mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Fixes glasses toggling
This commit is contained in:
@@ -20,8 +20,14 @@
|
||||
|
||||
#define INVISIBILITY_ABSTRACT 101 //only used for abstract objects (e.g. spacevine_controller), things that are not really there.
|
||||
|
||||
|
||||
#define BORGMESON 1
|
||||
#define BORGTHERM 2
|
||||
#define BORGXRAY 4
|
||||
#define BORGMATERIAL 8
|
||||
|
||||
//for clothing visor toggles, these determine which vars to toggle
|
||||
#define VISOR_FLASHPROTECT 1
|
||||
#define VISOR_TINT 2
|
||||
#define VISOR_VISIONFLAGS 4 //all following flags only matter for glasses
|
||||
#define VISOR_DARKNESSVIEW 8
|
||||
#define VISOR_INVISVIEW 16
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
item_state = "glasses"
|
||||
actions_types = list(/datum/action/item_action/toggle)
|
||||
resistance_flags = FIRE_PROOF | ACID_PROOF
|
||||
vision_flags = SEE_MOBS | SEE_TURFS | SEE_OBJS
|
||||
invis_view = SEE_INVISIBLE_NOLIGHTING
|
||||
darkness_view = 3
|
||||
flags_cover = GLASSESCOVERSEYES
|
||||
visor_flags_inv = HIDEEYES
|
||||
visor_vars_to_toggle = NONE //we don't actually toggle anything we just set it
|
||||
tint = 3 //this'll get reset, but it won't handle vision updates properly otherwise
|
||||
|
||||
/obj/item/clothing/glasses/wraith_spectacles/New()
|
||||
@@ -59,13 +59,15 @@
|
||||
/obj/item/clothing/glasses/wraith_spectacles/proc/set_vision_vars(update_vision)
|
||||
invis_view = SEE_INVISIBLE_LIVING
|
||||
tint = 0
|
||||
vision_flags = NONE
|
||||
darkness_view = 2
|
||||
if(!up)
|
||||
if(is_servant_of_ratvar(loc))
|
||||
invis_view = SEE_INVISIBLE_NOLIGHTING
|
||||
vision_flags = SEE_MOBS | SEE_TURFS | SEE_OBJS
|
||||
darkness_view = 3
|
||||
else
|
||||
tint = 3
|
||||
vision_flags = NONE
|
||||
if(update_vision && iscarbon(loc))
|
||||
var/mob/living/carbon/C = loc
|
||||
C.head_update(src, forced = 1)
|
||||
|
||||
@@ -5,12 +5,14 @@
|
||||
max_integrity = 200
|
||||
integrity_failure = 80
|
||||
var/damaged_clothes = 0 //similar to machine's BROKEN stat and structure's broken var
|
||||
var/flash_protect = 0 //Malk: What level of bright light protection item has. 1 = Flashers, Flashes, & Flashbangs | 2 = Welding | -1 = OH GOD WELDING BURNT OUT MY RETINAS
|
||||
var/tint = 0 //Malk: Sets the item's level of visual impairment tint, normally set to the same as flash_protect
|
||||
var/up = 0 // but seperated to allow items to protect but not impair vision, like space helmets
|
||||
var/visor_flags = 0 // flags that are added/removed when an item is adjusted up/down
|
||||
var/visor_flags_inv = 0 // same as visor_flags, but for flags_inv
|
||||
var/visor_flags_cover = 0 // same as above, but for flags_cover
|
||||
var/flash_protect = 0 //What level of bright light protection item has. 1 = Flashers, Flashes, & Flashbangs | 2 = Welding | -1 = OH GOD WELDING BURNT OUT MY RETINAS
|
||||
var/tint = 0 //Sets the item's level of visual impairment tint, normally set to the same as flash_protect
|
||||
var/up = 0 //but seperated to allow items to protect but not impair vision, like space helmets
|
||||
var/visor_flags = 0 //flags that are added/removed when an item is adjusted up/down
|
||||
var/visor_flags_inv = 0 //same as visor_flags, but for flags_inv
|
||||
var/visor_flags_cover = 0 //same as above, but for flags_cover
|
||||
//what to toggle when toggled with weldingvisortoggle()
|
||||
var/visor_vars_to_toggle = VISOR_FLASHPROTECT | VISOR_TINT | VISOR_VISIONFLAGS | VISOR_DARKNESSVIEW | VISOR_INVISVIEW
|
||||
lefthand_file = 'icons/mob/inhands/clothing_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/clothing_righthand.dmi'
|
||||
var/alt_desc = null
|
||||
@@ -717,8 +719,10 @@ BLIND // can't see anything
|
||||
flags_inv ^= visor_flags_inv
|
||||
flags_cover ^= initial(flags_cover)
|
||||
icon_state = "[initial(icon_state)][up ? "up" : ""]"
|
||||
flash_protect ^= initial(flash_protect)
|
||||
tint ^= initial(tint)
|
||||
if(visor_vars_to_toggle & VISOR_FLASHPROTECT)
|
||||
flash_protect ^= initial(flash_protect)
|
||||
if(visor_vars_to_toggle & VISOR_TINT)
|
||||
tint ^= initial(tint)
|
||||
|
||||
|
||||
/obj/item/clothing/proc/can_use(mob/user)
|
||||
|
||||
@@ -5,9 +5,12 @@
|
||||
|
||||
/obj/item/clothing/glasses/visor_toggling()
|
||||
..()
|
||||
vision_flags ^= initial(vision_flags)
|
||||
darkness_view ^= initial(darkness_view)
|
||||
invis_view ^= initial(invis_view)
|
||||
if(visor_vars_to_toggle & VISOR_VISIONFLAGS)
|
||||
vision_flags ^= initial(vision_flags)
|
||||
if(visor_vars_to_toggle & VISOR_DARKNESSVIEW)
|
||||
darkness_view ^= initial(darkness_view)
|
||||
if(visor_vars_to_toggle & VISOR_INVISVIEW)
|
||||
invis_view ^= initial(invis_view)
|
||||
|
||||
/obj/item/clothing/glasses/weldingvisortoggle(mob/user)
|
||||
. = ..()
|
||||
@@ -209,6 +212,7 @@
|
||||
materials = list(MAT_METAL = 250)
|
||||
flash_protect = 2
|
||||
tint = 2
|
||||
visor_vars_to_toggle = VISOR_FLASHPROTECT | VISOR_TINT
|
||||
flags_cover = GLASSESCOVERSEYES
|
||||
visor_flags_inv = HIDEEYES
|
||||
glass_colour_type = /datum/client_colour/glass_colour/gray
|
||||
@@ -222,7 +226,6 @@
|
||||
desc = "Covers the eyes, preventing sight."
|
||||
icon_state = "blindfold"
|
||||
item_state = "blindfold"
|
||||
// vision_flags = BLIND
|
||||
flash_protect = 2
|
||||
tint = 3 // to make them blind
|
||||
|
||||
|
||||
@@ -129,6 +129,7 @@
|
||||
var/obj/item/clothing/C = I
|
||||
if(C.tint || initial(C.tint))
|
||||
update_tint()
|
||||
update_sight()
|
||||
if(I.flags_inv & HIDEMASK || forced)
|
||||
update_inv_wear_mask()
|
||||
update_inv_head()
|
||||
|
||||
Reference in New Issue
Block a user