Moves a great many things from attackby() to item_interaction() (#96642)

## About The Pull Request

21 things.
Additionally, an actual refactor(a real one) of refunding of item-based
spellbook entries, as in the three summons, which hasn't worked for four
years and now does.
Lastly, the holopayment stand IDs can project can now accept payment.


## Why It's Good For The Game

They want you to think this is worth 210 gbp, don't believe the lies

## Changelog
🆑

fix: Wizards can now successfully refund summoning items
fix: Holopayment stands can now take payment

code: 21 things have been moved from attackby() to item_interaction()

/🆑
This commit is contained in:
Leland Kemble
2026-07-05 10:02:06 +02:00
committed by GitHub
parent ae315a22a1
commit e816dfebeb
23 changed files with 332 additions and 321 deletions
+9 -8
View File
@@ -56,18 +56,19 @@
. = ..()
. += span_notice("You can booby-trap the poster by using a glass shard on it before you put it up.")
/obj/item/poster/attackby(obj/item/I, mob/user, list/modifiers, list/attack_modifiers)
if(!istype(I, /obj/item/shard))
return ..()
/obj/item/poster/item_interaction(mob/living/user, obj/item/tool, list/modifiers)
if(!istype(tool, /obj/item/shard))
return NONE
if (locate(/obj/item/shard) in (poster_structure?.contents || contents))
if(locate(/obj/item/shard) in (poster_structure?.contents || contents))
balloon_alert(user, "already trapped!")
return
return ITEM_INTERACT_BLOCKING
if(!user.transferItemToLoc(I, src))
return
if(!user.transferItemToLoc(tool, src))
return ITEM_INTERACT_BLOCKING
to_chat(user, span_notice("You conceal \the [I] inside the rolled up poster."))
to_chat(user, span_notice("You conceal \the [tool] inside the rolled up poster."))
return ITEM_INTERACT_SUCCESS
/obj/item/poster/interact_with_atom(turf/closed/wall_structure, mob/living/user, list/modifiers)
if(!isclosedturf(wall_structure))
+5 -6
View File
@@ -80,12 +80,11 @@
pushed_over = FALSE
tacticool = AddComponent(/datum/component/tactical)
/obj/item/cardboard_cutout/attackby(obj/item/I, mob/living/user, list/modifiers, list/attack_modifiers)
if(istype(I, /obj/item/toy/crayon))
change_appearance(I, user)
return TRUE
return ..()
/obj/item/cardboard_cutout/item_interaction(mob/living/user, obj/item/tool, list/modifiers)
if(!istype(tool, /obj/item/toy/crayon))
return NONE
change_appearance(tool, user)
return ITEM_INTERACT_SUCCESS
/obj/item/cardboard_cutout/take_damage(damage_amount, damage_type, damage_flag, sound_effect, attack_dir, armour_penetration)
. = ..()
+6 -6
View File
@@ -124,13 +124,13 @@
desc = "This door only opens when a keycard is swiped. It looks virtually indestructible."
uses_queuelinks = FALSE
/obj/machinery/door/puzzle/keycard/attackby(obj/item/attacking_item, mob/user, list/modifiers, list/attack_modifiers)
. = ..()
if(!istype(attacking_item, /obj/item/keycard))
return
var/obj/item/keycard/key = attacking_item
if(!try_puzzle_open(key.puzzle_id))
/obj/machinery/door/puzzle/keycard/item_interaction(mob/living/user, obj/item/tool, list/modifiers)
if(!istype(tool, /obj/item/keycard))
return NONE
if(!try_puzzle_open(astype(tool, /obj/item/keycard).puzzle_id))
to_chat(user, span_notice("[src] buzzes. This must not be the right key."))
return ITEM_INTERACT_BLOCKING
return ITEM_INTERACT_SUCCESS
//Test doors. Gives admins a few doors to use quickly should they so choose for events.
/obj/machinery/door/puzzle/keycard/yellow_required
+14 -11
View File
@@ -66,14 +66,17 @@
var/obj/item/documents/photocopy/C = copy
copy_type = C.copy_type
/obj/item/documents/photocopy/attackby(obj/item/O, mob/user, list/modifiers, list/attack_modifiers)
if(istype(O, /obj/item/toy/crayon/red) || istype(O, /obj/item/toy/crayon/blue))
if (forgedseal)
to_chat(user, span_warning("You have already forged a seal on [src]!"))
else
var/obj/item/toy/crayon/C = O
name = "[C.crayon_color] secret documents"
icon_state = "docs_[C.crayon_color]"
forgedseal = C.crayon_color
to_chat(user, span_notice("You forge the official seal with a [C.crayon_color] crayon. No one will notice... right?"))
update_appearance()
/obj/item/documents/photocopy/item_interaction(mob/living/user, obj/item/tool, list/modifiers)
if(!istype(tool, /obj/item/toy/crayon/red) && !istype(tool, /obj/item/toy/crayon/blue))
return NONE
if (forgedseal)
to_chat(user, span_warning("You have already forged a seal on [src]!"))
return ITEM_INTERACT_BLOCKING
var/obj/item/toy/crayon/C = tool
name = "[C.crayon_color] secret documents"
icon_state = "docs_[C.crayon_color]"
forgedseal = C.crayon_color
to_chat(user, span_notice("You forge the official seal with a [C.crayon_color] crayon. No one will notice... right?"))
update_appearance()
return ITEM_INTERACT_SUCCESS