refactor action buttons (#29416)

* refactor action buttons

* fix cult spell charge overlay

* lewc review

* update for a/mhelp buttons and xenobio organs

* update for minebot

* properly create button each time

* directly add/remove unavail overlay for reasons

* lewc review
This commit is contained in:
warriorstar-orion
2025-07-28 19:13:28 +00:00
committed by GitHub
parent f9016e65ff
commit 56f4960ed4
115 changed files with 815 additions and 584 deletions
@@ -3,7 +3,7 @@
/datum/action/changeling
name = "Prototype Sting"
desc = "" // Fluff
button_background_icon_state = "bg_changeling"
background_icon_state = "bg_changeling"
/// A reference to the changeling's changeling antag datum.
var/datum/antagonist/changeling/cling
/// Datum path used to determine the location and name of the power in changeling evolution menu UI
@@ -6,7 +6,7 @@
/datum/action/changeling/evolution_menu
name = "Evolution Menu"
desc = "Choose our method of subjugation."
button_overlay_icon_state = "changelingsting"
button_icon_state = "changelingsting"
power_type = CHANGELING_INNATE_POWER
/// Which UI view will be displayed. Compact mode will show only power names, and will leave out their descriptions and helptext.
var/view_mode = EXPANDED_MODE
@@ -1,7 +1,7 @@
/datum/action/changeling/absorb_dna
name = "Absorb DNA"
desc = "Absorb the DNA of our victim. Requires us to strangle them."
button_overlay_icon_state = "absorb_dna"
button_icon_state = "absorb_dna"
power_type = CHANGELING_INNATE_POWER
req_human = TRUE
@@ -2,7 +2,7 @@
name = "Apex Predator"
desc = "We evolve a keen intuition, allowing us to detect the anxieties of nearby lifeforms."
helptext = "We will be able to detect the direction and room our prey is in, as well as if they have any injuries."
button_overlay_icon_state = "predator"
button_icon_state = "predator"
dna_cost = 1
power_type = CHANGELING_PURCHASABLE_POWER
category = /datum/changeling_power_category/utility
@@ -2,7 +2,7 @@
name = "Augmented Eyesight"
desc = "Creates more light sensing rods in our eyes, allowing our vision to penetrate most blocking objects. Protects our vision from flashes while inactive."
helptext = "Grants us x-ray vision or flash protection. We will become a lot more vulnerable to flash-based devices while x-ray vision is active."
button_overlay_icon_state = "augmented_eyesight"
button_icon_state = "augmented_eyesight"
dna_cost = 4
power_type = CHANGELING_PURCHASABLE_POWER
category = /datum/changeling_power_category/utility
@@ -2,7 +2,7 @@
name = "Last Resort"
desc = "We sacrifice our current body in a moment of need, placing us in control of a vessel that can plant our likeness in a new host. Costs 20 chemicals."
helptext = "We will be placed in control of a small, fragile creature. We may attack a corpse like this to plant an egg which will slowly mature into a new form for us."
button_overlay_icon_state = "last_resort"
button_icon_state = "last_resort"
chemical_cost = 20
dna_cost = 2
req_human = TRUE
@@ -2,7 +2,7 @@
name = "Biodegrade"
desc = "Dissolves restraints or other objects preventing free movement if we are restrained. Prepares hand to vomit acid on other objects, doesn't work on living targets. Costs 30 chemicals."
helptext = "This is obvious to nearby people, and can destroy standard restraints and closets, and break you out of grabs."
button_overlay_icon_state = "biodegrade"
button_icon_state = "biodegrade"
chemical_cost = 30 //High cost to prevent spam
dna_cost = 4
req_human = TRUE
@@ -2,7 +2,7 @@
name = "Chameleon Skin"
desc = "Our skin pigmentation rapidly changes to suit our current environment. Costs 25 chemicals."
helptext = "Allows us to become invisible after a few seconds of standing still. While active, it silences our footsteps. Can be toggled on and off."
button_overlay_icon_state = "chameleon_skin"
button_icon_state = "chameleon_skin"
dna_cost = 4
chemical_cost = 25
req_human = TRUE
@@ -1,7 +1,7 @@
/datum/action/changeling/contort_body
name = "Contort Body"
desc = "We contort our body, allowing us to fit in and under things we normally wouldn't be able to. Costs 25 chemicals."
button_overlay_icon_state = "contort_body"
button_icon_state = "contort_body"
chemical_cost = 25
dna_cost = 4
power_type = CHANGELING_PURCHASABLE_POWER
@@ -2,7 +2,7 @@
name = "Digital Camouflage"
desc = "By evolving the ability to distort our form and proportions, we defeat common algorithms used to detect lifeforms on cameras."
helptext = "We cannot be tracked by camera while using this skill."
button_overlay_icon_state = "digital_camo"
button_icon_state = "digital_camo"
dna_cost = 2
power_type = CHANGELING_PURCHASABLE_POWER
category = /datum/changeling_power_category/utility
@@ -3,7 +3,7 @@
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_overlay_icon_state = "enviro_adaptation"
button_icon_state = "enviro_adaptation"
dna_cost = 2
chemical_cost = 10
power_type = CHANGELING_PURCHASABLE_POWER
@@ -2,7 +2,7 @@
name = "Epinephrine Overdose"
desc = "We evolve additional sacs of adrenaline throughout our body. Costs 30 chemicals."
helptext = "Removes all stuns instantly and adds a short term reduction in further stuns. Can be used while unconscious. Continued use poisons the body."
button_overlay_icon_state = "adrenaline"
button_icon_state = "adrenaline"
chemical_cost = 30
dna_cost = 4
req_human = TRUE
@@ -1,7 +1,7 @@
/datum/action/changeling/fakedeath
name = "Regenerative Stasis"
desc = "We fall into a stasis, allowing us to regenerate and trick our enemies. Costs 15 chemicals."
button_overlay_icon_state = "fake_death"
button_icon_state = "fake_death"
chemical_cost = 15
power_type = CHANGELING_INNATE_POWER
req_dna = 1
@@ -2,7 +2,7 @@
name = "Fleshmend"
desc = "Our flesh rapidly regenerates, healing our burns, bruises, and shortness of breath. Costs 20 chemicals."
helptext = "Does not regrow limbs. Partially recovers our blood. Functions while unconscious."
button_overlay_icon_state = "fleshmend"
button_icon_state = "fleshmend"
chemical_cost = 20
dna_cost = 5
req_stat = UNCONSCIOUS
@@ -5,7 +5,7 @@ GLOBAL_LIST_EMPTY(hivemind_bank)
name = "Hivemind Access"
desc = "Allows us to upload or absorb DNA in the airwaves. Does not count towards absorb objectives. Costs 10 chemicals."
helptext = "Tunes our chemical receptors for hivemind communication, which passively grants us access to the Changeling Hivemind."
button_overlay_icon_state = "hive_absorb"
button_icon_state = "hive_absorb"
chemical_cost = 10
power_type = CHANGELING_INNATE_POWER
category = /datum/changeling_power_category/utility
@@ -1,7 +1,7 @@
/datum/action/changeling/humanform
name = "Human form"
desc = "We change into a human. Costs 5 chemicals."
button_overlay_icon_state = "human_form"
button_icon_state = "human_form"
chemical_cost = 5
req_dna = 1
@@ -2,7 +2,7 @@
name = "Lesser form"
desc = "We debase ourselves and become lesser. We become a monkey. Costs 5 chemicals."
helptext = "The transformation greatly reduces our size, allowing us to slip out of cuffs and climb through vents."
button_overlay_icon_state = "lesser_form"
button_icon_state = "lesser_form"
chemical_cost = 5
dna_cost = 2
req_human = TRUE
@@ -2,7 +2,7 @@
name = "Mimic Voice"
desc = "We shape our vocal glands to sound like a desired voice."
helptext = "Will turn your voice into the name that you enter."
button_overlay_icon_state = "mimic_voice"
button_icon_state = "mimic_voice"
dna_cost = 2
req_human = TRUE
power_type = CHANGELING_PURCHASABLE_POWER
@@ -119,7 +119,7 @@
name = "Arm Blade"
desc = "We reform one of our arms into a deadly blade. Costs 15 chemicals."
helptext = "We may retract our armblade in the same manner as we form it. Cannot be used while in lesser form."
button_overlay_icon_state = "armblade"
button_icon_state = "armblade"
chemical_cost = 15
dna_cost = 4
req_human = TRUE
@@ -183,7 +183,7 @@
Grab will immobilize the target and wrap a tentacle around them. \
Harm will drag the target closer and hit them with the object in our other hand. \
Cannot be used while in our lesser form."
button_overlay_icon_state = "tentacle"
button_icon_state = "tentacle"
chemical_cost = 10
dna_cost = 4
req_human = TRUE
@@ -406,7 +406,7 @@
name = "Organic Shield"
desc = "We reform one of our arms into a hard shield. Costs 20 chemicals."
helptext = "Organic tissue cannot resist damage forever, with the shield breaking after it is hit 6 times. Can be used to parry attacks and projectiles. Cannot be used while in lesser form."
button_overlay_icon_state = "organic_shield"
button_icon_state = "organic_shield"
chemical_cost = 20
dna_cost = 2
req_human = TRUE
@@ -441,7 +441,7 @@
name = "Organic Space Suit"
desc = "We grow an organic suit to protect ourselves from space exposure. Costs 20 chemicals."
helptext = "We must constantly repair our form to make it space proof, reducing chemical production while we are protected. Cannot be used in lesser form."
button_overlay_icon_state = "organic_suit"
button_icon_state = "organic_suit"
chemical_cost = 20
dna_cost = 4
req_human = TRUE
@@ -488,7 +488,7 @@
name = "Chitinous Armor"
desc = "We turn our skin into tough chitin to protect us from damage. Costs 25 chemicals."
helptext = "Upkeep of the armor requires a low expenditure of chemicals. The armor is strong against brute force, but does not provide much protection from lasers. Cannot be used in lesser form."
button_overlay_icon_state = "chitinous_armor"
button_icon_state = "chitinous_armor"
chemical_cost = 25
dna_cost = 4
req_human = TRUE
@@ -586,7 +586,7 @@
name = "Bone Shard"
desc = "We evolve the ability to break off shards of our bone and shape them into throwing weapons which embed into our foes. Costs 15 chemicals."
helptext = "The shards of bone will dull upon hitting a target, rendering them unusable as weapons."
button_overlay_icon_state = "boneshard"
button_icon_state = "boneshard"
chemical_cost = 15
dna_cost = 3
req_human = TRUE
@@ -2,7 +2,7 @@
name = "Anatomic Panacea"
desc = "Expels impurifications from our form, curing diseases, removing parasites, sobering us, purging toxins and radiation, and resetting our genetic code completely. Costs 20 chemicals."
helptext = "Can be used while unconscious."
button_overlay_icon_state = "panacea"
button_icon_state = "panacea"
chemical_cost = 20
dna_cost = 2
req_stat = UNCONSCIOUS
@@ -1,7 +1,7 @@
/datum/action/changeling/revive
name = "Regenerate"
desc = "We regenerate, healing all damage from our form."
button_overlay_icon_state = "revive"
button_icon_state = "revive"
req_dna = 1
req_stat = DEAD
bypass_fake_death = TRUE
@@ -2,7 +2,7 @@
name = "Resonant Shriek"
desc = "Our lungs and vocal cords shift, allowing us to briefly emit a noise that deafens and confuses the weak minded. Costs 30 chemicals."
helptext = "Emits a high frequency sound that confuses and deafens humans, blows out nearby lights and overloads cyborg sensors."
button_overlay_icon_state = "resonant_shriek"
button_icon_state = "resonant_shriek"
chemical_cost = 30
dna_cost = 2
req_human = TRUE
@@ -42,7 +42,7 @@
/datum/action/changeling/dissonant_shriek
name = "Dissonant Shriek"
desc = "We shift our vocal cords to release a high frequency sound that overloads nearby electronics. Costs 30 chemicals."
button_overlay_icon_state = "dissonant_shriek"
button_icon_state = "dissonant_shriek"
chemical_cost = 30
dna_cost = 2
power_type = CHANGELING_PURCHASABLE_POWER
@@ -5,7 +5,7 @@
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 use up our chemicals faster over time, and is not sustainable. Can not be used in lesser form."
button_overlay_icon_state = "strained_muscles"
button_icon_state = "strained_muscles"
dna_cost = 2
req_human = TRUE
power_type = CHANGELING_PURCHASABLE_POWER
@@ -7,7 +7,7 @@
name = "Spread Infestation"
desc = "Our form divides, creating an aggressive arachnid which will regard us as a friend. Costs 30 chemicals."
helptext = "The spiders are thoughtless creatures, but will not attack their creators. Their orders can be changed via remote hivemind (Alt+Shift click)."
button_overlay_icon_state = "spread_infestation"
button_icon_state = "spread_infestation"
chemical_cost = 30
dna_cost = 4
/// This var keeps track of the changeling's spider count
@@ -2,7 +2,7 @@
name = "Swap Forms"
desc = "We force ourselves into the body of another form, pushing their consciousness into the form we left behind. Costs 40 chemicals."
helptext = "We will bring all our abilities with us, but we will lose our old form DNA in exchange for the new one. The process will seem suspicious to any observers."
button_overlay_icon_state = "cling_mindswap"
button_icon_state = "cling_mindswap"
chemical_cost = 40
dna_cost = 2
req_human = TRUE //Monkeys can't grab
@@ -79,7 +79,7 @@
name = "Extract DNA Sting"
desc = "We stealthily sting a target and extract their DNA. Costs 25 chemicals."
helptext = "Will give you the DNA of your target, allowing you to transform into them."
button_overlay_icon_state = "sting_extract"
button_icon_state = "sting_extract"
sting_icon = "sting_extract"
chemical_cost = 25
power_type = CHANGELING_INNATE_POWER
@@ -99,7 +99,7 @@
name = "Mute Sting"
desc = "We silently sting a human, completely silencing them for a short time. Costs 20 chemicals."
helptext = "Does not provide a warning to the victim that they have been stung, until they try to speak and cannot."
button_overlay_icon_state = "sting_mute"
button_icon_state = "sting_mute"
sting_icon = "sting_mute"
chemical_cost = 20
dna_cost = 4
@@ -115,7 +115,7 @@
name = "Blind Sting"
desc = "We temporarily blind our victim. Costs 25 chemicals."
helptext = "This sting completely blinds a target for a short time, and leaves them with blurred vision for a long time."
button_overlay_icon_state = "sting_blind"
button_icon_state = "sting_blind"
sting_icon = "sting_blind"
chemical_cost = 25
dna_cost = 2
@@ -135,7 +135,7 @@
name = "Cryogenic Sting"
desc = "We silently sting our victim with a cocktail of chemicals that freezes them from the inside. Costs 15 chemicals."
helptext = "Does not provide a warning to the victim, though they will likely realize they are suddenly freezing."
button_overlay_icon_state = "sting_cryo"
button_icon_state = "sting_cryo"
sting_icon = "sting_cryo"
chemical_cost = 15
dna_cost = 4
@@ -153,7 +153,7 @@
name = "Lethargic Sting"
desc = "We silently sting our victim with a chemical that will gradually drain their stamina. Costs 50 chemicals."
helptext = "Does not provide a warning to the victim, though they will quickly realize they have been poisoned."
button_overlay_icon_state = "sting_lethargic"
button_icon_state = "sting_lethargic"
sting_icon = "sting_lethargic"
chemical_cost = 50
dna_cost = 4
@@ -1,7 +1,7 @@
/datum/action/changeling/transform
name = "Transform"
desc = "We take on the appearance and voice of one we have absorbed. Costs 5 chemicals."
button_overlay_icon_state = "transform"
button_icon_state = "transform"
chemical_cost = 5
power_type = CHANGELING_INNATE_POWER
req_dna = 1
@@ -268,7 +268,7 @@
return // TODO, add a refund proc?
user_eyes.AddComponent(/datum/component/scope, item_action_type = /datum/action/item_action/organ_action/toggle, flags = SCOPE_CLICK_MIDDLE)
for(var/datum/action/action in user_eyes.actions)
action.button_background_icon_state = "bg_flayer"
action.background_icon_state = "bg_flayer"
action.Grant(owner)
/datum/mindflayer_passive/telescopic_eyes/on_remove()
@@ -341,7 +341,7 @@
if(!internal_jammer)
internal_jammer = new /obj/item/jammer(owner) //Shove it in the flayer's chest
for(var/datum/action/action in internal_jammer.actions)
action.button_background_icon_state = "bg_flayer"
action.background_icon_state = "bg_flayer"
action.Grant(owner)
internal_jammer.range = 15 + ((level - 1) * 5) //Base range of the jammer is 15, each level adds 5 tiles for a max of 25 if you want to be REALLY annoying
@@ -301,7 +301,7 @@ RESTRICT_TYPE(/datum/antagonist/vampire)
check_vampire_upgrade(TRUE)
for(var/datum/spell/S in powers)
if(S.action)
S.action.UpdateButtons()
S.action.build_all_button_icons()
/**
* Safely subtract vampire's bloodusable. Clamped between 0 and bloodtotal.
@@ -14,7 +14,7 @@
action.name = "[initial(name)] ([V.iscloaking ? "Deactivate" : "Activate"])"
SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_NAME)
UpdateButtons()
build_all_button_icons()
/datum/spell/vampire/self/cloak/cast(list/targets, mob/user = usr)
var/datum/antagonist/vampire/V = user.mind.has_antag_datum(/datum/antagonist/vampire)