Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yautja Vision Changes #4046

Merged
merged 8 commits into from
Aug 12, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
114 changes: 55 additions & 59 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,32 @@

/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))
return PROCESS_KILL
var/mob/living/carbon/human/human_holder = loc

if(current_goggles && !drain_power(human_holder, 3))
to_chat(human_holder, SPAN_WARNING("Your bracers lack sufficient power to operate the visior."))
BeagleGaming1 marked this conversation as resolved.
Show resolved Hide resolved
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 All @@ -82,79 +104,77 @@
set src in usr
if(!usr || usr.stat)
return
var/mob/living/carbon/human/M = usr
if(!istype(M))
var/mob/living/carbon/human/user = usr
if(!istype(user))
return
if(!HAS_TRAIT(M, TRAIT_YAUTJA_TECH) && !M.hunter_data.thralled)
to_chat(M, SPAN_WARNING("You have no idea how to work this thing!"))
if(!HAS_TRAIT(user, TRAIT_YAUTJA_TECH) && !user.hunter_data.thralled)
to_chat(user, SPAN_WARNING("You have no idea how to work this thing!"))
return
if(src != M.wear_mask) //sanity
to_chat(M, SPAN_WARNING("You must wear \the [src]!"))
if(src != user.wear_mask) //sanity
to_chat(user, SPAN_WARNING("You must wear \the [src]!"))
return
var/obj/item/clothing/gloves/yautja/Y = M.gloves //Doesn't actually reduce power, but needs the bracers anyway.
if(!Y || !istype(Y))
to_chat(M, SPAN_WARNING("You must be wearing your bracers, as they have the power source."))
var/obj/item/clothing/gloves/yautja/bracer = user.gloves
if(!bracer || !istype(bracer))
to_chat(user, SPAN_WARNING("You must be wearing your bracers, as they have the power source."))
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))
to_chat(M, SPAN_WARNING("You need to remove your glasses first. Why are you even wearing these?"))
var/obj/item/visor = user.glasses
if(visor)
if(!istype(visor, /obj/item/clothing/glasses/night/yautja))
to_chat(user, 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
qdel(G)
M.update_inv_glasses()
M.update_sight()
user.temp_drop_inv_item(visor) //Get rid of ye existing maicerinho goggles
qdel(visor)
user.update_inv_glasses()
user.update_sight()
switch_vision_mode()
add_vision(M)
add_vision(user)

/obj/item/clothing/mask/gas/yautja/proc/switch_vision_mode() //switches to the next one
switch(current_goggles)
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 +225,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
Loading