Refactored AttackConfirmed and blockers list initialization + admin messages QoL improvements #315
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refactored fx.AttackConfirmed usages inside fx.Creature handle of AttackPlayer and AttackCreature, so fx.WheneverThisAttacks can be removed (and all of the other helper functions that were introduced in order for WheneverThisAttacks to actually work).
Essentially, both AttackConfirmed and WheneverThisAttacks served the same purpose, to handle attacking effects that happened right after the attack was confirmed (i.e. player chooses what shield / what creature to attack and commits the attack, i.e. action is NOT cancellable anymore) as per DM rules.
Also, introduced a new "step" event, BlockerSelectionStep, that serves as a helper step right before the opponent is prompted to select a blocker before the battle / shield brake to happen. This new "step" event is used in order to modify "in-place" the blockers list from the parent event, i.e. AttackPlayer or AttackCreature. Also, this new event is also used to handle conditional CantBeBlocked effects more easily.
Finally, I improved the admin messages handler with some QoL additions for faster debugging and initialization of the cards in the playzones. They reduce the number of commands one has to write in order to actually create a "playable" match context, i.e. populate different zones (hand, mana, shields, deck) very easily with a lot of different cards.
P.S. It is my first PR here, so please feel free to comment anything you think, I am eager to learn and to accept every kind of comment.
P.S. 2: Here is a non-exhaustive list of cards that I thought would be affected by the changes. I tested them (not very much though, please feel free to test yourself by cloning this branch from my public repo) and for me they seemed fine.
TOEL VIZIER OF HOPE
AMBER PIERCER
SILVER AXE
DARK TITAN MAGINN
PLASMA CHASER
HORRID WORM
PSYSHROOM
GAMIL
SNIPER MOSQUITO
EARTHSTOMP GIANT
THREE-EYED DRAGONFLY
BLOODWIG MANTIS
METALWING SKYTERROR
STAINED GLASS
WYN THE ORACLE
CURIOUS EYE
Armored Warrior Quelos
MURAMASA, DUKE OF BLADES
KING NEPTAS
LE QUIST THE ORACLE
DAIDALOS GENERAL OF FURY
Geoshine Spectral Knight
Necrodragon Galbazeek
HEADLONG GIANT
Tower Shell
Stampeding Longhorn
Xeno Mantis
Masked Pomegranate
Ultra Mantis, Scourge of Fate
Clobber Totem