mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 02:34:00 +00:00
@@ -33,9 +33,7 @@
|
||||
ui.open()
|
||||
ui.set_auto_update(1)
|
||||
|
||||
// Proc: refresh_sensors()
|
||||
// Parameters: None
|
||||
// Description: Refreshes list of active sensors kept on this computer.
|
||||
// Refreshes list of active sensors kept on this computer.
|
||||
/obj/nano_module/power_monitor/proc/refresh_sensors()
|
||||
grid_sensors = list()
|
||||
var/turf/T = get_turf(src)
|
||||
@@ -46,9 +44,7 @@
|
||||
else
|
||||
grid_sensors += S
|
||||
|
||||
// Proc: Topic()
|
||||
// Parameters: 2 (href, href_list - allows us to process UI clicks)
|
||||
// Description: Allows us to process UI clicks, which are relayed in form of hrefs.
|
||||
// Allows us to process UI clicks, which are relayed in form of hrefs.
|
||||
/obj/nano_module/power_monitor/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
@@ -210,6 +210,7 @@
|
||||
|
||||
// sync the organ's damage with its wounds
|
||||
src.update_damages()
|
||||
owner.updatehealth() //droplimb will call updatehealth() again if it does end up being called
|
||||
|
||||
//If limb took enough damage, try to cut or tear it off
|
||||
if(owner && loc == owner)
|
||||
@@ -232,7 +233,6 @@
|
||||
else
|
||||
droplimb(0,DROPLIMB_BLUNT)
|
||||
|
||||
owner.updatehealth()
|
||||
return update_icon()
|
||||
|
||||
/obj/item/organ/external/proc/heal_damage(brute, burn, internal = 0, robo_repair = 0)
|
||||
@@ -689,9 +689,9 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
if(src && istype(loc,/turf))
|
||||
throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),30)
|
||||
dir = 2
|
||||
return
|
||||
if(DROPLIMB_BURN)
|
||||
new /obj/effect/decal/cleanable/ash(get_turf(victim))
|
||||
qdel(src)
|
||||
if(DROPLIMB_BLUNT)
|
||||
var/obj/effect/decal/cleanable/blood/gibs/gore = new owner.species.single_gib_type(get_turf(victim))
|
||||
if(victim.species.flesh_color)
|
||||
@@ -705,8 +705,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
I.removed()
|
||||
if(istype(loc,/turf))
|
||||
I.throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),30)
|
||||
|
||||
qdel(src)
|
||||
qdel(src)
|
||||
|
||||
/****************************************************
|
||||
HELPERS
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
// POWERNET SENSOR MONITORING CONSOLE
|
||||
//
|
||||
// Last Change 31.12.2014 by Atlantis
|
||||
//
|
||||
// Connects to powernet sensors and loads data from them. Shows this data to the user.
|
||||
// Newly supports NanoUI.
|
||||
|
||||
@@ -22,18 +19,14 @@
|
||||
active_power_usage = 300
|
||||
var/obj/nano_module/power_monitor/power_monitor
|
||||
|
||||
// Proc: process()
|
||||
// Parameters: None
|
||||
// Description: Checks the sensors for alerts. If change (alerts cleared or detected) occurs, calls for icon update.
|
||||
// Checks the sensors for alerts. If change (alerts cleared or detected) occurs, calls for icon update.
|
||||
/obj/machinery/computer/power_monitor/process()
|
||||
var/alert = check_warnings()
|
||||
if(alert != alerting)
|
||||
alerting = !alerting
|
||||
update_icon()
|
||||
|
||||
// Proc: update_icon()
|
||||
// Parameters: None
|
||||
// Description: Updates icon of this computer according to current status.
|
||||
// Updates icon of this computer according to current status.
|
||||
/obj/machinery/computer/power_monitor/update_icon()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "powerb"
|
||||
@@ -46,17 +39,12 @@
|
||||
return
|
||||
icon_state = "power"
|
||||
|
||||
// Proc: New()
|
||||
// Parameters: None
|
||||
// Description: On creation automatically connects to active sensors. This is delayed to ensure sensors already exist.
|
||||
// On creation automatically connects to active sensors. This is delayed to ensure sensors already exist.
|
||||
/obj/machinery/computer/power_monitor/New()
|
||||
..()
|
||||
spawn(50)
|
||||
power_monitor = new(src)
|
||||
power_monitor = new(src)
|
||||
|
||||
// Proc: attack_hand()
|
||||
// Parameters: None
|
||||
// Description: On user click opens the UI of this computer.
|
||||
// On user click opens the UI of this computer.
|
||||
/obj/machinery/computer/power_monitor/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
|
||||
@@ -64,16 +52,12 @@
|
||||
return
|
||||
ui_interact(user)
|
||||
|
||||
// Proc: ui_interact()
|
||||
// Parameters: 4 (standard NanoUI parameters)
|
||||
// Description: Uses dark magic to operate the NanoUI of this computer.
|
||||
// Uses dark magic to operate the NanoUI of this computer.
|
||||
/obj/machinery/computer/power_monitor/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
power_monitor.ui_interact(user, ui_key, ui, force_open)
|
||||
|
||||
|
||||
// Proc: check_warnings()
|
||||
// Parameters: None
|
||||
// Description: Verifies if any warnings were registered by connected sensors.
|
||||
// Verifies if any warnings were registered by connected sensors.
|
||||
/obj/machinery/computer/power_monitor/proc/check_warnings()
|
||||
for(var/obj/machinery/power/sensor/S in power_monitor.grid_sensors)
|
||||
if(S.check_grid_warning())
|
||||
|
||||
@@ -278,6 +278,7 @@
|
||||
if(kill_count-- < 1)
|
||||
on_impact(src.loc) //for any final impact behaviours
|
||||
qdel(src)
|
||||
return
|
||||
if((!( current ) || loc == current))
|
||||
current = locate(min(max(x + xo, 1), world.maxx), min(max(y + yo, 1), world.maxy), z)
|
||||
if((x == 1 || x == world.maxx || y == 1 || y == world.maxy))
|
||||
@@ -289,6 +290,7 @@
|
||||
|
||||
if(!location)
|
||||
qdel(src) // if it's left the world... kill it
|
||||
return
|
||||
|
||||
before_move()
|
||||
Move(location.return_turf())
|
||||
|
||||
Reference in New Issue
Block a user