fireplace
fireplace copied to clipboard
Make unstealthing a game rule event
See a2cc6bcbc9ca7a5c889fc0c6f676e41568beab8c for the current hack.
Video of stealth internals: https://www.youtube.com/watch?v=0dSa0MiKEZU
Draft of something that might work:
@tag_rules(GameTag.STEALTH)
class Stealth:
events = (
Attack(SELF).on(Unstealth(SELF)),
Hit(source=SELF).on(Unstealth(SELF))
)
@tag_rules(GameTag.POISONOUS)
class Poisonous:
events = (
Damage(MINION, source=SELF).on(Destroy(Damage.Args.TARGETS))
)
@tag_rules(GameTag.DURABILITY)
class Weapon:
events = (
Attack(FRIENDLY_HERO).on(Hit(SELF, 1))
)
Sidenote, should make Stealth / Unstealth, Freeze / Unfreeze etc actions. Can easily make them lambdas of SetTag.
We could also also make Secret exhausting/unexhausting a game rule.
Whenever the engine can take care of something implicitly, that's a lot better because it's a lot more performant. Currently, secret.exhausted is set when it's not your turn. Maybe we just need to set CANT_EXHAUST to competitive spirit.
Is it so much worse? I assume it just registers an event listener, so overall ~~startup time~~ secret play may be slower, but it should be similar in runtime. If we register exhausting on turn end and unexhausting on turn start it should be similar, performance-wise.
It adds time on every turn end / turn begin.