diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 7125eeec282..1e95c7b8977 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -68,6 +68,7 @@ var/assistantratio = 2 //how many assistants to security members var/traitor_objectives_amount = 2 + var/shadowling_max_age = 0 var/max_maint_drones = 5 //This many drones can spawn, var/allow_drone_spawn = 1 //assuming the admin allow them to. @@ -260,6 +261,9 @@ if("jobs_have_minimal_access") config.jobs_have_minimal_access = 1 + if("shadowling_max_age") + config.shadowling_max_age = text2num(value) + if("log_ooc") config.log_ooc = 1 diff --git a/code/game/gamemodes/shadowling/shadowling.dm b/code/game/gamemodes/shadowling/shadowling.dm index f5fc513744a..439d3cb237d 100644 --- a/code/game/gamemodes/shadowling/shadowling.dm +++ b/code/game/gamemodes/shadowling/shadowling.dm @@ -201,11 +201,23 @@ Made by Xhuis /datum/game_mode/shadowling/check_finished() var/shadows_alive = 0 //and then shadowling was kill for(var/datum/mind/shadow in shadows) //but what if shadowling was not kill? - if(!istype(shadow.current,/mob/living/carbon/human) && !istype(shadow.current,/mob/living/simple_animal/ascendant_shadowling)) + if(!ishuman(shadow.current) && !istype(shadow.current,/mob/living/simple_animal/ascendant_shadowling)) continue if(shadow.current.stat == DEAD) continue shadows_alive++ + if(shadow.special_role == SPECIAL_ROLE_SHADOWLING && config.shadowling_max_age) + if(ishuman(shadow.current)) + var/mob/living/carbon/human/H = shadow.current + if(H.get_species() != "Shadow") + for(var/obj/effect/proc_holder/spell/targeted/shadowling_hatch/hatch_ability in shadow.spell_list) + hatch_ability.cycles_unused++ + if(!H.stunned && prob(20) && hatch_ability.cycles_unused > config.shadowling_max_age) + var/shadow_nag_messages = list("You can barely hold yourself in this lesser form!", "The urge to become something greater is overwhelming!", "You feel a burning passion to hatch free of this shell and assume godhood!") + H.take_overall_damage(0, 3) + to_chat(H, "[pick(shadow_nag_messages)]") + H << 'sound/weapons/sear.ogg' + if(shadows_alive) return ..() else diff --git a/code/game/gamemodes/shadowling/special_shadowling_abilities.dm b/code/game/gamemodes/shadowling/special_shadowling_abilities.dm index 353fd328f4c..bc58db4b064 100644 --- a/code/game/gamemodes/shadowling/special_shadowling_abilities.dm +++ b/code/game/gamemodes/shadowling/special_shadowling_abilities.dm @@ -9,6 +9,7 @@ var/list/possibleShadowlingNames = list("U'ruan", "Y`shej", "Nex", "Hel-uae", "N range = -1 include_user = 1 action_icon_state = "hatch" + var/cycles_unused = 0 /obj/effect/proc_holder/spell/targeted/shadowling_hatch/cast(list/targets, mob/user = usr) if(user.stat || !ishuman(user) || !user || !is_shadow(user || isinspace(user))) diff --git a/config/example/config.txt b/config/example/config.txt index d575635baeb..2dcd5da6573 100644 --- a/config/example/config.txt +++ b/config/example/config.txt @@ -95,6 +95,9 @@ PROBABILITY EXTENDED 2 PROBABILITY NUCLEAR 3 PROBABILITY ABDUCTION 0 +# MAXIMUM SECONDS SHADOWLINGS CAN REMAIN UNHATCHED BEFORE THEY TAKE DAMAGE +SHADOWLING_MAX_AGE 0 + ## Hash out to disable random events during the round. ALLOW_RANDOM_EVENTS