mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 12:37:26 +01:00
New Changeling Ability: Environmental Adaption [TG Darkness Adaption Port] (#25404)
* darkness * seethrough * shit works now * Update code/modules/antagonists/changeling/powers/environmental_adaption.dm Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com> Signed-off-by: Marm <85680653+ItsMarmite@users.noreply.github.com> * deconflict --------- Signed-off-by: Marm <85680653+ItsMarmite@users.noreply.github.com> Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
/datum/action/changeling/environmental_adaptation
|
||||
name = "Environmental Adaptation"
|
||||
desc = "Our skin pigmentations rapidly change to suit the environment around us. Needs 10 chemicals in-storage to toggle. Slows down our chemical regeneration by 15%"
|
||||
helptext = "Allows us to darken and change the translucency of our pigmentation. \
|
||||
The translucent effect works best in dark environments and garments. Can be toggled on and off."
|
||||
button_icon_state = "enviro_adaptation"
|
||||
dna_cost = 2
|
||||
chemical_cost = 10
|
||||
power_type = CHANGELING_PURCHASABLE_POWER
|
||||
category = /datum/changeling_power_category/utility
|
||||
|
||||
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
|
||||
var/chem_recharge_slowdown = 0
|
||||
|
||||
/datum/action/changeling/environmental_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/environmental_adaptation/proc/enable_ability(mob/living/carbon/human/cling) //Enable the adaptation
|
||||
animate(cling, alpha = 65, time = 3 SECONDS)
|
||||
cling.visible_message("<span class='warning'>[cling]'s skin suddenly starts becoming translucent!</span>", \
|
||||
"<span class='notice'>We adapt our pigmentation to suit the environment around us.</span>")
|
||||
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
|
||||
|
||||
/datum/action/changeling/environmental_adaptation/proc/disable_ability(mob/living/carbon/human/cling) //Restore the adaptation
|
||||
animate(cling, alpha = 255, time = 3 SECONDS)
|
||||
cling.visible_message(
|
||||
"<span class='warning'>[cling] appears from thin air!</span>",
|
||||
"<span class='notice'>We stop concentration on our pigmentation, allowing it to return to normal.</span>",
|
||||
)
|
||||
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
|
||||
Reference in New Issue
Block a user