Skip to content

Commit

Permalink
Shadowling Invasion
Browse files Browse the repository at this point in the history
  • Loading branch information
ThaumicNik committed Oct 8, 2024
1 parent 2e3ac2b commit 86fd1dd
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 8 deletions.
2 changes: 2 additions & 0 deletions modular_ss220/antagonists/_antagonists.dme
Original file line number Diff line number Diff line change
Expand Up @@ -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"
10 changes: 8 additions & 2 deletions modular_ss220/antagonists/code/shadowlings/father_of_shadows.dm
Original file line number Diff line number Diff line change
@@ -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 = "отец теней"
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Check failure on line 25 in modular_ss220/antagonists/code/shadowlings/shadowling_datum.dm

View workflow job for this annotation

GitHub Actions / Run Linters

Check Grep

modular_ss220/antagonists/code/shadowlings/shadowling_datum.dm:25: Changed files contains a proc argument starting with 'var'.
return TRUE

Expand Down
26 changes: 26 additions & 0 deletions modular_ss220/antagonists/code/shadowlings/shadowling_gamemode.dm
Original file line number Diff line number Diff line change
@@ -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--

3 changes: 3 additions & 0 deletions modular_ss220/antagonists/code/shadowlings/shadowling_mob.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/mob/living/carbon/human/shadow/ling/Initialize(mapload)
. = ..(mapload, /datum/species/shadow/ling)

Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 86fd1dd

Please sign in to comment.