-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactors several changeling abilities to status effects and ports "D…
…arkness Adaptation" (#3839) * ugh * done * god i fucking hate this place * works * right, yeah, this one * ling sting buff * guh * NO WAY LMAO * okay, adrenaline done * done * port diminish fix from vampire pr * icon fix * guh * quick swapout * ...really? * minor description changes * yet more description shit * make it slightly shorter * ...can i just decide? * oh yeah forgot to mark that * ugh * merge init signals files * Update tgstation.dme
- Loading branch information
1 parent
c513368
commit 3a35f27
Showing
31 changed files
with
475 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 10 additions & 10 deletions
20
code/modules/antagonists/changeling/powers/chameleon_skin.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
/datum/action/changeling/chameleon_skin | ||
name = "Chameleon Skin" | ||
desc = "Our skin pigmentation rapidly changes to suit our current environment. Costs 25 chemicals." | ||
desc = "Our skin pigmentation rapidly changes to suit our current environment. Costs 10 chemicals." | ||
helptext = "Allows us to become invisible after a few seconds of standing still. Can be toggled on and off." | ||
button_icon_state = "chameleon_skin" | ||
dna_cost = 2 | ||
chemical_cost = 25 | ||
dna_cost = 1 | ||
chemical_cost = 10 | ||
req_human = TRUE | ||
|
||
/datum/action/changeling/chameleon_skin/sting_action(mob/user) | ||
var/mob/living/carbon/human/H = user //SHOULD always be human, because req_human = TRUE | ||
if(!istype(H)) // req_human could be done in can_sting stuff. | ||
var/mob/living/carbon/human/cling = user //SHOULD always be human, because req_human = TRUE | ||
if(!istype(cling)) // req_human could be done in can_sting stuff. | ||
return | ||
..() | ||
if(H.dna.get_mutation(/datum/mutation/human/chameleon)) | ||
H.dna.remove_mutation(/datum/mutation/human/chameleon) | ||
if(cling.dna.get_mutation(/datum/mutation/human/chameleon/changeling)) | ||
cling.dna.remove_mutation(/datum/mutation/human/chameleon/changeling) | ||
else | ||
H.dna.add_mutation(/datum/mutation/human/chameleon) | ||
cling.dna.add_mutation(/datum/mutation/human/chameleon/changeling, MUT_OTHER) // monkestation edit | ||
return TRUE | ||
|
||
/datum/action/changeling/chameleon_skin/Remove(mob/user) | ||
if(user.has_dna()) | ||
var/mob/living/carbon/C = user | ||
C.dna.remove_mutation(/datum/mutation/human/chameleon) | ||
var/mob/living/carbon/cling = user | ||
cling.dna.remove_mutation(/datum/mutation/human/chameleon/changeling) | ||
..() |
82 changes: 82 additions & 0 deletions
82
code/modules/antagonists/changeling/powers/darkness_adaptation.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/datum/action/changeling/darkness_adaptation | ||
name = "Darkness Adaptation" | ||
desc = "Our skin pigmentation and eyes rapidly change to suit the darkness. Requires 10 available chemicals and slightly slows down chemical regeneration." // monkestation edit | ||
helptext = "Makes us translucent. Works best in dark enviroments and garments. Makes our eyes more sensitive to flashes." // monkestation edit | ||
button_icon_state = "darkness_adaptation" | ||
dna_cost = 2 | ||
chemical_cost = 10 | ||
|
||
req_human = TRUE | ||
//// is ability active (we are invisible)? | ||
var/is_active = FALSE | ||
/// How much we slow chemical regeneration while active, in chems per second | ||
var/recharge_slowdown = 0.15 | ||
|
||
/datum/action/changeling/darkness_adaptation/on_purchase(mob/user, is_respec) | ||
. = ..() | ||
RegisterSignal(user, COMSIG_CARBON_GAIN_ORGAN, PROC_REF(eye_implanted)) | ||
RegisterSignal(user, COMSIG_CARBON_LOSE_ORGAN, PROC_REF(eye_removed)) | ||
|
||
/datum/action/changeling/darkness_adaptation/sting_action(mob/living/carbon/human/cling) //SHOULD always be human, because req_human = TRUE | ||
..() | ||
is_active = !is_active | ||
if(is_active) | ||
enable_ability(cling) | ||
else | ||
disable_ability(cling) | ||
|
||
/datum/action/changeling/darkness_adaptation/Remove(mob/living/carbon/human/cling) | ||
..() | ||
disable_ability(cling) | ||
|
||
/datum/action/changeling/darkness_adaptation/proc/enable_ability(mob/living/carbon/human/cling) //Enable the adaptation | ||
animate(cling, alpha = 65,time = 3 SECONDS) | ||
cling.visible_message(span_warning("[cling]'s skin suddenly starts becoming translucent!"), \ | ||
span_notice("We are now far more stealthy and better at seeing in the dark.")) | ||
animate(cling, color = COLOR_DARK, time = 3 SECONDS) // Darkens their overall appearance | ||
var/datum/antagonist/changeling/changeling_data = cling.mind?.has_antag_datum(/datum/antagonist/changeling) | ||
changeling_data?.chem_recharge_slowdown -= recharge_slowdown //Slows down chem regeneration | ||
var/obj/item/organ/internal/eyes/eyes = cling.get_organ_by_type(/obj/item/organ/internal/eyes) | ||
if(!istype(eyes)) | ||
return | ||
eyes.lighting_cutoff = LIGHTING_CUTOFF_MEDIUM // Adds barely usable, kinda shit night vision | ||
eyes.flash_protect = max(eyes.flash_protect += -1, FLASH_PROTECTION_HYPER_SENSITIVE) // Reduces flash protection by one level | ||
cling.update_sight() // Update the display | ||
|
||
/datum/action/changeling/darkness_adaptation/proc/disable_ability(mob/living/carbon/human/cling) //Restore the adaptation | ||
animate(cling, alpha = 255, time = 3 SECONDS) | ||
cling.visible_message( | ||
span_warning("[cling] appears from thin air!"), | ||
span_notice("We are now appearing normal and lost the ability to see in the dark."), | ||
) | ||
animate(cling, color = null, time = 3 SECONDS) | ||
var/datum/antagonist/changeling/changeling_data = cling.mind?.has_antag_datum(/datum/antagonist/changeling) | ||
changeling_data?.chem_recharge_slowdown += recharge_slowdown | ||
var/obj/item/organ/internal/eyes/eyes = cling.get_organ_by_type(/obj/item/organ/internal/eyes) | ||
if(!istype(eyes)) | ||
return | ||
eyes.lighting_cutoff = LIGHTING_CUTOFF_VISIBLE | ||
eyes.flash_protect = max(eyes.flash_protect += 1, FLASH_PROTECTION_WELDER) | ||
cling.update_sight() | ||
|
||
/// Signal proc to grant the correct level of flash sensitivity | ||
/datum/action/changeling/darkness_adaptation/proc/eye_implanted(mob/living/source, obj/item/organ/gained, special) | ||
SIGNAL_HANDLER | ||
|
||
var/obj/item/organ/internal/eyes/eyes = gained | ||
if(!istype(eyes)) | ||
return | ||
if(is_active) | ||
eyes.flash_protect = max(eyes.flash_protect += -1, FLASH_PROTECTION_HYPER_SENSITIVE) | ||
else | ||
eyes.flash_protect = max(eyes.flash_protect += 1, FLASH_PROTECTION_WELDER) | ||
|
||
/// Signal proc to remove flash sensitivity when the eyes are removed | ||
/datum/action/changeling/darkness_adaptation/proc/eye_removed(mob/living/source, obj/item/organ/removed, special) | ||
SIGNAL_HANDLER | ||
|
||
var/obj/item/organ/internal/eyes/eyes = removed | ||
if(!istype(eyes)) | ||
return | ||
eyes.flash_protect = initial(eyes.flash_protect) | ||
// We don't need to bother about removing or adding night vision, fortunately, because they can't see anyways |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 25 additions & 48 deletions
73
code/modules/antagonists/changeling/powers/strained_muscles.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,41 @@ | ||
//Strained Muscles: Temporary speed boost at the cost of rapid damage | ||
//Limited because of space suits and such; ideally, used for a quick getaway | ||
|
||
////////////////////// | ||
// MONKE REFACTORED // | ||
////////////////////// | ||
|
||
/datum/action/changeling/strained_muscles | ||
name = "Strained Muscles" | ||
desc = "We evolve the ability to reduce the acid buildup in our muscles, allowing us to move much faster." | ||
helptext = "The strain will make us tired, and we will rapidly become fatigued. Standard weight restrictions, like space suits, still apply. Cannot be used in lesser form." | ||
desc = "We evolve the ability to reduce the acid buildup in our muscles, allowing us to move much faster. Costs 10 chemicals to activate." | ||
helptext = "Causes us to become fatigued over time. Cannot be used in lesser form or while unconscious. Overuse will lead to us collapsing." | ||
button_icon_state = "strained_muscles" | ||
chemical_cost = 0 | ||
chemical_cost = 10 | ||
dna_cost = 1 | ||
req_human = TRUE | ||
var/stacks = 0 //Increments every 5 seconds; damage increases over time | ||
active = FALSE //Whether or not you are a hedgehog | ||
disabled_by_fire = FALSE | ||
|
||
/datum/action/changeling/strained_muscles/sting_action(mob/living/carbon/user) | ||
..() | ||
active = !active | ||
if(active) | ||
to_chat(user, span_notice("Our muscles tense and strengthen.")) | ||
else | ||
user.remove_movespeed_modifier(/datum/movespeed_modifier/strained_muscles) | ||
to_chat(user, span_notice("Our muscles relax.")) | ||
if(stacks >= 10) | ||
to_chat(user, span_danger("We collapse in exhaustion.")) | ||
user.Paralyze(60) | ||
user.emote("gasp") | ||
|
||
INVOKE_ASYNC(src, PROC_REF(muscle_loop), user) | ||
/// How long this has been on in seconds. | ||
var/accumulation = 0 | ||
|
||
return TRUE | ||
/// Whether we've warned the user about their exhaustion. | ||
var/warning_given = FALSE | ||
|
||
/datum/action/changeling/strained_muscles/Remove(mob/user) | ||
user.remove_movespeed_modifier(/datum/movespeed_modifier/strained_muscles) | ||
/datum/action/changeling/strained_muscles/can_sting(mob/living/user, mob/living/target) | ||
var/has_effect = user.has_status_effect(/datum/status_effect/changeling_muscles) | ||
chemical_cost = has_effect ? 0 : 10 | ||
return ..() | ||
|
||
/datum/action/changeling/strained_muscles/proc/muscle_loop(mob/living/carbon/user) | ||
while(active) | ||
if(QDELETED(src) || QDELETED(user)) | ||
return | ||
|
||
user.add_movespeed_modifier(/datum/movespeed_modifier/strained_muscles) | ||
if(user.stat != CONSCIOUS || user.staminaloss >= 90) | ||
active = !active | ||
to_chat(user, span_notice("Our muscles relax without the energy to strengthen them.")) | ||
user.Paralyze(40) | ||
user.remove_movespeed_modifier(/datum/movespeed_modifier/strained_muscles) | ||
break | ||
|
||
stacks++ | ||
|
||
user.stamina.adjust(-stacks * 1.3) //At first the changeling may regenerate stamina fast enough to nullify fatigue, but it will stack | ||
|
||
if(stacks == 11) //Warning message that the stacks are getting too high | ||
to_chat(user, span_warning("Our legs are really starting to hurt...")) | ||
|
||
sleep(4 SECONDS) | ||
|
||
while(!active && stacks) //Damage stacks decrease fairly rapidly while not in sanic mode | ||
if(QDELETED(src) || QDELETED(user)) | ||
return | ||
/datum/action/changeling/strained_muscles/sting_action(mob/living/user) | ||
..() | ||
var/has_effect = user.has_status_effect(/datum/status_effect/changeling_muscles) | ||
if(has_effect) | ||
user.remove_status_effect(/datum/status_effect/changeling_muscles) | ||
else | ||
user.apply_status_effect(/datum/status_effect/changeling_muscles) | ||
return TRUE | ||
|
||
stacks-- | ||
sleep(2 SECONDS) | ||
/datum/action/changeling/strained_muscles/Remove(mob/living/user) | ||
user.remove_status_effect(/datum/status_effect/changeling_muscles) | ||
return ..() |
Oops, something went wrong.