Cleans up some Machinery Attackby

This commit is contained in:
Fox McCloud
2018-05-20 03:10:04 -04:00
parent a49fcfd53f
commit 0b79d8a9b7
31 changed files with 406 additions and 364 deletions
+10 -4
View File
@@ -57,9 +57,10 @@
if(exchange_parts(user, I))
return
default_deconstruction_crowbar(I)
if(default_deconstruction_crowbar(I))
return
if(istype(I, /obj/item/wrench))
if(iswrench(I))
if(!panel_open)
to_chat(user, "<span class='notice'>Open the maintenance panel first.</span>")
return
@@ -75,6 +76,8 @@
break
build_network()
update_icon()
else
return ..()
/obj/machinery/atmospherics/unary/cold_sink/freezer/update_icon()
if(panel_open)
@@ -216,9 +219,10 @@
if(exchange_parts(user, I))
return
default_deconstruction_crowbar(I)
if(default_deconstruction_crowbar(I))
return
if(istype(I, /obj/item/wrench))
if(iswrench(I))
if(!panel_open)
to_chat(user, "<span class='notice'>Open the maintenance panel first.</span>")
return
@@ -234,6 +238,8 @@
break
build_network()
update_icon()
else
return ..()
/obj/machinery/atmospherics/unary/heat_reservoir/heater/update_icon()
if(panel_open)
+11 -10
View File
@@ -143,19 +143,20 @@
take_victim(usr,usr)
/obj/machinery/optable/attackby(obj/item/W as obj, mob/living/carbon/user as mob, params)
if(istype(W, /obj/item/grab))
if(iscarbon(W:affecting))
take_victim(W:affecting,usr)
qdel(W)
return
if(istype(W, /obj/item/wrench))
playsound(src.loc, W.usesound, 50, 1)
if(do_after(user, 20 * W.toolspeed, target = src))
/obj/machinery/optable/attackby(obj/item/I, mob/living/carbon/user, params)
if(istype(I, /obj/item/grab))
var/obj/item/grab/G = I
if(iscarbon(G.affecting))
take_victim(G.affecting, user)
qdel(G)
if(iswrench(I))
playsound(loc, I.usesound, 50, 1)
if(do_after(user, 20 * I.toolspeed, target = src))
to_chat(user, "<span class='notice'>You deconstruct the table.</span>")
new /obj/item/stack/sheet/plasteel(loc, 5)
qdel(src)
else
return ..()
/obj/machinery/optable/proc/check_table(mob/living/carbon/patient as mob)
if(src.victim && get_turf(victim) == get_turf(src) && victim.lying)
+10 -8
View File
@@ -43,19 +43,21 @@
QDEL_NULL(storedpda)
return ..()
/obj/machinery/pdapainter/attackby(var/obj/item/O as obj, var/mob/user as mob, params)
if(istype(O, /obj/item/pda))
/obj/machinery/pdapainter/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/pda))
if(storedpda)
to_chat(user, "There is already a PDA inside.")
return
else
var/obj/item/pda/P = usr.get_active_hand()
var/obj/item/pda/P = user.get_active_hand()
if(istype(P))
user.drop_item()
storedpda = P
P.loc = src
P.add_fingerprint(usr)
update_icon()
if(user.drop_item())
storedpda = P
P.forceMove(src)
P.add_fingerprint(user)
update_icon()
else
return ..()
/obj/machinery/pdapainter/attack_hand(mob/user as mob)
+58 -57
View File
@@ -97,10 +97,10 @@
return
if(beaker.reagents.total_volume < beaker.reagents.maximum_volume)
src.occupant.transfer_blood_to(beaker, 1)
for(var/datum/reagent/x in src.occupant.reagents.reagent_list)
src.occupant.reagents.trans_to(beaker, 3)
src.occupant.transfer_blood_to(beaker, 1)
occupant.transfer_blood_to(beaker, 1)
for(var/datum/reagent/x in occupant.reagents.reagent_list)
occupant.reagents.trans_to(beaker, 3)
occupant.transfer_blood_to(beaker, 1)
if(occupant)
for(var/A in occupant.reagents.addiction_list)
@@ -117,7 +117,7 @@
if(M == occupant)
continue
else
M.forceMove(src.loc)
M.forceMove(loc)
updateDialog()
return
@@ -253,7 +253,7 @@
to_chat(usr, "<span class='notice'>Close the maintenance panel first.</span>")
return 0
if((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon/ai)))
if((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon/ai)))
if(href_list["chemical"])
if(occupant)
if(occupant.stat == DEAD)
@@ -268,7 +268,7 @@
toggle_filter()
if(href_list["ejectify"])
eject()
src.add_fingerprint(usr)
add_fingerprint(usr)
return 1
/obj/machinery/sleeper/blob_act()
@@ -280,31 +280,31 @@
return
/obj/machinery/sleeper/attackby(var/obj/item/G as obj, var/mob/user as mob, params)
if(istype(G, /obj/item/reagent_containers/glass))
/obj/machinery/sleeper/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/reagent_containers/glass))
if(!beaker)
if(!user.drop_item())
to_chat(user, "<span class='warning'>\The [G] is stuck to you!</span>")
to_chat(user, "<span class='warning'>[I] is stuck to you!</span>")
return
beaker = G
G.forceMove(src)
user.visible_message("[user] adds \a [G] to \the [src]!", "You add \a [G] to \the [src]!")
beaker = I
I.forceMove(src)
user.visible_message("[user] adds \a [I] to [src]!", "You add \a [I] to [src]!")
return
else
to_chat(user, "<span class='warning'>The sleeper has a beaker already.</span>")
return
if(istype(G, /obj/item/screwdriver))
if(src.occupant)
if(isscrewdriver(I))
if(occupant)
to_chat(user, "<span class='notice'>The maintenance panel is locked.</span>")
return
default_deconstruction_screwdriver(user, "[base_icon]-o", "[base_icon]-open", G)
default_deconstruction_screwdriver(user, "[base_icon]-o", "[base_icon]-open", I)
return
if(istype(G, /obj/item/wrench))
if(src.occupant)
if(iswrench(I))
if(occupant)
to_chat(user, "<span class='notice'>The scanner is occupied.</span>")
return
if(panel_open)
@@ -312,51 +312,52 @@
return
if(dir == 4)
orient = "LEFT"
dir = 8
setDir(8)
else
orient = "RIGHT"
dir = 4
playsound(src.loc, G.usesound, 50, 1)
setDir(4)
playsound(loc, I.usesound, 50, 1)
return
if(exchange_parts(user, G))
if(exchange_parts(user, I))
return
if(istype(G, /obj/item/crowbar))
default_deconstruction_crowbar(G)
if(default_deconstruction_crowbar(I))
return
if(istype(G, /obj/item/grab))
if(istype(I, /obj/item/grab))
var/obj/item/grab/G = I
if(panel_open)
to_chat(user, "<span class='boldnotice'>Close the maintenance panel first.</span>")
return
if(!ismob(G:affecting))
if(!ismob(G.affecting))
return
if(src.occupant)
if(occupant)
to_chat(user, "<span class='boldnotice'>The sleeper is already occupied!</span>")
return
for(var/mob/living/carbon/slime/M in range(1,G:affecting))
if(M.Victim == G:affecting)
to_chat(usr, "[G:affecting.name] will not fit into the sleeper because they have a slime latched onto their head.")
for(var/mob/living/carbon/slime/M in range(1, G.affecting))
if(M.Victim == G.affecting)
to_chat(usr, "[G.affecting.name] will not fit into the sleeper because they have a slime latched onto their head.")
return
visible_message("[user] starts putting [G:affecting:name] into the sleeper.")
visible_message("[user] starts putting [G.affecting:name] into the sleeper.")
if(do_after(user, 20, target = G:affecting))
if(src.occupant)
if(do_after(user, 20, target = G.affecting))
if(occupant)
to_chat(user, "<span class='boldnotice'>The sleeper is already occupied!</span>")
return
if(!G || !G:affecting) return
if(!G || !G.affecting)
return
var/mob/M = G:affecting
M.forceMove(src)
src.occupant = M
src.icon_state = "[base_icon]"
occupant = M
icon_state = "[base_icon]"
to_chat(M, "<span class='boldnotice'>You feel cool air surround you. You go numb as your senses turn inward.</span>")
src.add_fingerprint(user)
add_fingerprint(user)
qdel(G)
return
return
else
return ..()
/obj/machinery/sleeper/ex_act(severity)
@@ -365,21 +366,21 @@
switch(severity)
if(1.0)
for(var/atom/movable/A as mob|obj in src)
A.forceMove(src.loc)
A.forceMove(loc)
A.ex_act(severity)
qdel(src)
return
if(2.0)
if(prob(50))
for(var/atom/movable/A as mob|obj in src)
A.forceMove(src.loc)
A.forceMove(loc)
A.ex_act(severity)
qdel(src)
return
if(3.0)
if(prob(25))
for(var/atom/movable/A as mob|obj in src)
A.forceMove(src.loc)
A.forceMove(loc)
A.ex_act(severity)
qdel(src)
return
@@ -422,10 +423,10 @@
to_chat(user, "<span class='notice'>The sleeper does not offer that chemical!</notice>")
return
if(src.occupant)
if(src.occupant.reagents)
if(src.occupant.reagents.get_reagent_amount(chemical) + amount <= max_chem)
src.occupant.reagents.add_reagent(chemical, amount)
if(occupant)
if(occupant.reagents)
if(occupant.reagents.get_reagent_amount(chemical) + amount <= max_chem)
occupant.reagents.add_reagent(chemical, amount)
return
else
to_chat(user, "You can not inject any more of this chemical.")
@@ -445,8 +446,8 @@
if(usr.incapacitated()) //are you cuffed, dying, lying, stunned or other
return
src.icon_state = "[base_icon]-open"
src.go_out()
icon_state = "[base_icon]-open"
go_out()
add_fingerprint(usr)
return
@@ -504,15 +505,15 @@
visible_message("[user] starts putting [L.name] into the sleeper.")
if(do_after(user, 20, target = L))
if(src.occupant)
if(occupant)
to_chat(user, "<span class='boldnotice'>The sleeper is already occupied!</span>")
return
if(!L) return
L.forceMove(src)
src.occupant = L
src.icon_state = "[base_icon]"
occupant = L
icon_state = "[base_icon]"
to_chat(L, "<span class='boldnotice'>You feel cool air surround you. You go numb as your senses turn inward.</span>")
src.add_fingerprint(user)
add_fingerprint(user)
if(user.pulling == L)
user.stop_pulling()
return
@@ -527,7 +528,7 @@
set src in oview(1)
if(usr.stat != 0 || !(ishuman(usr)))
return
if(src.occupant)
if(occupant)
to_chat(usr, "<span class='boldnotice'>The sleeper is already occupied!</span>")
return
if(panel_open)
@@ -541,17 +542,17 @@
return
visible_message("[usr] starts climbing into the sleeper.")
if(do_after(usr, 20, target = usr))
if(src.occupant)
if(occupant)
to_chat(usr, "<span class='boldnotice'>The sleeper is already occupied!</span>")
return
usr.stop_pulling()
usr.forceMove(src)
src.occupant = usr
src.icon_state = "[base_icon]"
occupant = usr
icon_state = "[base_icon]"
for(var/obj/O in src)
qdel(O)
src.add_fingerprint(usr)
add_fingerprint(usr)
return
return
+44 -41
View File
@@ -2,9 +2,9 @@
name = "body scanner"
icon = 'icons/obj/Cryogenic2.dmi'
icon_state = "bodyscanner-open"
density = 1
density = TRUE
dir = 8
anchored = 1
anchored = TRUE
idle_power_usage = 1250
active_power_usage = 2500
@@ -32,7 +32,7 @@
if(M == occupant)
continue
else
M.forceMove(src.loc)
M.forceMove(loc)
/obj/machinery/bodyscanner/New()
..()
@@ -54,37 +54,36 @@
component_parts += new /obj/item/stack/cable_coil(null, 2)
RefreshParts()
/obj/machinery/bodyscanner/attackby(var/obj/item/G as obj, var/mob/user as mob)
if(istype(G, /obj/item/screwdriver))
if(src.occupant)
/obj/machinery/bodyscanner/attackby(obj/item/I, mob/user)
if(isscrewdriver(I))
if(occupant)
to_chat(user, "<span class='notice'>The maintenance panel is locked.</span>")
return
default_deconstruction_screwdriver(user, "bodyscanner-o", "bodyscanner-open", G)
default_deconstruction_screwdriver(user, "bodyscanner-o", "bodyscanner-open", I)
return
if(istype(G, /obj/item/wrench))
if(src.occupant)
if(iswrench(I))
if(occupant)
to_chat(user, "<span class='notice'>The scanner is occupied.</span>")
return
if(panel_open)
to_chat(user, "<span class='notice'>Close the maintenance panel first.</span>")
return
if(dir == 4)
dir = 8
setDir(8)
else
dir = 4
playsound(src.loc, G.usesound, 50, 1)
setDir(4)
playsound(loc, I.usesound, 50, 1)
return
if(exchange_parts(user, G))
if(exchange_parts(user, I))
return
if(istype(G, /obj/item/crowbar))
default_deconstruction_crowbar(G)
if(default_deconstruction_crowbar(I))
return
if(istype(G, /obj/item/grab))
var/obj/item/grab/TYPECAST_YOUR_SHIT = G
if(istype(I, /obj/item/grab))
var/obj/item/grab/TYPECAST_YOUR_SHIT = I
if(panel_open)
to_chat(user, "<span class='notice'>Close the maintenance panel first.</span>")
return
@@ -105,7 +104,9 @@
occupant = M
icon_state = "body_scanner_1"
add_fingerprint(user)
qdel(G)
qdel(TYPECAST_YOUR_SHIT)
else
return ..()
/obj/machinery/bodyscanner/MouseDrop_T(mob/living/carbon/human/O, mob/user as mob)
@@ -123,7 +124,7 @@
to_chat(user, "<span class='notice'>Close the maintenance panel first.</span>")
return 0 //panel open
if(occupant)
to_chat(user, "<span class='notice'>\The [src] is already occupied.</span>")
to_chat(user, "<span class='notice'>[src] is already occupied.</span>")
return 0 //occupied
if(O.buckled)
@@ -137,7 +138,7 @@
return 0
if(O == user)
visible_message("[user] climbs into \the [src].")
visible_message("[user] climbs into [src].")
else
visible_message("[user] puts [O] into the body scanner.")
@@ -175,21 +176,21 @@
switch(severity)
if(1.0)
for(var/atom/movable/A as mob|obj in src)
A.forceMove(src.loc)
A.forceMove(loc)
A.ex_act(severity)
qdel(src)
return
if(2.0)
if(prob(50))
for(var/atom/movable/A as mob|obj in src)
A.forceMove(src.loc)
A.forceMove(loc)
A.ex_act(severity)
qdel(src)
return
if(3.0)
if(prob(25))
for(var/atom/movable/A as mob|obj in src)
A.forceMove(src.loc)
A.forceMove(loc)
A.ex_act(severity)
qdel(src)
return
@@ -238,7 +239,7 @@
stat &= ~NOPOWER
else
spawn(rand(0, 15))
src.icon_state = "bodyscannerconsole-p"
icon_state = "bodyscannerconsole-p"
stat |= NOPOWER
/obj/machinery/body_scanconsole/New()
@@ -292,33 +293,35 @@
break
/obj/machinery/body_scanconsole/attackby(var/obj/item/G as obj, var/mob/user as mob, params)
if(istype(G, /obj/item/screwdriver))
default_deconstruction_screwdriver(user, "bodyscannerconsole-p", "bodyscannerconsole", G)
/obj/machinery/body_scanconsole/attackby(obj/item/I, mob/user, params)
if(default_deconstruction_screwdriver(user, "bodyscannerconsole-p", "bodyscannerconsole", I))
return
if(istype(G, /obj/item/wrench))
if(iswrench(I))
if(panel_open)
to_chat(user, "<span class='notice'>Close the maintenance panel first.</span>")
return
if(dir == 4)
dir = 8
setDir(8)
else
dir = 4
playsound(loc, G.usesound, 50, 1)
setDir(4)
playsound(loc, I.usesound, 50, 1)
if(exchange_parts(user, G))
if(exchange_parts(user, I))
return
default_deconstruction_crowbar(G)
if(default_deconstruction_crowbar(I))
return
else
return ..()
/obj/machinery/body_scanconsole/attack_ai(user as mob)
/obj/machinery/body_scanconsole/attack_ai(user)
return attack_hand(user)
/obj/machinery/body_scanconsole/attack_ghost(user as mob)
/obj/machinery/body_scanconsole/attack_ghost(user)
return attack_hand(user)
/obj/machinery/body_scanconsole/attack_hand(user as mob)
/obj/machinery/body_scanconsole/attack_hand(user)
if(stat & (NOPOWER|BROKEN))
return
@@ -326,13 +329,13 @@
to_chat(user, "<span class='notice'>Close the maintenance panel first.</span>")
return
if(!src.connected)
if(!connected)
findscanner()
ui_interact(user)
/obj/machinery/body_scanconsole/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
/obj/machinery/body_scanconsole/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "adv_med.tmpl", "Body Scanner", 690, 600)
@@ -475,14 +478,14 @@
return 1
if(href_list["ejectify"])
src.connected.eject()
connected.eject()
if(href_list["print_p"])
generate_printing_text()
if(!(printing) && printing_text)
printing = 1
visible_message("<span class='notice'>\The [src] rattles and prints out a sheet of paper.</span>")
visible_message("<span class='notice'>[src] rattles and prints out a sheet of paper.</span>")
var/obj/item/paper/P = new /obj/item/paper(loc)
playsound(loc, 'sound/goonstation/machines/printer_dotmatrix.ogg', 50, 1)
P.info = "<CENTER><B>Body Scan - [href_list["name"]]</B></CENTER><BR>"
@@ -654,7 +657,7 @@
if(occupant.disabilities & NEARSIGHTED)
dat += "<font color='red'>Retinal misalignment detected.</font><BR>"
else
dat += "\The [src] is empty."
dat += "[src] is empty."
else
dat = "<font color='red'> Error: No Body Scanner connected.</font>"
+21 -22
View File
@@ -969,31 +969,31 @@
playsound(src.loc, 'sound/effects/sparks4.ogg', 50, 1)
return
/obj/machinery/alarm/attackby(obj/item/W as obj, mob/user as mob, params)
src.add_fingerprint(user)
/obj/machinery/alarm/attackby(obj/item/I, mob/user, params)
add_fingerprint(user)
switch(buildstage)
if(2)
if(istype(W, /obj/item/screwdriver)) // Opening that Air Alarm up.
if(isscrewdriver(I)) // Opening that Air Alarm up.
// to_chat(user, "You pop the Air Alarm's maintence panel open.")
wiresexposed = !wiresexposed
to_chat(user, "The wires have been [wiresexposed ? "exposed" : "unexposed"]")
update_icon()
return
if(istype(W, /obj/item/wirecutters)) // cutting the wires out
if(iswirecutter(I)) // cutting the wires out
if(wires.wires_status == 31) // all wires cut
var/obj/item/stack/cable_coil/new_coil = new /obj/item/stack/cable_coil()
new_coil.amount = 5
new_coil.loc = user.loc
new_coil.forceMove(user.loc)
buildstage = 1
update_icon()
return
if(wiresexposed && ((istype(W, /obj/item/multitool) || istype(W, /obj/item/wirecutters))))
if(wiresexposed && ((ismultitool(I) || iswirecutter(I))))
return attack_hand(user)
if(istype(W, /obj/item/card/id) || istype(W, /obj/item/pda))// trying to unlock the interface with an ID card
if(istype(I, /obj/item/card/id) || istype(I, /obj/item/pda))// trying to unlock the interface with an ID card
if(stat & (NOPOWER|BROKEN))
to_chat(user, "It does nothing")
return
@@ -1004,13 +1004,11 @@
updateUsrDialog()
else
to_chat(user, "<span class='warning'>Access denied.</span>")
return
if(1)
if(istype(W, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/coil = W
if(istype(I, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/coil = I
if(coil.amount < 5)
to_chat(user, "You need more cable for this!")
return
@@ -1026,34 +1024,35 @@
first_run()
return
else if(istype(W, /obj/item/crowbar))
else if(iscrowbar(I))
to_chat(user, "You start prying out the circuit.")
playsound(get_turf(src), W.usesound, 50, 1)
if(do_after(user, 20 * W.toolspeed, target = src))
playsound(get_turf(src), I.usesound, 50, 1)
if(do_after(user, 20 * I.toolspeed, target = src))
if(buildstage != 1)
return
to_chat(user, "You pry out the circuit!")
var/obj/item/airalarm_electronics/circuit = new /obj/item/airalarm_electronics()
circuit.loc = user.loc
circuit.forceMove(user.loc)
buildstage = 0
update_icon()
return
return
if(0)
if(istype(W, /obj/item/airalarm_electronics))
if(istype(I, /obj/item/airalarm_electronics))
to_chat(user, "You insert the circuit!")
playsound(get_turf(src), W.usesound, 50, 1)
qdel(W)
playsound(get_turf(src), I.usesound, 50, 1)
qdel(I)
buildstage = 1
update_icon()
return
else if(istype(W, /obj/item/wrench))
else if(iswrench(I))
to_chat(user, "You remove the fire alarm assembly from the wall!")
new /obj/item/mounted/frame/alarm_frame(get_turf(user))
playsound(get_turf(src), W.usesound, 50, 1)
playsound(get_turf(src), I.usesound, 50, 1)
qdel(src)
return
return 0
return ..()
/obj/machinery/alarm/power_change()
if(powered(power_channel))
+6 -6
View File
@@ -36,8 +36,8 @@
if(charging)
to_chat(user, "Current charge: [round(charging.percent(), 1)]%")
/obj/machinery/cell_charger/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/stock_parts/cell))
/obj/machinery/cell_charger/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/stock_parts/cell))
if(stat & BROKEN)
to_chat(user, "<span class='warning'>[src] is broken!</span>")
return
@@ -57,19 +57,19 @@
if(!user.drop_item())
return
W.forceMove(src)
charging = W
I.forceMove(src)
charging = I
user.visible_message("[user] inserts a cell into the charger.", "<span class='notice'>You insert a cell into the charger.</span>")
chargelevel = -1
updateicon()
else if(iswrench(W))
else if(iswrench(I))
if(charging)
to_chat(user, "<span class='warning'>Remove the cell first!</span>")
return
anchored = !anchored
to_chat(user, "<span class='notice'>You [anchored ? "attach" : "detach"] the cell charger [anchored ? "to" : "from"] the ground</span>")
playsound(src.loc, W.usesound, 75, 1)
playsound(src.loc, I.usesound, 75, 1)
else
return ..()
+2 -2
View File
@@ -68,8 +68,8 @@
user << browse(null, "window=aircond")
user.unset_machine()
else
..()
return
return ..()
/obj/machinery/space_heater/air_conditioner/attack_hand(mob/user as mob)
src.add_fingerprint(user)
interact(user)
+18 -19
View File
@@ -349,19 +349,19 @@
use_power(200)
//Let's unlock this early I guess. Might be too early, needs tweaking.
/obj/machinery/clonepod/attackby(obj/item/W, mob/user, params)
/obj/machinery/clonepod/attackby(obj/item/I, mob/user, params)
if(!(occupant || mess))
if(default_deconstruction_screwdriver(user, "[icon_state]_maintenance", "[initial(icon_state)]", W))
if(default_deconstruction_screwdriver(user, "[icon_state]_maintenance", "[initial(icon_state)]", I))
return
if(exchange_parts(user, W))
if(exchange_parts(user, I))
return
if(default_deconstruction_crowbar(W))
if(default_deconstruction_crowbar(I))
return
if(W.GetID())
if(!check_access(W))
if(I.GetID())
if(!check_access(I))
to_chat(user, "<span class='danger'>Access Denied.</span>")
return
if(!(occupant || mess))
@@ -374,34 +374,33 @@
go_out()
//Removing cloning pod biomass
else if(istype(W, /obj/item/reagent_containers/food/snacks/meat))
to_chat(user, "<span class='notice'>\The [src] processes \the [W].</span>")
biomass += BIOMASS_MEAT_AMOUNT
user.drop_item()
qdel(W)
return
else if(istype(W, /obj/item/wrench))
else if(istype(I, /obj/item/reagent_containers/food/snacks/meat))
if(user.drop_item())
to_chat(user, "<span class='notice'>[src] processes [I].</span>")
biomass += BIOMASS_MEAT_AMOUNT
qdel(I)
else if(iswrench(I))
if(occupant)
to_chat(user, "<span class='warning'>Can not do that while [src] is in use.</span>")
else
if(anchored)
anchored = 0
anchored = FALSE
connected.pods -= src
connected = null
else
anchored = 1
playsound(loc, W.usesound, 100, 1)
anchored = TRUE
playsound(loc, I.usesound, 100, 1)
if(anchored)
user.visible_message("[user] secures [src] to the floor.", "You secure [src] to the floor.")
else
user.visible_message("[user] unsecures [src] from the floor.", "You unsecure [src] from the floor.")
else if(istype(W, /obj/item/multitool))
var/obj/item/multitool/M = W
else if(ismultitool(I))
var/obj/item/multitool/M = I
M.buffer = src
to_chat(user, "<span class='notice'>You load connection data from [src] to [M].</span>")
return
else
..()
return ..()
/obj/machinery/clonepod/emag_act(user)
if(isnull(occupant))
+38 -34
View File
@@ -112,7 +112,7 @@
to_chat(user, "<span class='notice'>\The [I] is no longer in storage.</span>")
return
visible_message("<span class='notice'>The console beeps happily as it disgorges \the [I].</span>")
visible_message("<span class='notice'>The console beeps happily as it disgorges [I].</span>")
dispense_item(I)
@@ -120,7 +120,8 @@
if(!allowed(user))
to_chat(user, "<span class='warning'>Access Denied.</span>")
return
if(!allow_items) return
if(!allow_items)
return
if(frozen_items.len == 0)
to_chat(user, "<span class='notice'>There is nothing to recover from storage.</span>")
@@ -323,15 +324,15 @@
// Also make sure there is a valid control computer
/obj/machinery/cryopod/proc/despawn_occupant()
//Drop all items into the pod.
for(var/obj/item/W in occupant)
occupant.unEquip(W)
W.forceMove(src)
for(var/obj/item/I in occupant)
occupant.unEquip(I)
I.forceMove(src)
if(W.contents.len) //Make sure we catch anything not handled by qdel() on the items.
if(should_preserve_item(W) != CRYO_DESTROY) // Don't remove the contents of things that need preservation
if(I.contents.len) //Make sure we catch anything not handled by qdel() on the items.
if(should_preserve_item(I) != CRYO_DESTROY) // Don't remove the contents of things that need preservation
continue
for(var/obj/item/O in W.contents)
if(istype(O,/obj/item/tank)) //Stop eating pockets, you fuck!
for(var/obj/item/O in I.contents)
if(istype(O, /obj/item/tank)) //Stop eating pockets, you fuck!
continue
O.forceMove(src)
@@ -345,23 +346,23 @@
items -= occupant // Don't delete the occupant
items -= announce // or the autosay radio.
for(var/obj/item/W in items)
if(istype(W,/obj/item/pda))
var/obj/item/pda/P = W
for(var/obj/item/I in items)
if(istype(I, /obj/item/pda))
var/obj/item/pda/P = I
QDEL_NULL(P.id)
qdel(P)
continue
var/preserve = should_preserve_item(W)
var/preserve = should_preserve_item(I)
if(preserve == CRYO_DESTROY)
qdel(W)
qdel(I)
else if(control_computer && control_computer.allow_items)
control_computer.frozen_items += W
control_computer.frozen_items += I
if(preserve == CRYO_OBJECTIVE)
control_computer.objective_items += W
W.loc = null
control_computer.objective_items += I
I.loc = null
else
W.forceMove(loc)
I.forceMove(loc)
// Skip past any cult sacrifice objective using this person
if(GAMEMODE_IS_CULT && is_sacrifice_target(occupant.mind))
@@ -461,22 +462,23 @@
#undef CRYO_PRESERVE
#undef CRYO_OBJECTIVE
/obj/machinery/cryopod/attackby(var/obj/item/G as obj, var/mob/user as mob, params)
/obj/machinery/cryopod/attackby(obj/item/I, mob/user, params)
if(istype(G, /obj/item/grab))
if(istype(I, /obj/item/grab))
var/obj/item/grab/G = I
if(occupant)
to_chat(user, "<span class='notice'>\The [src] is in use.</span>")
to_chat(user, "<span class='notice'>[src] is in use.</span>")
return
if(!ismob(G:affecting))
if(!ismob(G.affecting))
return
if(!check_occupant_allowed(G:affecting))
if(!check_occupant_allowed(G.affecting))
return
var/willing = null //We don't want to allow people to be forced into despawning.
var/mob/living/M = G:affecting
var/mob/living/M = G.affecting
time_till_despawn = initial(time_till_despawn)
if(!istype(M) || M.stat == DEAD)
@@ -485,20 +487,21 @@
if(M.client)
if(alert(M,"Would you like to enter long-term storage?",,"Yes","No") == "Yes")
if(!M || !G || !G:affecting) return
if(!M || !G || !G.affecting) return
willing = willing_time_divisor
else
willing = 1
if(willing)
visible_message("[user] starts putting [G:affecting:name] into \the [src].")
visible_message("[user] starts putting [G.affecting.name] into [src].")
if(do_after(user, 20, target = G:affecting))
if(!M || !G || !G:affecting) return
if(do_after(user, 20, target = G.affecting))
if(!M || !G || !G.affecting)
return
if(occupant)
to_chat(user, "<span class='boldnotice'>\The [src] is in use.</span>")
to_chat(user, "<span class='boldnotice'>[src] is in use.</span>")
return
take_occupant(M, willing)
@@ -516,6 +519,8 @@
to_chat(M, "<span class='boldnotice'>If you ghost, log out or close your client now, your character will shortly be permanently removed from the round.</span>")
take_occupant(M, willing)
else
return ..()
/obj/machinery/cryopod/MouseDrop_T(atom/movable/O as mob|obj, mob/user as mob)
@@ -567,7 +572,7 @@
if(willing)
if(!Adjacent(L))
to_chat(user, "<span class='boldnotice'>You're not close enough to \the [src].</span>")
to_chat(user, "<span class='boldnotice'>You're not close enough to [src].</span>")
return
if(L == user)
visible_message("[user] starts climbing into the cryo pod.")
@@ -633,14 +638,13 @@
if(occupant) items -= occupant
if(announce) items -= announce
for(var/obj/item/W in items)
W.loc = get_turf(src)
for(var/obj/item/I in items)
I.forceMove(get_turf(src))
go_out()
add_fingerprint(usr)
name = initial(name)
return
/obj/machinery/cryopod/verb/move_inside()
set name = "Enter Pod"
@@ -659,7 +663,7 @@
to_chat(usr, "You're too busy getting your life sucked out of you.")
return
visible_message("[usr] starts climbing into \the [src].")
visible_message("[usr] starts climbing into [src].")
if(do_after(usr, 20, target = usr))
+7 -5
View File
@@ -20,17 +20,19 @@ var/list/doppler_arrays = list()
/obj/machinery/doppler_array/process()
return PROCESS_KILL
/obj/machinery/doppler_array/attackby(var/obj/item/O, var/mob/user, params)
if(istype(O, /obj/item/wrench))
/obj/machinery/doppler_array/attackby(obj/item/I, mob/user, params)
if(iswrench(I))
if(!anchored && !isinspace())
anchored = 1
anchored = TRUE
power_change()
to_chat(user, "<span class='notice'>You fasten [src].</span>")
else if(anchored)
anchored = 0
anchored = FALSE
power_change()
to_chat(user, "<span class='notice'>You unfasten [src].</span>")
playsound(loc, O.usesound, 50, 1)
playsound(loc, I.usesound, 50, 1)
else
return ..()
/obj/machinery/doppler_array/verb/rotate()
set name = "Rotate Tachyon-doppler Dish"
+8 -8
View File
@@ -41,7 +41,7 @@
stat |= BROKEN
icon_state = "[initial(icon_state)]-broken"
/obj/machinery/dye_generator/attack_hand(mob/user as mob)
/obj/machinery/dye_generator/attack_hand(mob/user)
..()
src.add_fingerprint(user)
if(stat & (BROKEN|NOPOWER))
@@ -50,18 +50,18 @@
dye_color = temp
set_light(2, l_color = temp)
/obj/machinery/dye_generator/attackby(obj/item/W, mob/user, params)
/obj/machinery/dye_generator/attackby(obj/item/I, mob/user, params)
if(default_unfasten_wrench(user, W, time = 60))
if(default_unfasten_wrench(user, I, time = 60))
return
if(istype(W, /obj/item/hair_dye_bottle))
user.visible_message("<span class='notice'>[user] fills the [W] up with some dye.</span>","<span class='notice'>You fill the [W] up with some hair dye.</span>")
var/obj/item/hair_dye_bottle/HD = W
if(istype(I, /obj/item/hair_dye_bottle))
var/obj/item/hair_dye_bottle/HD = I
user.visible_message("<span class='notice'>[user] fills the [HD] up with some dye.</span>","<span class='notice'>You fill the [HD] up with some hair dye.</span>")
HD.dye_color = dye_color
HD.update_dye_overlay()
else
..()
return ..()
//Hair Dye Bottle
@@ -87,7 +87,7 @@
I.color = dye_color
overlays += I
/obj/item/hair_dye_bottle/attack(mob/living/carbon/M as mob, mob/user as mob)
/obj/item/hair_dye_bottle/attack(mob/living/carbon/M, mob/user)
if(user.a_intent != INTENT_HELP)
..()
return
+20 -24
View File
@@ -45,7 +45,7 @@ FIRE ALARM
/obj/machinery/firealarm/emag_act(mob/user)
if(!emagged)
emagged = 1
emagged = TRUE
if(user)
user.visible_message("<span class='warning'>Sparks fly out of the [src]!</span>",
"<span class='notice'>You emag [src], disabling its thermal sensors.</span>")
@@ -62,19 +62,15 @@ FIRE ALARM
/obj/machinery/firealarm/attack_ghost(mob/user)
ui_interact(user)
/obj/machinery/firealarm/bullet_act(BLAH)
return alarm()
/obj/machinery/firealarm/emp_act(severity)
if(prob(50/severity))
alarm(rand(30/severity, 60/severity))
..()
/obj/machinery/firealarm/attackby(obj/item/W, mob/user, params)
/obj/machinery/firealarm/attackby(obj/item/I, mob/user, params)
add_fingerprint(user)
if(istype(W, /obj/item/screwdriver) && buildstage == 2)
if(iswirecutter(I) && buildstage == 2)
wiresexposed = !wiresexposed
update_icon()
return
@@ -82,37 +78,37 @@ FIRE ALARM
if(wiresexposed)
switch(buildstage)
if(2)
if(istype(W, /obj/item/multitool))
if(ismultitool(I))
detecting = !detecting
if(detecting)
user.visible_message("<span class='warning'>[user] has reconnected [src]'s detecting unit!</span>", "You have reconnected [src]'s detecting unit.")
else
user.visible_message("<span class='warning'>[user] has disconnected [src]'s detecting unit!</span>", "You have disconnected [src]'s detecting unit.")
else if(istype(W, /obj/item/wirecutters)) // cutting the wires out
else if(iswirecutter(I)) // cutting the wires out
to_chat(user, "<span class='warning'>You cut the wires!</span>")
playsound(loc, W.usesound, 50, 1)
playsound(loc, I.usesound, 50, 1)
var/obj/item/stack/cable_coil/new_coil = new /obj/item/stack/cable_coil()
new_coil.amount = 5
new_coil.loc = user.loc
new_coil.forceMove(user.loc)
buildstage = 1
update_icon()
if(1)
if(istype(W, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/coil = W
if(istype(I, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/coil = I
if(!coil.use(5))
to_chat(user, "<span class='warning'>You cut the wires!</span>")
return
buildstage = 2
playsound(get_turf(src), W.usesound, 50, 1)
to_chat(user, "<span class='notice'>You wire \the [src]!</span>")
playsound(get_turf(src), I.usesound, 50, 1)
to_chat(user, "<span class='notice'>You wire [src]!</span>")
update_icon()
else if(istype(W, /obj/item/crowbar))
else if(iscrowbar(I))
to_chat(user, "<span class='warning'>You pry out the circuit!</span>")
playsound(get_turf(src), W.usesound, 50, 1)
if(do_after(user, 20 * W.toolspeed, target = src))
playsound(get_turf(src), I.usesound, 50, 1)
if(do_after(user, 20 * I.toolspeed, target = src))
if(buildstage != 1)
return
var/obj/item/firealarm_electronics/circuit = new /obj/item/firealarm_electronics()
@@ -120,20 +116,20 @@ FIRE ALARM
buildstage = 0
update_icon()
if(0)
if(istype(W, /obj/item/firealarm_electronics))
if(istype(I, /obj/item/firealarm_electronics))
to_chat(user, "<span class='notice'>You insert the circuit!</span>")
qdel(W)
qdel(I)
buildstage = 1
update_icon()
else if(istype(W, /obj/item/wrench))
else if(iswrench(I))
to_chat(user, "<span class='warning'>You remove the fire alarm assembly from the wall!</span>")
new /obj/item/mounted/frame/firealarm(get_turf(user))
playsound(get_turf(src), W.usesound, 50, 1)
playsound(get_turf(src), I.usesound, 50, 1)
qdel(src)
return
alarm()
else
return ..()
/obj/machinery/firealarm/process()//Note: this processing was mostly phased out due to other code, and only runs when needed
if(stat & (NOPOWER|BROKEN))
+10 -6
View File
@@ -38,14 +38,16 @@
// sd_set_light(0)
//Don't want to render prison breaks impossible
/obj/machinery/flasher/attackby(obj/item/W as obj, mob/user as mob, params)
if(istype(W, /obj/item/wirecutters))
/obj/machinery/flasher/attackby(obj/item/I, mob/user, params)
if(iswirecutter(I))
add_fingerprint(user)
disable = !disable
if(disable)
user.visible_message("<span class='warning'>[user] has disconnected the [src]'s flashbulb!</span>", "<span class='warning'>You disconnect the [src]'s flashbulb!</span>")
user.visible_message("<span class='warning'>[user] has disconnected [src]'s flashbulb!</span>", "<span class='warning'>You disconnect [src]'s flashbulb!</span>")
if(!disable)
user.visible_message("<span class='warning'>[user] has connected the [src]'s flashbulb!</span>", "<span class='warning'>You connect the [src]'s flashbulb!</span>")
user.visible_message("<span class='warning'>[user] has connected [src]'s flashbulb!</span>", "<span class='warning'>You connect [src]'s flashbulb!</span>")
else
return ..()
//Let the AI trigger them directly.
/obj/machinery/flasher/attack_ai(mob/user)
@@ -95,8 +97,8 @@
if((M.m_intent != MOVE_INTENT_WALK) && (anchored))
flash()
/obj/machinery/flasher/portable/attackby(obj/item/W as obj, mob/user as mob, params)
if(istype(W, /obj/item/wrench))
/obj/machinery/flasher/portable/attackby(obj/item/I, mob/user, params)
if(iswrench(I))
add_fingerprint(user)
anchored = !anchored
@@ -107,6 +109,8 @@
else if(anchored)
user.show_message(text("<span class='warning'>[src] is now secured.</span>"))
overlays += "[base_state]-s"
else
return ..()
// Flasher button
/obj/machinery/flasher_button
+8 -5
View File
@@ -93,8 +93,11 @@
if(href_list["close"])
close_game()
/obj/machinery/gameboard/attackby(var/obj/item/G as obj, var/mob/user as mob, params)
if(istype(G, /obj/item/wrench))
default_unfasten_wrench(user, G)
else if(istype(G, /obj/item/crowbar))
default_deconstruction_crowbar(G, ignore_panel = 1)
/obj/machinery/gameboard/attackby(obj/item/I, mob/user, params)
if(default_unfasten_wrench(user, I))
return
if(default_deconstruction_crowbar(I, ignore_panel = TRUE))
return
else
return ..()
+9 -7
View File
@@ -48,20 +48,22 @@
var/list/internal_log = list()
var/mode = 0 // 0 - making pass, 1 - viewing logs
/obj/machinery/computer/guestpass/attackby(obj/O, mob/user, params)
if(istype(O, /obj/item/card/id))
/obj/machinery/computer/guestpass/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/card/id))
if(!giver)
user.drop_item()
O.loc = src
giver = O
updateUsrDialog()
if(user.drop_item())
I.forceMove(src)
giver = I
updateUsrDialog()
else
to_chat(user, "<span class='warning'>There is already ID card inside.</span>")
else
return ..()
/obj/machinery/computer/guestpass/proc/get_changeable_accesses()
return giver.access
/obj/machinery/computer/guestpass/attack_ai(var/mob/user as mob)
/obj/machinery/computer/guestpass/attack_ai(mob/user)
return attack_hand(user)
+8 -5
View File
@@ -55,17 +55,20 @@ var/list/holopads = list()
holograph_range += 1 * B.rating
holo_range = holograph_range
/obj/machinery/hologram/holopad/attackby(obj/item/P as obj, mob/user as mob, params)
if(default_deconstruction_screwdriver(user, "holopad_open", "holopad0", P))
/obj/machinery/hologram/holopad/attackby(obj/item/I, mob/user, params)
if(default_deconstruction_screwdriver(user, "holopad_open", "holopad0", I))
return
if(exchange_parts(user, P))
if(exchange_parts(user, I))
return
if(default_unfasten_wrench(user, P))
if(default_unfasten_wrench(user, I))
return
default_deconstruction_crowbar(P)
if(default_deconstruction_crowbar(I))
return
else
return ..()
/obj/machinery/hologram/holopad/attack_hand(var/mob/living/carbon/human/user) //Carn: Hologram requests.
+11 -9
View File
@@ -68,21 +68,23 @@
icon_state = "[base_state]-p"
// src.sd_set_light(0)
/obj/machinery/sparker/attackby(obj/item/W as obj, mob/user as mob, params)
if(istype(W, /obj/item/detective_scanner))
/obj/machinery/sparker/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/detective_scanner))
return
if(istype(W, /obj/item/screwdriver))
if(isscrewdriver(I))
add_fingerprint(user)
src.disable = !src.disable
if(src.disable)
user.visible_message("<span class='warning'>[user] has disabled the [src]!</span>", "<span class='warning'>You disable the connection to the [src].</span>")
disable = !disable
if(disable)
user.visible_message("<span class='warning'>[user] has disabled [src]!</span>", "<span class='warning'>You disable the connection to [src].</span>")
icon_state = "[base_state]-d"
if(!src.disable)
user.visible_message("<span class='warning'>[user] has reconnected the [src]!</span>", "<span class='warning'>You fix the connection to the [src].</span>")
if(src.powered())
if(!disable)
user.visible_message("<span class='warning'>[user] has reconnected [src]!</span>", "<span class='warning'>You fix the connection to [src].</span>")
if(powered())
icon_state = "[base_state]"
else
icon_state = "[base_state]-p"
else
return ..()
/obj/machinery/sparker/attack_ai()
if(src.anchored)
+5 -5
View File
@@ -88,17 +88,17 @@
to_chat(usr, "<span class='warning'>There's nothing attached to the IV drip!</span>")
/obj/machinery/iv_drip/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/reagent_containers))
/obj/machinery/iv_drip/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/reagent_containers))
if(beaker)
to_chat(user, "<span class='warning'>There is already a reagent container loaded!</span>")
return
if(!user.drop_item())
return
W.forceMove(src)
beaker = W
to_chat(user, "<span class='notice'>You attach [W] to [src].</span>")
I.forceMove(src)
beaker = I
to_chat(user, "<span class='notice'>You attach [I] to [src].</span>")
update_icon()
else
return ..()
+6 -5
View File
@@ -97,17 +97,18 @@
updateicon()
else if(istype(I, /obj/item/card/id)||istype(I, /obj/item/pda))
else if(istype(I, /obj/item/card/id) || istype(I, /obj/item/pda))
if(open)
if(src.allowed(user))
src.locked = !src.locked
to_chat(user, "<span class='notice'>Controls are now [src.locked ? "locked" : "unlocked"].</span>")
if(allowed(user))
locked = !locked
to_chat(user, "<span class='notice'>Controls are now [locked ? "locked" : "unlocked"].</span>")
else
to_chat(user, "<span class='danger'>Access denied.</span>")
updateDialog()
else
to_chat(user, "<span class='warning'>You must open the cover first!</span>")
return
else
return ..()
/obj/machinery/navbeacon/attack_ai(mob/user)
interact(user, 1)
+5 -5
View File
@@ -31,18 +31,18 @@
emagged = 1 //Set the emag var to true.
/obj/machinery/poolcontroller/attackby(obj/item/P as obj, mob/user as mob, params) //Proc is called when a user hits the pool controller with something.
if(istype(P,/obj/item/multitool)) //If the mob hits the pool controller with a multitool, reset the emagged status
/obj/machinery/poolcontroller/attackby(obj/item/I, mob/user, params) //Proc is called when a user hits the pool controller with something.
if(ismultitool(I)) //If the mob hits the pool controller with a multitool, reset the emagged status
if(emagged) //Check the emag status
to_chat(user, "<span class='warning'>You re-enable \the [src]'s temperature safeguards.</span>")//Inform the user that they have just fixed the safeguards.
to_chat(user, "<span class='warning'>You re-enable [src]'s temperature safeguards.</span>")//Inform the user that they have just fixed the safeguards.
emagged = 0 //Set the emagged var to false.
emagged = FALSE //Set the emagged var to false.
else
to_chat(user, "<span class='warning'>Nothing happens.</span>")//If not emagged, don't do anything, and don't tell the user that it can be emagged.
else //If it's not a multitool, defer to /obj/machinery/attackby
..()
return ..()
/obj/machinery/poolcontroller/attack_hand(mob/user as mob)
ui_interact(user)
+1 -1
View File
@@ -54,7 +54,7 @@
to_chat(user, "<span class='notice'>[src] isn't connected to anything!</span>")
return 1
else
..()
return ..()
/obj/machinery/recharger/attack_hand(mob/user)
if(issilicon(user))
+9 -6
View File
@@ -136,18 +136,21 @@
else
icon_state = "borgcharger0"
/obj/machinery/recharge_station/attackby(obj/item/P as obj, mob/user as mob, params)
if(istype(P, /obj/item/screwdriver))
if(src.occupant)
/obj/machinery/recharge_station/attackby(obj/item/I, mob/user, params)
if(isscrewdriver(I))
if(occupant)
to_chat(user, "<span class='notice'>The maintenance panel is locked.</span>")
return
default_deconstruction_screwdriver(user, "borgdecon2", "borgcharger0", P)
default_deconstruction_screwdriver(user, "borgdecon2", "borgcharger0", I)
return
if(exchange_parts(user, P))
if(exchange_parts(user, I))
return
default_deconstruction_crowbar(P)
if(default_deconstruction_crowbar(I))
return
else
return ..()
/obj/machinery/recharge_station/proc/process_occupant()
if(src.occupant)
+5 -3
View File
@@ -51,6 +51,7 @@ var/const/SAFETY_COOLDOWN = 100
/obj/machinery/recycler/attackby(obj/item/I, mob/user, params)
add_fingerprint(user)
if(default_deconstruction_screwdriver(user, "grinder-oOpen", "grinder-o0", I))
return
@@ -60,9 +61,10 @@ var/const/SAFETY_COOLDOWN = 100
if(default_unfasten_wrench(user, I))
return
default_deconstruction_crowbar(I)
..()
add_fingerprint(user)
if(default_deconstruction_crowbar(I))
return
else
return ..()
/obj/machinery/recycler/emag_act(mob/user)
if(!emagged)
+13 -10
View File
@@ -269,7 +269,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
return
//err... hacking code, which has no reason for existing... but anyway... it was once supposed to unlock priority 3 messanging on that console (EXTREME priority...), but the code for that was removed.
/obj/machinery/requests_console/attackby(var/obj/item/O as obj, var/mob/user as mob)
/obj/machinery/requests_console/attackby(obj/item/I, mob/user)
/*
if(istype(O, /obj/item/crowbar))
if(open)
@@ -292,14 +292,15 @@ var/list/obj/machinery/requests_console/allConsoles = list()
else
to_chat(user, "You can't do much with that.")*/
if(istype(O, /obj/item/card/id))
if(inoperable(MAINT)) return
if(istype(I, /obj/item/card/id))
if(inoperable(MAINT))
return
if(screen == RCS_MESSAUTH)
var/obj/item/card/id/T = O
var/obj/item/card/id/T = I
msgVerified = text("<font color='green'><b>Verified by [T.registered_name] ([T.assignment])</b></font>")
updateUsrDialog()
if(screen == RCS_ANNOUNCE)
var/obj/item/card/id/ID = O
var/obj/item/card/id/ID = I
if(access_RC_announce in ID.GetAccess())
announceAuth = 1
announcement.announcer = ID.assignment ? "[ID.assignment] [ID.registered_name]" : ID.registered_name
@@ -308,16 +309,18 @@ var/list/obj/machinery/requests_console/allConsoles = list()
to_chat(user, "<span class='warning'>You are not authorized to send announcements.</span>")
updateUsrDialog()
if(screen == RCS_SHIPPING)
var/obj/item/card/id/T = O
var/obj/item/card/id/T = I
msgVerified = text("<font color='green'><b>Sender verified as [T.registered_name] ([T.assignment])</b></font>")
updateUsrDialog()
if(istype(O, /obj/item/stamp))
if(inoperable(MAINT)) return
if(istype(I, /obj/item/stamp))
if(inoperable(MAINT))
return
if(screen == RCS_MESSAUTH)
var/obj/item/stamp/T = O
var/obj/item/stamp/T = I
msgStamped = text("<font color='blue'><b>Stamped with the [T.name]</b></font>")
updateUsrDialog()
return
else
return ..()
/obj/machinery/requests_console/proc/reset_message(var/mainmenu = 0)
message = ""
+12 -13
View File
@@ -56,27 +56,26 @@
return
else
// insert cell
var/obj/item/stock_parts/cell/C = usr.get_active_hand()
var/obj/item/stock_parts/cell/C = user.get_active_hand()
if(istype(C))
user.drop_item()
cell = C
C.loc = src
C.add_fingerprint(usr)
if(user.drop_item())
cell = C
C.forceMove(src)
C.add_fingerprint(user)
user.visible_message("<span class='notice'>[user] inserts a power cell into [src].</span>", "<span class='notice'>You insert the power cell into [src].</span>")
user.visible_message("<span class='notice'>[user] inserts a power cell into [src].</span>", "<span class='notice'>You insert the power cell into [src].</span>")
else
to_chat(user, "The hatch must be open to insert a power cell.")
return
else if(istype(I, /obj/item/screwdriver))
else if(isscrewdriver(I))
open = !open
user.visible_message("<span class='notice'>[user] [open ? "opens" : "closes"] the hatch on the [src].</span>", "<span class='notice'>You [open ? "open" : "close"] the hatch on the [src].</span>")
user.visible_message("<span class='notice'>[user] [open ? "opens" : "closes"] the hatch on [src].</span>", "<span class='notice'>You [open ? "open" : "close"] the hatch on [src].</span>")
update_icon()
if(!open && user.machine == src)
user << browse(null, "window=spaceheater")
user.unset_machine()
else
..()
return
return ..()
/obj/machinery/space_heater/attack_hand(mob/user as mob)
src.add_fingerprint(user)
@@ -106,7 +105,7 @@
else
on = !on
user.visible_message("<span class='notice'>[user] switches [on ? "on" : "off"] the [src].</span>","<span class='notice'>You switch [on ? "on" : "off"] the [src].</span>")
user.visible_message("<span class='notice'>[user] switches [on ? "on" : "off"] [src].</span>","<span class='notice'>You switch [on ? "on" : "off"] [src].</span>")
update_icon()
return
@@ -131,7 +130,7 @@
usr.put_in_hands(cell)
cell.add_fingerprint(usr)
cell = null
usr.visible_message("<span class='notice'>[usr] removes the power cell from \the [src].</span>", "<span class='notice'>You remove the power cell from \the [src].</span>")
usr.visible_message("<span class='notice'>[usr] removes the power cell from [src].</span>", "<span class='notice'>You remove the power cell from [src].</span>")
if("cellinstall")
@@ -143,7 +142,7 @@
C.loc = src
C.add_fingerprint(usr)
usr.visible_message("<span class='notice'>[usr] inserts a power cell into \the [src].</span>", "<span class='notice'>You insert the power cell into \the [src].</span>")
usr.visible_message("<span class='notice'>[usr] inserts a power cell into [src].</span>", "<span class='notice'>You insert the power cell into [src].</span>")
updateDialog()
else
+6 -7
View File
@@ -158,14 +158,14 @@
return
/obj/machinery/power/singularity_beacon/attackby(obj/item/W as obj, mob/user as mob, params)
if(istype(W,/obj/item/screwdriver))
/obj/machinery/power/singularity_beacon/attackby(obj/item/I, mob/user, params)
if(isscrewdriver(I))
if(active)
to_chat(user, "<span class='warning'>You need to deactivate the beacon first!</span>")
return
if(anchored)
anchored = 0
anchored = FALSE
to_chat(user, "<span class='notice'>You unscrew the beacon from the floor.</span>")
disconnect_from_network()
return
@@ -173,11 +173,10 @@
if(!connect_to_network())
to_chat(user, "This device must be placed over an exposed cable.")
return
anchored = 1
anchored = TRUE
to_chat(user, "<span class='notice'>You screw the beacon to the floor and attach the cable.</span>")
return
..()
return
else
return ..()
/obj/machinery/power/singularity_beacon/Destroy()
+2 -1
View File
@@ -486,7 +486,8 @@
else
to_chat(user, "<span class='warning'>The [I] wont fit! The [src] can only hold up to [max_beakers] containers.</span>")
return
..()
else
return ..()
/obj/item/bombcore/chemical/CheckParts(list/parts_list)
..()
+39 -32
View File
@@ -38,21 +38,20 @@
break
return power_station
/obj/machinery/computer/teleporter/attackby(I as obj, mob/living/user as mob, params)
/obj/machinery/computer/teleporter/attackby(obj/item/I, mob/living/user, params)
if(istype(I, /obj/item/gps))
var/obj/item/gps/L = I
if(L.locked_location && !(stat & (NOPOWER|BROKEN)))
if(!user.unEquip(L))
to_chat(user, "<span class='warning'>\the [I] is stuck to your hand, you cannot put it in \the [src]</span>")
to_chat(user, "<span class='warning'>[I] is stuck to your hand, you cannot put it in [src]</span>")
return
L.loc = src
L.forceMove(src)
locked = L
to_chat(user, "<span class='caution'>You insert the GPS device into the [name]'s slot.</span>")
to_chat(user, "<span class='caution'>You insert the GPS device into the [src]'s slot.</span>")
else
..()
return
return ..()
/obj/machinery/computer/teleporter/emag_act(user as mob)
/obj/machinery/computer/teleporter/emag_act(mob/user)
if(!emagged)
emagged = 1
to_chat(user, "<span class='notice'>The teleporter can now lock on to Syndicate beacons!</span>")
@@ -341,14 +340,18 @@
//--FalseIncarnate
return
/obj/machinery/teleport/hub/attackby(obj/item/W, mob/user, params)
if(default_deconstruction_screwdriver(user, "tele-o", "tele0", W))
/obj/machinery/teleport/hub/attackby(obj/item/I, mob/user, params)
if(default_deconstruction_screwdriver(user, "tele-o", "tele0", I))
return
if(exchange_parts(user, W))
if(exchange_parts(user, I))
return
default_deconstruction_crowbar(W)
if(default_deconstruction_crowbar(I))
return
else
return ..()
/obj/machinery/teleport/hub/proc/teleport(atom/movable/M as mob|obj, turf/T)
var/obj/machinery/computer/teleporter/com = power_station.teleporter_console
@@ -438,14 +441,18 @@
else
icon_state = "tele0"
/obj/machinery/teleport/perma/attackby(obj/item/W, mob/user, params)
if(default_deconstruction_screwdriver(user, "tele-o", "tele0", W))
/obj/machinery/teleport/perma/attackby(obj/item/I, mob/user, params)
if(default_deconstruction_screwdriver(user, "tele-o", "tele0", I))
return
if(exchange_parts(user, W))
if(exchange_parts(user, I))
return
default_deconstruction_crowbar(W)
if(default_deconstruction_crowbar(I))
return
else
return ..()
/obj/machinery/teleport/station
name = "station"
@@ -506,40 +513,40 @@
teleporter_console = null
return ..()
/obj/machinery/teleport/station/attackby(var/obj/item/W, mob/user, params)
if(istype(W, /obj/item/multitool) && !panel_open)
var/obj/item/multitool/M = W
/obj/machinery/teleport/station/attackby(obj/item/I, mob/user, params)
if(ismultitool(I) && !panel_open)
var/obj/item/multitool/M = I
if(M.buffer && istype(M.buffer, /obj/machinery/teleport/station) && M.buffer != src)
if(linked_stations.len < efficiency)
linked_stations.Add(M.buffer)
M.buffer = null
to_chat(user, "<span class='caution'>You upload the data from the [W.name]'s buffer.</span>")
to_chat(user, "<span class='caution'>You upload the data from [M]'s buffer.</span>")
else
to_chat(user, "<span class='alert'>This station can't hold more information, try to use better parts.</span>")
if(default_deconstruction_screwdriver(user, "controller-o", "controller", W))
if(default_deconstruction_screwdriver(user, "controller-o", "controller", I))
update_icon()
return
if(exchange_parts(user, W))
if(exchange_parts(user, I))
return
default_deconstruction_crowbar(W)
if(default_deconstruction_crowbar(I))
return
if(panel_open)
if(istype(W, /obj/item/multitool))
var/obj/item/multitool/M = W
if(ismultitool(I))
var/obj/item/multitool/M = I
M.buffer = src
to_chat(user, "<span class='caution'>You download the data to the [W.name]'s buffer.</span>")
return
if(istype(W, /obj/item/wirecutters))
to_chat(user, "<span class='caution'>You download the data to the [M]'s buffer.</span>")
if(iswirecutter(I))
link_console_and_hub()
to_chat(user, "<span class='caution'>You reconnect the station to nearby machinery.</span>")
return
if(istype(W, /obj/item/circuitboard/teleporter_perma))
var/obj/item/circuitboard/teleporter_perma/C = W
if(istype(I, /obj/item/circuitboard/teleporter_perma))
var/obj/item/circuitboard/teleporter_perma/C = I
C.target = teleporter_console.target
to_chat(user, "<span class='caution'>You copy the targeting information from \the [src] to \the [W]</span>")
return
to_chat(user, "<span class='caution'>You copy the targeting information from [src] to [C]</span>")
else
return ..()
/obj/machinery/teleport/station/attack_ai()
src.attack_hand()
+3 -3
View File
@@ -344,12 +344,12 @@
domutcheck(H, null, MUTCHK_FORCED)
H.update_mutations()
/obj/machinery/transformer/gene_applier/attackby(obj/item/W, mob/living/user, params)
if(istype(W, /obj/item/disk/data))
/obj/machinery/transformer/gene_applier/attackby(obj/item/I, mob/living/user, params)
if(istype(I, /obj/item/disk/data))
if(locked)
to_chat(user, "<span class='warning'>Access Denied.</span>")
return FALSE
var/obj/item/disk/data/D = W
var/obj/item/disk/data/D = I
if(!D.buf)
to_chat(user, "<span class='warning'>Error: No data found.</span>")
return FALSE
+1 -1
View File
@@ -292,7 +292,7 @@
insert_item(user, I)
return
else
..()
return ..()
//Override this proc to do per-machine checks on the inserted item, but remember to call the parent to handle these generic checks before your logic!
/obj/machinery/vending/proc/item_slot_check(mob/user, obj/item/I)