Files
Paradise/code/_onclick/hud/robot.dm
Vi3trice f4b37b4177 Port TG updating appearances (#17943)
* Get pants that match or else you gonna look silly yo

* Posters

* Fix other hud elements

* Rereviewed

* Update shotglass.dm

* Fix for new merged PRs

* Typo

* Coming across other stuff

* Update theblob.dm

* No takebacksies

* smh i forget to leave a comment

* Updated for the detgun and cards

* Should have rerun langserver again

* No longer plastic, more in scope

* Damn you bluespace

* Reverting turret logic, out of scope at this point

* Tweak that part

* Went over energy guns again, and fixed UI White's sprite sheet

* Welding masks, glasses, and JUSTICE

* Update portable_atmospherics.dm

* Cleaning up, clearing things up

* Review and suggestions

* Update valve.dm

* More tweaks

* Missing character

* Not distinct lightmasks, so they can be overlays

* Update generator.dm

* Add parameter so holodeck doesn't try to make a perfect copy

* Update unsorted.dm

* Spiders

* Better fix for spiders, fix vamps too

* Ghosts

* Update telekinesis.dm

* Cleaning up old procs

* It's set up to not copy datums... Unless they're in a list

* Donuts, duct tape, and detgun. D3VR coming to Early Access

* Update procs that interact with doors so they call update_state instead

* Forgot one spot, and actually might as well just force lock

* Cleaning up other things... Sigh, and kitty ears

* oops

* Getting used to how it works

* blinds

* Going back to the suit obscuring thing, so it doesn't update all the time

* Missed that from merging master

* I made this PR and forgot about it

* Fix runtimes in cards

* Make things a bit more unified

* Update update_icons.dm

* yarn, really?

* Update library_equipment.dm

* Update shieldgen.dm

* Every time Charlie merges something, I go back and see if I can improve things further

* what's this? more?

* Update misc_special.dm

* wow, paper

* Review

* More reviews

* To be sure, seems like being broken messed something sometimes

* Brought airlocks closer to how TG works to iron out some stuff

* Pizza and morgue

* Doesn't seem to hurt, tried with holodeck

* Revert "Doesn't seem to hurt, tried with holodeck"

This reverts commit 158529302b.

* Icon conflict

* Fix organ damage

* Don't ask how. Why. It's like that on prod too.

* Cutting down on things and updating from TG.

* More flexible. Just in case the thing you stuck it on didn't destroy.

* Hydro was one the things I touched earlier on, better rework it

* Reviews

* Cleaning up further, also bri'ish

* Undo a change I did, and switch over to a more recent implementation

* Update biogenerator.dm

* Rolling back to old airlocks, but with new duct taped note

* Functionally the same. I'd just rather not have the smoothing happen there

* Went over APCs again

* Fix welding helmet names in species files

* Update airlock.dm

* Update persistent_overlay.dm

* Oh, topic
2022-07-21 08:11:59 +02:00

257 lines
5.9 KiB
Plaintext

/obj/screen/robot
icon = 'icons/mob/screen_robot.dmi'
/obj/screen/robot/module
name = "cyborg module"
icon_state = "nomod"
/obj/screen/robot/module/Click()
if(isrobot(usr))
var/mob/living/silicon/robot/R = usr
if(R.module)
R.hud_used.toggle_show_robot_modules()
return 1
R.pick_module()
/obj/screen/robot/module1
name = "module1"
icon_state = "inv1"
/obj/screen/robot/module1/Click()
if(isrobot(usr))
var/mob/living/silicon/robot/R = usr
R.toggle_module(1)
/obj/screen/robot/module2
name = "module2"
icon_state = "inv2"
/obj/screen/robot/module2/Click()
if(isrobot(usr))
var/mob/living/silicon/robot/R = usr
R.toggle_module(2)
/obj/screen/robot/module3
name = "module3"
icon_state = "inv3"
/obj/screen/robot/module3/Click()
if(isrobot(usr))
var/mob/living/silicon/robot/R = usr
R.toggle_module(3)
/obj/screen/robot/radio
name = "radio"
icon_state = "radio"
/obj/screen/robot/radio/Click()
if(issilicon(usr))
var/mob/living/silicon/robot/R = usr
R.radio_menu()
/obj/screen/robot/store
name = "store"
icon_state = "store"
/obj/screen/robot/store/Click()
if(isrobot(usr))
var/mob/living/silicon/robot/R = usr
R.uneq_active()
R.hud_used.update_robot_modules_display()
/obj/screen/robot/lamp
name = "Toggle Headlamp"
icon_state = "lamp0"
screen_loc = ui_borg_lamp
/obj/screen/robot/lamp/Click()
if(isrobot(usr))
var/mob/living/silicon/robot/R = usr
R.control_headlamp()
/obj/screen/robot/thrusters
name = "ion thrusters"
icon_state = "ionpulse0"
/obj/screen/robot/thrusters/Click()
var/mob/living/silicon/robot/R = usr
R.toggle_ionpulse()
/obj/screen/robot/mov_intent
name = "fast/slow toggle"
icon_state = "running"
/obj/screen/robot/mov_intent/Click()
usr.toggle_move_intent()
/mob/living/silicon/robot/create_mob_hud()
if(client && !hud_used)
hud_used = new /datum/hud/robot(src)
/datum/hud/robot/New(mob/user)
..()
var/obj/screen/using
var/mob/living/silicon/robot/mymobR = mymob
//Language menu
using = new /obj/screen/language_menu
using.screen_loc = ui_borg_lanugage_menu
static_inventory += using
//Radio
using = new /obj/screen/robot/radio()
using.screen_loc = ui_borg_radio
static_inventory += using
//Module select
using = new /obj/screen/robot/module1()
using.screen_loc = ui_inv1
static_inventory += using
mymobR.inv1 = using
using = new /obj/screen/robot/module2()
using.screen_loc = ui_inv2
static_inventory += using
mymobR.inv2 = using
using = new /obj/screen/robot/module3()
using.screen_loc = ui_inv3
static_inventory += using
mymobR.inv3 = using
//End of module select
//Sec/Med HUDs
using = new /obj/screen/ai/sensors()
using.screen_loc = ui_borg_sensor
static_inventory += using
//Intent
// Attack intent
using = new /obj/screen/act_intent/robot()
using.icon_state = mymob.a_intent
static_inventory += using
action_intent = using
// Movement intent
using = new /obj/screen/robot/mov_intent()
using.icon_state = (mymob.m_intent == MOVE_INTENT_RUN ? "running" : "walking")
static_inventory += using
using.screen_loc = ui_movi
move_intent = using
//Health
mymob.healths = new /obj/screen/healths/robot()
infodisplay += mymob.healths
//Installed Module
mymobR.hands = new /obj/screen/robot/module()
mymobR.hands.screen_loc = ui_borg_module
static_inventory += mymobR.hands
module_store_icon = new /obj/screen/robot/store()
module_store_icon.screen_loc = ui_borg_store
mymob.pullin = new /obj/screen/pull()
mymob.pullin.icon = 'icons/mob/screen_robot.dmi'
mymob.pullin.hud = src
mymob.pullin.update_icon(UPDATE_ICON_STATE)
mymob.pullin.screen_loc = ui_borg_pull
hotkeybuttons += mymob.pullin
zone_select = new /obj/screen/zone_sel/robot()
zone_select.hud = src
zone_select.update_icon(UPDATE_OVERLAYS)
static_inventory += zone_select
//Headlamp
mymobR.lamp_button = new /obj/screen/robot/lamp()
mymobR.lamp_button.screen_loc = ui_borg_lamp
static_inventory += mymobR.lamp_button
//Thrusters
using = new /obj/screen/robot/thrusters()
using.screen_loc = ui_borg_thrusters
static_inventory += using
mymobR.thruster_button = using
/datum/hud/robot/Destroy()
var/mob/living/silicon/robot/myrob = mymob
myrob.inv1 = null
myrob.hands = null
myrob.inv2 = null
myrob.inv3 = null
myrob.lamp_button = null
myrob.thruster_button = null
return ..()
/datum/hud/proc/toggle_show_robot_modules()
if(!isrobot(mymob))
return
var/mob/living/silicon/robot/R = mymob
R.shown_robot_modules = !R.shown_robot_modules
update_robot_modules_display()
/datum/hud/proc/update_robot_modules_display()
if(!isrobot(mymob))
return
var/mob/living/silicon/robot/R = mymob
if(!R.client)
return
if(!R.module)
return
if(R.shown_robot_modules && hud_shown)
//Modules display is shown
R.client.screen += module_store_icon //"store" icon
if(!R.module.modules)
to_chat(usr, "<span class='danger'>Selected module has no modules to select.</span>")
return
if(!R.robot_modules_background)
return
var/display_rows = CEILING(R.module.modules.len / 8, 1)
R.robot_modules_background.screen_loc = "CENTER-4:16,SOUTH+1:7 to CENTER+3:16,SOUTH+[display_rows]:7"
R.client.screen += R.robot_modules_background
var/x = -4 //Start at CENTER-4,SOUTH+1
var/y = 1
for(var/atom/movable/A in R.module.modules)
if( (A != R.module_state_1) && (A != R.module_state_2) && (A != R.module_state_3) )
//Module is not currently active
R.client.screen += A
if(x < 0)
A.screen_loc = "CENTER[x]:16,SOUTH+[y]:7"
else
A.screen_loc = "CENTER+[x]:16,SOUTH+[y]:7"
A.layer = ABOVE_HUD_LAYER
A.plane = ABOVE_HUD_PLANE
x++
if(x == 4)
x = -4
y++
else
//Modules display is hidden
R.client.screen -= module_store_icon
for(var/atom/A in R.module.modules)
if( (A != R.module_state_1) && (A != R.module_state_2) && (A != R.module_state_3) )
//Module is not currently active
R.client.screen -= A
R.shown_robot_modules = FALSE
R.client.screen -= R.robot_modules_background