Devour fixes and improvements. Allows dionae to devour. (#7887)

Dionae now have a stomach organ, which means they can devour. It has a bigger capacity than usual.
    Dionae can now devour big objects as well. Just pick them up and click on yourself while aiming mouth.
    Unathi can now actually devour tiny items.
    Unathi can now devour any mob smaller than them.
This commit is contained in:
Matt Atlas
2020-01-02 23:53:59 +02:00
committed by Erki
parent d7eb48cee4
commit c052a742aa
9 changed files with 142 additions and 85 deletions
@@ -0,0 +1,63 @@
/obj/item/organ/internal/diona/process()
return
/obj/item/organ/internal/diona/strata
name = "neural strata"
parent_organ = BP_CHEST
organ_tag = "neural strata"
/obj/item/organ/internal/diona/bladder
name = "gas bladder"
parent_organ = BP_HEAD
organ_tag = "gas bladder"
/obj/item/organ/internal/diona/polyp
name = "polyp segment"
parent_organ = BP_GROIN
organ_tag = "polyp segment"
/obj/item/organ/internal/diona/ligament
name = "anchoring ligament"
parent_organ = BP_GROIN
organ_tag = "anchoring ligament"
/obj/item/organ/internal/diona
name = "diona nymph"
icon = 'icons/obj/objects.dmi'
icon_state = "nymph"
organ_tag = "special" // Turns into a nymph instantly, no transplanting possible.
/obj/item/organ/internal/diona/removed(var/mob/living/user)
var/mob/living/carbon/human/H = owner
..()
if(!istype(H) || !H.organs || !H.organs.len)
H.death()
// These are different to the standard diona organs as they have a purpose in other
// species (absorbing radiation and light respectively)
/obj/item/organ/internal/diona/nutrients
name = "nutrient channel"
parent_organ = BP_CHEST
organ_tag = "nutrient channel"
icon = 'icons/mob/npc/alien.dmi'
icon_state = "claw"
/obj/item/organ/internal/diona/nutrients/removed()
return
/obj/item/organ/internal/diona/node
name = "response node"
parent_organ = BP_HEAD
organ_tag = "response node"
icon = 'icons/mob/npc/alien.dmi'
icon_state = "claw"
/obj/item/organ/internal/diona/node/removed()
return
/obj/item/organ/internal/stomach/diona
name = "digestion chamber"
should_process_alcohol = FALSE
icon = 'icons/mob/npc/alien.dmi'
icon_state = "chitin"
+17 -12
View File
@@ -7,9 +7,9 @@
dead_icon = "stomach"
organ_tag = BP_STOMACH
parent_organ = BP_GROIN
var/stomach_capacity
var/datum/reagents/metabolism/ingested
var/next_cramp = 0
var/should_process_alcohol = TRUE
/obj/item/organ/internal/stomach/Destroy()
QDEL_NULL(ingested)
@@ -104,8 +104,7 @@
if(functioning)
for(var/mob/living/M in contents)
if(M.stat == DEAD)
qdel(M)
continue
addtimer(CALLBACK(src, .proc/digest_mob, M), 30 SECONDS, TIMER_UNIQUE)
M.adjustBruteLoss(3)
M.adjustFireLoss(3)
@@ -119,15 +118,21 @@
next_cramp = world.time + rand(200,800)
owner.custom_pain("Your stomach cramps agonizingly!",1)
var/alcohol_volume = ingested.get_reagent_amount(/datum/reagent/alcohol/ethanol)
// Alcohol counts as double volume for the purposes of vomit probability
var/effective_volume = ingested.total_volume + alcohol_volume
// Just over the limit, the probability will be low. It rises a lot such that at double ingested it's 64% chance.
var/vomit_probability = (effective_volume / STOMACH_VOLUME) ** 6
if(prob(vomit_probability))
owner.vomit()
if(should_process_alcohol)
var/alcohol_volume = ingested.get_reagent_amount(/datum/reagent/alcohol/ethanol)
// Alcohol counts as double volume for the purposes of vomit probability
var/effective_volume = ingested.total_volume + alcohol_volume
// Just over the limit, the probability will be low. It rises a lot such that at double ingested it's 64% chance.
var/vomit_probability = (effective_volume / STOMACH_VOLUME) ** 6
if(prob(vomit_probability))
owner.vomit()
/obj/item/organ/internal/stomach/proc/digest_mob(mob/M)
if(!QDELETED(M))
qdel(M)
#undef STOMACH_VOLUME
#undef PUKE_ACTION_NAME
+5 -63
View File
@@ -25,6 +25,11 @@
name = "tendril"
limb_flags = 0
/obj/item/organ/external/diona/removed(var/mob/living/user)
..()
if(spawn_diona_nymph(get_turf(src)))
qdel(src)
/obj/item/organ/external/chest/diona
name = "core trunk"
limb_name = "chest"
@@ -172,66 +177,3 @@
joint = "structural ligament"
amputation_point = "branch"
vital = FALSE // Lore team requested this, not vital organ. We can still live without it.
/obj/item/organ/internal/diona/process()
return
/obj/item/organ/internal/diona/strata
name = "neural strata"
parent_organ = BP_CHEST
organ_tag = "neural strata"
/obj/item/organ/internal/diona/bladder
name = "gas bladder"
parent_organ = BP_HEAD
organ_tag = "gas bladder"
/obj/item/organ/internal/diona/polyp
name = "polyp segment"
parent_organ = BP_GROIN
organ_tag = "polyp segment"
/obj/item/organ/internal/diona/ligament
name = "anchoring ligament"
parent_organ = BP_GROIN
organ_tag = "anchoring ligament"
/obj/item/organ/internal/diona
name = "diona nymph"
icon = 'icons/obj/objects.dmi'
icon_state = "nymph"
organ_tag = "special" // Turns into a nymph instantly, no transplanting possible.
/obj/item/organ/internal/diona/removed(var/mob/living/user)
var/mob/living/carbon/human/H = owner
..()
if(!istype(H) || !H.organs || !H.organs.len)
H.death()
/obj/item/organ/external/diona/removed(var/mob/living/user)
..()
if(spawn_diona_nymph(get_turf(src)))
qdel(src)
// These are different to the standard diona organs as they have a purpose in other
// species (absorbing radiation and light respectively)
/obj/item/organ/internal/diona/nutrients
name = "nutrient channel"
parent_organ = BP_CHEST
organ_tag = "nutrient channel"
icon = 'icons/mob/npc/alien.dmi'
icon_state = "claw"
/obj/item/organ/internal/diona/nutrients/removed()
return
/obj/item/organ/internal/diona/node
name = "response node"
parent_organ = BP_HEAD
organ_tag = "response node"
icon = 'icons/mob/npc/alien.dmi'
icon_state = "claw"
/obj/item/organ/internal/diona/node/removed()
return