Skip to content

Commit

Permalink
stone shell
Browse files Browse the repository at this point in the history
  • Loading branch information
definitelynotspaghetti committed Dec 8, 2024
1 parent 39ae6a3 commit 080c8b3
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1187,6 +1187,38 @@ RU TGMC EDIT */
if(owner)
UnregisterSignal(owner, list(COMSIG_QDELETING, COMSIG_MOB_DEATH, COMSIG_XENOMORPH_EVOLVED, COMSIG_XENOMORPH_DEEVOLVED, COMSIG_XENOMORPH_BRUTE_DAMAGE, COMSIG_XENOMORPH_BURN_DAMAGE))

// ***************************************
// *********** Stone Shell
// ***************************************

#define STONE_SHELL_DAMAGE_REDUCTION 0.45

/datum/action/ability/xeno_action/stone_shell
name = "Stone Shell"
desc = "Your stone shell absorbs a portion of the damage you take."
hidden = TRUE

/datum/action/ability/xeno_action/stone_shell/give_action(mob/living/L)
. = ..()
RegisterSignals(owner, list(COMSIG_MOB_DEATH, COMSIG_XENOMORPH_EVOLVED, COMSIG_XENOMORPH_DEEVOLVED), PROC_REF(remove_ability))
RegisterSignals(owner, list(COMSIG_XENOMORPH_BRUTE_DAMAGE, COMSIG_XENOMORPH_BURN_DAMAGE), PROC_REF(apply_shell))

/datum/action/ability/xeno_action/stone_shell/proc/apply_shell(datum/source, amount, list/amount_mod)
SIGNAL_HANDLER
if(owner.stat)
return
if(amount <= 0)
return
var/mob/living/carbon/xenomorph/xeno_owner = owner
if(xeno_owner.health > (xeno_owner.maxHealth * 0.8))
return
var/damage_amount = round(amount * STONE_SHELL_DAMAGE_REDUCTION)
amount_mod += damage_amount

/datum/action/ability/xeno_action/stone_shell/proc/remove_ability(datum/source)
SIGNAL_HANDLER
if(owner)
UnregisterSignal(owner, list(COMSIG_QDELETING, COMSIG_MOB_DEATH, COMSIG_XENOMORPH_EVOLVED, COMSIG_XENOMORPH_DEEVOLVED, COMSIG_XENOMORPH_BRUTE_DAMAGE, COMSIG_XENOMORPH_BURN_DAMAGE))

// ***************************************
// *********** Earth Pillar (also see: Earth Riser)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
/datum/action/ability/activable/xeno/landslide,
/datum/action/ability/activable/xeno/earth_riser,
/datum/action/ability/activable/xeno/seismic_fracture,
/datum/action/ability/xeno_action/stone_shell,
)

/datum/xeno_caste/behemoth/normal
Expand All @@ -65,5 +66,6 @@
/datum/action/ability/activable/xeno/landslide,
/datum/action/ability/activable/xeno/earth_riser,
/datum/action/ability/activable/xeno/seismic_fracture,
/datum/action/ability/xeno_action/stone_shell,
/datum/action/ability/xeno_action/primal_wrath,
)

0 comments on commit 080c8b3

Please sign in to comment.