mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-31 09:08:30 +01:00
Merge pull request #10343 from GunHog/Borgie_Lights
[Review] Cyborg headlamps!
This commit is contained in:
@@ -38,6 +38,7 @@
|
||||
#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" //borgies
|
||||
#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
|
||||
|
||||
@@ -53,6 +53,14 @@
|
||||
var/mob/living/silicon/robot/R = usr
|
||||
R.uneq_active()
|
||||
|
||||
/obj/screen/robot/lamp
|
||||
name = "headlamp"
|
||||
icon_state = "lamp0"
|
||||
|
||||
/obj/screen/robot/lamp/Click()
|
||||
var/mob/living/silicon/robot/R = usr
|
||||
R.control_headlamp()
|
||||
|
||||
|
||||
/datum/hud/proc/robot_hud()
|
||||
adding = list()
|
||||
@@ -102,6 +110,12 @@
|
||||
using.screen_loc = ui_borg_sensor
|
||||
adding += using
|
||||
|
||||
//Headlamp control
|
||||
using = new /obj/screen/robot/lamp()
|
||||
using.screen_loc = ui_borg_lamp
|
||||
adding += using
|
||||
mymobR.lamp_button = using
|
||||
|
||||
//Intent
|
||||
using = new /obj/screen/act_intent()
|
||||
using.icon = 'icons/mob/screen_cyborg.dmi'
|
||||
|
||||
@@ -76,6 +76,8 @@
|
||||
qdel(G)
|
||||
for(var/mob/living/H in T.contents)
|
||||
extinguishMob(H)
|
||||
for(var/mob/living/silicon/robot/borgie in T.contents)
|
||||
borgie.update_headlamp(1)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
R.designation = "Default"
|
||||
R.notify_ai(2)
|
||||
R.update_icons()
|
||||
R.update_headlamp()
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
update_canmove()
|
||||
if(camera)
|
||||
camera.status = 0
|
||||
update_headlamp(1) //So borg lights are disabled when killed.
|
||||
|
||||
uneq_all() // particularly to ensure sight modes are cleared
|
||||
|
||||
|
||||
@@ -15,11 +15,6 @@
|
||||
if(istype(O,/obj/item/borg/sight))
|
||||
var/obj/item/borg/sight/S = O
|
||||
sight_mode &= ~S.sight_mode
|
||||
else if(istype(O, /obj/item/device/flashlight))
|
||||
var/obj/item/device/flashlight/F = O
|
||||
if(F.on)
|
||||
F.on = 0
|
||||
F.update_brightness(src)
|
||||
else if(istype(O, /obj/item/weapon/storage/bag/tray/))
|
||||
var/obj/item/weapon/storage/bag/tray/T = O
|
||||
T.do_quick_empty()
|
||||
|
||||
@@ -25,10 +25,12 @@
|
||||
if(cell && cell.charge)
|
||||
if(cell.charge <= 100)
|
||||
uneq_all()
|
||||
cell.use(1)
|
||||
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.
|
||||
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()
|
||||
stat = UNCONSCIOUS
|
||||
update_headlamp(1)
|
||||
|
||||
|
||||
/mob/living/silicon/robot/handle_regular_status_updates()
|
||||
@@ -59,6 +61,7 @@
|
||||
|
||||
if (paralysis || stunned || weakened) //Stunned etc.
|
||||
stat = UNCONSCIOUS
|
||||
update_headlamp()
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
var/obj/screen/inv1 = null
|
||||
var/obj/screen/inv2 = null
|
||||
var/obj/screen/inv3 = null
|
||||
var/obj/screen/lamp_button = null
|
||||
|
||||
var/shown_robot_modules = 0 //Used to determine whether they have the module menu shown or not
|
||||
var/obj/screen/robot_modules_background
|
||||
@@ -60,6 +61,8 @@
|
||||
var/tonermax = 40
|
||||
var/jetpackoverlay = 0
|
||||
var/braintype = "Cyborg"
|
||||
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.
|
||||
|
||||
/mob/living/silicon/robot/New(loc)
|
||||
spark_system = new /datum/effect/effect/system/spark_spread()
|
||||
@@ -221,6 +224,7 @@
|
||||
transform_animation(animation_length)
|
||||
notify_ai(2)
|
||||
update_icons()
|
||||
update_headlamp()
|
||||
SetEmagged(emagged) // Update emag status and give/take emag modules.
|
||||
|
||||
/mob/living/silicon/robot/proc/transform_animation(animation_length)
|
||||
@@ -720,12 +724,17 @@
|
||||
/mob/living/silicon/robot/update_icons()
|
||||
|
||||
overlays.Cut()
|
||||
if(stat == CONSCIOUS)
|
||||
if(stat != DEAD && !(paralysis || stunned || weakened)) //Not dead, not stunned.
|
||||
var/state_name = icon_state //For easy conversion and/or different names
|
||||
switch(icon_state)
|
||||
if("robot")
|
||||
overlays += "eyes-standard"
|
||||
state_name = "standard"
|
||||
if("mediborg")
|
||||
overlays += "eyes-mediborg"
|
||||
if("toiletbot")
|
||||
overlays += "eyes-toiletbot"
|
||||
overlays += "eyes-mediborg"
|
||||
state_name = "mediborg"
|
||||
if("secborg")
|
||||
overlays += "eyes-secborg"
|
||||
if("engiborg")
|
||||
@@ -738,6 +747,9 @@
|
||||
overlays += "eyes-syndie_bloodhound"
|
||||
else
|
||||
overlays += "eyes"
|
||||
state_name = "serviceborg"
|
||||
if(lamp_intensity > 2)
|
||||
overlays += "eyes-[state_name]-lights"
|
||||
|
||||
if(opened)
|
||||
if(wiresexposed)
|
||||
@@ -751,8 +763,6 @@
|
||||
overlays += "minerjetpack"
|
||||
update_fire()
|
||||
|
||||
|
||||
|
||||
/mob/living/silicon/robot/proc/installed_modules()
|
||||
if(!module)
|
||||
pick_module()
|
||||
@@ -978,6 +988,32 @@
|
||||
set category = "Robot Commands"
|
||||
set_autosay()
|
||||
|
||||
/mob/living/silicon/robot/proc/control_headlamp()
|
||||
if(stat)
|
||||
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)
|
||||
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)
|
||||
SetLuminosity(0)
|
||||
|
||||
if(lamp_intensity && (turn_off || stat))
|
||||
src << "<span class='danger'>Your headlamp has been deactivated.</span>"
|
||||
lamp_intensity = 0
|
||||
else
|
||||
AddLuminosity(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)
|
||||
|
||||
@@ -66,7 +66,6 @@
|
||||
|
||||
/obj/item/weapon/robot_module/standard/New()
|
||||
..()
|
||||
modules += new /obj/item/device/flashlight(src)
|
||||
modules += new /obj/item/weapon/melee/baton/loaded(src)
|
||||
modules += new /obj/item/weapon/extinguisher(src)
|
||||
modules += new /obj/item/weapon/wrench(src)
|
||||
@@ -81,7 +80,6 @@
|
||||
|
||||
/obj/item/weapon/robot_module/medical/New()
|
||||
..()
|
||||
modules += new /obj/item/device/flashlight(src)
|
||||
modules += new /obj/item/device/healthanalyzer(src)
|
||||
modules += new /obj/item/weapon/reagent_containers/borghypo(src)
|
||||
modules += new /obj/item/weapon/reagent_containers/glass/beaker/large(src)
|
||||
@@ -119,7 +117,6 @@
|
||||
|
||||
/obj/item/weapon/robot_module/engineering/New()
|
||||
..()
|
||||
modules += new /obj/item/device/flashlight(src)
|
||||
modules += new /obj/item/borg/sight/meson(src)
|
||||
emag = new /obj/item/borg/stun(src)
|
||||
modules += new /obj/item/weapon/rcd/borg(src)
|
||||
@@ -173,7 +170,6 @@
|
||||
|
||||
/obj/item/weapon/robot_module/security/New()
|
||||
..()
|
||||
modules += new /obj/item/device/flashlight/seclite(src)
|
||||
modules += new /obj/item/weapon/restraints/handcuffs/cable/zipties/cyborg(src)
|
||||
modules += new /obj/item/weapon/melee/baton/loaded(src)
|
||||
modules += new /obj/item/weapon/gun/energy/disabler/cyborg(src)
|
||||
@@ -187,7 +183,6 @@
|
||||
|
||||
/obj/item/weapon/robot_module/janitor/New()
|
||||
..()
|
||||
modules += new /obj/item/device/flashlight(src)
|
||||
modules += new /obj/item/weapon/soap/nanotrasen(src)
|
||||
modules += new /obj/item/weapon/storage/bag/trash/cyborg(src)
|
||||
modules += new /obj/item/weapon/mop/cyborg(src)
|
||||
@@ -205,7 +200,6 @@
|
||||
|
||||
/obj/item/weapon/robot_module/butler/New()
|
||||
..()
|
||||
modules += new /obj/item/device/flashlight(src)
|
||||
modules += new /obj/item/weapon/reagent_containers/food/drinks/drinkingglass(src)
|
||||
modules += new /obj/item/weapon/reagent_containers/food/condiment/enzyme(src)
|
||||
modules += new /obj/item/weapon/pen(src)
|
||||
@@ -239,7 +233,6 @@
|
||||
modules += new /obj/item/weapon/storage/bag/ore/cyborg(src)
|
||||
modules += new /obj/item/weapon/pickaxe/drill/cyborg(src)
|
||||
modules += new /obj/item/weapon/shovel(src)
|
||||
modules += new /obj/item/device/flashlight/lantern(src)
|
||||
modules += new /obj/item/weapon/storage/bag/sheetsnatcher/borg(src)
|
||||
modules += new /obj/item/device/t_scanner/adv_mining_scanner(src)
|
||||
modules += new /obj/item/weapon/gun/energy/kinetic_accelerator(src)
|
||||
@@ -251,7 +244,6 @@
|
||||
|
||||
/obj/item/weapon/robot_module/syndicate/New()
|
||||
..()
|
||||
modules += new /obj/item/device/flashlight(src)
|
||||
modules += new /obj/item/weapon/melee/energy/sword/cyborg(src)
|
||||
modules += new /obj/item/weapon/gun/energy/printer(src)
|
||||
modules += new /obj/item/weapon/gun/projectile/revolver/grenadelauncher/cyborg(src)
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
################################
|
||||
# Example Changelog File
|
||||
#
|
||||
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
|
||||
#
|
||||
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
|
||||
# When it is, any changes listed below will disappear.
|
||||
#
|
||||
# Valid Prefixes:
|
||||
# bugfix
|
||||
# wip (For works in progress)
|
||||
# tweak
|
||||
# soundadd
|
||||
# sounddel
|
||||
# rscadd (general adding of nice things)
|
||||
# rscdel (general deleting of nice things)
|
||||
# imageadd
|
||||
# imagedel
|
||||
# spellcheck (typo fixes)
|
||||
# experiment
|
||||
# tgs (TG-ported fixes?)
|
||||
#################################
|
||||
|
||||
# Your name.
|
||||
author: Gun Hog
|
||||
|
||||
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
|
||||
delete-after: True
|
||||
|
||||
# Any changes you've made. See valid prefix list above.
|
||||
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
|
||||
# SCREW THIS UP AND IT WON'T WORK.
|
||||
# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit.
|
||||
# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog.
|
||||
changes:
|
||||
- rscadd: "Nanotrasen advancements in cyborg technology now allow for integrated headlamps! As such, the flashlight package normally used as a module is now seamlessly merged with their systems!"
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 95 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 18 KiB |
Reference in New Issue
Block a user