Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stone Shell #787

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.25

/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,
)
Loading