am I actually working on this project again
This commit is contained in:
26
basegame.py
26
basegame.py
@@ -9,6 +9,7 @@ class Card:
|
|||||||
class Player:
|
class Player:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.name = "Player"
|
self.name = "Player"
|
||||||
|
self.ownedStarters = []
|
||||||
self.ownedCitizens = []
|
self.ownedCitizens = []
|
||||||
self.ownedDomains = []
|
self.ownedDomains = []
|
||||||
self.dukes = []
|
self.dukes = []
|
||||||
@@ -23,28 +24,28 @@ class Player:
|
|||||||
self.workerCount = 0
|
self.workerCount = 0
|
||||||
def display(self):
|
def display(self):
|
||||||
print(self.name)
|
print(self.name)
|
||||||
print("Gold: {} Strength: {} Magic: {}".format(self.goldScore, self.strengthScore, self.magicScore))
|
print(f"Gold: {self.goldScore} Strength: {self.strengthScore} Magic: {self.magicScore}")
|
||||||
print("Citizens: {} Monsters: {} Domains: {}".format(len(self.ownedCitizens), len(self.ownedMonsters), len(self.ownedDomains)))
|
print(f"Citizens: {len(self.ownedCitizens)} Monsters: {len(self.ownedMonsters)} Domains: {len(self.ownedDomains)}")
|
||||||
if self.shadowCount != 0:
|
if self.shadowCount != 0:
|
||||||
tempChar = ''
|
tempChar = ''
|
||||||
if self.shadowCount > 1:
|
if self.shadowCount > 1:
|
||||||
tempChar = 's'
|
tempChar = 's'
|
||||||
print("{} Shadow icon{}".format(self.shadowCount, tempChar))
|
print(f"{self.shadowCount} Shadow icon{tempChar}")
|
||||||
if self.holyCount != 0:
|
if self.holyCount != 0:
|
||||||
tempChar = ''
|
tempChar = ''
|
||||||
if self.holyCount > 1:
|
if self.holyCount > 1:
|
||||||
tempChar = 's'
|
tempChar = 's'
|
||||||
print("{} Holy icon{}".format(self.holyCount, tempChar))
|
print(f"{self.holyCount} Holy icon{tempChar}")
|
||||||
if self.soldierCount != 0:
|
if self.soldierCount != 0:
|
||||||
tempChar = ''
|
tempChar = ''
|
||||||
if self.soldierCount > 1:
|
if self.soldierCount > 1:
|
||||||
tempChar = 's'
|
tempChar = 's'
|
||||||
print("{} Soldier icon{}".format(self.soldierCount, tempChar))
|
print(f"{self.soldierCount} Soldier icon{tempChar}")
|
||||||
if self.workerCount != 0:
|
if self.workerCount != 0:
|
||||||
tempChar = ''
|
tempChar = ''
|
||||||
if self.workerCount > 1:
|
if self.workerCount > 1:
|
||||||
tempChar = 's'
|
tempChar = 's'
|
||||||
print("{} Worker icon{}".format(self.workerCount, tempChar))
|
print(f"{self.workerCount} Worker icon{tempChar}")
|
||||||
def calc_roles(self):
|
def calc_roles(self):
|
||||||
for citizen in self.ownedCitizens:
|
for citizen in self.ownedCitizens:
|
||||||
self.shadowCount = self.shadowCount + citizen.shadowCount
|
self.shadowCount = self.shadowCount + citizen.shadowCount
|
||||||
@@ -310,10 +311,10 @@ class Board:
|
|||||||
self.dieOne = random.randint(1, 6)
|
self.dieOne = random.randint(1, 6)
|
||||||
self.dieTwo = random.randint(1, 6)
|
self.dieTwo = random.randint(1, 6)
|
||||||
self.dieSum = self.dieOne + self.dieTwo
|
self.dieSum = self.dieOne + self.dieTwo
|
||||||
print("{} | {} | {}".format(self.dieOne, self.dieTwo, self.dieSum))
|
print(f"{self.dieOne} | {self.dieTwo} | {self.dieSum}")
|
||||||
for citizen in self.playerList[0].ownedCitizens:
|
for citizen in self.playerList[0].ownedCitizens:
|
||||||
if (citizen.rollMatch1 == self.dieOne) or (citizen.rollMatch1 == self.dieTwo) or (citizen.rollMatch1 == self.dieSum) or (citizen.rollMatch2 == self.dieSum):
|
if (citizen.rollMatch1 == self.dieOne) or (citizen.rollMatch1 == self.dieTwo) or (citizen.rollMatch1 == self.dieSum) or (citizen.rollMatch2 == self.dieSum):
|
||||||
print("{} Payout".format(citizen.name))
|
print(f"{citizen.name} Payout")
|
||||||
self.playerList[0].goldScore = self.playerList[0].goldScore + citizen.goldPayoutOnTurn
|
self.playerList[0].goldScore = self.playerList[0].goldScore + citizen.goldPayoutOnTurn
|
||||||
self.playerList[0].strengthScore = self.playerList[0].strengthScore + citizen.strengthPayoutOnTurn
|
self.playerList[0].strengthScore = self.playerList[0].strengthScore + citizen.strengthPayoutOnTurn
|
||||||
self.playerList[0].magicScore = self.playerList[0].magicScore + citizen.magicPayoutOnTurn
|
self.playerList[0].magicScore = self.playerList[0].magicScore + citizen.magicPayoutOnTurn
|
||||||
@@ -322,15 +323,22 @@ class Board:
|
|||||||
for player in listIterator:
|
for player in listIterator:
|
||||||
for citizen in player.ownedCitizens:
|
for citizen in player.ownedCitizens:
|
||||||
if (citizen.rollMatch1 == self.dieOne) or (citizen.rollMatch1 == self.dieTwo) or (citizen.rollMatch1 == self.dieSum) or (citizen.rollMatch2 == self.dieSum):
|
if (citizen.rollMatch1 == self.dieOne) or (citizen.rollMatch1 == self.dieTwo) or (citizen.rollMatch1 == self.dieSum) or (citizen.rollMatch2 == self.dieSum):
|
||||||
print("{} Payout".format(citizen.name))
|
print(f"{citizen.name} Payout")
|
||||||
player.goldScore = player.goldScore + citizen.goldPayoutOffTurn
|
player.goldScore = player.goldScore + citizen.goldPayoutOffTurn
|
||||||
player.strengthScore = player.strengthScore + citizen.strengthPayoutOffTurn
|
player.strengthScore = player.strengthScore + citizen.strengthPayoutOffTurn
|
||||||
player.magicScore = player.magicScore + citizen.magicPayoutOffTurn
|
player.magicScore = player.magicScore + citizen.magicPayoutOffTurn
|
||||||
|
|
||||||
def play_turn(self):
|
def play_turn(self):
|
||||||
|
self.display()
|
||||||
print("new turn")
|
print("new turn")
|
||||||
print("roll phase")
|
print("roll phase")
|
||||||
self.roll_phase()
|
self.roll_phase()
|
||||||
|
|
||||||
|
def display(self):
|
||||||
|
for player in self.playerList:
|
||||||
|
player.display()
|
||||||
|
|
||||||
def end_check(self):
|
def end_check(self):
|
||||||
if self.exhaustedCount <= (self.playerCount*2):
|
if self.exhaustedCount <= (self.playerCount*2):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|||||||
26
create_starters_table.sql
Normal file
26
create_starters_table.sql
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
CREATE TABLE vckonline.starters (
|
||||||
|
idstarters int(11) auto_increment NOT NULL,
|
||||||
|
name varchar(45) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
|
||||||
|
gold_cost int(11) NOT NULL,
|
||||||
|
roll_match1 int(11) NOT NULL,
|
||||||
|
roll_match2 int(11) DEFAULT 0 NULL,
|
||||||
|
shadow_count int(11) DEFAULT 0 NOT NULL,
|
||||||
|
holy_count int(11) DEFAULT 0 NOT NULL,
|
||||||
|
soldier_count int(11) DEFAULT 0 NOT NULL,
|
||||||
|
worker_count int(11) DEFAULT 0 NOT NULL,
|
||||||
|
gold_payout_on_turn int(11) DEFAULT 0 NOT NULL,
|
||||||
|
gold_payout_off_turn int(11) DEFAULT 0 NOT NULL,
|
||||||
|
strength_payout_on_turn int(11) DEFAULT 0 NOT NULL,
|
||||||
|
strength_payout_off_turn int(11) DEFAULT 0 NOT NULL,
|
||||||
|
magic_payout_on_turn int(11) DEFAULT 0 NOT NULL,
|
||||||
|
magic_payout_off_turn int(11) DEFAULT 0 NOT NULL,
|
||||||
|
has_special_payout_on_turn tinyint(4) DEFAULT 0 NOT NULL,
|
||||||
|
has_special_payout_off_turn tinyint(4) DEFAULT 0 NOT NULL,
|
||||||
|
special_payout_on_turn mediumtext CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL NULL,
|
||||||
|
special_payout_off_turn mediumtext CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL NULL,
|
||||||
|
special_citizen tinyint(4) DEFAULT 0 NOT NULL,
|
||||||
|
PRIMARY KEY (idstarters)
|
||||||
|
)
|
||||||
|
ENGINE=InnoDB
|
||||||
|
DEFAULT CHARSET=latin1
|
||||||
|
COLLATE=latin1_swedish_ci;
|
||||||
40
insert_citizen.sql
Normal file
40
insert_citizen.sql
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
INSERT INTO `vckonline`.`citizens`
|
||||||
|
(`name`,
|
||||||
|
`gold_cost`,
|
||||||
|
`roll_match1`,
|
||||||
|
`roll_match2`,
|
||||||
|
`shadow_count`,
|
||||||
|
`holy_count`,
|
||||||
|
`soldier_count`,
|
||||||
|
`worker_count`,
|
||||||
|
`gold_payout_on_turn`,
|
||||||
|
`gold_payout_off_turn`,
|
||||||
|
`strength_payout_on_turn`,
|
||||||
|
`strength_payout_off_turn`,
|
||||||
|
`magic_payout_on_turn`,
|
||||||
|
`magic_payout_off_turn`,
|
||||||
|
`has_special_payout_on_turn`,
|
||||||
|
`has_special_payout_off_turn`,
|
||||||
|
`special_payout_on_turn`,
|
||||||
|
`special_payout_off_turn`,
|
||||||
|
`special_citizen`)
|
||||||
|
VALUES
|
||||||
|
('',/*name*/
|
||||||
|
,/*gold_cost*/
|
||||||
|
,/*roll_match1*/
|
||||||
|
,/*roll_match2*/
|
||||||
|
,/*shadow_count*/
|
||||||
|
,/*holy_count*/
|
||||||
|
,/*soldier_count*/
|
||||||
|
,/*worker_count*/
|
||||||
|
,/*gold_payout_on_turn*/
|
||||||
|
,/*gold_payout_off_turn*/
|
||||||
|
,/*strength_payout_on_turn*/
|
||||||
|
,/*strength_payout_off_turn*/
|
||||||
|
,/*magic_payout_on_turn*/
|
||||||
|
,/*magic_payout_off_turn*/
|
||||||
|
,/*has_special_payout_on_turn*/
|
||||||
|
,/*has_special_payout_off_turn*/
|
||||||
|
,/*special_payout_on_turn*/
|
||||||
|
,/*special_payout_off_turn*/
|
||||||
|
/*special_citizen*/);
|
||||||
32
insert_duke.sql
Normal file
32
insert_duke.sql
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
INSERT INTO `vckonline`.`dukes`
|
||||||
|
(`name`,
|
||||||
|
`gold_mult`,
|
||||||
|
`strength_mult`,
|
||||||
|
`magic_mult`,
|
||||||
|
`shadow_mult`,
|
||||||
|
`holy_mult`,
|
||||||
|
`soldier_mult`,
|
||||||
|
`worker_mult`,
|
||||||
|
`monster_mult`,
|
||||||
|
`citizen_mult`,
|
||||||
|
`domain_mult`,
|
||||||
|
`boss_mult`,
|
||||||
|
`minion_mult`,
|
||||||
|
`beast_mult`,
|
||||||
|
`titan_mult`)
|
||||||
|
VALUES
|
||||||
|
('',/*name*/
|
||||||
|
,/*gold_mult*/
|
||||||
|
,/*strength_mult*/
|
||||||
|
,/*magic_mult*/
|
||||||
|
,/*shadow_mult*/
|
||||||
|
,/*holy_mult*/
|
||||||
|
,/*soldier_mult*/
|
||||||
|
,/*worker_mult*/
|
||||||
|
,/*monster_mult*/
|
||||||
|
,/*citizen_mult*/
|
||||||
|
,/*domain_mult*/
|
||||||
|
,/*boss_mult*/
|
||||||
|
,/*minion_mult*/
|
||||||
|
,/*beast_mult*/
|
||||||
|
/*titan_mult*/);
|
||||||
26
insert_monster.sql
Normal file
26
insert_monster.sql
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
INSERT INTO `vckonline`.`monsters`
|
||||||
|
(`name`,
|
||||||
|
`area`,
|
||||||
|
`type`,
|
||||||
|
`order`,
|
||||||
|
`strength_cost`,
|
||||||
|
`magic_cost`,
|
||||||
|
`vp_reward`,
|
||||||
|
`gold_reward`,
|
||||||
|
`strength_reward`,
|
||||||
|
`magic_reward`,
|
||||||
|
`has_special_reward`,
|
||||||
|
`is_extra`)
|
||||||
|
VALUES
|
||||||
|
('',/*name*/
|
||||||
|
'',/*area*/
|
||||||
|
'',/*type*/
|
||||||
|
,/*order*/
|
||||||
|
,/*strength_cost*/
|
||||||
|
,/*magic_cost*/
|
||||||
|
,/*vp_reward*/
|
||||||
|
,/*gold_reward*/
|
||||||
|
,/*strength_reward*/
|
||||||
|
,/*magic_reward*/
|
||||||
|
,/*has_special_reward*/
|
||||||
|
/*is_extra*/);
|
||||||
40
insert_starter.sql
Normal file
40
insert_starter.sql
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
INSERT INTO `vckonline`.`starters`
|
||||||
|
(`name`,
|
||||||
|
`gold_cost`,
|
||||||
|
`roll_match1`,
|
||||||
|
`roll_match2`,
|
||||||
|
`shadow_count`,
|
||||||
|
`holy_count`,
|
||||||
|
`soldier_count`,
|
||||||
|
`worker_count`,
|
||||||
|
`gold_payout_on_turn`,
|
||||||
|
`gold_payout_off_turn`,
|
||||||
|
`strength_payout_on_turn`,
|
||||||
|
`strength_payout_off_turn`,
|
||||||
|
`magic_payout_on_turn`,
|
||||||
|
`magic_payout_off_turn`,
|
||||||
|
`has_special_payout_on_turn`,
|
||||||
|
`has_special_payout_off_turn`,
|
||||||
|
`special_payout_on_turn`,
|
||||||
|
`special_payout_off_turn`,
|
||||||
|
`special_citizen`)
|
||||||
|
VALUES
|
||||||
|
('Peasant',/*name*/
|
||||||
|
0,/*gold_cost*/
|
||||||
|
5,/*roll_match1*/
|
||||||
|
0,/*roll_match2*/
|
||||||
|
0,/*shadow_count*/
|
||||||
|
0,/*holy_count*/
|
||||||
|
0,/*soldier_count*/
|
||||||
|
0,/*worker_count*/
|
||||||
|
1,/*gold_payout_on_turn*/
|
||||||
|
1,/*gold_payout_off_turn*/
|
||||||
|
0,/*strength_payout_on_turn*/
|
||||||
|
0,/*strength_payout_off_turn*/
|
||||||
|
0,/*magic_payout_on_turn*/
|
||||||
|
0,/*magic_payout_off_turn*/
|
||||||
|
0,/*has_special_payout_on_turn*/
|
||||||
|
0,/*has_special_payout_off_turn*/
|
||||||
|
0,/*special_payout_on_turn*/
|
||||||
|
0,/*special_payout_off_turn*/
|
||||||
|
1/*special_citizen*/);
|
||||||
Reference in New Issue
Block a user