mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-26 05:27:01 +01:00
* Adding defines * More signals for external power * Gets the reboot working * renaming a proc * config stuff * Working on cyborg movement * Update code/modules/mob/living/silicon/robot/robot_damage.dm Co-authored-by: CRUNCH <143041327+Fordoxia@users.noreply.github.com> * Update code/modules/mob/living/silicon/robot/robot_damage.dm Co-authored-by: CRUNCH <143041327+Fordoxia@users.noreply.github.com> * Update code/modules/mob/living/silicon/robot/robot_damage.dm Co-authored-by: CRUNCH <143041327+Fordoxia@users.noreply.github.com> * IOSYS where'd you come from * begon return 0 * VTEC caps slowdown * Adjusting EMPs * Funny arm is GONE * Oh yeah regenerating stamina might be a good thing * Forgot you could uninstall vtec * icon machine broke * Cell-less borgs can enter chargers to stay powered * oh that was almost bad * Fixes some logic * its a surprise tool that will help us later * Adjusting some numbers * Adds a sound to go along with the text alarm * dead things can still charge * Another logic error * Xenos too * sorry linter * fixes CL * Slightly more slowdown on stam damage * neurotoxin won't stun * SOUNDS! * 3 flashes to stun instead of 4 * Slightly longer stun * SPEEDING UP BORGS JUST FOR THE TM SINCE CONFIG DONT WORK * Keep borgs stunned forever * Power loss is more dangerous * Adds a stamina hud to borgs * Cyborgs now heal up properly * Removes an outdated comment * Replacing parts works better now * EMPs disable components for a brief time * More missed rebalances * When you forget to remove debug messages * WHAT * Cult magic works + borgs can be silenced * 2 flashes to stun, flashes confuse now * Update code/game/objects/items/devices/flash.dm Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com> * Abductors can stun borgs * Watcher/cyro rays deal stam to brog * Fixes a rounding error when healing borgs back to full HP * Fixed span Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com> Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com> * Fixed whitespace Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com> Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com> * Guard clausify * Indents a message * Update code/modules/mob/living/silicon/robot/robot_damage.dm Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com> Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com> * Update code/modules/mob/living/silicon/robot/component.dm Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com> Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com> * Update code/modules/mob/living/silicon/robot/robot_damage.dm Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com> Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com> * that's not what stat does * No more hardcoded speed, don't TM this branch --------- Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com> Co-authored-by: CRUNCH <143041327+Fordoxia@users.noreply.github.com> Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com> Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com> Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com>
147 lines
4.0 KiB
Plaintext
147 lines
4.0 KiB
Plaintext
/mob/living/silicon/robot/Life(seconds, times_fired)
|
|
set invisibility = 0
|
|
if(notransform)
|
|
return
|
|
|
|
. = ..()
|
|
|
|
handle_equipment()
|
|
|
|
// if Alive
|
|
if(.)
|
|
handle_robot_hud_updates()
|
|
handle_robot_cell()
|
|
update_items()
|
|
|
|
|
|
/mob/living/silicon/robot/proc/handle_robot_cell()
|
|
if(stat == DEAD)
|
|
return
|
|
if(externally_powered)
|
|
return
|
|
if(low_power_mode)
|
|
handle_no_power()
|
|
else if(!is_component_functioning("power cell")) //This makes it so you'll only get the warnings once per running out of charge
|
|
enter_low_power_mode()
|
|
else if(stat == CONSCIOUS)
|
|
use_power()
|
|
|
|
/mob/living/silicon/robot/proc/use_power()
|
|
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
|
|
diag_hud_set_borgcell()
|
|
|
|
/mob/living/silicon/robot/proc/handle_no_power()
|
|
diag_hud_set_borgcell()
|
|
if(is_component_functioning("power cell"))
|
|
low_power_mode = FALSE
|
|
return
|
|
adjustStaminaLoss(3)
|
|
|
|
/mob/living/silicon/robot/proc/enter_low_power_mode()
|
|
low_power_mode = TRUE
|
|
playsound(src, "sound/mecha/lowpower.ogg", 50, FALSE, SOUND_RANGE_SET(10))
|
|
to_chat(src, "<span_class='warning'>Alert: Power cell requires immediate charging.</span>")
|
|
handle_no_power()
|
|
|
|
/mob/living/silicon/robot/proc/handle_equipment()
|
|
if(camera && !scrambledcodes)
|
|
if(stat == DEAD || wires.is_cut(WIRE_BORG_CAMERA))
|
|
camera.status = FALSE
|
|
else
|
|
camera.status = TRUE
|
|
|
|
//update the state of modules and components here
|
|
if(stat != CONSCIOUS)
|
|
uneq_all()
|
|
|
|
if(!is_component_functioning("radio") || stat == UNCONSCIOUS)
|
|
radio.on = FALSE
|
|
else
|
|
radio.on = TRUE
|
|
|
|
/mob/living/silicon/robot/proc/SetEmagged(new_state)
|
|
emagged = new_state
|
|
update_icons()
|
|
if(emagged)
|
|
throw_alert("hacked", /atom/movable/screen/alert/hacked)
|
|
else
|
|
clear_alert("hacked")
|
|
|
|
/mob/living/silicon/robot/proc/handle_robot_hud_updates()
|
|
if(!client)
|
|
return
|
|
|
|
update_cell_hud_icon()
|
|
|
|
/mob/living/silicon/robot/update_health_hud()
|
|
if(healths)
|
|
if(stat != DEAD)
|
|
if(health >= maxHealth)
|
|
healths.icon_state = "health0"
|
|
else if(health > maxHealth * 0.5)
|
|
healths.icon_state = "health2"
|
|
else if(health > 0)
|
|
healths.icon_state = "health3"
|
|
else if(health > -maxHealth * 0.5)
|
|
healths.icon_state = "health4"
|
|
else if(health > -maxHealth)
|
|
healths.icon_state = "health5"
|
|
else
|
|
healths.icon_state = "health6"
|
|
else
|
|
healths.icon_state = "health7"
|
|
|
|
/mob/living/silicon/robot/proc/update_cell_hud_icon()
|
|
if(cell)
|
|
var/cellcharge = cell.charge/cell.maxcharge
|
|
switch(cellcharge)
|
|
if(0.75 to INFINITY)
|
|
clear_alert("charge")
|
|
if(0.5 to 0.75)
|
|
throw_alert("charge", /atom/movable/screen/alert/lowcell, 1)
|
|
if(0.25 to 0.5)
|
|
throw_alert("charge", /atom/movable/screen/alert/lowcell, 2)
|
|
if(0.01 to 0.25)
|
|
throw_alert("charge", /atom/movable/screen/alert/lowcell, 3)
|
|
else
|
|
throw_alert("charge", /atom/movable/screen/alert/emptycell)
|
|
else
|
|
throw_alert("charge", /atom/movable/screen/alert/nocell)
|
|
|
|
|
|
|
|
/mob/living/silicon/robot/proc/update_items() // What in the Sam hell is this?
|
|
if(client)
|
|
for(var/obj/I in get_all_slots())
|
|
client.screen |= I
|
|
if(module_state_1)
|
|
module_state_1:screen_loc = ui_inv1
|
|
if(module_state_2)
|
|
module_state_2:screen_loc = ui_inv2
|
|
if(module_state_3)
|
|
module_state_3:screen_loc = ui_inv3
|
|
|
|
//Robots on fire
|
|
/mob/living/silicon/robot/handle_fire()
|
|
. = ..()
|
|
if(!.)
|
|
return
|
|
if(fire_stacks > 0)
|
|
fire_stacks--
|
|
fire_stacks = max(0, fire_stacks)
|
|
else
|
|
ExtinguishMob()
|
|
|
|
|
|
/mob/living/silicon/robot/update_fire()
|
|
overlays -= image("icon"='icons/mob/OnFire.dmi', "icon_state"="Generic_mob_burning")
|
|
if(on_fire)
|
|
overlays += image("icon"='icons/mob/OnFire.dmi', "icon_state"="Generic_mob_burning")
|
|
|
|
/mob/living/silicon/robot/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume, global_overlay = TRUE)
|
|
if(!on_fire) //Silicons don't gain stacks from hotspots, but hotspots can ignite them
|
|
IgniteMob()
|
|
|
|
//Robots on fire
|