Skip to content

Commit 1dee0d2

Browse files
committed
outland (without tests)
2 parents ac75d0b + 9c8debe commit 1dee0d2

74 files changed

Lines changed: 2570 additions & 159 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.coveragerc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[report]
2+
exclude_lines =
3+
pragma: no cover
4+
if TYPE_CHECKING:

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ A Hearthstone simulator and implementation, written in Python.
1010

1111
## Cards Implementation
1212

13-
Now updated to [Patch 16.6.0.43246](https://hearthstone.wiki.gg/wiki/Patch_16.6.0.43246)
14-
* **100%** Basic (142 of 142 cards)
15-
* **100%** Classic (245 of 245 cards)
16-
* **100%** Hall of Fame (24 of 24 cards)
13+
Now updated to [Patch 17.6.0.53261](https://hearthstone.wiki.gg/wiki/Patch_17.6.0.53261)
14+
* **100%** Basic (153 of 153 cards)
15+
* **100%** Classic (240 of 240 cards)
16+
* **100%** Hall of Fame (35 of 35 cards)
1717
* **100%** Curse of Naxxramas (30 of 30 cards)
1818
* **100%** Goblins vs Gnomes (123 of 123 cards)
1919
* **100%** Blackrock Mountain (31 of 31 cards)
2020
* **100%** The Grand Tournament (132 of 132 cards)
21-
* **100%** Hero Skins (30 of 30 cards)
21+
* **100%** Hero Skins (33 of 33 cards)
2222
* **100%** The League of Explorers (45 of 45 cards)
2323
* **100%** Whispers of the Old Gods (134 of 134 cards)
2424
* **100%** One Night in Karazhan (45 of 45 cards)
@@ -33,7 +33,9 @@ Now updated to [Patch 16.6.0.43246](https://hearthstone.wiki.gg/wiki/Patch_16.6.
3333
* **100%** Saviours of Uldum (135 of 135 cards)
3434
* **100%** Descent of Dragons (140 of 140 cards)
3535
* **100%** Galakrond's Awakening (35 of 35 cards)
36-
* **100%** Ashes of Outlands (1 of 1 card)
36+
* **100%** Ashes of Outlands (135 of 135 cards)
37+
* **100%** Scholomance Academy (1 of 1 card)
38+
* **100%** Demon Hunter Initiate (20 of 20 cards)
3739

3840
## Requirements
3941

fireplace/actions.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,7 +1592,7 @@ def do(self, source, target, amount):
15921592
return target
15931593

15941594

1595-
class SetTag(TargetedAction):
1595+
class SetTags(TargetedAction):
15961596
"""
15971597
Sets targets' given tags.
15981598
"""
@@ -1610,7 +1610,7 @@ def do(self, source, target, tags):
16101610
self.broadcast(source, EventListener.AFTER, target)
16111611

16121612

1613-
class UnsetTag(TargetedAction):
1613+
class UnsetTags(TargetedAction):
16141614
"""
16151615
Unset targets' given tags.
16161616
"""
@@ -1625,10 +1625,10 @@ def do(self, source, target, tags):
16251625

16261626
class GetTag(TargetedAction):
16271627
TARGET = ActionArg()
1628-
TAGS = ActionArg()
1628+
TAG = ActionArg()
16291629

1630-
def do(self, source, target, tags):
1631-
return [target.tags[tag] for tag in tags]
1630+
def do(self, source, target, tag):
1631+
return target.tags[tag]
16321632

16331633

16341634
class Silence(TargetedAction):
@@ -1892,6 +1892,11 @@ def choose_target(self, source, card):
18921892
return source.game.random.choice(card.targets)
18931893

18941894
def do(self, source, card, targets):
1895+
if source.type == CardType.MINION and (
1896+
source.dead or source.silenced or source.zone != Zone.PLAY
1897+
):
1898+
return
1899+
18951900
player = source.controller
18961901
old_choice = player.choice
18971902
player.choice = None

fireplace/cards/CardDefs.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:d4c29ef0c109574e5805c3414be11cd590d9388a4b3302e7ad162913e5009fba
3-
size 23853306
2+
oid sha256:7fccd87b7e20f9864fe0664aa9d9304213981dc6c883fe71010cceda1b9af7ac
3+
size 25601149

fireplace/cards/__init__.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,24 @@
44
from hearthstone import cardxml
55
from hearthstone.enums import CardSet, CardType, GameTag, Race, ZodiacYear
66

7+
from ..enums import BoardEnum
78
from ..logging import log
89
from ..utils import CARD_SETS
910

1011

11-
year = ZodiacYear.DRAGON
12+
year = ZodiacYear.PHOENIX
1213
default_language = "enUS"
14+
standard_board_skins = [
15+
BoardEnum.STORMWIND,
16+
BoardEnum.ORGRIMMAR,
17+
BoardEnum.PANDARIA,
18+
BoardEnum.STRANGLETHORN,
19+
BoardEnum.DALARAN,
20+
BoardEnum.ULDUM_TOMB,
21+
BoardEnum.ULDUM_CITY,
22+
BoardEnum.DRAGONBLIGHT,
23+
BoardEnum.OUTLAND,
24+
]
1325

1426

1527
def get_script_definition(id, card=None):

fireplace/cards/brawl/mechwar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class TB_MechWar_Boss1_HeroPower:
99
"""Hello! Hello! Hello!"""
1010

1111
requirements = {PlayReq.REQ_FRIENDLY_TARGET: 0, PlayReq.REQ_MINION_TARGET: 0}
12-
activate = SetTag(
12+
activate = SetTags(
1313
LOWEST_ATK(FRIENDLY_MINIONS), (GameTag.TAUNT, GameTag.DIVINE_SHIELD)
1414
)
1515

fireplace/cards/classic/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from .demonhunter import *
12
from .druid import *
23
from .hunter import *
34
from .mage import *
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
from ..utils import *
2+
3+
4+
##
5+
# Minions
6+
7+
8+
class BT_142:
9+
"""Shadowhoof Slayer"""
10+
11+
# <b>Battlecry:</b> Give your hero +1_Attack this turn.
12+
play = Buff(CONTROLLER, "BT_142e")
13+
14+
15+
BT_142e = buff(atk=1)
16+
17+
18+
class BT_323:
19+
"""Sightless Watcher"""
20+
21+
# <b>Battlecry:</b> Look at 3 cards in your deck. Choose one to put on top.
22+
play = Choice(CONTROLLER, RANDOM(DeDuplicate(FRIENDLY_DECK)) * 3).then(
23+
PutOnTop(CONTROLLER, Choice.CARD)
24+
)
25+
26+
27+
class BT_352:
28+
"""Satyr Overseer"""
29+
30+
# After your hero attacks, summon a 2/2 Satyr.
31+
events = Attack(FRIENDLY_HERO).after(Summon(CONTROLLER, "BT_352t"))
32+
33+
34+
class BT_495:
35+
"""Glaivebound Adept"""
36+
37+
# <b>Battlecry:</b> If your hero attacked this turn, deal 4 damage.
38+
requirements = {
39+
PlayReq.REQ_TARGET_IF_AVAILABLE_AND_HERO_ATTACKED_THIS_TURN: 0,
40+
}
41+
powered_up = NUM_ATTACKS_THIS_TURN(FRIENDLY_HERO) > 0
42+
play = Hit(TARGET, 4)
43+
44+
45+
##
46+
# Spells
47+
48+
49+
class BT_035:
50+
"""Chaos Strike"""
51+
52+
# Give your hero +2_Attack this turn. Draw a card.
53+
play = Buff(FRIENDLY_HERO, "BT_035e"), Draw(CONTROLLER)
54+
55+
56+
BT_035e = buff(atk=2)
57+
58+
59+
class BT_036:
60+
"""Coordinated Strike"""
61+
62+
# Summon three 1/1_Illidari with <b>Rush</b>.
63+
play = Summon(CONTROLLER, "BT_036t") * 3
64+
65+
66+
class BT_235:
67+
"""Chaos Nova"""
68+
69+
# Deal $4 damage to all_minions.
70+
play = Hit(ALL_MINIONS, 4)
71+
72+
73+
class BT_512:
74+
"""Inner Demon"""
75+
76+
# Give your hero +8_Attack this turn.
77+
play = Buff(FRIENDLY_HERO, "BT_512e")
78+
79+
80+
BT_512e = buff(atk=8)
81+
82+
83+
class BT_740:
84+
"""Soul Cleave"""
85+
86+
# <b>Lifesteal</b> Deal $2 damage to two random enemy minions.
87+
requirements = {PlayReq.REQ_MINIMUM_ENEMY_MINIONS: 1}
88+
play = Hit(RANDOM_ENEMY_MINION * 2, 2)

fireplace/cards/classic/neutral_epic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class EX1_590:
4949

5050
play = (
5151
Buff(SELF, "EX1_590e") * Count(ALL_MINIONS + DIVINE_SHIELD),
52-
UnsetTag(ALL_MINIONS, (GameTag.DIVINE_SHIELD,)),
52+
UnsetTags(ALL_MINIONS, (GameTag.DIVINE_SHIELD,)),
5353
)
5454

5555

fireplace/cards/classic/neutral_legendary.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ class EX1_577:
195195

196196

197197
class EX1_614:
198-
"""Illidan Stormrage"""
198+
"""Xavius"""
199199

200200
events = OWN_CARD_PLAY.on(Summon(CONTROLLER, "EX1_614t"))
201201

0 commit comments

Comments
 (0)