Files
vgstation13/code/datums/wires/syndicatebomb.dm
D3athrow 01d2471fc9 Merge branch 'color_replace_2_electric_boogaloo' into Bleeding-Edge
Conflicts:
	code/ATMOSPHERICS/pipe/pipe_dispenser.dm
	code/game/machinery/computer/HolodeckControl.dm
	code/game/machinery/embedded_controller/embedded_controller_base.dm
	code/modules/mining/money_bag.dm
	code/modules/mob/living/carbon/carbon.dm
	code/modules/mob/living/silicon/mommi/mommi.dm
	code/modules/mob/living/simple_animal/friendly/farm_animals.dm
	code/modules/research/destructive_analyzer.dm
	code/modules/research/rdconsole.dm
	code/modules/research/xenoarchaeology/machinery/analysis_base.dm
	code/modules/research/xenoarchaeology/machinery/artifact_harvester.dm
	code/modules/research/xenoarchaeology/tools/ano_device_battery.dm
2015-04-12 16:40:59 -05:00

78 lines
3.3 KiB
Plaintext

/datum/wires/syndicatebomb
random = 1
holder_type = /obj/machinery/syndicatebomb
wire_count = 5
var/const/WIRE_BOOM = 1 // Explodes if pulsed or cut while active, defuses a bomb that isn't active on cut
var/const/WIRE_UNBOLT = 2 // Unbolts the bomb if cut, hint on pulsed
var/const/WIRE_DELAY = 4 // Raises the timer on pulse, does nothing on cut
var/const/WIRE_PROCEED = 8 // Lowers the timer, explodes if cut while the bomb is active
var/const/WIRE_ACTIVATE = 16 // Will start a bombs timer if pulsed, will hint if pulsed while already active, will stop a timer a bomb on cut
/datum/wires/syndicatebomb/UpdatePulsed(var/index)
var/obj/machinery/syndicatebomb/P = holder
if(P.degutted)
return
switch(index)
if(WIRE_BOOM)
if (P.active)
P.loc.visible_message("<span class='warning'>\icon[holder] An alarm sounds! It's go-</span>")
P.timer = 0
if(WIRE_UNBOLT)
P.loc.visible_message("<span class='notice'>\icon[holder] The bolts spin in place for a moment.</span>")
if(WIRE_DELAY)
playsound(P.loc, 'sound/machines/chime.ogg', 30, 1)
P.loc.visible_message("<span class='notice'>\icon[holder] The bomb chirps.</span>")
P.timer += 10
if(WIRE_PROCEED)
playsound(P.loc, 'sound/machines/buzz-sigh.ogg', 30, 1)
P.loc.visible_message("<span class='warning'>\icon[holder] The bomb buzzes ominously!</span>")
if (P.timer >= 61) //Long fuse bombs can suddenly become more dangerous if you tinker with them
P.timer = 60
if (P.timer >= 21)
P.timer -= 10
else if (P.timer >= 11) //both to prevent negative timers and to have a little mercy
P.timer = 10
if(WIRE_ACTIVATE)
if(!P.active && !P.defused)
playsound(P.loc, 'sound/machines/click.ogg', 30, 1)
P.loc.visible_message("<span class='warning'>\icon[holder] You hear the bomb start ticking!</span>")
P.active = 1
if(!P.open_panel) //Needs to exist in case the wire is pulsed with a signaler while the panel is closed
P.icon_state = "syndicate-bomb-active"
else
P.icon_state = "syndicate-bomb-active-wires"
processing_objects.Add(P)
else
P.loc.visible_message("<span class='notice'>\icon[holder] The bomb seems to hesitate for a moment.</span>")
P.timer += 5
/datum/wires/syndicatebomb/UpdateCut(var/index, var/mended)
var/obj/machinery/syndicatebomb/P = holder
if(P.degutted)
return
switch(index)
if(WIRE_EXPLODE)
if(!mended)
if(P.active)
P.loc.visible_message("<span class='warning'>\icon[holder] An alarm sounds! It's go-</span>")
P.timer = 0
else
P.defused = 1
if(mended)
P.defused = 0 //cutting and mending all the wires of an inactive bomb will thus cure any sabotage
if(WIRE_UNBOLT)
if (!mended && P.anchored)
playsound(P.loc, 'sound/effects/stealthoff.ogg', 30, 1)
P.loc.visible_message("<span class='notice'>\icon[holder] The bolts lift out of the ground!</span>")
P.anchored = 0
if(WIRE_PROCEED)
if(!mended && P.active)
P.loc.visible_message("<span class='warning'>\icon[holder] An alarm sounds! It's go-</span>")
P.timer = 0
if(WIRE_ACTIVATE)
if (!mended && P.active)
P.loc.visible_message("<span class='notice'>\icon[holder] The timer stops! The bomb has been defused!</span>")
P.icon_state = "syndicate-bomb-inactive-wires" //no cutting possible with the panel closed
P.active = 0
P.defused = 1