diff --git a/code/datums/vision_override.dm b/code/datums/vision_override.dm
new file mode 100644
index 00000000000..a634a77f6fb
--- /dev/null
+++ b/code/datums/vision_override.dm
@@ -0,0 +1,16 @@
+/datum/vision_override
+ var/name = "vision override"
+ var/see_in_dark = 0
+ var/see_invisible = 0
+ var/light_sensetive = 0
+ var/sight_flags = 0
+
+/datum/vision_override/nightvision
+ see_in_dark = 8
+ see_invisible = SEE_INVISIBLE_MINIMUM
+
+/datum/vision_override/nightvision/thermals
+ sight_flags = SEE_MOBS
+
+/datum/vision_override/nightvision/thermals/ling_augmented_eyesight
+ light_sensetive = 1
\ No newline at end of file
diff --git a/code/game/gamemodes/changeling/changeling_power.dm b/code/game/gamemodes/changeling/changeling_power.dm
index 496688835bb..a365a45673c 100644
--- a/code/game/gamemodes/changeling/changeling_power.dm
+++ b/code/game/gamemodes/changeling/changeling_power.dm
@@ -19,6 +19,9 @@
/obj/effect/proc_holder/changeling/proc/on_purchase(var/mob/user)
return
+/obj/effect/proc_holder/changeling/proc/on_refund(mob/user)
+ return
+
/obj/effect/proc_holder/changeling/Click()
var/mob/user = usr
if(!user || !user.mind || !user.mind.changeling)
diff --git a/code/game/gamemodes/changeling/evolution_menu.dm b/code/game/gamemodes/changeling/evolution_menu.dm
index 0ffce0ba172..9475dda8035 100644
--- a/code/game/gamemodes/changeling/evolution_menu.dm
+++ b/code/game/gamemodes/changeling/evolution_menu.dm
@@ -406,8 +406,10 @@ var/list/sting_paths
mind.changeling.changeling_speak = 0
mind.changeling.reset()
for(var/obj/effect/proc_holder/changeling/p in mind.changeling.purchasedpowers)
- if(!(p.dna_cost == 0 && keep_free_powers))
- mind.changeling.purchasedpowers -= p
+ if(p.dna_cost == 0 && keep_free_powers)
+ continue
+ mind.changeling.purchasedpowers -= p
+ p.on_refund(src)
/datum/changeling/proc/has_sting(obj/effect/proc_holder/changeling/power)
for(var/obj/effect/proc_holder/changeling/P in purchasedpowers)
diff --git a/code/game/gamemodes/changeling/powers/augmented_eyesight.dm b/code/game/gamemodes/changeling/powers/augmented_eyesight.dm
index d40da71fff1..d303d022753 100644
--- a/code/game/gamemodes/changeling/powers/augmented_eyesight.dm
+++ b/code/game/gamemodes/changeling/powers/augmented_eyesight.dm
@@ -7,18 +7,15 @@
helptext = "Grants us night vision and thermal vision. It may be toggled on or off."
chemical_cost = 0
dna_cost = 2 //Would be 1 without thermal vision
- var/active = 0 //Whether or not vision is enhanced
/obj/effect/proc_holder/changeling/augmented_eyesight/sting_action(var/mob/user)
- active = !active
- if(active)
+ if(!user.vision_type)
user << "We feel a minute twitch in our eyes, and darkness creeps away."
+ user.vision_type = new /datum/vision_override/nightvision/thermals/ling_augmented_eyesight
else
user << "Our vision dulls. Shadows gather."
- user.sight &= ~SEE_MOBS
- while(active)
- user.see_in_dark = 8
- user.see_invisible = 2
- user.sight |= SEE_MOBS
- sleep(1) //BAD THINGS HAPPEN WITHOUT THIS.
+ user.vision_type = null
return 1
+
+/obj/effect/proc_holder/changeling/augmented_eyesight/on_refund(mob/user)
+ user.vision_type = null
\ No newline at end of file
diff --git a/code/game/gamemodes/shadowling/shadowling.dm b/code/game/gamemodes/shadowling/shadowling.dm
index 1cc2cd9d469..05d778c8b5a 100644
--- a/code/game/gamemodes/shadowling/shadowling.dm
+++ b/code/game/gamemodes/shadowling/shadowling.dm
@@ -135,6 +135,7 @@ Made by Xhuis
var/mob/living/carbon/human/S = shadow_mind.current
shadow_mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/shadowling_hatch)
shadow_mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/enthrall)
+ shadow_mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/shadow_vision)
spawn(0)
shadow_mind.current.add_language("Shadowling Hivemind")
update_shadow_icons_added(shadow_mind)
@@ -154,7 +155,7 @@ Made by Xhuis
new_thrall_mind.current.add_language("Shadowling Hivemind")
new_thrall_mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/lesser_glare)
new_thrall_mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/lesser_shadow_walk)
- //new_thrall_mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/thrall_vision) //Uncomment when vision code is unfucked.
+ new_thrall_mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/shadow_vision/thrall)
new_thrall_mind.current << "You see the truth. Reality has been torn away and you realize what a fool you've been."
new_thrall_mind.current << "The shadowlings are your masters. Serve them above all else and ensure they complete their goals."
new_thrall_mind.current << "You may not harm other thralls or the shadowlings. However, you do not need to obey other thralls."
@@ -210,7 +211,7 @@ Made by Xhuis
else
shadowling_dead = 1 //but shadowling was kill :(
return 1
-
+
/datum/game_mode/proc/remove_shadowling(datum/mind/ling_mind)
if(!istype(ling_mind) || !(ling_mind in shadows)) return 0
update_shadow_icons_removed(ling_mind)
@@ -304,7 +305,7 @@ Made by Xhuis
flesh_color = "#222222"
flags = NO_BLOOD | NO_BREATHE | NO_SCAN | NO_INTORGANS
- burn_mod = 2 //2x burn damage
+ burn_mod = 1.5 //1.5x burn damage, 2x is excessive
/datum/game_mode/proc/update_shadow_icons_added(datum/mind/shadow_mind)
spawn(0)
diff --git a/code/game/gamemodes/shadowling/shadowling_abilities.dm b/code/game/gamemodes/shadowling/shadowling_abilities.dm
index f1778935ef8..9decbe31e72 100644
--- a/code/game/gamemodes/shadowling/shadowling_abilities.dm
+++ b/code/game/gamemodes/shadowling/shadowling_abilities.dm
@@ -170,8 +170,8 @@
user.visible_message("[user] appears from nowhere!", "Your shadowy guise slips away.")
user.alpha = initial(user.alpha)
-/*
-/obj/effect/proc_holder/spell/targeted/thrall_vision //Uncomment this if we ever update our vision code to not be absolute garbage.
+
+/obj/effect/proc_holder/spell/targeted/shadow_vision
name = "Darksight"
desc = "Gives you night vision."
panel = "Thrall Abilities"
@@ -179,23 +179,22 @@
range = -1
include_user = 1
clothes_req = 0
- var/active = 0
+ var/datum/vision_override/vision_path = /datum/vision_override/nightvision/thermals
-/obj/effect/proc_holder/spell/targeted/thrall_vision/cast(list/targets)
+/obj/effect/proc_holder/spell/targeted/shadow_vision/cast(list/targets)
for(var/mob/living/user in targets)
if(!istype(user) || !ishuman(user))
return
var/mob/living/carbon/human/H = user
- active = !active
- if(active)
- user << "You shift the nerves in your eyes, allowing you to see in the dark."
- H.see_in_dark = 8
- H.dna.species.invis_sight = SEE_INVISIBLE_MINIMUM
+ if(!H.vision_type)
+ H << "You shift the nerves in your eyes, allowing you to see in the dark."
+ H.vision_type = new vision_path
else
- user << "You return your vision to normal."
- H.see_in_dark = 0
- H.dna.species.invis_sight = initial(H.dna.species.invis_sight)
-*/
+ H << "You return your vision to normal."
+ H.vision_type = null
+
+/obj/effect/proc_holder/spell/targeted/shadow_vision/thrall
+ vision_path = /datum/vision_override/nightvision
/obj/effect/proc_holder/spell/aoe_turf/flashfreeze
name = "Icy Veins"
diff --git a/code/game/gamemodes/shadowling/shadowling_items.dm b/code/game/gamemodes/shadowling/shadowling_items.dm
index e494c7507f0..863ea9c43a6 100644
--- a/code/game/gamemodes/shadowling/shadowling_items.dm
+++ b/code/game/gamemodes/shadowling/shadowling_items.dm
@@ -66,17 +66,13 @@
flags = ABSTRACT | NODROP
-/obj/item/clothing/glasses/night/shadowling
+/obj/item/clothing/glasses/shadowling
name = "crimson eyes"
desc = "A shadowling's eyes. Very light-sensitive and can detect body heat through walls."
icon = null
icon_state = null
item_state = null
origin_tech = null
- vision_flags = SEE_MOBS
- darkness_view = 8
- see_darkness = 0
- invisa_view = 2
unacidable = 1
flash_protect = -1
flags = ABSTRACT | NODROP
diff --git a/code/game/gamemodes/shadowling/special_shadowling_abilities.dm b/code/game/gamemodes/shadowling/special_shadowling_abilities.dm
index bb4fc80c7d6..72ba07fbdc7 100644
--- a/code/game/gamemodes/shadowling/special_shadowling_abilities.dm
+++ b/code/game/gamemodes/shadowling/special_shadowling_abilities.dm
@@ -79,6 +79,8 @@ var/list/possibleShadowlingNames = list("U'ruan", "Y`shej", "Nex", "Hel-uae", "N
H.undershirt = "None"
H.socks = "None"
H.faction |= "faithless"
+ if(!H.weakeyes)
+ H.weakeyes = 1
H.equip_to_slot_or_del(new /obj/item/clothing/under/shadowling(usr), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/shadowling(usr), slot_shoes)
@@ -86,7 +88,7 @@ var/list/possibleShadowlingNames = list("U'ruan", "Y`shej", "Nex", "Hel-uae", "N
H.equip_to_slot_or_del(new /obj/item/clothing/head/shadowling(usr), slot_head)
H.equip_to_slot_or_del(new /obj/item/clothing/gloves/shadowling(usr), slot_gloves)
H.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/shadowling(usr), slot_wear_mask)
- H.equip_to_slot_or_del(new /obj/item/clothing/glasses/night/shadowling(usr), slot_glasses)
+ H.equip_to_slot_or_del(new /obj/item/clothing/glasses/shadowling(usr), slot_glasses)
H.set_species("Shadowling")
sleep(10)
diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm
index e32146ff69f..f22c68bb0f0 100644
--- a/code/game/machinery/flasher.dm
+++ b/code/game/machinery/flasher.dm
@@ -79,6 +79,9 @@
continue
O.Weaken(strength)
+ if(O.weakeyes)
+ O.Weaken(strength * 1.5)
+ O.visible_message("[O] gasps and shields their eyes!")
if (istype(O, /mob/living/carbon/human))
var/mob/living/carbon/human/H = O
var/obj/item/organ/eyes/E = H.internal_organs_by_name["eyes"]
diff --git a/code/game/objects/items/devices/flash.dm b/code/game/objects/items/devices/flash.dm
index 42653c3ff1b..3d37f120bc6 100644
--- a/code/game/objects/items/devices/flash.dm
+++ b/code/game/objects/items/devices/flash.dm
@@ -77,6 +77,8 @@
/obj/item/device/flash/proc/flash_carbon(var/mob/living/carbon/M, var/mob/user = null, var/power = 5, convert = 1)
add_logs(M, user, "flashed", object="[src.name]")
+ if(M.weakeyes)
+ M.Weaken(3) //quick weaken bypasses eye protection but has no eye flash
var/safety = M:eyecheck()
if(safety <= 0)
M.confused += power
@@ -85,6 +87,9 @@
terrible_conversion_proc(M, user)
M.Stun(1)
user.visible_message("[user] blinds [M] with the [src.name]!")
+ if(M.weakeyes)
+ M.Stun(2)
+ M.visible_message("[M] gasps and shields their eyes!")
return 1
else
if(user)
diff --git a/code/game/objects/items/devices/laserpointer.dm b/code/game/objects/items/devices/laserpointer.dm
index ec5f18283a8..a43928a5689 100644
--- a/code/game/objects/items/devices/laserpointer.dm
+++ b/code/game/objects/items/devices/laserpointer.dm
@@ -101,6 +101,8 @@
//eye target check
outmsg = "You blind [C] by shining [src] in their eyes."
+ if(C.weakeyes)
+ C.Stun(1)
var/eye_prot = C.eyecheck()
if(C.blinded || eye_prot >= 2)
eye_prot = 4
diff --git a/code/game/objects/items/weapons/grenades/flashbang.dm b/code/game/objects/items/weapons/grenades/flashbang.dm
index 7eca6aa719b..ad56e541fd4 100644
--- a/code/game/objects/items/weapons/grenades/flashbang.dm
+++ b/code/game/objects/items/weapons/grenades/flashbang.dm
@@ -36,9 +36,17 @@
ear_safety++
//Flash
+ var/mob/living/carbon/human/H = M
+ var/obj/item/organ/eyes/E = H.internal_organs_by_name["eyes"]
+ if(M.weakeyes)
+ M.visible_message("[M] screams and collapses!")
+ M << "AAAAGH! IT BURNS!"
+ M.Weaken(15) //hella stunned
+ M.Stun(15)
+ if(E)
+ E.damage += 8
+
if(!eye_safety && ishuman(M))
- var/mob/living/carbon/human/H = M
- var/obj/item/organ/eyes/E = H.internal_organs_by_name["eyes"]
flick("e_flash", M.flash)
if (E) E.damage += rand(1, 3)
M.Stun(max(10/distance, 3))
diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm
index eead644cc58..ef88db4a6dc 100644
--- a/code/modules/mob/living/carbon/human/human_defines.dm
+++ b/code/modules/mob/living/carbon/human/human_defines.dm
@@ -84,4 +84,4 @@
var/fire_dmi = 'icons/mob/OnFire.dmi'
var/fire_sprite = "Standing"
- var/datum/body_accessory/body_accessory = null
+ var/datum/body_accessory/body_accessory = null
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm
index 875a3a85260..c9d441d77e8 100644
--- a/code/modules/mob/living/carbon/human/life.dm
+++ b/code/modules/mob/living/carbon/human/life.dm
@@ -768,7 +768,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
light_amount = T.get_lumcount()*10
if(light_amount > species.light_dam && !incorporeal_move) //if there's enough light, start dying
if(species.light_effect_amp)
- adjustFireLoss(5) //This gets doubled by Shadowling's innate fire weakness, so it ends up being 10.
+ adjustFireLoss(4.7) //This gets multiplied by 1.5 due to Shadowling's innate fire weakness, so it ends up being about 7.
else
adjustFireLoss(1)
adjustBruteLoss(1)
@@ -968,7 +968,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
var/obj/item/organ/vision
if(species.vision_organ)
vision = internal_organs_by_name[species.vision_organ]
-
+
if(!species.vision_organ) // Presumably if a species has no vision organs, they see via some other means.
eye_blind = 0
blinded = 0
@@ -977,7 +977,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
eye_blind = 1
blinded = 1
eye_blurry = 1
- else
+ else
//blindness
if(sdisabilities & BLIND) // Disabled-blind, doesn't get better on its own
blinded = 1
@@ -987,7 +987,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
else if(istype(glasses, /obj/item/clothing/glasses/sunglasses/blindfold)) //resting your eyes with a blindfold heals blurry eyes faster
eye_blurry = max(eye_blurry-3, 0)
blinded = 1
-
+
//blurry sight
if(vision.is_bruised()) // Vision organs impaired? Permablurry.
eye_blurry = 1
@@ -1220,13 +1220,17 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
if(ANTAGHUD)
process_antag_hud(src)
-
-
-
else if(!seer)
see_in_dark = species.darksight
see_invisible = SEE_INVISIBLE_LIVING
-
+
+ if(vision_type)
+ see_in_dark = max(see_in_dark, vision_type.see_in_dark, species.darksight)
+ see_invisible = vision_type.see_invisible
+ if(vision_type.light_sensetive)
+ weakeyes = 1
+ sight |= vision_type.sight_flags
+
if(see_override) //Override all
see_invisible = see_override
diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm
index cee943541d3..3837f3d2b48 100644
--- a/code/modules/mob/mob_defines.dm
+++ b/code/modules/mob/mob_defines.dm
@@ -203,6 +203,7 @@
var/area/lastarea = null
var/digitalcamo = 0 // Can they be tracked by the AI?
+ var/weakeyes //Are they vulnerable to flashes?
var/list/radar_blips = list() // list of screen objects, radar blips
var/radar_open = 0 // nonzero is radar is open
@@ -234,4 +235,6 @@
var/last_movement = -100 // Last world.time the mob actually moved of its own accord.
- var/resize = 1 //Badminnery resize
\ No newline at end of file
+ var/resize = 1 //Badminnery resize
+
+ var/datum/vision_override/vision_type = null //Vision override datum.
\ No newline at end of file
diff --git a/paradise.dme b/paradise.dme
index dba397639c5..f469f33be4f 100644
--- a/paradise.dme
+++ b/paradise.dme
@@ -186,6 +186,7 @@
#include "code\datums\spell.dm"
#include "code\datums\supplypacks.dm"
#include "code\datums\uplink_item.dm"
+#include "code\datums\vision_override.dm"
#include "code\datums\cache\air_alarm.dm"
#include "code\datums\cache\apc.dm"
#include "code\datums\cache\cache.dm"