mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 00:29:02 +01:00
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:
+11
-12
@@ -324,18 +324,17 @@
|
||||
|
||||
// attach a wire to a power machine - leads from the turf you are standing on
|
||||
//almost never called, overwritten by all power machines but terminal and generator
|
||||
/obj/machinery/power/attackby(obj/item/W, mob/user, list/modifiers, list/attack_modifiers)
|
||||
if(istype(W, /obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/coil = W
|
||||
var/turf/T = user.loc
|
||||
if(T.underfloor_accessibility < UNDERFLOOR_INTERACTABLE || !isfloorturf(T))
|
||||
return
|
||||
if(get_dist(src, user) > 1)
|
||||
return
|
||||
coil.place_turf(T, user)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/item_interaction(mob/living/user, obj/item/tool, list/modifiers)
|
||||
if(!istype(tool, /obj/item/stack/cable_coil))
|
||||
return NONE
|
||||
var/obj/item/stack/cable_coil/coil = tool
|
||||
var/turf/userturf = user.loc
|
||||
if(userturf.underfloor_accessibility < UNDERFLOOR_INTERACTABLE || !isfloorturf(userturf))
|
||||
return ITEM_INTERACT_BLOCKING
|
||||
if(get_dist(src, user) > 1)
|
||||
return ITEM_INTERACT_BLOCKING
|
||||
coil.place_turf(userturf, user)
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
|
||||
///////////////////////////////////////////
|
||||
// Powernet handling helpers
|
||||
|
||||
Reference in New Issue
Block a user