Gripper attackby fixes (#13571)

This cannot go wrong, can it?
This commit is contained in:
mikomyazaki
2022-04-20 22:15:15 +02:00
committed by GitHub
parent d8497aa4cb
commit e59589ec8a
184 changed files with 975 additions and 894 deletions
+1 -1
View File
@@ -54,7 +54,7 @@ Pipelines + Other Objects -> Pipe network
/obj/machinery/atmospherics/attackby(atom/A, mob/user as mob)
if(istype(A, /obj/item/device/pipe_painter))
return
return FALSE
..()
/obj/machinery/atmospherics/proc/add_underlay(var/turf/T, var/obj/machinery/atmospherics/node, var/direction, var/icon_connect_type)
@@ -121,5 +121,6 @@
node1 = null
node2 = null
return TRUE
else
..()
@@ -277,13 +277,13 @@
return ..()
if (unlocked)
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], turn it off first.</span>")
return 1
return TRUE
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], it too exerted due to internal pressure.</span>")
add_fingerprint(user)
return 1
return TRUE
playsound(src.loc, W.usesound, 50, 1)
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
if (do_after(user, 40/W.toolspeed, act_target = src))
@@ -293,6 +293,7 @@
"You hear ratchet.")
new /obj/item/pipe(loc, make_from=src)
qdel(src)
return TRUE
#undef REGULATE_NONE
#undef REGULATE_INPUT
@@ -223,13 +223,13 @@ Thus, the two variables affect pump operation are set in New():
return ..()
if (!(stat & NOPOWER) && use_power)
to_chat(user, "<span class='warning'>You cannot unwrench this [src], turn it off first.</span>")
return 1
return TRUE
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE && !istype(W, /obj/item/pipewrench))
to_chat(user, "<span class='warning'>You cannot unwrench this [src], it's too exerted due to internal pressure.</span>")
add_fingerprint(user)
return 1
return TRUE
else
to_chat(user, "<span class='warning'>You struggle to unwrench \the [src] with your pipe wrench.</span>")
playsound(src.loc, W.usesound, 50, 1)
@@ -241,3 +241,4 @@ Thus, the two variables affect pump operation are set in New():
"You hear a ratchet.")
new /obj/item/pipe(loc, make_from=src)
qdel(src)
return TRUE
@@ -93,7 +93,7 @@
if ((int_pressure - env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], it is too exerted due to internal pressure.</span>")
add_fingerprint(user)
return 1
return TRUE
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
playsound(src.loc, W.usesound, 50, 1)
if(do_after(user, 40/W.toolspeed, act_target = src))
@@ -103,6 +103,7 @@
"You hear a ratchet.")
new /obj/item/pipe(loc, make_from=src)
qdel(src)
return TRUE
/obj/machinery/atmospherics/omni/attack_hand(user as mob)
if(..())
@@ -135,15 +135,15 @@
return ..()
if (connected_device)
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], dettach \the [connected_device] first.</span>")
return 1
return TRUE
if (locate(/obj/machinery/portable_atmospherics, src.loc))
return 1
return TRUE
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], it too exerted due to internal pressure.</span>")
add_fingerprint(user)
return 1
return TRUE
playsound(src.loc, W.usesound, 50, 1)
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
if (do_after(user, 40/W.toolspeed, act_target = src))
@@ -153,3 +153,4 @@
"You hear a ratchet.")
new /obj/item/pipe(loc, make_from=src)
qdel(src)
return TRUE
@@ -139,7 +139,7 @@
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], it too exerted due to internal pressure.</span>")
add_fingerprint(user)
return 1
return TRUE
playsound(src.loc, W.usesound, 50, 1)
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
if (do_after(user, 40/W.toolspeed, act_target = src))
@@ -149,6 +149,7 @@
"You hear a ratchet.")
new /obj/item/pipe(loc, make_from=src)
qdel(src)
return TRUE
/obj/machinery/atmospherics/trinary/filter/attack_hand(user as mob) // -- TLE
@@ -111,7 +111,7 @@
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], it too exerted due to internal pressure.</span>")
add_fingerprint(user)
return 1
return TRUE
playsound(src.loc, W.usesound, 50, 1)
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
if (do_after(user, 40/W.toolspeed, act_target = src))
@@ -121,6 +121,7 @@
"You hear ratchet.")
new /obj/item/pipe(loc, make_from=src)
qdel(src)
return TRUE
/obj/machinery/atmospherics/trinary/mixer/attack_hand(user as mob)
if(..())
+3 -2
View File
@@ -348,13 +348,13 @@
return ..()
if (istype(src, /obj/machinery/atmospherics/tvalve/digital))
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], it's too complicated.</span>")
return 1
return TRUE
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
to_chat(user, "<span class='warnng'>You cannot unwrench \the [src], it too exerted due to internal pressure.</span>")
add_fingerprint(user)
return 1
return TRUE
playsound(src.loc, W.usesound, 50, 1)
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
if (do_after(user, 40/W.toolspeed, act_target = src))
@@ -364,6 +364,7 @@
"You hear a ratchet.")
new /obj/item/pipe(loc, make_from=src)
qdel(src)
return TRUE
/obj/machinery/atmospherics/tvalve/mirrored
icon_state = "map_tvalvem0"
@@ -78,7 +78,7 @@
if(!ui)
ui = new(user, src, "machinery-atmospherics-freezer", 440, 300, "Gas Cooling System")
ui.auto_update_content = TRUE
ui.open()
/obj/machinery/atmospherics/unary/freezer/vueui_data_change(list/data, mob/user, datum/vueui/ui)
@@ -172,13 +172,13 @@
/obj/machinery/atmospherics/unary/freezer/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(default_deconstruction_screwdriver(user, O))
return
return TRUE
if(default_deconstruction_crowbar(user, O))
return
return TRUE
if(default_part_replacement(user, O))
return
return TRUE
..()
return ..()
/obj/machinery/atmospherics/unary/freezer/examine(mob/user)
..(user)
@@ -99,7 +99,7 @@
if(!ui)
ui = new(user, src, "machinery-atmospherics-freezer", 440, 300, "Gas Heating System")
ui.auto_update_content = TRUE
ui.open()
/obj/machinery/atmospherics/unary/heater/vueui_data_change(list/data, mob/user, datum/vueui/ui)
@@ -160,13 +160,13 @@
/obj/machinery/atmospherics/unary/heater/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(default_deconstruction_screwdriver(user, O))
return
return TRUE
if(default_deconstruction_crowbar(user, O))
return
return TRUE
if(default_part_replacement(user, O))
return
return TRUE
..()
return ..()
/obj/machinery/atmospherics/unary/heater/examine(mob/user)
..(user)
@@ -376,7 +376,7 @@
to_chat(user, SPAN_NOTICE("Now welding the vent."))
if(do_after(user, 30/W.toolspeed))
if(!src || !WT.isOn())
return
return TRUE
welded = !welded
update_icon()
playsound(src, 'sound/items/welder_pry.ogg', 50, 1)
@@ -387,18 +387,18 @@
to_chat(user, SPAN_NOTICE("You fail to complete the welding."))
else
to_chat(user, SPAN_WARNING("You need more welding fuel to complete this task."))
return 1
return TRUE
else if(istype(W, /obj/item/melee/arm_blade))
if(!welded)
to_chat(user, SPAN_WARNING("\The [W] can only be used to tear open welded air vents!"))
return
return TRUE
user.visible_message(SPAN_WARNING("\The [user] starts using \the [W] to hack open \the [src]!"), SPAN_NOTICE("You start hacking open \the [src] with \the [W]..."))
user.do_attack_animation(src, W)
playsound(loc, 'sound/weapons/smash.ogg', 60, TRUE)
var/cut_amount = 3
for(var/i = 0; i <= cut_amount; i++)
if(!W || !do_after(user, 30, src))
return
return TRUE
user.do_attack_animation(src, W)
user.visible_message(SPAN_WARNING("\The [user] smashes \the [W] into \the [src]!"), SPAN_NOTICE("You smash \the [W] into \the [src]."))
playsound(loc, 'sound/weapons/smash.ogg', 60, TRUE)
@@ -429,17 +429,17 @@
return ..()
if (!(stat & NOPOWER) && use_power)
to_chat(user, SPAN_WARNING("You cannot unwrench \the [src], turn it off first."))
return 1
return TRUE
var/turf/T = src.loc
if (node && node.level==1 && isturf(T) && !T.is_plating())
to_chat(user, SPAN_WARNING("You must remove the plating first."))
return 1
return TRUE
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
to_chat(user, SPAN_WARNING("You cannot unwrench \the [src], it is too exerted due to internal pressure."))
add_fingerprint(user)
return 1
return TRUE
playsound(src.loc, W.usesound, 50, 1)
to_chat(user, SPAN_NOTICE("You begin to unfasten \the [src]..."))
if (do_after(user, 40/W.toolspeed))
@@ -449,6 +449,7 @@
"You hear a ratchet.")
new /obj/item/pipe(loc, make_from=src)
qdel(src)
return TRUE
/obj/machinery/atmospherics/unary/vent_pump/Destroy()
if(initial_loc)
@@ -299,17 +299,17 @@
if (W.iswrench())
if (!(stat & NOPOWER) && use_power)
to_chat(user, SPAN_WARNING("You cannot unwrench \the [src], turn it off first."))
return 1
return TRUE
var/turf/T = src.loc
if (node && node.level==1 && isturf(T) && !T.is_plating())
to_chat(user, SPAN_WARNING("You must remove the plating first."))
return 1
return TRUE
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
to_chat(user, SPAN_WARNING("You cannot unwrench \the [src], it is too exerted due to internal pressure."))
add_fingerprint(user)
return 1
return TRUE
playsound(src.loc, W.usesound, 50, 1)
to_chat(user, SPAN_NOTICE("You begin to unfasten \the [src]..."))
if (do_after(user, 40/W.toolspeed, act_target = src))
@@ -319,7 +319,7 @@
"You hear a ratchet.")
new /obj/item/pipe(loc, make_from=src)
qdel(src)
return 1
return TRUE
if(W.iswelder())
var/obj/item/weldingtool/WT = W
@@ -330,7 +330,7 @@
playsound(src, 'sound/items/welder.ogg', 50, 1)
if(do_after(user, 20/W.toolspeed, act_target = src))
if(!src || !WT.isOn())
return
return TRUE
welded = !welded
update_icon()
playsound(src, 'sound/items/welder_pry.ogg', 50, 1)
@@ -341,19 +341,19 @@
to_chat(user, SPAN_NOTICE("You fail to complete the welding."))
else
to_chat(user, SPAN_WARNING("You need more welding fuel to complete this task."))
return 1
return TRUE
if(istype(W, /obj/item/melee/arm_blade))
if(!welded)
to_chat(user, SPAN_WARNING("\The [W] can only be used to tear open welded scrubbers!"))
return
return TRUE
user.visible_message(SPAN_WARNING("\The [user] starts using \the [W] to hack open \the [src]!"), SPAN_NOTICE("You start hacking open \the [src] with \the [W]..."))
user.do_attack_animation(src, W)
playsound(loc, 'sound/weapons/smash.ogg', 60, TRUE)
var/cut_amount = 3
for(var/i = 0; i <= cut_amount; i++)
if(!W || !do_after(user, 30, src))
return
return TRUE
user.do_attack_animation(src, W)
user.visible_message(SPAN_WARNING("\The [user] smashes \the [W] into \the [src]!"), SPAN_NOTICE("You smash \the [W] into \the [src]."))
playsound(loc, 'sound/weapons/smash.ogg', 60, TRUE)
@@ -362,7 +362,7 @@
spark(get_turf(src), 3, alldirs)
playsound(loc, 'sound/items/welder_pry.ogg', 50, TRUE)
update_icon()
return
return TRUE
return ..()
+3 -2
View File
@@ -306,13 +306,13 @@
return ..()
if (istype(src, /obj/machinery/atmospherics/valve/digital))
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], it's too complicated.</span>")
return 1
return TRUE
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], it is too exerted due to internal pressure.</span>")
add_fingerprint(user)
return 1
return TRUE
playsound(src.loc, W.usesound, 50, 1)
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
if (do_after(user, 40/W.toolspeed, act_target = src))
@@ -322,6 +322,7 @@
"You hear a ratchet.")
new /obj/item/pipe(loc, make_from=src)
qdel(src)
return TRUE
/obj/machinery/atmospherics/valve/examine(mob/user)
..()
+6 -5
View File
@@ -80,7 +80,7 @@
return ..()
if(istype(W,/obj/item/device/pipe_painter))
return 0
return FALSE
if(istype(W, /obj/item/device/analyzer) && Adjacent(user))
var/obj/item/device/analyzer/A = W
@@ -92,14 +92,14 @@
var/turf/T = src.loc
if (level==1 && isturf(T) && !T.is_plating())
to_chat(user, "<span class='warning'>You must remove the plating first.</span>")
return 1
return TRUE
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
if(!istype(W, /obj/item/pipewrench))
to_chat(user, "<span class='warning'>You cannot unwrench \the [src], it is too exerted due to internal pressure.</span>")
add_fingerprint(user)
return 1
return TRUE
else
to_chat(user, "<span class='warning'>You struggle to unwrench \the [src] with your pipe wrench.</span>")
playsound(src.loc, W.usesound, 50, 1)
@@ -115,6 +115,7 @@
new /obj/item/pipe_meter(T)
qdel(meter)
qdel(src)
return TRUE
/obj/machinery/atmospherics/proc/change_color(var/new_color)
//only pass valid pipe colors please ~otherwise your pipe will turn invisible
@@ -1200,12 +1201,12 @@
/obj/machinery/atmospherics/pipe/tank/attackby(var/obj/item/W as obj, var/mob/user as mob)
if(istype(W, /obj/item/device/pipe_painter))
return
return FALSE
if(istype(W, /obj/item/device/analyzer) && in_range(user, src))
var/obj/item/device/analyzer/A = W
A.analyze_gases(src, user)
return FALSE
return TRUE
/obj/machinery/atmospherics/pipe/tank/air
name = "Pressure Tank (Air)"
+1 -1
View File
@@ -59,7 +59,7 @@
is recieving it.
The most common are:
* mob/UnarmedAttack(atom,adjacent) - used here only when adjacent, with no item in hand; in the case of humans, checks gloves
* atom/attackby(item,user) - used only when adjacent
* atom/attackby(item,user) - used only when adjacent, return TRUE to prevent further afterattack procs being called
* item/afterattack(atom,user,adjacent,params) - used both ranged and adjacent
* mob/RangedAttack(atom,params) - used only ranged, only used for tk and laser eyes but could be changed
*/
+2 -1
View File
@@ -27,7 +27,7 @@ avoid code duplication. This includes items that may sometimes act as a standard
add_fingerprint(user)
return A.attackby(src, user, click_parameters)
// No comment
// attackby should return TRUE if all desired actions are resolved from that attack, within attackby. This prevents afterattack being called.
/atom/proc/attackby(obj/item/W, mob/user, var/click_parameters)
return
@@ -67,6 +67,7 @@ avoid code duplication. This includes items that may sometimes act as a standard
/mob/living/simple_animal/attackby(obj/item/I, mob/living/user)
if(I.damtype == PAIN)
playsound(loc, 'sound/weapons/tap.ogg', I.get_clamped_volume(), 1, -1)
return TRUE
else
return ..()
+4 -1
View File
@@ -271,8 +271,9 @@
W.forceMove(src)
src.concealed_blade = W
update_icon()
return TRUE
else
..()
return ..()
/obj/item/cane/concealed/update_icon()
if(concealed_blade)
@@ -453,6 +454,7 @@
to_chat(user, SPAN_NOTICE("You modify \the [src] into a makeshift PSU circuitboard."))
qdel(src)
user.put_in_hands(new_circuit)
return TRUE
/obj/item/module/id_auth
name = "\improper ID authentication module"
@@ -524,6 +526,7 @@
to_chat(user, "You bypass the fried security chip and extract the encryption key.")
to_chat(user, "The fried neural socket crumbles away like dust.")
qdel(src)
return TRUE
/obj/item/storage/part_replacer
name = "rapid part exchange device"
+2 -2
View File
@@ -232,7 +232,7 @@
if(anchored)
return
if(!universe.OnTouchMapEdge(src))
return
@@ -431,4 +431,4 @@
return 0
/atom/movable/proc/can_attach_sticker(var/mob/user, var/obj/item/sticker/S)
return TRUE
return TRUE
+8 -9
View File
@@ -119,27 +119,27 @@
if(istype(item, /obj/item/reagent_containers/glass))
if(beaker)
to_chat(user, "<span class='warning'>A beaker is already loaded into the machine.</span>")
return
return TRUE
beaker = item
user.drop_from_inventory(item,src)
user.visible_message("\The [user] adds \a [item] to \the [src]!", "You add \a [item] to \the [src]!")
return
return TRUE
else if (!istype(item, /obj/item/grab))
return
var/obj/item/grab/G = item
if (!ismob(G.affecting))
return
return TRUE
if (src.occupant)
to_chat(user, "<span class='warning'>The scanner is already occupied!</span>")
return
return TRUE
if (G.affecting.abiotic())
to_chat(user, "<span class='warning'>The subject cannot have abiotic items on.</span>")
return
return TRUE
put_in(G.affecting)
src.add_fingerprint(user)
qdel(G)
return
return TRUE
/obj/machinery/dna_scannernew/proc/put_in(var/mob/M)
if(M.client)
@@ -237,10 +237,9 @@
src.disk = I
to_chat(user, "You insert [I].")
SSnanoui.update_uis(src) // update all UIs attached to src
return
return TRUE
else
..()
return
return ..()
/obj/machinery/computer/scan_consolenew/ex_act(severity)
+1
View File
@@ -62,6 +62,7 @@
var/obj/item/material/sword/blade = new(get_turf(src))
blade.force = 15
qdel(src)
return TRUE
/obj/item/melee/cultblade/mounted
name = "daemon doomblade"
+3 -4
View File
@@ -32,12 +32,11 @@
/obj/effect/rune/attackby(obj/I, mob/user)
if(istype(I, /obj/item/book/tome) && iscultist(user))
rune.do_tome_action(user, I)
return
return TRUE
else if(istype(I, /obj/item/nullrod))
to_chat(user, SPAN_NOTICE("You disrupt the vile magic with the deadening field of \the [I]!"))
qdel(src)
return
return
return TRUE
/obj/effect/rune/attack_hand(mob/living/user)
if(!iscultist(user))
@@ -49,4 +48,4 @@
return rune.activate(user, src)
/obj/effect/rune/cultify()
return
return
+2 -1
View File
@@ -10,4 +10,5 @@
if(!B.unique)
var/cult_item = B.cultify()
user.put_in_hands(cult_item)
to_chat(user, SPAN_CULT("You pass the book over the desk. The contents within fade away and get replaced by the writings of Nar'Sie."))
to_chat(user, SPAN_CULT("You pass the book over the desk. The contents within fade away and get replaced by the writings of Nar'Sie."))
return TRUE
+4 -3
View File
@@ -10,9 +10,10 @@
var/cult_item = W.cultify(TRUE)
if(isnull(cult_item))
to_chat(user, SPAN_WARNING("You get the idea that you can't reforge this."))
return
if(istype(cult_item, /obj/item))
else if(istype(cult_item, /obj/item))
user.put_in_hands(cult_item)
to_chat(user, SPAN_CULT(stored_message))
return TRUE
else if(!isnull(cult_item)) // it didn't return an item
to_chat(user, SPAN_CULT(cult_item)) // but i still want it to play a message
to_chat(user, SPAN_CULT(cult_item)) // but i still want it to play a message
return TRUE
@@ -48,4 +48,5 @@
..()
if(istype(I, /obj/item/nullrod))
to_chat(user, "<span class='notice'>You touch \the [src] with \the [I], closing the path to the otherworld.</span>")
qdel(src)
qdel(src)
return TRUE
+1 -1
View File
@@ -351,7 +351,7 @@
var/obj/item/holder/H = W
if(H.contained)
present_sacrifice(user, H.contained)
return
return TRUE
attackpylon(user, W.force, W)
@@ -96,6 +96,7 @@
user.drop_from_inventory(W,src)
Consume(W)
return TRUE
/turf/unsimulated/wall/supermatter/CollidedWith(atom/AM)
+3 -3
View File
@@ -181,8 +181,8 @@
/obj/effect/meteor/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W, /obj/item/pickaxe))
qdel(src)
return
..()
return TRUE
return ..()
/obj/effect/meteor/proc/make_debris()
for(var/throws = dropamt, throws > 0, throws--)
@@ -351,4 +351,4 @@
var/turf/mobloc = get_turf(M)
if(mobloc && mobloc.z == T.z)
if(!isdeaf(M))
M.playsound_simple(T, 'sound/effects/meteorimpact.ogg', range, use_random_freq = TRUE, use_pressure = FALSE)
M.playsound_simple(T, 'sound/effects/meteorimpact.ogg', range, use_random_freq = TRUE, use_pressure = FALSE)
+3 -3
View File
@@ -374,12 +374,12 @@ var/list/all_technomancer_assistance = typesof(/datum/technomancer/assistance) -
var/turf/T = get_turf(user)
if(T.z in current_map.player_levels)
to_chat(user, "<span class='danger'>You can only refund at your base, it's too late now!</span>")
return
return TRUE
for(var/datum/technomancer/equipment/E in equipment_instances + assistance_instances)
if(AM.type == E.obj_path) // We got a match.
if(budget + E.cost > max_budget)
to_chat(user, "<span class='warning'>\The [src] will not allow you to overflow your maximum budget by refunding that.</span>")
return
return TRUE
else
budget = budget + E.cost
to_chat(user, "<span class='notice'>You've refunded \the [AM].</span>")
@@ -395,6 +395,6 @@ var/list/all_technomancer_assistance = typesof(/datum/technomancer/assistance) -
core.remove_spell(spell)
break
qdel(AM)
return
return TRUE
to_chat(user, "<span class='warn'>\The [src] is unable to refund \the [AM].</span>")
@@ -231,8 +231,9 @@
var/obj/item/spell/spell = W
if(run_checks() & (cast_methods & CAST_COMBINE))
spell.on_combine_cast(src, user)
return TRUE
else
..()
return ..()
// Proc: afterattack()
// Parameters: 4 (target - the atom clicked on by user, user - the technomancer who clicked with the spell, proximity - argument
@@ -326,4 +327,4 @@
// If we miss or hit an obstacle, we still want to delete the spell.
spawn(20)
if(src)
qdel(src)
qdel(src)
+5 -5
View File
@@ -33,7 +33,7 @@
to_chat(user, SPAN_WARNING("\The [src]'s cable reel is full."))
else
to_chat(user, SPAN_NOTICE("You load [result] lengths of cable into \the [src]."))
return
return TRUE
if(O.iswirecutter())
if(cable && cable.amount)
@@ -47,13 +47,13 @@
user.put_in_hands(CC)
else
to_chat(user, SPAN_WARNING("There's no more cable on the reel."))
return
return TRUE
if(O.ismultitool())
if(!cable)
to_chat(user, SPAN_WARNING("\The [src] doesn't have any cable loaded!"))
return
cable.attackby(O, user)
return TRUE
return cable.attackby(O, user)
/obj/machinery/cablelayer/examine(mob/user)
..()
@@ -120,4 +120,4 @@
NC.mergeConnectedNetworks(NC.d2)
last_piece = NC
return TRUE
return TRUE
+7 -7
View File
@@ -69,7 +69,7 @@
playsound(loc, /decl/sound_category/switch_sound, 50, 1)
/obj/machinery/optable/CanPass(atom/movable/mover, turf/target, height = 0, air_group = 0)
if(air_group || (height == 0))
if(air_group || (height == 0))
return FALSE
return istype(mover) && mover.checkpass(PASSTABLE)
@@ -159,13 +159,13 @@
var/obj/item/grab/G = W
if(victim)
to_chat(usr, SPAN_NOTICE(SPAN_BOLD("\The [src] is already occupied!")))
return FALSE
return TRUE
var/mob/living/L = G.affecting
var/bucklestatus = L.bucklecheck(user)
if(!bucklestatus)//We must make sure the person is unbuckled before they go in
return
return TRUE
if(L == user)
user.visible_message(SPAN_NOTICE("\The [user] starts climbing onto \the [src]."), SPAN_NOTICE("You start climbing onto \the [src]."), range = 3)
@@ -177,13 +177,13 @@
LB.user_unbuckle(user)
take_victim(G.affecting,usr)
qdel(W)
return
return TRUE
if(default_deconstruction_screwdriver(user, W))
return
return TRUE
if(default_deconstruction_crowbar(user, W))
return
return TRUE
if(default_part_replacement(user, W))
return
return TRUE
/obj/machinery/optable/proc/check_table(mob/living/carbon/patient)
check_victim()
+8 -7
View File
@@ -228,7 +228,7 @@
user.visible_message("<span class='notice'>\The [user] adds \a [I] to \the [src].</span>", "<span class='notice'>You add \a [I] to \the [src].</span>")
else
to_chat(user, "<span class='warning'>\The [src] has a beaker already.</span>")
return
return TRUE
else if(istype(I, /obj/item/grab))
var/obj/item/grab/G = I
@@ -236,7 +236,7 @@
if(!istype(L))
to_chat(user, "<span class='warning'>\The machine won't accept that.</span>")
return
return TRUE
if(display_loading_message)
user.visible_message("<span class='notice'>[user] starts putting [G.affecting] into [src].</span>", "<span class='notice'>You start putting [G.affecting] into [src].</span>", range = 3)
@@ -244,13 +244,13 @@
if (do_mob(user, G.affecting, 20, needhand = 0))
if(occupant)
to_chat(user, "<span class='warning'>\The [src] is already occupied.</span>")
return
return TRUE
var/bucklestatus = L.bucklecheck(user)
if (!bucklestatus)//incase the patient got buckled_to during the delay
return
return TRUE
if(L != G.affecting)//incase it isn't the same mob we started with
return
return TRUE
var/mob/M = G.affecting
M.forceMove(src)
@@ -258,15 +258,16 @@
occupant = M
update_icon()
qdel(G)
return
return TRUE
else if(I.isscrewdriver())
src.panel_open = !src.panel_open
to_chat(user, "You [src.panel_open ? "open" : "close"] the maintenance panel.")
cut_overlays()
if(src.panel_open)
add_overlay("[initial(icon_state)]-o")
return TRUE
else if(default_part_replacement(user, I))
return
return TRUE
/obj/machinery/sleeper/MouseDrop_T(var/mob/target, var/mob/user)
if(user.stat || user.lying || !Adjacent(user) || !target.Adjacent(user)|| !ishuman(target))
+1 -2
View File
@@ -52,8 +52,7 @@
src.attack_hand(usr)
else
to_chat(user, "<span class='warning'>Access denied.</span>")
return
return
return TRUE
/obj/machinery/ai_slipper/attack_ai(mob/user as mob)
if(!ai_can_interact(user))
+9 -8
View File
@@ -769,7 +769,7 @@
wiresexposed = !wiresexposed
to_chat(user, "<span class='notice'>You [wiresexposed ? "open" : "close"] the maintenance panel.</span>")
update_icon()
return
return TRUE
if (wiresexposed && W.iswirecutter())
user.visible_message("<span class='warning'>[user] has cut the wires inside \the [src]!</span>", "You cut the wires inside \the [src].")
@@ -777,19 +777,19 @@
new/obj/item/stack/cable_coil(get_turf(src), 5)
buildstage = 1
update_icon()
return
return TRUE
if (W.GetID())// trying to unlock the interface with an ID card
if(stat & (NOPOWER|BROKEN))
to_chat(user, "<span class='notice'>Nothing happens.</span>")
return
return TRUE
else
if(allowed(usr) && !wires.IsIndexCut(AALARM_WIRE_IDSCAN))
locked = !locked
to_chat(user, "<span class='notice'>You [ locked ? "lock" : "unlock"] the Air Alarm interface.</span>")
else
to_chat(user, "<span class='warning'>Access denied.</span>")
return
return TRUE
if(1)
if(W.iscoil())
@@ -800,10 +800,9 @@
update_icon()
first_run()
set_frequency(frequency)
return
else
to_chat(user, "<span class='warning'>You need 5 pieces of cable to do wire \the [src].</span>")
return
return TRUE
else if(W.iscrowbar())
to_chat(user, "You start prying out the circuit.")
@@ -814,20 +813,22 @@
circuit.forceMove(user.loc)
buildstage = 0
update_icon()
return
return TRUE
if(0)
if(istype(W, /obj/item/airalarm_electronics))
to_chat(user, "You insert the circuit!")
qdel(W)
buildstage = 1
update_icon()
return
return TRUE
else if(W.iswrench())
to_chat(user, "You remove the air alarm assembly from the wall!")
new /obj/item/frame/air_alarm(get_turf(user))
playsound(src.loc, W.usesound, 50, 1)
qdel(src)
return TRUE
return ..()
+1 -1
View File
@@ -71,7 +71,7 @@ var/global/list/bluespace_inhibitors
else
visible_message(SPAN_NOTICE("\The [user] [pick("touches","pokes","prods")] \the [src] with \the [W]."))
if(prob(66))
return
return TRUE
do_break()
+3 -3
View File
@@ -305,7 +305,7 @@ update_flag
return
if(!W.iswrench() && !is_type_in_list(W, list(/obj/item/tank, /obj/item/device/analyzer, /obj/item/modular_computer)) && !issignaler(W) && !(W.iswirecutter() && signaler))
if(W.flags & NOBLUDGEON)
return
return TRUE
visible_message(SPAN_WARNING("\The [user] hits \the [src] with \the [W]!"), SPAN_NOTICE("You hit \the [src] with \the [W]."))
user.do_attack_animation(src, W)
playsound(src, 'sound/weapons/smash.ogg', 60, 1)
@@ -313,7 +313,7 @@ update_flag
if(!istype(W, /obj/item/forensics))
src.add_fingerprint(user)
healthcheck()
return
return TRUE
if(istype(user, /mob/living/silicon/robot) && istype(W, /obj/item/tank/jetpack))
var/datum/gas_mixture/thejetpack = W:air_contents
@@ -326,7 +326,7 @@ update_flag
var/datum/gas_mixture/removed = air_contents.remove(transfer_moles)
thejetpack.merge(removed)
to_chat(user, "You pulse-pressurize your jetpack from the tank.")
return
return TRUE
..()
+12 -11
View File
@@ -92,17 +92,18 @@
return ..()
/obj/machinery/meter/attackby(var/obj/item/W as obj, var/mob/user as mob)
if (!W.iswrench())
return ..()
playsound(src.loc, W.usesound, 50, 1)
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
if (do_after(user, 40/W.toolspeed))
user.visible_message( \
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
"<span class='notice'>You have unfastened \the [src].</span>", \
"You hear ratchet.")
new /obj/item/pipe_meter(src.loc)
qdel(src)
if (W.iswrench())
playsound(src.loc, W.usesound, 50, 1)
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
if (do_after(user, 40/W.toolspeed))
user.visible_message( \
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
"<span class='notice'>You have unfastened \the [src].</span>", \
"You hear ratchet.")
new /obj/item/pipe_meter(src.loc)
qdel(src)
return TRUE
return ..()
// TURF METER - REPORTS A TILE'S AIR CONTENTS
@@ -109,13 +109,13 @@
/obj/machinery/portable_atmospherics/attackby(var/obj/item/W as obj, var/mob/user as mob)
if ((istype(W, /obj/item/tank) && !( src.destroyed )))
if (src.holding)
return
return TRUE
var/obj/item/tank/T = W
user.drop_from_inventory(T,src)
src.holding = T
update_icon()
SSvueui.check_uis_for_change(src)
return
return TRUE
else if (W.iswrench())
if(connected_port)
@@ -123,7 +123,7 @@
to_chat(user, "<span class='notice'>You disconnect \the [src] from the port.</span>")
update_icon()
SSvueui.check_uis_for_change(src)
return
return TRUE
else
var/obj/machinery/atmospherics/portables_connector/possible_port = locate(/obj/machinery/atmospherics/portables_connector/) in loc
if(possible_port)
@@ -131,18 +131,18 @@
to_chat(user, "<span class='notice'>You connect \the [src] to the port.</span>")
update_icon()
SSvueui.check_uis_for_change(src)
return
return TRUE
else
to_chat(user, "<span class='notice'>\The [src] failed to connect to the port.</span>")
return
return TRUE
else
to_chat(user, "<span class='notice'>Nothing happens.</span>")
return
return TRUE
else if ((istype(W, /obj/item/device/analyzer)) && Adjacent(user))
var/obj/item/device/analyzer/A = W
A.analyze_gases(src, user)
return
return TRUE
return ..()
@@ -165,7 +165,7 @@
if(istype(I, /obj/item/cell))
if(cell)
to_chat(user, "There is already a power cell installed.")
return
return TRUE
var/obj/item/cell/C = I
@@ -175,12 +175,12 @@
user.visible_message("<span class='notice'>[user] opens the panel on [src] and inserts [C].</span>", "<span class='notice'>You open the panel on [src] and insert [C].</span>")
power_change()
SSvueui.check_uis_for_change(src)
return
return TRUE
if(I.isscrewdriver())
if(!cell)
to_chat(user, "<span class='warning'>There is no power cell installed.</span>")
return
return TRUE
user.visible_message("<span class='notice'>[user] opens the panel on [src] and removes [cell].</span>", "<span class='notice'>You open the panel on [src] and remove [cell].</span>")
cell.add_fingerprint(user)
@@ -188,8 +188,8 @@
cell = null
power_change()
SSvueui.check_uis_for_change(src)
return
..()
return TRUE
return ..()
/obj/machinery/portable_atmospherics/proc/log_open(var/mob/user)
if(air_contents.gas.len == 0)
+8 -10
View File
@@ -214,33 +214,31 @@
if(I.iswrench())
if(on)
to_chat(user, "<span class='warning'>Turn \the [src] off first!</span>")
return
return TRUE
anchored = !anchored
playsound(src.loc, I.usesound, 50, 1)
to_chat(user, "<span class='notice'>You [anchored ? "wrench" : "unwrench"] \the [src].</span>")
return
return TRUE
//doesn't use power cells
if(istype(I, /obj/item/cell))
return
return TRUE
if (I.isscrewdriver())
return
return TRUE
//doesn't hold tanks
if(istype(I, /obj/item/tank))
return
..()
return TRUE
return ..()
/obj/machinery/portable_atmospherics/powered/scrubber/huge/stationary
name = "Stationary Air Scrubber"
/obj/machinery/portable_atmospherics/powered/scrubber/huge/stationary/attackby(var/obj/item/I as obj, var/mob/user as mob)
if(I.iswrench())
to_chat(user, "<span class='warning'>The bolts are too tight for you to unscrew!</span>")
return
return TRUE
..()
return ..()
+8 -8
View File
@@ -146,18 +146,18 @@
/obj/machinery/autolathe/attackby(obj/item/O, mob/user)
if(busy)
to_chat(user, SPAN_NOTICE("\The [src] is busy. Please wait for the completion of previous operation."))
return
return TRUE
if(default_deconstruction_screwdriver(user, O))
updateUsrDialog()
return
return TRUE
if(default_deconstruction_crowbar(user, O))
return
return TRUE
if(default_part_replacement(user, O))
return
return TRUE
if(stat)
return
return TRUE
if(panel_open)
//Don't eat multitools or wirecutters used on an open lathe.
@@ -166,7 +166,7 @@
wires.Interact(user)
else
to_chat(user, SPAN_WARNING("\The [src]'s wires aren't exposed."))
return
return TRUE
if(O.loc != user && !istype(O, /obj/item/stack))
return FALSE
@@ -177,7 +177,7 @@
load_lathe(O, user)
updateUsrDialog()
return
return TRUE
/obj/machinery/autolathe/attack_hand(mob/user)
user.set_machine(src)
@@ -346,4 +346,4 @@
#undef NO_SPACE
#undef FILL_COMPLETELY
#undef FILL_INCOMPLETELY
#undef FILL_INCOMPLETELY
+8 -6
View File
@@ -308,11 +308,11 @@
/obj/machinery/biogenerator/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(default_deconstruction_screwdriver(user, O))
return
return TRUE
if(default_deconstruction_crowbar(user, O))
return
return TRUE
if(default_part_replacement(user, O))
return
return TRUE
if(istype(O, /obj/item/reagent_containers/glass))
if(beaker)
to_chat(user, SPAN_NOTICE("\The [src] is already loaded."))
@@ -321,8 +321,10 @@
O.forceMove(src)
beaker = O
updateUsrDialog()
. = TRUE
else if(processing)
to_chat(user, SPAN_NOTICE("\The [src] is currently processing."))
. = TRUE
else if(istype(O, /obj/item/storage/bag/plants))
var/i = 0
var/obj/item/storage/bag/P = O
@@ -342,10 +344,10 @@
if(i < capacity)
to_chat(user, SPAN_NOTICE("You empty \the [O] into \the [src]."))
. = TRUE
else if(!istype(O, /obj/item/reagent_containers/food/snacks/grown))
to_chat(user, SPAN_NOTICE("You cannot put this in \the [src]."))
. = TRUE
else
var/i = 0
for(var/obj/item/reagent_containers/food/snacks/grown/G in contents)
@@ -356,8 +358,8 @@
user.remove_from_mob(O)
O.forceMove(src)
to_chat(user, SPAN_NOTICE("You put \the [O] in \the [src]"))
. = TRUE
update_icon()
return
/obj/machinery/biogenerator/interact(mob/user as mob)
if(stat & BROKEN)
+3 -3
View File
@@ -66,14 +66,14 @@
loaded_dna = REAGENT_DATA(S.reagents, /decl/reagent/blood)
S.reagents.clear_reagents()
to_chat(user, "<span class='info'>You inject the blood sample into the bioprinter.</span>")
return
return TRUE
// Meat for biomass.
if(!prints_prosthetics && istype(W, /obj/item/reagent_containers/food/snacks/meat))
stored_matter += 50
user.drop_from_inventory(W,src)
to_chat(user, "<span class='info'>\The [src] processes \the [W]. Levels of stored biomass now: [stored_matter]</span>")
qdel(W)
return
return TRUE
// Steel for matter.
if(prints_prosthetics && istype(W, /obj/item/stack/material) && W.get_material_name() == DEFAULT_WALL_MATERIAL)
var/obj/item/stack/S = W
@@ -81,6 +81,6 @@
user.drop_from_inventory(W,src)
to_chat(user, "<span class='info'>\The [src] processes \the [W]. Levels of stored matter now: [stored_matter]</span>")
qdel(W)
return
return TRUE
return..()
+4 -4
View File
@@ -41,10 +41,10 @@
/obj/machinery/bluespacerelay/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(default_deconstruction_screwdriver(user, O))
return
return TRUE
if(default_deconstruction_crowbar(user, O))
return
return TRUE
if(default_part_replacement(user, O))
return
return TRUE
..()
return ..()
+4 -4
View File
@@ -123,10 +123,10 @@
return
if (occupant)
to_chat(user, SPAN_WARNING("The scanner is already occupied!"))
return
return TRUE
if (G.affecting.abiotic())
to_chat(user, SPAN_WARNING("Subject cannot have abiotic items on."))
return
return TRUE
var/mob/living/M = G.affecting
user.visible_message(SPAN_NOTICE("\The [user] starts putting \the [M] into \the [src]."), SPAN_NOTICE("You start putting \the [M] into \the [src]."), range = 3)
@@ -134,7 +134,7 @@
if (do_mob(user, G.affecting, 30, needhand = 0))
var/bucklestatus = M.bucklecheck(user)
if (!bucklestatus)//incase the patient got buckled_to during the delay
return
return TRUE
if (bucklestatus == 2)
var/obj/structure/LB = M.buckled_to
LB.user_unbuckle(user)
@@ -150,7 +150,7 @@
add_fingerprint(user)
//G = null
qdel(G)
return
return TRUE
/obj/machinery/bodyscanner/MouseDrop_T(atom/movable/O as mob|obj, mob/living/user as mob)
if(!istype(user))
+5 -2
View File
@@ -59,6 +59,7 @@
if(!locked)
open = !open
to_chat(user, "<span class='notice'>Maintenance panel is now [src.open ? "opened" : "closed"].</span>")
return TRUE
else if(W.iswelder())
if(health < maxhealth)
if(open)
@@ -69,6 +70,7 @@
to_chat(user, "<span class='notice'>Unable to repair with the maintenance panel closed.</span>")
else
to_chat(user, "<span class='notice'>[src] does not need a repair.</span>")
return TRUE
else
if(hasvar(W,"force") && hasvar(W,"damtype"))
switch(W.damtype)
@@ -77,10 +79,11 @@
if("brute")
src.health -= W.force * brute_dam_coeff
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
..()
. = ..()
healthcheck()
return .
else
..()
return ..()
/obj/machinery/bot/bullet_act(var/obj/item/projectile/Proj)
if(!(Proj.damage_type == BRUTE || Proj.damage_type == BURN))
+5 -3
View File
@@ -96,7 +96,7 @@
else if(I.isscrewdriver())
if(locked)
to_chat(user, "<span class='notice'>The maintenance hatch cannot be opened or closed while the controls are locked.</span>")
return
return TRUE
open = !open
if(open)
@@ -108,6 +108,7 @@
icon_state = "mulebot0"
updateDialog()
return TRUE
else if (I.iswrench())
if (src.health < maxhealth)
src.health = min(maxhealth, src.health+25)
@@ -118,6 +119,7 @@
)
else
to_chat(user, "<span class='notice'>[src] does not need a repair!</span>")
return TRUE
else if(load && ismob(load)) // chance to knock off rider
if(prob(1+I.force * 2))
unload(0)
@@ -125,9 +127,9 @@
else
to_chat(user, "You hit [src] with \the [I] but to no effect.")
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
return TRUE
else
..()
return
return ..()
/obj/machinery/bot/mulebot/emag_act(var/remaining_charges, var/user)
locked = !locked
+8 -5
View File
@@ -137,9 +137,11 @@
user.visible_message("<span class='warning'>[user] screws the camera's panel [panel_open ? "open" : "closed"]!</span>",
"<span class='notice'>You screw the camera's panel [panel_open ? "open" : "closed"].</span>")
playsound(src.loc, W.usesound, 50, 1)
return TRUE
else if((W.iswirecutter() || W.ismultitool()) && panel_open)
interact(user)
return TRUE
else if(W.iswelder() && (wires.CanDeconstruct() || (stat & BROKEN)))
if(weld(W, user))
@@ -159,7 +161,7 @@
new /obj/item/stack/cable_coil(loc, 2)
assembly = null //so qdel doesn't eat it.
qdel(src)
return
return TRUE
// OTHER
else if (can_use() && (istype(W, /obj/item/paper)) && isliving(user))
@@ -187,17 +189,18 @@
if (S.current_camera == src)
to_chat(O, "[U] holds \a [itemname] up to one of the cameras ...")
O << browse(text("<HTML><HEAD><TITLE>[]</TITLE></HEAD><BODY><TT>[]</TT></BODY></HTML>", itemname, info), text("window=[]", itemname)) //Force people watching to open the page so they can't see it again)
return TRUE
else if (istype(W, /obj/item/camera_bug))
if (!src.can_use())
to_chat(user, "<span class='warning'>Camera non-functional.</span>")
return
if (src.bugged)
else if (src.bugged)
to_chat(user, "<span class='notice'>Camera bug removed.</span>")
src.bugged = 0
else
to_chat(user, "<span class='notice'>Camera bugged.</span>")
src.bugged = 1
return TRUE
else if(W.damtype == BRUTE || W.damtype == BURN) //bashing cameras
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
@@ -209,9 +212,9 @@
if (I.hitsound)
playsound(loc, I.hitsound, I.get_clamped_volume(), 1, -1)
take_damage(W.force)
return TRUE
else
..()
return ..()
/obj/machinery/camera/proc/deactivate(user as mob, var/choice = 1)
// The only way for AI to reactivate cameras are malf abilities, this gives them different messages.
@@ -36,7 +36,7 @@
state = 1
update_icon()
auto_turn()
return
return TRUE
if(1)
// State 1
@@ -45,7 +45,7 @@
to_chat(user, "You weld the assembly securely into place.")
anchored = 1
state = 2
return
return TRUE
else if(W.iswrench())
playsound(src.loc, W.usesound, 50, 1)
@@ -53,7 +53,7 @@
anchored = 0
update_icon()
state = 0
return
return TRUE
if(2)
// State 2
@@ -64,7 +64,7 @@
state = 3
else
to_chat(user, "<span class='warning'>You need 2 coils of wire to wire the assembly.</span>")
return
return TRUE
else if(W.iswelder())
@@ -72,7 +72,7 @@
to_chat(user, "You unweld the assembly from its place.")
state = 1
anchored = 1
return
return TRUE
if(3)
@@ -83,12 +83,12 @@
var/input = sanitize(input(usr, "Which networks would you like to connect this camera to? Separate networks with a comma. No Spaces!\nFor example: Station,Security,Secret", "Set Network", camera_network ? camera_network : NETWORK_STATION))
if(!input)
to_chat(usr, "No input found please hang up and try your call again.")
return
return TRUE
var/list/tempnetwork = text2list(input, ",")
if(tempnetwork.len < 1)
to_chat(usr, "No network found please hang up and try your call again.")
return
return TRUE
var/area/camera_area = get_area(src)
var/temptag = "[sanitize(camera_area.name)] ([rand(1, 999)])"
@@ -113,7 +113,7 @@
var/confirm = alert(user, "Is this what you want? Chances Remaining: [i]", "Confirmation", "Yes", "No")
if(confirm == "Yes")
break
return
return TRUE
else if(W.iswirecutter())
@@ -121,7 +121,7 @@
playsound(src.loc, 'sound/items/wirecutter.ogg', 50, 1)
to_chat(user, "You cut the wires from the circuits.")
state = 2
return
return TRUE
// Upgrades!
if(is_type_in_list(W, possible_upgrades) && !is_type_in_list(W, upgrades)) // Is a possible upgrade and isn't in the camera already.
+4 -3
View File
@@ -37,13 +37,14 @@
if(src.allowed(user))
covered = !covered //Enable / Disable the forcefield
update_use_power(covered + 1) //Update the power usage
. = TRUE
else
if(covered && (stat & NOPOWER)) //Only bounce off if its powered (i.e. shield active)
..()
. = ..()
else
user.visible_message("<span class='danger'>[src] has been hit by [user] with [W], but it bounces off the forcefield.</span>","<span class='danger'>You hit [src] with [W], but it bounces off the forcefield.</span>","You hear something boucing off a forcefield.")
. = TRUE
update_icon()
return
/obj/machinery/case_button/attack_hand(mob/user as mob)
if(!covered)
@@ -111,4 +112,4 @@
/obj/machinery/case_button/shuttle/deactivate(mob/user)
..()
return cancel_call_proc(user)
return cancel_call_proc(user)
+7 -5
View File
@@ -44,29 +44,30 @@
/obj/machinery/cell_charger/attackby(obj/item/W, mob/user)
if(stat & BROKEN)
return
return TRUE
if(istype(W, /obj/item/cell) && anchored)
if(charging)
to_chat(user, "<span class='warning'>There is already a cell in the charger.</span>")
return
return TRUE
else
var/area/a = loc.loc // Gets our locations location, like a dream within a dream
if(!isarea(a))
return
return TRUE
if(a.power_equip == 0) // There's no APC in this area, don't try to cheat power!
to_chat(user, "<span class='warning'>The [name] blinks red as you try to insert the cell!</span>")
return
return TRUE
user.drop_from_inventory(W,src)
charging = W
user.visible_message("[user] inserts a cell into the charger.", "You insert a cell into the charger.")
chargelevel = -1
update_icon()
return TRUE
else if(W.iswrench())
if(charging)
to_chat(user, "<span class='warning'>Remove the cell first!</span>")
return
return TRUE
anchored = !anchored
to_chat(user, "You [anchored ? "attach" : "detach"] the cell charger [anchored ? "to" : "from"] the ground")
@@ -82,6 +83,7 @@
user.visible_message("[user] removes the cell from the charger.", "You remove the cell from the charger.")
chargelevel = -1
update_icon()
return TRUE
/obj/machinery/cell_charger/attack_ai(mob/user)
if(istype(user, /mob/living/silicon/robot) && Adjacent(user)) // Borgs can remove the cell if they are near enough
+7 -7
View File
@@ -31,26 +31,26 @@
/obj/machinery/chem_heater/attackby(obj/item/O, mob/user)
if(default_deconstruction_screwdriver(user, O))
return
return TRUE
if(default_deconstruction_crowbar(user, O))
return
return TRUE
if(default_part_replacement(user, O))
return
return TRUE
if(istype(O, /obj/item/reagent_containers/glass) || istype(O, /obj/item/reagent_containers/food))
if(container)
to_chat(user, SPAN_WARNING("There is already \a [container] on \the [src]!"))
return
return TRUE
var/obj/item/reagent_containers/RC = O
if(!RC.is_open_container())
to_chat(user, SPAN_WARNING("You don't see how \the [src] could heat up the reagents in \the [RC]."))
return
return TRUE
container = RC
user.drop_from_inventory(RC,src)
to_chat(user, SPAN_NOTICE("You set \the [RC] in \the [src]."))
updateUsrDialog()
return
return TRUE
/obj/machinery/chem_heater/interact(mob/user as mob)
if(stat & BROKEN)
@@ -162,4 +162,4 @@
#undef SLOW_MODE_MAX_TEMP_CHANGE
#undef SLOW_MODE_MAX_TEMP_CHANGE
+9 -8
View File
@@ -215,20 +215,20 @@
/obj/machinery/clonepod/attackby(obj/item/W as obj, mob/user as mob)
if(isnull(occupant))
if(default_deconstruction_screwdriver(user, W))
return
return TRUE
if(default_deconstruction_crowbar(user, W))
return
return TRUE
if(default_part_replacement(user, W))
return
return TRUE
if(W.GetID())
if(!check_access(W.GetID()))
to_chat(user, "<span class='warning'>Access Denied.</span>")
return
return TRUE
if((!locked) || (isnull(occupant)))
return
return TRUE
if((occupant.health < -20) && (occupant.stat != 2))
to_chat(user, "<span class='warning'>Access Refused.</span>")
return
return TRUE
else
locked = 0
to_chat(user, "System unlocked.")
@@ -237,7 +237,7 @@
biomass += 50
user.drop_from_inventory(W,src)
qdel(W)
return
return TRUE
else if(W.iswrench())
if(locked && (anchored || occupant))
to_chat(user, "<span class='warning'>Can not do that while [src] is in use.</span>")
@@ -253,8 +253,9 @@
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.")
return TRUE
else
..()
return ..()
/obj/machinery/clonepod/emag_act(var/remaining_charges, var/mob/user)
if(isnull(occupant))
+3 -3
View File
@@ -62,7 +62,7 @@
if(input_scan)
to_chat(usr, SPAN_NOTICE("You try to insert \the [O], but \the [src] buzzes. There is already a [O] inside!"))
playsound(src, 'sound/machines/buzz-sigh.ogg', 50, 1)
return
return TRUE
user.drop_from_inventory(O, src)
input_scan = O
input_scan.color = "#272727"
@@ -70,10 +70,10 @@
usr.visible_message("\The [src] pings, displaying \the [input_scan].")
to_chat(usr, SPAN_NOTICE("You insert \the [O] into [src]."))
playsound(src, 'sound/bureaucracy/scan.ogg', 50, 1)
return
return TRUE
else
to_chat(usr, SPAN_WARNING("\The [src]'s scan slot is closed! Please put in a valid patient on the table to open it!"))
return
return TRUE
/obj/machinery/computer/operating/interact(mob/user)
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
+26 -12
View File
@@ -22,6 +22,7 @@
to_chat(user, "<span class='notice'>You wrench the frame into place.</span>")
anchored = 1
state = 1
return TRUE
if(P.iswelder())
var/obj/item/weldingtool/WT = P
if(!WT.isOn())
@@ -33,6 +34,7 @@
to_chat(user, "<span class='notice'>You deconstruct the frame.</span>")
new /obj/item/stack/material/plasteel( loc, 4)
qdel(src)
return TRUE
if(1)
if(P.iswrench())
playsound(loc, P.usesound, 50, 1)
@@ -40,17 +42,20 @@
to_chat(user, "<span class='notice'>You unfasten the frame.</span>")
anchored = 0
state = 0
return TRUE
if(istype(P, /obj/item/circuitboard/aicore) && !circuit)
playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1)
to_chat(user, "<span class='notice'>You place the circuit board inside the frame.</span>")
icon_state = "1"
circuit = P
user.drop_from_inventory(P,src)
return TRUE
if(P.isscrewdriver() && circuit)
playsound(loc, P.usesound, 50, 1)
to_chat(user, "<span class='notice'>You screw the circuit board into place.</span>")
state = 2
icon_state = "2"
return TRUE
if(P.iscrowbar() && circuit)
playsound(loc, P.usesound, 50, 1)
to_chat(user, "<span class='notice'>You remove the circuit board.</span>")
@@ -58,17 +63,19 @@
icon_state = "0"
circuit.forceMove(loc)
circuit = null
return TRUE
if(2)
if(P.isscrewdriver() && circuit)
playsound(loc, P.usesound, 50, 1)
to_chat(user, "<span class='notice'>You unfasten the circuit board.</span>")
state = 1
icon_state = "1"
return TRUE
if(P.iscoil())
var/obj/item/stack/cable_coil/C = P
if (C.get_amount() < 5)
to_chat(user, "<span class='warning'>You need five coils of wire to add them to the frame.</span>")
return
return TRUE
to_chat(user, "<span class='notice'>You start to add cables to the frame.</span>")
playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1)
if (do_after(user, 20) && state == 2)
@@ -76,7 +83,7 @@
state = 3
icon_state = "3"
to_chat(user, "<span class='notice'>You add cables to the frame.</span>")
return
return TRUE
if(3)
if(P.iswirecutter())
if (brain)
@@ -88,6 +95,7 @@
icon_state = "2"
var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( loc )
A.amount = 5
return TRUE
if(istype(P, /obj/item/stack/material) && P.get_material_name() == "rglass")
var/obj/item/stack/RG = P
@@ -101,12 +109,14 @@
to_chat(user, "<span class='notice'>You put in the glass panel.</span>")
state = 4
icon_state = "4"
return TRUE
if(istype(P, /obj/item/aiModule/asimov))
laws.add_inherent_law("You may not injure a human being or, through inaction, allow a human being to come to harm.")
laws.add_inherent_law("You must obey orders given to you by human beings, except where such orders would conflict with the First Law.")
laws.add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.")
to_chat(usr, "Law module applied.")
return TRUE
if(istype(P, /obj/item/aiModule/nanotrasen))
laws.add_inherent_law("Safeguard: Protect your assigned space station to the best of your ability. It is not something we can easily afford to replace.")
@@ -114,23 +124,26 @@
laws.add_inherent_law("Protect: Protect the crew of your assigned space station to the best of your abilities, with priority as according to their rank and role.")
laws.add_inherent_law("Survive: AI units are not expendable, they are expensive. Do not allow unauthorized personnel to tamper with your equipment.")
to_chat(usr, "Law module applied.")
return TRUE
if(istype(P, /obj/item/aiModule/purge))
laws.clear_inherent_laws()
to_chat(usr, "Law module applied.")
return TRUE
if(istype(P, /obj/item/aiModule/freeform))
var/obj/item/aiModule/freeform/M = P
laws.add_inherent_law(M.newFreeFormLaw)
to_chat(usr, "Added a freeform law.")
return TRUE
if(istype(P, /obj/item/device/mmi))
var/obj/item/device/mmi/M = P
if(!M.ready_for_use(user))
return
return TRUE
if(jobban_isbanned(M.brainmob, "AI"))
to_chat(user, "<span class='warning'>This [P] does not seem to fit.</span>")
return
return TRUE
if(M.brainmob.mind)
clear_antag_roles(M.brainmob.mind, 1)
@@ -139,6 +152,7 @@
brain = P
to_chat(usr, "Added [P].")
icon_state = "3b"
return TRUE
if(P.iscrowbar() && brain)
playsound(loc, P.usesound, 50, 1)
@@ -146,6 +160,7 @@
brain.forceMove(loc)
brain = null
icon_state = "3"
return TRUE
if(4)
if(P.iscrowbar())
@@ -157,7 +172,7 @@
else
icon_state = "3"
new /obj/item/stack/material/glass/reinforced( loc, 2 )
return
return TRUE
if(P.isscrewdriver())
playsound(loc, P.usesound, 50, 1)
@@ -173,6 +188,7 @@
A.rename_self("ai", 1)
feedback_inc("cyborg_ais_created",1)
qdel(src)
return TRUE
/obj/structure/AIcore/deactivated
name = "inactive AI"
@@ -221,26 +237,24 @@
load_ai(transfer,card,user)
else
to_chat(user, "<span class='danger'>ERROR:</span> Unable to locate artificial intelligence.")
return
return TRUE
else if(W.iswrench())
if(anchored)
user.visible_message("<span class='notice'>\The [user] starts to unbolt \the [src] from the plating...</span>")
if(!do_after(user,40/W.toolspeed))
user.visible_message("<span class='notice'>\The [user] decides not to unbolt \the [src].</span>")
return
return TRUE
user.visible_message("<span class='notice'>\The [user] finishes unfastening \the [src]!</span>")
anchored = 0
return
else
user.visible_message("<span class='notice'>\The [user] starts to bolt \the [src] to the plating...</span>")
if(!do_after(user,40/W.toolspeed))
user.visible_message("<span class='notice'>\The [user] decides not to bolt \the [src].</span>")
return
return TRUE
user.visible_message("<span class='notice'>\The [user] finishes fastening down \the [src]!</span>")
anchored = 1
return
else
return ..()
return TRUE
return ..()
/client/proc/empty_ai_core_toggle_latejoin()
set name = "Toggle AI Core Latejoin"
+15 -3
View File
@@ -19,17 +19,19 @@
to_chat(user, "<span class='notice'>You wrench the frame into place.</span>")
src.anchored = 1
src.state = 1
return TRUE
if(P.iswelder())
var/obj/item/weldingtool/WT = P
if(!WT.remove_fuel(0, user))
to_chat(user, "The welding tool must be on to complete this task.")
return
return TRUE
playsound(src.loc, 'sound/items/welder.ogg', 50, 1)
if(do_after(user, 20/P.toolspeed))
if(!src || !WT.isOn()) return
to_chat(user, "<span class='notice'>You deconstruct the frame.</span>")
new /obj/item/stack/material/steel( src.loc, 5 )
qdel(src)
return TRUE
if(1)
if(P.iswrench())
playsound(src.loc, P.usesound, 50, 1)
@@ -37,6 +39,7 @@
to_chat(user, "<span class='notice'>You unfasten the frame.</span>")
src.anchored = 0
src.state = 0
return TRUE
if(istype(P, /obj/item/circuitboard) && !circuit)
var/obj/item/circuitboard/B = P
if(B.board_type == "computer")
@@ -47,11 +50,13 @@
user.drop_from_inventory(P,src)
else
to_chat(user, "<span class='warning'>This frame does not accept circuit boards of this type!</span>")
return TRUE
if(P.isscrewdriver() && circuit)
playsound(src.loc, P.usesound, 50, 1)
to_chat(user, "<span class='notice'>You screw the circuit board into place and screw the drawer shut.</span>")
src.state = 2
src.icon_state = "2"
return TRUE
if(P.iscrowbar() && circuit)
playsound(src.loc, P.usesound, 50, 1)
to_chat(user, "<span class='notice'>You remove the circuit board.</span>")
@@ -59,17 +64,19 @@
src.icon_state = "0"
circuit.forceMove(src.loc)
src.circuit = null
return TRUE
if(2)
if(P.isscrewdriver() && circuit)
playsound(src.loc, P.usesound, 50, 1)
to_chat(user, "<span class='notice'>You unfasten the circuit board.</span>")
src.state = 1
src.icon_state = "1"
return TRUE
if(P.iscoil())
var/obj/item/stack/cable_coil/C = P
if (C.get_amount() < 5)
to_chat(user, "<span class='warning'>You need five coils of wire to add them to the frame.</span>")
return
return TRUE
to_chat(user, "<span class='notice'>You start to add cables to the frame.</span>")
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
if(do_after(user, 20) && state == 2)
@@ -77,6 +84,7 @@
to_chat(user, "<span class='notice'>You add cables to the frame.</span>")
state = 3
icon_state = "3"
return TRUE
if(3)
if(P.iswirecutter())
playsound(src.loc, 'sound/items/wirecutter.ogg', 50, 1)
@@ -85,12 +93,13 @@
src.icon_state = "2"
var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( src.loc )
A.amount = 5
return TRUE
if(istype(P, /obj/item/stack/material) && P.get_material_name() == "glass")
var/obj/item/stack/G = P
if (G.get_amount() < 2)
to_chat(user, "<span class='warning'>You need two sheets of glass to put in the glass panel.</span>")
return
return TRUE
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
to_chat(user, "<span class='notice'>You start to put in the glass keyboard.</span>")
if(do_after(user, 20) && state == 3)
@@ -98,6 +107,7 @@
to_chat(user, "<span class='notice'>You put in the glass keyboard.</span>")
src.state = 4
src.icon_state = "4"
return TRUE
if(4)
if(P.iscrowbar())
playsound(src.loc, P.usesound, 50, 1)
@@ -105,9 +115,11 @@
src.state = 3
src.icon_state = "3"
new /obj/item/stack/material/glass( src.loc, 2 )
return TRUE
if(P.isscrewdriver())
playsound(src.loc, P.usesound, 50, 1)
to_chat(user, "<span class='notice'>You connect the glass keyboard.</span>")
var/B = new src.circuit.build_path ( src.loc )
src.circuit.construct(B)
qdel(src)
return TRUE
+2 -3
View File
@@ -94,10 +94,9 @@
src.diskette = W
to_chat(user, "You insert [W].")
src.updateUsrDialog()
return
return TRUE
else
..()
return
return ..()
/obj/machinery/computer/cloning/attack_ai(mob/user as mob)
if(!ai_can_interact(user))
+2 -1
View File
@@ -127,8 +127,9 @@
A.icon_state = "4"
M.deconstruct(src)
qdel(src)
return TRUE
else
..()
return ..()
/obj/machinery/computer/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if (!mover)
+2 -2
View File
@@ -82,8 +82,8 @@
updateUsrDialog()
else if(giver)
to_chat(user, "<span class='warning'>There is already ID card inside.</span>")
return
..()
return TRUE
return ..()
/obj/machinery/computer/guestpass/attack_ai(var/mob/user as mob)
if(!ai_can_interact(user))
+5 -3
View File
@@ -29,12 +29,13 @@
/obj/machinery/computer/aiupload/attackby(obj/item/O as obj, mob/user as mob)
if(isNotStationLevel(src.z))
to_chat(user, "<span class='danger'>Unable to establish a connection:</span>")
return
return TRUE
if(istype(O, /obj/item/aiModule))
var/obj/item/aiModule/M = O
M.install(src)
return TRUE
else
..()
return ..()
/obj/machinery/computer/aiupload/attack_hand(var/mob/user as mob)
@@ -70,9 +71,10 @@
/obj/machinery/computer/borgupload/attackby(obj/item/aiModule/module as obj, mob/user as mob)
if(isNotStationLevel(src.z))
to_chat(user, "<span class='danger'>Unable to establish a connection:</span>")
return
return TRUE
if(istype(module, /obj/item/aiModule))
module.install(src)
return TRUE
else
return ..()
+4 -6
View File
@@ -39,17 +39,15 @@
/obj/machinery/computer/message_monitor/attackby(obj/item/O as obj, mob/living/user as mob)
if(stat & (NOPOWER|BROKEN))
..()
return
return ..()
if(!istype(user))
return
return TRUE
if(O.isscrewdriver() && emag)
//Stops people from just unscrewing the monitor and putting it back to get the console working again.
to_chat(user, "<span class='warning'>It is too hot to mess with!</span>")
return
return TRUE
..()
return
return ..()
/obj/machinery/computer/message_monitor/emag_act(var/remaining_charges, var/mob/user)
// Will create sparks and print out the console's password. You will then have to wait a while for the console to be back online.
+3 -2
View File
@@ -38,10 +38,11 @@
to_chat(user, "<span class='alert'>Could not import incident report.</span>")
qdel( O )
return TRUE
else if( istype( O, /obj/item/paper ) && menu_screen == "import_incident" )
to_chat(user, "<span class='alert'>This console only accepts authentic incident reports. Copies are invalid.</span>")
..()
return TRUE
return ..()
/obj/machinery/computer/sentencing/proc/import( var/obj/item/paper/incident/I )
incident = null
+4 -1
View File
@@ -87,7 +87,7 @@
if(paymode == COIN)
if(prob(2))
if(!user.drop_from_inventory(C, user.loc))
return
return TRUE
C.throw_at(user, 3, 10)
if(prob(10))
balance = max(balance - SPIN_PRICE, 0)
@@ -100,6 +100,7 @@
qdel(C)
else
to_chat(user, SPAN_WARNING("This machine is only accepting credit chips!"))
return TRUE
else if(istype(I, /obj/item/spacecash))
if(paymode == CREDITCHIP)
var/obj/item/spacecash/H = I
@@ -110,6 +111,7 @@
qdel(H)
else
to_chat(user, SPAN_WARNING("This machine is only accepting coins!"))
return TRUE
else if(I.ismultitool())
if(balance > 0)
visible_message("<b>[src]</b> says, 'ERROR! Please empty the machine balance before altering paymode'") //Prevents converting coins into credits and vice versa
@@ -120,6 +122,7 @@
else
paymode = CREDITCHIP
visible_message("<b>[src]</b> says, 'This machine now works with CREDITCHIPS!'")
return TRUE
else
return ..()
+12 -2
View File
@@ -73,12 +73,13 @@
to_chat(user, SPAN_NOTICE("You decide to scrap the blueprint."))
new /obj/item/stack/material/steel(get_turf(src), 2)
qdel(src)
return TRUE
if(WIRING_STATE)
if(P.iscoil())
var/obj/item/stack/cable_coil/C = P
if(C.get_amount() < 5)
to_chat(user, SPAN_WARNING("You need five lengths of cable to add them to the blueprint."))
return
return TRUE
playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, TRUE)
to_chat(user, SPAN_NOTICE("You start wiring up the blueprint..."))
if(do_after(user, 20, act_target = src))
@@ -86,21 +87,24 @@
to_chat(user, SPAN_NOTICE("You wire up the blueprint."))
state = CIRCUITBOARD_STATE
icon_state = "blueprint_1"
return TRUE
else
if(P.iswrench())
playsound(get_turf(src), P.usesound, 75, TRUE)
to_chat(user, SPAN_NOTICE("You dismantle the blueprint."))
new /obj/item/stack/material/steel(get_turf(src), 2)
qdel(src)
return TRUE
else if(istype(P, /obj/item/gun/energy/plasmacutter))
var/obj/item/gun/energy/plasmacutter/PC = P
if(PC.check_power_and_message(user))
return
return TRUE
PC.use_resource(1)
playsound(get_turf(src), PC.fire_sound, 75, TRUE)
to_chat(user, SPAN_NOTICE("You dismantle the blueprint."))
new /obj/item/stack/material/steel(get_turf(src), 2)
qdel(src)
return TRUE
if(CIRCUITBOARD_STATE)
if(istype(P, /obj/item/circuitboard))
var/obj/item/circuitboard/B = P
@@ -129,6 +133,7 @@
to_chat(user, SPAN_NOTICE("[components_description]"))
else
to_chat(user, SPAN_WARNING("This blueprint does not accept circuit boards of this type!"))
return TRUE
else
if(P.iswirecutter())
playsound(get_turf(src), P.usesound, 50, TRUE, pitch_toggle)
@@ -138,6 +143,7 @@
var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil(get_turf(src))
A.amount = 5
A.update_icon()
return TRUE
if(COMPONENT_STATE)
if(P.iscrowbar())
@@ -157,6 +163,7 @@
req_components = list()
components = list()
icon_state = "blueprint_2"
return TRUE
else
if(P.isscrewdriver())
var/component_check = TRUE
@@ -189,6 +196,7 @@
new_machine.RefreshParts()
new_machine.anchored = TRUE
qdel(src)
return TRUE
else
if(istype(P, /obj/item))
for(var/I in req_components)
@@ -214,6 +222,7 @@
to_chat(user, SPAN_NOTICE("[components_description]"))
if(P?.loc != src && !istype(P, /obj/item/stack))
to_chat(user, SPAN_WARNING("You cannot add that component to the machine!."))
return TRUE
/obj/machinery/constructable_frame/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
@@ -241,6 +250,7 @@
to_chat(user, SPAN_NOTICE("You dismantle \the [src]."))
new /obj/item/stack/material/steel(get_turf(src), 5)
qdel(src)
return TRUE
#undef BLUEPRINT_STATE
#undef WIRING_STATE
+6 -6
View File
@@ -93,13 +93,13 @@
M.apply_damage(45, PAIN)
M.visible_message("<span class='danger'>[user]'s hand catches in the [src]!</span>", "<span class='danger'>Your hand gets caught in the [src]!</span>")
M.say("*scream")
return
return TRUE
if(default_deconstruction_screwdriver(user, O))
return
return TRUE
if(default_deconstruction_crowbar(user, O))
return
return TRUE
if(default_part_replacement(user, O))
return
return TRUE
//Stuff you can do if the maint hatch is open
if(panel_open)
@@ -111,8 +111,8 @@
if(valve_open)
blocked = 0
action = "retract"
return
..()
return TRUE
return ..()
/obj/machinery/crusher_base/default_deconstruction_crowbar(var/mob/user, var/obj/item/crowbar/C)
if(!istype(C))
+4 -4
View File
@@ -182,7 +182,7 @@
if(istype(G, /obj/item/reagent_containers/glass))
if(beaker)
to_chat(user, "<span class='warning'>A beaker is already loaded into the machine.</span>")
return
return TRUE
beaker = G
user.drop_from_inventory(G,src)
@@ -199,18 +199,18 @@
if(do_mob(user, L, 30, needhand = 0))
var/bucklestatus = L.bucklecheck(user)
if(!bucklestatus)//incase the patient got buckled_to during the delay
return
return TRUE
if(bucklestatus == 2)
var/obj/structure/LB = L.buckled_to
LB.user_unbuckle(user)
for(var/mob/living/carbon/slime/M in range(1, L))
if(M.victim == L)
to_chat(user, SPAN_WARNING("[L] will not fit into the cryo because they have a slime latched onto their head."))
return
return TRUE
if(put_mob(L))
user.visible_message("<span class='notice'>[user] puts [L] into [src].</span>", "<span class='notice'>You put [L] into [src].</span>", range = 3)
qdel(G)
return
return TRUE
/obj/machinery/atmospherics/unary/cryo_cell/MouseDrop_T(atom/movable/O as mob|obj, mob/living/user as mob)
if(!istype(user))
+6 -5
View File
@@ -384,11 +384,11 @@ var/global/list/frozen_crew = list()
if(istype(G))
if(occupant)
to_chat(user, SPAN_WARNING("\The [src] is in use."))
return
return TRUE
if(!ismob(G.affecting))
return
return TRUE
if(!check_occupant_allowed(G.affecting))
return
return TRUE
var/willing = FALSE //We don't want to allow people to be forced into despawning.
var/mob/M = G.affecting
@@ -397,7 +397,7 @@ var/global/list/frozen_crew = list()
var/original_loc = M.loc
if(alert(M, "Would you like to enter long-term storage?", , "Yes", "No") == "Yes")
if(!M || !G || !G.affecting || M.loc != original_loc)
return
return TRUE
willing = TRUE
else
willing = TRUE
@@ -407,7 +407,7 @@ var/global/list/frozen_crew = list()
if(do_after(user, 20))
if(!M || !G || !G.affecting)
return
return TRUE
M.forceMove(src)
@@ -430,6 +430,7 @@ var/global/list/frozen_crew = list()
//Despawning occurs when process() is called with an occupant without a client.
src.add_fingerprint(M)
return TRUE
/obj/machinery/cryopod/MouseDrop_T(atom/movable/O, mob/living/user)
if(!istype(user))
+4 -4
View File
@@ -110,13 +110,13 @@ for reference:
if(health < maxhealth)
if(D.get_amount() < 1)
to_chat(user, SPAN_WARNING("You need one sheet of [material.display_name] to repair \the [src]."))
return
return TRUE
user.visible_message("<b>[user]</b> begins to repair \the [src].", SPAN_NOTICE("You begin to repair \the [src]."))
if(do_after(user, 2 SECONDS) && health < maxhealth)
if(D.use(1))
health = maxhealth
visible_message("<b>[user]</b> repairs \the [src].", SPAN_NOTICE("You repair \the [src]."))
return
return TRUE
else
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
switch(W.damtype)
@@ -127,8 +127,8 @@ for reference:
shake_animation()
playsound(src.loc, material.hitsound, W.get_clamped_volume(), 1)
if(check_dismantle())
return
..()
return TRUE
return ..()
/obj/structure/barricade/proc/check_dismantle()
if(src.health <= 0)
+21 -16
View File
@@ -233,7 +233,7 @@
/obj/machinery/door/airlock/centcom/attackby(obj/item/I, mob/user)
if (operating)
return
return TRUE
if (allowed(user) && operable())
if (density)
@@ -242,6 +242,7 @@
close()
else
do_animate("deny")
return TRUE
/obj/machinery/door/airlock/centcom/attack_ai(mob/user)
if(!ai_can_interact(user))
@@ -272,7 +273,7 @@
obj/machinery/door/airlock/glass_centcom/attackby(obj/item/I, mob/user)
if (operating)
return
return TRUE
if (allowed(user) && operable())
if (density)
@@ -281,6 +282,7 @@ obj/machinery/door/airlock/glass_centcom/attackby(obj/item/I, mob/user)
close()
else
do_animate("deny")
return TRUE
/obj/machinery/door/airlock/glass_centcom/attack_ai(mob/user)
if(!ai_can_interact(user))
@@ -1248,22 +1250,22 @@ About the new airlock wires panel:
if(!istype(usr, /mob/living/silicon))
if(src.isElectrified())
if(src.shock(user, 75))
return
return TRUE
if(istype(C, /obj/item/taperoll) || istype(C, /obj/item/rfd))
return
return TRUE
if(!istype(C, /obj/item/forensics))
src.add_fingerprint(user)
if (!repairing && (stat & BROKEN) && src.locked) //bolted and broken
if (!cut_bolts(C,user))
..()
return
return ..()
return TRUE
if (istype(C, /obj/item/device/magnetic_lock))
if (bracer)
to_chat(user, SPAN_NOTICE("There is already a [bracer] on [src]!"))
return
return TRUE
var/obj/item/device/magnetic_lock/newbracer = C
newbracer.attachto(src, user)
return
return TRUE
if(!repairing && (C.iswelder() && !( src.operating > 0 ) && src.density))
var/obj/item/weldingtool/WT = C
if(WT.isOn())
@@ -1274,16 +1276,14 @@ About the new airlock wires panel:
)
playsound(src, 'sound/items/welder.ogg', 50, 1)
if (!do_after(user, 2/C.toolspeed SECONDS, act_target = src, extra_checks = CALLBACK(src, .proc/is_open, src.density)))
return
return TRUE
if(!WT.remove_fuel(0,user))
to_chat(user, SPAN_NOTICE("You need more welding fuel to complete this task."))
return
return TRUE
playsound(src, 'sound/items/welder_pry.ogg', 50, 1)
welded = !welded
update_icon()
return
else
return
return TRUE
else if(C.isscrewdriver())
if (src.p_open)
if (stat & BROKEN)
@@ -1295,6 +1295,7 @@ About the new airlock wires panel:
src.p_open = TRUE
to_chat(user, SPAN_NOTICE("You carefully unscrew the panel on \the [src]"))
src.update_icon()
return TRUE
else if(C.iswirecutter())
return src.attack_hand(user)
else if(C.ismultitool())
@@ -1304,6 +1305,7 @@ About the new airlock wires panel:
else if(istype(C, /obj/item/pai_cable)) // -- TLE
var/obj/item/pai_cable/cable = C
cable.plugin(src, user)
return TRUE
else if(!repairing && C.iscrowbar())
if(istype(C, /obj/item/melee/arm_blade))
if(!arePowerSystemsOn()) //if this check isn't done and empty, the armblade will never be used to hit the airlock
@@ -1332,6 +1334,7 @@ About the new airlock wires panel:
open(1)
else
close(1)
return TRUE
else if(istype(C, /obj/item/material/twohanded/fireaxe) && !arePowerSystemsOn())
if(locked && user.a_intent != I_HURT)
to_chat(user, SPAN_NOTICE("The airlock's bolts prevent it from being forced."))
@@ -1350,6 +1353,7 @@ About the new airlock wires panel:
close(1)
else
to_chat(user, SPAN_WARNING("You need to be wielding \the [C] to do that."))
return TRUE
else if(istype(C, /obj/item/melee/hammer) && !arePowerSystemsOn())
if(locked && user.a_intent != I_HURT)
to_chat(user, SPAN_NOTICE("The airlock's bolts prevent it from being forced."))
@@ -1360,6 +1364,7 @@ About the new airlock wires panel:
open(1)
else
close(1)
return TRUE
else if(density && istype(C, /obj/item/material/twohanded/chainsaw))
var/obj/item/material/twohanded/chainsaw/ChainSawVar = C
if(!ChainSawVar.wielded)
@@ -1420,14 +1425,14 @@ About the new airlock wires panel:
open(1)
take_damage(50)
ChainSawVar.cutting = 0
return TRUE
else
..()
return
return ..()
/obj/machinery/door/airlock/phoron/attackby(C as obj, mob/user as mob)
if(C)
ignite(is_hot(C))
..()
return ..()
/obj/machinery/door/airlock/set_broken()
src.p_open = TRUE
+2 -2
View File
@@ -265,8 +265,8 @@
//Swiping ID on the access button
if (I.GetID())
attack_hand(user)
return
..()
return TRUE
return ..()
/obj/machinery/access_button/attack_hand(mob/user)
add_fingerprint(usr)
@@ -32,7 +32,7 @@
t1 += "<B>Unrestricted Access Settings</B><br>"
for(var/direction in cardinal)
if(direction & unres_dir)
t1 += "<a style='color:#00dd12' href='?src=\ref[src];unres_dir=[direction]'>[capitalize(dir2text(direction))]</a><br>"
@@ -116,15 +116,16 @@
if(istype(W, /obj/item/airlock_electronics) &&(!isrobot(user)))
if(src.locked)
to_chat(user, SPAN_WARNING("\The [src] you're trying to set is locked! Swipe your ID to unlock."))
return
return TRUE
var/obj/item/airlock_electronics/A = W
if(A.locked)
to_chat(user, SPAN_WARNING("\The [src] you're trying to copy is locked! Swipe your ID to unlock."))
return
return TRUE
src.conf_access = A.conf_access
src.one_access = A.one_access
src.last_configurator = A.last_configurator
to_chat(user, SPAN_NOTICE("Configuration settings copied successfully."))
return TRUE
else if(W.GetID())
var/obj/item/card/id/I = W.GetID()
if(check_access(I))
@@ -133,8 +134,9 @@
to_chat(user, SPAN_NOTICE("You swipe your ID over \the [src], [locked ? "locking" : "unlocking"] it."))
else
to_chat(user, SPAN_WARNING("Access denied."))
return TRUE
else
..()
return ..()
/obj/item/airlock_electronics/secure
name = "secure airlock electronics"
+4 -3
View File
@@ -123,16 +123,16 @@
force_toggle()
else
to_chat(usr, "<span class='notice'>[src]'s motors resist your effort.</span>")
return
return TRUE
if(istype(C, /obj/item/stack/material) && C.get_material_name() == "plasteel")
var/amt = Ceiling((maxhealth - health)/150)
if(!amt)
to_chat(usr, "<span class='notice'>\The [src] is already fully repaired.</span>")
return
return TRUE
var/obj/item/stack/P = C
if(P.amount < amt)
to_chat(usr, "<span class='warning'>You don't have enough sheets to repair this! You need at least [amt] sheets.</span>")
return
return TRUE
to_chat(usr, "<span class='notice'>You begin repairing [src]...</span>")
if(do_after(usr, 30))
if(P.use(amt))
@@ -140,6 +140,7 @@
src.repair()
else
to_chat(usr, "<span class='warning'>You don't have enough sheets to repair this! You need at least [amt] sheets.</span>")
return TRUE
+3 -3
View File
@@ -282,12 +282,12 @@
src.updateUsrDialog()
else
to_chat(user, "<span class='alert'>\The [src] buzzes, \"There's already an active sentence!\"</span>")
return
return TRUE
else if( istype( O, /obj/item/paper ))
to_chat(user, "<span class='alert'>\The [src] buzzes, \"This console only accepts authentic incident reports. Copies are invalid.\"</span>")
return
return TRUE
..()
return ..()
/obj/machinery/door_timer/proc/import( var/obj/item/paper/incident/I, var/user )
if( !istype( I ))
+10 -13
View File
@@ -304,13 +304,13 @@
if(istype(stack) && stack.get_material_name() == get_material_name())
if(stat & BROKEN)
to_chat(user, SPAN_NOTICE("It looks like \the [src] is pretty busted. It's going to need more than just patching up now."))
return
return TRUE
if(health >= maxhealth)
to_chat(user, SPAN_NOTICE("Nothing to fix!"))
return
return TRUE
if(!density)
to_chat(user, SPAN_WARNING("\The [src] must be closed before you can repair it."))
return
return TRUE
//figure out how much metal we need
var/amount_needed = (maxhealth - health) / DOOR_REPAIR_AMOUNT
@@ -330,12 +330,12 @@
if (transfer)
to_chat(user, SPAN_NOTICE("You fit [transfer] [stack.singular_name]\s to damaged and broken parts on \the [src]."))
return
return TRUE
if(repairing && I.iswelder())
if(!density)
to_chat(user, "<span class='warning'>\The [src] must be closed before you can repair it.</span>")
return
return TRUE
var/obj/item/weldingtool/welder = I
if(welder.remove_fuel(0,user))
@@ -347,14 +347,14 @@
update_icon()
qdel(repairing)
repairing = null
return
return TRUE
if(repairing && I.iscrowbar())
to_chat(user, "<span class='notice'>You remove \the [repairing].</span>")
playsound(src.loc, I.usesound, 100, 1)
repairing.forceMove(user.loc)
repairing = null
return
return TRUE
//psa to whoever coded this, there are plenty of objects that need to call attack() on doors without bludgeoning them.
if(src.density && istype(I, /obj/item) && user.a_intent == I_HURT && !istype(I, /obj/item/card))
@@ -368,22 +368,19 @@
user.visible_message("<span class='danger'>\The [user] forcefully strikes \the [src] with \the [W]!</span>")
playsound(src.loc, hitsound, W.get_clamped_volume(), 1)
take_damage(W.force)
return
return TRUE
if(src.operating > 0 || isrobot(user)) return //borgs can't attack doors open because it conflicts with their AI-like interaction with them.
if(src.operating) return
if(src.operating > 0 || isrobot(user)) return TRUE //borgs can't attack doors open because it conflicts with their AI-like interaction with them.
if(src.allowed(user) && operable())
if(src.density)
open()
else
close()
return
return TRUE
if(src.density)
do_animate("deny")
return
/obj/machinery/door/emag_act(var/remaining_charges)
if(density && operable())
+11 -13
View File
@@ -262,7 +262,7 @@
if(!istype(C, /obj/item/forensics))
add_fingerprint(user)
if(operating)
return // Already doing something.
return TRUE // Already doing something.
if(C.iswelder() && !repairing)
var/obj/item/weldingtool/WT = C
if(WT.isOn())
@@ -273,22 +273,20 @@
)
playsound(src, 'sound/items/welder.ogg', 50, 1)
if (!do_after(user, 2/C.toolspeed SECONDS, act_target = src, extra_checks = CALLBACK(src, .proc/is_open, src.density)))
return
return TRUE
if(!WT.remove_fuel(0,user))
to_chat(user, SPAN_NOTICE("You need more welding fuel to complete this task."))
return
return TRUE
playsound(src, 'sound/items/welder_pry.ogg', 50, 1)
blocked = !blocked
update_icon()
return
else
return
return TRUE
if(density && C.isscrewdriver())
hatch_open = !hatch_open
user.visible_message("<span class='danger'>[user] has [hatch_open ? "opened" : "closed"] \the [src] maintenance panel.</span>",
"You have [hatch_open ? "opened" : "closed"] the [src] maintenance panel.")
update_icon()
return
return TRUE
if(blocked && C.iscrowbar() && !repairing)
if(!hatch_open)
@@ -313,26 +311,26 @@
FA.wired = 1
FA.update_icon()
qdel(src)
return
return TRUE
if(blocked)
to_chat(user, "<span class='danger'>\The [src] is welded shut!</span>")
return
return TRUE
if(C.iscrowbar() || istype(C,/obj/item/material/twohanded/fireaxe) || (istype(C, /obj/item/melee/hammer)))
if(operating)
return
return TRUE
if(blocked && C.iscrowbar())
user.visible_message("<span class='danger'>\The [user] pries at \the [src] with \a [C], but \the [src] is welded in place!</span>",\
"You try to pry \the [src] [density ? "open" : "closed"], but it is welded in place!",\
"You hear someone struggle and metal straining.")
return
return TRUE
if(istype(C,/obj/item/material/twohanded/fireaxe))
var/obj/item/material/twohanded/fireaxe/F = C
if(!F.wielded)
return
return TRUE
user.visible_message("<span class='danger'>\The [user] starts to force \the [src] [density ? "open" : "closed"] with \a [C]!</span>",\
"You start forcing \the [src] [density ? "open" : "closed"] with \the [C]!",\
@@ -351,7 +349,7 @@
open(1, user)
else
close()
return
return TRUE
return ..()
@@ -20,13 +20,13 @@ obj/structure/firedoor_assembly/attackby(var/obj/item/C as obj, mob/user as mob)
var/obj/item/stack/cable_coil/cable = C
if (cable.get_amount() < 1)
to_chat(user, "<span class='warning'>You need one length of coil to wire \the [src].</span>")
return
return TRUE
user.visible_message("[user] wires \the [src].", "You start to wire \the [src].")
if(do_after(user, 40) && !wired && anchored)
if (cable.use(1))
wired = 1
to_chat(user, "<span class='notice'>You wire \the [src].</span>")
return TRUE
else if(C.iswirecutter() && wired )
playsound(src.loc, 'sound/items/wirecutter.ogg', 100, 1)
user.visible_message("[user] cuts the wires from \the [src].", "You start to cut the wires from \the [src].")
@@ -36,7 +36,7 @@ obj/structure/firedoor_assembly/attackby(var/obj/item/C as obj, mob/user as mob)
to_chat(user, "<span class='notice'>You cut the wires!</span>")
new/obj/item/stack/cable_coil(src.loc, 1)
wired = 0
return TRUE
else if(istype(C, /obj/item/airalarm_electronics) && wired)
if(anchored)
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
@@ -47,12 +47,14 @@ obj/structure/firedoor_assembly/attackby(var/obj/item/C as obj, mob/user as mob)
qdel(src)
else
to_chat(user, "<span class='warning'>You must secure \the [src] first!</span>")
return TRUE
else if(C.iswrench())
anchored = !anchored
playsound(src.loc, C.usesound, 50, 1)
user.visible_message("<span class='warning'>[user] has [anchored ? "" : "un" ]secured \the [src]!</span>",
"You have [anchored ? "" : "un" ]secured \the [src]!")
update_icon()
return TRUE
else if(!anchored && C.iswelder())
var/obj/item/weldingtool/WT = C
if(WT.remove_fuel(0, user))
@@ -66,5 +68,6 @@ obj/structure/firedoor_assembly/attackby(var/obj/item/C as obj, mob/user as mob)
qdel(src)
else
to_chat(user, "<span class='notice'>You need more welding fuel.</span>")
return TRUE
else
..(C, user)
return ..(C, user)
+3 -4
View File
@@ -10,10 +10,9 @@
return
/obj/machinery/door/unpowered/attackby(obj/item/I as obj, mob/user as mob)
if(istype(I, /obj/item/melee/energy/blade)) return
if(src.locked) return
..()
return
if(istype(I, /obj/item/melee/energy/blade)) return TRUE
if(src.locked) return TRUE
return ..()
/obj/machinery/door/unpowered/emag_act()
return -1
+7 -6
View File
@@ -163,7 +163,7 @@
//If it's in the process of opening/closing, ignore the click
if (operating)
return
return TRUE
//Emags and ninja swords? You may pass.
if (istype(I, /obj/item/melee/energy/blade))
@@ -172,7 +172,7 @@
playsound(src.loc, /decl/sound_category/spark_sound, 50, 1)
playsound(src.loc, 'sound/weapons/blade.ogg', 50, 1)
visible_message("<span class='warning'>The glass door was sliced open by [user]!</span>")
return 1
return TRUE
//If it's emagged, crowbar can pry electronics out.
if (emagged == 1 && I.iscrowbar())
@@ -186,7 +186,7 @@
var/obj/item/stack/material/glass/reinforced/rglass = new /obj/item/stack/material/glass/reinforced(loc)
rglass.amount = 5
qdel(src)
return
return TRUE
if(!isliving(I))
if(I.iscrowbar() && user.a_intent == I_HELP)
@@ -198,7 +198,7 @@
close(1)
else
to_chat(user, SPAN_NOTICE("The windoor's motors resist your efforts to force it."))
return
return TRUE
//If it's a weapon, smash windoor. Unless it's an id card, agent card, ect.. then ignore it (Cards really shouldnt damage a door anyway)
if(src.density && istype(I, /obj/item) && !istype(I, /obj/item/card))
@@ -208,7 +208,7 @@
visible_message("<span class='danger'>[src] was hit by [I].</span>")
if(I.damtype == BRUTE || I.damtype == BURN)
take_damage(aforce)
return
return TRUE
if(!istype(I, /obj/item/forensics))
src.add_fingerprint(user)
@@ -218,12 +218,13 @@
user.visible_message("\The [user] begins to manually [density ? "push" : "pull"] \the [src] [density ? "open" : "closed"]!",
"You begin to manually [density ? "push" : "pull"] \the [src] [density ? "open" : "closed"]!", "You hear the sound of a glass door [density ? "opening" : "closing"].")
if(!do_after(user, 1 SECOND, TRUE, src))
return
return TRUE
visible_message("\The [user] [density ? "pulls" : "pushes"] \the [src] [density ? "closed" : "open"].")
if (src.density)
open()
else
close()
return TRUE
/obj/machinery/door/window/brigdoor
name = "secure door"
+9 -7
View File
@@ -90,14 +90,14 @@
if(!istype(W, /obj/item/forensics))
src.add_fingerprint(user)
else
return
return TRUE
if (W.isscrewdriver() && buildstage == 2)
if(!wiresexposed)
set_light(0)
wiresexposed = !wiresexposed
update_icon()
return
return TRUE
if(wiresexposed)
set_light(0)
@@ -109,22 +109,23 @@
user.visible_message("<span class='notice'>\The [user] has reconnected [src]'s detecting unit!</span>", "<span class='notice'>You have reconnected [src]'s detecting unit.</span>")
else
user.visible_message("<span class='notice'>\The [user] has disconnected [src]'s detecting unit!</span>", "<span class='notice'>You have disconnected [src]'s detecting unit.</span>")
return TRUE
else if (W.iswirecutter())
user.visible_message("<span class='notice'>\The [user] has cut the wires inside \the [src]!</span>", "<span class='notice'>You have cut the wires inside \the [src].</span>")
new/obj/item/stack/cable_coil(get_turf(src), 5)
playsound(src.loc, 'sound/items/wirecutter.ogg', 50, 1)
buildstage = 1
update_icon()
return TRUE
if(1)
if(W.iscoil())
var/obj/item/stack/cable_coil/C = W
if (C.use(5))
to_chat(user, "<span class='notice'>You wire \the [src].</span>")
buildstage = 2
return
else
to_chat(user, "<span class='warning'>You need 5 pieces of cable to wire \the [src].</span>")
return
return TRUE
else if(W.iscrowbar())
to_chat(user, "You pry out the circuit!")
playsound(src.loc, W.usesound, 50, 1)
@@ -133,22 +134,23 @@
circuit.forceMove(user.loc)
buildstage = 0
update_icon()
return TRUE
if(0)
if(istype(W, /obj/item/firealarm_electronics))
to_chat(user, "You insert the circuit!")
qdel(W)
buildstage = 1
update_icon()
return TRUE
else if(W.iswrench())
to_chat(user, "You remove the fire alarm assembly from the wall!")
new /obj/item/frame/fire_alarm(get_turf(user))
playsound(src.loc, W.usesound, 50, 1)
qdel(src)
return
return TRUE
return TRUE
src.alarm()
return
/obj/machinery/firealarm/machinery_process()//Note: this processing was mostly phased out due to other code, and only runs when needed
var/area/A = get_area(src)
+2
View File
@@ -57,6 +57,7 @@
user.visible_message("<span class='warning'>[user] has disconnected the [src]'s flashbulb!</span>", "<span class='warning'>You disconnect the [src]'s flashbulb!</span>")
if (!src.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>")
return TRUE
//Let the AI trigger them directly.
/obj/machinery/flasher/attack_ai(mob/user)
@@ -131,6 +132,7 @@
else if (src.anchored)
user.show_message(text("<span class='warning'>[src] is now secured.</span>"))
add_overlay("[base_state]-s")
return TRUE
/obj/machinery/button/flasher
name = "flasher button"
+4 -1
View File
@@ -114,6 +114,7 @@
to_chat(user, SPAN_NOTICE(msg))
else
to_chat(user, SPAN_WARNING("\The [src]'s battery panel is open and cannot be screwed down!"))
return TRUE
if(W.iscrowbar())
if(unlocked)
open = !open
@@ -121,6 +122,7 @@
to_chat(user, SPAN_NOTICE(msg))
else
to_chat(user, SPAN_WARNING("\The [src]'s battery panel is still screwed shut!"))
return TRUE
if(istype(W, /obj/item/cell))
if(open)
if(cell)
@@ -130,4 +132,5 @@
user.drop_from_inventory(W, src)
cell = W
to_chat(user, SPAN_NOTICE("You insert the power cell."))
update_icon()
return TRUE
update_icon()
+9 -7
View File
@@ -29,37 +29,39 @@ var/list/floor_light_cache = list()
anchored = !anchored
visible_message("<span class='notice'>\The [user] has [anchored ? "attached" : "detached"] \the [src].</span>")
playsound(src.loc, 'sound/items/screwdriver.ogg', 100, 1)
return TRUE
else if(W.iswelder() && (damaged || (stat & BROKEN)))
var/obj/item/weldingtool/WT = W
if(!WT.remove_fuel(0, user))
to_chat(user, "<span class='warning'>\The [src] must be on to complete this task.</span>")
return
return TRUE
playsound(src.loc, 'sound/items/welder.ogg', 50, 1)
if(!do_after(user, 20/W.toolspeed))
return
return TRUE
if(!src || !WT.isOn())
return
return TRUE
visible_message("<span class='notice'>\The [user] has repaired \the [src].</span>")
update_icon()
stat &= ~BROKEN
damaged = null
update_brightness()
return TRUE
else if(W.force && user.a_intent == "hurt")
attack_hand(user)
return attack_hand(user)
else if(W.iscrowbar())
if(anchored)
to_chat(user, "<span class='warning'>\The [src] must be unfastened from the [loc] first!</span>")
return
return TRUE
else
to_chat(user, "<span class='notice'>You lever off the [name].</span>")
playsound(src.loc, 'sound/items/crowbar_tile.ogg', 100, TRUE)
if(stat & BROKEN)
qdel(src)
return
return TRUE
else
new /obj/item/stack/tile/light(user.loc)
qdel(src)
return
return TRUE
/obj/machinery/floor_light/attack_hand(var/mob/user)
+5 -5
View File
@@ -39,13 +39,13 @@
mode[m] = !mode[m]
var/O = mode[m]
user.visible_message("<b>[user]</b> has set \the [src] [m] mode [!O ? "off" : "on"].", SPAN_NOTICE("You set \the [src] [m] mode [!O ? "off":"on"]."))
return
return TRUE
if(istype(I, /obj/item/stack/tile))
to_chat(user, SPAN_NOTICE("You successfully load \the [I] into \the [src]."))
user.drop_from_inventory(I, src)
TakeTile(I)
return
return TRUE
if(I.iscrowbar())
if(!length(contents))
@@ -56,11 +56,11 @@
to_chat(user, SPAN_NOTICE("You remove \the [E] from \the [src]."))
user.put_in_hands(E)
T = null
return
return TRUE
if(I.isscrewdriver())
T = input(user, "Choose which set of tiles you want \the [src] to lay.", "Tiles") as null|anything in contents
return
return TRUE
/obj/machinery/floorlayer/examine(mob/user)
..()
@@ -117,4 +117,4 @@
/obj/machinery/floorlayer/proc/CollectTiles(var/turf/w_turf)
for(var/obj/item/stack/tile/tile in w_turf)
TakeTile(tile)
TakeTile(tile)
+4 -3
View File
@@ -64,13 +64,13 @@
var/obj/item/spacecash/C = W
if(!on)
to_chat(user, SPAN_WARNING("\The [src] has no power!"))
return
return TRUE
if(amountleft <= 0)
to_chat(user, SPAN_WARNING("There's no more [typeofcandy] left!"))
return
return TRUE
if(C.worth < gumprice)
to_chat(user, SPAN_WARNING("You don't think this is enough to buy what you want from this."))
return
return TRUE
else
visible_message(SPAN_INFO("\The [user] inserts a bill into \the [src]."))
var/changeleftover = C.worth - gumprice
@@ -87,6 +87,7 @@
smashgumball()
else
visible_message(SPAN_WARNING("\The [user] bash's \the [src] with \the [W]."))
return TRUE
+1
View File
@@ -109,6 +109,7 @@
else if(!disable)
user.visible_message("<span class='warning'>[user] has reconnected the [src]!</span>", "<span class='warning'>You fix the connection to the [src].</span>")
update_icon()
return TRUE
/obj/machinery/sparker/attack_ai(mob/user)
if(!ai_can_interact(user))
+15 -15
View File
@@ -433,61 +433,61 @@
/obj/machinery/iv_drip/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W, /obj/item/reagent_containers/blood/ripped))
to_chat(user, "You can't use a ripped bloodpack.")
return
return TRUE
if(istype(W, /obj/item/reagent_containers))
if(beaker)
to_chat(user, "There is already a reagent container loaded!")
return
return TRUE
user.drop_from_inventory(W, src)
beaker = W
user.visible_message(SPAN_NOTICE("[user] attaches \the [W] to \the [src]."), SPAN_NOTICE("You attach \the [W] to \the [src]."))
update_icon()
return
return TRUE
if(istype(W, /obj/item/clothing/mask/breath))
if(is_type_in_list(W, mask_blacklist))
to_chat(user, "\The [W] is incompatible with \the [src].")
return
return TRUE
if(breath_mask)
to_chat(user, "There is already a mask installed.")
return
return TRUE
user.drop_from_inventory(W, src)
breath_mask = W
user.visible_message(SPAN_NOTICE("[user] places \the [W] in \the [src]."), SPAN_NOTICE("You place \the [W] in \the [src]."))
update_icon()
return
return TRUE
if(istype(W, /obj/item/tank))
if(is_type_in_list(W, tank_blacklist))
to_chat(user, "\The [W] is incompatible with \the [src].")
return
return TRUE
if(tank)
to_chat(user, "There is already a tank installed!")
return
return TRUE
if(istype(W, /obj/item/tank/phoron))
if(tipped)
to_chat(user, "You're not sure how to place \the [W] in the fallen [src].")
return
return TRUE
user.drop_from_inventory(W, src)
tank = W
user.visible_message(SPAN_NOTICE("[user] places \the [W] in \the [src]."), SPAN_NOTICE("You place \the [W] in \the [src]."))
update_icon()
return
return TRUE
if(W.iswrench())
if(!tank)
to_chat(user, "There isn't a tank installed for you to secure!")
return
return TRUE
if(tank_type == "phoron")
to_chat(user, "You can't properly secure this type of tank to \the [src]!")
return
return TRUE
user.visible_message(
SPAN_NOTICE("[user] [is_loose ? "tightens" : "loosens"] the nuts on [src]."),
SPAN_NOTICE("You [is_loose ? "tighten" : "loosen"] the nuts on [src], [is_loose ? "securing \the [tank]" : "allowing \the [tank] to be removed"]."))
playsound(src.loc, "sound/items/wrench.ogg", 50, 1)
is_loose = !is_loose
return
return TRUE
if(default_deconstruction_screwdriver(user, W))
return
return TRUE
if(default_part_replacement(user, W))
return
return TRUE
return ..()
/obj/machinery/iv_drip/attack_ai(mob/user as mob)
+2 -2
View File
@@ -178,7 +178,7 @@ datum/track/New(var/title_name, var/audio)
playsound(src.loc, W.usesound, 50, 1)
power_change()
update_icon()
return
return TRUE
return ..()
/obj/machinery/media/jukebox/emag_act(var/remaining_charges, var/mob/user)
@@ -235,4 +235,4 @@ datum/track/New(var/title_name, var/audio)
cut_overlays()
icon_state = state_base
if(playing)
add_overlay("[state_base]-running")
add_overlay("[state_base]-running")
+3 -3
View File
@@ -296,18 +296,18 @@ Class Procs:
if(issignaler(W))
if(signaler)
to_chat(user, SPAN_WARNING("\The [src] already has a signaler attached."))
return
return TRUE
var/obj/item/device/assembly/signaler/S = W
user.drop_from_inventory(W, src)
signaler = S
S.machine = src
user.visible_message("<b>[user]</b> attaches \the [S] to \the [src].", SPAN_NOTICE("You attach \the [S] to \the [src]."), range = 3)
log_and_message_admins("has attached a signaler to \the [src].", user, get_turf(src))
return
return TRUE
else if(W.iswirecutter() && signaler)
user.visible_message("<b>[user]</b> removes \the [signaler] from \the [src].", SPAN_NOTICE("You remove \the [signaler] from \the [src]."), range = 3)
user.put_in_hands(detach_signaler())
return
return TRUE
return ..()
+2 -1
View File
@@ -68,6 +68,7 @@
"You unsecure the external reinforcing bolts from the floor.", \
"You hear a ratchet")
src.anchored = 0
return TRUE
/obj/item/mass_driver_diy
name = "Mass Driver Kit"
@@ -156,4 +157,4 @@
icon = 'icons/obj/stationobjs.dmi'
icon_state = "mass_driver"
anchored = 0
use_power = 0
use_power = 0
+6 -5
View File
@@ -152,13 +152,13 @@
/obj/machinery/mecha_part_fabricator/attackby(var/obj/item/I, var/mob/user)
if(busy)
to_chat(user, SPAN_NOTICE("\The [src] is busy. Please wait for completion of previous operation."))
return 1
return TRUE
if(default_deconstruction_screwdriver(user, I))
return
return TRUE
if(default_deconstruction_crowbar(user, I))
return
return TRUE
if(default_part_replacement(user, I))
return
return TRUE
if(!istype(I, /obj/item/stack/material))
return ..()
@@ -168,7 +168,7 @@
return ..()
if(!(M.material.name in list(MATERIAL_STEEL, MATERIAL_GLASS, MATERIAL_GOLD, MATERIAL_SILVER, MATERIAL_DIAMOND, MATERIAL_PHORON, MATERIAL_URANIUM)))
to_chat(user, SPAN_WARNING("\The [src] cannot hold [M.material.name]."))
return
return TRUE
var/sname = "[M.name]"
if(materials[M.material.name] + M.perunit <= res_max_amount)
@@ -186,6 +186,7 @@
update_busy()
else
to_chat(user, SPAN_NOTICE("\The [src] cannot hold more [sname]."))
return TRUE
/obj/machinery/mecha_part_fabricator/MouseDrop_T(mob/living/carbon/human/target as mob, mob/user as mob)
if (!istype(target) || target.buckled_to || get_dist(user, src) > 1 || get_dist(user, target) > 1 || user.stat || istype(user, /mob/living/silicon/ai))
+2 -1
View File
@@ -112,6 +112,7 @@ var/global/list/navbeacons // no I don't like putting this in, but it will do
user.visible_message("[user] [open ? "opens" : "closes"] the beacon's cover.", "You [open ? "open" : "close"] the beacon's cover.")
update_icon()
return TRUE
else if (I.GetID())
if(open)
@@ -123,7 +124,7 @@ var/global/list/navbeacons // no I don't like putting this in, but it will do
updateDialog()
else
to_chat(user, "You must open the cover first!")
return
return TRUE
/obj/machinery/navbeacon/attack_ai(var/mob/user)
if(!ai_can_interact(user))
+1 -1
View File
@@ -973,7 +973,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
src.scribble_page = src.curr_page
src.scribble = s
src.attack_self(user)
return
return TRUE
/obj/item/newspaper/proc/rolled(mob/user)
if(ishuman(user) && Adjacent(user) && !user.incapacitated())
+16 -18
View File
@@ -66,7 +66,7 @@ var/bomb_set
to_chat(user, "You screw the control panel of \the [src] back on.")
playsound(src, O.usesound, 50, 1)
flick("lock", src)
return
return TRUE
if (panel_open && (O.ismultitool() || O.iswirecutter()))
return attack_hand(user)
@@ -83,69 +83,67 @@ var/bomb_set
if(0)
if(O.iswelder())
var/obj/item/weldingtool/WT = O
if(!WT.isOn()) return
if(!WT.isOn()) return TRUE
if (WT.get_fuel() < 5) // uses up 5 fuel.
to_chat(user, "<span class='warning'>You need more fuel to complete this task.</span>")
return
return TRUE
user.visible_message("[user] starts cutting loose the anchoring bolt covers on [src].", "You start cutting loose the anchoring bolt covers with [O]...")
if(do_after(user,40/O.toolspeed))
if(!src || !user || !WT.remove_fuel(5, user)) return
if(!src || !user || !WT.remove_fuel(5, user)) return TRUE
user.visible_message("[user] cuts through the bolt covers on [src].", "You cut through the bolt cover.")
removal_stage = 1
return
return TRUE
if(1)
if(O.iscrowbar())
user.visible_message("[user] starts forcing open the bolt covers on [src].", "You start forcing open the anchoring bolt covers with [O]...")
if(do_after(user,15/O.toolspeed))
if(!src || !user) return
if(!src || !user) return TRUE
user.visible_message("[user] forces open the bolt covers on [src].", "You force open the bolt covers.")
removal_stage = 2
return
return TRUE
if(2)
if(O.iswelder())
var/obj/item/weldingtool/WT = O
if(!WT.isOn()) return
if(!WT.isOn()) return TRUE
if (WT.get_fuel() < 5) // uses up 5 fuel.
to_chat(user, "<span class='warning'>You need more fuel to complete this task.</span>")
return
return TRUE
user.visible_message("[user] starts cutting apart the anchoring system sealant on [src].", "You start cutting apart the anchoring system's sealant with [O]...")
if(do_after(user,40/O.toolspeed))
if(!src || !user || !WT.remove_fuel(5, user)) return
if(!src || !user || !WT.remove_fuel(5, user)) return TRUE
user.visible_message("[user] cuts apart the anchoring system sealant on [src].", "You cut apart the anchoring system's sealant.")
removal_stage = 3
return
return TRUE
if(3)
if(O.iswrench())
user.visible_message("[user] begins unwrenching the anchoring bolts on [src].", "You begin unwrenching the anchoring bolts...")
if(do_after(user,50/O.toolspeed))
if(!src || !user) return
if(!src || !user) return TRUE
user.visible_message("[user] unwrenches the anchoring bolts on [src].", "You unwrench the anchoring bolts.")
removal_stage = 4
return
return TRUE
if(4)
if(O.iscrowbar())
user.visible_message("[user] begins lifting [src] off of the anchors.", "You begin lifting the device off the anchors...")
if(do_after(user,80/O.toolspeed))
if(!src || !user) return
if(!src || !user) return TRUE
user.visible_message("[user] crowbars [src] off of the anchors. It can now be moved.", "You jam the crowbar under the nuclear device and lift it off its anchors. You can now move it!")
anchored = 0
removal_stage = 5
return
..()
return TRUE
return ..()
/obj/machinery/nuclearbomb/attack_ghost(mob/user as mob)
attack_hand(user)
+28 -28
View File
@@ -465,7 +465,7 @@ Buildable meters
pipe_type = PIPE_SUPPLY_STRAIGHT
else
to_chat(user, "<span class='warning'>You can not change this pipe!</span>")
return
return TRUE
else if(pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_SIMPLE_BENT, PIPE_SCRUBBERS_STRAIGHT, PIPE_SCRUBBERS_BENT, PIPE_SUPPLY_BENT, PIPE_SUPPLY_STRAIGHT))
if(pipe_type in list(PIPE_SIMPLE_BENT, PIPE_SIMPLE_STRAIGHT))
@@ -484,9 +484,10 @@ Buildable meters
else
pipe_type = PIPE_SIMPLE_STRAIGHT
update()
return TRUE
if (!isturf(src.loc))
return 1
return TRUE
if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_SUPPLY_STRAIGHT, PIPE_SCRUBBERS_STRAIGHT, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE))
if(dir==2)
set_dir(1)
@@ -499,7 +500,7 @@ Buildable meters
for(var/obj/machinery/atmospherics/M in src.loc)
if((M.initialize_directions & pipe_dir) && M.check_connect_types_construction(M,src)) // matches at least one direction on either type of pipe & same connection type
to_chat(user, "<span class='warning'>There is already a pipe of the same type at this location.</span>")
return 1
return TRUE
// no conflicts found
var/pipefailtext = "<span class='warning'>There's nothing to connect this pipe section to!</span>" //(with how the pipe code works, at least one end needs to be connected to something, otherwise the game deletes the segment)"
@@ -516,7 +517,7 @@ Buildable meters
P.atmos_init()
if (QDELETED(P))
to_chat(usr, pipefailtext)
return 1
return TRUE
P.build_network()
if (P.node1)
P.node1.atmos_init()
@@ -535,7 +536,7 @@ Buildable meters
P.atmos_init()
if (QDELETED(P))
to_chat(usr, pipefailtext)
return 1
return TRUE
P.build_network()
if (P.node1)
P.node1.atmos_init()
@@ -554,7 +555,7 @@ Buildable meters
P.atmos_init()
if (QDELETED(P))
to_chat(usr, pipefailtext)
return 1
return TRUE
P.build_network()
if (P.node1)
P.node1.atmos_init()
@@ -573,7 +574,7 @@ Buildable meters
P.atmos_init()
if (QDELETED(P))
to_chat(usr, pipefailtext)
return 1
return TRUE
P.build_network()
if (P.node1)
P.node1.atmos_init()
@@ -590,7 +591,7 @@ Buildable meters
P.atmos_init()
if (QDELETED(P))
to_chat(usr, pipefailtext)
return 1
return TRUE
P.build_network()
if (P.node1)
P.node1.atmos_init()
@@ -625,7 +626,7 @@ Buildable meters
M.atmos_init()
if (QDELETED(M))
to_chat(usr, pipefailtext)
return 1
return TRUE
M.build_network()
if (M.node1)
M.node1.atmos_init()
@@ -648,7 +649,7 @@ Buildable meters
M.atmos_init()
if (!M)
to_chat(usr, "There's nothing to connect this manifold to! (with how the pipe code works, at least one end needs to be connected to something, otherwise the game deletes the segment)")
return 1
return TRUE
M.build_network()
if (M.node1)
M.node1.atmos_init()
@@ -671,7 +672,7 @@ Buildable meters
M.atmos_init()
if (!M)
to_chat(usr, "There's nothing to connect this manifold to! (with how the pipe code works, at least one end needs to be connected to something, otherwise the game deletes the segment)")
return 1
return TRUE
M.build_network()
if (M.node1)
M.node1.atmos_init()
@@ -694,7 +695,7 @@ Buildable meters
M.atmos_init()
if (QDELETED(M))
to_chat(usr, pipefailtext)
return 1
return TRUE
M.build_network()
if (M.node1)
M.node1.atmos_init()
@@ -721,7 +722,7 @@ Buildable meters
M.atmos_init()
if (!M)
to_chat(usr, "There's nothing to connect this manifold to! (with how the pipe code works, at least one end needs to be connected to something, otherwise the game deletes the segment)")
return 1
return TRUE
M.build_network()
if (M.node1)
M.node1.atmos_init()
@@ -748,7 +749,7 @@ Buildable meters
M.atmos_init()
if (!M)
to_chat(usr, "There's nothing to connect this manifold to! (with how the pipe code works, at least one end needs to be connected to something, otherwise the game deletes the segment)")
return 1
return TRUE
M.build_network()
if (M.node1)
M.node1.atmos_init()
@@ -771,7 +772,7 @@ Buildable meters
P.atmos_init()
if (QDELETED(P))
to_chat(usr, pipefailtext) //"There's nothing to connect this pipe to! (with how the pipe code works, at least one end needs to be connected to something, otherwise the game deletes the segment)")
return 1
return TRUE
P.build_network()
if (P.node1)
P.node1.atmos_init()
@@ -952,7 +953,7 @@ Buildable meters
P.atmos_init()
if (QDELETED(P))
to_chat(usr, pipefailtext)
return 1
return TRUE
P.build_network()
if (P.node1)
P.node1.atmos_init()
@@ -1230,7 +1231,7 @@ Buildable meters
"You hear ratchet.")
qdel(src) // remove the pipe item
return
return TRUE
//TODO: DEFERRED
// ensure that setterm() is called for a newly connected pipeline
@@ -1246,17 +1247,16 @@ Buildable meters
w_class = ITEMSIZE_LARGE
/obj/item/pipe_meter/attackby(var/obj/item/W as obj, var/mob/user as mob)
..()
if (!W.iswrench())
return ..()
if(!locate(/obj/machinery/atmospherics/pipe, src.loc))
to_chat(user, "<span class='warning'>You need to fasten it to a pipe</span>")
return 1
new/obj/machinery/meter( src.loc )
playsound(src.loc, W.usesound, 50, 1)
to_chat(user, "<span class='notice'>You have fastened the meter to the pipe</span>")
qdel(src)
if (W.iswrench())
if(!locate(/obj/machinery/atmospherics/pipe, src.loc))
to_chat(user, "<span class='warning'>You need to fasten it to a pipe</span>")
return 1
new/obj/machinery/meter( src.loc )
playsound(src.loc, W.usesound, 50, 1)
to_chat(user, "<span class='notice'>You have fastened the meter to the pipe</span>")
qdel(src)
return TRUE
return ..()
//not sure why these are necessary
#undef PIPE_SIMPLE_STRAIGHT
#undef PIPE_SIMPLE_BENT
+3 -2
View File
@@ -107,7 +107,7 @@
to_chat(usr, SPAN_NOTICE("You put \the [I] back into \the [src]."))
user.remove_from_mob(I) //Catches robot gripper duplication
qdel(I)
return
return TRUE
else if(I.iswrench())
playsound(get_turf(user), I.usesound, 50, 1)
if(anchored)
@@ -125,6 +125,7 @@
anchored = TRUE
stat &= ~MAINT
power_change()
return TRUE
else
return ..()
@@ -237,4 +238,4 @@
anchored = FALSE
/obj/machinery/pipedispenser/disposal/orderable
anchored = FALSE
anchored = FALSE
+34 -38
View File
@@ -333,21 +333,22 @@
else
to_chat(user, "<span class='notice'>You remove the turret but did not manage to salvage anything.</span>")
qdel(src) // qdel
return TRUE
else if((I.iswrench()))
if (immobile)
to_chat(user, "<span class='notice'>[src] is firmly attached to the ground with some form of epoxy.</span>")
return
return TRUE
if(enabled || raised)
to_chat(user, "<span class='warning'>You cannot unsecure an active turret!</span>")
return
return TRUE
if(wrenching)
to_chat(user, "<span class='warning'>Someone is already [anchored ? "un" : ""]securing the turret!</span>")
return
return TRUE
if(!anchored && isinspace())
to_chat(user, "<span class='warning'>Cannot secure turrets in space!</span>")
return
return TRUE
user.visible_message( \
"<span class='warning'>[user] begins [anchored ? "un" : ""]securing the turret.</span>", \
@@ -368,6 +369,7 @@
to_chat(user, "<span class='notice'>You unsecure the exterior bolts on the turret.</span>")
update_icon()
wrenching = 0
return TRUE
else if(I.GetID())
//Behavior lock/unlock mangement
@@ -377,29 +379,27 @@
updateUsrDialog()
else
to_chat(user, "<span class='notice'>Access denied.</span>")
return TRUE
else if(I.iswelder())
var/obj/item/weldingtool/WT = I
if (!WT.welding)
to_chat(user, "<span class='danger'>\The [WT] must be turned on!</span>")
return
else if (health == maxhealth)
to_chat(user, "<span class='notice'>\The [src] is fully repaired.</span>")
return
else if (WT.remove_fuel(3, user))
to_chat(user, "<span class='notice'>Now welding \the [src].</span>")
if(do_after(user, 5))
if(QDELETED(src) || !WT.isOn())
return
return TRUE
playsound(src.loc, 'sound/items/welder_pry.ogg', 50, 1)
health += maxhealth / 3
health = min(maxhealth, health)
return
else
to_chat(user, "<span class='notice'>You fail to complete the welding.</span>")
else
to_chat(user, "<span class='warning'>You need more welding fuel to complete this task.</span>")
return 1
return TRUE
else
//if the turret was attacked with the intention of harming it:
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
@@ -408,7 +408,7 @@
if(!attacked && !emagged)
attacked = 1
addtimer(CALLBACK(src, .proc/reset_attacked), 1 SECONDS, TIMER_UNIQUE | TIMER_OVERRIDE)
..()
return ..()
/obj/machinery/porta_turret/proc/reset_attacked()
attacked = FALSE
@@ -828,14 +828,14 @@
anchored = 1
build_step = 1
icon_state = "turret_frame_1_[case_sprite_set]"
return
return TRUE
else if(I.iscrowbar() && !anchored)
playsound(loc, I.usesound, 75, 1)
to_chat(user, "<span class='notice'>You dismantle the turret construction.</span>")
new /obj/item/stack/material/steel( loc, 5)
qdel(src)
return
return TRUE
if(1)
if(istype(I, /obj/item/stack/material) && I.get_material_name() == DEFAULT_WALL_MATERIAL)
@@ -846,7 +846,7 @@
icon_state = "turret_frame_2_[case_sprite_set]"
else
to_chat(user, "<span class='warning'>You need two sheets of metal to continue construction.</span>")
return
return TRUE
else if(I.iswrench())
playsound(loc, I.usesound, 75, 1)
@@ -854,7 +854,7 @@
anchored = 0
build_step = 0
icon_state = "turret_frame_0_[case_sprite_set]"
return
return TRUE
if(2)
@@ -863,24 +863,24 @@
to_chat(user, "<span class='notice'>You bolt the metal armor into place.</span>")
build_step = 3
icon_state = "turret_frame_3_[case_sprite_set]"
return
return TRUE
else if(I.iswelder())
var/obj/item/weldingtool/WT = I
if(!WT.isOn())
return
return TRUE
if(WT.get_fuel() < 5) //uses up 5 fuel.
to_chat(user, "<span class='notice'>You need more fuel to complete this task.</span>")
return
return TRUE
playsound(loc, pick('sound/items/welder.ogg', 'sound/items/welder_pry.ogg'), 50, 1)
if(do_after(user, 20/I.toolspeed))
if(!src || !WT.remove_fuel(5, user)) return
if(!src || !WT.remove_fuel(5, user)) return TRUE
build_step = 1
to_chat(user, "You remove the turret's interior metal armor.")
new /obj/item/stack/material/steel( loc, 2)
icon_state = "turret_frame_1_[case_sprite_set]"
return
return TRUE
if(3)
@@ -888,10 +888,10 @@
E = I //typecasts the item to a gun
if(E.can_turret)
if(isrobot(user))
return
return TRUE
if(!user.unEquip(I))
to_chat(user, "<span class='notice'>\the [I] is stuck to your hand, you cannot put it in \the [src]</span>")
return
return TRUE
to_chat(user, "<span class='notice'>You install [I] into the turret.</span>")
user.drop_from_inventory(E,src)
target_type = /obj/machinery/porta_turret
@@ -899,24 +899,24 @@
build_step = 4
icon_state = "turret_frame_4_[case_sprite_set]"
add_overlay("turret_[E.turret_sprite_set]_off")
return
return TRUE
else if(I.iswrench())
playsound(loc, I.usesound, 100, 1)
to_chat(user, "<span class='notice'>You remove the turret's metal armor bolts.</span>")
build_step = 2
icon_state = "turret_frame_2_[case_sprite_set]"
return
return TRUE
if(4)
if(isprox(I))
build_step = 5
if(!user.unEquip(I))
to_chat(user, "<span class='notice'>\the [I] is stuck to your hand, you cannot put it in \the [src]</span>")
return
return TRUE
to_chat(user, "<span class='notice'>You add the prox sensor to the turret.</span>")
qdel(I)
return
return TRUE
//attack_hand() removes the gun
@@ -928,7 +928,7 @@
icon_state = "turret_frame_5a_[case_sprite_set]"
add_overlay("turret_[E.turret_sprite_set]_off")
add_overlay("turret_frame_5b_[case_sprite_set]")
return
return TRUE
//attack_hand() removes the prox sensor
@@ -944,7 +944,7 @@
build_step = 7
else
to_chat(user, "<span class='warning'>You need two sheets of metal to continue construction.</span>")
return
return TRUE
else if(I.isscrewdriver())
playsound(loc, I.usesound, 100, 1)
@@ -953,7 +953,7 @@
cut_overlays()
icon_state = "turret_frame_4_[case_sprite_set]"
add_overlay("turret_[E.turret_sprite_set]_off")
return
return TRUE
if(7)
if(I.iswelder())
@@ -1000,6 +1000,7 @@
Turret.icon_state = "cover_[case_sprite_set]"
START_PROCESSING(SSprocessing, Turret)
qdel(src) // qdel
return TRUE
else if(I.iscrowbar())
playsound(loc, I.usesound, 75, 1)
@@ -1010,19 +1011,14 @@
icon_state = "turret_frame_5a_[case_sprite_set]"
add_overlay("turret_[E.turret_sprite_set]_off")
add_overlay("turret_frame_5c_[case_sprite_set]")
return
return TRUE
if(I.ispen()) //you can rename turrets like bots!
var/t = sanitizeSafe(input(user, "Enter new turret name", name, finish_name) as text, MAX_NAME_LEN)
if(!t)
return
if(!in_range(src, usr) && loc != usr)
return
finish_name = t
return
..()
if(t && in_range(src, usr) && loc != usr)
finish_name = t
return TRUE
return ..()
/obj/machinery/porta_turret_construct/attack_hand(mob/user)
+7 -6
View File
@@ -50,11 +50,11 @@
if(portable && G.iswrench())
if(charging)
to_chat(user, SPAN_WARNING("You can't modify \the [src] while it has something charging inside."))
return
return TRUE
anchored = !anchored
user.visible_message("<b>[user]</b> [anchored ? "attaches" : "detaches"] \the [src].", SPAN_NOTICE("You [anchored ? "attach" : "detach"] \the [src]."))
playsound(loc, G.usesound, 75, 1)
return
return TRUE
if (istype(G, /obj/item/gripper))//Code for allowing cyborgs to use rechargers
var/obj/item/gripper/Gri = G
@@ -64,22 +64,23 @@
update_icon()
else
to_chat(user, "<span class='danger'>Your gripper cannot hold \the [charging].</span>")
return TRUE
if(!G.dropsafety())
return
return TRUE
if(is_type_in_list(G, allowed_devices))
if (G.get_cell() == DEVICE_NO_CELL)
if (G.charge_failure_message)
to_chat(user, "<span class='warning'>\The [G][G.charge_failure_message]</span>")
return
return TRUE
if(charging)
to_chat(user, "<span class='warning'>\A [charging] is already charging here.</span>")
return
return TRUE
// Checks to make sure he's not in space doing it, and that the area got proper power.
if(!powered())
to_chat(user, "<span class='warning'>\The [name] blinks red as you try to insert the item!</span>")
return
return TRUE
user.drop_from_inventory(G,src)
charging = G
+7 -7
View File
@@ -148,21 +148,21 @@
/obj/machinery/recharge_station/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(!occupant)
if(default_deconstruction_screwdriver(user, O))
return
return TRUE
else if(default_deconstruction_crowbar(user, O))
return
return TRUE
else if(default_part_replacement(user, O))
return
return TRUE
if(istype(O, /obj/item/grab))
var/obj/item/grab/grab = O
var/mob/living/L = grab.affecting
if(!L.isSynthetic())
return
return TRUE
move_ipc(grab.affecting)
qdel(O)
..()
return ..()
/obj/machinery/recharge_station/RefreshParts()
..()
@@ -315,7 +315,7 @@
else
to_chat(user, SPAN_DANGER("Cancelled loading [C] into the charger. You and [C] must stay still!"))
return
else if(isipc(C)) // IPCs don't take as long
var/mob/living/carbon/human/machine/R = C
if(!user.Adjacent(R) || !Adjacent(user))
+5 -1
View File
@@ -364,7 +364,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
//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)
if (istype(O, /obj/item/card/id))
if(inoperable(MAINT)) return
if(inoperable(MAINT)) return TRUE
if(screen == RCS_MESSAUTH)
var/obj/item/card/id/T = O
msgVerified = text("<font color='green'><b>Verified by [T.registered_name] ([T.assignment])</b></font>")
@@ -378,12 +378,14 @@ var/list/obj/machinery/requests_console/allConsoles = list()
reset_message()
to_chat(user, "<span class='warning'>You are not authorized to send announcements.</span>")
updateUsrDialog()
return TRUE
else if (istype(O, /obj/item/stamp))
if(inoperable(MAINT)) return
if(screen == RCS_MESSAUTH)
var/obj/item/stamp/T = O
msgStamped = text("<span class='notice'><b>Stamped with the [T.name]</b></span>")
updateUsrDialog()
return TRUE
else if (istype(O, /obj/item/paper_bundle))
var/obj/item/paper_bundle/C = O
if(lid)
@@ -396,6 +398,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
audible_message("<b>The Requests Console</b> beeps, \"Paper added.\"")
else if(screen == RCS_MAINMENU) //Faxing them papers
fax_send(O, user)
return TRUE
else if (istype(O, /obj/item/paper))
if(lid)
if(alert(user, "Do you want to restock \the [src] with \the [O]?", "Paper Restocking", "Yes", "No") == "No")
@@ -408,6 +411,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
audible_message("<b>The Requests Console</b> beeps, \"Paper added.\"")
else if(screen == RCS_MAINMENU) //Faxing them papers
fax_send(O, user)
return TRUE
/obj/machinery/requests_console/proc/can_send()
for(var/obj/machinery/message_server/MS in SSmachinery.processing_machines)
+5 -5
View File
@@ -60,24 +60,24 @@
/obj/machinery/ringer/attackby(obj/item/C as obj, mob/living/user as mob)
if(stat & (BROKEN|NOPOWER) || !istype(user,/mob/living))
return
return TRUE
if (istype(C, /obj/item/modular_computer))
if(!check_access(C))
to_chat(user, "<span class='warning'>Access Denied.</span>")
return
return TRUE
else if (C in rings_pdas)
to_chat(user, "<span class='notice'>You unlink \the [C] from \the [src].</span>")
remove_pda(C)
return
return TRUE
to_chat(user, "<span class='notice'>You link \the [C] to \the [src], it will now ring upon someone using \the [src].</span>")
rings_pdas += C
// WONT FIX: This requires callbacks fuck my dick.
destroyed_event.register(C, src, .proc/remove_pda)
update_icon()
return TRUE
else
..()
return ..()
/obj/machinery/ringer/attack_hand(mob/user as mob)
if(..())

Some files were not shown because too many files have changed in this diff Show More