Skip to content

Commit

Permalink
Merge pull request ParadiseSS13#13462 from SteelSlayer/bloodcrawl-mim…
Browse files Browse the repository at this point in the history
…ery-traits

Replaces the bloodcrawl variable with a trait
  • Loading branch information
Fox-McCloud authored May 23, 2020
2 parents 5c0b938 + c9f92cf commit 707258f
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 20 deletions.
4 changes: 3 additions & 1 deletion code/__HELPERS/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 4 additions & 1 deletion code/_globalvars/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions code/game/gamemodes/miniantags/slaughter/bloodcrawl.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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>")
Expand Down
34 changes: 19 additions & 15 deletions code/game/gamemodes/miniantags/slaughter/slaughter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
see_in_dark = 8
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
var/boost = 0
bloodcrawl = BLOODCRAWL_EAT


var/devoured = 0
Expand All @@ -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()
Expand Down Expand Up @@ -247,33 +247,37 @@
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)
// Eating the heart for the first time. Gives basic bloodcrawling. This is the only time we need to insert the heart.
if(!HAS_TRAIT(user, TRAIT_BLOODCRAWL))
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)
ADD_TRAIT(user, TRAIT_BLOODCRAWL, "bloodcrawl")
user.drop_item()
insert(user) //Consuming the heart literally replaces your heart with a demon heart. H A R D C O R E.
return TRUE

// Eating a 2nd heart. Gives the ability to drag people into blood and eat them.
if(HAS_TRAIT(user, TRAIT_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>")
ADD_TRAIT(user, 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

user.drop_item()
insert(user) //Consuming the heart literally replaces your heart with a demon heart. H A R D C O R E
// Eating any more than 2 demon hearts does nothing.
to_chat(user, "<span class='warning'>...and you don't feel any different.</span>")
qdel(src)

/obj/item/organ/internal/heart/demon/insert(mob/living/carbon/M, special = 0)
..()
. = ..()
if(M.mind)
M.mind.AddSpell(new /obj/effect/proc_holder/spell/bloodcrawl(null))

/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()
Expand Down
1 change: 0 additions & 1 deletion code/modules/mob/living/living_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 707258f

Please sign in to comment.