bloodcrawl trait

This commit is contained in:
SteelSlayer
2020-05-20 14:55:50 -05:00
parent 401fa0ebe5
commit 3085305eaa
5 changed files with 34 additions and 24 deletions
+3 -1
View File
@@ -62,7 +62,9 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
//mob traits
#define TRAIT_PACIFISM "pacifism"
#define TRAIT_WATERBREATH "waterbreathing"
#define TRAIT_WATERBREATH "waterbreathing"
#define TRAIT_BLOODCRAWL "bloodcrawl"
#define TRAIT_BLOODCRAWL_EAT "bloodcrawl_eat"
// common trait sources
#define ROUNDSTART_TRAIT "roundstart" //cannot be removed without admin intervention
+4 -1
View File
@@ -5,7 +5,10 @@
*/
GLOBAL_LIST_INIT(traits_by_type, list(
/mob = list(
"TRAIT_PACIFISM" = TRAIT_PACIFISM
"TRAIT_PACIFISM" = TRAIT_PACIFISM,
"TRAIT_WATERBREATH" = TRAIT_WATERBREATH,
"BLOODCRAWL" = TRAIT_BLOODCRAWL,
"BLOODCRAWL_EAT" = TRAIT_BLOODCRAWL_EAT
)))
/// value -> trait name, generated on use from trait_by_type global
@@ -35,8 +35,8 @@
animation.dir = dir
ExtinguishMob()
if(pulling && bloodcrawl == BLOODCRAWL_EAT)
if(istype(pulling, /mob/living/))
if(pulling && HAS_TRAIT(src, TRAIT_BLOODCRAWL_EAT))
if(isliving(pulling))
var/mob/living/victim = pulling
if(victim.stat == CONSCIOUS)
visible_message("<span class='warning'>[victim] kicks free of [B] just before entering it!</span>")
@@ -35,7 +35,6 @@
see_in_dark = 8
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
var/boost = 0
bloodcrawl = BLOODCRAWL_EAT
var/devoured = 0
@@ -59,6 +58,7 @@
/mob/living/simple_animal/slaughter/New()
..()
remove_from_all_data_huds()
ADD_TRAIT(src, TRAIT_BLOODCRAWL_EAT, "bloodcrawl_eat")
var/obj/effect/proc_holder/spell/bloodcrawl/bloodspell = new
AddSpell(bloodspell)
whisper_action = new()
@@ -247,33 +247,39 @@
user.visible_message("<span class='warning'>[user] raises [src] to [user.p_their()] mouth and tears into it with [user.p_their()] teeth!</span>", \
"<span class='danger'>An unnatural hunger consumes you. You raise [src] to your mouth and devour it!</span>")
playsound(user, 'sound/misc/demon_consume.ogg', 50, 1)
for(var/obj/effect/proc_holder/spell/knownspell in user.mind.spell_list)
if(knownspell.type == /obj/effect/proc_holder/spell/bloodcrawl)
qdel(src)
return
if(user.bloodcrawl == 0)
user.visible_message("<span class='warning'>[user]'s eyes flare a deep crimson!</span>", \
"<span class='userdanger'>You feel a strange power seep into your body... you have absorbed the demon's blood-travelling powers!</span>")
user.bloodcrawl = BLOODCRAWL
else if(user.bloodcrawl == BLOODCRAWL)
to_chat(user, "You feel diffr-<span class = 'danger'> CONSUME THEM! </span>")
user.bloodcrawl = BLOODCRAWL_EAT
else
to_chat(user, "<span class='warning'>...and you don't feel any different.</span>")
user.drop_item()
insert(user) //Consuming the heart literally replaces your heart with a demon heart. H A R D C O R E
/obj/item/organ/internal/heart/demon/insert(mob/living/carbon/M, special = 0)
..()
if(M.mind)
if(!M.mind)
return
// Eating the heart for the first time. Gives basic bloodcrawling.
if(!HAS_TRAIT(M, TRAIT_BLOODCRAWL))
M.visible_message("<span class='warning'>[M]'s eyes flare a deep crimson!</span>", \
"<span class='userdanger'>You feel a strange power seep into your body... you have absorbed the demon's blood-travelling powers!</span>")
M.mind.AddSpell(new /obj/effect/proc_holder/spell/bloodcrawl(null))
ADD_TRAIT(M, TRAIT_BLOODCRAWL, "bloodcrawl")
return ..() // The only time we actually need to replace the user's heart with the demon heart.
// Eating a 2nd heart. Gives the ability to drag people into blood and eat them.
if(HAS_TRAIT(M, TRAIT_BLOODCRAWL))
to_chat(M, "You feel diffr-<span class = 'danger'> CONSUME THEM! </span>")
ADD_TRAIT(M, TRAIT_BLOODCRAWL_EAT, "bloodcrawl_eat")
qdel(src) // Replacing their demon heart with another demon heart is pointless, just delete this one and return.
return TRUE
// Eating any more than 2 demon hearts does nothing.
else
to_chat(M, "<span class='warning'>...and you don't feel any different.</span>")
qdel(src)
return
/obj/item/organ/internal/heart/demon/remove(mob/living/carbon/M, special = 0)
..()
if(M.mind)
M.bloodcrawl = 0
REMOVE_TRAIT(M, TRAIT_BLOODCRAWL, "bloodcrawl")
REMOVE_TRAIT(M, TRAIT_BLOODCRAWL_EAT, "bloodcrawl_eat")
M.mind.RemoveSpell(/obj/effect/proc_holder/spell/bloodcrawl)
/obj/item/organ/internal/heart/demon/Stop()
@@ -33,7 +33,6 @@
var/metabolism_efficiency = 1 //more or less efficiency to metabolize helpful/harmful reagents and regulate body temperature..
var/digestion_ratio = 1 //controls how quickly reagents metabolize; largely governered by species attributes.
var/bloodcrawl = 0 //0 No blood crawling, 1 blood crawling, 2 blood crawling+mob devour
var/holder = null //The holder for blood crawling
var/ventcrawler = 0 //0 No vent crawling, 1 vent crawling in the nude, 2 vent crawling always