Misc tweaks & fixes (#2572)

changes:

Minor performance tweaks & light fixes to wall shield generators.
Added more subsystem targets to the subsystem panic verb.
Speculative fix for #2532.
Fix non-human voidsuit helmets not having a light overlay on the on-mob sprite.
This commit is contained in:
Lohikar
2017-06-02 16:56:22 +03:00
committed by skull132
parent ebaffcfaf5
commit 0038ff84f6
6 changed files with 48 additions and 52 deletions
-2
View File
@@ -354,8 +354,6 @@ BLIND // can't see anything
var/cache_key = "[light_overlay][H ? "_[H.species.get_bodytype()]" : ""]"
if(!SSicon_cache.light_overlay_cache[cache_key])
var/use_icon = 'icons/mob/light_overlays.dmi'
if(H && sprite_sheets && sprite_sheets[H.species.get_bodytype()])
use_icon = sprite_sheets[H.species.get_bodytype()]
SSicon_cache.light_overlay_cache[cache_key] = image("icon" = use_icon, "icon_state" = "[light_overlay]")
if(H)
+5 -3
View File
@@ -273,21 +273,23 @@
emp_act(severity)
if(istype(src.loc, /mob/living/carbon/human))
var/mob/living/carbon/human/M = src.loc
M << "<span class='danger'>The Optical Thermal Scanner overloads and blinds you!</span>"
M << "<span class='danger'>\The [src] overloads and blinds you!</span>"
if(M.glasses == src)
M.eye_blind = 3
M.eye_blurry = 5
// Don't cure being nearsighted
if(!(M.disabilities & NEARSIGHTED))
M.disabilities |= NEARSIGHTED
spawn(100)
M.disabilities &= ~NEARSIGHTED
addtimer(CALLBACK(M, /mob/living/carbon/human/.proc/thermal_reset_blindness), 100)
..()
/obj/item/clothing/glasses/thermal/Initialize()
. = ..()
overlay = global_hud.thermal
/mob/living/carbon/human/proc/thermal_reset_blindness()
disabilities &= ~NEARSIGHTED
/obj/item/clothing/glasses/thermal/syndi //These are now a traitor item, concealed as mesons. -Pete
name = "optical meson scanner"
desc = "Used for seeing walls, floors, and stuff through anything."
+8 -7
View File
@@ -77,7 +77,7 @@ var/list/possible_cable_coil_colours = list(
/obj/structure/cable/white
color = COLOR_WHITE
/obj/structure/cable/New()
/obj/structure/cable/Initialize()
. = ..()
// ensure d1 & d2 reflect the icon_state for entering and exiting cable
@@ -89,9 +89,10 @@ var/list/possible_cable_coil_colours = list(
d2 = text2num( copytext( icon_state, dash+1 ) )
var/turf/T = src.loc // hide if turf is not intact
if(level==1) hide(!T.is_plating())
SSpower.all_cables += src //add it to the global cable list
if(level == 1)
hide(!T.is_plating())
SSpower.all_cables += src //add it to the global cable list
/obj/structure/cable/Destroy() // called when a cable is deleted
if(powernet)
@@ -855,8 +856,8 @@ obj/structure/cable/proc/cableColor(var/colorC)
/obj/item/stack/cable_coil/cut
item_state = "coil2"
/obj/item/stack/cable_coil/cut/New(loc)
..()
/obj/item/stack/cable_coil/cut/Initialize(mapload)
. = ..()
src.amount = rand(1,2)
pixel_x = rand(-2,2)
pixel_y = rand(-2,2)
@@ -884,9 +885,9 @@ obj/structure/cable/proc/cableColor(var/colorC)
/obj/item/stack/cable_coil/white
color = COLOR_WHITE
/obj/item/stack/cable_coil/random/New()
/obj/item/stack/cable_coil/random/Initialize()
color = pick(COLOR_RED, COLOR_BLUE, COLOR_LIME, COLOR_WHITE, COLOR_PINK, COLOR_YELLOW, COLOR_CYAN)
..()
. = ..()
//nooses - all catbeast/ligger/squiggers/synths must hang
@@ -373,7 +373,7 @@
if (!isturf(T))
return 0
if ((locate(/obj/machinery/containment_field) in T) || (locate(/obj/machinery/shieldwall) in T))
if ((locate(/obj/machinery/containment_field) in T) || (locate(/obj/shieldwall) in T))
return 0
else if (locate(/obj/machinery/field_generator) in T)
var/obj/machinery/field_generator/G = locate(/obj/machinery/field_generator) in T
+31 -38
View File
@@ -95,14 +95,10 @@
if(!src.state == 1)
src.active = 0
return
spawn(1)
setup_field(1)
spawn(2)
setup_field(2)
spawn(3)
setup_field(4)
spawn(4)
setup_field(8)
addtimer(CALLBACK(src, .proc/setup_field, 1), 1)
addtimer(CALLBACK(src, .proc/setup_field, 2), 2)
addtimer(CALLBACK(src, .proc/setup_field, 3), 4)
addtimer(CALLBACK(src, .proc/setup_field, 4), 8)
src.active = 2
if(src.active >= 1)
if(src.power == 0)
@@ -110,7 +106,8 @@
"You hear heavy droning fade out")
icon_state = "Shield_Gen"
src.active = 0
for(var/dir in list(1,2,4,8)) src.cleanup(dir)
for(var/dir in list(1,2,4,8))
cleanup(dir)
/obj/machinery/shieldwallgen/proc/setup_field(var/NSEW = 0)
var/turf/T = src.loc
@@ -152,8 +149,7 @@
var/field_dir = get_dir(T2,get_step(T2, NSEW))
T = get_step(T2, NSEW)
T2 = T
var/obj/machinery/shieldwall/CF = new/obj/machinery/shieldwall/(src, G) //(ref to this gen, ref to connected gen)
CF.loc = T
var/obj/shieldwall/CF = new/obj/shieldwall/(T, src, G) //(ref to this gen, ref to connected gen)
CF.set_dir(field_dir)
@@ -189,7 +185,7 @@
visible_message("<span class='warning'>The [src.name] has been hit with \the [W.name] by [user.name]!</span>")
/obj/machinery/shieldwallgen/proc/cleanup(var/NSEW)
var/obj/machinery/shieldwall/F
var/obj/shieldwall/F
var/obj/machinery/shieldwallgen/G
var/turf/T = src.loc
var/turf/T2 = src.loc
@@ -197,8 +193,8 @@
for(var/dist = 0, dist <= 9, dist += 1) // checks out to 8 tiles away for fields
T = get_step(T2, NSEW)
T2 = T
if(locate(/obj/machinery/shieldwall) in T)
F = (locate(/obj/machinery/shieldwall) in T)
if(locate(/obj/shieldwall) in T)
F = (locate(/obj/shieldwall) in T)
qdel(F)
if(locate(/obj/machinery/shieldwallgen) in T)
@@ -220,8 +216,8 @@
//////////////Containment Field START
/obj/machinery/shieldwall
name = "Shield"
/obj/shieldwall
name = "shield"
desc = "An energy shield."
icon = 'icons/effects/effects.dmi'
icon_state = "shieldwall"
@@ -229,6 +225,7 @@
density = 1
unacidable = 1
light_range = 3
light_color = LIGHT_COLOR_BLUE
var/needs_power = 0
var/active = 1
// var/power = 10
@@ -240,45 +237,41 @@
var/power_usage = 2500 //how much power it takes to sustain the shield
var/generate_power_usage = 7500 //how much power it takes to start up the shield
/obj/machinery/shieldwall/New(var/obj/machinery/shieldwallgen/A, var/obj/machinery/shieldwallgen/B)
..()
/obj/shieldwall/Initialize(mapload, var/obj/machinery/shieldwallgen/A, var/obj/machinery/shieldwallgen/B)
. = ..()
update_nearby_tiles()
src.gen_primary = A
src.gen_secondary = B
gen_primary = A
gen_secondary = B
if(A && B && A.active && B.active)
needs_power = 1
if(prob(50))
A.storedpower -= generate_power_usage
else
B.storedpower -= generate_power_usage
A.storedpower -= generate_power_usage/2
B.storedpower -= generate_power_usage/2
START_PROCESSING(SSprocessing, src)
else
qdel(src) //need at least two generator posts
/obj/machinery/shieldwall/Destroy()
/obj/shieldwall/Destroy()
update_nearby_tiles()
STOP_PROCESSING(SSprocessing, src)
return ..()
/obj/machinery/shieldwall/attack_hand(mob/user as mob)
/obj/shieldwall/attack_hand(mob/user as mob)
return
/obj/machinery/shieldwall/process()
/obj/shieldwall/process()
if(needs_power)
if(isnull(gen_primary)||isnull(gen_secondary))
if(!gen_primary || !gen_secondary)
qdel(src)
return
if(!(gen_primary.active)||!(gen_secondary.active))
if(!(gen_primary.active) || !(gen_secondary.active))
qdel(src)
return
if(prob(50))
gen_primary.storedpower -= power_usage
else
gen_secondary.storedpower -= power_usage
gen_primary.storedpower -= power_usage/2
gen_secondary.storedpower -= power_usage/2
/obj/machinery/shieldwall/bullet_act(var/obj/item/projectile/Proj)
/obj/shieldwall/bullet_act(var/obj/item/projectile/Proj)
if(needs_power)
var/obj/machinery/shieldwallgen/G
if(prob(50))
@@ -290,7 +283,7 @@
return
/obj/machinery/shieldwall/ex_act(severity)
/obj/shieldwall/ex_act(severity)
if(needs_power)
var/obj/machinery/shieldwallgen/G
switch(severity)
@@ -317,7 +310,7 @@
return
/obj/machinery/shieldwall/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
/obj/shieldwall/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(air_group || (height==0)) return 1
if(istype(mover) && mover.checkpass(PASSGLASS))