Attack Chain Migration: Grenades & Plastic Explosives (#31874)

* Update bomb.dm

* migration

* Fix CI

* Update mining_charges.dm

* Update deployable.dm
This commit is contained in:
CRUNCH
2026-04-21 05:58:44 +01:00
committed by GitHub
parent fd45dc8718
commit 3c1d985e31
10 changed files with 252 additions and 202 deletions
+41 -33
View File
@@ -26,47 +26,52 @@
if(timer_off)
. += SPAN_NOTICE("The mining charge is connected to a detonator.")
/obj/item/grenade/plastic/miningcharge/attack_self__legacy__attackchain(mob/user)
if(nadeassembly)
nadeassembly.attack_self__legacy__attackchain(user)
/obj/item/grenade/plastic/miningcharge/interact_with_atom(atom/target, mob/living/user, list/modifiers)
if(!ismineralturf(target) && !hacked)
return ITEM_INTERACT_COMPLETE
/obj/item/grenade/plastic/miningcharge/afterattack__legacy__attackchain(atom/movable/AM, mob/user, flag)
if(!ismineralturf(AM) && !hacked)
return
if(is_ancient_rock(AM) && !hacked)
to_chat(user, SPAN_NOTICE("This rock appears to be resistant to all mining tools except pickaxes!"))
return
if(!timer_off) //override original proc for plastic explosions
if(is_ancient_rock(target) && !hacked)
to_chat(user, SPAN_WARNING("This rock appears to be resistant to all mining tools except pickaxes!"))
return ITEM_INTERACT_COMPLETE
// Override original proc for plastic explosives.
if(!timer_off)
return ..()
if(!flag)
return
if(iscarbon(AM))
return
if(iscarbon(target))
return ITEM_INTERACT_COMPLETE
to_chat(user, SPAN_NOTICE("You start planting [src]."))
if(!do_after(user, (2.5 SECONDS) * toolspeed, target = AM))
return
if(!do_after(user, (2.5 SECONDS) * toolspeed, target = target))
return ITEM_INTERACT_COMPLETE
if(!user.unequip(src))
return
target = AM
forceMove(AM)
to_chat(user, SPAN_DANGER("[src] is stuck to your hand!"))
return ITEM_INTERACT_COMPLETE
forceMove(target)
if(hacked)
message_admins("[ADMIN_LOOKUPFLW(user)] planted [name] on [target.name] at [ADMIN_COORDJMP(target)]")
log_game("planted [name] on [target.name] at [COORD(target)]", user)
installed = TRUE
target.overlays += image_overlay
return ITEM_INTERACT_COMPLETE
/obj/item/grenade/plastic/miningcharge/attackby__legacy__attackchain(obj/item/I, mob/user, params)
if(!istype(I, /obj/item/detonator))
return
var/obj/item/detonator/detonator = I
/obj/item/grenade/plastic/miningcharge/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(!istype(used, /obj/item/detonator))
return NONE
var/obj/item/detonator/detonator = used
if((src in detonator.bombs) || timer_off)
to_chat(user, SPAN_WARNING("[src] was already synchronized to a existing detonator!"))
return
return ITEM_INTERACT_COMPLETE
detonator.bombs += src
timer_off = TRUE
to_chat(user, SPAN_NOTICE("You synchronize [src] to [I]."))
to_chat(user, SPAN_NOTICE("You synchronize [src] to [used]."))
playsound(src, 'sound/machines/twobeep.ogg', 50)
detonator.update_icon()
return ITEM_INTERACT_COMPLETE
/obj/item/grenade/plastic/miningcharge/proc/detonate()
addtimer(CALLBACK(src, PROC_REF(prime)), 3 SECONDS)
@@ -75,7 +80,7 @@
if(hacked) //try not to blow your fingers off
explode()
return
var/turf/simulated/mineral/location = get_turf(target)
var/turf/simulated/mineral/location = get_turf(target_atom)
var/datum/effect_system/smoke_spread/S = new
S.set_up(smoke_amount, 0, location, null)
S.start()
@@ -99,18 +104,18 @@
/obj/item/grenade/plastic/miningcharge/proc/explode()
var/turf/location
if(target)
if(!QDELETED(target))
if(isturf(target))
location = get_turf(target)
if(target_atom)
if(!QDELETED(target_atom))
if(isturf(target_atom))
location = get_turf(target_atom)
else
location = get_atom_on_turf(target)
target.overlays -= image_overlay
location = get_atom_on_turf(target_atom)
target_atom.overlays -= image_overlay
else
location = get_atom_on_turf(src)
if(location)
explosion(location, boom_sizes[1], boom_sizes[2], boom_sizes[3], cause = name)
location.ex_act(EXPLODE_HEAVY, target)
location.ex_act(EXPLODE_HEAVY, target_atom)
qdel(src)
/obj/item/grenade/plastic/miningcharge/proc/override_safety()
@@ -161,13 +166,16 @@
/obj/item/t_scanner/adv_mining_scanner/syndicate/afterattack__legacy__attackchain(atom/target, mob/user, proximity_flag, click_parameters)
if(!istype(target, /obj/item/grenade/plastic/miningcharge))
return
var/obj/item/grenade/plastic/miningcharge/charge = target
if(charge.hacked)
to_chat(user, SPAN_NOTICE("[src] is already overridden!"))
return
if(charges <= 0)
to_chat(user, SPAN_NOTICE("Its overriding function is depleted."))
return
charge.override_safety()
visible_message(SPAN_WARNING("Sparks fly out of [src]!"))
playsound(src, "sparks", 50, TRUE)
@@ -197,9 +197,9 @@ GLOBAL_LIST_EMPTY(wormhole_effect)
thrower = null
return ..()
/obj/item/grenade/jaunter_grenade/attack_self__legacy__attackchain(mob/user)
. = ..()
/obj/item/grenade/jaunter_grenade/activate_self(mob/user)
thrower = user
return ..()
/obj/item/grenade/jaunter_grenade/prime()
var/area/our_area = get_area(src)