Files
Aurora.3/code/game/machinery/rechargestation.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

182 lines
4.8 KiB
Plaintext

/obj/machinery/recharge_station
name = "cyborg recharging station"
icon = 'icons/obj/objects.dmi'
icon_state = "borgcharger0"
density = 1
anchored = 1.0
use_power = 1
idle_power_usage = 5
active_power_usage = 1000
var/mob/occupant = null
New()
..()
build_icon()
process()
if(!(NOPOWER|BROKEN))
return
if(src.occupant)
process_occupant()
return 1
allow_drop()
return 0
relaymove(mob/user as mob)
if(user.stat)
return
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)
if(src.occupant)
icon_state = "borgcharger1"
else
icon_state = "borgcharger0"
else
icon_state = "borgcharger0"
process_occupant()
if(src.occupant)
if (istype(occupant, /mob/living/silicon/robot))
var/mob/living/silicon/robot/R = occupant
restock_modules()
if(!R.cell)
return
else if(R.cell.charge >= R.cell.maxcharge)
R.cell.charge = R.cell.maxcharge
return
else
R.cell.charge = min(R.cell.charge + 200, R.cell.maxcharge)
return
go_out()
if(!( src.occupant ))
return
//for(var/obj/O in src)
// O.loc = src.loc
if (src.occupant.client)
src.occupant.client.eye = src.occupant.client.mob
src.occupant.client.perspective = MOB_PERSPECTIVE
src.occupant.loc = src.loc
src.occupant = null
build_icon()
src.use_power = 1
return
restock_modules()
if(src.occupant)
if(istype(occupant, /mob/living/silicon/robot))
var/mob/living/silicon/robot/R = occupant
if(R.module && R.module.modules)
var/list/um = R.contents|R.module.modules
// ^ makes sinle list of active (R.contents) and inactive modules (R.module.modules)
for(var/obj/O in um)
// Engineering
if(istype(O,/obj/item/stack/sheet/metal) || istype(O,/obj/item/stack/sheet/rglass) || istype(O,/obj/item/weapon/cable_coil))
if(O:amount < 50)
O:amount += 1
// Security
if(istype(O,/obj/item/device/flash))
if(O:broken)
O:broken = 0
O:times_used = 0
O:icon_state = "flash"
if(istype(O,/obj/item/weapon/gun/energy/taser/cyborg))
if(O:power_supply.charge < O:power_supply.maxcharge)
O:power_supply.give(O:charge_cost)
O:update_icon()
else
O:charge_tick = 0
if(istype(O,/obj/item/weapon/melee/baton))
if(O:charges < 10)
O:charges += 1
//Service
if(istype(O,/obj/item/weapon/reagent_containers/food/condiment/enzyme))
if(O.reagents.get_reagent_amount("enzyme") < 50)
O.reagents.add_reagent("enzyme", 2)
//Medical
if(istype(O,/obj/item/weapon/reagent_containers/glass/bottle/robot))
var/obj/item/weapon/reagent_containers/glass/bottle/robot/B = O
if(B.reagent && (B.reagents.get_reagent_amount(B.reagent) < B.volume))
B.reagents.add_reagent(B.reagent, 2)
//Janitor
if(istype(O, /obj/item/device/lightreplacer))
var/obj/item/device/lightreplacer/LR = O
LR.Charge(R)
if(R)
if(R.module)
R.module.respawn_consumable(R)
//Emagged items for janitor and medical borg
if(R.module.emag)
if(istype(R.module.emag, /obj/item/weapon/reagent_containers/spray))
var/obj/item/weapon/reagent_containers/spray/S = R.module.emag
if(S.name == "Polyacid spray")
S.reagents.add_reagent("pacid", 2)
else if(S.name == "Lube spray")
S.reagents.add_reagent("lube", 2)
verb
move_eject()
set category = "Object"
set src in oview(1)
if (usr.stat != 0)
return
src.go_out()
add_fingerprint(usr)
return
move_inside()
set category = "Object"
set src in oview(1)
if (usr.stat == 2)
//Whoever had it so that a borg with a dead cell can't enter this thing should be shot. --NEO
return
if (!(istype(usr, /mob/living/silicon/)))
usr << "\blue <B>Only non-organics may enter the recharger!</B>"
return
if (src.occupant)
usr << "\blue <B>The cell is already occupied!</B>"
return
if (!usr:cell)
usr<<"\blue Without a powercell, you can't be recharged."
//Make sure they actually HAVE a cell, now that they can get in while powerless. --NEO
return
usr.stop_pulling()
if(usr && usr.client)
usr.client.perspective = EYE_PERSPECTIVE
usr.client.eye = src
usr.loc = src
src.occupant = usr
/*for(var/obj/O in src)
O.loc = src.loc*/
src.add_fingerprint(usr)
build_icon()
src.use_power = 2
return