Files
Polaris/code/game/machinery/OpTable.dm
Erthilo 36effbacc2 TG: There's a metric assload of stuff here, mostly in preparation to my massive
traitor expansion, so I'll try to be brief:

- I added in the foundations for traitor factions. See factions.dm for all the
different faction datums. They don't do anything yet.

- I completely ported mob/var/mutations from a bitfield to a generic list.
Mutation enumerated-identifiers are added into this list. For instance, TK = 1,
COLD_RESISTANCE = 2, XRAY = 3, etc... The purpose of this was because bitwise
operations could not actually be used after a certain size (because BYOND is
stuck in the 16bit era).

- I've added in completely-functional nano-augmentations. Check under
implantnanoaug.dm for a list of implants and implaners. As mentioned previously,
they are completely functional but may be slightly OP. Among these nanoaugs are
Super Strength, Psionic Radar, Electric Hands, Energy Blade/Sword Synthesizer,
Rebreather, Dermal Armor, Combat Reflexes, and Regenerative Nanorobots. I won't
go into detail as to what they do, but hopefully they should be self-
explanitory. If not, check out their descriptions in the file previously
mentioned.

- Added in a future traitor item, the Mind Batterer. Along with it a new .ogg
file.

- New telecomms bus mainframe sprite, thanks to WJohnston.

- New holdable shield, sprites courtesy of Muncher (i had to mangle the side
sprites because of a technical little issue. I'll change it back to the original
soon). It can be retracted and expanded. Probably only going to be given to
traitors.

- A couple of minor bugfixes here and there, along with some code tidying.

Hope this isn't too large a commit. I intended it to be MUCH larger, but I've
decided to split up my Traitor Factions expansion into smaller commits.
Revision: r3692
Author: 	 vageyenaman
2012-06-02 19:46:18 +01:00

180 lines
4.4 KiB
Plaintext

/obj/machinery/optable
name = "Operating Table"
desc = "Used for advanced medical procedures. Apparently this includes the clown."
icon = 'surgery.dmi'
icon_state = "table2-idle"
density = 1
anchored = 1.0
use_power = 1
idle_power_usage = 1
active_power_usage = 5
var/mob/living/carbon/victim = null
var/strapped = 0.0
var/updatesicon = 1
var/obj/machinery/computer/operating/computer = null
/obj/machinery/optable/New()
..()
for(dir in list(NORTH,EAST,SOUTH,WEST))
computer = locate(/obj/machinery/computer/operating, get_step(src, dir))
if (!isnull(computer))
break
spawn(100)
process()
/obj/machinery/optable/ex_act(severity)
switch(severity)
if(1.0)
//SN src = null
del(src)
return
if(2.0)
if (prob(50))
//SN src = null
del(src)
return
if(3.0)
if (prob(25))
src.density = 0
else
return
/obj/machinery/optable/blob_act()
if(prob(75))
del(src)
/obj/machinery/optable/hand_p(mob/user as mob)
return src.attack_paw(user)
return
/obj/machinery/optable/attack_paw(mob/user as mob)
if ((HULK in usr.mutations))
usr << text("\blue You destroy the operating table.")
for(var/mob/O in oviewers())
if ((O.client && !( O.blinded )))
O << text("\red [usr] destroys the operating table.")
src.density = 0
del(src)
if (!( locate(/obj/machinery/optable, user.loc) ))
step(user, get_dir(user, src))
if (user.loc == src.loc)
user.layer = TURF_LAYER
for(var/mob/M in viewers(user, null))
M.show_message("The monkey hides under the table!", 1)
//Foreach goto(69)
return
/obj/machinery/optable/attack_hand(mob/user as mob)
if ((HULK in usr.mutations) || (SUPRSTR in usr.augmentations))
usr << text("\blue You destroy the table.")
for(var/mob/O in oviewers())
if ((O.client && !( O.blinded )))
O << text("\red [usr] destroys the table.")
src.density = 0
del(src)
return
/obj/machinery/optable/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(air_group || (height==0)) return 1
if(istype(mover) && mover.pass_flags&PASSTABLE)
return 1
else
return 0
/obj/machinery/optable/MouseDrop_T(obj/O as obj, mob/user as mob)
if(isrobot(user))
return
if ((!( istype(O, /obj/item/weapon) ) || user.equipped() != O))
return
user.drop_item()
if (O.loc != src.loc)
step(O, get_dir(O, src))
return
/obj/machinery/optable/proc/check_victim()
if(locate(/mob/living/carbon, src.loc))
var/mob/M = locate(/mob/living/carbon, src.loc)
if(M.resting)
victim = M
if(updatesicon)
icon_state = "table2-active"
return 1
if(victim)
victim.update_clothing()
victim = null
if(updatesicon)
icon_state = "table2-idle"
processing_objects.Remove(src)
return 0
/obj/machinery/optable/process()
check_victim()
/obj/machinery/optable/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(isrobot(user))
return
if (istype(W, /obj/item/weapon/grab))
if(ismob(W:affecting))
var/mob/M = W:affecting
if (M.client)
M.client.perspective = EYE_PERSPECTIVE
M.client.eye = src
M.resting = 1
M.loc = src.loc
for (var/mob/C in viewers(src))
C.show_message("\red [M] has been laid on the operating table by [user].", 3)
for(var/obj/O in src)
O.loc = src.loc
src.add_fingerprint(user)
if(updatesicon)
icon_state = "table2-active"
src.victim = M
M.update_clothing()
processing_objects.Add(src)
del(W)
return
user.drop_item()
if(W && W.loc)
W.loc = src.loc
return
/obj/machinery/optable/portable
name = "mobile operating table"
desc = "Used for advanced medical procedures. Seems to be movable, neat."
icon = 'rollerbed.dmi'
icon_state = "up"
density = 1
anchored = 0
updatesicon = 0
New()
..()
attackby(obj/item/weapon/W as obj, mob/user as mob)
if(!anchored)
return
return ..()
verb/make_deployable()
set category = "Object"
set name = "Deploy Table"
set src in oview(1)
if(anchored)
if(victim)
usr << "You can't do that with someone on the table!"
else
anchored = 0
for(var/mob/M in orange(5,src))
M.show_message("\blue [usr] releases the locks on the table's casters!")
icon_state = "up"
else
anchored = 1
for(var/mob/M in orange(5,src))
M.show_message("\blue [usr] locks the table's casters in place!")
icon_state = "down"