diff --git a/modular_ss220/antagonists/_antagonists.dme b/modular_ss220/antagonists/_antagonists.dme index b06b95963a35..ba730e2ae2b9 100644 --- a/modular_ss220/antagonists/_antagonists.dme +++ b/modular_ss220/antagonists/_antagonists.dme @@ -21,3 +21,5 @@ #include "code/shadowlings/spells/shadow_father_crawl.dm" #include "code/shadowlings/father_of_shadows.dm" #include "code/shadowlings/shadowling_traps.dm" +#include "code/shadowlings/shadowling_gamemode.dm" +#include "code/shadowlings/shadowling_mob.dm" diff --git a/modular_ss220/antagonists/code/shadowlings/father_of_shadows.dm b/modular_ss220/antagonists/code/shadowlings/father_of_shadows.dm index 921e64df0da2..28f346c8cc8a 100644 --- a/modular_ss220/antagonists/code/shadowlings/father_of_shadows.dm +++ b/modular_ss220/antagonists/code/shadowlings/father_of_shadows.dm @@ -1,5 +1,5 @@ #define HEALTH_DECREASING_AMOUNT 70 -#define MAX_CONSUMED_CORPSES 5 +#define MAX_CONSUMED_CORPSES 4 /mob/living/simple_animal/demon/shadow_father // Can't inherit from demon/shadow because of 'initialize' proc name = "отец теней" @@ -67,6 +67,11 @@ else adjustBruteLoss(-20) +/mob/living/simple_animal/demon/shadow_father/death(gibbed) + if(consumed > 0) + SSticker.mode.begin_shadowling_invasion(src, FALSE) + . = ..() + /mob/living/simple_animal/demon/shadow_father/proc/check_darkness() var/turf/T = get_turf(src) var/lum_count = T.get_lumcount() @@ -97,6 +102,7 @@ new /datum/spell/shadowling/self/place_trap/stun, new /datum/spell/shadowling/self/place_trap/poison, new /datum/spell/shadowling/self/place_trap/blindness, + new /datum/spell/shadowling/self/tear_the_reality, ) for(var/datum/spell/spell in spells_to_grant) AddSpell(spell) @@ -134,7 +140,7 @@ is_consuming = FALSE return - target.visible_message(span_danger("[src] полностью [target] тенями и тело исчезает в потусторонней пелене! [src], похоже, стал слабее!")) + target.visible_message(span_danger("[src] полностью окутывает [target] тенями и тело исчезает в потусторонней пелене! [src], похоже, стал слабее!")) qdel(target) playsound(src, 'modular_ss220/antagonists/sound/shadowlings/shadow_consumption_end.ogg', 50, TRUE) maxHealth -= HEALTH_DECREASING_AMOUNT diff --git a/modular_ss220/antagonists/code/shadowlings/shadowling_datum.dm b/modular_ss220/antagonists/code/shadowlings/shadowling_datum.dm index 33b3cc223b9c..b7126c42c722 100644 --- a/modular_ss220/antagonists/code/shadowlings/shadowling_datum.dm +++ b/modular_ss220/antagonists/code/shadowlings/shadowling_datum.dm @@ -22,12 +22,6 @@ special_role = SPECIAL_ROLE_SHADOWLING_THRALL wiki_page_name = "Shadowlings" -/datum/game_mode - var/list/datum/mind/shadowlings = list() - var/list/datum/mind/shadowling_thralls = list() - var/list/datum/mind/shadow_fathers = list() - var/victory_warning_announced = FALSE - /proc/is_thrall(var/mob/living/M) return TRUE diff --git a/modular_ss220/antagonists/code/shadowlings/shadowling_gamemode.dm b/modular_ss220/antagonists/code/shadowlings/shadowling_gamemode.dm new file mode 100644 index 000000000000..c631aa774ff8 --- /dev/null +++ b/modular_ss220/antagonists/code/shadowlings/shadowling_gamemode.dm @@ -0,0 +1,26 @@ +/datum/game_mode + var/list/datum/mind/shadowlings = list() + var/list/datum/mind/shadowling_thralls = list() + var/list/datum/mind/shadow_fathers = list() + var/victory_warning_announced = FALSE + +/// Called when shadow father is killed or when special spell is used +/datum/game_mode/proc/begin_shadowling_invasion(mob/living/simple_animal/demon/shadow_father/father, spell_used) + father.consumed++ //At least one shadowling + var/list/mob/dead/observer/candidates = SSghost_spawns.poll_candidates("Вы хотите поиграть за тенелинга?", ROLE_SHADOWLING, TRUE, 25 SECONDS, source = /mob/living/simple_animal/demon/shadow_father, role_cleanname = "Shadowling") + while(father.consumed > 0) + var/player_to_spawn + if(spell_used) // Granting shadowling role for father that commited suicide + player_to_spawn = father.key + spell_used = FALSE + else + var/list/mob/dead/observer/ghost = pick(candidates) + player_to_spawn = ghost.key + if(isnull(player_to_spawn)) + break + var/obj/effect/dummy/slaughter/holder = new /obj/effect/dummy/slaughter(father.loc) + var/mob/living/carbon/human/shadow/ling/ling = new /mob/living/carbon/human/shadow/ling(holder) + dust_if_respawnable(player_to_spawn) + ling.key = player_to_spawn + father.consumed-- + diff --git a/modular_ss220/antagonists/code/shadowlings/shadowling_mob.dm b/modular_ss220/antagonists/code/shadowlings/shadowling_mob.dm new file mode 100644 index 000000000000..0730fd5f7c27 --- /dev/null +++ b/modular_ss220/antagonists/code/shadowlings/shadowling_mob.dm @@ -0,0 +1,3 @@ +/mob/living/carbon/human/shadow/ling/Initialize(mapload) + . = ..(mapload, /datum/species/shadow/ling) + diff --git a/modular_ss220/antagonists/code/shadowlings/spells/shadowling_tear_the_reality.dm b/modular_ss220/antagonists/code/shadowlings/spells/shadowling_tear_the_reality.dm new file mode 100644 index 000000000000..d05224a2d21c --- /dev/null +++ b/modular_ss220/antagonists/code/shadowlings/spells/shadowling_tear_the_reality.dm @@ -0,0 +1,20 @@ +/datum/spell/shadowling/self/tear_the_reality + name = "Прорвать реальность" + desc = "Вы используете накопленную от поглощённых смертных силу, чтобы создать разрыв в реальности и призвать в этот мир своих детей. Летально для вас, но гарантирует то, что ваш дух возродится в одном из детей." + base_cooldown = 0 SECONDS + stat_allowed = UNCONSCIOUS + action_icon_state = "ascend" + +/datum/spell/shadowling/self/tear_the_reality/can_cast(mob/user, charge_check, show_message) + . = ..() + if(!istype(user, /mob/living/simple_animal/demon/shadow_father)) + return FALSE + var/mob/living/simple_animal/demon/shadow_father/father = user + if(father.consumed < 1) + to_chat(father, span_warning("Вам нужно поглотить как минимум одного смертного, чтобы прорвать реальность.")) + return FALSE + var/confirm = tgui_alert(father, "Вы уверены что хотите закончить свою охоту и прорвать реальность? Вы призовёте [father.consumed + 1] тенелингов и гарантированно станите одним из них.", "Закончить охоту?", list("Да", "Я ещё поохочусь")) + if(confirm != "Да") + return + SSticker.mode.begin_shadowling_invasion(father, TRUE) +