You have accumulated [src.mind.vampire.bloodtotal] [src.mind.vampire.bloodtotal > 1 ? "units" : "unit"] of blood[src.mind.vampire.bloodusable != bloodusable ?", and have [src.mind.vampire.bloodusable] left to use" : "."]"
check_vampire_upgrade(mind)
H.vessel.remove_reagent("blood",25)
if(ishuman(src))
var/mob/living/carbon/human/V = src
V.nutrition = min(450,V.nutrition+(blood/2))
src.mind.vampire.draining = null
src << "\blue You stop draining [H.name] of blood."
return 1
/mob/proc/check_vampire_upgrade(datum/mind/v)
if(!v) return
if(!v.vampire) return
var/datum/vampire/vamp = v.vampire
var/list/old_powers = vamp.powers.Copy()
// This used to be a switch statement.
// Don't use switch statements for shit like this, since blood can be any random-ass value.
// if(100) requires the blood to be at EXACTLY 100 units to trigger.
// if(blud >= 100) activates when blood is at or over 100 units.
// TODO: Make this modular.
// TIER 1
if(vamp.bloodtotal >= 100)
if(!(VAMP_VISION in vamp.powers))
vamp.powers.Add(VAMP_VISION)
if(!(VAMP_SHAPE in vamp.powers))
vamp.powers.Add(VAMP_SHAPE)
// TIER 2
if(vamp.bloodtotal >= 150)
if(!(VAMP_CLOAK in vamp.powers))
vamp.powers.Add(VAMP_CLOAK)
if(!(VAMP_DISEASE in vamp.powers))
vamp.powers.Add(VAMP_DISEASE)
// TIER 3
if(vamp.bloodtotal >= 200)
if(!(VAMP_BATS in vamp.powers))
vamp.powers.Add(VAMP_BATS)
if(!(VAMP_SCREAM in vamp.powers))
vamp.powers.Add(VAMP_SCREAM)
// Commented out until we can figured out a way to stop this from spamming.
//src << "\blue Your rejuvination abilities have improved and will now heal you over time when used."
// TIER 3.5 (/vg/)
if(vamp.bloodtotal >= 250)
if(!(VAMP_BLINK in vamp.powers))
vamp.powers.Add(VAMP_BLINK)
// TIER 4
if(vamp.bloodtotal >= 300)
if(!(VAMP_JAUNT in vamp.powers))
vamp.powers.Add(VAMP_JAUNT)
if(!(VAMP_SLAVE in vamp.powers))
vamp.powers.Add(VAMP_SLAVE)
// TIER 5
if(vamp.bloodtotal >= 500)
if(!(VAMP_FULL in vamp.powers))
vamp.powers.Add(VAMP_FULL)
announce_new_power(old_powers, vamp.powers)
/mob/proc/announce_new_power(list/old_powers, list/new_powers)
for(var/n in new_powers)
if(!(n in old_powers))
switch(n)
if(VAMP_SHAPE)
src << "\blue You have gained the shapeshifting ability, at the cost of stored blood you can change your form permanently."
verbs += /client/vampire/proc/vampire_shapeshift
if(VAMP_VISION)
src << "\blue Your vampiric vision has improved."
//no verb
if(VAMP_DISEASE)
src << "\blue You have gained the Diseased Touch ability which causes those you touch to die shortly after unless treated medically."
verbs += /client/vampire/proc/vampire_disease
if(VAMP_CLOAK)
src << "\blue You have gained the Cloak of Darkness ability which when toggled makes you near invisible in the shroud of darkness."
verbs += /client/vampire/proc/vampire_cloak
if(VAMP_BATS)
src << "\blue You have gained the Summon Bats ability."
verbs += /client/vampire/proc/vampire_bats // work in progress
if(VAMP_SCREAM)
src << "\blue You have gained the Chriopteran Screech ability which stuns anything with ears in a large radius and shatters glass in the process."
verbs += /client/vampire/proc/vampire_screech
if(VAMP_JAUNT)
src << "\blue You have gained the Mist Form ability which allows you to take on the form of mist for a short period and pass over any obstacle in your path."
verbs += /client/vampire/proc/vampire_jaunt
if(VAMP_SLAVE)
src << "\blue You have gained the Enthrall ability which at a heavy blood cost allows you to enslave a human that is not loyal to any other for a random period of time."
verbs += /client/vampire/proc/vampire_enthrall
if(VAMP_BLINK)
src << "\blue You have gained the ability to shadowstep, which makes you disappear into nearby shadows at the cost of blood."
verbs += /client/vampire/proc/vampire_shadowstep
if(VAMP_FULL)
src << "\blue You have reached your full potential and are no longer weak to the effects of anything holy and your vision has been improved greatly."
//no verb
//prepare for copypaste
/datum/game_mode/proc/update_vampire_icons_added(datum/mind/vampire_mind)
var/ref = "\ref[vampire_mind]"
if(ref in thralls)
if(vampire_mind.current)
if(vampire_mind.current.client)
var/I = image('icons/mob/mob.dmi', loc = vampire_mind.current, icon_state = "vampire")
vampire_mind.current.client.images += I
for(var/headref in thralls)
for(var/datum/mind/t_mind in thralls[headref])
var/datum/mind/head = locate(headref)
if(head)
if(head.current)
if(head.current.client)
var/I = image('icons/mob/mob.dmi', loc = t_mind.current, icon_state = "vampthrall")
head.current.client.images += I
if(t_mind.current)
if(t_mind.current.client)
var/I = image('icons/mob/mob.dmi', loc = head.current, icon_state = "vampire")
t_mind.current.client.images += I
if(t_mind.current)
if(t_mind.current.client)
var/I = image('icons/mob/mob.dmi', loc = t_mind.current, icon_state = "vampthrall")
t_mind.current.client.images += I
/datum/game_mode/proc/update_vampire_icons_removed(datum/mind/vampire_mind)
for(var/headref in thralls)
var/datum/mind/head = locate(headref)
for(var/datum/mind/t_mind in thralls[headref])
if(t_mind.current)
if(t_mind.current.client)
for(var/image/I in t_mind.current.client.images)
if((I.icon_state == "vampthrall" || I.icon_state == "vampire") && I.loc == vampire_mind.current)
//world.log << "deleting [vampire_mind] overlay"
del(I)
if(head)
//world.log << "found [head.name]"
if(head.current)
if(head.current.client)
for(var/image/I in head.current.client.images)
if((I.icon_state == "vampthrall" || I.icon_state == "vampire") && I.loc == vampire_mind.current)
//world.log << "deleting [vampire_mind] overlay"
del(I)
if(vampire_mind.current)
if(vampire_mind.current.client)
for(var/image/I in vampire_mind.current.client.images)
if(I.icon_state == "vampthrall" || I.icon_state == "vampire")
del(I)
/datum/game_mode/proc/remove_vampire_mind(datum/mind/vampire_mind, datum/mind/head)
//var/list/removal
if(!istype(head))
head = vampire_mind //workaround for removing a thrall's control over the enthralled
var/ref = "\ref[head]"
if(ref in thralls)
thralls[ref] -= vampire_mind
enthralled -= vampire_mind
vampire_mind.special_role = null
update_vampire_icons_removed(vampire_mind)
//world << "Removed [vampire_mind.current.name] from vampire shit"
vampire_mind.current << "\red The fog clouding your mind clears. You remember nothing from the moment you were enthralled until now."
/mob/living/carbon/human/proc/check_sun()
var/ax = x
var/ay = y
for(var/i = 1 to 20)
ax += sun.dx
ay += sun.dy
var/turf/T = locate( round(ax,0.5),round(ay,0.5),z)
if(T.x == 1 || T.x==world.maxx || T.y==1 || T.y==world.maxy)
break
if(T.density)
return
vamp_burn()
/mob/living/carbon/human/proc/handle_vampire()
if(hud_used)
if(!hud_used.vampire_blood_display)
hud_used.vampire_hud()
hud_used.human_hud('icons/mob/screen1_Vampire.dmi')
hud_used.vampire_blood_display.maptext_width = 64
hud_used.vampire_blood_display.maptext_height = 26
hud_used.vampire_blood_display.maptext = " U:[mind.vampire.bloodusable]
T:[mind.vampire.bloodtotal]
"
handle_vampire_cloak()
if(istype(loc, /turf/space))
check_sun()
if(istype(loc.loc, /area/chapel) && !(VAMP_FULL in src.mind.vampire.powers))
vamp_burn()
mind.vampire.nullified = max(0, mind.vampire.nullified - 1)
mob/living/carbon/human/proc/vamp_burn()
if(prob(35))
switch(health)
if(80 to 100)
src << "\red Your skin flakes away..."
if(60 to 80)
src << "Your skin sizzles!"
if((-INFINITY) to 60)
if(!on_fire)
src << "\red Your skin catches fire!"
else
src << "\red You continue to burn!"
fire_stacks += 5
IgniteMob()
emote("scream")
else
switch(health)
if((-INFINITY) to 60)
fire_stacks++
IgniteMob()
adjustFireLoss(3)
return