Fixes #7185, works on #7184

This commit is contained in:
Zuhayr
2014-12-01 23:55:03 +10:30
parent a1a66870ca
commit 8240f14176
3 changed files with 44 additions and 27 deletions
+25 -16
View File
@@ -255,17 +255,36 @@ BLIND // can't see anything
/obj/item/clothing/head/attack_self(mob/user)
if(brightness_on)
if(!isturf(user.loc))
user << "You cannot turn the light on while in this [user.loc]" //To prevent some lighting anomalities.
user << "You cannot turn the light on while in this [user.loc]"
return
on = !on
update_icon()
if(on)
user.SetLuminosity(user.luminosity + brightness_on)
else
user.SetLuminosity(user.luminosity - brightness_on)
update_light(user)
else
return ..(user)
/obj/item/clothing/head/proc/update_light(var/mob/user = null)
if(on)
if(loc == user)
user.SetLuminosity(user.luminosity + brightness_on)
else if(isturf(loc))
SetLuminosity(brightness_on)
else
if(loc == user)
user.SetLuminosity(user.luminosity - brightness_on)
else if(isturf(loc))
SetLuminosity(0)
update_icon()
/obj/item/clothing/head/pickup(mob/user)
if(on)
user.SetLuminosity(user.luminosity + brightness_on)
SetLuminosity(0)
/obj/item/clothing/head/dropped(mob/user)
if(on)
user.SetLuminosity(user.luminosity - brightness_on)
SetLuminosity(brightness_on)
/obj/item/clothing/head/update_icon(var/mob/user)
overlays.Cut()
@@ -279,16 +298,6 @@ BLIND // can't see anything
var/mob/living/carbon/human/H = user
H.update_inv_head()
/obj/item/clothing/head/proc/update_light(mob/user)
if(!brightness_on)
return
if(on)
if(light_overlay) overlays |= light_overlay
user.SetLuminosity(user.luminosity - brightness_on)
SetLuminosity(brightness_on)
/obj/item/clothing/head/equipped(mob/user)
..()
update_light(user)
+17 -10
View File
@@ -69,6 +69,7 @@
var/offline_slowdown = 10 // If the suit is deployed and unpowered, it sets slowdown to this.
var/vision_restriction
var/offline_vision_restriction = 1 // 0 - none, 1 - welder vision, 2 - blind. Maybe move this to helmets.
var/list/suit_can_hold
// Wiring! How exciting.
var/datum/wires/rig/wires
@@ -122,6 +123,10 @@
verbs |= /obj/item/weapon/rig/proc/toggle_boots
if(chest_type)
chest = new chest_type(src)
if(suit_can_hold)
chest.allowed = suit_can_hold
else
chest.allowed = list()
verbs |= /obj/item/weapon/rig/proc/toggle_chest
for(var/obj/item/piece in list(gloves,helmet,boots,chest))
@@ -235,15 +240,17 @@
if("helmet")
M << "<font color='blue'>\The [piece] hisses [!seal_target ? "closed" : "open"].</font>"
M.update_inv_head()
if(!seal_target)
if(flags & AIRTIGHT)
helmet.flags |= AIRTIGHT
helmet.flags_inv |= (HIDEEYES|HIDEFACE)
helmet.body_parts_covered |= (FACE|EYES)
else
helmet.flags &= ~AIRTIGHT
helmet.flags_inv &= ~(HIDEEYES|HIDEFACE)
helmet.body_parts_covered &= ~(FACE|EYES)
if(helmet)
if(!seal_target)
if(flags & AIRTIGHT)
helmet.flags |= AIRTIGHT
helmet.flags_inv |= (HIDEEYES|HIDEFACE)
helmet.body_parts_covered |= (FACE|EYES)
else
helmet.flags &= ~AIRTIGHT
helmet.flags_inv &= ~(HIDEEYES|HIDEFACE)
helmet.body_parts_covered &= ~(FACE|EYES)
helmet.update_light(wearer)
else
failed_to_seal = 1
@@ -480,7 +487,7 @@
if((istype(H) && H.back == src) || (istype(H,/mob/living/silicon)))
if(istype(H,/mob/living/silicon))
if(!control_overridden)
if(!ai_override_enabled)
usr << "<span class='danger'>Synthetic access disabled. Please consult hardware provider.</span>"
return
else if(security_check_enabled && !src.allowed(usr))
+2 -1
View File
@@ -1245,7 +1245,8 @@
if(copytext(hud.icon_state,1,4) == "hud") //ugly, but icon comparison is worse, I believe
client.images.Remove(hud)
client.screen -= global_huds
for(var/hud in global_huds)
client.screen.Remove(hud)
update_action_buttons()