refactors grenades (#7138)

This commit is contained in:
silicons
2025-05-15 20:10:16 +02:00
committed by GitHub
parent 46de43e4cf
commit 95de4c698a
118 changed files with 1371 additions and 1249 deletions
@@ -978,7 +978,7 @@
activators = list("prime grenade" = IC_PINTYPE_PULSE_IN)
spawn_flags = IC_SPAWN_RESEARCH
origin_tech = list(TECH_ENGINEERING = 3, TECH_DATA = 3, TECH_COMBAT = 4)
var/obj/item/grenade/attached_grenade
var/obj/item/grenade/simple/attached_grenade
var/pre_attached_grenade_type
/obj/item/integrated_circuit/manipulation/grenade/Initialize(mapload)
@@ -988,17 +988,15 @@
attach_grenade(grenade)
/obj/item/integrated_circuit/manipulation/grenade/Destroy()
if(attached_grenade && !attached_grenade.active)
attached_grenade.dropInto(loc)
detach_grenade()
. =..()
QDEL_NULL(attached_grenade)
return ..()
/obj/item/integrated_circuit/manipulation/grenade/proc/ask_for_input(mob/living/user, obj/item/I, a_intent)
if(!isobj(I))
return FALSE
attackby_react(I, user, a_intent)
/obj/item/integrated_circuit/manipulation/grenade/attackby_react(var/obj/item/grenade/G, var/mob/user)
/obj/item/integrated_circuit/manipulation/grenade/attackby_react(var/obj/item/grenade/simple/G, var/mob/user)
if(istype(G))
. = CLICKCHAIN_DO_NOT_PROPAGATE
if(attached_grenade)
@@ -1025,10 +1023,10 @@
return ..()
/obj/item/integrated_circuit/manipulation/grenade/do_work()
if(attached_grenade && !attached_grenade.active)
if(attached_grenade && !attached_grenade.activated)
var/datum/integrated_io/detonation_time = inputs[1]
if(isnum(detonation_time.data) && detonation_time.data > 0)
attached_grenade.det_time = between(1, detonation_time.data, 12) SECONDS
attached_grenade.activation_detonate_delay = between(1, detonation_time.data, 12) SECONDS
attached_grenade.activate()
var/atom/holder = loc
log_and_message_admins("activated a grenade assembly. Last touches: Assembly: [holder.fingerprintslast] Circuit: [fingerprintslast] Grenade: [attached_grenade.fingerprintslast]")