Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 54 additions & 11 deletions coc/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

class ExtendedEnum(Enum):
"""An Enum class that allows for the `__str__` method to be implemented."""

def __str__(self):
return self.in_game_name

Expand Down Expand Up @@ -62,7 +63,13 @@ class PlayerHouseElementType(ExtendedEnum):
@property
def in_game_name(self) -> str:
"""Get a neat client-facing string value for the element type."""
lookup = {"ground": "Ground", "roof": "Roof", "foot": "Foot", "decoration": "Decoration", "walls": "Walls"}
lookup = {
"ground": "Ground",
"roof": "Roof",
"foot": "Foot",
"decoration": "Decoration",
"walls": "Walls"
}
return lookup[self.value]


Expand All @@ -77,7 +84,12 @@ class Role(ExtendedEnum):
@property
def in_game_name(self) -> str:
"""Get a neat client-facing string value for the role."""
lookup = {"member": "Member", "admin": "Elder", "coLeader": "Co-Leader", "leader": "Leader"}
lookup = {
"member": "Member",
"admin": "Elder",
"coLeader": "Co-Leader",
"leader": "Leader"
}
return lookup[self.value]


Expand All @@ -103,7 +115,10 @@ class BattleModifier(ExtendedEnum):
@property
def in_game_name(self) -> str:
"""Get a neat client-facing string value for the battle modifier."""
lookup = {"none": "None", "hardMode": "Hard Mode"}
lookup = {
"none": "None",
"hardMode": "Hard Mode"
}
return lookup[self.value]


Expand All @@ -118,7 +133,12 @@ class WarState(ExtendedEnum):
@property
def in_game_name(self) -> str:
"""Get a neat client-facing string value for the war state."""
lookup = {"notInWar": "Not in War", "preparation": "Preparation", "inWar": "In War", "warEnded": "War Ended"}
lookup = {
"notInWar": "Not in War",
"preparation": "Preparation",
"inWar": "In War",
"warEnded": "War Ended"
}
return lookup[self.value]


Expand All @@ -131,7 +151,11 @@ class WarResult(ExtendedEnum):
@property
def in_game_name(self) -> str:
"""Get a neat client-facing string value for the war state."""
lookup = {"win": "Win", "lose": "Lose", "tie": "Tie"}
lookup = {
"win": "Win",
"lose": "Lose",
"tie": "Tie"
}
return lookup[self.value]


Expand All @@ -148,9 +172,16 @@ class Resource(ExtendedEnum):
@property
def in_game_name(self) -> str:
"""Get a neat client-facing string value for the resource."""
lookup = {"Elixir": "Elixir", "Elixir2": "Builder Elixir",
"DarkElixir": "Dark Elixir", "Gold": "Gold", "Gold2": "Builder Gold",
"CommonOre": "Shiny Ore", "RareOre": "Glowy Ore", "EpicOre": "Starry Ore"}
lookup = {
"Elixir": "Elixir",
"Elixir2": "Builder Elixir",
"DarkElixir": "Dark Elixir",
"Gold": "Gold",
"Gold2": "Builder Gold",
"CommonOre": "Shiny Ore",
"RareOre": "Glowy Ore",
"EpicOre": "Starry Ore"
}
return lookup[self.value]


Expand Down Expand Up @@ -188,6 +219,7 @@ def in_game_name(self) -> str:
"Headhunter",
"Apprentice Warden",
"Druid",
"Furnace"
]

SIEGE_MACHINE_ORDER = [
Expand Down Expand Up @@ -265,8 +297,18 @@ def in_game_name(self) -> str:

SPELL_ORDER = ELIXIR_SPELL_ORDER + DARK_ELIXIR_SPELL_ORDER

HOME_BASE_HERO_ORDER = ["Barbarian King", "Archer Queen", "Minion Prince", "Grand Warden", "Royal Champion"]
BUILDER_BASE_HERO_ORDER = ["Battle Machine", "Battle Copter"]
HOME_BASE_HERO_ORDER = [
"Barbarian King",
"Archer Queen",
"Minion Prince",
"Grand Warden",
"Royal Champion"
]
BUILDER_BASE_HERO_ORDER = [
"Battle Machine",
"Battle Copter"
]

HERO_ORDER = HOME_BASE_HERO_ORDER + BUILDER_BASE_HERO_ORDER

PETS_ORDER = [
Expand All @@ -280,6 +322,7 @@ def in_game_name(self) -> str:
"Phoenix",
"Spirit Fox",
"Angry Jelly",
"Sneezy"
]

EQUIPMENT = [
Expand Down Expand Up @@ -363,7 +406,7 @@ def in_game_name(self) -> str:
"Next Generation Model",
"Un-Build It",
"Champion Builder",

# Clan Capital
"Aggressive Capitalism",
"Most Valuable Clanmate",
Expand Down
127 changes: 126 additions & 1 deletion coc/static/characters.json
Original file line number Diff line number Diff line change
Expand Up @@ -15432,5 +15432,130 @@
"EnemyGroupWeight": 800,
"TriggersTraps": true,
"PreviewScenario": "TroopMinionBodyguard"
},
"Furnace": {
"1": {
"VisualLevel": 1,
"LaboratoryLevel": 13,
"Hitpoints": 1530,
"UpgradeTimeH": 288,
"UpgradeCost": 200000,
"DPS": 0,
"SecondarySpawnDist": 150,
"SummonTroopCount": 1,
"SummonTime": 875,
"SummonCooldown": 7000,
"SummonLimit": 19
},
"2": {
"VisualLevel": 2,
"LaboratoryLevel": 14,
"Hitpoints": 1620,
"UpgradeTimeH": 336,
"UpgradeCost": 260000,
"DPS": 0,
"SecondarySpawnDist": 150,
"SummonTroopCount": 1,
"SummonTime": 875,
"SummonCooldown": 7000,
"SummonLimit": 20
},
"3": {
"VisualLevel": 3,
"LaboratoryLevel": 15,
"Hitpoints": 1710,
"UpgradeTimeH": 384,
"UpgradeCost": 320000,
"DPS": 0,
"SecondarySpawnDist": 150,
"SummonTroopCount": 1,
"SummonTime": 875,
"SummonCooldown": 7000,
"SummonLimit": 21
},
"4": {
"VisualLevel": 4,
"LaboratoryLevel": 15,
"Hitpoints": 1800,
"UpgradeTimeH": 384,
"UpgradeCost": 320000,
"DPS": 0,
"SecondarySpawnDist": 150,
"SummonTroopCount": 1,
"SummonTime": 875,
"SummonCooldown": 7000,
"SummonLimit": 22
},
"Name": "Furnace",
"TID": "TID_FURNACE",
"InfoTID": "TID_CHARACTER_INFO_FURNACE",
"HousingSpace": 18,
"BarrackLevel": 12,
"Speed": 0,
"UpgradeResource": "DarkElixir",
"DonateCost": 6,
"PreferedTargetDamageMod": 1,
"IconSWF": "sc/ui.sc",
"IconExportName": "icon_unit_furnace",
"BigPicture": "unit_furnace_big",
"BigPictureSWF": "sc/info_furnace.sc",
"DeployEffect": "Furnace Deploy",
"HitEffect": "Furnace Hit",
"IsFlying": false,
"AirTargets": true,
"GroundTargets": true,
"DieEffect": "Furnace Die",
"ProductionBuilding": "Dark Elixir Barrack",
"IsJumper": false,
"MovementOffsetSpeed": 0,
"TombStone": "DarkTombStone",
"SummonTroop": "Furnace Firemite",
"SummonEffect": "Furnace Summon",
"TargetedEffectOffset": -50,
"FriendlyGroupWeight": 1200,
"EnemyGroupWeight": 200,
"TriggersTraps": true,
"PreviewScenario": "TroopGroundAny3"
},
"Furnace Firemite": {
"1": {
"Name": "Firemite",
"VisualLevel": 1,
"TID": "TID_FURNACE_FIREMITE",
"InfoTID": "TID_CHARACTER_INFO_FURNACE_FIREMITE",
"HousingSpace": 1,
"BarrackLevel": 1,
"LaboratoryLevel": 1,
"Speed": 32,
"Hitpoints": 250,
"AttackRange": 2.5,
"AttackSpeed": 1000,
"DPS": 25,
"PreferedTargetDamageMod": 1,
"IconSWF": "sc/ui.sc",
"IconExportName": "icon_unit_firemite",
"BigPicture": "unit_firemite_big",
"BigPictureSWF": "sc/info_firemite.sc",
"DeployEffect": "Firemite Deploy",
"AttackEffect": "Firemite Attack",
"HitEffect": "Firemite Hit",
"IsFlying": false,
"AirTargets": false,
"GroundTargets": true,
"DieEffect": "Firemite Die",
"Animation": "Firemite",
"IsJumper": true,
"MovementOffsetSpeed": 0,
"DisableProduction": true,
"IsSecondaryTroop": true,
"SpawnIdle": 500,
"TargetedEffectOffset": -50,
"FriendlyGroupWeight": 50,
"EnemyGroupWeight": 100,
"TriggersTraps": false,
"DoesNotOpenCC": true,
"HealerWeight": 0,
"PreviewScenario": "SecondaryTroop"
}
}
}
}
Loading