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
This commit is contained in:
johnsonmt88@gmail.com
2012-12-01 00:45:32 +00:00
parent ed2aa3d785
commit dc599e776b
16 changed files with 191 additions and 1 deletions

View File

@@ -230,7 +230,13 @@
del(src)
return
return
emp_act(severity)
if(stat & (BROKEN|NOPOWER))
..(severity)
return
if(occupant)
go_out()
..(severity)
alter_health(mob/living/M as mob)
if (M.health > 0)

View File

@@ -27,6 +27,22 @@
return
/obj/machinery/portable_atmospherics/pump/emp_act(severity)
if(stat & (BROKEN|NOPOWER))
..(severity)
return
if(prob(50/severity))
on = !on
if(prob(100/severity))
direction_out = !direction_out
target_pressure = rand(0,1300)
update_icon()
..(severity)
/obj/machinery/portable_atmospherics/pump/process()
..()
if(on)

View File

@@ -10,6 +10,17 @@
volume = 750
/obj/machinery/portable_atmospherics/scrubber/emp_act(severity)
if(stat & (BROKEN|NOPOWER))
..(severity)
return
if(prob(50/severity))
on = !on
update_icon()
..(severity)
/obj/machinery/portable_atmospherics/scrubber/huge
name = "Huge Air Scrubber"
icon_state = "scrubber:0"

View File

@@ -79,6 +79,14 @@
attack_ai(mob/user)
return
emp_act(severity)
if(stat & (BROKEN|NOPOWER))
return
if(charging)
charging.emp_act(severity)
..(severity)
process()
//world << "ccpt [charging] [stat]"
if(!charging || (stat & (BROKEN|NOPOWER)) || !anchored)

View File

@@ -270,3 +270,19 @@
A.icon_state = "4"
del(src)
/obj/machinery/computer/arcade/emp_act(severity)
if(stat & (NOPOWER|BROKEN))
..(severity)
return
var/empprize = null
var/num_of_prizes = 0
switch(severity)
if(1)
num_of_prizes = rand(1,4)
if(2)
num_of_prizes = rand(0,2)
for(num_of_prizes; num_of_prizes > 0; num_of_prizes--)
empprize = pickweight(prizes)
new empprize(src.loc)
..(severity)

View File

@@ -431,6 +431,34 @@
src.updateUsrDialog()
return
/obj/machinery/computer/med_data/emp_act(severity)
if(stat & (BROKEN|NOPOWER))
..(severity)
return
for(var/datum/data/record/R in data_core.medical)
if(prob(10/severity))
switch(rand(1,6))
if(1)
R.fields["name"] = "[pick(pick(first_names_male), pick(first_names_female))] [pick(last_names)]"
if(2)
R.fields["sex"] = pick("Male", "Female")
if(3)
R.fields["age"] = rand(5, 85)
if(4)
R.fields["b_type"] = pick("A-", "B-", "AB-", "O-", "A+", "B+", "AB+", "O+")
if(5)
R.fields["p_stat"] = pick("*Unconcious*", "Active", "Physically Unfit")
if(6)
R.fields["m_stat"] = pick("*Insane*", "*Unstable*", "*Watch*", "Stable")
continue
else if(prob(1))
del(R)
continue
..(severity)
/obj/machinery/computer/med_data/laptop
name = "Medical Laptop"

View File

@@ -526,6 +526,34 @@ What a mess.*/
updateUsrDialog()
return
/obj/machinery/computer/secure_data/emp_act(severity)
if(stat & (BROKEN|NOPOWER))
..(severity)
return
for(var/datum/data/record/R in data_core.security)
if(prob(10/severity))
switch(rand(1,6))
if(1)
R.fields["name"] = "[pick(pick(first_names_male), pick(first_names_female))] [pick(last_names)]"
if(2)
R.fields["sex"] = pick("Male", "Female")
if(3)
R.fields["age"] = rand(5, 85)
if(4)
R.fields["criminal"] = pick("None", "*Arrest*", "Incarcerated", "Parolled", "Released")
if(5)
R.fields["p_stat"] = pick("*Unconcious*", "Active", "Physically Unfit")
if(6)
R.fields["m_stat"] = pick("*Insane*", "*Unstable*", "*Watch*", "Stable")
continue
else if(prob(1))
del(R)
continue
..(severity)
/obj/machinery/computer/secure_data/detective_computer
icon = 'icons/obj/computer.dmi'
icon_state = "messyfiles"

View File

@@ -229,6 +229,13 @@ for reference:
if (src.health <= 0)
src.explode()
return
emp_act(severity)
if(stat & (BROKEN|NOPOWER))
return
if(prob(50/severity))
locked = !locked
anchored = !anchored
icon_state = "barrier[src.locked]"
meteorhit()
src.explode()

View File

@@ -88,6 +88,14 @@
O.eye_stat += rand(0, 2)
/obj/machinery/flasher/emp_act(severity)
if(stat & (BROKEN|NOPOWER))
..(severity)
return
if(prob(75/severity))
flash()
..(severity)
/obj/machinery/flasher/portable/HasProximity(atom/movable/AM as mob|obj)
if ((src.disable) || (src.last_flash && world.time < src.last_flash + 150))
return

View File

@@ -100,6 +100,12 @@
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)

View File

@@ -60,3 +60,9 @@
updateicon()
/obj/machinery/light_switch/emp_act(severity)
if(stat & (BROKEN|NOPOWER))
..(severity)
return
power_change()
..(severity)

View File

@@ -34,3 +34,9 @@
O.throw_at(target, drive_range * power, power)
flick("mass_driver1", src)
return
emp_act(severity)
if(stat & (BROKEN|NOPOWER))
return
drive()
..(severity)

View File

@@ -80,6 +80,21 @@ obj/machinery/recharger/process()
else
icon_state = "recharger2"
obj/machinery/recharger/emp_act(severity)
if(stat & (NOPOWER|BROKEN) || !anchored)
..(severity)
return
if(istype(charging, /obj/item/weapon/gun/energy))
var/obj/item/weapon/gun/energy/E = charging
if(E.power_supply)
E.power_supply.emp_act(severity)
else if(istype(charging, /obj/item/weapon/melee/baton))
var/obj/item/weapon/melee/baton/B = charging
B.charges = 0
..(severity)
obj/machinery/recharger/update_icon() //we have an update_icon() in addition to the stuff in process to make it feel a tiny bit snappier.
if(charging)
icon_state = "recharger1"

View File

@@ -34,6 +34,15 @@
src.go_out()
return
emp_act(severity)
if(stat & (BROKEN|NOPOWER))
..(severity)
return
if(occupant)
occupant.emp_act(severity)
go_out()
..(severity)
proc
build_icon()
if(NOPOWER|BROKEN)

View File

@@ -43,6 +43,13 @@
usr << "The charge meter reads [cell ? round(cell.percent(),1) : 0]%"
return
emp_act(severity)
if(stat & (BROKEN|NOPOWER))
..(severity)
return
if(cell)
cell.emp_act(severity)
..(severity)
attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/weapon/cell))

View File

@@ -52,6 +52,12 @@
update()
emp_act(severity)
if(stat & (BROKEN|NOPOWER))
..(severity)
return
set_picture("ai_bsod")
..(severity)
// set what is displayed
@@ -271,6 +277,13 @@
update()
emp_act(severity)
if(stat & (BROKEN|NOPOWER))
..(severity)
return
set_picture("ai_bsod")
..(severity)
proc/update()
if(mode==0) //Blank