Against Buggy Mutants - not even Guarding will save you
- Kevin G
- Sep 2, 2017
- 2 min read
The new Guard feature is near complete.

(Don't mind the gif artifacts - I'm not sure why GifCam does that)
Guarding (Gold Box Style++)
The game will now allow you to spend action points to guard with one or more weapons attacks. The number of readied attacks is only limited by your action point total. When an enemy enters your weapon reach, you attack first (gold box game style) It's setup right now so that all your guarding attacks fire off at the triggering enemy. I might change that by giving the player an option or only allow one attack per enemy.
How does it work?
Coding this was really f-ing complicated too, especially when several units are guarding the same square. Without the internal Event Messaging System I created, the task would be near impossible. I had to make a TileGuarder class that listened for a number of different events. The basic sequence of events is as follows.
The TileGuarder listens for unit location changed events
If a guard is triggered the moving unit is told to end its movement and pause.
The TileGuarder issues a guard attack request to each unit guarding the location
The guarding unit issues an attack normally and the attack is handled like any other.
The guarding unit issues an guard attack completed message
When the TileGuarder receives a GuardAttackCompleted message the attacker is told to stop guarding
When all guarding units have completed their guard attacks the target is told to unpause.
And this doesn't deal with death correctly. An overwatch ability (guarding with ranged weapons) is next on my hit list. Hopefully both systems will play nicely together.
Poor Adam, not even his new guard attack could save him. And the Mutants first attack bugged out. LOL

Comments