Ashdrake noms (#2868)

* Initial commit

* probably a better way to check this

* It compiled boys. Let's see if it works.

* IT WAS ALL NULLS, BOYS

* Hooray, it's not broken anymore boys!

* Well it works, but we need transfer IDs to work

locating them post-initialize would help, probably. Then assigning their
links soon after.

* Bellies linked, autotransfer, LoseTarget

* half-thought sanity check needs to go away

* A few last minute tweaks.
This commit is contained in:
Poojawa
2017-09-21 06:29:08 -05:00
committed by GitHub
parent 5b38d23bfd
commit aec48daa0a
11 changed files with 239 additions and 39 deletions
@@ -228,6 +228,9 @@
if(!target || !CanAttack(target))
LoseTarget()
return 0
if(isturf(target.loc))
LoseTarget()
return 0
if(target in possible_targets)
if(target.z != z)
LoseTarget()
@@ -60,6 +60,7 @@ Difficulty: Medium
score_type = DRAKE_SCORE
deathmessage = "collapses into a pile of bones, its flesh sloughing away."
death_sound = 'sound/magic/demon_dies.ogg'
no_vore = FALSE
/mob/living/simple_animal/hostile/megafauna/dragon/Initialize()
. = ..()
@@ -0,0 +1,50 @@
/mob/living/simple_animal/hostile/megafauna/dragon
vore_active = TRUE
/mob/living/simple_animal/hostile/megafauna/dragon/Initialize()
// Create and register 'stomachs'
var/datum/belly/megafauna/dragon/maw/maw = new(src)
var/datum/belly/megafauna/dragon/gullet/gullet = new(src)
var/datum/belly/megafauna/dragon/gut/gut = new(src)
for(var/datum/belly/X in list(maw, gullet, gut))
vore_organs[X.name] = X
// Connect 'stomachs' together
maw.transferlocation = gullet
gullet.transferlocation = gut
vore_selected = maw.name // NPC eats into maw
return ..()
/datum/belly/megafauna/dragon
human_prey_swallow_time = 50 // maybe enough to switch targets if distracted
nonhuman_prey_swallow_time = 50
/datum/belly/megafauna/dragon/maw
name = "maw"
inside_flavor = "The maw of the dreaded Ash drake closes around you, engulfing you into a swelteringly hot, disgusting enviroment. The acidic saliva tingles over your form while that tongue pushes you further back...towards the dark gullet beyond."
vore_verb = "scoop"
vore_sound = 'sound/vore/pred/taurswallow.ogg'
swallow_time = 20
escapechance = 25
// From above, will transfer into gullet
transferchance = 25
autotransferchance = 66
autotransferwait = 200
/datum/belly/megafauna/dragon/gullet
name = "gullet"
inside_flavor = "A ripple of muscle and arching of the tongue pushes you down like any other food. No choice in the matter, you're simply consumed. The dark ambiance of the outside world is replaced with working, wet flesh. Your only light being what you brought with you."
swallow_time = 60 // costs extra time to eat directly to here
escapechance = 5
// From above, will transfer into gut
transferchance = 25
autotransferchance = 50
autotransferwait = 200
/datum/belly/megafauna/dragon/gut
name = "stomach"
vore_capacity = 5 //I doubt this many people will actually last in the gut, but...
inside_flavor = "With a rush of burning ichor greeting you, you're introduced to the Drake's stomach. Wrinkled walls greedily grind against you, acidic slimes working into your body as you become fuel and nutriton for a superior predator. All that's left is your body's willingness to resist your destiny."
digest_mode = DM_DRAGON
digest_burn = 5
swallow_time = 100 // costs extra time to eat directly to here
escapechance = 0
@@ -89,11 +89,15 @@
. = ..()
if(. && isliving(target))
var/mob/living/L = target
if(L.stat != DEAD)
if(!client && ranged && ranged_cooldown <= world.time)
OpenFire()
if(L.stat >= SOFT_CRIT)
if(vore_active == TRUE && L.devourable == TRUE)
dragon_feeding(src,L)
else if(L.stat == DEAD)
devour(L)
else
devour(L)
if(L.stat != DEAD)
if(!client && ranged && ranged_cooldown <= world.time)
OpenFire()
/mob/living/simple_animal/hostile/megafauna/proc/devour(mob/living/L)
if(!L)
@@ -4,15 +4,15 @@
devourable = FALSE //insurance because who knows.
var/vore_active = FALSE // If vore behavior is enabled for this mob
var/vore_capacity = 1 // The capacity (in people) this person can hold
var/vore_default_mode = DM_DIGEST // Default bellymode (DM_DIGEST, DM_HOLD, DM_ABSORB)
var/vore_digest_chance = 25 // Chance to switch to digest mode if resisted
var/vore_absorb_chance = 0 // Chance to switch to absorb mode if resisted
var/vore_escape_chance = 25 // Chance of resisting out of mob
var/vore_stomach_name // The name for the first belly if not "stomach"
var/vore_stomach_flavor // The flavortext for the first belly if not the default
var/vore_fullness = 0 // How "full" the belly is (controls icons)
// Release belly contents beforey being gc'd!
/mob/living/simple_animal/Destroy()
@@ -22,6 +22,37 @@
prey_excludes.Cut()
. = ..()
// Update fullness based on size & quantity of belly contents
/mob/living/simple_animal/proc/update_fullness(var/atom/movable/M)
var/new_fullness = 0
for(var/I in vore_organs)
var/datum/belly/B = vore_organs[I]
if (!(M in B.internal_contents))
return FALSE // Nothing's inside
new_fullness += M
vore_fullness = new_fullness
/mob/living/simple_animal/proc/swallow_check()
for(var/I in vore_organs)
var/datum/belly/B = vore_organs[I]
if(vore_active)
update_fullness()
if(!vore_fullness)
// Nothing
return
else
addtimer(CALLBACK(src, .proc/swallow_mob), B.swallow_time)
/mob/living/simple_animal/proc/swallow_mob()
for(var/I in vore_organs)
var/datum/belly/B = vore_organs[I]
for(var/mob/living/M in B.internal_contents)
B.transfer_contents(M, B.transferlocation)
/mob/living/simple_animal/death()
for(var/I in vore_organs)
var/datum/belly/B = vore_organs[I]
@@ -69,4 +100,3 @@
"The stomach glorps and gurgles as it tries to work you into slop.")
src.vore_organs[B.name] = B
src.vore_selected = B.name