code/__DEFINES/combat/block.dm
mob_check_block | Check whether or not we can block, without "triggering" a block. Basically run checks without effects like depleting shields. Wrapper for do_run_block(). The arguments on that means the same as for this. |
---|---|
mob_run_block | Runs a block "sequence", effectively checking and then doing effects if necessary. Wrapper for do_run_block(). The arguments on that means the same as for this. |
BLOCK_NONE | Bitflags for check_block() and handle_block(). Meant to be combined. You can be hit and still reflect, for example, if you do not use BLOCK_SUCCESS. Attack was not blocked |
BLOCK_SUCCESS | Attack was blocked, do not do damage. THIS FLAG MUST BE THERE FOR DAMAGE/EFFECT PREVENTION! |
BLOCK_SHOULD_REDIRECT | The below are for "metadata" on "how" the attack was blocked. Attack was and should be redirected according to list argument REDIRECT_METHOD (NOTE: the SHOULD here is important, as it says "the thing blocking isn't handling the reflecting for you so do it yourself"!) |
BLOCK_REDIRECTED | Attack was redirected (whether by us or by SHOULD_REDIRECT flagging for automatic handling) |
BLOCK_PHYSICAL_EXTERNAL | Attack was blocked by something like a shield. |
BLOCK_PHYSICAL_INTERNAL | Attack was blocked by something worn on you. |
BLOCK_TARGET_DODGED | Attack outright missed because the target dodged. Should usually be combined with redirection passthrough or something (see martial arts) |
BLOCK_CONTINUE_CHAIN | Meta-flag for run_block/do_run_block : By default, BLOCK_SUCCESS tells do_run_block() to assume the attack is completely blocked and not continue the block chain. If this is present, it will continue to check other items in the chain rather than stopping. |
BLOCK_SHOULD_CHANGE_DAMAGE | Attack should change the amount of damage incurred. This means something calling run_block() has to handle it! |
BLOCK_SHOULD_PARTIAL_MITIGATE | Attack should scale by this percent, 0 for no block and 100 for full blocked |
BLOCK_RETURN_REDIRECT_METHOD | For keys in associative list/block_return as we don't want to saturate our (somewhat) limited flags. |
REDIRECT_METHOD_PASSTHROUGH | Pass through victim |
REDIRECT_METHOD_DEFLECT | Deflect at randomish angle |
REDIRECT_METHOD_REFLECT | reverse 180 angle, basically (as opposed to "realistic" wall reflections) |
REDIRECT_METHOD_RETURN_TO_SENDER | "do not taser the bad man with the desword" - actually aims at the firer/attacker rather than just reversing |
BLOCK_RETURN_REFLECT_PROJECTILE_CHANCE | These keys are generally only applied to the list if real_attack is FALSE. Used incase we want to make "smarter" mob AI in the future or something. Tells the caller how likely from 0 (none) to 100 (always) we are to reflect energy projectiles |
BLOCK_RETURN_NORMAL_BLOCK_CHANCE | Tells the caller how likely we are to block attacks from 0 to 100 in general |
BLOCK_RETURN_BLOCK_CAPACITY | Tells the caller about how many hits we can soak on average before our blocking fails. |
BLOCK_RETURN_ACTIVE_BLOCK | Tells the caller we got blocked by active directional block. |
BLOCK_RETURN_ACTIVE_BLOCK_DAMAGE_MITIGATED | Tells the caller our damage mitigation for their attack. |
BLOCK_RETURN_SET_DAMAGE_TO | For [BLOCK_CHANGE_DAMAGE]. Set damage to this. |
BLOCK_RETURN_MITIGATION_PERCENT | For BLOCK_SHOULD_PARTIAL_MITIGATE. Percentage mitigation. |
BLOCK_RETURN_OVERRIDE_PARRY_EFFICIENCY | Used internally by run_parry proc, use on an on_active_parry() proc to override parrying efficiency. |
BLOCK_RETURN_FORCE_NO_PARRY_COUNTERATTACK | Used internally by run_parry proc, use on an on_active_parry() proc to prevent counterattacks |
BLOCK_RETURN_PROJECTILE_BLOCK_PERCENTAGE | Always set to 100 by run_block() if BLOCK_SUCCESS is in return value. Otherwise, defaults to mitigation percent if not set. Used by projectile/proc/on_hit(). |
DEFAULT_REDIRECT_METHOD_PROJECTILE | Default if the above isn't set in the list. |
BLOCK_PRIORITY_ACTIVE_BLOCK | Block priorities. Higher means it's checked sooner. |
Define Details
BLOCK_CONTINUE_CHAIN
Meta-flag for run_block/do_run_block : By default, BLOCK_SUCCESS tells do_run_block() to assume the attack is completely blocked and not continue the block chain. If this is present, it will continue to check other items in the chain rather than stopping.
BLOCK_NONE
Bitflags for check_block() and handle_block(). Meant to be combined. You can be hit and still reflect, for example, if you do not use BLOCK_SUCCESS. Attack was not blocked
BLOCK_PHYSICAL_EXTERNAL
Attack was blocked by something like a shield.
BLOCK_PHYSICAL_INTERNAL
Attack was blocked by something worn on you.
BLOCK_PRIORITY_ACTIVE_BLOCK
Block priorities. Higher means it's checked sooner.
BLOCK_REDIRECTED
Attack was redirected (whether by us or by SHOULD_REDIRECT flagging for automatic handling)
BLOCK_RETURN_ACTIVE_BLOCK
Tells the caller we got blocked by active directional block.
BLOCK_RETURN_ACTIVE_BLOCK_DAMAGE_MITIGATED
Tells the caller our damage mitigation for their attack.
BLOCK_RETURN_BLOCK_CAPACITY
Tells the caller about how many hits we can soak on average before our blocking fails.
BLOCK_RETURN_FORCE_NO_PARRY_COUNTERATTACK
Used internally by run_parry proc, use on an on_active_parry() proc to prevent counterattacks
BLOCK_RETURN_MITIGATION_PERCENT
For BLOCK_SHOULD_PARTIAL_MITIGATE. Percentage mitigation.
BLOCK_RETURN_NORMAL_BLOCK_CHANCE
Tells the caller how likely we are to block attacks from 0 to 100 in general
BLOCK_RETURN_OVERRIDE_PARRY_EFFICIENCY
Used internally by run_parry proc, use on an on_active_parry() proc to override parrying efficiency.
BLOCK_RETURN_PROJECTILE_BLOCK_PERCENTAGE
Always set to 100 by run_block() if BLOCK_SUCCESS is in return value. Otherwise, defaults to mitigation percent if not set. Used by projectile/proc/on_hit().
BLOCK_RETURN_REDIRECT_METHOD
For keys in associative list/block_return as we don't want to saturate our (somewhat) limited flags.
BLOCK_RETURN_REFLECT_PROJECTILE_CHANCE
These keys are generally only applied to the list if real_attack is FALSE. Used incase we want to make "smarter" mob AI in the future or something. Tells the caller how likely from 0 (none) to 100 (always) we are to reflect energy projectiles
BLOCK_RETURN_SET_DAMAGE_TO
For [BLOCK_CHANGE_DAMAGE]. Set damage to this.
BLOCK_SHOULD_CHANGE_DAMAGE
Attack should change the amount of damage incurred. This means something calling run_block() has to handle it!
BLOCK_SHOULD_PARTIAL_MITIGATE
Attack should scale by this percent, 0 for no block and 100 for full blocked
BLOCK_SHOULD_REDIRECT
The below are for "metadata" on "how" the attack was blocked. Attack was and should be redirected according to list argument REDIRECT_METHOD (NOTE: the SHOULD here is important, as it says "the thing blocking isn't handling the reflecting for you so do it yourself"!)
BLOCK_SUCCESS
Attack was blocked, do not do damage. THIS FLAG MUST BE THERE FOR DAMAGE/EFFECT PREVENTION!
BLOCK_TARGET_DODGED
Attack outright missed because the target dodged. Should usually be combined with redirection passthrough or something (see martial arts)
DEFAULT_REDIRECT_METHOD_PROJECTILE
Default if the above isn't set in the list.
REDIRECT_METHOD_DEFLECT
Deflect at randomish angle
REDIRECT_METHOD_PASSTHROUGH
Pass through victim
REDIRECT_METHOD_REFLECT
reverse 180 angle, basically (as opposed to "realistic" wall reflections)
REDIRECT_METHOD_RETURN_TO_SENDER
"do not taser the bad man with the desword" - actually aims at the firer/attacker rather than just reversing
mob_check_block
Check whether or not we can block, without "triggering" a block. Basically run checks without effects like depleting shields. Wrapper for do_run_block(). The arguments on that means the same as for this.
mob_run_block
Runs a block "sequence", effectively checking and then doing effects if necessary. Wrapper for do_run_block(). The arguments on that means the same as for this.