Skip to content

Commit

Permalink
Yautja Vision
Browse files Browse the repository at this point in the history
  • Loading branch information
realforest2001 committed Jul 29, 2023
1 parent 2cff80d commit a3a365f
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 67 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/lighting.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#define LIGHTING_PLANE_ALPHA_VISIBLE 255
///The dim natural vision of Yautja
#define LIGHTING_PLANE_ALPHA_YAUTJA 235
#define LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE 127
#define LIGHTING_PLANE_ALPHA_INVISIBLE 0
13 changes: 0 additions & 13 deletions code/modules/clothing/glasses/meson.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,6 @@
desc = "Used for shield the user's eyes from harmful electromagnetic emissions, can also be used as safety googles. Contains prescription lenses."
prescription = TRUE

/obj/item/clothing/glasses/meson/yautja
name = "bio-mask x-ray"
desc = "A vision overlay generated by the Bio-Mask. Used to see through objects."
icon = 'icons/obj/items/hunter/pred_gear.dmi'
icon_state = "visor_meson"
item_state = "securityhud"
darkness_view = 12
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
vision_flags = SEE_TURFS
flags_inventory = COVEREYES
flags_item = NODROP|DELONDROP
actions_types = null

/obj/item/clothing/glasses/meson/refurbished
name = "refurbished meson scanner"
desc = "Used to shield the user's eyes from harmful electromagnetic emissions, also used as general safety goggles. A special version with upgraded optics."
Expand Down
12 changes: 0 additions & 12 deletions code/modules/clothing/glasses/thermal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,6 @@
item_state = "syringe_kit"
toggleable = FALSE

/obj/item/clothing/glasses/thermal/yautja
name = "bio-mask thermal"
desc = "A vision overlay generated by the Bio-Mask. Used to sense the heat of prey."
icon = 'icons/obj/items/hunter/pred_gear.dmi'
icon_state = "visor_thermal"
item_state = "securityhud"
vision_flags = SEE_MOBS
invisa_view = 2
flags_inventory = COVEREYES
flags_item = NODROP|DELONDROP
toggleable = FALSE

/obj/item/clothing/glasses/thermal/empproof
desc = "Thermals in the shape of glasses. This one is EMP proof."
blinds_on_emp = FALSE
81 changes: 39 additions & 42 deletions code/modules/cm_preds/yaut_mask.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#define VISION_MODE_OFF 0
#define VISION_MODE_NVG 1
#define VISION_MODE_THERMAL 2
#define VISION_MODE_MESON 3

///parent type
/obj/item/clothing/mask/gas/yautja
Expand Down Expand Up @@ -65,8 +63,33 @@

/obj/item/clothing/mask/gas/yautja/Destroy()
remove_from_missing_pred_gear(src)
STOP_PROCESSING(SSobj, src)
return ..()

/obj/item/clothing/mask/gas/yautja/process()
if(!ishuman(loc))
STOP_PROCESSING(SSobj, src)
return
var/mob/living/carbon/human/human_holder = loc

if(current_goggles && !drain_power(human_holder, 5))
to_chat(human_holder, SPAN_WARNING("Your bracers lack sufficient power to operate the visior."))
current_goggles = VISION_MODE_OFF
var/obj/item/visor = human_holder.glasses
if(istype(visor,/obj/item/clothing/glasses/night/yautja))//To change if any new vision modes are made
human_holder.temp_drop_inv_item(visor)
qdel(visor)
human_holder.update_inv_glasses()
human_holder.update_sight()

/obj/item/clothing/mask/gas/yautja/proc/drain_power(mob/living/carbon/human/human_holder, drain_amount)
var/obj/item/clothing/gloves/yautja/bracer = human_holder.gloves
if(!bracer || !istype(bracer))
return FALSE
if(!(bracer.drain_power(human_holder, drain_amount)))
return FALSE
return TRUE

/obj/item/clothing/mask/gas/yautja/verb/toggle_zoom()
set name = "Toggle Mask Zoom"
set desc = "Toggle your mask's zoom function."
Expand Down Expand Up @@ -97,7 +120,7 @@
return
var/obj/item/G = M.glasses
if(G)
if(!istype(G,/obj/item/clothing/glasses/night/yautja) && !istype(G,/obj/item/clothing/glasses/meson/yautja) && !istype(G,/obj/item/clothing/glasses/thermal/yautja))
if(!istype(G,/obj/item/clothing/glasses/night/yautja))
to_chat(M, SPAN_WARNING("You need to remove your glasses first. Why are you even wearing these?"))
return
M.temp_drop_inv_item(G) //Get rid of ye existing maicerinho goggles
Expand All @@ -112,49 +135,47 @@
if(VISION_MODE_OFF)
current_goggles = VISION_MODE_NVG
if(VISION_MODE_NVG)
current_goggles = VISION_MODE_THERMAL
if(VISION_MODE_THERMAL)
current_goggles = VISION_MODE_MESON
if(VISION_MODE_MESON)
current_goggles = VISION_MODE_OFF

/obj/item/clothing/mask/gas/yautja/proc/add_vision(mob/living/carbon/human/user) //applies current_goggles
switch(current_goggles)
if(VISION_MODE_NVG)
user.equip_to_slot_or_del(new /obj/item/clothing/glasses/night/yautja(user), WEAR_EYES)
to_chat(user, SPAN_NOTICE("Low-light vision module: activated."))
if(VISION_MODE_THERMAL)
user.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/yautja(user), WEAR_EYES)
to_chat(user, SPAN_NOTICE("Thermal vision module: activated."))
if(VISION_MODE_MESON)
user.equip_to_slot_or_del(new /obj/item/clothing/glasses/meson/yautja(user), WEAR_EYES)
to_chat(user, SPAN_NOTICE("Material vision module: activated."))
if(VISION_MODE_OFF)
to_chat(user, SPAN_NOTICE("You deactivate your visor."))

playsound(src, 'sound/effects/pred_vision.ogg', 15, 1)
user.update_inv_glasses()

#undef VISION_MODE_OFF
#undef VISION_MODE_NVG

/obj/item/clothing/mask/gas/yautja/dropped(mob/living/carbon/human/user) //Clear the gogglors if the helmet is removed.
STOP_PROCESSING(SSobj, src)
if(istype(user) && user.wear_mask == src) //inventory reference is only cleared after dropped().
for(var/listed_hud in mask_huds)
var/datum/mob_hud/H = huds[listed_hud]
H.remove_hud_from(user)
var/obj/item/G = user.glasses
if(G) //make your hud fuck off
if(istype(G,/obj/item/clothing/glasses/night/yautja) || istype(G,/obj/item/clothing/glasses/meson/yautja) || istype(G,/obj/item/clothing/glasses/thermal/yautja))
user.temp_drop_inv_item(G)
qdel(G)
var/obj/item/visor = user.glasses
if(visor) //make your hud fuck off
if(istype(visor,/obj/item/clothing/glasses/night/yautja))
user.temp_drop_inv_item(visor)
qdel(visor)
user.update_inv_glasses()
user.update_sight()
..()

/obj/item/clothing/mask/gas/yautja/equipped(mob/living/carbon/human/user, slot)
if(slot == WEAR_FACE)
START_PROCESSING(SSobj, src)
for(var/listed_hud in mask_huds)
var/datum/mob_hud/H = huds[listed_hud]
H.add_hud_to(user)
if(current_goggles)
var/obj/item/clothing/gloves/yautja/bracer = user.gloves
if(!bracer || !istype(bracer))
return FALSE
add_vision(user)
..()

Expand Down Expand Up @@ -205,30 +226,6 @@
name = "ancient alien mask"
desc = "A beautifully designed metallic face mask, both ornate and functional. This one seems to be old and degraded."

/obj/item/clothing/mask/gas/yautja/damaged/switch_vision_mode()
switch(current_goggles)
if(VISION_MODE_OFF)
current_goggles = VISION_MODE_NVG
if(VISION_MODE_NVG)
current_goggles = VISION_MODE_OFF

/obj/item/clothing/mask/gas/yautja/damaged/add_vision(mob/living/carbon/human/user)
switch(current_goggles)
if(VISION_MODE_NVG)
user.equip_to_slot_or_del(new /obj/item/clothing/glasses/night/yautja(user), WEAR_EYES)
to_chat(user, SPAN_NOTICE("You activate your visor."))
if(VISION_MODE_OFF)
to_chat(user, SPAN_NOTICE("You deactivate your visor."))

playsound(src, 'sound/effects/pred_vision.ogg', 15, 1)
user.update_inv_glasses()

#undef VISION_MODE_OFF
#undef VISION_MODE_NVG
#undef VISION_MODE_THERMAL
#undef VISION_MODE_MESON


//flavor, not a subtype
/obj/item/clothing/mask/yautja_flavor
name = "alien stone mask"
Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1387,6 +1387,7 @@
lighting_alpha = default_lighting_alpha
sight &= ~(SEE_TURFS|SEE_MOBS|SEE_OBJS)
see_in_dark = species.darksight
sight |= species.flags_sight
if(glasses)
process_glasses(glasses)

Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/living/carbon/human/species/species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@

var/darksight = 2
var/default_lighting_alpha = LIGHTING_PLANE_ALPHA_VISIBLE
var/flags_sight = 0

var/brute_mod = null // Physical damage reduction/malus.
var/burn_mod = null // Burn damage reduction/malus.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
speech_chance = 100
death_message = "clicks in agony and falls still, motionless and completely lifeless..."
darksight = 5
default_lighting_alpha = LIGHTING_PLANE_ALPHA_YAUTJA
flags_sight = SEE_MOBS
slowdown = -0.5
total_health = 175 //more health than regular humans
timed_hug = FALSE
Expand Down

0 comments on commit a3a365f

Please sign in to comment.