Files
Paradise/code/datums/wires/syndicatebomb_wires.dm
Christer2222andGitHub b5eabdf1a9 You can now stick forks into outlets (#31435)
* now shocks

* machines + added get_internal_wires

* removed duplicate variable on syndicatebomb

* adds wire tearing, check if the door has a plating

* return a few item_interaction_complete

* linting + unpowered message

* removed some checks  + floodlights + ChemMaster

* cut_random_uncut() -> cut_random_uncut_wire()

* simplified random wire selection

* return ..() + removed /

* early return if not machine

* get_internal_wires() comment

* attackchain

* attackchain + comment removal

* duplicate variable removal

* removed extra lines

* removed some / + removed unnecessary checks

* removed uncut wirecount function + extra check to cooking machinery

* attack chain signal

* space

* removed some \thes
2026-02-17 19:12:09 +00:00

84 lines
3.0 KiB
Plaintext

/datum/wires/syndicatebomb
randomize = TRUE
holder_type = /obj/machinery/syndicatebomb
wire_count = 5
proper_name = "Syndicate bomb"
/datum/wires/syndicatebomb/New(atom/_holder)
wires = list(WIRE_BOMB_DELAY, WIRE_EXPLODE, WIRE_BOMB_UNBOLT,WIRE_BOMB_PROCEED, WIRE_BOMB_ACTIVATE)
return ..()
/datum/wires/syndicatebomb/interactable(mob/user)
var/obj/machinery/syndicatebomb/P = holder
if(P.panel_open)
return TRUE
return FALSE
/datum/wires/syndicatebomb/on_pulse(wire)
var/obj/machinery/syndicatebomb/B = holder
switch(wire)
if(WIRE_EXPLODE)
if(B.active)
holder.visible_message(SPAN_DANGER("[bicon(B)] An alarm sounds! It's go-"))
B.explode_now = TRUE
if(WIRE_BOMB_UNBOLT)
holder.visible_message(SPAN_NOTICE("[bicon(holder)] The bolts spin in place for a moment."))
if(WIRE_BOMB_DELAY)
if(B.delayedbig)
holder.visible_message(SPAN_NOTICE("[bicon(B)] The bomb has already been delayed."))
else
holder.visible_message(SPAN_NOTICE("[bicon(B)] The bomb chirps."))
playsound(B, 'sound/machines/chime.ogg', 30, 1)
B.detonation_timer += 300
B.delayedbig = TRUE
if(WIRE_BOMB_PROCEED)
holder.visible_message(SPAN_DANGER("[bicon(B)] The bomb buzzes ominously!"))
playsound(B, 'sound/machines/buzz-sigh.ogg', 30, 1)
var/seconds = B.seconds_remaining()
if(seconds >= 61) // Long fuse bombs can suddenly become more dangerous if you tinker with them.
B.detonation_timer = world.time + 600
else if(seconds >= 21)
B.detonation_timer -= 100
else if(seconds >= 11) // Both to prevent negative timers and to have a little mercy.
B.detonation_timer = world.time + 100
if(WIRE_BOMB_ACTIVATE)
if(!B.active && !B.defused)
holder.visible_message(SPAN_DANGER("[bicon(B)] You hear the bomb start ticking!"))
B.activate()
B.update_icon()
else if(B.delayedlittle)
holder.visible_message(SPAN_NOTICE("[bicon(B)] Nothing happens."))
else
holder.visible_message(SPAN_NOTICE("[bicon(B)] The bomb seems to hesitate for a moment."))
B.detonation_timer += 100
B.delayedlittle = TRUE
..()
/datum/wires/syndicatebomb/on_cut(wire, mend)
var/obj/machinery/syndicatebomb/B = holder
switch(wire)
if(WIRE_EXPLODE)
if(mend)
B.defused = FALSE // Cutting and mending all the wires of an inactive bomb will thus cure any sabotage.
else
if(B.active)
holder.visible_message(SPAN_DANGER("[bicon(B)] An alarm sounds! It's go-"))
B.explode_now = TRUE
else
B.defused = TRUE
if(WIRE_BOMB_UNBOLT)
if(!mend && B.anchored)
holder.visible_message(SPAN_NOTICE("[bicon(B)] The bolts lift out of the ground!"))
playsound(B, 'sound/effects/stealthoff.ogg', 30, 1)
B.anchored = FALSE
if(WIRE_BOMB_PROCEED)
if(!mend && B.active)
holder.visible_message(SPAN_DANGER("[bicon(B)] An alarm sounds! It's go-"))
B.explode_now = TRUE
if(WIRE_BOMB_ACTIVATE)
if(!mend && B.active)
holder.visible_message(SPAN_NOTICE("[bicon(B)] The timer stops! The bomb has been defused!"))
B.defused = TRUE
B.update_icon()
..()