Skip to content

Caesar723/Territory-War-A-Card-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Territory War

How to use it

use pip3 to install django and channels:
pip3 install Django
pip3 install channels

go to CardGame/first/consumers.py and go to Line 36
change the path which contain “first” folder example

To create database , first , install mysql.connector
pip3 install mysql-connector-python
go to CardGame/first/Database.py use function
createDatabase()
createPasswordTable()
creatCardTable()

change the path which contain manage.py file
python3.9 manage.py runserver




Game's content

example

When you in this game , you must register a account number , click '注册'.
example

And then you can access this game.
example

In this game you can click '新建套牌' to create a deck.
example

After creating a deck, you can click '匹配' to match a opponent, waiting for the opponent.
example BACON 2022-09-09 19 47 27






## How to diy a card go to /CardGame/first/father.py
you will see the **superclass** of the card called **card**
It have and function, **Rcost()** is to output the the final cost
such as **['g','g','g','g','g']**
It means this card have **5 green**
![example](http://tiebapic.baidu.com/forum/pic/item/8a72f6dde71190ef6d87ae0e8b1b9d16fcfa60ad.jpg)
This is the cost bar **5 green** means your cost bar must have a number greater than 5 in the last row


There are three subclass **servent** **magic** **ground** , ignore the shelter
you can see there are lots of function in **servent**
![example](http://tiebapic.baidu.com/forum/pic/item/f871bcc379310a553857e225f24543a9832610b2.jpg)
you can over override:
**ZhanHong(self,MyMaster,Master,selectIndex=None):# when use servent the function is used**
**WangYu(self,MyMaster,Master): # when servent is die function is uesd**
**WhenBeAttack(self,MyMaster,Master,otherServent):# when serveny be attack use this function**
**whenSendData(self,MyMaster,Master):#used to make Aura**
**whenTermFinish(self,MyMaster,Master):# when round finish use this function**


The class called **Master** is protagonist
The **live** is your live
**groundList** is your cost bar
**cardHand** **cardGround** **cardStorage** **tomb** all store **card** object
**cardHand** store the cards in your hand
**cardGround** store the cards in your Battle field
**cardStorage** store the cards in your cards library
**tomb** store the **servant** who have been died
**getCard(self,num):** is to draw a card , it will return the array which contain the objects you get


Now start to make a card, go to /CardGame/first/cardServent.py
This is the example
![example](http://tiebapic.baidu.com/forum/pic/item/12d2197b02087bf4be8f6b38b7d3572c10dfcf43.jpg)
you must override the founction to create the skill
**warning**: your subclass name must the same as your cards **name**

About

This is the card game like HearthStone and Magic . If your want to look click this: http://35167eu292.zicp.vip

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published