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:
Tim
2025-10-02 11:15:25 -05:00
committed by GitHub
parent f12598c323
commit 990d8df2e1
2 changed files with 17 additions and 1 deletions

View File

@@ -90,6 +90,8 @@ DEFINE_BITFIELD(spell_requirements, list(
/// Holy magic resistance that blocks unholy magic (revenant, vampire, voice of god)
#define MAGIC_RESISTANCE_HOLY (1<<2)
#define ALL_MAGIC_RESISTANCE (MAGIC_RESISTANCE|MAGIC_RESISTANCE_MIND|MAGIC_RESISTANCE_HOLY)
DEFINE_BITFIELD(antimagic_flags, list(
"MAGIC_RESISTANCE" = MAGIC_RESISTANCE,
"MAGIC_RESISTANCE_HOLY" = MAGIC_RESISTANCE_HOLY,

View File

@@ -45,7 +45,6 @@
datum/callback/check_blocking,
)
var/atom/movable/movable = parent
if(!istype(movable))
return COMPONENT_INCOMPATIBLE
@@ -54,6 +53,7 @@
if(isitem(movable))
RegisterSignal(movable, COMSIG_ITEM_EQUIPPED, PROC_REF(on_equip))
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))
compatible = TRUE
else if(ismob(movable))
@@ -95,6 +95,20 @@
SIGNAL_HANDLER
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)
SIGNAL_HANDLER