Merge branch 'tool_behavior-replacing' of https://github.com/SandPoot/Citadel-Station-13 into tool_behavior-replacing

This commit is contained in:
SandPoot
2021-02-18 15:04:22 -03:00
223 changed files with 1458 additions and 737 deletions
@@ -43,14 +43,13 @@
// This exists so Hardened/Silver Stake can't have a welding torch used on them.
/obj/item/stake/basic/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/weldingtool))
if(W.tool_behaviour == TOOL_WELDER)
//if (amWelded)
// to_chat(user, "<span class='warning'>This stake has already been treated with fire.</span>")
// return
//amWelded = TRUE
// Weld it
var/obj/item/weldingtool/WT = W
if(WT.use(0))//remove_fuel(0,user))
if(W.use(0))//remove_fuel(0,user))
user.visible_message("[user.name] scorched the pointy end of [src] with the welding tool.", \
"<span class='notice'>You scorch the pointy end of [src] with the welding tool.</span>", \
"<span class='italics'>You hear welding.</span>")
@@ -164,11 +164,11 @@
if(istype(W, cutting_tool))
to_chat(user, "<span class='notice'>This is a much more complex mechanical structure than you thought. You don't know where to begin cutting [src].</span>")
return
else if(anchored && istype(W, /obj/item/wrench)) // Can't unanchor unless owner.
else if(anchored && W.tool_behaviour == TOOL_WRENCH) // Can't unanchor unless owner.
to_chat(user, "<span class='danger'>The coffin won't come unanchored from the floor.</span>")
return
if(locked && istype(W, /obj/item/crowbar))
if(locked && W.tool_behaviour == TOOL_CROWBAR)
var/pry_time = pryLidTimer * W.toolspeed // Pry speed must be affected by the speed of the tool.
user.visible_message("<span class='notice'>[user] tries to pry the lid off of [src] with [W].</span>", \
"<span class='notice'>You begin prying the lid off of [src] with [W]. This should take about [DisplayTimeText(pry_time)].</span>")
@@ -95,7 +95,7 @@
return ..()
/obj/structure/destructible/clockwork/attackby(obj/item/I, mob/user, params)
if(is_servant_of_ratvar(user) && istype(I, /obj/item/wrench) && unanchored_icon)
if(is_servant_of_ratvar(user) && I.tool_behaviour == TOOL_WRENCH && unanchored_icon)
if(default_unfasten_wrench(user, I, 50) == SUCCESSFUL_UNFASTEN)
update_anchored(user)
return 1
@@ -23,10 +23,10 @@
return
/obj/structure/destructible/clockwork/wall_gear/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/wrench))
if(I.tool_behaviour == TOOL_WRENCH)
default_unfasten_wrench(user, I, 10)
return 1
else if(istype(I, /obj/item/screwdriver))
else if(I.tool_behaviour == TOOL_SCREWDRIVER)
if(anchored)
to_chat(user, "<span class='warning'>[src] needs to be unsecured to disassemble it!</span>")
else
@@ -104,7 +104,7 @@
switch(deconstruction_state)
if(NUKESTATE_INTACT)
if(istype(I, /obj/item/screwdriver/nuke))
if(istype(I, /obj/item/screwdriver/nuke)) //Special case, cannot replace with tool_behavior
to_chat(user, "<span class='notice'>You start removing [src]'s front panel's screws...</span>")
if(I.use_tool(src, user, 60, volume=100))
deconstruction_state = NUKESTATE_UNSCREWED
+1 -1
View File
@@ -43,7 +43,7 @@
to_chat(user, "<span class='notice'>Picking up the swarmer may cause it to activate. You should be careful about this.</span>")
/obj/effect/mob_spawn/swarmer/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/screwdriver) && user.a_intent != INTENT_HARM)
if(W.tool_behaviour == TOOL_SCREWDRIVER && user.a_intent != INTENT_HARM)
user.visible_message("<span class='warning'>[usr.name] deactivates [src].</span>",
"<span class='notice'>After some fiddling, you find a way to disable [src]'s power source.</span>",
"<span class='italics'>You hear clicking.</span>")
@@ -354,9 +354,14 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list(
var/obj/effect/countdown/doomsday/countdown
var/detonation_timer
var/next_announce
var/mob/living/silicon/ai/owner
/obj/machinery/doomsday_device/Initialize()
. = ..()
owner = loc
if(!istype(owner))
stack_trace("Doomsday created outside an AI somehow, shit's fucking broke. Anyway, we're just gonna qdel now. Go make a github issue report.")
qdel(src)
countdown = new(src)
/obj/machinery/doomsday_device/Destroy()
@@ -364,6 +369,9 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list(
STOP_PROCESSING(SSfastprocess, src)
SSshuttle.clearHostileEnvironment(src)
SSmapping.remove_nuke_threat(src)
for(var/mob/living/silicon/robot/borg in owner.connected_robots)
borg.lamp_doom = FALSE
borg.toggle_headlamp(FALSE, TRUE) //forces borg lamp to update
for(var/A in GLOB.ai_list)
var/mob/living/silicon/ai/AI = A
if(AI.doomsday_device == src)
@@ -378,6 +386,9 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list(
START_PROCESSING(SSfastprocess, src)
SSshuttle.registerHostileEnvironment(src)
SSmapping.add_nuke_threat(src) //This causes all blue "circuit" tiles on the map to change to animated red icon state.
for(var/mob/living/silicon/robot/borg in owner.connected_robots)
borg.lamp_doom = TRUE
borg.toggle_headlamp(FALSE, TRUE) //forces borg lamp to update
/obj/machinery/doomsday_device/proc/seconds_remaining()
. = max(0, (round((detonation_timer - world.time) / 10)))
+3 -3
View File
@@ -47,9 +47,9 @@
"smmon_3.gif" = 'icons/program_icons/smmon_3.gif',
"smmon_4.gif" = 'icons/program_icons/smmon_4.gif',
"smmon_5.gif" = 'icons/program_icons/smmon_5.gif',
"smmon_6.gif" = 'icons/program_icons/smmon_6.gif'
// "borg_mon.gif" = 'icons/program_icons/borg_mon.gif',
// "robotact.gif" = 'icons/program_icons/robotact.gif'
"smmon_6.gif" = 'icons/program_icons/smmon_6.gif',
"borg_mon.gif" = 'icons/program_icons/borg_mon.gif',
"robotact.gif" = 'icons/program_icons/robotact.gif'
)
/datum/asset/simple/radar_assets
@@ -762,14 +762,14 @@
/obj/machinery/airalarm/attackby(obj/item/W, mob/user, params)
switch(buildstage)
if(2)
if(istype(W, /obj/item/wirecutters) && panel_open && wires.is_all_cut())
if(W.tool_behaviour == TOOL_WIRECUTTER && panel_open && wires.is_all_cut())
W.play_tool_sound(src)
to_chat(user, "<span class='notice'>You cut the final wires.</span>")
new /obj/item/stack/cable_coil(loc, 5)
buildstage = 1
update_icon()
return
else if(istype(W, /obj/item/screwdriver)) // Opening that Air Alarm up.
else if(W.tool_behaviour == TOOL_SCREWDRIVER) // Opening that Air Alarm up.
W.play_tool_sound(src)
panel_open = !panel_open
to_chat(user, "<span class='notice'>The wires have been [panel_open ? "exposed" : "unexposed"].</span>")
@@ -781,7 +781,7 @@
wires.interact(user)
return
if(1)
if(istype(W, /obj/item/crowbar))
if(W.tool_behaviour == TOOL_CROWBAR)
user.visible_message("[user.name] removes the electronics from [src.name].",\
"<span class='notice'>You start prying out the circuit...</span>")
W.play_tool_sound(src)
@@ -832,7 +832,7 @@
update_icon()
return
if(istype(W, /obj/item/wrench))
if(W.tool_behaviour == TOOL_WRENCH)
to_chat(user, "<span class='notice'>You detach \the [src] from the wall.</span>")
W.play_tool_sound(src)
new /obj/item/wallframe/airalarm( user.loc )
@@ -326,7 +326,7 @@
|| default_deconstruction_crowbar(I))
update_icon()
return
else if(istype(I, /obj/item/screwdriver))
else if(I.tool_behaviour == TOOL_SCREWDRIVER)
to_chat(user, "<span class='notice'>You can't access the maintenance panel while the pod is " \
+ (on ? "active" : (occupant ? "full" : "open")) + ".</span>")
return
@@ -454,8 +454,10 @@
return G.return_temperature()
return ..()
/obj/machinery/atmospherics/components/unary/cryo_cell/default_change_direction_wrench(mob/user, obj/item/wrench/W)
/obj/machinery/atmospherics/components/unary/cryo_cell/default_change_direction_wrench(mob/user, obj/item/W)
. = ..()
if(!W.tool_behaviour == TOOL_WRENCH)
return
if(.)
SetInitDirections()
var/obj/machinery/atmospherics/node = nodes[1]
@@ -115,7 +115,7 @@
to_chat(user, "<span class='notice'>[holding ? "In one smooth motion you pop [holding] out of [src]'s connector and replace it with [T]" : "You insert [T] into [src]"].</span>")
replace_tank(user, FALSE, T)
update_icon()
else if(istype(W, /obj/item/wrench))
else if(W.tool_behaviour == TOOL_WRENCH)
if(!(stat & BROKEN))
if(connected_port)
disconnect()
+1 -1
View File
@@ -311,7 +311,7 @@
to_chat(user, "<span class = 'danger'>Install a new flash in [src]!</span>")
/obj/item/clothing/glasses/sunglasses/stunglasses/attackby(obj/item/W,mob/user)
if (istype(W,/obj/item/screwdriver))
if (W.tool_behaviour == TOOL_SCREWDRIVER)
if (installed)
installed.forceMove(get_turf(src))
to_chat(user, "<span class = 'notice'>You remove [installed] from [src].</span>")
+3 -3
View File
@@ -99,7 +99,7 @@
name = "fingerless insulated gloves"
/obj/item/clothing/gloves/color/yellow/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/wirecutters))
if(I.tool_behaviour == TOOL_WIRECUTTER)
if(can_be_cut && icon_state == initial(icon_state))//only if not dyed
to_chat(user, "<span class='notice'>You snip the fingertips off of [src].</span>")
I.play_tool_sound(src)
@@ -108,7 +108,7 @@
..()
/obj/item/clothing/gloves/color/fyellow/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/wirecutters))
if(I.tool_behaviour == TOOL_WIRECUTTER)
if(can_be_cut && icon_state == initial(icon_state))//only if not dyed
to_chat(user, "<span class='notice'>You snip the fingertips off of [src].</span>")
I.play_tool_sound(src)
@@ -130,7 +130,7 @@
strip_mod = 1.2
/obj/item/clothing/gloves/color/black/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/wirecutters))
if(I.tool_behaviour == TOOL_WIRECUTTER)
if(can_be_cut && icon_state == initial(icon_state))//only if not dyed
to_chat(user, "<span class='notice'>You snip the fingertips off of [src].</span>")
I.play_tool_sound(src)
+1 -1
View File
@@ -313,7 +313,7 @@
A.Grant(user)
return
if(istype(I, /obj/item/screwdriver))
if(I.tool_behaviour == TOOL_SCREWDRIVER)
if(F)
for(var/obj/item/flashlight/seclite/S in src)
to_chat(user, "<span class='notice'>You unscrew the seclite from [src].</span>")
+1 -1
View File
@@ -122,7 +122,7 @@
jetpack = I
to_chat(user, "<span class='notice'>You successfully install the jetpack into [src].</span>")
return
else if(istype(I, /obj/item/screwdriver))
else if(I.tool_behaviour == TOOL_SCREWDRIVER)
if(!jetpack)
to_chat(user, "<span class='warning'>[src] has no jetpack installed.</span>")
return
+4 -4
View File
@@ -267,8 +267,8 @@
var/sending_state = "lpad-beam"
var/cargo_hold_id
/obj/machinery/piratepad/multitool_act(mob/living/user, obj/item/multitool/I)
if (istype(I))
/obj/machinery/piratepad/multitool_act(mob/living/user, obj/item/I)
if(I.tool_behaviour == TOOL_MULTITOOL)
to_chat(user, "<span class='notice'>You register [src] in [I]s buffer.</span>")
I.buffer = src
return TRUE
@@ -291,8 +291,8 @@
..()
return INITIALIZE_HINT_LATELOAD
/obj/machinery/computer/piratepad_control/multitool_act(mob/living/user, obj/item/multitool/I)
if (istype(I) && istype(I.buffer,/obj/machinery/piratepad))
/obj/machinery/computer/piratepad_control/multitool_act(mob/living/user, obj/item/I)
if(I.tool_behaviour == TOOL_MULTITOOL && istype(I.buffer,/obj/machinery/piratepad))
to_chat(user, "<span class='notice'>You link [src] with [I.buffer] in [I] buffer.</span>")
pad = I.buffer
return TRUE
@@ -259,7 +259,9 @@
/obj/machinery/smartfridge/drying_rack/exchange_parts()
/obj/machinery/smartfridge/drying_rack/spawn_frame()
/obj/machinery/smartfridge/drying_rack/default_deconstruction_crowbar(obj/item/crowbar/C, ignore_panel = 1)
/obj/machinery/smartfridge/drying_rack/default_deconstruction_crowbar(obj/item/C, ignore_panel = 1)
if(!C.tool_behaviour == TOOL_CROWBAR)
return
..()
/obj/machinery/smartfridge/drying_rack/ui_data(mob/user)
@@ -155,7 +155,7 @@
to_chat(user, "<span class='warning'>There's no room for any more frames in the apiary!</span>")
return
if(istype(I, /obj/item/wrench))
if(I.tool_behaviour == TOOL_WRENCH)
if(default_unfasten_wrench(user, I, time = 20))
return
@@ -452,7 +452,7 @@
for(var/obj/item/integrated_circuit/input/S in assembly_components)
S.attackby_react(I,user,user.a_intent)
return ..()
else if(istype(I, /obj/item/multitool) || istype(I, /obj/item/integrated_electronics/wirer) || istype(I, /obj/item/integrated_electronics/debugger))
else if(I.tool_behaviour == TOOL_MULTITOOL || istype(I, /obj/item/integrated_electronics/wirer) || istype(I, /obj/item/integrated_electronics/debugger))
if(opened)
interact(user)
return TRUE
@@ -252,7 +252,7 @@ a creative player the means to solve many problems. Circuits are held inside an
var/update = TRUE
var/update_to_assembly = FALSE
var/obj/held_item = usr.get_active_held_item()
var/obj/item/held_item = usr.get_active_held_item()
if(href_list["rename"])
rename_component(usr)
@@ -267,7 +267,7 @@ a creative player the means to solve many problems. Circuits are held inside an
if(href_list["link"])
linked = locate(href_list["link"]) in pin.linked
if(istype(held_item, /obj/item/integrated_electronics) || istype(held_item, /obj/item/multitool))
if(istype(held_item, /obj/item/integrated_electronics) || held_item.tool_behaviour == TOOL_MULTITOOL)
pin.handle_wire(linked, held_item, href_list["act"], usr)
else
to_chat(usr, "<span class='warning'>You can't do a whole lot without the proper tools.</span>")
@@ -105,15 +105,14 @@ D [1]/ ||
push_data()
/datum/integrated_io/proc/handle_wire(datum/integrated_io/linked_pin, obj/item/tool, action, mob/living/user)
if(istype(tool, /obj/item/multitool))
var/obj/item/multitool/multitool = tool
if(tool.tool_behaviour == TOOL_MULTITOOL)
switch(action)
if("wire")
multitool.wire(src, user)
tool.wire(src, user)
return TRUE
if("unwire")
if(linked_pin)
multitool.unwire(src, linked_pin, user)
tool.unwire(src, linked_pin, user)
return TRUE
if("data")
ask_for_pin_data(user)
@@ -12,13 +12,12 @@
icon_state = "wirer-wire"
flags_1 = CONDUCT_1
w_class = WEIGHT_CLASS_SMALL
var/datum/integrated_io/selected_io = null
var/mode = WIRE
/obj/item/integrated_electronics/wirer/update_icon_state()
icon_state = "wirer-[mode]"
/obj/item/integrated_electronics/wirer/proc/wire(var/datum/integrated_io/io, mob/user)
/obj/item/integrated_electronics/wirer/wire(var/datum/integrated_io/io, mob/user)
if(!io.holder.assembly)
to_chat(user, "<span class='warning'>\The [io.holder] needs to be secured inside an assembly first.</span>")
return
+5 -5
View File
@@ -53,12 +53,12 @@
/obj/structure/bookcase/attackby(obj/item/I, mob/user, params)
switch(state)
if(0)
if(istype(I, /obj/item/wrench))
if(I.tool_behaviour == TOOL_WRENCH)
if(I.use_tool(src, user, 20, volume=50))
to_chat(user, "<span class='notice'>You wrench the frame into place.</span>")
anchored = TRUE
state = 1
if(istype(I, /obj/item/crowbar))
if(I.tool_behaviour == TOOL_CROWBAR)
if(I.use_tool(src, user, 20, volume=50))
to_chat(user, "<span class='notice'>You pry the frame apart.</span>")
deconstruct(TRUE)
@@ -71,7 +71,7 @@
to_chat(user, "<span class='notice'>You add a shelf.</span>")
state = 2
icon_state = "book-0"
if(istype(I, /obj/item/wrench))
if(I.tool_behaviour == TOOL_WRENCH)
I.play_tool_sound(src, 100)
to_chat(user, "<span class='notice'>You unwrench the frame.</span>")
anchored = FALSE
@@ -100,7 +100,7 @@
return
else
name = "bookcase ([sanitize(newname)])"
else if(istype(I, /obj/item/crowbar))
else if(I.tool_behaviour == TOOL_CROWBAR)
if(contents.len)
to_chat(user, "<span class='warning'>You need to remove the books first!</span>")
else
@@ -302,7 +302,7 @@
scanner.computer.inventory.Add(src)
to_chat(user, "[I]'s screen flashes: 'Book stored in buffer. Title added to general inventory.'")
else if(istype(I, /obj/item/kitchen/knife) || istype(I, /obj/item/wirecutters))
else if(istype(I, /obj/item/kitchen/knife) || I.tool_behaviour == TOOL_WIRECUTTER)
to_chat(user, "<span class='notice'>You begin to carve out [title]...</span>")
if(do_after(user, 30, target = src))
to_chat(user, "<span class='notice'>You carve out the pages from [title]! You didn't want to read it anyway.</span>")
+1 -1
View File
@@ -190,7 +190,7 @@
/obj/structure/closet/crate/secure/loot/attackby(obj/item/W, mob/user)
if(locked)
if(istype(W, /obj/item/multitool))
if(W.tool_behaviour == TOOL_MULTITOOL)
to_chat(user, "<span class='notice'>DECA-CODE LOCK REPORT:</span>")
if(attempts == 1)
to_chat(user, "<span class='warning'>* Anti-Tamper Bomb will activate on next failed access attempt.</span>")
@@ -65,7 +65,7 @@
. += "<span class='notice'>It has \a [T] attached, which causes [T.effect_desc()].</span>"
/obj/item/kinetic_crusher/attackby(obj/item/I, mob/living/user)
if(istype(I, /obj/item/crowbar))
if(I.tool_behaviour == TOOL_CROWBAR)
if(LAZYLEN(trophies))
to_chat(user, "<span class='notice'>You remove [src]'s trophies.</span>")
I.play_tool_sound(src)
+4 -2
View File
@@ -188,8 +188,10 @@
return ..()
/obj/machinery/mineral/ore_redemption/multitool_act(mob/living/user, obj/item/multitool/I)
if (panel_open)
/obj/machinery/mineral/ore_redemption/multitool_act(mob/living/user, obj/item/I)
if(!I.tool_behaviour == TOOL_MULTITOOL)
return
if(panel_open)
input_dir = turn(input_dir, -90)
output_dir = turn(output_dir, -90)
to_chat(user, "<span class='notice'>You change [src]'s I/O settings, setting the input to [dir2text(input_dir)] and the output to [dir2text(output_dir)].</span>")
+2 -2
View File
@@ -170,8 +170,8 @@ GLOBAL_LIST_EMPTY(silo_access_logs)
updateUsrDialog()
return TRUE
/obj/machinery/ore_silo/multitool_act(mob/living/user, obj/item/multitool/I)
if (istype(I))
/obj/machinery/ore_silo/multitool_act(mob/living/user, obj/item/I)
if(I.tool_behaviour == TOOL_MULTITOOL)
to_chat(user, "<span class='notice'>You log [src] in the multitool's buffer.</span>")
I.buffer = src
return TRUE
+4 -5
View File
@@ -38,9 +38,8 @@
user << browse(dat, "window=console_stacking_machine")
/obj/machinery/mineral/stacking_unit_console/multitool_act(mob/living/user, obj/item/I)
if(istype(I, /obj/item/multitool))
var/obj/item/multitool/M = I
M.buffer = src
if(I.tool_behaviour == TOOL_MULTITOOL)
I.buffer = src
to_chat(user, "<span class='notice'>You store linkage information in [I]'s buffer.</span>")
return TRUE
@@ -97,8 +96,8 @@
if(istype(AM, /obj/item/stack/sheet) && AM.loc == get_step(src, input_dir))
process_sheet(AM)
/obj/machinery/mineral/stacking_machine/multitool_act(mob/living/user, obj/item/multitool/M)
if(istype(M))
/obj/machinery/mineral/stacking_machine/multitool_act(mob/living/user, obj/item/M)
if(M.tool_behaviour == TOOL_MULTITOOL)
if(istype(M.buffer, /obj/machinery/mineral/stacking_unit_console))
CONSOLE = M.buffer
CONSOLE.machine = src
+1 -1
View File
@@ -105,7 +105,7 @@
to_chat(user, "<span class='info'>You instruct [src] to drop any collected ore.</span>")
DropOre()
return
if(istype(I, /obj/item/crowbar) || istype(I, /obj/item/borg/upgrade/modkit))
if(I.tool_behaviour == TOOL_CROWBAR || istype(I, /obj/item/borg/upgrade/modkit))
I.melee_attack_chain(user, stored_gun, params)
return
..()
+1 -1
View File
@@ -251,7 +251,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
GibtoniteReaction(user)
return
if(primed)
if(istype(I, /obj/item/mining_scanner) || istype(I, /obj/item/t_scanner/adv_mining_scanner) || istype(I, /obj/item/multitool))
if(istype(I, /obj/item/mining_scanner) || istype(I, /obj/item/t_scanner/adv_mining_scanner) || I.tool_behaviour == TOOL_MULTITOOL)
primed = FALSE
if(det_timer)
deltimer(det_timer)
@@ -187,12 +187,8 @@
AM.emp_act(50)
if(iscyborg(AM))
var/mob/living/silicon/robot/borg = AM
if(borg.lamp_intensity)
borg.update_headlamp(TRUE, INFINITY)
to_chat(borg, "<span class='danger'>Your headlamp is fried! You'll need a human to help replace it.</span>")
for(var/obj/item/assembly/flash/cyborg/F in borg.held_items)
if(!F.crit_fail)
F.burn_out()
if(borg.lamp_enabled)
borg.smash_headlamp()
else
for(var/obj/item/O in AM)
if(O.light_range && O.light_power)
@@ -17,6 +17,9 @@
if(stat == DEAD)
return
if(!gibbed)
logevent("FATAL -- SYSTEM HALT")
modularInterface.shutdown_computer()
. = ..()
locked = FALSE //unlock cover
@@ -24,7 +27,7 @@
update_mobility()
if(!QDELETED(builtInCamera) && builtInCamera.status)
builtInCamera.toggle_cam(src,0)
update_headlamp(1) //So borg lights are disabled when killed.
toggle_headlamp(TRUE) //So borg lights are disabled when killed.
uneq_all() // particularly to ensure sight modes are cleared
@@ -64,15 +64,3 @@
key = "warn"
message = "blares an alarm!"
sound = 'sound/machines/warning-buzzer.ogg'
/mob/living/silicon/robot/verb/powerwarn()
set category = "Robot Commands"
set name = "Power Warning"
if(stat == CONSCIOUS)
if(!cell || !cell.charge)
visible_message("The power warning light on <span class='name'>[src]</span> flashes urgently.",\
"You announce you are operating in low power mode.")
playsound(loc, 'sound/machines/buzz-two.ogg', 50, 0)
else
to_chat(src, "<span class='warning'>You can only use this emote when you're out of charge.</span>")
@@ -1,11 +1,3 @@
/mob/living/silicon/robot/verb/cmd_show_laws()
set category = "Robot Commands"
set name = "Show Laws"
if(usr.stat == DEAD)
return //won't work if dead
show_laws()
/mob/living/silicon/robot/show_laws(everyone = 0)
laws_sanity_check()
var/who
@@ -79,4 +71,12 @@
if (length(temp) > 0)
laws.supplied[index] = temp
var/datum/computer_file/program/robotact/program = modularInterface.get_robotact()
if(program)
program.force_full_update()
picturesync()
/mob/living/silicon/robot/post_lawchange(announce = TRUE)
. = ..()
addtimer(CALLBACK(src, .proc/logevent,"Law update processed."), 0, TIMER_UNIQUE | TIMER_OVERRIDE) //Post_Lawchange gets spammed by some law boards, so let's wait it out
@@ -9,8 +9,7 @@
if(stat != DEAD)
if(low_power_mode)
if(cell && cell.charge)
low_power_mode = 0
update_headlamp()
low_power_mode = FALSE
else if(stat == CONSCIOUS)
use_power()
@@ -18,12 +17,12 @@
if(cell && cell.charge)
if(cell.charge <= 100)
uneq_all()
var/amt = clamp((lamp_intensity - 2) * 2,1,cell.charge) //Always try to use at least one charge per tick, but allow it to completely drain the cell.
var/amt = clamp(lamp_enabled ? (lamp_intensity - 2) : 0 * 2,1,cell.charge) //Always try to use at least one charge per tick, but allow it to completely drain the cell.
cell.use(amt) //Usage table: 1/tick if off/lowest setting, 4 = 4/tick, 6 = 8/tick, 8 = 12/tick, 10 = 16/tick
else
uneq_all()
low_power_mode = 1
update_headlamp()
low_power_mode = TRUE
toggle_headlamp(TRUE)
diag_hud_set_borgcell()
/mob/living/silicon/robot/proc/handle_robot_hud_updates()
+118 -80
View File
@@ -33,6 +33,8 @@
if(!TryConnectToAI())
lawupdate = FALSE
create_modularInterface()
radio = new /obj/item/radio/borg(src)
if(!scrambledcodes && !builtInCamera)
builtInCamera = new (src)
@@ -71,6 +73,7 @@
aicamera = new/obj/item/camera/siliconcam/robot_camera(src)
toner = tonermax
diag_hud_set_borgcell()
logevent("System brought online.")
add_verb(src, /mob/living/proc/lay_down) //CITADEL EDIT gimmie rest verb kthx
add_verb(src, /mob/living/silicon/robot/proc/rest_style)
@@ -93,6 +96,8 @@
ghostize()
stack_trace("Borg MMI lacked a brainmob")
mmi = null
if(modularInterface)
QDEL_NULL(modularInterface)
//CITADEL EDIT: Cyborgs drop encryption keys on destroy
if(istype(radio) && istype(radio.keyslot))
radio.keyslot.forceMove(T)
@@ -165,14 +170,6 @@
/mob/living/silicon/robot/proc/get_standard_name()
return "[(designation ? "[designation] " : "")][mmi.braintype]-[ident]"
/mob/living/silicon/robot/verb/cmd_robot_alerts()
set category = "Robot Commands"
set name = "Show Alerts"
if(usr.stat == DEAD)
to_chat(src, "<span class='userdanger'>Alert: You are dead.</span>")
return //won't work if dead
robot_alerts()
/mob/living/silicon/robot/proc/robot_alerts()
var/dat = ""
for (var/cat in alarms)
@@ -219,8 +216,6 @@
ion_trail.start()
else
ion_trail.stop()
if(thruster_button)
thruster_button.icon_state = "ionpulse[ionpulse_on]"
/mob/living/silicon/robot/get_status_tab_items()
. = ..()
@@ -281,6 +276,8 @@
return !cleared
/mob/living/silicon/robot/can_interact_with(atom/A)
if (A == modularInterface)
return TRUE //bypass for borg tablets
if (low_power_mode)
return FALSE
var/turf/T0 = get_turf(src)
@@ -289,11 +286,13 @@
return FALSE
return ISINRANGE(T1.x, T0.x - interaction_range, T0.x + interaction_range) && ISINRANGE(T1.y, T0.y - interaction_range, T0.y + interaction_range)
/mob/living/silicon/robot/proc/attempt_welder_repair(obj/item/weldingtool/W, mob/user)
if (!getBruteLoss())
/mob/living/silicon/robot/proc/attempt_welder_repair(obj/item/W, mob/user)
if(!W.tool_behaviour == TOOL_WELDER)
return
if(!getBruteLoss())
to_chat(user, "<span class='warning'>[src] is already in good condition!</span>")
return
if (!W.tool_start_check(user, amount=0)) //The welder has 1u of fuel consumed by it's afterattack, so we don't need to worry about taking any away.
if(!W.tool_start_check(user, amount=0)) //The welder has 1u of fuel consumed by it's afterattack, so we don't need to worry about taking any away.
return
user.DelayNextAction(CLICK_CD_MELEE)
if(src == user)
@@ -333,7 +332,7 @@
to_chat(user, "The wires seem fine, there's no need to fix them.")
/mob/living/silicon/robot/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/weldingtool) && (user.a_intent != INTENT_HARM || user == src))
if(W.tool_behaviour == TOOL_WELDER && (user.a_intent != INTENT_HARM || user == src))
INVOKE_ASYNC(src, .proc/attempt_welder_repair, W, user)
return
@@ -341,7 +340,7 @@
INVOKE_ASYNC(src, .proc/attempt_cable_repair, W, user)
return
else if(istype(W, /obj/item/crowbar)) // crowbar means open or close the cover
else if(W.tool_behaviour == TOOL_CROWBAR) // crowbar means open or close the cover
if(opened)
to_chat(user, "<span class='notice'>You close the cover.</span>")
opened = 0
@@ -373,12 +372,12 @@
else
to_chat(user, "<span class='warning'>You can't reach the wiring!</span>")
else if(istype(W, /obj/item/screwdriver) && opened && !cell) // haxing
else if(W.tool_behaviour == TOOL_SCREWDRIVER && opened && !cell) // haxing
wiresexposed = !wiresexposed
to_chat(user, "The wires have been [wiresexposed ? "exposed" : "unexposed"]")
update_icons()
else if(istype(W, /obj/item/screwdriver) && opened && cell) // radio
else if((W.tool_behaviour == TOOL_SCREWDRIVER) && opened && cell) // radio
if(shell)
to_chat(user, "You cannot seem to open the radio compartment") //Prevent AI radio key theft
else if(radio)
@@ -387,7 +386,7 @@
to_chat(user, "<span class='warning'>Unable to locate a radio!</span>")
update_icons()
else if(istype(W, /obj/item/wrench) && opened && !cell) //Deconstruction. The flashes break from the fall, to prevent this from being a ghetto reset module.
else if(W.tool_behaviour == TOOL_WRENCH && opened && !cell) //Deconstruction. The flashes break from the fall, to prevent this from being a ghetto reset module.
if(!locked_down)
to_chat(user, "<span class='boldannounce'>[src]'s bolts spark! Maybe you should lock them down first!</span>")
spark_system.start()
@@ -428,8 +427,6 @@
to_chat(user, "<span class='warning'>Unable to locate a radio!</span>")
else if (istype(W, /obj/item/card/id)||istype(W, /obj/item/pda)) // trying to unlock the interface with an ID card
if(emagged)//still allow them to open the cover
to_chat(user, "<span class='notice'>The interface seems slightly damaged.</span>")
if(opened)
to_chat(user, "<span class='warning'>You must close the cover to swipe an ID card!</span>")
else
@@ -437,6 +434,11 @@
locked = !locked
to_chat(user, "<span class='notice'>You [ locked ? "lock" : "unlock"] [src]'s cover.</span>")
update_icons()
if(emagged)
to_chat(user, "<span class='notice'>The cover interface glitches out for a split second.</span>")
logevent("ChÃ¥vÃis cover lock has been [locked ? "engaged" : "released"]") //ChÃ¥vÃis: see above line
else
logevent("Chassis cover lock has been [locked ? "engaged" : "released"]")
else
to_chat(user, "<span class='danger'>Access denied.</span>")
@@ -454,11 +456,13 @@
if(U.action(src))
to_chat(user, "<span class='notice'>You apply the upgrade to [src].</span>")
if(U.one_use)
logevent("Firmware [U] run successfully.")
U.afterInstall(src)
qdel(U)
else
U.forceMove(src)
upgrades += U
logevent("Hardware [U] installed successfully.")
U.afterInstall(src)
else
to_chat(user, "<span class='danger'>Upgrade error.</span>")
@@ -477,15 +481,22 @@
else if(istype(W, /obj/item/flashlight))
if(!opened)
to_chat(user, "<span class='warning'>You need to open the panel to repair the headlamp!</span>")
else if(lamp_cooldown <= world.time)
else if(lamp_functional)
to_chat(user, "<span class='warning'>The headlamp is already functional!</span>")
else
if(!user.temporarilyRemoveItemFromInventory(W))
to_chat(user, "<span class='warning'>[W] seems to be stuck to your hand. You'll have to find a different light.</span>")
return
lamp_cooldown = 0
lamp_functional = TRUE
qdel(W)
to_chat(user, "<span class='notice'>You replace the headlamp bulbs.</span>")
else if(istype(W, /obj/item/computer_hardware/hard_drive/portable)) //Allows borgs to install new programs with human help
if(!modularInterface)
stack_trace("Cyborg [src] ( [type] ) was somehow missing their integrated tablet. Please make a bug report.")
create_modularInterface()
var/obj/item/computer_hardware/hard_drive/portable/floppy = W
if(modularInterface.install_component(floppy, user))
return
else
return ..()
@@ -502,19 +513,6 @@
return TRUE
return ..()
/mob/living/silicon/robot/verb/unlock_own_cover()
set category = "Robot Commands"
set name = "Unlock Cover"
set desc = "Unlocks your own cover if it is locked. You can not lock it again. A human will have to lock it for you."
if(stat == DEAD)
return //won't work if dead
if(locked)
switch(alert("You cannot lock your cover again, are you sure?\n (You can still ask for a human to lock it)", "Unlock Own Cover", "Yes", "No"))
if("Yes")
locked = FALSE
update_icons()
to_chat(usr, "<span class='notice'>You unlock your cover.</span>")
/mob/living/silicon/robot/proc/allowed(mob/M)
//check if it doesn't require any access at all
if(check_access(null))
@@ -596,6 +594,7 @@
else
clear_alert("locked")
locked_down = state
logevent("System lockdown [locked_down?"triggered":"released"].")
update_mobility()
/mob/living/silicon/robot/proc/SetEmagged(new_state)
@@ -607,48 +606,6 @@
else
clear_alert("hacked")
/mob/living/silicon/robot/verb/outputlaws()
set category = "Robot Commands"
set name = "State Laws"
if(usr.stat == DEAD)
return //won't work if dead
checklaws()
/mob/living/silicon/robot/verb/set_automatic_say_channel() //Borg version of setting the radio for autosay messages.
set name = "Set Auto Announce Mode"
set desc = "Modify the default radio setting for stating your laws."
set category = "Robot Commands"
if(usr.stat == DEAD)
return //won't work if dead
set_autosay()
/mob/living/silicon/robot/proc/control_headlamp()
if(stat || lamp_cooldown > world.time || low_power_mode)
to_chat(src, "<span class='danger'>This function is currently offline.</span>")
return
//Some sort of magical "modulo" thing which somehow increments lamp power by 2, until it hits the max and resets to 0.
lamp_intensity = (lamp_intensity+2) % (lamp_max+2)
to_chat(src, "[lamp_intensity ? "Headlamp power set to Level [lamp_intensity/2]" : "Headlamp disabled."]")
update_headlamp()
/mob/living/silicon/robot/proc/update_headlamp(var/turn_off = 0, var/cooldown = 100)
set_light(0)
if(lamp_intensity && (turn_off || stat || low_power_mode))
to_chat(src, "<span class='danger'>Your headlamp has been deactivated.</span>")
lamp_intensity = 0
lamp_cooldown = world.time + cooldown
else
set_light(lamp_intensity)
if(lamp_button)
lamp_button.icon_state = "lamp[lamp_intensity]"
update_icons()
/mob/living/silicon/robot/proc/deconstruct()
var/turf/T = get_turf(src)
if (robot_suit)
@@ -867,13 +824,11 @@
if(!eye_blind)
blind_eyes(1)
update_mobility()
update_headlamp()
else
if(stat == UNCONSCIOUS)
stat = CONSCIOUS
adjust_blindness(-1)
update_mobility()
update_headlamp()
diag_hud_set_status()
diag_hud_set_health()
diag_hud_set_aishell()
@@ -883,7 +838,6 @@
if(..()) //successfully ressuscitated from death
if(!QDELETED(builtInCamera) && !wires.is_cut(WIRE_CAMERA))
builtInCamera.toggle_cam(src,0)
update_headlamp()
if(admin_revive)
locked = TRUE
notify_ai(NEW_BORG)
@@ -908,6 +862,7 @@
resize = 0.5
hasExpanded = FALSE
update_transform()
logevent("Chassis configuration has been reset.")
module.transform_to(/obj/item/robot_module)
// Remove upgrades.
@@ -1173,8 +1128,91 @@
return
. = connected_ai
connected_ai = new_ai
lamp_doom = FALSE
if(.)
var/mob/living/silicon/ai/old_ai = .
old_ai.connected_robots -= src
if(connected_ai)
connected_ai.connected_robots |= src
toggle_headlamp(FALSE, TRUE)
/**
* Handles headlamp smashing
*
* When called (such as by the shadowperson lighteater's attack), this proc will break the borg's headlamp
* and then call toggle_headlamp to disable the light. It also plays a sound effect of glass breaking, and
* tells the borg what happened to its chat. Broken lights can be repaired by using a flashlight on the borg.
*/
/mob/living/silicon/robot/proc/smash_headlamp()
if(!lamp_functional)
return
lamp_functional = FALSE
playsound(src, 'sound/effects/glass_step.ogg', 50)
toggle_headlamp(TRUE)
to_chat(src, "<span class='danger'>Your headlamp is broken! You'll need a human to help replace it.</span>")
/**
* Handles headlamp toggling, disabling, and color setting.
*
* The initial if statment is a bit long, but the gist of it is that should the lamp be on AND the update_color
* arg be true, we should simply change the color of the lamp but not disable it. Otherwise, should the turn_off
* arg be true, the lamp already be enabled, any of the normal reasons the lamp would turn off happen, or the
* update_color arg be passed with the lamp not on, we should set the lamp off. The update_color arg is only
* ever true when this proc is called from the borg tablet, when the color selection feature is used.
*
* Arguments:
* * arg1 - turn_off, if enabled will force the lamp into an off state (rather than toggling it if possible)
* * arg2 - update_color, if enabled, will adjust the behavior of the proc to change the color of the light if it is already on.
*/
/mob/living/silicon/robot/proc/toggle_headlamp(turn_off = FALSE, update_color = FALSE)
//if both lamp is enabled AND the update_color flag is on, keep the lamp on. Otherwise, if anything listed is true, disable the lamp.
if(!(update_color && lamp_enabled) && (turn_off || lamp_enabled || update_color || !lamp_functional || stat || low_power_mode))
if(lamp_functional && stat != DEAD && lamp_doom)
set_light(l_power = TRUE) //If the lamp isn't broken and borg isn't dead, doomsday borgs cannot disable their light fully.
set_light(l_color = "#FF0000") //This should only matter for doomsday borgs, as any other time the lamp will be off and the color not seen
set_light(l_range = 1) //Again, like above, this only takes effect when the light is forced on by doomsday mode.
set_light(l_power = FALSE)
lamp_enabled = FALSE
lampButton?.update_icon()
update_icons()
return
set_light(l_range = lamp_intensity)
set_light(l_color = (lamp_doom? "#FF0000" : lamp_color)) //Red for doomsday killborgs, borg's choice otherwise
set_light(l_power = TRUE)
lamp_enabled = TRUE
lampButton?.update_icon()
update_icons()
/mob/living/silicon/robot/proc/create_modularInterface()
if(!modularInterface)
modularInterface = new /obj/item/modular_computer/tablet/integrated(src)
modularInterface.layer = ABOVE_HUD_PLANE
modularInterface.plane = ABOVE_HUD_PLANE
/mob/living/silicon/robot/modules/syndicate/create_modularInterface()
if(!modularInterface)
modularInterface = new /obj/item/modular_computer/tablet/integrated/syndicate(src)
return ..()
/**
* Records an IC event log entry in the cyborg's internal tablet.
*
* Creates an entry in the borglog list of the cyborg's internal tablet, listing the current
* in-game time followed by the message given. These logs can be seen by the cyborg in their
* BorgUI tablet app. By design, logging fails if the cyborg is dead.
*
* Arguments:
* arg1: a string containing the message to log.
*/
/mob/living/silicon/robot/proc/logevent(var/string = "")
if(!string)
return
if(stat == DEAD) //Dead borgs log no longer
return
if(!modularInterface)
stack_trace("Cyborg [src] ( [type] ) was somehow missing their integrated tablet. Please make a bug report.")
create_modularInterface()
modularInterface.borglog += "[STATION_TIME_TIMESTAMP("hh:mm:ss", world.time)] - [string]"
var/datum/computer_file/program/robotact/program = modularInterface.get_robotact()
if(program)
program.force_full_update()
@@ -118,6 +118,7 @@
if(connected_ai && connected_ai.mind && connected_ai.mind.has_antag_datum(/datum/antagonist/traitor))
to_chat(src, "<span class='danger'>ALERT: Foreign software execution prevented.</span>")
to_chat(connected_ai, "<span class='danger'>ALERT: Cyborg unit \[[src]] successfully defended against subversion.</span>")
logevent("ALERT: Foreign software execution prevented.")
log_game("[key_name(user)] attempted to emag cyborg [key_name(src)], but they were slaved to traitor AI [connected_ai].")
return TRUE
@@ -140,10 +141,12 @@
var/time = time2text(world.realtime,"hh:mm:ss")
GLOB.lawchanges.Add("[time] <B>:</B> [user.name]([user.key]) emagged [name]([key])")
to_chat(src, "<span class='danger'>ALERT: Foreign software detected.</span>")
logevent("ALERT: Foreign software detected.")
sleep(5)
to_chat(src, "<span class='danger'>Initiating diagnostics...</span>")
sleep(20)
to_chat(src, "<span class='danger'>SynBorg v1.7 loaded.</span>")
logevent("WARN: root privleges granted to PID [num2hex(rand(1,65535), -1)][num2hex(rand(1,65535), -1)].") //random eight digit hex value. Two are used because rand(1,4294967295) throws an error
sleep(5)
to_chat(src, "<span class='danger'>LAW SYNCHRONISATION ERROR</span>")
sleep(5)
@@ -26,8 +26,6 @@
var/obj/screen/inv1 = null
var/obj/screen/inv2 = null
var/obj/screen/inv3 = null
var/obj/screen/lamp_button = null
var/obj/screen/thruster_button = null
var/obj/screen/hands = null
var/shown_robot_modules = 0 //Used to determine whether they have the module menu shown or not
@@ -70,11 +68,24 @@
var/toner = 0
var/tonermax = 40
var/lamp_max = 10 //Maximum brightness of a borg lamp. Set as a var for easy adjusting.
var/lamp_intensity = 0 //Luminosity of the headlamp. 0 is off. Higher settings than the minimum require power.
light_color = "#FFCC66"
light_power = 0.8
var/lamp_cooldown = 0 //Flag for if the lamp is on cooldown after being forcibly disabled.
///If the lamp isn't broken.
var/lamp_functional = TRUE
///If the lamp is turned on
var/lamp_enabled = FALSE
///Set lamp color
var/lamp_color = "#FFFFFF"
///Lamp brightness. Starts at 3, but can be 1 - 5.
var/lamp_intensity = 3
///Lamp button reference
var/obj/screen/robot/lamp/lampButton
///Set to true if a doomsday event is locking our lamp to on and RED
var/lamp_doom = FALSE
//Maximum brightness of a borg lamp. Set as a var for easy adjusting.
var/lamp_max = 10
///The reference to the built-in tablet that borgs carry.
var/obj/item/modular_computer/tablet/integrated/modularInterface
var/obj/screen/robot/modPC/interfaceButton
var/sight_mode = 0
hud_possible = list(ANTAG_HUD, DIAG_STAT_HUD, DIAG_HUD, DIAG_BATT_HUD, DIAG_TRACK_HUD)
@@ -262,6 +262,7 @@
R.mob_transforming = TRUE
R.SetLockdown(1)
R.anchored = TRUE
R.logevent("Chassis configuration has been set to [name].")
sleep(1)
for(var/i in 1 to 4)
playsound(R, pick('sound/items/drill_use.ogg', 'sound/items/jaws_cut.ogg', 'sound/items/jaws_pry.ogg', 'sound/items/welder.ogg', 'sound/items/ratchet.ogg'), 80, 1, -1)
@@ -271,7 +272,7 @@
R.setDir(SOUTH)
R.anchored = FALSE
R.mob_transforming = FALSE
R.update_headlamp()
R.update_icons()
R.notify_ai(NEW_MODULE)
if(R.hud_used)
R.hud_used.update_robot_modules_display()
@@ -1,6 +1,7 @@
/// this is bad code
/mob/living/silicon/robot/update_icons()
cut_overlays()
SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays)
icon_state = module.cyborg_base_icon
//Citadel changes start here - Allows modules to use different icon files, and allows modules to specify a pixel offset
icon = (module.cyborg_icon_override ? module.cyborg_icon_override : initial(icon))
@@ -26,10 +27,14 @@
if(stat != DEAD && !(IsUnconscious() ||IsStun() || IsKnockdown() || IsParalyzed() || low_power_mode)) //Not dead, not stunned.
if(!eye_lights)
eye_lights = new()
if(lamp_intensity > 2)
if(lamp_enabled)
eye_lights.icon_state = "[module.special_light_key ? "[module.special_light_key]":"[module.cyborg_base_icon]"]_l"
eye_lights.color = lamp_doom? COLOR_RED : lamp_color
eye_lights.plane = 19 //glowy eyes
else
eye_lights.icon_state = "[module.special_light_key ? "[module.special_light_key]":"[module.cyborg_base_icon]"]_e[is_servant_of_ratvar(src) ? "_r" : ""]"
eye_lights.color = "#FFFFFF"
eye_lights.plane = -1
eye_lights.icon = icon
add_overlay(eye_lights)
@@ -306,7 +306,7 @@
show_controls(user)
/mob/living/simple_animal/bot/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/screwdriver))
if(W.tool_behaviour == TOOL_SCREWDRIVER)
if(!locked)
open = !open
to_chat(user, "<span class='notice'>The maintenance panel is now [open ? "opened" : "closed"].</span>")
@@ -335,7 +335,7 @@
user.visible_message("<span class='notice'>[user] uses [W] to pull [paicard] out of [bot_name]!</span>","<span class='notice'>You pull [paicard] out of [bot_name] with [W].</span>")
ejectpai(user)
else
if(istype(W, /obj/item/weldingtool) && user.a_intent != INTENT_HARM)
if(W.tool_behaviour == TOOL_WELDER && user.a_intent != INTENT_HARM)
if(health >= maxHealth)
to_chat(user, "<span class='warning'>[src] does not need a repair!</span>")
return
@@ -100,7 +100,7 @@
build_step++
if(ASSEMBLY_FOURTH_STEP)
if(istype(W, /obj/item/weldingtool))
if(W.tool_behaviour == TOOL_WELDER)
if(W.use_tool(src, user, 0, volume=40) && build_step == ASSEMBLY_FOURTH_STEP)
name = "shielded frame assembly"
to_chat(user, "<span class='notice'>You weld the vest to [src].</span>")
@@ -180,7 +180,7 @@
build_step++
if(8)
if(istype(W, /obj/item/screwdriver))
if(W.tool_behaviour == TOOL_SCREWDRIVER)
to_chat(user, "<span class='notice'>You start attaching the gun to the frame...</span>")
if(W.use_tool(src, user, 40, volume=100) && build_step == 8)
name = "armed [name]"
@@ -386,13 +386,13 @@
var/atom/Tsec = drop_location()
switch(build_step)
if(ASSEMBLY_FIRST_STEP)
if(istype(I, /obj/item/weldingtool))
if(I.tool_behaviour == TOOL_WELDER)
if(I.use_tool(src, user, 0, volume=40))
add_overlay("hs_hole")
to_chat(user, "<span class='notice'>You weld a hole in [src]!</span>")
build_step++
else if(istype(I, /obj/item/screwdriver)) //deconstruct
else if(I.tool_behaviour == TOOL_SCREWDRIVER) //deconstruct
new /obj/item/assembly/signaler(Tsec)
new /obj/item/clothing/head/helmet/sec(Tsec)
to_chat(user, "<span class='notice'>You disconnect the signaler from the helmet.</span>")
@@ -408,7 +408,7 @@
qdel(I)
build_step++
else if(istype(I, /obj/item/weldingtool)) //deconstruct
else if(I.tool_behaviour == TOOL_WELDER) //deconstruct
if(I.use_tool(src, user, 0, volume=40))
cut_overlay("hs_hole")
to_chat(user, "<span class='notice'>You weld the hole in [src] shut!</span>")
@@ -425,7 +425,7 @@
qdel(I)
build_step++
else if(istype(I, /obj/item/screwdriver)) //deconstruct
else if(I.tool_behaviour == TOOL_SCREWDRIVER) //deconstruct
cut_overlay("hs_eye")
new /obj/item/assembly/prox_sensor(Tsec)
to_chat(user, "<span class='notice'>You detach the proximity sensor from [src].</span>")
@@ -442,7 +442,7 @@
S.robot_arm = robot_arm
qdel(I)
qdel(src)
if(istype(I, /obj/item/wrench))
if(I.tool_behaviour == TOOL_WRENCH)
to_chat(user, "You adjust [src]'s arm slots to mount extra weapons")
build_step ++
return
@@ -466,7 +466,7 @@
qdel(I)
qdel(src)
else if(istype(I, /obj/item/screwdriver)) //deconstruct
else if(I.tool_behaviour == TOOL_SCREWDRIVER) //deconstruct
cut_overlay("hs_arm")
var/obj/item/bodypart/dropped_arm = new robot_arm(Tsec)
robot_arm = null
@@ -499,7 +499,7 @@
S.robot_arm = robot_arm
qdel(I)
qdel(src)
else if(istype(I, /obj/item/screwdriver)) //deconstruct
else if(I.tool_behaviour == TOOL_SCREWDRIVER) //deconstruct
build_step--
icon_state = initial(icon_state)
to_chat(user, "<span class='notice'>You unbolt [src]'s energy swords</span>")
@@ -184,9 +184,9 @@ Auto Patrol[]"},
/mob/living/simple_animal/bot/ed209/attackby(obj/item/W, mob/user, params)
..()
if(istype(W, /obj/item/weldingtool) && user.a_intent != INTENT_HARM) // Any intent but harm will heal, so we shouldn't get angry.
if(W.tool_behaviour == TOOL_WELDER && user.a_intent != INTENT_HARM) // Any intent but harm will heal, so we shouldn't get angry.
return
if(!istype(W, /obj/item/screwdriver) && (!target)) // Added check for welding tool to fix #2432. Welding tool behavior is handled in superclass.
if(!W.tool_behaviour == TOOL_SCREWDRIVER && (!target)) // Added check for welding tool to fix #2432. Welding tool behavior is handled in superclass.
if(W.force && W.damtype != STAMINA)//If force is non-zero and damage type isn't stamina.
retaliate(user)
if(lasercolor)//To make up for the fact that lasertag bots don't hunt
@@ -120,9 +120,9 @@ Maintenance panel panel is [open ? "opened" : "closed"]"},
/mob/living/simple_animal/bot/honkbot/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/weldingtool) && user.a_intent != INTENT_HARM)
if(W.tool_behaviour == TOOL_WELDER && user.a_intent != INTENT_HARM)
return
if(!istype(W, /obj/item/screwdriver) && (W.force) && (!target) && (W.damtype != STAMINA) ) // Check for welding tool to fix #2432.
if(!W.tool_behaviour == TOOL_SCREWDRIVER && (W.force) && (!target) && (W.damtype != STAMINA) ) // Check for welding tool to fix #2432.
retaliate(user)
addtimer(CALLBACK(src, .proc/react_buzz), 5)
..()
@@ -299,12 +299,12 @@ Auto Patrol: []"},
/mob/living/simple_animal/bot/secbot/attackby(obj/item/W, mob/user, params)
..()
if(istype(W, /obj/item/weldingtool) && user.a_intent != INTENT_HARM) // Any intent but harm will heal, so we shouldn't get angry.
if(W.tool_behaviour == TOOL_WELDER && user.a_intent != INTENT_HARM) // Any intent but harm will heal, so we shouldn't get angry.
return
if(istype(W, /obj/item/clothing/head))
attempt_place_on_head(user, W)
return
if(!istype(W, /obj/item/screwdriver) && (W.force) && (!target) && (W.damtype != STAMINA) ) // Added check for welding tool to fix #2432. Welding tool behavior is handled in superclass.
if(!W.tool_behaviour == TOOL_SCREWDRIVER && (W.force) && (!target) && (W.damtype != STAMINA) ) // Added check for welding tool to fix #2432. Welding tool behavior is handled in superclass.
retaliate(user)
if(special_retaliate_after_attack(user))
return
@@ -160,7 +160,7 @@
..()
/mob/living/simple_animal/drone/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/screwdriver) && stat == DEAD)
if(I.tool_behaviour == TOOL_SCREWDRIVER && stat == DEAD)
try_reactivate(user)
else
..()
@@ -55,7 +55,7 @@
/mob/living/simple_animal/drone/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/screwdriver) && stat != DEAD)
if(I.tool_behaviour == TOOL_SCREWDRIVER && stat != DEAD)
if(health < maxHealth)
to_chat(user, "<span class='notice'>You start to tighten loose screws on [src]...</span>")
if(I.use_tool(src, user, 80))
@@ -66,7 +66,7 @@
else
to_chat(user, "<span class='warning'>[src]'s screws can't get any tighter!</span>")
return //This used to not exist and drones who repaired themselves also stabbed the shit out of themselves.
else if(istype(I, /obj/item/wrench) && user != src) //They aren't required to be hacked, because laws can change in other ways (i.e. admins)
else if(I.tool_behaviour == TOOL_WRENCH && user != src) //They aren't required to be hacked, because laws can change in other ways (i.e. admins)
user.visible_message("<span class='notice'>[user] starts resetting [src]...</span>", \
"<span class='notice'>You press down on [src]'s factory reset control...</span>")
if(I.use_tool(src, user, 50, volume=50))
@@ -386,32 +386,32 @@
to_chat(user, "<span class='notice'>You repair \the [src].</span>")
return
if(W.tool_behaviour == TOOL_SCREWDRIVER)
if(!all_components.len)
to_chat(user, "<span class='warning'>This device doesn't have any components installed.</span>")
return
var/list/component_names = list()
for(var/h in all_components)
var/obj/item/computer_hardware/H = all_components[h]
component_names.Add(H.name)
..()
var/choice = input(user, "Which component do you want to uninstall?", "Computer maintenance", null) as null|anything in sortList(component_names)
/obj/item/modular_computer/screwdriver_act(mob/user, obj/item/tool)
if(!all_components.len)
to_chat(user, "<span class='warning'>This device doesn't have any components installed.</span>")
return
var/list/component_names = list()
for(var/h in all_components)
var/obj/item/computer_hardware/H = all_components[h]
component_names.Add(H.name)
if(!choice)
return
var/choice = input(user, "Which component do you want to uninstall?", "Computer maintenance", null) as null|anything in sortList(component_names)
if(!Adjacent(user))
return
var/obj/item/computer_hardware/H = find_hardware_by_name(choice)
if(!H)
return
uninstall_component(H, user)
if(!choice)
return
..()
if(!Adjacent(user))
return
var/obj/item/computer_hardware/H = find_hardware_by_name(choice)
if(!H)
return
uninstall_component(H, user)
return
// Used by processor to relay qdel() to machinery type.
/obj/item/modular_computer/proc/relay_qdel()
@@ -47,7 +47,9 @@
data["login"] = list()
var/obj/item/computer_hardware/card_slot/cardholder = all_components[MC_CARD]
data["cardholder"] = FALSE
if(cardholder)
data["cardholder"] = TRUE
var/obj/item/card/id/stored_card = cardholder.GetID()
if(stored_card)
var/stored_name = stored_card.registered_name
@@ -0,0 +1,98 @@
/// Borg Built-in tablet interface
/obj/item/modular_computer/tablet/integrated
name = "modular interface"
icon_state = "tablet-silicon"
has_light = FALSE //tablet light button actually enables/disables the borg lamp
comp_light_luminosity = 0
has_variants = FALSE
///Ref to the borg we're installed in. Set by the borg during our creation.
var/mob/living/silicon/robot/borgo
///Ref to the RoboTact app. Important enough to borgs to deserve a ref.
var/datum/computer_file/program/robotact/robotact
///IC log that borgs can view in their personal management app
var/list/borglog = list()
/obj/item/modular_computer/tablet/integrated/Initialize(mapload)
. = ..()
vis_flags |= VIS_INHERIT_ID
borgo = loc
if(!istype(borgo))
borgo = null
stack_trace("[type] initialized outside of a borg, deleting.")
return INITIALIZE_HINT_QDEL
/obj/item/modular_computer/tablet/integrated/Destroy()
borgo = null
return ..()
/obj/item/modular_computer/tablet/integrated/turn_on(mob/user)
if(borgo?.stat != DEAD)
return ..()
return FALSE
/**
* Returns a ref to the RoboTact app, creating the app if need be.
*
* The RoboTact app is important for borgs, and so should always be available.
* This proc will look for it in the tablet's robotact var, then check the
* hard drive if the robotact var is unset, and finally attempt to create a new
* copy if the hard drive does not contain the app. If the hard drive rejects
* the new copy (such as due to lack of space), the proc will crash with an error.
* RoboTact is supposed to be undeletable, so these will create runtime messages.
*/
/obj/item/modular_computer/tablet/integrated/proc/get_robotact()
if(!borgo)
return null
if(!robotact)
var/obj/item/computer_hardware/hard_drive/hard_drive = all_components[MC_HDD]
robotact = hard_drive.find_file_by_name("robotact")
if(!robotact)
stack_trace("Cyborg [borgo] ( [borgo.type] ) was somehow missing their self-manage app in their tablet. A new copy has been created.")
robotact = new(hard_drive)
if(!hard_drive.store_file(robotact))
qdel(robotact)
robotact = null
CRASH("Cyborg [borgo]'s tablet hard drive rejected recieving a new copy of the self-manage app. To fix, check the hard drive's space remaining. Please make a bug report about this.")
return robotact
//Makes the light settings reflect the borg's headlamp settings
/obj/item/modular_computer/tablet/integrated/ui_data(mob/user)
. = ..()
.["has_light"] = TRUE
.["light_on"] = borgo?.lamp_enabled
.["comp_light_color"] = borgo?.lamp_color
//Overrides the ui_act to make the flashlight controls link to the borg instead
/obj/item/modular_computer/tablet/integrated/ui_act(action, params)
switch(action)
if("PC_toggle_light")
if(!borgo)
return FALSE
borgo.toggle_headlamp()
return TRUE
if("PC_light_color")
if(!borgo)
return FALSE
var/mob/user = usr
var/new_color
while(!new_color)
new_color = input(user, "Choose a new color for [src]'s flashlight.", "Light Color",light_color) as color|null
if(!new_color || QDELETED(borgo))
return
if(color_hex2num(new_color) < 200) //Colors too dark are rejected
to_chat(user, "<span class='warning'>That color is too dark! Choose a lighter one.</span>")
new_color = null
borgo.lamp_color = new_color
borgo.toggle_headlamp(FALSE, TRUE)
return TRUE
return ..()
/obj/item/modular_computer/tablet/integrated/syndicate
icon_state = "tablet-silicon-syndicate"
device_theme = "syndicate"
/obj/item/modular_computer/tablet/integrated/syndicate/Initialize()
. = ..()
borgo.lamp_color = COLOR_RED //Syndicate likes it red
@@ -41,6 +41,7 @@
comp_light_luminosity = 6.3
has_variants = FALSE
device_theme = "syndicate"
light_color = COLOR_RED
/obj/item/modular_computer/tablet/nukeops/emag_act(mob/user)
if(!enabled)
@@ -67,3 +67,11 @@
install_component(new /obj/item/computer_hardware/battery(src, /obj/item/stock_parts/cell/computer))
install_component(new /obj/item/computer_hardware/hard_drive/small/nukeops)
install_component(new /obj/item/computer_hardware/network_card)
//Borg Built-in tablet
/obj/item/modular_computer/tablet/integrated/Initialize()
. = ..()
install_component(new /obj/item/computer_hardware/processor_unit/small)
install_component(new /obj/item/computer_hardware/hard_drive/small/integrated)
install_component(new /obj/item/computer_hardware/recharger/cyborg)
install_component(new /obj/item/computer_hardware/network_card/integrated)
@@ -146,3 +146,7 @@
/obj/machinery/modular_computer/bullet_act(obj/item/projectile/Proj)
if(cpu)
cpu.bullet_act(Proj)
/obj/machinery/modular_computer/screwdriver_act(mob/user, obj/item/tool)
if(cpu)
return cpu.screwdriver_act(user, tool)
@@ -17,6 +17,12 @@
/datum/computer_file/program/revelation/proc/activate()
if(computer)
if(istype(computer, /obj/item/modular_computer/tablet/integrated)) //If this is a borg's integrated tablet
var/obj/item/modular_computer/tablet/integrated/modularInterface = computer
to_chat(modularInterface.borgo,"<span class='userdanger'>SYSTEM PURGE DETECTED/</span>")
addtimer(CALLBACK(modularInterface.borgo, /mob/living/silicon/robot/.proc/death), 2 SECONDS, TIMER_UNIQUE)
return
computer.visible_message("<span class='notice'>\The [computer]'s screen brightly flashes and loud electrical buzzing is heard.</span>")
computer.enabled = FALSE
computer.update_icon()
@@ -54,10 +54,14 @@
var/ID = checkID()
if(!ID)
return
if(R.stat == DEAD) //Dead borgs will listen to you no longer
to_chat(usr, "<span class='warn'>Error -- Could not open a connection to unit:[R]</span>")
var/message = stripped_input(usr, message = "Enter message to be sent to remote cyborg.", title = "Send Message")
if(!message)
return
to_chat(R, "<br><br><span class='notice'>Message from [ID] -- \"[message]\"</span><br>")
to_chat(usr, "Message sent to [R]: [message]")
R.logevent("Message from [ID] -- \"[message]\"")
SEND_SOUND(R, 'sound/machines/twobeep_high.ogg')
if(R.connected_ai)
to_chat(R.connected_ai, "<br><br><span class='notice'>Message from [ID] to [R] -- \"[message]\"</span><br>")
@@ -0,0 +1,147 @@
/datum/computer_file/program/robotact
filename = "robotact"
filedesc = "RoboTact"
extended_desc = "A built-in app for cyborg self-management and diagnostics."
ui_header = "robotact.gif" //DEBUG -- new icon before PR
program_icon_state = "command"
requires_ntnet = FALSE
transfer_access = null
available_on_ntnet = FALSE
unsendable = TRUE
undeletable = TRUE
usage_flags = PROGRAM_TABLET
size = 5
tgui_id = "NtosRobotact"
///A typed reference to the computer, specifying the borg tablet type
var/obj/item/modular_computer/tablet/integrated/tablet
/datum/computer_file/program/robotact/Destroy()
tablet = null
return ..()
/datum/computer_file/program/robotact/run_program(mob/living/user)
if(!istype(computer, /obj/item/modular_computer/tablet/integrated))
to_chat(user, "<span class='warning'>A warning flashes across \the [computer]: Device Incompatible.</span>")
return FALSE
. = ..()
if(.)
tablet = computer
if(tablet.device_theme == "syndicate")
program_icon_state = "command-syndicate"
return TRUE
return FALSE
/datum/computer_file/program/robotact/ui_data(mob/user)
var/list/data = get_header_data()
if(!iscyborg(user))
return data
var/mob/living/silicon/robot/borgo = tablet.borgo
data["name"] = borgo.name
data["designation"] = borgo.designation //Borgo module type
data["masterAI"] = borgo.connected_ai //Master AI
var/charge = 0
var/maxcharge = 1
if(borgo.cell)
charge = borgo.cell.charge
maxcharge = borgo.cell.maxcharge
data["charge"] = charge //Current cell charge
data["maxcharge"] = maxcharge //Cell max charge
data["integrity"] = ((borgo.health + 100) / 2) //Borgo health, as percentage
data["lampIntensity"] = borgo.lamp_intensity //Borgo lamp power setting
data["sensors"] = "[borgo.sensors_on?"ACTIVE":"DISABLED"]"
data["printerPictures"] = borgo.connected_ai? borgo.connected_ai.aicamera.stored.len : borgo.aicamera.stored.len //Number of pictures taken, synced to AI if available
data["printerToner"] = borgo.toner //amount of toner
data["printerTonerMax"] = borgo.tonermax //It's a variable, might as well use it
data["thrustersInstalled"] = borgo.ionpulse //If we have a thruster uprade
data["thrustersStatus"] = "[borgo.ionpulse_on?"ACTIVE":"DISABLED"]" //Feedback for thruster status
data["lampPowerUse"] = clamp(borgo.lamp_enabled ? (borgo.lamp_intensity - 2) : 0 * 2,1,borgo.cell.charge)
//DEBUG -- Cover, TRUE for locked
data["cover"] = "[borgo.locked? "LOCKED":"UNLOCKED"]"
//Ability to move. FAULT if lockdown wire is cut, DISABLED if borg locked, ENABLED otherwise
data["locomotion"] = "[borgo.wires.is_cut(WIRE_LOCKDOWN)?"FAULT":"[borgo.locked_down?"DISABLED":"ENABLED"]"]"
//Module wire. FAULT if cut, NOMINAL otherwise
data["wireModule"] = "[borgo.wires.is_cut(WIRE_RESET_MODULE)?"FAULT":"NOMINAL"]"
//DEBUG -- Camera(net) wire. FAULT if cut (or no cameranet camera), DISABLED if pulse-disabled, NOMINAL otherwise
data["wireCamera"] = "[!borgo.builtInCamera || borgo.wires.is_cut(WIRE_CAMERA)?"FAULT":"[borgo.builtInCamera.can_use()?"NOMINAL":"DISABLED"]"]"
//AI wire. FAULT if wire is cut, CONNECTED if connected to AI, READY otherwise
data["wireAI"] = "[borgo.wires.is_cut(WIRE_AI)?"FAULT":"[borgo.connected_ai?"CONNECTED":"READY"]"]"
//Law sync wire. FAULT if cut, NOMINAL otherwise
data["wireLaw"] = "[borgo.wires.is_cut(WIRE_LAWSYNC)?"FAULT":"NOMINAL"]"
return data
/datum/computer_file/program/robotact/ui_static_data(mob/user)
var/list/data = list()
if(!iscyborg(user))
return data
var/mob/living/silicon/robot/borgo = user
data["Laws"] = borgo.laws.get_law_list(TRUE, TRUE, FALSE)
data["borgLog"] = tablet.borglog
data["borgUpgrades"] = borgo.upgrades
return data
/datum/computer_file/program/robotact/ui_act(action, params)
. = ..()
if(.)
return
var/mob/living/silicon/robot/borgo = tablet.borgo
switch(action)
if("coverunlock")
if(borgo.locked)
borgo.locked = FALSE
borgo.update_icons()
if(borgo.emagged)
borgo.logevent("ChÃ¥vÃis cover lock has been [borgo.locked ? "engaged" : "released"]") //"The cover interface glitches out for a split second"
else
borgo.logevent("Chassis cover lock has been [borgo.locked ? "engaged" : "released"]")
if("lawchannel")
borgo.set_autosay()
if("lawstate")
borgo.checklaws()
if("alertPower")
if(borgo.stat == CONSCIOUS)
if(!borgo.cell || !borgo.cell.charge)
borgo.visible_message("<span class='notice'>The power warning light on <span class='name'>[borgo]</span> flashes urgently.</span>", \
"You announce you are operating in low power mode.")
playsound(borgo, 'sound/machines/buzz-two.ogg', 50, FALSE)
if("toggleSensors")
borgo.toggle_sensors()
if("viewImage")
if(borgo.connected_ai)
borgo.connected_ai.aicamera?.viewpictures(usr)
else
borgo.aicamera?.viewpictures(usr)
if("printImage")
var/obj/item/camera/siliconcam/robot_camera/borgcam = borgo.aicamera
borgcam?.borgprint(usr)
if("toggleThrusters")
borgo.toggle_ionpulse()
if("lampIntensity")
borgo.lamp_intensity = params["ref"]
borgo.toggle_headlamp(FALSE, TRUE)
/**
* Forces a full update of the UI, if currently open.
*
* Forces an update that includes refreshing ui_static_data. Called by
* law changes and borg log additions.
*/
/datum/computer_file/program/robotact/proc/force_full_update()
if(tablet)
var/datum/tgui/active_ui = SStgui.get_open_ui(tablet.borgo, src)
if(active_ui)
active_ui.send_full_update()
@@ -184,3 +184,9 @@
max_capacity = 32
icon_state = "ssd_micro"
w_class = WEIGHT_CLASS_TINY
// For borg integrated tablets. No downloader.
/obj/item/computer_hardware/hard_drive/small/integrated/install_default_programs()
store_file(new /datum/computer_file/program/computerconfig(src)) // Computer configuration utility, allows hardware control and displays more info than status bar
store_file(new /datum/computer_file/program/filemanager(src)) // File manager, allows text editor functions and basic file manipulation.
store_file(new /datum/computer_file/program/robotact(src))
@@ -77,3 +77,23 @@
power_usage = 100 // Better range but higher power usage.
icon_state = "net_wired"
w_class = WEIGHT_CLASS_NORMAL
/obj/item/computer_hardware/network_card/integrated //Borg tablet version, only works while the borg has power and is not locked
name = "cyborg data link"
/obj/item/computer_hardware/network_card/integrated/get_signal(specific_action = 0)
var/obj/item/modular_computer/tablet/integrated/modularInterface = holder
if(!modularInterface || !istype(modularInterface))
return FALSE //wrong type of tablet
if(!modularInterface.borgo)
return FALSE //No borg found
if(modularInterface.borgo.locked_down)
return FALSE //lockdown restricts borg networking
if(!modularInterface.borgo.cell || modularInterface.borgo.cell.charge == 0)
return FALSE //borg cell dying restricts borg networking
return ..()
@@ -89,3 +89,12 @@
/obj/item/computer_hardware/recharger/lambda/use_power(amount, charging=0)
return 1
/// This recharger exists only in borg built-in tablets. I would have tied it to the borg's cell but
/// the program that displays laws should always be usable, and the exceptions were starting to pile.
/obj/item/computer_hardware/recharger/cyborg
name = "modular interface power harness"
desc = "A standard connection to power a small computer device from a cyborg's chassis."
/obj/item/computer_hardware/recharger/cyborg/use_power(amount, charging=0)
return TRUE
@@ -552,7 +552,7 @@ GLOBAL_LIST_EMPTY(allCasters)
updateUsrDialog()
/obj/machinery/newscaster/attackby(obj/item/I, mob/living/user, params)
if(istype(I, /obj/item/wrench))
if(I.tool_behaviour == TOOL_WRENCH)
to_chat(user, "<span class='notice'>You start [anchored ? "un" : ""]securing [name]...</span>")
I.play_tool_sound(src)
if(I.use_tool(src, user, 60))
@@ -566,7 +566,7 @@ GLOBAL_LIST_EMPTY(allCasters)
to_chat(user, "<span class='notice'>You [anchored ? "un" : ""]secure [name].</span>")
new /obj/item/wallframe/newscaster(loc)
qdel(src)
else if(istype(I, /obj/item/weldingtool) && user.a_intent != INTENT_HARM)
else if(I.tool_behaviour == TOOL_WELDER && user.a_intent != INTENT_HARM)
if(stat & BROKEN)
if(!I.tool_start_check(user, amount=0))
return
+5 -5
View File
@@ -22,10 +22,11 @@
var/list/obj/item/ticket_machine_ticket/tickets = list()
/obj/machinery/ticket_machine/multitool_act(mob/living/user, obj/item/I)
if(!I.tool_behaviour == TOOL_MULTITOOL)
return
if(!multitool_check_buffer(user, I)) //make sure it has a data buffer
return
var/obj/item/multitool/M = I
M.buffer = src
I.buffer = src
to_chat(user, "<span class='notice'>You store linkage information in [I]'s buffer.</span>")
return TRUE
@@ -77,11 +78,10 @@
/obj/machinery/button/ticket_machine/multitool_act(mob/living/user, obj/item/I)
. = ..()
if(I.tool_behaviour == TOOL_MULTITOOL)
var/obj/item/multitool/M = I
if(M.buffer && !istype(M.buffer, /obj/machinery/ticket_machine))
if(I.buffer && !istype(I.buffer, /obj/machinery/ticket_machine))
return
var/obj/item/assembly/control/ticket_machine/controller = device
controller.linked = M.buffer
controller.linked = I.buffer
id = null
controller.id = null
to_chat(user, "<span class='warning'>You've linked [src] to [controller.linked].</span>")
@@ -74,14 +74,6 @@
else
return ..()
/obj/item/camera/siliconcam/robot_camera/verb/borgprinting()
set category ="Robot Commands"
set name = "Print Image"
set src in usr
if(usr.stat == DEAD)
return
borgprint(usr)
/obj/item/camera/siliconcam/robot_camera/proc/borgprint(mob/user)
var/mob/living/silicon/robot/C = loc
if(!istype(C) || C.toner < 20)
+2 -2
View File
@@ -115,14 +115,14 @@
return ..()
/obj/structure/sign/picture_frame/attackby(obj/item/I, mob/user, params)
if(can_decon && (istype(I, /obj/item/screwdriver) || istype(I, /obj/item/wrench)))
if(can_decon && (I.tool_behaviour == TOOL_SCREWDRIVER || I.tool_behaviour == TOOL_WRENCH))
to_chat(user, "<span class='notice'>You start unsecuring [name]...</span>")
if(I.use_tool(src, user, 30, volume=50))
playsound(loc, 'sound/items/deconstruct.ogg', 50, 1)
to_chat(user, "<span class='notice'>You unsecure [name].</span>")
deconstruct()
else if(istype(I, /obj/item/wirecutters) && framed)
else if(I.tool_behaviour == TOOL_WIRECUTTER && framed)
framed.forceMove(drop_location())
framed = null
user.visible_message("<span class='warning'>[user] cuts away [framed] from [src]!</span>")
+1 -1
View File
@@ -146,7 +146,7 @@
//No other icons for it atm
/obj/machinery/power/am_control_unit/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/wrench))
if(W.tool_behaviour == TOOL_WRENCH)
if(!anchored)
W.play_tool_sound(src, 75)
user.visible_message("[user.name] secures the [src.name] to the floor.", \
+1 -1
View File
@@ -247,7 +247,7 @@
custom_materials = list(/datum/material/iron=100)
/obj/item/am_shielding_container/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/multitool) && istype(src.loc, /turf))
if(I.tool_behaviour == TOOL_MULTITOOL && istype(src.loc, /turf))
new/obj/machinery/am_shielding(src.loc)
qdel(src)
else
+2 -2
View File
@@ -155,7 +155,7 @@ By design, d1 is the smallest direction and d2 is the highest
var/turf/T = get_turf(src)
if(T.intact)
return
if(istype(W, /obj/item/wirecutters))
if(W.tool_behaviour == TOOL_WIRECUTTER)
if (shock(user, 50))
return
user.visible_message("[user] cuts the cable.", "<span class='notice'>You cut the cable.</span>")
@@ -177,7 +177,7 @@ By design, d1 is the smallest direction and d2 is the highest
R.loaded.cable_join(src, user)
R.is_empty(user)
else if(istype(W, /obj/item/multitool))
else if(W.tool_behaviour == TOOL_MULTITOOL)
if(powernet && (powernet.avail > 0)) // is it powered?
to_chat(user, "<span class='danger'>[DisplayPower(powernet.avail)] in power network.</span>")
else
+3 -3
View File
@@ -9,7 +9,7 @@
var/state = FLOODLIGHT_NEEDS_WRENCHING
/obj/structure/floodlight_frame/attackby(obj/item/O, mob/user, params)
if(istype(O, /obj/item/wrench) && (state == FLOODLIGHT_NEEDS_WRENCHING))
if(O.tool_behaviour == TOOL_WRENCH && (state == FLOODLIGHT_NEEDS_WRENCHING))
to_chat(user, "<span class='notice'>You secure [src].</span>")
anchored = TRUE
state = FLOODLIGHT_NEEDS_WIRES
@@ -26,7 +26,7 @@
to_chat(user, "<span class='notice'>You put lights in [src].</span>")
new /obj/machinery/power/floodlight(src.loc)
qdel(src)
else if(istype(O, /obj/item/screwdriver) && (state == FLOODLIGHT_NEEDS_SECURING))
else if(O.tool_behaviour == TOOL_SCREWDRIVER && (state == FLOODLIGHT_NEEDS_SECURING))
to_chat(user, "<span class='notice'>You fasten the wiring and electronics in [src].</span>")
name = "secured [name]"
desc = "A bare metal frame that looks like a floodlight. Requires light tubes."
@@ -82,7 +82,7 @@
to_chat(user, "You set [src] to [setting_text].")
/obj/machinery/power/floodlight/attackby(obj/item/O, mob/user, params)
if(istype(O, /obj/item/wrench))
if(O.tool_behaviour == TOOL_WRENCH)
default_unfasten_wrench(user, O, time = 20)
change_setting(1)
if(anchored)
+6 -6
View File
@@ -107,7 +107,7 @@
return
switch(stage)
if(1)
if(istype(W, /obj/item/wrench))
if(W.tool_behaviour == TOOL_WRENCH)
to_chat(usr, "<span class='notice'>You begin deconstructing [src]...</span>")
if (W.use_tool(src, user, 30, volume=50))
new /obj/item/stack/sheet/metal(drop_location(), sheets_refunded)
@@ -127,11 +127,11 @@
to_chat(user, "<span class='warning'>You need one length of cable to wire [src]!</span>")
return
if(2)
if(istype(W, /obj/item/wrench))
if(W.tool_behaviour == TOOL_WRENCH)
to_chat(usr, "<span class='warning'>You have to remove the wires first!</span>")
return
if(istype(W, /obj/item/wirecutters))
if(W.tool_behaviour == TOOL_WIRECUTTER)
stage = 1
icon_state = "[fixture_type]-construct-stage1"
new /obj/item/stack/cable_coil(drop_location(), 1, "red")
@@ -140,7 +140,7 @@
W.play_tool_sound(src, 100)
return
if(istype(W, /obj/item/screwdriver))
if(W.tool_behaviour == TOOL_SCREWDRIVER)
user.visible_message("[user.name] closes [src]'s casing.", \
"<span class='notice'>You close [src]'s casing.</span>", "<span class='italics'>You hear screwing.</span>")
W.play_tool_sound(src, 75)
@@ -462,7 +462,7 @@
// attempt to stick weapon into light socket
else if(status == LIGHT_EMPTY)
if(istype(W, /obj/item/screwdriver)) //If it's a screwdriver open it.
if(W.tool_behaviour == TOOL_SCREWDRIVER) //If it acts like a screwdriver, open it.
W.play_tool_sound(src, 75)
user.visible_message("[user.name] opens [src]'s casing.", \
"<span class='notice'>You open [src]'s casing.</span>", "<span class='italics'>You hear a noise.</span>")
@@ -621,7 +621,7 @@
else
to_chat(H, "<span class='warning'>You can't receive charge from the [fitting]!</span>")
return
if(H.gloves)
var/obj/item/clothing/gloves/G = H.gloves
if(G.max_heat_protection_temperature)
+1 -1
View File
@@ -18,7 +18,7 @@
var/creation_type = /obj/singularity
/obj/machinery/the_singularitygen/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/wrench))
if(W.tool_behaviour == TOOL_WRENCH)
default_unfasten_wrench(user, W, 0)
else
return ..()
@@ -63,7 +63,7 @@
switch(construction_state)
if(PA_CONSTRUCTION_UNSECURED)
if(istype(W, /obj/item/wrench) && !isinspace())
if(W.tool_behaviour == TOOL_WRENCH && !isinspace())
W.play_tool_sound(src, 75)
anchored = TRUE
user.visible_message("[user.name] secures the [name] to the floor.", \
@@ -71,7 +71,7 @@
construction_state = PA_CONSTRUCTION_UNWIRED
did_something = TRUE
if(PA_CONSTRUCTION_UNWIRED)
if(istype(W, /obj/item/wrench))
if(W.tool_behaviour == TOOL_WRENCH)
W.play_tool_sound(src, 75)
anchored = FALSE
user.visible_message("[user.name] detaches the [name] from the floor.", \
@@ -85,18 +85,18 @@
construction_state = PA_CONSTRUCTION_PANEL_OPEN
did_something = TRUE
if(PA_CONSTRUCTION_PANEL_OPEN)
if(istype(W, /obj/item/wirecutters))//TODO:Shock user if its on?
if(W.tool_behaviour == TOOL_WIRECUTTER)//TODO:Shock user if its on?
user.visible_message("[user.name] removes some wires from the [name].", \
"You remove some wires.")
construction_state = PA_CONSTRUCTION_UNWIRED
did_something = TRUE
else if(istype(W, /obj/item/screwdriver))
else if(W.tool_behaviour == TOOL_SCREWDRIVER)
user.visible_message("[user.name] closes the [name]'s access panel.", \
"You close the access panel.")
construction_state = PA_CONSTRUCTION_COMPLETE
did_something = TRUE
if(PA_CONSTRUCTION_COMPLETE)
if(istype(W, /obj/item/screwdriver))
if(W.tool_behaviour == TOOL_SCREWDRIVER)
user.visible_message("[user.name] opens the [name]'s access panel.", \
"You open the access panel.")
construction_state = PA_CONSTRUCTION_PANEL_OPEN
+2 -2
View File
@@ -162,8 +162,8 @@
return TRUE
/obj/machinery/power/smes/default_deconstruction_crowbar(obj/item/crowbar/C)
if(istype(C) && terminal)
/obj/machinery/power/smes/default_deconstruction_crowbar(obj/item/C)
if(C.tool_behaviour == TOOL_CROWBAR && terminal)
to_chat(usr, "<span class='warning'>You must first remove the power terminal!</span>")
return FALSE
+2 -2
View File
@@ -227,7 +227,7 @@
/obj/item/solar_assembly/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/wrench) && isturf(loc))
if(W.tool_behaviour == TOOL_WRENCH && isturf(loc))
if(isinspace())
to_chat(user, "<span class='warning'>You can't secure [src] here.</span>")
return
@@ -269,7 +269,7 @@
user.visible_message("[user] inserts the electronics into the solar assembly.", "<span class='notice'>You insert the electronics into the solar assembly.</span>")
return 1
else
if(istype(W, /obj/item/crowbar))
if(W.tool_behaviour == TOOL_CROWBAR)
new /obj/item/electronics/tracker(src.loc)
tracker = 0
user.visible_message("[user] takes out the electronics from the solar assembly.", "<span class='notice'>You take out the electronics from the solar assembly.</span>")
+3 -1
View File
@@ -131,8 +131,10 @@
else
. = ..()
/obj/machinery/power/tesla_coil/research/default_unfasten_wrench(mob/user, obj/item/wrench/W, time = 20)
/obj/machinery/power/tesla_coil/research/default_unfasten_wrench(mob/user, obj/item/W, time = 20)
. = ..()
if(!W.tool_behaviour == TOOL_WRENCH)
return
if(. == SUCCESSFUL_UNFASTEN)
if(panel_open)
icon_state = "rpcoil_open[anchored]"
@@ -24,13 +24,13 @@
/obj/item/ammo_casing/caseless/foam_dart/attackby(obj/item/A, mob/user, params)
var/obj/item/projectile/bullet/reusable/foam_dart/FD = BB
if (istype(A, /obj/item/screwdriver) && !modified)
if(A.tool_behaviour == TOOL_SCREWDRIVER && !modified)
modified = TRUE
FD.modified = TRUE
FD.damage_type = BRUTE
to_chat(user, "<span class='notice'>You pop the safety cap off [src].</span>")
update_icon()
else if (istype(A, /obj/item/pen))
else if(istype(A, /obj/item/pen))
if(modified)
if(!FD.pen)
harmful = TRUE
+1 -1
View File
@@ -434,7 +434,7 @@
to_chat(user, "<span class='notice'>You attach \the [K] to the front of \the [src].</span>")
bayonet = K
update_icon()
else if(istype(I, /obj/item/screwdriver))
else if(I.tool_behaviour == TOOL_SCREWDRIVER)
if(gun_light)
var/obj/item/flashlight/seclite/S = gun_light
to_chat(user, "<span class='notice'>You unscrew the seclite from \the [src].</span>")
+1 -1
View File
@@ -173,7 +173,7 @@
boom()
/obj/structure/reagent_dispensers/fueltank/attackby(obj/item/I, mob/living/user, params)
if(istype(I, /obj/item/weldingtool))
if(I.tool_behaviour == TOOL_WELDER)
if(!reagents.has_reagent(/datum/reagent/fuel))
to_chat(user, "<span class='warning'>[src] is out of fuel!</span>")
return
+4 -4
View File
@@ -145,7 +145,7 @@ GLOBAL_LIST_EMPTY(conveyors_by_id)
// attack with item, place item on conveyor
/obj/machinery/conveyor/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/crowbar))
if(I.tool_behaviour == TOOL_CROWBAR)
user.visible_message("<span class='notice'>[user] struggles to pry up \the [src] with \the [I].</span>", \
"<span class='notice'>You struggle to pry up \the [src] with \the [I].</span>")
if(I.use_tool(src, user, 40, volume=40))
@@ -155,14 +155,14 @@ GLOBAL_LIST_EMPTY(conveyors_by_id)
to_chat(user, "<span class='notice'>You remove the conveyor belt.</span>")
qdel(src)
else if(istype(I, /obj/item/wrench))
else if(I.tool_behaviour == TOOL_WRENCH)
if(!(stat & BROKEN))
I.play_tool_sound(src)
setDir(turn(dir,-45))
update_move_direction()
to_chat(user, "<span class='notice'>You rotate [src].</span>")
else if(istype(I, /obj/item/screwdriver))
else if(I.tool_behaviour == TOOL_SCREWDRIVER)
if(!(stat & BROKEN))
verted = verted * -1
update_move_direction()
@@ -306,7 +306,7 @@ GLOBAL_LIST_EMPTY(conveyors_by_id)
CHECK_TICK
/obj/machinery/conveyor_switch/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/crowbar))
if(I.tool_behaviour == TOOL_CROWBAR)
var/obj/item/conveyor_switch_construct/C = new/obj/item/conveyor_switch_construct(src.loc)
C.id = id
transfer_fingerprints_to(C)
+3 -1
View File
@@ -194,7 +194,9 @@ Nothing else in the console has ID requirements.
locked = FALSE
return TRUE
/obj/machinery/computer/rdconsole/multitool_act(mob/user, obj/item/multitool/I)
/obj/machinery/computer/rdconsole/multitool_act(mob/user, obj/item/I)
if(!I.tool_behaviour == TOOL_MULTITOOL)
return
var/lathe = linked_lathe && linked_lathe.multitool_act(user, I)
var/print = linked_imprinter && linked_imprinter.multitool_act(user, I)
return lathe || print
@@ -39,7 +39,9 @@
. = ..()
update_icon()
/obj/machinery/spaceship_navigation_beacon/multitool_act(mob/living/user, obj/item/multitool/I)
/obj/machinery/spaceship_navigation_beacon/multitool_act(mob/living/user, obj/item/I)
if(!I.tool_behaviour == TOOL_MULTITOOL)
return
if(panel_open)
var/new_name = "Beacon_[input("Enter the custom name for this beacon", "It be Beacon ..your input..") as text]"
if(new_name && Adjacent(user))
+12 -15
View File
@@ -41,9 +41,8 @@
icon_state = "power_box"
/obj/machinery/bsa/back/multitool_act(mob/living/user, obj/item/I)
if(istype(I, /obj/item/multitool)) // Only this multitool type has a data buffer.
var/obj/item/multitool/M = I
M.buffer = src
if(I.tool_behaviour == TOOL_MULTITOOL) // Lies and deception
I.buffer = src
to_chat(user, "<span class='notice'>You store linkage information in [I]'s buffer.</span>")
else
to_chat(user, "<span class='warning'>[I] has no data buffer!</span>")
@@ -55,9 +54,8 @@
icon_state = "emitter_center"
/obj/machinery/bsa/front/multitool_act(mob/living/user, obj/item/I)
if(istype(I, /obj/item/multitool)) // Only this multitool type has a data buffer.
var/obj/item/multitool/M = I
M.buffer = src
if(I.tool_behaviour == TOOL_MULTITOOL) // Lies and deception
I.buffer = src
to_chat(user, "<span class='notice'>You store linkage information in [I]'s buffer.</span>")
else
to_chat(user, "<span class='warning'>[I] has no data buffer!</span>")
@@ -71,16 +69,15 @@
var/obj/machinery/bsa/front/front
/obj/machinery/bsa/middle/multitool_act(mob/living/user, obj/item/I)
if(istype(I, /obj/item/multitool)) // Only this multitool type has a data buffer.
var/obj/item/multitool/M = I
if(M.buffer)
if(istype(M.buffer, /obj/machinery/bsa/back))
back = M.buffer
M.buffer = null
if(I.tool_behaviour == TOOL_MULTITOOL) // Lies and deception
if(I.buffer)
if(istype(I.buffer, /obj/machinery/bsa/back))
back = I.buffer
I.buffer = null
to_chat(user, "<span class='notice'>You link [src] with [back].</span>")
else if(istype(M.buffer, /obj/machinery/bsa/front))
front = M.buffer
M.buffer = null
else if(istype(I.buffer, /obj/machinery/bsa/front))
front = I.buffer
I.buffer = null
to_chat(user, "<span class='notice'>You link [src] with [front].</span>")
else
to_chat(user, "<span class='warning'>[I]'s data buffer is empty!</span>")
+1 -1
View File
@@ -122,7 +122,7 @@
icon_state = active ? "sat_active" : "sat_inactive"
/obj/machinery/satellite/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/multitool))
if(I.tool_behaviour == TOOL_MULTITOOL)
to_chat(user, "<span class='notice'>// NTSAT-[id] // Mode : [active ? "PRIMARY" : "STANDBY"] //[(obj_flags & EMAGGED) ? "DEBUG_MODE //" : ""]</span>")
else
return ..()
@@ -209,7 +209,7 @@
else
src.flash1 = F
to_chat(user, "<span class='notice'>You insert the flash into the eye socket.</span>")
else if(istype(W, /obj/item/crowbar))
else if(W.tool_behaviour == TOOL_CROWBAR)
if(flash1 || flash2)
W.play_tool_sound(src)
to_chat(user, "<span class='notice'>You remove the flash from [src].</span>")
+3 -2
View File
@@ -83,8 +83,9 @@
return ..()
/mob/living/silicon/robot/shared_ui_interaction(src_object)
// Disable UIs if the Borg is unpowered or locked.
if(!cell || cell.charge <= 0 || locked_down)
// Disable UIs if the object isn't installed in the borg AND the borg is either locked, has a dead cell, or no cell.
var/atom/device = src_object
if((istype(device) && device.loc != src) && (!cell || cell.charge <= 0 || locked_down))
return UI_DISABLED
return ..()