Files
CHOMPStation2/code/game/machinery/igniter.dm
johnsonmt88@gmail.com dc599e776b Added emp_act() to some machines.
- Cell charger: Now calls battery emp_act() as well.

- Security Barrier: Now has a chance to toggle the lock.

- Flasher (portable and wall mounted machines, not the item): Now has a chance to flash.

- Wall-Mounted Sparker: Creates sparks.

- Light switch: Toggles the lights when emp'd (not that it'll matter since the lights will probably all have gone out anyway.)

- Weapon Recharger: Calls the energy gun's battery's emp_act() for guns and in the case of stun batons, it sets their charges to 0.

- Cyborg Recharge Station: Cyborgs now get ejected, then emp'd. There would probably be issues with emping the cyborg inside the machine, like being trapped forever or something.

- Sleeper: Eject's the patient. I kind of wish I could make it inject random chems, but it wants a usr and I'm not inclined to start mucking with sleeper code just for this.

- Space Heater: Calls the emp_act() for the battery inside the heater.

- Status Display: Causes the blue screen of death.

- Portable Atmos Pumps: Randomly changes the pressure, has a chance to flip the direction and turn the machine on/off.

- Portable Atmos Scrubber: Has a chance to toggle the machine on/off.

- Arcade Machine: Spits out some random prizes.

- Medical record computer: Runs through the medical records and has a chance to scramble the name, age, sex, blood type, physical or mental state of patients as well as a small chance to delete entries entirely.

- Security record computer: Runs through the security records and has a chance to scramble the name, age, sex, criminal status, physical or mental state of entries as well as a small chance to delete entries entirely.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5237 316c924e-a436-60f5-8080-3fe189b3f50e
2012-12-01 00:45:32 +00:00

147 lines
3.5 KiB
Plaintext

/obj/machinery/igniter/attack_ai(mob/user as mob)
return src.attack_hand(user)
/obj/machinery/igniter/attack_paw(mob/user as mob)
if ((ticker && ticker.mode.name == "monkey"))
return src.attack_hand(user)
return
/obj/machinery/igniter/attack_hand(mob/user as mob)
if(..())
return
add_fingerprint(user)
use_power(50)
src.on = !( src.on )
src.icon_state = text("igniter[]", src.on)
return
/obj/machinery/igniter/process() //ugh why is this even in process()?
if (src.on && !(stat & NOPOWER) )
var/turf/location = src.loc
if (isturf(location))
location.hotspot_expose(1000,500,1)
return 1
/obj/machinery/igniter/New()
..()
icon_state = "igniter[on]"
/obj/machinery/igniter/power_change()
if(!( stat & NOPOWER) )
icon_state = "igniter[src.on]"
else
icon_state = "igniter0"
// Wall mounted remote-control igniter.
/obj/machinery/sparker
name = "Mounted igniter"
desc = "A wall-mounted ignition device."
icon = 'icons/obj/stationobjs.dmi'
icon_state = "migniter"
var/id = null
var/disable = 0
var/last_spark = 0
var/base_state = "migniter"
anchored = 1
/obj/machinery/sparker/New()
..()
/obj/machinery/sparker/power_change()
if ( powered() && disable == 0 )
stat &= ~NOPOWER
icon_state = "[base_state]"
// src.sd_SetLuminosity(2)
else
stat |= ~NOPOWER
icon_state = "[base_state]-p"
// src.sd_SetLuminosity(0)
/obj/machinery/sparker/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/device/detective_scanner))
return
if (istype(W, /obj/item/weapon/screwdriver))
add_fingerprint(user)
src.disable = !src.disable
if (src.disable)
user.visible_message("\red [user] has disabled the [src]!", "\red You disable the connection to the [src].")
icon_state = "[base_state]-d"
if (!src.disable)
user.visible_message("\red [user] has reconnected the [src]!", "\red You fix the connection to the [src].")
if(src.powered())
icon_state = "[base_state]"
else
icon_state = "[base_state]-p"
/obj/machinery/sparker/attack_ai()
if (src.anchored)
return src.ignite()
else
return
/obj/machinery/sparker/proc/ignite()
if (!(powered()))
return
if ((src.disable) || (src.last_spark && world.time < src.last_spark + 50))
return
flick("[base_state]-spark", src)
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(2, 1, src)
s.start()
src.last_spark = world.time
use_power(1000)
var/turf/location = src.loc
if (isturf(location))
location.hotspot_expose(1000,500,1)
return 1
/obj/machinery/sparker/emp_act(severity)
if(stat & (BROKEN|NOPOWER))
..(severity)
return
ignite()
..(severity)
/obj/machinery/ignition_switch/attack_ai(mob/user as mob)
return src.attack_hand(user)
/obj/machinery/ignition_switch/attack_paw(mob/user as mob)
return src.attack_hand(user)
/obj/machinery/ignition_switch/attackby(obj/item/weapon/W, mob/user as mob)
return src.attack_hand(user)
/obj/machinery/ignition_switch/attack_hand(mob/user as mob)
if(stat & (NOPOWER|BROKEN))
return
if(active)
return
use_power(5)
active = 1
icon_state = "launcheract"
for(var/obj/machinery/sparker/M in world)
if (M.id == src.id)
spawn( 0 )
M.ignite()
for(var/obj/machinery/igniter/M in world)
if(M.id == src.id)
use_power(50)
M.on = !( M.on )
M.icon_state = text("igniter[]", M.on)
sleep(50)
icon_state = "launcherbtt"
active = 0
return