defib 
A component for an item that attempts to defibrillate a mob when activated.
Vars | |
| actual_unit_uid | uid to an item that should be making noise and handling things that our direct parent shouldn't be concerned with. |
|---|---|
| busy | If the defib is actively performing a defib cycle |
| cooldown | Cooldown length for this defib in deciseconds |
| emag_proof | If true, this cannot be emagged. |
| emp_proof | If true, EMPs will have no effect. |
| heart_attack_chance | Chance to cause cardiac arrest when used in Harm mode with safety protocols disabled. |
| ignore_hardsuits | If it should penetrate space suits |
| on_cooldown | Whether or not we're currently on cooldown |
| robotic | If this is being used by a borg or not, with necessary safeties applied if so. |
| safety | Whether the safeties are enabled or not |
| speed_multiplier | How fast the defib should work. |
Procs | |
| Initialize | Create a new defibrillation component. |
| apply_disarm_fibrillate_effects | Applies the non-lethal effects of an offensive defibrillator shock. |
| combat_fibrillate | Inflict burn damage and potentially trigger a heart attack on someone. |
| defibrillate | Perform a defibrillation. |
| disarm_fibrillate | Inflict stamina loss and confusion/knockdown on someone. |
| get_effect_target | Get the "parent" that effects (emags, EMPs) should be applied onto. |
| medical_fibrillate | Standard medical defibrillation flow. |
| trigger_defib | Start the defibrillation process when triggered by a signal. |
| try_block_attack | Attempts to block a attack (such as a defibrillator shock) using the target's held or worn items. |
Var Details
actual_unit_uid 
uid to an item that should be making noise and handling things that our direct parent shouldn't be concerned with.
busy 
If the defib is actively performing a defib cycle
cooldown 
Cooldown length for this defib in deciseconds
emag_proof 
If true, this cannot be emagged.
emp_proof 
If true, EMPs will have no effect.
heart_attack_chance 
Chance to cause cardiac arrest when used in Harm mode with safety protocols disabled.
ignore_hardsuits 
If it should penetrate space suits
on_cooldown 
Whether or not we're currently on cooldown
robotic 
If this is being used by a borg or not, with necessary safeties applied if so.
safety 
Whether the safeties are enabled or not
speed_multiplier 
How fast the defib should work.
Proc Details
Initialize
Create a new defibrillation component.
Arguments:
- robotic - whether this should be treated like a borg module.
- cooldown - Minimum time possible between shocks.
- speed_multiplier - Speed multiplier for defib do-afters.
- ignore_hardsuits - If true, the defib can zap through hardsuits.
- heart_attack_chance - If safeties are off, the % chance for this to cause a heart attack on harm intent.
- safe_by_default - If true, safety will be enabled by default.
- emp_proof - If true, safety won't be switched by emp. Note that the device itself can still have behavior from it, it's just that the component will not.
- emag_proof - If true, safety won't be switched by emag. Note that the device itself can still have behavior from it, it's just that the component will not.
- actual_unit - Unit which the component's parent is based from, such as a large defib unit or a borg. The actual_unit will make the sounds and be the "origin" of visible messages, among other things.
apply_disarm_fibrillate_effects
Applies the non-lethal effects of an offensive defibrillator shock.
Standard defibs apply stamina damage and either confusion or knockdown. Combat-capable defibs that ignore hardsuits always apply knockdown instead.
Arguments:
- target - person being shocked
combat_fibrillate
Inflict burn damage and potentially trigger a heart attack on someone.
Arguments:
- user - wielder of the defib
- target - person getting shocked
- defib_ref - the defibrillator instance
defibrillate
Perform a defibrillation.
disarm_fibrillate
Inflict stamina loss and confusion/knockdown on someone.
Arguments:
- user - wielder of the defib
- target - person getting shocked
- defib_ref - the defibrillator instance
get_effect_target
Get the "parent" that effects (emags, EMPs) should be applied onto.
medical_fibrillate
Standard medical defibrillation flow.
Arguments:
- user - wielder of the defib
- target - person getting shocked
- defib_ref - the defibrillator instance
trigger_defib
Start the defibrillation process when triggered by a signal.
try_block_attack
Attempts to block a attack (such as a defibrillator shock) using the target's held or worn items.
Iterates through all items in the target's contents and calls their hit_reaction(), which handles block chance and shield components.
Arguments:
- target - person being attacked
- attack_text - text used in block messages
- attack_type - type of the incoming attack (used for block filtering)
Returns:
- TRUE - if the attack was successfully blocked
- FALSE - if no blocking item reacted