From 4cf311cbf20ff13c957804a617ac4e11da71b758 Mon Sep 17 00:00:00 2001
From: GDN <96800819+GDNgit@users.noreply.github.com>
Date: Sat, 16 Mar 2024 11:12:09 -0500
Subject: [PATCH] Reworks last resort. Reverts #23992 (#24389)
* Reworks last resort. Reverts #23992
* forgot to push these
* projectiles no longer pass over headslugs
---
.../changeling/changeling_power.dm | 3 ---
.../changeling/datum_changeling.dm | 4 ---
.../antagonists/changeling/powers/absorb.dm | 4 ---
.../changeling/powers/become_headslug.dm | 25 +++++++++++++------
.../antagonists/changeling/powers/revive.dm | 4 ---
.../living/simple_animal/hostile/headslug.dm | 7 ++++--
6 files changed, 22 insertions(+), 25 deletions(-)
diff --git a/code/modules/antagonists/changeling/changeling_power.dm b/code/modules/antagonists/changeling/changeling_power.dm
index abb6ed1f284..b5d08685e4e 100644
--- a/code/modules/antagonists/changeling/changeling_power.dm
+++ b/code/modules/antagonists/changeling/changeling_power.dm
@@ -83,9 +83,6 @@
if(HAS_TRAIT(user, TRAIT_FAKEDEATH) && !bypass_fake_death)
to_chat(user, "We are incapacitated.")
return FALSE
- if(!cling.can_use_powers)
- to_chat(owner, "Our cells are repairing themselves, we are unable to use our powers!")
- return FALSE
return TRUE
// Transform the target to the chosen dna. Used in transform.dm and tiny_prick.dm (handy for changes since it's the same thing done twice)
diff --git a/code/modules/antagonists/changeling/datum_changeling.dm b/code/modules/antagonists/changeling/datum_changeling.dm
index a507ad5cfa3..f8c39e74fd9 100644
--- a/code/modules/antagonists/changeling/datum_changeling.dm
+++ b/code/modules/antagonists/changeling/datum_changeling.dm
@@ -48,10 +48,6 @@
var/datum/action/changeling/sting/chosen_sting
/// If the changeling is in the process of regenerating from their fake death.
var/regenerating = FALSE
- /// Did changeling use headslug?
- var/headslugged = FALSE
- /// Can you use abilities due to a recent revival?
- var/can_use_powers = TRUE
blurb_text_color = COLOR_PURPLE
blurb_text_outline_width = 1
diff --git a/code/modules/antagonists/changeling/powers/absorb.dm b/code/modules/antagonists/changeling/powers/absorb.dm
index eb2b08c67ca..1674c5729cf 100644
--- a/code/modules/antagonists/changeling/powers/absorb.dm
+++ b/code/modules/antagonists/changeling/powers/absorb.dm
@@ -86,10 +86,6 @@
target_cling.absorbed_dna.len = 1
target_cling.absorbed_count = 0
- if(cling.headslugged)
- cling.headslugged = FALSE
- to_chat(user, "By absorbing [target], we are once again strong enough to turn into a headslug.")
-
cling.chem_charges = min(cling.chem_charges + 10, cling.chem_storage)
cling.is_absorbing = FALSE
diff --git a/code/modules/antagonists/changeling/powers/become_headslug.dm b/code/modules/antagonists/changeling/powers/become_headslug.dm
index 06301121e98..c6e87864784 100644
--- a/code/modules/antagonists/changeling/powers/become_headslug.dm
+++ b/code/modules/antagonists/changeling/powers/become_headslug.dm
@@ -1,24 +1,33 @@
/datum/action/changeling/headslug
name = "Last Resort"
- desc = "We sacrifice our current body in a moment of need, placing us in control of a vessel that can plant our likeness in a new host. Costs 20 chemicals. We will need to absorb someone to use this ability again."
- helptext = "We will be placed in control of a small, fragile creature. We may attack a corpse like this to plant an egg which will slowly mature into a new form for us. This ability is available only once per absorption."
+ desc = "We sacrifice our current body in a moment of need, placing us in control of a vessel that can plant our likeness in a new host. Costs 20 chemicals."
+ helptext = "We will be placed in control of a small, fragile creature. We may attack a corpse like this to plant an egg which will slowly mature into a new form for us."
button_icon_state = "last_resort"
chemical_cost = 20
+ dna_cost = 2
req_human = TRUE
req_stat = DEAD
bypass_fake_death = TRUE
- power_type = CHANGELING_INNATE_POWER
+ power_type = CHANGELING_PURCHASABLE_POWER
+ category = /datum/changeling_power_category/defence
/datum/action/changeling/headslug/try_to_sting(mob/user, mob/target)
- if(cling.headslugged)
- to_chat(user, "We need to absorb a humanoid to headslug again.")
- return
if(tgui_alert(user, "Are you sure you wish to do this? This action cannot be undone.", "Sting", list("Yes", "No")) != "Yes")
return
- cling.headslugged = TRUE
..()
-/datum/action/changeling/headslug/sting_action(mob/user)
+/datum/action/changeling/headslug/sting_action(mob/living/user)
+ user.Weaken(30 SECONDS)
+ user.do_jitter_animation(1000, -1) // jitter until they are gibbed
+ user.visible_message("A loud crack erupts from [user], followed by a hiss.")
+ playsound(get_turf(user), "bonebreak", 75, TRUE)
+ playsound(get_turf(user), 'sound/machines/hiss.ogg', 75, TRUE)
+ addtimer(CALLBACK(src, PROC_REF(become_headslug), user), 5 SECONDS)
+ var/matrix/M = user.transform
+ M.Scale(1.8, 1.2)
+ animate(user, time = 5 SECONDS, transform = M, easing = SINE_EASING)
+
+/datum/action/changeling/headslug/proc/become_headslug(mob/user)
var/datum/mind/M = user.mind
var/list/organs = user.get_organs_zone("head", 1)
diff --git a/code/modules/antagonists/changeling/powers/revive.dm b/code/modules/antagonists/changeling/powers/revive.dm
index f5fc56bb495..20e4c793330 100644
--- a/code/modules/antagonists/changeling/powers/revive.dm
+++ b/code/modules/antagonists/changeling/powers/revive.dm
@@ -11,10 +11,6 @@
if(HAS_TRAIT(user, TRAIT_UNREVIVABLE))
to_chat(user, "Something is preventing us from regenerating, we will need to revive at another point.")
return FALSE
-
- cling.can_use_powers = FALSE
- addtimer(VARSET_CALLBACK(cling, can_use_powers, TRUE), 10 SECONDS)
-
REMOVE_TRAIT(user, TRAIT_FAKEDEATH, CHANGELING_TRAIT)
for(var/obj/item/grab/G in user.grabbed_by)
var/mob/living/carbon/M = G.assailant
diff --git a/code/modules/mob/living/simple_animal/hostile/headslug.dm b/code/modules/mob/living/simple_animal/hostile/headslug.dm
index 19137beaac9..be34f9ff999 100644
--- a/code/modules/mob/living/simple_animal/hostile/headslug.dm
+++ b/code/modules/mob/living/simple_animal/hostile/headslug.dm
@@ -1,5 +1,5 @@
-#define EGG_INCUBATION_DEAD_CYCLE 60
-#define EGG_INCUBATION_LIVING_CYCLE 120
+#define EGG_INCUBATION_DEAD_CYCLE 120
+#define EGG_INCUBATION_LIVING_CYCLE 200
/mob/living/simple_animal/hostile/headslug
name = "headslug"
desc = "Absolutely not de-beaked or harmless. Keep away from corpses."
@@ -59,6 +59,9 @@
to_chat(src, "With our egg laid, our death approaches rapidly...")
addtimer(CALLBACK(src, PROC_REF(death)), 25 SECONDS)
+/mob/living/simple_animal/hostile/headslug/projectile_hit_check(obj/item/projectile/P)
+ return (stat || FALSE)
+
/obj/item/organ/internal/body_egg/changeling_egg
name = "changeling egg"
desc = "Twitching and disgusting."