durand_shield
Shield processing *An object to take the hit for us when using the Durand's defense mode. It is spawned in during the durand's initilization, and always stays on the same tile. Normally invisible, until defense mode is actvated. When the durand detects an attack that should be blocked, the attack is passed to the shield. The shield takes the damage, uses it to calculate charge cost, and then sets its own integrity back to max. Shield is automatically dropped if we run out of power or the user gets out.
Vars | |
chassis | Our link back to the durand |
---|---|
switching | To keep track of things during the animation |
Procs | |
activate | Handles activating and deactivating the shield. |
make_invisible | Sets invisibility to INVISIBILITY_MAXIMUM if defense mode is disabled |
Var Details
chassis
Our link back to the durand
switching
To keep track of things during the animation
Proc Details
activate
Handles activating and deactivating the shield.
This proc is called by a signal sent from the mech's action button and
relayed by the mech itself. The "forced" variable, signal_args[1]
, will
skip the to-pilot text and is meant for when the shield is disabled by
means other than the action button (like running out of power).
Arguments:
- source: the shield
- owner: mob that activated the shield
- signal_args: whether it's forced
make_invisible
Sets invisibility to INVISIBILITY_MAXIMUM if defense mode is disabled
We need invisibility set to higher than 25 for the shield to not appear in the right-click context menu, but if we do it too early, we miss the deactivate animation. Hense, timer and this proc.