diff --git a/code/modules/antagonists/changeling/powers/environmental_adaption.dm b/code/modules/antagonists/changeling/powers/environmental_adaption.dm new file mode 100644 index 00000000000..bd4870fd8e4 --- /dev/null +++ b/code/modules/antagonists/changeling/powers/environmental_adaption.dm @@ -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("[cling]'s skin suddenly starts becoming translucent!", \ + "We adapt our pigmentation to suit the environment around us.") + 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( + "[cling] appears from thin air!", + "We stop concentration on our pigmentation, allowing it to return to normal.", + ) + 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 diff --git a/icons/mob/actions/actions.dmi b/icons/mob/actions/actions.dmi index 567b1047558..122a250846e 100644 Binary files a/icons/mob/actions/actions.dmi and b/icons/mob/actions/actions.dmi differ diff --git a/paradise.dme b/paradise.dme index fd223d61dc0..b8d7a5c5e01 100644 --- a/paradise.dme +++ b/paradise.dme @@ -1442,6 +1442,7 @@ #include "code\modules\antagonists\changeling\powers\chameleon_skin.dm" #include "code\modules\antagonists\changeling\powers\contort_body.dm" #include "code\modules\antagonists\changeling\powers\digitalcamo.dm" +#include "code\modules\antagonists\changeling\powers\environmental_adaption.dm" #include "code\modules\antagonists\changeling\powers\epinephrine.dm" #include "code\modules\antagonists\changeling\powers\fakedeath.dm" #include "code\modules\antagonists\changeling\powers\fleshmend.dm"