Skip to content
This repository has been archived by the owner on Sep 8, 2022. It is now read-only.

[MIRROR] [TG PORT] Removes Robot Commands and replaces it with an integrated control tablet program + silicons start with HUD on #1014

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions beestation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -2699,6 +2699,7 @@
#include "code\modules\modular_computers\file_system\programs\arcade.dm"
#include "code\modules\modular_computers\file_system\programs\atmosscan.dm"
#include "code\modules\modular_computers\file_system\programs\borg_monitor.dm"
#include "code\modules\modular_computers\file_system\programs\borg_self_monitor.dm"
#include "code\modules\modular_computers\file_system\programs\budgetordering.dm"
#include "code\modules\modular_computers\file_system\programs\card.dm"
#include "code\modules\modular_computers\file_system\programs\cargobounty.dm"
Expand Down
7 changes: 3 additions & 4 deletions code/_onclick/hud/_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,15 @@
#define ui_storage1 "CENTER+1:18,SOUTH:5"
#define ui_storage2 "CENTER+2:20,SOUTH:5"

#define ui_borg_sensor "CENTER-3:16, SOUTH:5" //borgs
#define ui_borg_lamp "CENTER-4:16, SOUTH:5" //borgs
#define ui_borg_thrusters "CENTER-5:16, SOUTH:5" //borgs
#define ui_borg_lamp "CENTER-3:16, SOUTH:5" //borgs
#define ui_borg_tablet "CENTER-4:16, SOUTH:5" //borgs
#define ui_inv1 "CENTER-2:16,SOUTH:5" //borgs
#define ui_inv2 "CENTER-1 :16,SOUTH:5" //borgs
#define ui_inv3 "CENTER :16,SOUTH:5" //borgs
#define ui_borg_module "CENTER+1:16,SOUTH:5" //borgs
#define ui_borg_store "CENTER+2:16,SOUTH:5" //borgs
#define ui_borg_camera "CENTER+3:21,SOUTH:5" //borgs
#define ui_borg_album "CENTER+4:21,SOUTH:5" //borgs
#define ui_borg_alerts "CENTER+4:21,SOUTH:5" //borgs
#define ui_borg_language_menu "CENTER+4:21,SOUTH+1:5" //borgs

#define ui_monkey_head "CENTER-5:13,SOUTH:5" //monkey
Expand Down
3 changes: 0 additions & 3 deletions code/_onclick/hud/ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,6 @@
if(isAI(usr))
var/mob/living/silicon/ai/AI = usr
AI.aicamera.viewpictures(usr)
else if(iscyborg(usr))
var/mob/living/silicon/robot/R = usr
R.aicamera.viewpictures(usr)

/atom/movable/screen/ai/sensors
name = "Sensor Augmentation"
Expand Down
101 changes: 61 additions & 40 deletions code/_onclick/hud/robot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -68,26 +68,6 @@
var/mob/living/silicon/robot/R = usr
R.uneq_active()

/atom/movable/screen/robot/lamp
name = "headlamp"
icon_state = "lamp0"

/atom/movable/screen/robot/lamp/Click()
if(..())
return
var/mob/living/silicon/robot/R = usr
R.control_headlamp()

/atom/movable/screen/robot/thrusters
name = "ion thrusters"
icon_state = "ionpulse0"

/atom/movable/screen/robot/thrusters/Click()
if(..())
return
var/mob/living/silicon/robot/R = usr
R.toggle_ionpulse()

/datum/hud/robot
ui_style = 'icons/mob/screen_cyborg.dmi'

Expand Down Expand Up @@ -130,36 +110,36 @@

//End of module select

//Photography stuff
using = new /atom/movable/screen/ai/image_take()
using.screen_loc = ui_borg_camera
using.hud = src
static_inventory += using

using = new /atom/movable/screen/ai/image_view()
using.screen_loc = ui_borg_album
using = new /atom/movable/screen/robot/lamp()
using.screen_loc = ui_borg_lamp
using.hud = src
static_inventory += using
mymobR.lampButton = using
var/atom/movable/screen/robot/lamp/lampscreen = using
lampscreen.robot = mymobR

//Sec/Med HUDs
using = new /atom/movable/screen/ai/sensors()
using.screen_loc = ui_borg_sensor
//Photography stuff
using = new /atom/movable/screen/ai/image_take()
using.screen_loc = ui_borg_camera
using.hud = src
static_inventory += using

//Headlamp control
using = new /atom/movable/screen/robot/lamp()
using.screen_loc = ui_borg_lamp
//Borg Integrated Tablet
using = new /atom/movable/screen/robot/modPC()
using.screen_loc = ui_borg_tablet
using.hud = src
static_inventory += using
mymobR.lamp_button = using

//Thrusters
using = new /atom/movable/screen/robot/thrusters()
using.screen_loc = ui_borg_thrusters
mymobR.interfaceButton = using
if(mymobR.modularInterface)
using.vis_contents += mymobR.modularInterface
var/atom/movable/screen/robot/modPC/tabletbutton = using
tabletbutton.robot = mymobR

//Alerts
using = new /atom/movable/screen/robot/alerts()
using.screen_loc = ui_borg_alerts
using.hud = src
static_inventory += using
mymobR.thruster_button = using

//Intent
action_intent = new /atom/movable/screen/act_intent/robot()
Expand Down Expand Up @@ -288,3 +268,44 @@
else
for(var/obj/item/I in R.held_items)
screenmob.client.screen -= I

/atom/movable/screen/robot/lamp
name = "headlamp"
icon_state = "lamp_off"
var/mob/living/silicon/robot/robot

/atom/movable/screen/robot/lamp/Click()
. = ..()
if(.)
return
robot?.toggle_headlamp()
update_icon()

/atom/movable/screen/robot/lamp/update_icon()
if(robot?.lamp_enabled)
icon_state = "lamp_on"
else
icon_state = "lamp_off"

/atom/movable/screen/robot/modPC
name = "Modular Interface"
icon_state = "template"
var/mob/living/silicon/robot/robot

/atom/movable/screen/robot/modPC/Click()
. = ..()
if(.)
return
robot.modularInterface?.interact(robot)

/atom/movable/screen/robot/alerts
name = "Alert Panel"
icon = 'icons/mob/screen_ai.dmi'
icon_state = "alerts"

/atom/movable/screen/robot/alerts/Click()
. = ..()
if(.)
return
var/mob/living/silicon/robot/borgo = usr
borgo.robot_alerts()
4 changes: 4 additions & 0 deletions code/datums/wires/robot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
if(R.shell)
R.undeploy()
R.connected_ai = null
R.logevent("AI connection fault [mend?"cleared":"detected"]")
if(WIRE_LAWSYNC) // Cut the law wire, and the borg will no longer receive law updates from its AI. Repair and it will re-sync.
if(mend)
if(!R.emagged)
Expand All @@ -84,14 +85,17 @@
else if(!R.deployed) //AI shells must always have the same laws as the AI
R.lawupdate = FALSE
log_combat(usr, R, "disabled lawsync via wire")
R.logevent("Lawsync Module fault [mend?"cleared":"detected"]")
if (WIRE_CAMERA) // Disable the camera.
if(!QDELETED(R.builtInCamera) && !R.scrambledcodes)
R.builtInCamera.status = mend
R.builtInCamera.toggle_cam(usr, FALSE)
R.visible_message("[R]'s camera lens focuses loudly.", "Your camera lens focuses loudly.")
R.logevent("Camera Module fault [mend?"cleared":"detected"]")
log_combat(usr, R, "[mend ? "enabled" : "disabled"] cyborg camera via wire")
if(WIRE_LOCKDOWN) // Simple lockdown.
R.SetLockdown(!mend)
R.logevent("Motor Controller fault [mend?"cleared":"detected"]")
log_combat(usr, R, "[!R.lockcharge ? "locked down" : "released"] via wire")
if(WIRE_RESET_MODULE)
if(R.has_module() && !mend)
Expand Down
1 change: 1 addition & 0 deletions code/game/machinery/computer/robot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
log_game("[key_name(usr)] emagged [key_name(R)] using robotic console!")
message_admins("[ADMIN_LOOKUPFLW(usr)] emagged cyborg [key_name_admin(R)] using robotic console!")
R.SetEmagged(TRUE)
R.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
if("killdrone")
if(allowed(usr))
var/mob/living/simple_animal/drone/D = locate(params["ref"]) in GLOB.mob_list
Expand Down
5 changes: 5 additions & 0 deletions code/game/objects/items/robot/robot_upgrades.dm
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
playsound(loc, 'sound/voice/liveagain.ogg', 75, 1)

R.revive()
R.logevent("WARN -- System recovered from unexpected shutdown.")
R.logevent("System brought online.")

/obj/item/borg/upgrade/vtec
name = "cyborg VTEC module"
Expand Down Expand Up @@ -134,6 +136,7 @@
return FALSE

R.ionpulse = TRUE
R.toggle_ionpulse() //Enabled by default

/obj/item/borg/upgrade/thrusters/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
Expand Down Expand Up @@ -290,6 +293,8 @@
return FALSE

R.SetEmagged(1)
R.logevent("WARN: hardware installed with missing security certificate!") //A bit of fluff to hint it was an illegal tech item
R.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

return TRUE

Expand Down
1 change: 1 addition & 0 deletions code/modules/asset_cache/asset_list_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"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_self_monitor.gif" = 'icons/program_icons/borg_self_monitor.gif'
)

/datum/asset/simple/circuit_assets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,8 @@

/mob/living/silicon/robot/lighteater_act(obj/item/light_eater/light_eater)
..()
if(!lamp_cooldown)
update_headlamp(TRUE, INFINITY)
to_chat(src, "<span class='danger'>Your headlamp is fried! You'll need a human to help replace it.</span>")
if(lamp_enabled)
smash_headlamp()

/obj/structure/bonfire/lighteater_act(obj/item/light_eater/light_eater)
if(burning)
Expand Down
6 changes: 4 additions & 2 deletions code/modules/mob/living/silicon/robot/death.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@
/mob/living/silicon/robot/death(gibbed)
if(stat == DEAD)
return

if(!gibbed)
logevent("FATAL -- SYSTEM HALT")
modularInterface.shutdown_computer()
. = ..()

locked = FALSE //unlock cover

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

Expand Down
12 changes: 0 additions & 12 deletions code/modules/mob/living/silicon/robot/emote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,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>")
16 changes: 8 additions & 8 deletions code/modules/mob/living/silicon/robot/laws.dm
Original file line number Diff line number Diff line change
@@ -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/deadchat_lawchange()
if(lawupdate)
return
Expand Down Expand Up @@ -84,4 +76,12 @@
if (length(temp) > 0)
laws.supplied[index] = temp

var/datum/computer_file/program/borg_self_monitor/program = modularInterface.get_self_monitoring()
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 changes: 4 additions & 5 deletions code/modules/mob/living/silicon/robot/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,20 @@
if(stat != DEAD)
if(low_power_mode)
if(cell?.charge)
low_power_mode = 0
update_headlamp()
low_power_mode = FALSE
else if(stat == CONSCIOUS)
use_power()

/mob/living/silicon/robot/proc/use_power()
if(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),1,cell.charge) //Lamp will use a max of 5 charge, depending on brightness of lamp. If lamp is off, borg systems consume 1 point of charge, or the rest of the cell if it's lower than that.
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()
Expand Down
Loading