Merge branch 'tool_behavior-replacing' of https://github.com/SandPoot/Citadel-Station-13 into tool_behavior-replacing
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user