/datum/component/anti_magic
This provides different types of magic resistance on an object
Vars | |
alert_caster_on_equip | Whether we should, on equipping, alert the caster that this item can block any of their spells This changes between true and false on equip and drop, don't set it outright to something |
---|---|
antimagic_flags | A bitflag with the types of magic resistance on the object |
charges | The amount of times the object can protect the user from magic Set to INFINITY to have, well, infinite charges. |
drain_antimagic | The callback invoked when we have been drained a antimagic charge |
expiration | The callback invoked when twe have been depleted of all charges |
inventory_flags | The inventory slot the object must be located at in order to activate |
Procs | |
Initialize | Adds magic resistances to an object |
restrict_casting_magic | cannot cast magic with the same type of antimagic present |
Var Details
alert_caster_on_equip
Whether we should, on equipping, alert the caster that this item can block any of their spells This changes between true and false on equip and drop, don't set it outright to something
antimagic_flags
A bitflag with the types of magic resistance on the object
charges
The amount of times the object can protect the user from magic Set to INFINITY to have, well, infinite charges.
drain_antimagic
The callback invoked when we have been drained a antimagic charge
expiration
The callback invoked when twe have been depleted of all charges
inventory_flags
The inventory slot the object must be located at in order to activate
Proc Details
Initialize
Adds magic resistances to an object
Magic resistance will prevent magic from affecting the user if it has the correct resistance against the type of magic being used
args:
- antimagic_flags (optional) A bitflag with the types of magic resistance on the object
- charges (optional) The amount of times the object can protect the user from magic
- inventory_flags (optional) The inventory slot the object must be located at in order to activate
- drain_antimagic (optional) The proc that is triggered when an object has been drained a antimagic charge
- expiration (optional) The proc that is triggered when the object is depleted of charges
antimagic bitflags: (see code/__DEFINES/magic.dm)
- MAGIC_RESISTANCE - Default magic resistance that blocks normal magic (wizard, spells, staffs)
- MAGIC_RESISTANCE_MIND - Tinfoil hat magic resistance that blocks mental magic (telepathy, abductors, jelly people)
- MAGIC_RESISTANCE_HOLY - Holy magic resistance that blocks unholy magic (revenant, cult, vampire, voice of god)
restrict_casting_magic
cannot cast magic with the same type of antimagic present