mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-11 10:11:09 +00:00
Antimagic examine tags (#93203)
## About The Pull Request This PR introduces new examine tags for the antimagic component to give players specific feedback on an item's defensive properties. | Condition | Tag | Description | | :--- | :--- | :--- | | **All Resistances** | `magic-proof` | "It is thoroughly shielded against all known forms of magic." | | **MAGIC_RESISTANCE** | `warded` | "It possesses a general resistance to regular spells and magic." | | **MAGIC_RESISTANCE_MIND** | `telepathy-proof` | "It appears to be insulated against telepathic or mental influence." | | **MAGIC_RESISTANCE_HOLY** | `blessed` | "It is protected by a divine shield against unholy and dark forms of magic." | ## Why It's Good For The Game Gives players more context and helpful information about items. ## Changelog 🆑 qol: New examine tags for the antimagic component to give players specific feedback on an item's magical resistance. /🆑
This commit is contained in:
@@ -90,6 +90,8 @@ DEFINE_BITFIELD(spell_requirements, list(
|
|||||||
/// Holy magic resistance that blocks unholy magic (revenant, vampire, voice of god)
|
/// Holy magic resistance that blocks unholy magic (revenant, vampire, voice of god)
|
||||||
#define MAGIC_RESISTANCE_HOLY (1<<2)
|
#define MAGIC_RESISTANCE_HOLY (1<<2)
|
||||||
|
|
||||||
|
#define ALL_MAGIC_RESISTANCE (MAGIC_RESISTANCE|MAGIC_RESISTANCE_MIND|MAGIC_RESISTANCE_HOLY)
|
||||||
|
|
||||||
DEFINE_BITFIELD(antimagic_flags, list(
|
DEFINE_BITFIELD(antimagic_flags, list(
|
||||||
"MAGIC_RESISTANCE" = MAGIC_RESISTANCE,
|
"MAGIC_RESISTANCE" = MAGIC_RESISTANCE,
|
||||||
"MAGIC_RESISTANCE_HOLY" = MAGIC_RESISTANCE_HOLY,
|
"MAGIC_RESISTANCE_HOLY" = MAGIC_RESISTANCE_HOLY,
|
||||||
|
|||||||
@@ -45,7 +45,6 @@
|
|||||||
datum/callback/check_blocking,
|
datum/callback/check_blocking,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
var/atom/movable/movable = parent
|
var/atom/movable/movable = parent
|
||||||
if(!istype(movable))
|
if(!istype(movable))
|
||||||
return COMPONENT_INCOMPATIBLE
|
return COMPONENT_INCOMPATIBLE
|
||||||
@@ -54,6 +53,7 @@
|
|||||||
if(isitem(movable))
|
if(isitem(movable))
|
||||||
RegisterSignal(movable, COMSIG_ITEM_EQUIPPED, PROC_REF(on_equip))
|
RegisterSignal(movable, COMSIG_ITEM_EQUIPPED, PROC_REF(on_equip))
|
||||||
RegisterSignal(movable, COMSIG_ITEM_DROPPED, PROC_REF(on_drop))
|
RegisterSignal(movable, COMSIG_ITEM_DROPPED, PROC_REF(on_drop))
|
||||||
|
RegisterSignal(movable, COMSIG_ATOM_EXAMINE_TAGS, PROC_REF(get_examine_tags))
|
||||||
RegisterSignals(movable, list(COMSIG_ITEM_ATTACK, COMSIG_ITEM_ATTACK_ATOM), PROC_REF(on_attack))
|
RegisterSignals(movable, list(COMSIG_ITEM_ATTACK, COMSIG_ITEM_ATTACK_ATOM), PROC_REF(on_attack))
|
||||||
compatible = TRUE
|
compatible = TRUE
|
||||||
else if(ismob(movable))
|
else if(ismob(movable))
|
||||||
@@ -95,6 +95,20 @@
|
|||||||
SIGNAL_HANDLER
|
SIGNAL_HANDLER
|
||||||
unregister_antimagic_signals(bucklee)
|
unregister_antimagic_signals(bucklee)
|
||||||
|
|
||||||
|
/datum/component/anti_magic/proc/get_examine_tags(atom/source, mob/user, list/examine_list)
|
||||||
|
SIGNAL_HANDLER
|
||||||
|
|
||||||
|
if(antimagic_flags == ALL_MAGIC_RESISTANCE)
|
||||||
|
examine_list["magic-proof"] = "It is thoroughly shielded against all known forms of magic."
|
||||||
|
return
|
||||||
|
|
||||||
|
if(antimagic_flags & MAGIC_RESISTANCE)
|
||||||
|
examine_list["warded"] = "It possesses a general resistance to regular spells and magic."
|
||||||
|
if(antimagic_flags & MAGIC_RESISTANCE_MIND)
|
||||||
|
examine_list["telepathy-proof"] = "It appears to be insulated against telepathic or mental influence."
|
||||||
|
if(antimagic_flags & MAGIC_RESISTANCE_HOLY)
|
||||||
|
examine_list["blessed"] = "It is protected by a divine shield against unholy and dark forms of magic."
|
||||||
|
|
||||||
/datum/component/anti_magic/proc/on_equip(atom/movable/source, mob/equipper, slot)
|
/datum/component/anti_magic/proc/on_equip(atom/movable/source, mob/equipper, slot)
|
||||||
SIGNAL_HANDLER
|
SIGNAL_HANDLER
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user