migrates /obj/effect to the new attack chain (#28066)

* the great migration

* pleasing the linter

* whoops

* smol fixes

* review

* hallucination attack proc

---------

Co-authored-by: Toastical <toast@toaster.com>
Co-authored-by: Toastical <toastical@toaster.com>
This commit is contained in:
Toastical
2025-02-26 09:45:18 +00:00
committed by GitHub
co-authored by Toastical Toastical
parent 6ded7786fd
commit 202249a137
18 changed files with 109 additions and 112 deletions
+3 -2
View File
@@ -94,9 +94,10 @@
// Else, anomaly core gets deleted by qdel(src).
qdel(src)
/obj/effect/anomaly/attackby__legacy__attackchain(obj/item/I, mob/user, params)
if(istype(I, /obj/item/analyzer))
/obj/effect/anomaly/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(istype(used, /obj/item/analyzer))
to_chat(user, "<span class='notice'>Analyzing... [src]'s unstable field is fluctuating along frequency [format_frequency(aSignal.frequency)], code [aSignal.code].</span>")
return ITEM_INTERACT_COMPLETE
/obj/effect/anomaly/grav
name = "gravitational anomaly"
@@ -38,11 +38,13 @@
playsound(L, 'sound/effects/attackblob.ogg', 50, TRUE)
to_chat(L, "<span class='userdanger'>[src] sticks to you!</span>")
/obj/effect/decal/cleanable/tar/attackby__legacy__attackchain(obj/item/welder, mob/living/user, params)
if(!welder.get_heat() || !Adjacent(user))
return
playsound(welder, 'sound/items/welder.ogg', 50, TRUE)
/obj/effect/decal/cleanable/tar/item_interaction(mob/living/user, obj/item/used, list/modifiers)
var/obj/item/weldingtool/fire_tool = used
if(!fire_tool.get_heat() || !Adjacent(user))
return ITEM_INTERACT_COMPLETE
playsound(fire_tool, 'sound/items/welder.ogg', 50, TRUE)
if(do_after(user, 3 SECONDS, FALSE, user))
if(welder.get_heat() && Adjacent(user))
user.visible_message("<span class='danger'>[user] burns away [src] with [welder]!</span>", "<span class='danger'>You burn away [src]!</span>")
if(fire_tool.get_heat() && Adjacent(user))
user.visible_message("<span class='danger'>[user] burns away [src] with [fire_tool]!</span>", "<span class='danger'>You burn away [src]!</span>")
qdel(src)
return ITEM_INTERACT_COMPLETE
+6 -4
View File
@@ -8,6 +8,7 @@
move_resist = INFINITY
anchored = TRUE
can_be_hit = FALSE
new_attack_chain = TRUE
/obj/effect/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)
return
@@ -103,11 +104,12 @@
if(desc)
. += desc
/obj/effect/decal/attackby__legacy__attackchain(obj/item/I, mob/user)
if(istype(I, /obj/item/reagent_containers/glass) || istype(I, /obj/item/reagent_containers/drinks))
scoop(I, user)
/obj/effect/decal/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(istype(used, /obj/item/reagent_containers/glass) || istype(used, /obj/item/reagent_containers/drinks))
scoop(used, user)
else if(issimulatedturf(loc))
I.melee_attack_chain(user, loc)
used.melee_attack_chain(user, loc)
return ITEM_INTERACT_COMPLETE
/obj/effect/decal/attack_animal(mob/living/simple_animal/M)
if(issimulatedturf(loc))
+3 -4
View File
@@ -146,12 +146,11 @@ GLOBAL_LIST_INIT(meteors_gore, list(/obj/effect/meteor/meaty = 5, /obj/effect/me
/obj/effect/meteor/ex_act()
return
/obj/effect/meteor/attackby__legacy__attackchain(obj/item/I, mob/user, params)
if(istype(I, /obj/item/pickaxe))
/obj/effect/meteor/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(istype(used, /obj/item/pickaxe))
make_debris()
qdel(src)
return
return ..()
return ITEM_INTERACT_COMPLETE
/obj/effect/meteor/proc/make_debris()
for(var/throws = dropamt, throws > 0, throws--)
+8 -10
View File
@@ -97,17 +97,15 @@
user.put_in_hands(SB)
to_chat(user, "<span class='notice'>You scoop up some snow and make \a [SB]!</span>")
/obj/effect/snow/attackby__legacy__attackchain(obj/item/I, mob/user)
if(istype(I, /obj/item/shovel))
var/obj/item/shovel/S = I
/obj/effect/snow/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(istype(used, /obj/item/shovel))
var/obj/item/shovel/shovel = used
user.visible_message("<span class='notice'>[user] is clearing away [src]...</span>", "<span class='notice'>You begin clearing away [src]...</span>", "<span class='warning'>You hear a wettish digging sound.</span>")
playsound(loc, S.usesound, 50, TRUE)
if(!do_after(user, 50 * S.toolspeed, target = src))
return
user.visible_message("<span class='notice'>[user] clears away [src]!</span>", "<span class='notice'>You clear away [src]!</span>")
qdel(src)
else
return ..()
playsound(loc, shovel.usesound, 50, TRUE)
if(do_after(user, 50 * shovel.toolspeed, target = src))
user.visible_message("<span class='notice'>[user] clears away [src]!</span>", "<span class='notice'>You clear away [src]!</span>")
qdel(src)
return ITEM_INTERACT_COMPLETE
/obj/effect/snow/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
..()