From a3a365fd8c1b5bb5c9529857afe8925f5123e588 Mon Sep 17 00:00:00 2001 From: forest2001 Date: Sat, 29 Jul 2023 18:48:00 +0100 Subject: [PATCH 1/7] Yautja Vision --- code/__DEFINES/lighting.dm | 2 + code/modules/clothing/glasses/meson.dm | 13 --- code/modules/clothing/glasses/thermal.dm | 12 --- code/modules/cm_preds/yaut_mask.dm | 81 +++++++++---------- code/modules/mob/living/carbon/human/human.dm | 1 + .../living/carbon/human/species/species.dm | 1 + .../carbon/human/species/yautja/_species.dm | 2 + 7 files changed, 45 insertions(+), 67 deletions(-) diff --git a/code/__DEFINES/lighting.dm b/code/__DEFINES/lighting.dm index ac050e467a71..5a4ba7676233 100644 --- a/code/__DEFINES/lighting.dm +++ b/code/__DEFINES/lighting.dm @@ -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 diff --git a/code/modules/clothing/glasses/meson.dm b/code/modules/clothing/glasses/meson.dm index 859368cd7afc..b0823910365d 100644 --- a/code/modules/clothing/glasses/meson.dm +++ b/code/modules/clothing/glasses/meson.dm @@ -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." diff --git a/code/modules/clothing/glasses/thermal.dm b/code/modules/clothing/glasses/thermal.dm index 607e53cf65f1..bfc60d271724 100644 --- a/code/modules/clothing/glasses/thermal.dm +++ b/code/modules/clothing/glasses/thermal.dm @@ -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 diff --git a/code/modules/cm_preds/yaut_mask.dm b/code/modules/cm_preds/yaut_mask.dm index 5d4d21c46c80..6765b5d8cf08 100644 --- a/code/modules/cm_preds/yaut_mask.dm +++ b/code/modules/cm_preds/yaut_mask.dm @@ -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 @@ -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." @@ -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 @@ -112,10 +135,6 @@ 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 @@ -123,38 +142,40 @@ 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) ..() @@ -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" diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index d01416b2443f..c5de5bda0fa1 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -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) diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index b6eeb68e95d3..f6487d1faf1c 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -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. diff --git a/code/modules/mob/living/carbon/human/species/yautja/_species.dm b/code/modules/mob/living/carbon/human/species/yautja/_species.dm index 8e8849f5ad4c..f8ecb3e0591b 100644 --- a/code/modules/mob/living/carbon/human/species/yautja/_species.dm +++ b/code/modules/mob/living/carbon/human/species/yautja/_species.dm @@ -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 From 842c3b3e92f72a19c5490f68251d39bc07be35a7 Mon Sep 17 00:00:00 2001 From: forest2001 Date: Sat, 29 Jul 2023 19:03:51 +0100 Subject: [PATCH 2/7] lying comment.... --- code/modules/cm_preds/yaut_mask.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/cm_preds/yaut_mask.dm b/code/modules/cm_preds/yaut_mask.dm index 6765b5d8cf08..1bf7fd0d1499 100644 --- a/code/modules/cm_preds/yaut_mask.dm +++ b/code/modules/cm_preds/yaut_mask.dm @@ -114,7 +114,7 @@ if(src != M.wear_mask) //sanity to_chat(M, 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. + var/obj/item/clothing/gloves/yautja/Y = M.gloves if(!Y || !istype(Y)) to_chat(M, SPAN_WARNING("You must be wearing your bracers, as they have the power source.")) return From db546d4e433f02ed0b7f4cc15389a4ac8ead3863 Mon Sep 17 00:00:00 2001 From: forest2001 <41653574+realforest2001@users.noreply.github.com> Date: Sat, 5 Aug 2023 18:07:53 +0100 Subject: [PATCH 3/7] Apply suggestions from code review Co-authored-by: harryob --- code/modules/cm_preds/yaut_mask.dm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/code/modules/cm_preds/yaut_mask.dm b/code/modules/cm_preds/yaut_mask.dm index 1bf7fd0d1499..98c216095f42 100644 --- a/code/modules/cm_preds/yaut_mask.dm +++ b/code/modules/cm_preds/yaut_mask.dm @@ -68,15 +68,14 @@ /obj/item/clothing/mask/gas/yautja/process() if(!ishuman(loc)) - STOP_PROCESSING(SSobj, src) - return + return PROCESS_KILL 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 + 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() @@ -120,7 +119,7 @@ return var/obj/item/G = M.glasses if(G) - if(!istype(G,/obj/item/clothing/glasses/night/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 @@ -159,7 +158,7 @@ H.remove_hud_from(user) var/obj/item/visor = user.glasses if(visor) //make your hud fuck off - if(istype(visor,/obj/item/clothing/glasses/night/yautja)) + if(istype(visor, /obj/item/clothing/glasses/night/yautja)) user.temp_drop_inv_item(visor) qdel(visor) user.update_inv_glasses() From c60e455296aea4645933f78dfcd77be2e4344928 Mon Sep 17 00:00:00 2001 From: forest2001 Date: Thu, 10 Aug 2023 15:58:09 +0100 Subject: [PATCH 4/7] passive reduction --- code/modules/cm_preds/yaut_mask.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/cm_preds/yaut_mask.dm b/code/modules/cm_preds/yaut_mask.dm index 98c216095f42..6e0b32ba1285 100644 --- a/code/modules/cm_preds/yaut_mask.dm +++ b/code/modules/cm_preds/yaut_mask.dm @@ -71,7 +71,7 @@ return PROCESS_KILL var/mob/living/carbon/human/human_holder = loc - if(current_goggles && !drain_power(human_holder, 5)) + if(current_goggles && !drain_power(human_holder, 3)) 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 From b878197030f8846ff5ae69fd59d729743976787d Mon Sep 17 00:00:00 2001 From: forest2001 Date: Sat, 12 Aug 2023 23:05:43 +0100 Subject: [PATCH 5/7] fixes 1L var --- code/modules/cm_preds/yaut_mask.dm | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/code/modules/cm_preds/yaut_mask.dm b/code/modules/cm_preds/yaut_mask.dm index 6e0b32ba1285..5f0f12005e67 100644 --- a/code/modules/cm_preds/yaut_mask.dm +++ b/code/modules/cm_preds/yaut_mask.dm @@ -104,30 +104,30 @@ 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 + var/obj/item/clothing/gloves/yautja/Y = user.gloves if(!Y || !istype(Y)) - to_chat(M, SPAN_WARNING("You must be wearing your bracers, as they have the power source.")) + to_chat(user, SPAN_WARNING("You must be wearing your bracers, as they have the power source.")) return - var/obj/item/G = M.glasses + var/obj/item/G = user.glasses if(G) 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?")) + 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 + user.temp_drop_inv_item(G) //Get rid of ye existing maicerinho goggles qdel(G) - M.update_inv_glasses() - M.update_sight() + 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) From 9715b5136041d8499e5194387013e3c2e957ec3b Mon Sep 17 00:00:00 2001 From: forest2001 Date: Sat, 12 Aug 2023 23:07:04 +0100 Subject: [PATCH 6/7] More 1L vars --- code/modules/cm_preds/yaut_mask.dm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/code/modules/cm_preds/yaut_mask.dm b/code/modules/cm_preds/yaut_mask.dm index 5f0f12005e67..44f3557cf236 100644 --- a/code/modules/cm_preds/yaut_mask.dm +++ b/code/modules/cm_preds/yaut_mask.dm @@ -113,17 +113,17 @@ if(src != user.wear_mask) //sanity to_chat(user, SPAN_WARNING("You must wear \the [src]!")) return - var/obj/item/clothing/gloves/yautja/Y = user.gloves - if(!Y || !istype(Y)) + 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 = user.glasses - if(G) - if(!istype(G, /obj/item/clothing/glasses/night/yautja)) + 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 - user.temp_drop_inv_item(G) //Get rid of ye existing maicerinho goggles - qdel(G) + 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() From be0eb4017de1aac3cf59a09e54eac8235c82244c Mon Sep 17 00:00:00 2001 From: forest2001 Date: Sat, 12 Aug 2023 23:11:26 +0100 Subject: [PATCH 7/7] visior --- code/modules/cm_preds/yaut_mask.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/cm_preds/yaut_mask.dm b/code/modules/cm_preds/yaut_mask.dm index 44f3557cf236..be0aa8ed761a 100644 --- a/code/modules/cm_preds/yaut_mask.dm +++ b/code/modules/cm_preds/yaut_mask.dm @@ -72,7 +72,7 @@ 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.")) + to_chat(human_holder, SPAN_WARNING("Your bracers lack sufficient power to operate the visor.")) 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