diff --git a/code/datums/gamemode/role/vampire_role.dm b/code/datums/gamemode/role/vampire_role.dm
index 7be4a528c05..07dbfb85033 100644
--- a/code/datums/gamemode/role/vampire_role.dm
+++ b/code/datums/gamemode/role/vampire_role.dm
@@ -254,14 +254,16 @@
return
// Vision-related changes.
- if (/datum/power/vampire/mature in current_powers)
- H.change_sight(adding = SEE_TURFS|SEE_MOBS|SEE_OBJS)
+ if (locate(/datum/power/vampire/vision) in current_powers)
+ H.change_sight(adding = SEE_MOBS)
+
+ if (locate(/datum/power/vampire/mature) in current_powers)
+ H.change_sight(adding = SEE_TURFS|SEE_OBJS)
H.see_in_dark = 8
H.see_invisible = SEE_INVISIBLE_MINIMUM
- else if (/datum/power/vampire/vision in current_powers)
- H.change_sight(adding = SEE_MOBS)
-
+/datum/role/vampire/proc/is_mature_or_has_vision()
+ return (locate(/datum/power/vampire/vision) in current_powers) || (locate(/datum/power/vampire/mature) in current_powers)
/datum/role/vampire/proc/handle_enthrall(var/datum/mind/enthralled)
if (!istype(enthralled))
@@ -312,11 +314,11 @@
if((T.get_lumcount() * 10) <= 2)
H.alphas["vampire_cloak"] = round((255 * 0.15))
- if(/datum/power/vampire/shadow in current_powers)
+ if(locate(/datum/power/vampire/shadow) in current_powers)
H.color = "#000000"
return TRUE
else
- if(/datum/power/vampire/shadow in current_powers)
+ if(locate(/datum/power/vampire/shadow) in current_powers)
H.alphas["vampire_cloak"] = round((255 * 0.15))
else
H.alphas["vampire_cloak"] = round((255 * 0.80))
@@ -357,7 +359,7 @@
if(prob(35))
to_chat(H, "This ground is blessed. Get away, or splatter it with blood to make it safe for you.")
- if((/datum/power/vampire/mature in current_powers) && (istype(get_area(H), /area/chapel))) //stay out of the chapel unless you want to turn into a pile of ashes
+ if((locate(/datum/power/vampire/mature) in current_powers) && (istype(get_area(H), /area/chapel))) //stay out of the chapel unless you want to turn into a pile of ashes
nullified = max(5, nullified + 2)
if(prob(35))
to_chat(H, "You feel yourself growing weaker.")
@@ -367,14 +369,14 @@
*/
if(!nullified) //Checks to see if you can benefit from your vamp current_powers here
- if(!(/datum/power/vampire/mature in current_powers))
+ if(!(locate(/datum/power/vampire/mature) in current_powers))
smitetemp -= 1
- if(!(/datum/power/vampire/shadow in current_powers))
+ if(!(locate(/datum/power/vampire/shadow) in current_powers))
var/turf/T = get_turf(H)
if((T.get_lumcount() * 10) < 2)
smitetemp -= 1
- if(!(/datum/power/vampire/undying in current_powers))
+ if(!(locate(/datum/power/vampire/undying) in current_powers))
smitetemp -= 1
if(smitetemp <= 0) //if you weren't smote by the tile you're on, remove a little holy
@@ -446,7 +448,7 @@
var/mob/living/carbon/human/H = antag.current
if (!istype(H))
return
- if(/datum/power/vampire/mature in current_powers)
+ if(locate(/datum/power/vampire/mature) in current_powers)
to_chat(H, "A freezing liquid permeates your bloodstream. Your vampiric powers fade and your insides burn.")
H.take_organ_damage(0, 5) //FIRE, MAGIC FIRE THAT BURNS ROBOTIC LIMBS TOO!
smitecounter += 10 //50 units to catch on fire. Generally you'll get fucked up quickly
@@ -463,7 +465,7 @@
var/mob/living/carbon/human/H = antag.current
if (!istype(H))
return
- if(!(/datum/power/vampire/undying in current_powers))
+ if(!(locate(/datum/power/vampire/undying) in current_powers))
if(method == TOUCH)
if(H.wear_mask)
to_chat(H, "Your mask protects you from the holy water!")
@@ -477,7 +479,7 @@
if(prob(15) && volume >= 30)
var/datum/organ/external/head/head_organ = H.get_organ(LIMB_HEAD)
if(head_organ)
- if(!(/datum/power/vampire/mature in current_powers))
+ if(!(locate(/datum/power/vampire/mature) in current_powers))
to_chat(H, "A freezing liquid covers your face. Its melting!")
smitecounter += 60 //Equivalent from metabolizing all this holy water normally
if(head_organ.take_damage(30, 0))
@@ -485,16 +487,16 @@
head_organ.disfigure("burn")
H.audible_scream()
else
- to_chat(H, "A freezing liquid covers your face. Your vampiric current_powers protect you!")
+ to_chat(H, "A freezing liquid covers your face. Your vampiric current powers protect you!")
smitecounter += 12 //Ditto above
else
- if(!(/datum/power/vampire/mature in current_powers))
+ if(!(locate(/datum/power/vampire/mature) in current_powers))
to_chat(H, "You are doused with a freezing liquid. You're melting!")
H.take_organ_damage(min(15, volume * 2)) //Uses min() and volume to make sure they aren't being sprayed in trace amounts (1 unit != insta rape) -- Doohl
smitecounter += volume * 2
else
- to_chat(H, "You are doused with a freezing liquid. Your vampiric current_powers protect you!")
+ to_chat(H, "You are doused with a freezing liquid. Your vampiric current powers protect you!")
smitecounter += volume * 0.4
else
if(H.acidable())
diff --git a/code/game/objects/effects/decals/Cleanable/misc.dm b/code/game/objects/effects/decals/Cleanable/misc.dm
index 3864ddf4b44..09e067b576f 100644
--- a/code/game/objects/effects/decals/Cleanable/misc.dm
+++ b/code/game/objects/effects/decals/Cleanable/misc.dm
@@ -367,7 +367,7 @@
/obj/effect/decal/cleanable/salt/proc/checkVamp(var/mob/living/theVamp)
if(isvampire(theVamp))
var/datum/role/vampire/V = isvampire(theVamp)
- if(/datum/power/vampire/charisma in V.current_powers) //He's already a powerful vamp, the check is no longer meta
+ if(locate(/datum/power/vampire/charisma) in V.current_powers) //He's already a powerful vamp, the check is no longer meta
return TRUE
return FALSE
diff --git a/code/game/objects/items/incense.dm b/code/game/objects/items/incense.dm
index 5c3c489a3b2..2852002f82d 100644
--- a/code/game/objects/items/incense.dm
+++ b/code/game/objects/items/incense.dm
@@ -486,7 +486,7 @@
var/mob/living/carbon/human/H = M
var/datum/role/vampire/V = isvampire(H)
if(V)
- if(/datum/power/vampire/mature in V.current_powers)
+ if(locate(/datum/power/vampire/mature) in V.current_powers)
V.smitecounter += 30 //Smithe the shit out of him. Four strikes and he's out
if(istype(M,/mob/living/simple_animal))
@@ -500,7 +500,7 @@
if(user.mind)
if(ishuman(user))
var/datum/role/vampire/V = isvampire(user)
- if(V && !(/datum/power/vampire/undying in V.current_powers))
+ if(V && !(locate(/datum/power/vampire/undying) in V.current_powers))
V.smitecounter += 60
to_chat(user, "\The [src] sears your hand!")
diff --git a/code/game/objects/items/weapons/cosmetics.dm b/code/game/objects/items/weapons/cosmetics.dm
index 77877d05959..23420e3e4ca 100644
--- a/code/game/objects/items/weapons/cosmetics.dm
+++ b/code/game/objects/items/weapons/cosmetics.dm
@@ -500,7 +500,7 @@
var/mob/living/carbon/human/H = user
if (isvampire(H))
var/datum/role/vampire/V = H.mind.GetRole(VAMPIRE)
- if (!(/datum/power/vampire/mature in V.current_powers))
+ if (!(locate(/datum/power/vampire/mature) in V.current_powers))
to_chat(H, "You don't see anything.")
return
diff --git a/code/game/objects/items/weapons/null_rod.dm b/code/game/objects/items/weapons/null_rod.dm
index adc03c5d3bd..e9e7ca0c3f4 100644
--- a/code/game/objects/items/weapons/null_rod.dm
+++ b/code/game/objects/items/weapons/null_rod.dm
@@ -49,7 +49,7 @@
var/datum/role/vampire/V = isvampire(H)
if(V && isReligiousLeader(user)) //Fuck up vampires by smiting the shit out of them. Shock and Awe!
- if(/datum/power/vampire/mature in V.current_powers)
+ if(locate(/datum/power/vampire/mature) in V.current_powers)
to_chat(H, "\The [src]'s power violently interferes with your own!")
if(V.nullified < 5) //Don't actually reduce their debuff if it's over 5
V.nullified = min(5, V.nullified + 2)
@@ -87,7 +87,7 @@
to_chat(user, "\The [src] is teeming with divine power. You feel like you could [fluff_pickup] a horde of undead with this.")
if(ishuman(user)) //Typecasting, only humans can be vampires
var/datum/role/vampire/V = isvampire(user)
- if(V && !(/datum/power/vampire/undying in V.current_powers))
+ if(V && !(locate(/datum/power/vampire/undying) in V.current_powers))
V.smitecounter += 60
to_chat(user, "You feel an unwanted presence as you pick up the rod. Your body feels like it is burning from the inside!")
diff --git a/code/game/objects/items/weapons/storage/bible.dm b/code/game/objects/items/weapons/storage/bible.dm
index 91a412bceae..de92ce31fe1 100644
--- a/code/game/objects/items/weapons/storage/bible.dm
+++ b/code/game/objects/items/weapons/storage/bible.dm
@@ -159,7 +159,7 @@
if(ishuman(M)) //Only humans can be vampires or cultists.
var/mob/living/carbon/human/H = M
V = isvampire(M)
- if(V && (/datum/power/vampire/mature in V.current_powers) && my_rel.leadsThisReligion(user)) //The user is a "mature" Vampire, fuck up his vampiric powers and hurt his head
+ if(V && (locate(/datum/power/vampire/mature) in V.current_powers) && my_rel.leadsThisReligion(user)) //The user is a "mature" Vampire, fuck up his vampiric powers and hurt his head
to_chat(H, "[my_rel.deity_name]'s power nullifies your own!")
if(V.nullified < 5) //Don't actually reduce their debuff if it's over 5
V.nullified = min(5, V.nullified + 2)
@@ -213,7 +213,7 @@
var/mob/living/carbon/human/H = user
var/datum/role/vampire/V = isvampire(H)
var/datum/role/cultist/C = isanycultist(H)
- if(V && (!(/datum/power/vampire/undying in V.current_powers))) //We are a Vampire, we aren't very smart
+ if(V && (!(locate(/datum/power/vampire/undying) in V.current_powers))) //We are a Vampire, we aren't very smart
to_chat(H, "[my_rel.deity_name]'s power channels through \the [src]. You feel extremely uneasy as you grab it!")
V.smitecounter += 10
if(C) //We are a Cultist, we aren't very smart either, but at least there will be no consequences for us
diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm
index 5f189def5ab..93c798d019d 100644
--- a/code/game/objects/structures/mirror.dm
+++ b/code/game/objects/structures/mirror.dm
@@ -33,7 +33,7 @@
/obj/structure/mirror/proc/vampire_check(mob/living/user, mob/living/carbon/human/target)
var/datum/role/vampire/V = isvampire(target)
- if(V && !(/datum/power/vampire/mature in V.current_powers))
+ if(V && !(locate(/datum/power/vampire/mature) in V.current_powers))
to_chat(user, "You don't see anything in \the [src].")
return FALSE
return TRUE
diff --git a/code/modules/mob/hearing/virtualhearer.dm b/code/modules/mob/hearing/virtualhearer.dm
index 47d85e4c54f..c506af7df7c 100644
--- a/code/modules/mob/hearing/virtualhearer.dm
+++ b/code/modules/mob/hearing/virtualhearer.dm
@@ -71,11 +71,11 @@ var/list/stationary_hearers = list( /obj/item/device/radio/intercom,
sight = copying
if(adding)
sight |= adding
- if(adding & (SEE_TURFS | SEE_MOBS | SEE_OBJS))
+ if((sight != oldsight) && (adding & (SEE_TURFS | SEE_MOBS | SEE_OBJS)))
sight &= ~SEE_BLACKNESS
if(removing)
sight &= ~removing
- if(removing & (SEE_TURFS | SEE_MOBS | SEE_OBJS))
+ if((sight != oldsight) && (removing & (SEE_TURFS | SEE_MOBS | SEE_OBJS)))
sight |= SEE_BLACKNESS
if(sight != oldsight)
var/mob/virtualhearer/VH = mob_hearers[src]
diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index 622f1ea131f..21984b7603e 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -393,7 +393,7 @@
if( head && head.is_hidden_identity())
return get_worn_id_name("Unknown") //Likewise for hats
var/datum/role/vampire/V = isvampire(src)
- if(V && (/datum/power/vampire/shadow in V.current_powers) && V.ismenacing)
+ if(V && (locate(/datum/power/vampire/shadow) in V.current_powers) && V.ismenacing)
return get_worn_id_name("Unknown")
var/face_name = get_face_name()
var/id_name = get_worn_id_name("")
diff --git a/code/modules/mob/living/carbon/human/life/handle_regular_hud_updates.dm b/code/modules/mob/living/carbon/human/life/handle_regular_hud_updates.dm
index d14085dbe9f..6bbbffd8286 100644
--- a/code/modules/mob/living/carbon/human/life/handle_regular_hud_updates.dm
+++ b/code/modules/mob/living/carbon/human/life/handle_regular_hud_updates.dm
@@ -117,14 +117,13 @@
src.client.images += V.cached_images[i]
i++
- if (!V || (!(/datum/power/vampire/vision in V.current_powers) && !(/datum/power/vampire/mature in V.current_powers))) // Not a vampire, or a vampire but neither of the spells.
+ if (!V || !V.is_mature_or_has_vision()) // Not a vampire, or a vampire but neither of the spells.
change_sight(removing = SEE_MOBS)
- if (!V || !(/datum/power/vampire/mature in V.current_powers))
+ if (!V || !(locate(/datum/power/vampire/mature) in V.current_powers))
change_sight(removing = SEE_TURFS|SEE_OBJS)
var/datum/organ/internal/eyes/E = src.internal_organs_by_name["eyes"]
if(E)
see_in_dark = E.see_in_dark
-
see_invisible = see_in_dark > 2 ? SEE_INVISIBLE_LEVEL_ONE : SEE_INVISIBLE_LIVING
// Moiving this "see invisble" thing here so that it can be overriden by xrays, vampires...
@@ -289,7 +288,7 @@
if(ticker && ticker.hardcore_mode) //Hardcore mode: flashing nutrition indicator when starving!
if(nutrition < STARVATION_MIN)
throw_alert(SCREEN_ALARM_FOOD, /obj/abstract/screen/alert/carbon/food/starving, 5)
-
+
update_pull_icon()
if(disabilities & NEARSIGHTED) //This looks meh but saves a lot of memory by not requiring to add var/prescription
diff --git a/code/modules/spells/aoe_turf/glare.dm b/code/modules/spells/aoe_turf/glare.dm
index 0d4d051af38..8ee61785466 100644
--- a/code/modules/spells/aoe_turf/glare.dm
+++ b/code/modules/spells/aoe_turf/glare.dm
@@ -67,7 +67,7 @@
C.Stun(distance_value)
if(distance_value > 1)
C.Knockdown(distance_value)
- C.stuttering += 5+distance_value * ((/datum/power/vampire/charisma in V.current_powers) ? 2 : 1) //double stutter time with Charisma
+ C.stuttering += 5+distance_value * ((locate(/datum/power/vampire/charisma) in V.current_powers) ? 2 : 1) //double stutter time with Charisma
if(!C.blinded)
C.blinded = 1
C.blinded += max(1, distance_value)
@@ -81,4 +81,4 @@
user.stuttering += 15
var/datum/role/vampire/V = isvampire(user)
if (V)
- V.remove_blood(3*blood_cost)
\ No newline at end of file
+ V.remove_blood(3*blood_cost)
diff --git a/code/modules/spells/targeted/enthrall.dm b/code/modules/spells/targeted/enthrall.dm
index c8e19d684a5..86cc2e05750 100644
--- a/code/modules/spells/targeted/enthrall.dm
+++ b/code/modules/spells/targeted/enthrall.dm
@@ -47,31 +47,31 @@
/spell/targeted/enthrall/cast(var/list/targets, var/mob/user)
if (targets.len > 1)
return FALSE
-
+
var/mob/living/target = targets[1]
var/datum/role/vampire/V = isvampire(user)
if (!V)
return FALSE
-
- user.visible_message("[user] bites \the [target]'s neck!", "You bite \the [target]'s neck and begin the flow of power.")
- to_chat(target, "You feel the tendrils of evil [(/datum/power/vampire/charisma in V.current_powers) ? "aggressively" : "slowly"] invade your mind.")
- if(do_mob(user, target, (/datum/power/vampire/charisma in V.current_powers) ? 150 : 300))
+ user.visible_message("[user] bites \the [target]'s neck!", "You bite \the [target]'s neck and begin the flow of power.")
+ to_chat(target, "You feel the tendrils of evil [(locate(/datum/power/vampire/charisma) in V.current_powers) ? "aggressively" : "slowly"] invade your mind.")
+
+ if(do_mob(user, target, (locate(/datum/power/vampire/charisma) in V.current_powers) ? 150 : 300))
if(user.vampire_power(blood_cost, 0)) // recheck
V.handle_enthrall(target.mind)
else
to_chat(user, "Either you or your target moved, and you couldn't finish enthralling them!")
return FALSE
-
+
if(!target.client) //There is not a player "in control" of this corpse, so there is no one to inform.
var/mob/dead/observer/ghost = mind_can_reenter(target.mind)
if(ghost)
var/mob/ghostmob = ghost.get_top_transmogrification()
if(ghostmob) //A ghost has been found, and it still belongs to this corpse. There's nothing preventing them from being revived.
to_chat(ghostmob, "The vampire has enthralled your corpse. You will be their servant when you return to the living. Blood and power to your Lord. (Check your notes for the current identity of your master upon revival.)")
-
+
V.remove_blood(blood_cost)
/spell/targeted/enthrall/critfail(var/list/targets, var/mob/user)
@@ -81,4 +81,4 @@
H.confused = max(10, H.confused)
var/datum/role/vampire/V = isvampire(user)
if (V)
- V.remove_blood(blood_cost)
\ No newline at end of file
+ V.remove_blood(blood_cost)
diff --git a/code/modules/spells/vampire_helpers.dm b/code/modules/spells/vampire_helpers.dm
index 2c1200c7811..b7d631f4c57 100644
--- a/code/modules/spells/vampire_helpers.dm
+++ b/code/modules/spells/vampire_helpers.dm
@@ -10,7 +10,7 @@
world.log << "[src] has vampire spells but isn't a vampire."
return 0
- var/fullpower = (/datum/power/vampire/jaunt in vampire.current_powers)
+ var/fullpower = (locate(/datum/power/vampire/jaunt) in vampire.current_powers)
if(src.stat > max_stat)
to_chat(src, "You are incapacitated.")
@@ -43,7 +43,7 @@
if(restrained())
to_chat(src, " You cannot do this while restrained! ")
return 0
- if(!(/datum/power/vampire/charisma in V.current_powers)) //Charisma allows implanted targets to be enthralled.
+ if(!(locate(/datum/power/vampire/charisma) in V.current_powers)) //Charisma allows implanted targets to be enthralled.
for(var/obj/item/weapon/implant/loyalty/L in H)
if(L && L.implanted)
implanted = TRUE