diff --git a/code/modules/antagonists/morph/morph.dm b/code/modules/antagonists/morph/morph.dm index f5b9d2e40ed6..a160534abab2 100644 --- a/code/modules/antagonists/morph/morph.dm +++ b/code/modules/antagonists/morph/morph.dm @@ -37,6 +37,8 @@ var/eat_while_disguised = FALSE var/atom/movable/form = null var/morph_time = 0 + var/eat_count = 0 + var/corpse_eat_count = 0 var/static/list/blacklist_typecache = typecacheof(list( /obj/screen, /obj/singularity, @@ -199,16 +201,24 @@ if(L.stat == DEAD) if(do_after(src, 3 SECONDS, target = L)) if(eat(L)) + eat_count++ + corpse_eat_count++ adjustHealth(-50) return else if(isitem(target)) //Eat items just to be annoying var/obj/item/I = target if(!I.anchored) if(do_after(src, 2 SECONDS, target = I)) - eat(I) + if(eat(I)) + eat_count++ return return ..() +/mob/living/simple_animal/hostile/morph/get_status_tab_items() + . = ..() + . += "Things eaten: [eat_count]" + . += "Corpses eaten: [corpse_eat_count]" + //Spawn Event /datum/round_event_control/morph diff --git a/code/modules/antagonists/morph/morph_antag.dm b/code/modules/antagonists/morph/morph_antag.dm index d2e022cd7ace..376136622a7d 100644 --- a/code/modules/antagonists/morph/morph_antag.dm +++ b/code/modules/antagonists/morph/morph_antag.dm @@ -4,20 +4,88 @@ show_in_antagpanel = FALSE show_to_ghosts = TRUE -/datum/antagonist/morph/proc/forge_objectives() - var/datum/objective/new_objective = new - new_objective.owner = owner - new_objective.completed = TRUE - objectives += new_objective - new_objective.explanation_text = "Consume everything." // you can do whatever - var/datum/objective/survive/survival = new - survival.owner = owner - objectives += survival // just dont die doing it +/datum/antagonist/morph/roundend_report() + var/list/parts = list() + parts += printplayer(owner) + if(istype(owner.current, /mob/living/simple_animal/hostile/morph)) + var/mob/living/simple_animal/hostile/morph/M = owner.current + parts += "Things eaten: [M.eat_count]" + parts += "Corpses eaten: [M.corpse_eat_count]" + parts += printobjectives(objectives) + return parts.Join("
") /datum/antagonist/morph/on_gain() forge_objectives() . = ..() -/datum/antagonist/nightmare/greet() +/datum/antagonist/morph/proc/forge_objectives() + if(prob(33)) // Get both objectives + var/datum/objective/morph_eat_things/eat = new + eat.owner = owner + eat.update_explanation_text() + objectives += eat // Consume x objects + var/datum/objective/morph_eat_things/eatcorpses = new + eatcorpses.owner = owner + eatcorpses.update_explanation_text() + objectives += eatcorpses // Consume x corpses + else + if(prob(50)) + var/datum/objective/morph_eat_things/eat = new + eat.owner = owner + eat.update_explanation_text() + objectives += eat // Consume x objects + else + var/datum/objective/morph_eat_things/eatcorpses = new + eatcorpses.owner = owner + eatcorpses.update_explanation_text() + objectives += eatcorpses // Consume x corpses + + var/datum/objective/survive/survival = new + survival.owner = owner + objectives += survival // Don't die, idiot + + + +/datum/antagonist/morph/greet() owner.announce_objectives() - SEND_SOUND(owner.current, sound('sound/magic/demon_consume.ogg')) \ No newline at end of file + + +// Consume x objects +/datum/objective/morph_eat_things + name = "morph eat objective" + explanation_text = "Eat things." + var/target_things + +/datum/objective/morph_eat_things/update_explanation_text() + ..() + if(!target_things) + target_things = rand(20,60) + explanation_text = "Eat at least [target_things] things." + +/datum/objective/morph_eat_things/check_completion() + if(..()) + return TRUE + if(istype(owner.current, /mob/living/simple_animal/hostile/morph)) + var/mob/living/simple_animal/hostile/morph/M = owner.current + return M.eat_count >= target_things + + +// Consume x corpses +/datum/objective/morph_eat_corpses + name = "morph eat corpses objective" + explanation_text = "Eat corpses." + var/target_corpses + +/datum/objective/morph_eat_corpses/update_explanation_text() + ..() + if(!target_corpses) + target_corpses = rand(2,6) + explanation_text = "Eat at least [target_corpses] corpses." + +/datum/objective/morph_eat_corpses/check_completion() + if(..()) + return TRUE + if(istype(owner.current, /mob/living/simple_animal/hostile/morph)) + var/mob/living/simple_animal/hostile/morph/M = owner.current + return M.corpse_eat_count >= target_corpses +