From 43b7fa5ed9276cc3132085e805fbab963b39da03 Mon Sep 17 00:00:00 2001
From: chuga-git <98280110+chuga-git@users.noreply.github.com>
Date: Thu, 27 Jun 2024 22:16:55 -0500
Subject: [PATCH] Gargantua Blood Rush now removes bolas (#25989)
* gargantua bloodrush now clears legcuffs, slightly refactors removing restraints
* comment tweaks, prevents blood rush from being used when buckled.
* Update code/modules/mob/living/carbon/carbon_procs.dm
Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>
Signed-off-by: chuga-git <98280110+chuga-git@users.noreply.github.com>
---------
Signed-off-by: chuga-git <98280110+chuga-git@users.noreply.github.com>
Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>
---
code/game/gamemodes/cult/runes.dm | 2 +-
.../abduction/machinery/experiment.dm | 4 +-
.../weapons/bio_chips/bio_chip_freedom.dm | 2 +-
.../vampire_powers/gargantua_powers.dm | 25 +++-
.../modules/mob/living/carbon/carbon_procs.dm | 110 +++++++++++++-----
5 files changed, 106 insertions(+), 37 deletions(-)
diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm
index 1acfaf66bd7..8316beacba1 100644
--- a/code/game/gamemodes/cult/runes.dm
+++ b/code/game/gamemodes/cult/runes.dm
@@ -354,7 +354,7 @@ structure_check() searches for nearby cultist structures required for the invoca
for(var/datum/disease/critical/crit in H.viruses) // cure all crit conditions
crit.cure()
- H.uncuff()
+ H.clear_restraints()
H.Silence(6 SECONDS) //Prevent "HALP MAINT CULT" before you realise you're converted
if(H.reagents?.has_reagent("holywater"))
H.reagents.del_reagent("holywater") // Also prevent fill stomach with holy water and "forgot" about it after converting
diff --git a/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm b/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm
index 4027079a2f8..fb36aa273a9 100644
--- a/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm
+++ b/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm
@@ -166,11 +166,11 @@
H.Sleeping(16 SECONDS)
if(console && console.pad && console.pad.teleport_target)
H.forceMove(console.pad.teleport_target)
- H.uncuff()
+ H.clear_restraints()
return
//Area not chosen / It's not safe area - teleport to arrivals
H.forceMove(pick(GLOB.latejoin))
- H.uncuff()
+ H.clear_restraints()
return
/obj/machinery/abductor/experiment/attackby(obj/item/G, mob/user)
diff --git a/code/game/objects/items/weapons/bio_chips/bio_chip_freedom.dm b/code/game/objects/items/weapons/bio_chips/bio_chip_freedom.dm
index 898584a9240..ae9b6ad062d 100644
--- a/code/game/objects/items/weapons/bio_chips/bio_chip_freedom.dm
+++ b/code/game/objects/items/weapons/bio_chips/bio_chip_freedom.dm
@@ -14,7 +14,7 @@
to_chat(imp_in, "You feel a faint click.")
if(iscarbon(imp_in))
var/mob/living/carbon/C_imp_in = imp_in
- C_imp_in.uncuff()
+ C_imp_in.clear_restraints()
for(var/obj/item/grab/G in C_imp_in.grabbed_by)
var/mob/living/carbon/M = G.assailant
C_imp_in.visible_message("[C_imp_in] suddenly shocks [M] from their wrists and slips out of their grab!")
diff --git a/code/modules/antagonists/vampire/vampire_powers/gargantua_powers.dm b/code/modules/antagonists/vampire/vampire_powers/gargantua_powers.dm
index 641894c0eab..11b7960235b 100644
--- a/code/modules/antagonists/vampire/vampire_powers/gargantua_powers.dm
+++ b/code/modules/antagonists/vampire/vampire_powers/gargantua_powers.dm
@@ -92,18 +92,33 @@
/datum/spell/vampire/self/blood_rush
name = "Blood Rush (30)"
- desc = "Infuse yourself with blood magic to boost your movement speed."
+ desc = "Infuse yourself with blood magic to boost your movement speed and break out of leg restraints."
gain_desc = "You have gained the ability to temporarily move at high speeds."
base_cooldown = 30 SECONDS
required_blood = 30
action_icon_state = "blood_rush"
+/datum/spell/vampire/self/blood_rush/can_cast(mob/user, charge_check, show_message)
+ var/mob/living/L = user
+ // they're not getting anything out of this spell if they're stunned or buckled anyways, so we might as well stop them from wasting the blood
+ if(L.IsWeakened() || L.buckled)
+ to_chat(L, "You can't cast this spell while incapacitated!")
+ return FALSE
+ return ..()
+
/datum/spell/vampire/self/blood_rush/cast(list/targets, mob/user)
var/mob/living/target = targets[1]
- if(ishuman(target))
- var/mob/living/carbon/human/H = target
- to_chat(H, "You feel a rush of energy!")
- H.apply_status_effect(STATUS_EFFECT_BLOOD_RUSH)
+ if(!ishuman(target))
+ return
+
+ var/mob/living/carbon/human/H = target
+ to_chat(H, "You feel a rush of energy!")
+
+ H.apply_status_effect(STATUS_EFFECT_BLOOD_RUSH)
+ H.clear_legcuffs(TRUE)
+ // note that this doesn't cancel the baton knockdown timer
+ H.SetKnockDown(0)
+ H.stand_up(TRUE)
/datum/spell/fireball/demonic_grasp
name = "Demonic Grasp (20)"
diff --git a/code/modules/mob/living/carbon/carbon_procs.dm b/code/modules/mob/living/carbon/carbon_procs.dm
index 98758accbf9..7d20aba8935 100644
--- a/code/modules/mob/living/carbon/carbon_procs.dm
+++ b/code/modules/mob/living/carbon/carbon_procs.dm
@@ -1018,35 +1018,89 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven
legcuffed,
back,
wear_mask)
+/**
+ * Clears a carbon mob's handcuffs and legcuffs, dropping them to the ground.
+ *
+ * Arguments:
+ * * show_message - if TRUE, will display a visible message when restraints are removed. FALSE by default.
+ *
+ * Returns:
+ * * TRUE if handcuffs or legcuffs were removed, FALSE otherwise
+ */
+/mob/living/carbon/proc/clear_restraints(show_message = FALSE)
+ . = clear_handcuffs(show_message)
+ . |= clear_legcuffs(show_message)
-/mob/living/carbon/proc/uncuff()
- if(handcuffed)
- var/obj/item/W = handcuffed
- handcuffed = null
- if(buckled && buckled.buckle_requires_restraints)
- buckled.unbuckle_mob(src)
- update_handcuffed()
- if(client)
- client.screen -= W
- if(W)
- W.forceMove(drop_location())
- W.dropped(src)
- if(W)
- W.layer = initial(W.layer)
- W.plane = initial(W.plane)
- if(legcuffed)
- var/obj/item/W = legcuffed
- legcuffed = null
- toggle_move_intent()
- update_inv_legcuffed()
- if(client)
- client.screen -= W
- if(W)
- W.forceMove(drop_location())
- W.dropped(src)
- if(W)
- W.layer = initial(W.layer)
- W.plane = initial(W.plane)
+/**
+ * Removes a carbon's handcuffs, dropping them to the ground. Calls update_handcuffed(). Unbuckles if handcuffs were necessary for the buckle (pipe buckling, etc.)
+ *
+ * Arguments:
+ * * show_message - if TRUE, will display a visible message when restraints are removed. FALSE by default.
+ *
+ * Returns:
+ * * TRUE if handcuffs existed and were successfully removed, FALSE otherwise
+ */
+/mob/living/carbon/proc/clear_handcuffs(show_message = FALSE)
+ if(!handcuffed)
+ return FALSE
+
+ var/obj/item/W = handcuffed
+ if(isnull(W))
+ return FALSE
+
+ handcuffed = null
+ if(buckled && buckled.buckle_requires_restraints)
+ buckled.unbuckle_mob(src)
+ update_handcuffed()
+
+ if(client)
+ client.screen -= W
+
+ if(show_message)
+ visible_message("[src] slips out of [W]!")
+
+ W.forceMove(drop_location())
+ W.dropped(src)
+ if(W)
+ W.layer = initial(W.layer)
+ W.plane = initial(W.plane)
+
+ return TRUE
+
+/**
+ * Removes a carbon's legcuffs, dropping them to the ground. Calls update_inv_legcuffed().
+ *
+ * Arguments:
+ * * show_message - if TRUE, will display a visible message when restraints are removed. FALSE by default.
+ *
+ * Returns:
+ * * TRUE if legcuffs existed and were successfully removed, FALSE otherwise
+ */
+/mob/living/carbon/proc/clear_legcuffs(show_message = FALSE)
+ if(!legcuffed)
+ return FALSE
+
+ var/obj/item/W = legcuffed
+ if(isnull(W))
+ return FALSE
+
+ legcuffed = null
+ toggle_move_intent()
+ update_inv_legcuffed()
+
+ if(client)
+ client.screen -= W
+
+ if(show_message)
+ visible_message("[W] falls off of [src]!")
+
+ W.forceMove(drop_location())
+ W.dropped(src)
+ if(W)
+ W.layer = initial(W.layer)
+ W.plane = initial(W.plane)
+
+ return TRUE
/mob/living/carbon/proc/slip(description, knockdown, tilesSlipped, walkSafely, slipAny, slipVerb = "slip")