mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-18 19:44:58 +01:00
Merge remote-tracking branch 'remotes/upstream/master' into thaw
This commit is contained in:
@@ -0,0 +1,325 @@
|
||||
/obj/structure/AIcore
|
||||
density = 1
|
||||
anchored = 0
|
||||
name = "\improper AI core"
|
||||
icon = 'icons/mob/AI.dmi'
|
||||
icon_state = "0"
|
||||
var/state = 0
|
||||
var/datum/ai_laws/laws = new()
|
||||
var/obj/item/weapon/circuitboard/circuit = null
|
||||
var/obj/item/device/mmi/brain = null
|
||||
|
||||
|
||||
/obj/structure/AIcore/attackby(obj/item/P as obj, mob/user as mob, params)
|
||||
switch(state)
|
||||
if(0)
|
||||
if(istype(P, /obj/item/weapon/wrench))
|
||||
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user << "<span class='notice'>You start wrenching the frame into place...</span>"
|
||||
if(do_after(user, 20))
|
||||
user << "<span class='notice'>You wrench the frame into place.</span>"
|
||||
anchored = 1
|
||||
state = 1
|
||||
if(istype(P, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = P
|
||||
if(!WT.isOn())
|
||||
user << "<span class='warning'>The welder must be on for this task!</span>"
|
||||
return
|
||||
playsound(loc, 'sound/items/Welder.ogg', 50, 1)
|
||||
user << "<span class='notice'>You start to deconstruct the frame...</span>"
|
||||
if(do_after(user, 20))
|
||||
if(!src || !WT.remove_fuel(0, user)) return
|
||||
user << "<span class='notice'>You deconstruct the frame.</span>"
|
||||
new /obj/item/stack/sheet/plasteel( loc, 4)
|
||||
qdel(src)
|
||||
if(1)
|
||||
if(istype(P, /obj/item/weapon/wrench))
|
||||
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user << "<span class='notice'>You start to unfasten the frame...</span>"
|
||||
if(do_after(user, 20))
|
||||
user << "<span class='notice'>You unfasten the frame.</span>"
|
||||
anchored = 0
|
||||
state = 0
|
||||
if(istype(P, /obj/item/weapon/circuitboard/aicore) && !circuit)
|
||||
playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
user << "<span class='notice'>You place the circuit board inside the frame.</span>"
|
||||
icon_state = "1"
|
||||
circuit = P
|
||||
user.drop_item()
|
||||
P.loc = src
|
||||
if(istype(P, /obj/item/weapon/screwdriver) && circuit)
|
||||
playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
user << "<span class='notice'>You screw the circuit board into place.</span>"
|
||||
state = 2
|
||||
icon_state = "2"
|
||||
if(istype(P, /obj/item/weapon/crowbar) && circuit)
|
||||
playsound(loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
user << "<span class='notice'>You remove the circuit board.</span>"
|
||||
state = 1
|
||||
icon_state = "0"
|
||||
circuit.loc = loc
|
||||
circuit = null
|
||||
if(2)
|
||||
if(istype(P, /obj/item/weapon/screwdriver) && circuit)
|
||||
playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
user << "<span class='notice'>You unfasten the circuit board.</span>"
|
||||
state = 1
|
||||
icon_state = "1"
|
||||
if(istype(P, /obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/C = P
|
||||
if(C.get_amount() >= 5)
|
||||
playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
user << "<span class='notice'>You start to add cables to the frame...</span>"
|
||||
if(do_after(user, 20))
|
||||
if (C.get_amount() >= 5 && state == 2)
|
||||
C.use(5)
|
||||
user << "<span class='notice'>You add cables to the frame.</span>"
|
||||
state = 3
|
||||
icon_state = "3"
|
||||
else
|
||||
user << "<span class='warning'>You need five lengths of cable to wire the AI core!</span>"
|
||||
return
|
||||
if(3)
|
||||
if(istype(P, /obj/item/weapon/wirecutters))
|
||||
if (brain)
|
||||
user << "<span class='warning'>Get that brain out of there first!</span>"
|
||||
else
|
||||
playsound(loc, 'sound/items/Wirecutter.ogg', 50, 1)
|
||||
user << "<span class='notice'>You remove the cables.</span>"
|
||||
state = 2
|
||||
icon_state = "2"
|
||||
var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( loc )
|
||||
A.amount = 5
|
||||
|
||||
if(istype(P, /obj/item/stack/sheet/rglass))
|
||||
var/obj/item/stack/sheet/rglass/G = P
|
||||
if(G.get_amount() >= 2)
|
||||
playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
user << "<span class='notice'>You start to put in the glass panel...</span>"
|
||||
if(do_after(user, 20))
|
||||
if (G.get_amount() >= 2 && state == 3)
|
||||
G.use(2)
|
||||
user << "<span class='notice'>You put in the glass panel.</span>"
|
||||
state = 4
|
||||
icon_state = "4"
|
||||
else
|
||||
user << "<span class='warning'>You need two sheets of reinforced glass to insert them into AI core!</span>"
|
||||
return
|
||||
|
||||
if(istype(P, /obj/item/weapon/aiModule/core/full)) //Allows any full core boards to be applied to AI cores.
|
||||
var/obj/item/weapon/aiModule/core/M = P
|
||||
laws.clear_inherent_laws()
|
||||
laws.clear_zeroth_law(0)
|
||||
for(var/templaw in M.laws)
|
||||
laws.add_inherent_law(templaw)
|
||||
usr << "<span class='notice'>Law module applied.</span>"
|
||||
|
||||
if(istype(P, /obj/item/weapon/aiModule/reset/purge))
|
||||
laws.clear_inherent_laws()
|
||||
laws.clear_zeroth_law(0)
|
||||
usr << "<span class='notice'>Laws cleared applied.</span>"
|
||||
|
||||
|
||||
if(istype(P, /obj/item/weapon/aiModule/supplied/freeform) || istype(P, /obj/item/weapon/aiModule/core/freeformcore))
|
||||
var/obj/item/weapon/aiModule/supplied/freeform/M = P
|
||||
if(M.laws[1] == "")
|
||||
return
|
||||
laws.add_inherent_law(M.laws[1])
|
||||
usr << "<span class='notice'>Added a freeform law.</span>"
|
||||
|
||||
if(istype(P, /obj/item/device/mmi))
|
||||
var/obj/item/device/mmi/M = P
|
||||
if(!M.brainmob)
|
||||
user << "<span class='warning'>Sticking an empty MMI into the frame would sort of defeat the purpose!</span>"
|
||||
return
|
||||
if(M.brainmob.stat == DEAD)
|
||||
user << "<span class='warning'>Sticking a dead brain into the frame would sort of defeat the purpose!</span>"
|
||||
return
|
||||
|
||||
if(!M.brainmob.client)
|
||||
user << "<span class='warning'>Sticking an inactive brain into the frame would sort of defeat the purpose.</span>"
|
||||
return
|
||||
|
||||
if((config) && (!config.allow_ai))
|
||||
user << "<span class='warning'>This MMI does not seem to fit!</span>"
|
||||
return
|
||||
|
||||
if(jobban_isbanned(M.brainmob, "AI"))
|
||||
user << "<span class='warning'>This MMI does not seem to fit!</span>"
|
||||
return
|
||||
|
||||
if(!M.brainmob.mind)
|
||||
user << "<span class='warning'>This MMI is mindless!</span>"
|
||||
return
|
||||
|
||||
ticker.mode.remove_cultist(M.brainmob.mind, 1)
|
||||
ticker.mode.remove_revolutionary(M.brainmob.mind, 1)
|
||||
ticker.mode.remove_gangster(M.brainmob.mind, 1)
|
||||
|
||||
user.drop_item()
|
||||
M.loc = src
|
||||
brain = M
|
||||
usr << "<span class='notice'>Added a brain.</span>"
|
||||
icon_state = "3b"
|
||||
|
||||
if(istype(P, /obj/item/weapon/crowbar) && brain)
|
||||
playsound(loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
user << "<span class='notice'>You remove the brain.</span>"
|
||||
brain.loc = loc
|
||||
brain = null
|
||||
icon_state = "3"
|
||||
|
||||
if(4)
|
||||
if(istype(P, /obj/item/weapon/crowbar))
|
||||
playsound(loc, 'sound/items/Crowbar.ogg', 50, 1)
|
||||
user << "<span class='notice'>You remove the glass panel.</span>"
|
||||
state = 3
|
||||
if (brain)
|
||||
icon_state = "3b"
|
||||
else
|
||||
icon_state = "3"
|
||||
new /obj/item/stack/sheet/rglass(loc, 2)
|
||||
return
|
||||
|
||||
if(istype(P, /obj/item/weapon/screwdriver))
|
||||
playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
user << "<span class='notice'>You connect the monitor.</span>"
|
||||
if(!laws.inherent.len) //If laws isn't set to null but nobody supplied a board, the AI would normally be created lawless. We don't want that.
|
||||
laws = null
|
||||
new /mob/living/silicon/ai (loc, laws, brain)
|
||||
feedback_inc("cyborg_ais_created",1)
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/AIcore/deactivated
|
||||
name = "inactive AI"
|
||||
icon = 'icons/mob/AI.dmi'
|
||||
icon_state = "ai-empty"
|
||||
anchored = 1
|
||||
state = 20//So it doesn't interact based on the above. Not really necessary.
|
||||
|
||||
/obj/structure/AIcore/deactivated/attackby(var/obj/item/A as obj, var/mob/user as mob, params)
|
||||
if(istype(A, /obj/item/device/aicard))//Is it?
|
||||
A.transfer_ai("INACTIVE","AICARD",src,user)
|
||||
if(istype(A, /obj/item/weapon/wrench))
|
||||
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user.visible_message("[user] [anchored ? "fastens" : "unfastens"] [src].", \
|
||||
"<span class='notice'>You start to [anchored ? "fasten [src] to" : "unfasten [src] from"] the floor...</span>")
|
||||
switch(anchored)
|
||||
if(0)
|
||||
if(do_after(user, 20))
|
||||
user << "<span class='notice'>You fasten the core into place.</span>"
|
||||
anchored = 1
|
||||
if(1)
|
||||
if(do_after(user, 20))
|
||||
user << "<span class='notice'>You unfasten the core.</span>"
|
||||
anchored = 0
|
||||
return
|
||||
|
||||
/*
|
||||
This is a good place for AI-related object verbs so I'm sticking it here.
|
||||
If adding stuff to this, don't forget that an AI need to cancel_camera() whenever it physically moves to a different location.
|
||||
That prevents a few funky behaviors.
|
||||
*/
|
||||
//What operation to perform based on target, what ineraction to perform based on object used, target itself, user. The object used is src and calls this proc.
|
||||
/obj/item/proc/transfer_ai(var/choice as text, var/interaction as text, var/target, var/mob/U as mob)
|
||||
if(istype(src, /obj/item/device/aicard))
|
||||
var/obj/item/device/aicard/icard = src
|
||||
if(icard.flush)
|
||||
U << "<span class='boldannounce'>ERROR</span>: AI flush is in progress, cannot execute transfer protocol."
|
||||
return
|
||||
|
||||
switch(choice)
|
||||
if("AICORE")//AI mob.
|
||||
var/mob/living/silicon/ai/T = target
|
||||
if(!T.mind)
|
||||
U << "<span class='warning'>No intelligence patterns detected.</span>" //No more magical carding of empty cores, AI RETURN TO BODY!!!11
|
||||
return
|
||||
switch(interaction)
|
||||
if("AICARD")
|
||||
var/obj/item/device/aicard/C = src
|
||||
if(C.contents.len)//If there is an AI on card.
|
||||
U << "<span class='boldannounce'>Transfer failed</span>: Existing AI found on this terminal. Remove existing AI to install a new one."
|
||||
else
|
||||
if (ticker.mode.name == "AI malfunction")
|
||||
var/datum/game_mode/malfunction/malf = ticker.mode
|
||||
for (var/datum/mind/malfai in malf.malf_ai)
|
||||
if (T.mind == malfai)
|
||||
U << "<span class='boldannounce'>ERROR</span>: Remote transfer interface disabled."//Do ho ho ho~
|
||||
return
|
||||
new /obj/structure/AIcore/deactivated(T.loc)//Spawns a deactivated terminal at AI location.
|
||||
T.aiRestorePowerRoutine = 0//So the AI initially has power.
|
||||
T.control_disabled = 1//Can't control things remotely if you're stuck in a card!
|
||||
T.radio_enabled = 0 //No talking on the built-in radio for you either!
|
||||
T.loc = C//Throw AI into the card.
|
||||
C.name = "intelliCard - [T.name]"
|
||||
if (T.stat == 2)
|
||||
C.icon_state = "aicard-404"
|
||||
else
|
||||
C.icon_state = "aicard-full"
|
||||
T.cancel_camera()
|
||||
T << "You have been downloaded to a mobile storage device. Remote device connection severed."
|
||||
U << "<span class='boldnotice'>Transfer successful</span>: [T.name] ([rand(1000,9999)].exe) removed from host terminal and stored within local memory."
|
||||
|
||||
if("INACTIVE")//Inactive AI object.
|
||||
var/obj/structure/AIcore/deactivated/T = target
|
||||
switch(interaction)
|
||||
if("AICARD")
|
||||
var/obj/item/device/aicard/C = src
|
||||
var/mob/living/silicon/ai/A = locate() in C//I love locate(). Best proc ever.
|
||||
if(A)//If AI exists on the card. Else nothing since both are empty.
|
||||
A.control_disabled = 0
|
||||
A.radio_enabled = 1
|
||||
A.loc = T.loc//To replace the terminal.
|
||||
C.icon_state = "aicard"
|
||||
C.name = "intelliCard"
|
||||
C.overlays.Cut()
|
||||
A.cancel_camera()
|
||||
A << "You have been uploaded to a stationary terminal. Remote device connection restored."
|
||||
U << "<span class='boldnotice'>Transfer successful</span>: [A.name] ([rand(1000,9999)].exe) installed and executed successfully. Local copy has been removed."
|
||||
qdel(T)
|
||||
|
||||
if("AIFIXER")//AI Fixer terminal.
|
||||
var/obj/machinery/computer/aifixer/T = target
|
||||
switch(interaction)
|
||||
if("AICARD")
|
||||
var/obj/item/device/aicard/C = src
|
||||
if(!T.contents.len)
|
||||
if (!C.contents.len)
|
||||
U << "No AI to copy over!"//Well duh
|
||||
else for(var/mob/living/silicon/ai/A in C)
|
||||
C.icon_state = "aicard"
|
||||
C.name = "intelliCard"
|
||||
C.overlays.Cut()
|
||||
A.loc = T
|
||||
T.occupier = A
|
||||
A.control_disabled = 1
|
||||
A.radio_enabled = 0
|
||||
if (A.stat == 2)
|
||||
T.overlays += image('icons/obj/computer.dmi', "ai-fixer-404")
|
||||
else
|
||||
T.overlays += image('icons/obj/computer.dmi', "ai-fixer-full")
|
||||
T.overlays -= image('icons/obj/computer.dmi', "ai-fixer-empty")
|
||||
A.cancel_camera()
|
||||
A << "You have been uploaded to a stationary terminal. Sadly, there is no remote access from here."
|
||||
U << "<span class='boldnotice'>Transfer successful</span>: [A.name] ([rand(1000,9999)].exe) installed and executed successfully. Local copy has been removed."
|
||||
else
|
||||
if(!C.contents.len && T.occupier && !T.active)
|
||||
C.name = "intelliCard - [T.occupier.name]"
|
||||
T.overlays += image('icons/obj/computer.dmi', "ai-fixer-empty")
|
||||
if (T.occupier.stat == 2)
|
||||
C.icon_state = "aicard-404"
|
||||
T.overlays -= image('icons/obj/computer.dmi', "ai-fixer-404")
|
||||
else
|
||||
C.icon_state = "aicard-full"
|
||||
T.overlays -= image('icons/obj/computer.dmi', "ai-fixer-full")
|
||||
T.occupier << "You have been downloaded to a mobile storage device. Still no remote access."
|
||||
U << "<span class='boldnotice'>Transfer successful</span>: [T.occupier.name] ([rand(1000,9999)].exe) removed from host terminal and stored within local memory."
|
||||
T.occupier.loc = C
|
||||
T.occupier.cancel_camera()
|
||||
T.occupier = null
|
||||
else if (C.contents.len)
|
||||
U << "<span class='boldannounce'>ERROR</span>: Artificial intelligence detected on terminal."
|
||||
else if (T.active)
|
||||
U << "<span class='boldannounce'>ERROR</span>: Reconstruction in progress."
|
||||
else if (!T.occupier)
|
||||
U << "<span class='boldannounce'>ERROR</span>: Unable to locate artificial intelligence."
|
||||
@@ -50,7 +50,7 @@
|
||||
|
||||
/obj/structure/sign/barsign/attack_hand(mob/user as mob)
|
||||
if (!src.allowed(user))
|
||||
user << "<span class = 'info'>Access denied.</span>"
|
||||
user << "<span class='info'>Access denied.</span>"
|
||||
return
|
||||
if (broken)
|
||||
user << "<span class ='danger'>The controls seem unresponsive.</span>"
|
||||
@@ -62,7 +62,7 @@
|
||||
|
||||
/obj/structure/sign/barsign/attackby(var/obj/item/I, var/mob/user)
|
||||
if(!allowed(user))
|
||||
user << "<span class = 'info'>Access denied.</span>"
|
||||
user << "<span class='info'>Access denied.</span>"
|
||||
return
|
||||
if( istype(I, /obj/item/weapon/screwdriver))
|
||||
if(!panel_open)
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
return (!density)
|
||||
|
||||
/obj/structure/closet/proc/can_open()
|
||||
if(src.welded || src.locked)
|
||||
if(welded || locked)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
@@ -81,32 +81,32 @@
|
||||
/obj/structure/closet/proc/dump_contents()
|
||||
|
||||
for(var/obj/O in src)
|
||||
O.loc = src.loc
|
||||
O.loc = loc
|
||||
|
||||
for(var/mob/M in src)
|
||||
M.loc = src.loc
|
||||
M.loc = loc
|
||||
if(M.client)
|
||||
M.client.eye = M.client.mob
|
||||
M.client.perspective = MOB_PERSPECTIVE
|
||||
|
||||
/obj/structure/closet/proc/take_contents()
|
||||
|
||||
for(var/atom/movable/AM in src.loc)
|
||||
for(var/atom/movable/AM in loc)
|
||||
if(insert(AM) == -1) // limit reached
|
||||
break
|
||||
|
||||
/obj/structure/closet/proc/open()
|
||||
if(src.opened)
|
||||
if(opened)
|
||||
return 0
|
||||
if(!src.can_open())
|
||||
if(!can_open())
|
||||
return 0
|
||||
src.dump_contents()
|
||||
dump_contents()
|
||||
|
||||
src.opened = 1
|
||||
opened = 1
|
||||
if(istype(src, /obj/structure/closet/body_bag))
|
||||
playsound(src.loc, 'sound/items/zip.ogg', 15, 1, -3)
|
||||
playsound(loc, 'sound/items/zip.ogg', 15, 1, -3)
|
||||
else
|
||||
playsound(src.loc, 'sound/machines/click.ogg', 15, 1, -3)
|
||||
playsound(loc, 'sound/machines/click.ogg', 15, 1, -3)
|
||||
density = 0
|
||||
update_icon()
|
||||
return 1
|
||||
@@ -139,25 +139,25 @@
|
||||
return 1
|
||||
|
||||
/obj/structure/closet/proc/close()
|
||||
if(!src.opened)
|
||||
if(!opened)
|
||||
return 0
|
||||
if(!src.can_close())
|
||||
if(!can_close())
|
||||
return 0
|
||||
take_contents()
|
||||
|
||||
src.opened = 0
|
||||
opened = 0
|
||||
if(istype(src, /obj/structure/closet/body_bag))
|
||||
playsound(src.loc, 'sound/items/zip.ogg', 15, 1, -3)
|
||||
playsound(loc, 'sound/items/zip.ogg', 15, 1, -3)
|
||||
else
|
||||
playsound(src.loc, 'sound/machines/click.ogg', 15, 1, -3)
|
||||
playsound(loc, 'sound/machines/click.ogg', 15, 1, -3)
|
||||
density = 1
|
||||
update_icon()
|
||||
return 1
|
||||
|
||||
/obj/structure/closet/proc/toggle()
|
||||
if(src.opened)
|
||||
return src.close()
|
||||
return src.open()
|
||||
if(opened)
|
||||
return close()
|
||||
return open()
|
||||
|
||||
/obj/structure/closet/ex_act(severity, target)
|
||||
contents_explosion(severity, target)
|
||||
@@ -192,9 +192,9 @@
|
||||
return
|
||||
if(opened)
|
||||
if(istype(W, /obj/item/weapon/grab))
|
||||
if(src.large)
|
||||
if(large)
|
||||
var/obj/item/weapon/grab/G = W
|
||||
src.MouseDrop_T(G.affecting, user) //act like they were dragged onto the closet
|
||||
MouseDrop_T(G.affecting, user) //act like they were dragged onto the closet
|
||||
user.drop_item()
|
||||
else
|
||||
user << "<span class='notice'>The locker is too small to stuff [W] into!</span>"
|
||||
@@ -210,7 +210,7 @@
|
||||
if( !opened || !istype(src, /obj/structure/closet) || !user || !WT || !WT.isOn() || !user.loc )
|
||||
return
|
||||
playsound(loc, 'sound/items/Welder2.ogg', 50, 1)
|
||||
new /obj/item/stack/sheet/metal(src.loc)
|
||||
new /obj/item/stack/sheet/metal(loc)
|
||||
visible_message("[user] has cut \the [src] apart with \the [WT].", "<span class='italics'>You hear welding.</span>")
|
||||
qdel(src)
|
||||
return
|
||||
@@ -239,10 +239,10 @@
|
||||
user << "<span class='notice'>The locker appears to be broken.</span>"
|
||||
return
|
||||
if(!place(user, W) && !isnull(W))
|
||||
src.attack_hand(user)
|
||||
attack_hand(user)
|
||||
|
||||
/obj/structure/closet/proc/place(var/mob/user, var/obj/item/I)
|
||||
if(!src.opened && secure)
|
||||
if(!opened && secure)
|
||||
togglelock(user)
|
||||
return 1
|
||||
return 0
|
||||
@@ -258,21 +258,21 @@
|
||||
return 0
|
||||
if(!istype(user.loc, /turf)) // are you in a container/closet/pod/etc? Will also check for null loc
|
||||
return 0
|
||||
if(needs_opened && !src.opened)
|
||||
if(needs_opened && !opened)
|
||||
return 0
|
||||
if(istype(O, /obj/structure/closet))
|
||||
return 0
|
||||
if(move_them)
|
||||
step_towards(O, src.loc)
|
||||
step_towards(O, loc)
|
||||
if(show_message && user != O)
|
||||
user.show_viewers("<span class='danger'>[user] stuffs [O] into [src]!</span>")
|
||||
src.add_fingerprint(user)
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
|
||||
/obj/structure/closet/relaymove(mob/user as mob)
|
||||
if(user.stat || !isturf(src.loc))
|
||||
if(user.stat || !isturf(loc))
|
||||
return
|
||||
if(!src.open())
|
||||
if(!open())
|
||||
user << "<span class='notice'>It won't budge!</span>"
|
||||
if(world.time > lastbang+5)
|
||||
lastbang = world.time
|
||||
@@ -281,19 +281,20 @@
|
||||
|
||||
|
||||
/obj/structure/closet/attack_paw(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/structure/closet/attack_hand(mob/user as mob)
|
||||
src.add_fingerprint(user)
|
||||
add_fingerprint(user)
|
||||
if(user.lying && get_dist(src, user) > 0)
|
||||
return
|
||||
|
||||
if(!src.toggle())
|
||||
return src.attackby(null, user)
|
||||
if(!toggle())
|
||||
togglelock(user)
|
||||
return
|
||||
|
||||
// tk grab then use on self
|
||||
/obj/structure/closet/attack_self_tk(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/structure/closet/verb/verb_toggleopen()
|
||||
set src in oview(1)
|
||||
@@ -304,7 +305,7 @@
|
||||
return
|
||||
|
||||
if(iscarbon(usr) || issilicon(usr))
|
||||
src.attack_hand(usr)
|
||||
attack_hand(usr)
|
||||
else
|
||||
usr << "<span class='warning'>This mob type can't use this verb.</span>"
|
||||
|
||||
@@ -322,7 +323,7 @@
|
||||
if(istype(user.loc, /obj/structure/closet/critter) && !welded)
|
||||
breakout_time = 0.75 //45 seconds if it's an unwelded critter crate
|
||||
|
||||
if( opened || (!welded && !locked && !istype(src.loc, /obj/mecha)) )
|
||||
if( opened || (!welded && !locked && !istype(loc, /obj/mecha)) )
|
||||
return //Door's open, not locked or welded or inside a mech, no point in resisting.
|
||||
|
||||
//okay, so the closet is either welded or locked... resist!!!
|
||||
@@ -332,7 +333,7 @@
|
||||
for(var/mob/O in viewers(src))
|
||||
O << "<span class='warning'>[src] begins to shake violently!</span>"
|
||||
if(do_after(user,(breakout_time*60*10))) //minutes * 60seconds * 10deciseconds
|
||||
if(!user || user.stat != CONSCIOUS || user.loc != src || opened || (!locked && !welded && !istype(src.loc, /obj/mecha)) )
|
||||
if(!user || user.stat != CONSCIOUS || user.loc != src || opened || (!locked && !welded && !istype(loc, /obj/mecha)) )
|
||||
return
|
||||
//we check after a while whether there is a point of resisting anymore and whether the user is capable of resisting
|
||||
|
||||
@@ -340,11 +341,11 @@
|
||||
locked = 0 //applies to critter crates and secure lockers only
|
||||
broken = 1 //applies to secure lockers only
|
||||
user.visible_message("<span class='danger'>[user] successfully broke out of [src]!</span>", "<span class='notice'>You successfully break out of [src]!</span>")
|
||||
if(istype( src.loc, /obj/structure/bigDelivery))
|
||||
var/obj/structure/bigDelivery/D = src.loc
|
||||
if(istype( loc, /obj/structure/bigDelivery))
|
||||
var/obj/structure/bigDelivery/D = loc
|
||||
qdel(D)
|
||||
else if(istype( src.loc, /obj/mecha))
|
||||
src.loc = get_turf(src.loc)
|
||||
else if(istype( loc, /obj/mecha))
|
||||
loc = get_turf(loc)
|
||||
open()
|
||||
else
|
||||
user << "<span class='warning'>You fail to break out of [src]!</span>"
|
||||
@@ -354,7 +355,7 @@
|
||||
if(!user.canUseTopic(user) || broken)
|
||||
user << "<span class='warning'>You can't do that right now!</span>"
|
||||
return
|
||||
if(src.opened || !secure || !in_range(src, user))
|
||||
if(opened || !secure || !in_range(src, user))
|
||||
return
|
||||
else
|
||||
togglelock(user)
|
||||
@@ -364,20 +365,20 @@
|
||||
O.emp_act(severity)
|
||||
if(secure && !broken)
|
||||
if(prob(50/severity))
|
||||
src.locked = !src.locked
|
||||
src.update_icon()
|
||||
locked = !locked
|
||||
update_icon()
|
||||
if(prob(20/severity) && !opened)
|
||||
if(!locked)
|
||||
open()
|
||||
else
|
||||
src.req_access = list()
|
||||
src.req_access += pick(get_all_accesses())
|
||||
req_access = list()
|
||||
req_access += pick(get_all_accesses())
|
||||
..()
|
||||
|
||||
/obj/structure/closet/proc/togglelock(mob/user as mob)
|
||||
if(secure)
|
||||
if(src.allowed(user))
|
||||
src.locked = !src.locked
|
||||
if(allowed(user))
|
||||
locked = !locked
|
||||
add_fingerprint(user)
|
||||
for(var/mob/O in viewers(user, 3))
|
||||
if((O.client && !( O.eye_blind )))
|
||||
|
||||
@@ -23,11 +23,11 @@
|
||||
|
||||
if (isrobot(user) || src.locked)
|
||||
if(istype(O, /obj/item/device/multitool))
|
||||
user << "<span class = 'caution'> Resetting circuitry...</span>"
|
||||
user << "<span class='caution'>Resetting circuitry...</span>"
|
||||
playsound(user, 'sound/machines/lockreset.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
src.locked = 0
|
||||
user << "<span class = 'caution'> You disable the locking modules.</span>"
|
||||
user << "<span class='caution'>You disable the locking modules.</span>"
|
||||
update_icon()
|
||||
return
|
||||
else if(istype(O, /obj/item/weapon))
|
||||
@@ -43,7 +43,7 @@
|
||||
user.do_attack_animation(src)
|
||||
playsound(user, 'sound/effects/Glasshit.ogg', 100, 1) //We don't want this playing every time
|
||||
if(W.force < 15)
|
||||
user << "<span class = 'warning'> The cabinet's protective glass glances off the hit.</span>"
|
||||
user << "<span class='warning'>The cabinet's protective glass glances off the hit.</span>"
|
||||
else
|
||||
src.hitstaken++
|
||||
if(src.hitstaken == 4)
|
||||
@@ -56,12 +56,12 @@
|
||||
if (istype(O, /obj/item/weapon/twohanded/fireaxe) && src.localopened)
|
||||
if(!fireaxe)
|
||||
if(O:wielded)
|
||||
user << "<span class = 'warning'> Unwield the axe first.</span>"
|
||||
user << "<span class='warning'>Unwield the axe first.</span>"
|
||||
return
|
||||
fireaxe = O
|
||||
user.drop_item()
|
||||
src.contents += O
|
||||
user << "<span class = 'caution'> You place the fire axe back in the [src.name].</span>"
|
||||
user << "<span class='caution'>You place the fire axe back in the [src.name].</span>"
|
||||
update_icon()
|
||||
else
|
||||
if(src.smashed)
|
||||
@@ -84,11 +84,11 @@
|
||||
spawn(10) update_icon()
|
||||
return
|
||||
else
|
||||
user << "<span class = 'caution'> Resetting circuitry...</span>"
|
||||
user << "<span class='caution'>Resetting circuitry...</span>"
|
||||
playsound(user, 'sound/machines/lockenable.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
src.locked = 1
|
||||
user << "<span class = 'caution'> You re-enable the locking modules.</span>"
|
||||
user << "<span class='caution'>You re-enable the locking modules.</span>"
|
||||
return
|
||||
else
|
||||
localopened = !localopened
|
||||
@@ -144,13 +144,13 @@
|
||||
hasaxe = 1
|
||||
|
||||
if(src.locked)
|
||||
user <<"<span class = 'warning'> The cabinet won't budge!</span>"
|
||||
user <<"<span class='warning'>The cabinet won't budge!</span>"
|
||||
return
|
||||
if(localopened)
|
||||
if(fireaxe)
|
||||
user.put_in_hands(fireaxe)
|
||||
fireaxe = null
|
||||
user << "<span class = 'caution'> You take the fire axe from the [name].</span>"
|
||||
user << "<span class='caution'>You take the fire axe from the [name].</span>"
|
||||
src.add_fingerprint(user)
|
||||
update_icon()
|
||||
else
|
||||
@@ -177,7 +177,7 @@
|
||||
/obj/structure/closet/fireaxecabinet/attack_tk(mob/user as mob)
|
||||
if(localopened && fireaxe)
|
||||
fireaxe.loc = loc
|
||||
user << "<span class = 'caution'> You telekinetically remove the fire axe.</span>"
|
||||
user << "<span class='caution'>You telekinetically remove the fire axe.</span>"
|
||||
fireaxe = null
|
||||
update_icon()
|
||||
return
|
||||
@@ -221,14 +221,14 @@
|
||||
|
||||
/obj/structure/closet/fireaxecabinet/attack_ai(mob/user as mob)
|
||||
if(src.smashed)
|
||||
user << "<span class = 'warning'> The security of the cabinet is compromised.</span>"
|
||||
user << "<span class='warning'>The security of the cabinet is compromised.</span>"
|
||||
return
|
||||
else
|
||||
locked = !locked
|
||||
if(locked)
|
||||
user << "<span class = 'caution'> Cabinet locked.</span>"
|
||||
user << "<span class='caution'>Cabinet locked.</span>"
|
||||
else
|
||||
user << "<span class = 'caution'> Cabinet unlocked.</span>"
|
||||
user << "<span class='caution'>Cabinet unlocked.</span>"
|
||||
return
|
||||
|
||||
/obj/structure/closet/fireaxecabinet/update_icon() //Template: fireaxe[has fireaxe][is opened][hits taken][is smashed]. If you want the opening or closing animations, add "opening" or "closing" right after the numbers
|
||||
|
||||
@@ -311,6 +311,8 @@
|
||||
new /obj/item/weapon/storage/backpack/chemistry(src)
|
||||
new /obj/item/weapon/storage/backpack/satchel_chem(src)
|
||||
new /obj/item/weapon/storage/backpack/satchel_chem(src)
|
||||
new /obj/item/weapon/storage/bag/chemistry(src)
|
||||
new /obj/item/weapon/storage/bag/chemistry(src)
|
||||
return
|
||||
|
||||
|
||||
|
||||
@@ -436,7 +436,7 @@
|
||||
|
||||
if(mineral && mineral != "glass")
|
||||
mineral = null //I know this is stupid, but until we change glass to a boolean it's how this code works.
|
||||
user << "<span class='notice'> You change the paintjob on the airlock assembly.</span>"
|
||||
user << "<span class='notice'>You change the paintjob on the airlock assembly.</span>"
|
||||
|
||||
else if(istype(W, /obj/item/weapon/weldingtool) && !anchored )
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
@@ -448,7 +448,7 @@
|
||||
if(do_after(user, 40))
|
||||
if( !WT.isOn() )
|
||||
return
|
||||
user << "<span class='notice'> You disassemble the airlock assembly.</span>"
|
||||
user << "<span class='notice'>You disassemble the airlock assembly.</span>"
|
||||
new /obj/item/stack/sheet/metal(get_turf(src), 4)
|
||||
if (mineral)
|
||||
if (mineral == "glass")
|
||||
@@ -480,7 +480,7 @@
|
||||
if(do_after(user, 40))
|
||||
if( src.anchored )
|
||||
return
|
||||
user << "<span class='notice'> You secure the airlock assembly.</span>"
|
||||
user << "<span class='notice'>You secure the airlock assembly.</span>"
|
||||
src.name = "secured airlock assembly"
|
||||
src.anchored = 1
|
||||
else
|
||||
@@ -494,7 +494,7 @@
|
||||
if(do_after(user, 40))
|
||||
if( !src.anchored )
|
||||
return
|
||||
user << "<span class='notice'> You unsecure the airlock assembly.</span>"
|
||||
user << "<span class='notice'>You unsecure the airlock assembly.</span>"
|
||||
src.name = "airlock assembly"
|
||||
src.anchored = 0
|
||||
|
||||
@@ -520,7 +520,7 @@
|
||||
if(do_after(user, 40))
|
||||
if( src.state != 1 )
|
||||
return
|
||||
user << "<span class='notice'> You cut the wires from the airlock assembly.</span>"
|
||||
user << "<span class='notice'>You cut the wires from the airlock assembly.</span>"
|
||||
new/obj/item/stack/cable_coil(get_turf(user), 1)
|
||||
src.state = 0
|
||||
src.name = "secured airlock assembly"
|
||||
@@ -535,7 +535,7 @@
|
||||
|
||||
user.drop_item()
|
||||
W.loc = src
|
||||
user << "<span class='notice'> You install the airlock electronics.</span>"
|
||||
user << "<span class='notice'>You install the airlock electronics.</span>"
|
||||
src.state = 2
|
||||
src.name = "near finished airlock assembly"
|
||||
src.electronics = W
|
||||
@@ -549,7 +549,7 @@
|
||||
if(do_after(user, 40))
|
||||
if( src.state != 2 )
|
||||
return
|
||||
user << "<span class='notice'> You remove the airlock electronics.</span>"
|
||||
user << "<span class='notice'>You remove the airlock electronics.</span>"
|
||||
src.state = 1
|
||||
src.name = "wired airlock assembly"
|
||||
var/obj/item/weapon/airlock_electronics/ae
|
||||
@@ -614,7 +614,7 @@
|
||||
|
||||
if(do_after(user, 40))
|
||||
if(src.loc && state == 2)
|
||||
user << "<span class='notice'> You finish the airlock.</span>"
|
||||
user << "<span class='notice'>You finish the airlock.</span>"
|
||||
var/obj/machinery/door/airlock/door
|
||||
if(mineral == "glass")
|
||||
door = new src.glass_type( src.loc )
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
/obj/structure/janitorialcart/proc/wet_mop(obj/item/weapon/mop, mob/user)
|
||||
if(reagents.total_volume < 1)
|
||||
user << "[src] is out of water!</span>"
|
||||
user << "<span class='warning'>[src] is out of water!</span>"
|
||||
else
|
||||
reagents.trans_to(mop, 5) //
|
||||
user << "<span class='notice'>You wet [mop] in [src].</span>"
|
||||
|
||||
@@ -106,7 +106,20 @@
|
||||
name = "magic mirror"
|
||||
desc = "Turn and face the strange... face."
|
||||
icon_state = "magic_mirror"
|
||||
var/list/races_blacklist = list("skeleton")
|
||||
var/list/choosable_races = list()
|
||||
|
||||
/obj/structure/mirror/magic/New()
|
||||
if(!choosable_races.len)
|
||||
for(var/datum/species/S in typesof(/datum/species) - /datum/species)
|
||||
if(!(S.id in races_blacklist))
|
||||
choosable_races += S
|
||||
..()
|
||||
|
||||
/obj/structure/mirror/magic/badmin/New()
|
||||
for(var/datum/species/S in typesof(/datum/species) - /datum/species)
|
||||
choosable_races += S
|
||||
..()
|
||||
|
||||
/obj/structure/mirror/magic/attack_hand(mob/user as mob)
|
||||
if(!ishuman(user))
|
||||
@@ -130,7 +143,7 @@
|
||||
|
||||
if("race")
|
||||
var/newrace
|
||||
var/racechoice = input(H, "What are we again?", "Race change") as null|anything in species_list
|
||||
var/racechoice = input(H, "What are we again?", "Race change") as null|anything in choosable_races
|
||||
newrace = species_list[racechoice]
|
||||
|
||||
if(!newrace || !H.dna)
|
||||
@@ -150,7 +163,7 @@
|
||||
var/temp_hsv = RGBtoHSV(new_mutantcolor)
|
||||
|
||||
if(ReadHSV(temp_hsv)[3] >= ReadHSV("#7F7F7F")[3]) // mutantcolors must be bright
|
||||
H.dna.mutant_color = sanitize_hexcolor(new_mutantcolor)
|
||||
H.dna.features["mcolor"] = sanitize_hexcolor(new_mutantcolor)
|
||||
|
||||
else
|
||||
H << "<span class='notice'>Invalid color. Your color is not bright enough.</span>"
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
icon = 'icons/obj/janitor.dmi'
|
||||
icon_state = "mopbucket"
|
||||
density = 1
|
||||
pressure_resistance = 5
|
||||
flags = OPENCONTAINER
|
||||
var/amount_per_transfer_from_this = 5 //shit I dunno, adding this so syringes stop runtime erroring. --NeoFite
|
||||
|
||||
|
||||
@@ -348,20 +348,20 @@
|
||||
if (istype(O, /obj/item/weapon/wrench))
|
||||
if (!anchored && !isinspace())
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user << "<span class='notice'> You begin to tighten \the [src] to the floor...</span>"
|
||||
user << "<span class='notice'>You begin to tighten \the [src] to the floor...</span>"
|
||||
if (do_after(user, 20))
|
||||
user.visible_message( \
|
||||
"[user] tightens \the [src]'s casters.", \
|
||||
"<span class='notice'> You tighten \the [src]'s casters. Now it can be played again.</span>", \
|
||||
"<span class='notice'>You tighten \the [src]'s casters. Now it can be played again.</span>", \
|
||||
"<span class='italics'>You hear ratchet.</span>")
|
||||
anchored = 1
|
||||
else if(anchored)
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user << "<span class='notice'> You begin to loosen \the [src]'s casters...</span>"
|
||||
user << "<span class='notice'>You begin to loosen \the [src]'s casters...</span>"
|
||||
if (do_after(user, 40))
|
||||
user.visible_message( \
|
||||
"[user] loosens \the [src]'s casters.", \
|
||||
"<span class='notice'> You loosen \the [src]. Now it can be pulled somewhere else.</span>", \
|
||||
"<span class='notice'>You loosen \the [src]. Now it can be pulled somewhere else.</span>", \
|
||||
"<span class='italics'>You hear ratchet.</span>")
|
||||
anchored = 0
|
||||
else
|
||||
|
||||
@@ -11,10 +11,18 @@
|
||||
name = "\improper Centcom identification console"
|
||||
desc = "You can use this to change ID's."
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "id"
|
||||
icon_state = "computer"
|
||||
|
||||
/obj/structure/showcase/fakeid/New()
|
||||
overlays += "id"
|
||||
overlays += "id_key"
|
||||
|
||||
/obj/structure/showcase/fakesec
|
||||
name = "\improper Centcom security records"
|
||||
desc = "Used to view and edit personnel's security records"
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "security"
|
||||
icon_state = "computer"
|
||||
|
||||
/obj/structure/showcase/fakesec/New()
|
||||
overlays += "security"
|
||||
overlays += "security_key"
|
||||
@@ -4,7 +4,6 @@
|
||||
icon = 'icons/obj/objects.dmi'
|
||||
icon_state = "stool"
|
||||
anchored = 1.0
|
||||
pressure_resistance = 5
|
||||
|
||||
/obj/structure/stool/ex_act(severity, target)
|
||||
switch(severity)
|
||||
|
||||
@@ -32,28 +32,37 @@
|
||||
return
|
||||
if(istype(I, /obj/item/stack/sheet/plasteel))
|
||||
var/obj/item/stack/sheet/plasteel/P = I
|
||||
if(P.get_amount() < 1)
|
||||
user << "<span class='warning'>You need one plasteel sheet to do this!</span>"
|
||||
return
|
||||
user << "<span class='notice'>You start adding [P] to [src]...</span>"
|
||||
if(do_after(user, 50))
|
||||
P.use(1)
|
||||
new /obj/structure/table/reinforced(src.loc)
|
||||
qdel(src)
|
||||
P.use(1)
|
||||
return
|
||||
return
|
||||
if(istype(I, /obj/item/stack/sheet/metal))
|
||||
var/obj/item/stack/sheet/metal/M = I
|
||||
if(M.get_amount() < 1)
|
||||
user << "<span class='warning'>You need one metal sheet to do this!</span>"
|
||||
return
|
||||
user << "<span class='notice'>You start adding [M] to [src]...</span>"
|
||||
if(do_after(user, 20))
|
||||
M.use(1)
|
||||
new /obj/structure/table(src.loc)
|
||||
qdel(src)
|
||||
M.use(1)
|
||||
return
|
||||
return
|
||||
if(istype(I, /obj/item/stack/sheet/glass))
|
||||
var/obj/item/stack/sheet/glass/G = I
|
||||
if(G.get_amount() < 1)
|
||||
user << "<span class='warning'>You need one glass sheet to do this!</span>"
|
||||
return
|
||||
user << "<span class='notice'>You start adding [G] to [src]...</span>"
|
||||
if(do_after(user, 20))
|
||||
G.use(1)
|
||||
new /obj/structure/table/glass(src.loc)
|
||||
qdel(src)
|
||||
G.use(1)
|
||||
return
|
||||
return
|
||||
|
||||
/*
|
||||
* Wooden Frames
|
||||
@@ -71,17 +80,23 @@
|
||||
..()
|
||||
if(istype(I, /obj/item/stack/sheet/mineral/wood))
|
||||
var/obj/item/stack/sheet/mineral/wood/W = I
|
||||
if(W.get_amount() < 1)
|
||||
user << "<span class='warning'>You need one wood sheet to do this!</span>"
|
||||
return
|
||||
user << "<span class='notice'>You start adding [W] to [src]...</span>"
|
||||
if(do_after(user, 20))
|
||||
W.use(1)
|
||||
new /obj/structure/table/wood(src.loc)
|
||||
qdel(src)
|
||||
W.use(1)
|
||||
return
|
||||
return
|
||||
if(istype(I, /obj/item/stack/tile/carpet))
|
||||
var/obj/item/stack/tile/carpet/C = I
|
||||
if(C.get_amount() < 1)
|
||||
user << "<span class='warning'>You need one carpet sheet to do this!</span>"
|
||||
return
|
||||
user << "<span class='notice'>You start adding [C] to [src]...</span>"
|
||||
if(do_after(user, 20))
|
||||
C.use(1)
|
||||
new /obj/structure/table/wood/poker(src.loc)
|
||||
qdel(src)
|
||||
C.use(1)
|
||||
return
|
||||
return
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
/obj/structure/windoor_assembly/New(dir=NORTH)
|
||||
..()
|
||||
src.ini_dir = src.dir
|
||||
ini_dir = dir
|
||||
air_update_turf(1)
|
||||
|
||||
/obj/structure/windoor_assembly/Destroy()
|
||||
@@ -77,7 +77,7 @@
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if (WT.remove_fuel(0,user))
|
||||
user.visible_message("[user] disassembles the windoor assembly.", "<span class='notice'>You start to disassemble the windoor assembly...</span>")
|
||||
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
|
||||
playsound(loc, 'sound/items/Welder2.ogg', 50, 1)
|
||||
|
||||
if(do_after(user, 40))
|
||||
if(!src || !WT.isOn()) return
|
||||
@@ -93,41 +93,41 @@
|
||||
|
||||
//Wrenching an unsecure assembly anchors it in place. Step 4 complete
|
||||
if(istype(W, /obj/item/weapon/wrench) && !anchored)
|
||||
for(var/obj/machinery/door/window/WD in src.loc)
|
||||
if(WD.dir == src.dir)
|
||||
for(var/obj/machinery/door/window/WD in loc)
|
||||
if(WD.dir == dir)
|
||||
user << "<span class='warning'>There is already a windoor in that location!</span>"
|
||||
return
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
|
||||
playsound(loc, 'sound/items/Ratchet.ogg', 100, 1)
|
||||
user.visible_message("[user] secures the windoor assembly to the floor.", "<span class='notice'>You start to secure the windoor assembly to the floor...</span>")
|
||||
|
||||
if(do_after(user, 40))
|
||||
if(!src || src.anchored)
|
||||
if(!src || anchored)
|
||||
return
|
||||
for(var/obj/machinery/door/window/WD in src.loc)
|
||||
if(WD.dir == src.dir)
|
||||
for(var/obj/machinery/door/window/WD in loc)
|
||||
if(WD.dir == dir)
|
||||
user << "<span class='warning'>There is already a windoor in that location!</span>"
|
||||
return
|
||||
user << "<span class='notice'>You secure the windoor assembly.</span>"
|
||||
src.anchored = 1
|
||||
if(src.secure)
|
||||
src.name = "secure anchored windoor assembly"
|
||||
anchored = 1
|
||||
if(secure)
|
||||
name = "secure anchored windoor assembly"
|
||||
else
|
||||
src.name = "anchored windoor assembly"
|
||||
name = "anchored windoor assembly"
|
||||
|
||||
//Unwrenching an unsecure assembly un-anchors it. Step 4 undone
|
||||
else if(istype(W, /obj/item/weapon/wrench) && anchored)
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
|
||||
playsound(loc, 'sound/items/Ratchet.ogg', 100, 1)
|
||||
user.visible_message("[user] unsecures the windoor assembly to the floor.", "<span class='notice'>You start to unsecure the windoor assembly to the floor...</span>")
|
||||
|
||||
if(do_after(user, 40))
|
||||
if(!src || !src.anchored)
|
||||
if(!src || !anchored)
|
||||
return
|
||||
user << "<span class='notice'>You unsecure the windoor assembly.</span>"
|
||||
src.anchored = 0
|
||||
if(src.secure)
|
||||
src.name = "secure windoor assembly"
|
||||
anchored = 0
|
||||
if(secure)
|
||||
name = "secure windoor assembly"
|
||||
else
|
||||
src.name = "windoor assembly"
|
||||
name = "windoor assembly"
|
||||
|
||||
//Adding plasteel makes the assembly a secure windoor assembly. Step 2 (optional) complete.
|
||||
else if(istype(W, /obj/item/stack/sheet/plasteel) && !secure)
|
||||
@@ -143,27 +143,29 @@
|
||||
|
||||
P.use(2)
|
||||
user << "<span class='notice'>You reinforce the windoor.</span>"
|
||||
src.secure = 1
|
||||
if(src.anchored)
|
||||
src.name = "secure anchored windoor assembly"
|
||||
secure = 1
|
||||
if(anchored)
|
||||
name = "secure anchored windoor assembly"
|
||||
else
|
||||
src.name = "secure windoor assembly"
|
||||
name = "secure windoor assembly"
|
||||
|
||||
//Adding cable to the assembly. Step 5 complete.
|
||||
else if(istype(W, /obj/item/stack/cable_coil) && anchored)
|
||||
user.visible_message("[user] wires the windoor assembly.", "<span class='notice'>You start to wire the windoor assembly...</span>")
|
||||
|
||||
if(do_after(user, 40))
|
||||
if(!src || !src.anchored || src.state != "01")
|
||||
if(!src || !anchored || state != "01")
|
||||
return
|
||||
var/obj/item/stack/cable_coil/CC = W
|
||||
CC.use(1)
|
||||
if(!CC.use(1))
|
||||
user << "<span class='warning'>You need more cable to do this!</span>"
|
||||
return
|
||||
user << "<span class='notice'>You wire the windoor.</span>"
|
||||
src.state = "02"
|
||||
if(src.secure)
|
||||
src.name = "secure wired windoor assembly"
|
||||
state = "02"
|
||||
if(secure)
|
||||
name = "secure wired windoor assembly"
|
||||
else
|
||||
src.name = "wired windoor assembly"
|
||||
name = "wired windoor assembly"
|
||||
else
|
||||
..()
|
||||
|
||||
@@ -171,61 +173,61 @@
|
||||
|
||||
//Removing wire from the assembly. Step 5 undone.
|
||||
if(istype(W, /obj/item/weapon/wirecutters))
|
||||
playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
|
||||
playsound(loc, 'sound/items/Wirecutter.ogg', 100, 1)
|
||||
user.visible_message("[user] cuts the wires from the airlock assembly.", "<span class='notice'>You start to cut the wires from airlock assembly...</span>")
|
||||
|
||||
if(do_after(user, 40))
|
||||
if(!src || src.state != "02")
|
||||
if(!src || state != "02")
|
||||
return
|
||||
|
||||
user << "<span class='notice'>You cut the windoor wires.</span>"
|
||||
new/obj/item/stack/cable_coil(get_turf(user), 1)
|
||||
src.state = "01"
|
||||
if(src.secure)
|
||||
src.name = "secure anchored windoor assembly"
|
||||
state = "01"
|
||||
if(secure)
|
||||
name = "secure anchored windoor assembly"
|
||||
else
|
||||
src.name = "anchored windoor assembly"
|
||||
name = "anchored windoor assembly"
|
||||
|
||||
//Adding airlock electronics for access. Step 6 complete.
|
||||
else if(istype(W, /obj/item/weapon/airlock_electronics))
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
|
||||
playsound(loc, 'sound/items/Screwdriver.ogg', 100, 1)
|
||||
user.visible_message("[user] installs the electronics into the airlock assembly.", "<span class='notice'>You start to install electronics into the airlock assembly...</span>")
|
||||
user.drop_item()
|
||||
W.loc = src
|
||||
|
||||
if(do_after(user, 40))
|
||||
if(!src || src.electronics)
|
||||
W.loc = src.loc
|
||||
if(!src || electronics)
|
||||
W.loc = loc
|
||||
return
|
||||
user << "<span class='notice'>You install the airlock electronics.</span>"
|
||||
src.name = "near finished windoor assembly"
|
||||
src.electronics = W
|
||||
name = "near finished windoor assembly"
|
||||
electronics = W
|
||||
else
|
||||
W.loc = src.loc
|
||||
W.loc = loc
|
||||
|
||||
//Screwdriver to remove airlock electronics. Step 6 undone.
|
||||
else if(istype(W, /obj/item/weapon/screwdriver))
|
||||
if(!electronics)
|
||||
return
|
||||
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
|
||||
playsound(loc, 'sound/items/Screwdriver.ogg', 100, 1)
|
||||
user.visible_message("[user] removes the electronics from the airlock assembly.", "<span class='notice'>You start to uninstall electronics from the airlock assembly...</span>")
|
||||
|
||||
if(do_after(user, 40))
|
||||
if(!src || !electronics)
|
||||
return
|
||||
user << "<span class='notice'>You remove the airlock electronics.</span>"
|
||||
src.name = "wired windoor assembly"
|
||||
name = "wired windoor assembly"
|
||||
var/obj/item/weapon/airlock_electronics/ae
|
||||
ae = electronics
|
||||
electronics = null
|
||||
ae.loc = src.loc
|
||||
ae.loc = loc
|
||||
|
||||
else if(istype(W, /obj/item/weapon/pen))
|
||||
var/t = stripped_input(user, "Enter the name for the door.", src.name, src.created_name,MAX_NAME_LEN)
|
||||
var/t = stripped_input(user, "Enter the name for the door.", name, created_name,MAX_NAME_LEN)
|
||||
if(!t)
|
||||
return
|
||||
if(!in_range(src, usr) && src.loc != usr)
|
||||
if(!in_range(src, usr) && loc != usr)
|
||||
return
|
||||
created_name = t
|
||||
return
|
||||
@@ -234,37 +236,37 @@
|
||||
|
||||
//Crowbar to complete the assembly, Step 7 complete.
|
||||
else if(istype(W, /obj/item/weapon/crowbar))
|
||||
if(!src.electronics)
|
||||
if(!electronics)
|
||||
usr << "<span class='warning'>The assembly is missing electronics!</span>"
|
||||
return
|
||||
usr << browse(null, "window=windoor_access")
|
||||
playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
|
||||
playsound(loc, 'sound/items/Crowbar.ogg', 100, 1)
|
||||
user.visible_message("[user] pries the windoor into the frame.", "<span class='notice'>You start prying the windoor into the frame...</span>")
|
||||
|
||||
if(do_after(user, 40))
|
||||
|
||||
if(src.loc && src.electronics)
|
||||
if(loc && electronics)
|
||||
|
||||
density = 1 //Shouldn't matter but just incase
|
||||
user << "<span class='notice'>You finish the windoor.</span>"
|
||||
|
||||
if(secure)
|
||||
var/obj/machinery/door/window/brigdoor/windoor = new /obj/machinery/door/window/brigdoor(src.loc)
|
||||
if(src.facing == "l")
|
||||
var/obj/machinery/door/window/brigdoor/windoor = new /obj/machinery/door/window/brigdoor(loc)
|
||||
if(facing == "l")
|
||||
windoor.icon_state = "leftsecureopen"
|
||||
windoor.base_state = "leftsecure"
|
||||
else
|
||||
windoor.icon_state = "rightsecureopen"
|
||||
windoor.base_state = "rightsecure"
|
||||
windoor.dir = src.dir
|
||||
windoor.dir = dir
|
||||
windoor.density = 0
|
||||
|
||||
if(src.electronics.use_one_access)
|
||||
windoor.req_one_access = src.electronics.conf_access
|
||||
if(electronics.use_one_access)
|
||||
windoor.req_one_access = electronics.conf_access
|
||||
else
|
||||
windoor.req_access = src.electronics.conf_access
|
||||
windoor.electronics = src.electronics
|
||||
src.electronics.loc = windoor
|
||||
windoor.req_access = electronics.conf_access
|
||||
windoor.electronics = electronics
|
||||
electronics.loc = windoor
|
||||
if(created_name)
|
||||
windoor.name = created_name
|
||||
qdel(src)
|
||||
@@ -272,19 +274,19 @@
|
||||
|
||||
|
||||
else
|
||||
var/obj/machinery/door/window/windoor = new /obj/machinery/door/window(src.loc)
|
||||
if(src.facing == "l")
|
||||
var/obj/machinery/door/window/windoor = new /obj/machinery/door/window(loc)
|
||||
if(facing == "l")
|
||||
windoor.icon_state = "leftopen"
|
||||
windoor.base_state = "left"
|
||||
else
|
||||
windoor.icon_state = "rightopen"
|
||||
windoor.base_state = "right"
|
||||
windoor.dir = src.dir
|
||||
windoor.dir = dir
|
||||
windoor.density = 0
|
||||
|
||||
windoor.req_access = src.electronics.conf_access
|
||||
windoor.electronics = src.electronics
|
||||
src.electronics.loc = windoor
|
||||
windoor.req_access = electronics.conf_access
|
||||
windoor.electronics = electronics
|
||||
electronics.loc = windoor
|
||||
if(created_name)
|
||||
windoor.name = created_name
|
||||
qdel(src)
|
||||
@@ -305,18 +307,18 @@
|
||||
set src in oview(1)
|
||||
if(usr.stat || !usr.canmove || usr.restrained())
|
||||
return
|
||||
if (src.anchored)
|
||||
if (anchored)
|
||||
usr << "<span class='warning'>It is fastened to the floor; therefore, you can't rotate it!</span>"
|
||||
return 0
|
||||
//if(src.state != "01")
|
||||
//if(state != "01")
|
||||
//update_nearby_tiles(need_rebuild=1) //Compel updates before
|
||||
|
||||
src.dir = turn(src.dir, 270)
|
||||
dir = turn(dir, 270)
|
||||
|
||||
//if(src.state != "01")
|
||||
//if(state != "01")
|
||||
//update_nearby_tiles(need_rebuild=1)
|
||||
|
||||
src.ini_dir = src.dir
|
||||
ini_dir = dir
|
||||
update_icon()
|
||||
return
|
||||
|
||||
@@ -328,11 +330,11 @@
|
||||
if(usr.stat || !usr.canmove || usr.restrained())
|
||||
return
|
||||
|
||||
if(src.facing == "l")
|
||||
if(facing == "l")
|
||||
usr << "<span class='notice'>The windoor will now slide to the right.</span>"
|
||||
src.facing = "r"
|
||||
facing = "r"
|
||||
else
|
||||
src.facing = "l"
|
||||
facing = "l"
|
||||
usr << "<span class='notice'>The windoor will now slide to the left.</span>"
|
||||
|
||||
update_icon()
|
||||
|
||||
@@ -235,7 +235,7 @@
|
||||
|
||||
else if(istype(I, /obj/item/weapon/wrench) && !anchored)
|
||||
playsound(loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
user << "<span class='notice'> You begin to disassemble [src]...</span>"
|
||||
user << "<span class='notice'>You begin to disassemble [src]...</span>"
|
||||
if(do_after(user, 40))
|
||||
if(disassembled)
|
||||
return //Prevents multiple deconstruction attempts
|
||||
@@ -256,7 +256,7 @@
|
||||
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
disassembled = 1
|
||||
user << "<span class='notice'> You successfully disassemble [src].</span>"
|
||||
user << "<span class='notice'>You successfully disassemble [src].</span>"
|
||||
qdel(src)
|
||||
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user