mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 12:37:26 +01:00
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:
@@ -1,7 +1,7 @@
|
||||
/// Blood magic handles the creation of blood spells (formerly talismans)
|
||||
/datum/action/innate/cult/blood_magic
|
||||
name = "Prepare Blood Magic"
|
||||
button_overlay_icon_state = "carve"
|
||||
button_icon_state = "carve"
|
||||
desc = "Prepare blood magic by carving runes into your flesh. This is easier with an <b>empowering rune</b>."
|
||||
default_button_position = DEFAULT_BLOODSPELLS
|
||||
var/list/spells = list()
|
||||
@@ -74,7 +74,7 @@
|
||||
/// The next generation of talismans, handles storage/creation of blood magic
|
||||
/datum/action/innate/cult/blood_spell
|
||||
name = "Blood Magic"
|
||||
button_overlay_icon_state = "telerune"
|
||||
button_icon_state = "telerune"
|
||||
desc = "Fear the Old Blood."
|
||||
default_button_position = SCRN_OBJ_CULT_LIST
|
||||
var/charges = 1
|
||||
@@ -86,7 +86,11 @@
|
||||
var/health_cost = 0
|
||||
/// Have we already been positioned into our starting location?
|
||||
var/positioned = FALSE
|
||||
var/mutable_appearance/button_charge_count
|
||||
|
||||
/datum/action/innate/cult/blood_spell/New(target)
|
||||
. = ..()
|
||||
button_charge_count = image('icons/effects/effects.dmi', icon_state = "nothing")
|
||||
|
||||
/datum/action/innate/cult/blood_spell/proc/get_panel_text()
|
||||
if(initial(charges) == 1)
|
||||
@@ -94,14 +98,17 @@
|
||||
var/available_charges = hand_magic ? "[hand_magic.uses]" : "[charges]"
|
||||
return "[available_charges]/[initial(charges)]"
|
||||
|
||||
/datum/action/innate/cult/blood_spell/UpdateButton(atom/movable/screen/movable/action_button/button, status_only, force)
|
||||
/datum/action/innate/cult/blood_spell/update_button_status(atom/movable/screen/movable/action_button/button, force)
|
||||
. = ..()
|
||||
if(!button)
|
||||
return
|
||||
button.overlays -= button_charge_count
|
||||
|
||||
var/text = get_panel_text()
|
||||
if(!text || !button)
|
||||
return
|
||||
var/image/count_down_holder = image('icons/effects/effects.dmi', icon_state = "nothing")
|
||||
count_down_holder.maptext = "<div style=\"font-size:8pt;color:white;font:'Small Fonts';text-align:center;\" valign=\"bottom\">[text]</div>"
|
||||
button.add_overlay(count_down_holder)
|
||||
button_charge_count.maptext = "<div style=\"font-size:8pt;color:white;font:'Small Fonts';text-align:center;\" valign=\"bottom\">[text]</div>"
|
||||
button.overlays |= button_charge_count
|
||||
|
||||
/datum/action/innate/cult/blood_spell/Grant(mob/living/owner, datum/action/innate/cult/blood_magic/BM)
|
||||
if(health_cost)
|
||||
@@ -148,21 +155,21 @@
|
||||
/datum/action/innate/cult/blood_spell/stun
|
||||
name = "Stun"
|
||||
desc = "Will knock down and mute a victim on contact. Strike them with a cult blade to complete the invocation, stunning them and extending the mute."
|
||||
button_overlay_icon_state = "stun"
|
||||
button_icon_state = "stun"
|
||||
magic_path = /obj/item/melee/blood_magic/stun
|
||||
health_cost = 10
|
||||
|
||||
/datum/action/innate/cult/blood_spell/teleport
|
||||
name = "Teleport"
|
||||
desc = "Empowers your hand to teleport yourself or another cultist to a teleport rune on contact."
|
||||
button_overlay_icon_state = "teleport"
|
||||
button_icon_state = "teleport"
|
||||
magic_path = /obj/item/melee/blood_magic/teleport
|
||||
health_cost = 7
|
||||
|
||||
/datum/action/innate/cult/blood_spell/emp
|
||||
name = "Electromagnetic Pulse"
|
||||
desc = "Releases an Electromagnetic Pulse, affecting nearby non-cultists. <b>The pulse will still affect you.</b>"
|
||||
button_overlay_icon_state = "emp"
|
||||
button_icon_state = "emp"
|
||||
health_cost = 10
|
||||
invocation = "Ta'gh fara'qha fel d'amar det!"
|
||||
|
||||
@@ -198,24 +205,24 @@
|
||||
/datum/action/innate/cult/blood_spell/shackles
|
||||
name = "Shadow Shackles"
|
||||
desc = "Empowers your hand to start handcuffing victim on contact, and mute them if successful."
|
||||
button_overlay_icon_state = "shackles"
|
||||
button_icon_state = "shackles"
|
||||
charges = 4
|
||||
magic_path = /obj/item/melee/blood_magic/shackles
|
||||
|
||||
/datum/action/innate/cult/blood_spell/construction
|
||||
name = "Twisted Construction"
|
||||
desc = "Empowers your hand to corrupt certain metalic objects.<br><u>Converts:</u><br>Plasteel into runed metal<br>50 metal into a construct shell<br>Cyborg shells into construct shells<br>Airlocks into brittle runed airlocks after a delay (harm intent)"
|
||||
button_overlay_icon_state = "transmute"
|
||||
button_icon_state = "transmute"
|
||||
magic_path = "/obj/item/melee/blood_magic/construction"
|
||||
health_cost = 12
|
||||
|
||||
/datum/action/innate/cult/blood_spell/dagger
|
||||
name = "Summon Dagger"
|
||||
desc = "Summon a ritual dagger, necessary to scribe runes."
|
||||
button_overlay_icon_state = "cult_dagger"
|
||||
button_icon_state = "cult_dagger"
|
||||
|
||||
/datum/action/innate/cult/blood_spell/dagger/New()
|
||||
button_overlay_icon_state = GET_CULT_DATA(dagger_icon, "cult_dagger")
|
||||
button_icon_state = GET_CULT_DATA(dagger_icon, "cult_dagger")
|
||||
..()
|
||||
|
||||
/datum/action/innate/cult/blood_spell/dagger/Activate()
|
||||
@@ -238,13 +245,13 @@
|
||||
/datum/action/innate/cult/blood_spell/equipment
|
||||
name = "Summon Equipment"
|
||||
desc = "Empowers your hand to summon combat gear onto a cultist you touch, including cult armor into open slots, a cult bola, and a cult sword."
|
||||
button_overlay_icon_state = "equip"
|
||||
button_icon_state = "equip"
|
||||
magic_path = /obj/item/melee/blood_magic/armor
|
||||
|
||||
/datum/action/innate/cult/blood_spell/horror
|
||||
name = "Hallucinations"
|
||||
desc = "Gives hallucinations to a target at range. A silent and invisible spell."
|
||||
button_overlay_icon_state = "horror"
|
||||
button_icon_state = "horror"
|
||||
var/datum/spell/horror/PH
|
||||
charges = 4
|
||||
|
||||
@@ -296,10 +303,9 @@
|
||||
var/mob/living/carbon/human/H = target
|
||||
H.Hallucinate(120 SECONDS)
|
||||
attached_action.charges--
|
||||
attached_action.UpdateButtons()
|
||||
attached_action.desc = attached_action.base_desc
|
||||
attached_action.desc += "<br><b><u>Has [attached_action.charges] use\s remaining</u></b>."
|
||||
attached_action.UpdateButtons()
|
||||
attached_action.build_all_button_icons()
|
||||
user.ranged_ability.remove_ranged_ability(user, "<span class='cult'><b>[H] has been cursed with living nightmares!</b></span>")
|
||||
if(attached_action.charges <= 0)
|
||||
to_chat(ranged_ability_user, "<span class='cult'>You have exhausted the spell's power!</span>")
|
||||
@@ -309,7 +315,7 @@
|
||||
name = "Conceal Presence"
|
||||
desc = "Alternates between hiding and revealing nearby cult structures, cult airlocks and runes."
|
||||
invocation = "Kla'atu barada nikt'o!"
|
||||
button_overlay_icon_state = "veiling"
|
||||
button_icon_state = "veiling"
|
||||
charges = 10
|
||||
var/revealing = FALSE //if it reveals or not
|
||||
|
||||
@@ -329,7 +335,7 @@
|
||||
O.cult_conceal()
|
||||
revealing = TRUE // Switch on use
|
||||
name = "Reveal Runes"
|
||||
button_overlay_icon_state = "revealing"
|
||||
button_icon_state = "revealing"
|
||||
|
||||
else // Unhiding stuff
|
||||
owner.visible_message("<span class='warning'>A flash of light shines from [owner]'s hand!</span>", \
|
||||
@@ -344,19 +350,19 @@
|
||||
O.cult_reveal()
|
||||
revealing = FALSE // Switch on use
|
||||
name = "Conceal Runes"
|
||||
button_overlay_icon_state = "veiling"
|
||||
button_icon_state = "veiling"
|
||||
if(charges <= 0)
|
||||
qdel(src)
|
||||
desc = "[revealing ? "Reveals" : "Conceals"] nearby cult structures, airlocks, and runes."
|
||||
desc += "<br><b><u>Has [charges] use\s remaining</u></b>."
|
||||
UpdateButtons()
|
||||
build_all_button_icons()
|
||||
|
||||
/datum/action/innate/cult/blood_spell/manipulation
|
||||
name = "Blood Rites"
|
||||
desc = "Empowers your hand to manipulate blood. Use on blood or a noncultist to absorb blood to be used later, use on yourself or another cultist to heal them using absorbed blood. \
|
||||
\nUse the spell in-hand to cast advanced rites, such as summoning a magical blood spear, firing blood projectiles out of your hands, and more!"
|
||||
invocation = "Fel'th Dol Ab'orod!"
|
||||
button_overlay_icon_state = "manip"
|
||||
button_icon_state = "manip"
|
||||
charges = 5
|
||||
magic_path = /obj/item/melee/blood_magic/manipulator
|
||||
|
||||
@@ -403,7 +409,7 @@
|
||||
source.charges = uses
|
||||
source.desc = source.base_desc
|
||||
source.desc += "<br><b><u>Has [uses] use\s remaining</u></b>."
|
||||
source.UpdateButtons()
|
||||
source.build_all_button_icons()
|
||||
return ..()
|
||||
|
||||
/obj/item/melee/blood_magic/customised_abstract_text(mob/living/carbon/owner)
|
||||
@@ -436,7 +442,7 @@
|
||||
else if(source)
|
||||
source.desc = source.base_desc
|
||||
source.desc += "<br><b><u>Has [uses] use\s remaining</u></b>."
|
||||
source.UpdateButtons()
|
||||
source.build_all_button_icons()
|
||||
|
||||
//The spell effects
|
||||
|
||||
@@ -576,7 +582,7 @@
|
||||
user.visible_message("<span class='cultitalic'>This victim doesn't have enough arms to complete the restraint!</span>")
|
||||
return
|
||||
CuffAttack(C, user)
|
||||
source.UpdateButtons()
|
||||
source.build_all_button_icons()
|
||||
..()
|
||||
|
||||
/obj/item/melee/blood_magic/shackles/proc/CuffAttack(mob/living/carbon/C, mob/living/user)
|
||||
@@ -872,12 +878,12 @@
|
||||
target.clean_blood()
|
||||
else
|
||||
steal_blood(user, target)
|
||||
source.UpdateButtons()
|
||||
source.build_all_button_icons()
|
||||
return
|
||||
|
||||
if(isconstruct(target))
|
||||
heal_construct(user, target)
|
||||
source.UpdateButtons()
|
||||
source.build_all_button_icons()
|
||||
return
|
||||
|
||||
if(istype(target, /obj/item/blood_orb))
|
||||
@@ -887,10 +893,10 @@
|
||||
to_chat(user, "<span class='warning'>You obtain [candidate.blood] blood from the orb of blood!</span>")
|
||||
playsound(user, 'sound/misc/enter_blood.ogg', 50, extrarange = SOUND_RANGE_SET(7))
|
||||
qdel(candidate)
|
||||
source.UpdateButtons()
|
||||
source.build_all_button_icons()
|
||||
return
|
||||
blood_draw(target, user)
|
||||
source.UpdateButtons()
|
||||
source.build_all_button_icons()
|
||||
|
||||
/obj/item/melee/blood_magic/manipulator/proc/blood_draw(atom/target, mob/living/carbon/human/user)
|
||||
var/temp = 0
|
||||
@@ -994,4 +1000,4 @@
|
||||
to_chat(user, "<span class='warning'>You need a free hand for this rite!</span>")
|
||||
uses += BLOOD_BARRAGE_COST // Refund the charges
|
||||
qdel(rite)
|
||||
source.UpdateButtons()
|
||||
source.build_all_button_icons()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/datum/action/innate/cult
|
||||
button_overlay_icon = 'icons/mob/actions/actions_cult.dmi'
|
||||
button_background_icon_state = "bg_cult"
|
||||
button_icon = 'icons/mob/actions/actions_cult.dmi'
|
||||
background_icon_state = "bg_cult"
|
||||
check_flags = AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_CONSCIOUS
|
||||
buttontooltipstyle = "cult"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
/datum/action/innate/cult/comm
|
||||
name = "Communion"
|
||||
desc = "Whispered words that all cultists can hear.<br><b>Warning:</b>Nearby non-cultists can still hear you."
|
||||
button_overlay_icon_state = "cult_comms"
|
||||
button_icon_state = "cult_comms"
|
||||
check_flags = AB_CHECK_CONSCIOUS
|
||||
|
||||
/datum/action/innate/cult/comm/Activate()
|
||||
@@ -87,12 +87,12 @@
|
||||
//Objectives
|
||||
/datum/action/innate/cult/check_progress
|
||||
name = "Study the Veil"
|
||||
button_overlay_icon_state = "tome"
|
||||
button_icon_state = "tome"
|
||||
desc = "Check your cult's current progress and objective."
|
||||
check_flags = AB_CHECK_CONSCIOUS
|
||||
|
||||
/datum/action/innate/cult/check_progress/New()
|
||||
button_overlay_icon_state = GET_CULT_DATA(tome_icon, "tome")
|
||||
button_icon_state = GET_CULT_DATA(tome_icon, "tome")
|
||||
..()
|
||||
|
||||
/datum/action/innate/cult/check_progress/IsAvailable()
|
||||
@@ -111,11 +111,11 @@
|
||||
/datum/action/innate/cult/use_dagger
|
||||
name = "Draw Blood Rune"
|
||||
desc = "Use the ritual dagger to create a powerful blood rune."
|
||||
button_overlay_icon_state = "blood_dagger"
|
||||
button_icon_state = "blood_dagger"
|
||||
default_button_position = "10:29,4:-2"
|
||||
|
||||
/datum/action/innate/cult/use_dagger/Grant()
|
||||
button_overlay_icon_state = GET_CULT_DATA(dagger_icon, "blood_dagger")
|
||||
button_icon_state = GET_CULT_DATA(dagger_icon, "blood_dagger")
|
||||
..()
|
||||
|
||||
/datum/action/innate/cult/use_dagger/Activate()
|
||||
|
||||
@@ -634,7 +634,7 @@
|
||||
/datum/action/innate/cult/spear
|
||||
name = "Bloody Bond"
|
||||
desc = "Recall the blood spear to your hand."
|
||||
button_overlay_icon_state = "bloodspear"
|
||||
button_icon_state = "bloodspear"
|
||||
default_button_position = "11:31,4:-2"
|
||||
var/obj/item/cult_spear/spear
|
||||
var/cooldown = 0
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
if(QDELETED(src) || uses) //Not sure if not having src here would cause a runtime, so it's here to be safe
|
||||
return
|
||||
desc = "[initial(desc)] It has [uses] use\s remaining."
|
||||
UpdateButtons()
|
||||
build_all_button_icons()
|
||||
|
||||
/datum/spell/ai_spell/proc/check_camera_vision(mob/user, atom/target)
|
||||
var/turf/target_turf = get_turf(target)
|
||||
@@ -207,7 +207,7 @@
|
||||
else //Adding uses to an existing module
|
||||
action.uses += initial(action.uses)
|
||||
action.desc = "[initial(action.desc)] It has [action.uses] use\s remaining."
|
||||
action.UpdateButtons()
|
||||
action.build_all_button_icons()
|
||||
temp = "Additional use[action.uses > 1 ? "s" : ""] added to [action.name]!"
|
||||
processing_time -= AM.cost
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
|
||||
/datum/action/innate/teleport_in
|
||||
name = "Send To"
|
||||
button_overlay_icon_state = "beam_down"
|
||||
button_icon_state = "beam_down"
|
||||
|
||||
/datum/action/innate/teleport_in/Activate()
|
||||
if(!target || !iscarbon(owner))
|
||||
@@ -83,7 +83,7 @@
|
||||
|
||||
/datum/action/innate/teleport_out
|
||||
name = "Retrieve"
|
||||
button_overlay_icon_state = "beam_up"
|
||||
button_icon_state = "beam_up"
|
||||
|
||||
/datum/action/innate/teleport_out/Activate()
|
||||
if(!target || !iscarbon(owner))
|
||||
@@ -96,7 +96,7 @@
|
||||
|
||||
/datum/action/innate/teleport_self
|
||||
name = "Send Self"
|
||||
button_overlay_icon_state = "beam_down"
|
||||
button_icon_state = "beam_down"
|
||||
|
||||
/datum/action/innate/teleport_self/Activate()
|
||||
if(!target || !iscarbon(owner))
|
||||
@@ -110,7 +110,7 @@
|
||||
|
||||
/datum/action/innate/vest_mode_swap
|
||||
name = "Switch Vest Mode"
|
||||
button_overlay_icon_state = "vest_mode"
|
||||
button_icon_state = "vest_mode"
|
||||
|
||||
/datum/action/innate/vest_mode_swap/Activate()
|
||||
if(!target || !iscarbon(owner))
|
||||
@@ -121,7 +121,7 @@
|
||||
|
||||
/datum/action/innate/vest_disguise_swap
|
||||
name = "Switch Vest Disguise"
|
||||
button_overlay_icon_state = "vest_disguise"
|
||||
button_icon_state = "vest_disguise"
|
||||
|
||||
/datum/action/innate/vest_disguise_swap/Activate()
|
||||
if(!target || !iscarbon(owner))
|
||||
@@ -131,7 +131,7 @@
|
||||
|
||||
/datum/action/innate/set_droppoint
|
||||
name = "Set Experiment Release Point"
|
||||
button_overlay_icon_state = "set_drop"
|
||||
button_icon_state = "set_drop"
|
||||
|
||||
/datum/action/innate/set_droppoint/Activate()
|
||||
if(!target || !iscarbon(owner))
|
||||
|
||||
@@ -170,8 +170,8 @@
|
||||
AddSpell(new /datum/spell/fireball/shadow_grapple)
|
||||
var/datum/spell/bloodcrawl/shadow_crawl/S = new
|
||||
AddSpell(S)
|
||||
whisper_action.button_overlay_icon_state = "shadow_whisper"
|
||||
whisper_action.button_background_icon_state = "shadow_demon_bg"
|
||||
whisper_action.button_icon_state = "shadow_whisper"
|
||||
whisper_action.background_icon_state = "shadow_demon_bg"
|
||||
if(istype(loc, /obj/effect/dummy/slaughter))
|
||||
S.phased = TRUE
|
||||
RegisterSignal(loc, COMSIG_MOVABLE_MOVED, TYPE_PROC_REF(/mob/living/simple_animal/demon/shadow, check_darkness))
|
||||
|
||||
@@ -164,8 +164,8 @@
|
||||
|
||||
/datum/action/innate/demon_whisper
|
||||
name = "Demonic Whisper"
|
||||
button_overlay_icon_state = "demon_comms"
|
||||
button_background_icon_state = "bg_demon"
|
||||
button_icon_state = "demon_comms"
|
||||
background_icon_state = "bg_demon"
|
||||
|
||||
/datum/action/innate/demon_whisper/IsAvailable()
|
||||
return ..()
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
*/
|
||||
/datum/action/guardian
|
||||
name = "Generic guardian host action"
|
||||
button_overlay_icon = 'icons/mob/guardian.dmi'
|
||||
button_overlay_icon_state = "base"
|
||||
button_icon = 'icons/mob/guardian.dmi'
|
||||
button_icon_state = "base"
|
||||
var/mob/living/simple_animal/hostile/guardian/guardian
|
||||
|
||||
/datum/action/guardian/Grant(mob/M, mob/living/simple_animal/hostile/guardian/G)
|
||||
@@ -24,7 +24,7 @@
|
||||
/datum/action/guardian/communicate
|
||||
name = "Communicate"
|
||||
desc = "Communicate telepathically with your guardian."
|
||||
button_overlay_icon_state = "communicate"
|
||||
button_icon_state = "communicate"
|
||||
|
||||
/datum/action/guardian/communicate/Trigger(left_click)
|
||||
var/input = tgui_input_text(owner, "Enter a message to tell your guardian:", "Message")
|
||||
@@ -50,7 +50,7 @@
|
||||
/datum/action/guardian/recall
|
||||
name = "Recall Guardian"
|
||||
desc = "Forcibly recall your guardian."
|
||||
button_overlay_icon_state = "recall"
|
||||
button_icon_state = "recall"
|
||||
|
||||
/datum/action/guardian/recall/Trigger(left_click)
|
||||
guardian.Recall()
|
||||
@@ -63,7 +63,7 @@
|
||||
/datum/action/guardian/reset_guardian
|
||||
name = "Replace Guardian Player"
|
||||
desc = "Replace your guardian's player with a ghost. This can only be done once."
|
||||
button_overlay_icon_state = "reset"
|
||||
button_icon_state = "reset"
|
||||
var/cooldown_timer
|
||||
|
||||
/datum/action/guardian/reset_guardian/IsAvailable()
|
||||
@@ -82,7 +82,7 @@
|
||||
|
||||
// Do this immediately, so the user can't spam a bunch of polls.
|
||||
cooldown_timer = addtimer(CALLBACK(src, PROC_REF(reset_cooldown)), 5 MINUTES)
|
||||
UpdateButtons()
|
||||
build_all_button_icons()
|
||||
|
||||
to_chat(owner, "<span class='danger'>Searching for a replacement ghost...</span>")
|
||||
var/list/mob/dead/observer/candidates = SSghost_spawns.poll_candidates("Do you want to play as [guardian.real_name]?", ROLE_GUARDIAN, FALSE, 15 SECONDS, source = guardian)
|
||||
@@ -184,7 +184,7 @@
|
||||
*/
|
||||
/datum/action/guardian/reset_guardian/proc/reset_cooldown()
|
||||
cooldown_timer = null
|
||||
UpdateButtons()
|
||||
build_all_button_icons()
|
||||
|
||||
/**
|
||||
* Grants all existing `/datum/action/guardian` type actions to the src mob.
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
/mob/living/simple_animal/hostile/morph/proc/add_food(amount)
|
||||
gathered_food += amount
|
||||
for(var/datum/action/spell_action/action in actions)
|
||||
action.UpdateButtons()
|
||||
action.build_all_button_icons()
|
||||
|
||||
|
||||
/mob/living/simple_animal/hostile/morph/proc/assume()
|
||||
@@ -155,8 +155,8 @@
|
||||
melee_damage_lower = 5
|
||||
melee_damage_upper = 5
|
||||
speed = MORPHED_SPEED
|
||||
ambush_spell.UpdateButtons()
|
||||
pass_airlock_spell.UpdateButtons()
|
||||
ambush_spell.build_all_button_icons()
|
||||
pass_airlock_spell.build_all_button_icons()
|
||||
move_resist = MOVE_FORCE_DEFAULT // They become more fragile and easier to move
|
||||
|
||||
/mob/living/simple_animal/hostile/morph/proc/restore()
|
||||
@@ -171,7 +171,7 @@
|
||||
if(ambush_prepared)
|
||||
to_chat(src, "<span class='warning'>The ambush potential has faded as you take your true form.</span>")
|
||||
failed_ambush()
|
||||
pass_airlock_spell.UpdateButtons()
|
||||
pass_airlock_spell.build_all_button_icons()
|
||||
move_resist = MOVE_FORCE_STRONG // Return to their fatness
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@
|
||||
|
||||
/mob/living/simple_animal/hostile/morph/proc/failed_ambush()
|
||||
ambush_prepared = FALSE
|
||||
ambush_spell.UpdateButtons()
|
||||
ambush_spell.build_all_button_icons()
|
||||
mimic_spell.perfect_disguise = FALSE // Reset the perfect disguise
|
||||
remove_status_effect(/datum/status_effect/morph_ambush)
|
||||
UnregisterSignal(src, COMSIG_MOVABLE_MOVED)
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
name = "[name] ([hunger_cost])"
|
||||
action.name = name
|
||||
action.desc = desc
|
||||
action.UpdateButtons()
|
||||
action.build_all_button_icons()
|
||||
|
||||
/datum/spell/morph_spell/create_new_handler()
|
||||
var/datum/spell_handler/morph/H = new
|
||||
|
||||
@@ -169,8 +169,8 @@
|
||||
update_glow()
|
||||
playsound(get_turf(src), 'sound/effects/eleczap.ogg', 30, TRUE)
|
||||
give_spells()
|
||||
whisper_action.button_overlay_icon_state = "pulse_whisper"
|
||||
whisper_action.button_background_icon_state = "bg_pulsedemon"
|
||||
whisper_action.button_icon_state = "pulse_whisper"
|
||||
whisper_action.background_icon_state = "bg_pulsedemon"
|
||||
|
||||
/mob/living/simple_animal/demon/pulse_demon/proc/deleted_handler(our_demon, force)
|
||||
SIGNAL_HANDLER
|
||||
@@ -344,7 +344,7 @@
|
||||
if(!S.action || S.locked)
|
||||
continue
|
||||
if(S.requires_area)
|
||||
S.action.UpdateButtons()
|
||||
S.action.build_all_button_icons()
|
||||
|
||||
// can enter an apc at all?
|
||||
/mob/living/simple_animal/demon/pulse_demon/proc/is_valid_apc(obj/machinery/power/apc/A)
|
||||
@@ -457,7 +457,7 @@
|
||||
var/dist = S.cast_cost - orig
|
||||
// only update icon if the amount is actually enough to change a spell's availability
|
||||
if(dist == 0 || (dist > 0 && realdelta >= dist) || (dist < 0 && realdelta <= dist))
|
||||
S.action.UpdateButtons()
|
||||
S.action.build_all_button_icons()
|
||||
return realdelta
|
||||
|
||||
// linear scale for glow strength, see table:
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
desc = "[initial(desc)][spell_level == level_max ? "" : " It costs [format_si_suffix(upgrade_cost)] APC\s to upgrade. <b>Alt-Click</b> this spell to upgrade it."]"
|
||||
action.name = name
|
||||
action.desc = desc
|
||||
action.UpdateButtons()
|
||||
action.build_all_button_icons()
|
||||
|
||||
/datum/spell/pulse_demon/can_cast(mob/living/simple_animal/demon/pulse_demon/user, charge_check, show_message)
|
||||
if(!..())
|
||||
@@ -276,8 +276,8 @@
|
||||
|
||||
/datum/spell/pulse_demon/toggle/proc/do_toggle(varstate, mob/user)
|
||||
if(action)
|
||||
action.button_background_icon_state = varstate ? action_background_icon_state : "[action_background_icon_state]_disabled"
|
||||
action.UpdateButtons()
|
||||
action.background_icon_state = varstate ? action_background_icon_state : "[action_background_icon_state]_disabled"
|
||||
action.build_all_button_icons()
|
||||
if(user)
|
||||
to_chat(user, "<span class='notice'>You will [varstate ? "now" : "no longer"] [base_message]</span>")
|
||||
return varstate
|
||||
|
||||
@@ -175,7 +175,7 @@
|
||||
name = "[initial(name)] ([cast_amount]E)"
|
||||
action.name = name
|
||||
action.desc = desc
|
||||
action.UpdateButtons()
|
||||
action.build_all_button_icons()
|
||||
|
||||
/datum/spell/aoe/revenant/revert_cast(mob/user)
|
||||
. = ..()
|
||||
@@ -212,7 +212,7 @@
|
||||
user.reveal(reveal)
|
||||
user.stun(stun)
|
||||
if(action)
|
||||
action.UpdateButtons()
|
||||
action.build_all_button_icons()
|
||||
return TRUE
|
||||
|
||||
//Overload Light: Breaks a light that's online and sends out lightning bolts to all nearby people.
|
||||
|
||||
@@ -456,15 +456,15 @@
|
||||
//action given to antag clowns
|
||||
/datum/action/innate/toggle_clumsy
|
||||
name = "Toggle Clown Clumsy"
|
||||
button_overlay_icon_state = "clown"
|
||||
button_icon_state = "clown"
|
||||
|
||||
/datum/action/innate/toggle_clumsy/Activate()
|
||||
var/mob/living/carbon/human/H = owner
|
||||
H.dna.SetSEState(GLOB.clumsyblock, TRUE)
|
||||
singlemutcheck(H, GLOB.clumsyblock, MUTCHK_FORCED)
|
||||
active = TRUE
|
||||
button_background_icon_state = "bg_spell"
|
||||
UpdateButtons()
|
||||
background_icon_state = "bg_spell"
|
||||
build_all_button_icons()
|
||||
to_chat(H, "<span class='notice'>You start acting clumsy to throw suspicions off. Focus again before using weapons.</span>")
|
||||
|
||||
/datum/action/innate/toggle_clumsy/Deactivate()
|
||||
@@ -472,8 +472,8 @@
|
||||
H.dna.SetSEState(GLOB.clumsyblock, FALSE)
|
||||
singlemutcheck(H, GLOB.clumsyblock, MUTCHK_FORCED)
|
||||
active = FALSE
|
||||
button_background_icon_state = "bg_default"
|
||||
UpdateButtons()
|
||||
background_icon_state = "bg_default"
|
||||
build_all_button_icons()
|
||||
to_chat(H, "<span class='notice'>You focus and can now use weapons regularly.</span>")
|
||||
|
||||
/datum/job/mime
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
|
||||
/datum/action/innate/camera_off
|
||||
name = "End Camera View"
|
||||
button_overlay_icon_state = "camera_off"
|
||||
button_icon_state = "camera_off"
|
||||
|
||||
/datum/action/innate/camera_off/Activate()
|
||||
if(!target || !iscarbon(target))
|
||||
@@ -92,7 +92,7 @@
|
||||
|
||||
/datum/action/innate/camera_jump
|
||||
name = "Jump To Camera"
|
||||
button_overlay_icon_state = "camera_jump"
|
||||
button_icon_state = "camera_jump"
|
||||
|
||||
/datum/action/innate/camera_jump/Activate()
|
||||
if(!target || !iscarbon(target))
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
/datum/action/innate/mecha
|
||||
check_flags = AB_CHECK_RESTRAINED | AB_CHECK_STUNNED | AB_CHECK_CONSCIOUS
|
||||
button_overlay_icon = 'icons/mob/actions/actions_mecha.dmi'
|
||||
button_icon = 'icons/mob/actions/actions_mecha.dmi'
|
||||
var/obj/mecha/chassis
|
||||
|
||||
/datum/action/innate/mecha/Grant(mob/living/L, obj/mecha/M)
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
/datum/action/innate/mecha/mech_eject
|
||||
name = "Eject From Mech"
|
||||
button_overlay_icon_state = "mech_eject"
|
||||
button_icon_state = "mech_eject"
|
||||
|
||||
/datum/action/innate/mecha/mech_eject/Activate()
|
||||
if(!owner)
|
||||
@@ -46,20 +46,20 @@
|
||||
|
||||
/datum/action/innate/mecha/mech_toggle_internals
|
||||
name = "Toggle Internal Airtank Usage"
|
||||
button_overlay_icon_state = "mech_internals_off"
|
||||
button_icon_state = "mech_internals_off"
|
||||
|
||||
/datum/action/innate/mecha/mech_toggle_internals/Activate()
|
||||
if(!owner || !chassis || chassis.occupant != owner)
|
||||
return
|
||||
chassis.use_internal_tank = !chassis.use_internal_tank
|
||||
button_overlay_icon_state = "mech_internals_[chassis.use_internal_tank ? "on" : "off"]"
|
||||
button_icon_state = "mech_internals_[chassis.use_internal_tank ? "on" : "off"]"
|
||||
chassis.occupant_message("Now taking air from [chassis.use_internal_tank ? "internal airtank" : "environment"].")
|
||||
chassis.log_message("Now taking air from [chassis.use_internal_tank ? "internal airtank" : "environment"].")
|
||||
UpdateButtons()
|
||||
build_all_button_icons()
|
||||
|
||||
/datum/action/innate/mecha/mech_toggle_lights
|
||||
name = "Toggle Lights"
|
||||
button_overlay_icon_state = "mech_lights_off"
|
||||
button_icon_state = "mech_lights_off"
|
||||
|
||||
/datum/action/innate/mecha/mech_toggle_lights/Activate()
|
||||
if(!owner || !chassis || chassis.occupant != owner)
|
||||
@@ -67,17 +67,17 @@
|
||||
chassis.lights = !chassis.lights
|
||||
if(chassis.lights)
|
||||
chassis.set_light(chassis.lights_range, chassis.lights_power)
|
||||
button_overlay_icon_state = "mech_lights_on"
|
||||
button_icon_state = "mech_lights_on"
|
||||
else
|
||||
chassis.set_light(chassis.lights_range_ambient, chassis.lights_power_ambient)
|
||||
button_overlay_icon_state = "mech_lights_off"
|
||||
button_icon_state = "mech_lights_off"
|
||||
chassis.occupant_message("Toggled lights [chassis.lights ? "on" : "off"].")
|
||||
chassis.log_message("Toggled lights [chassis.lights ? "on" : "off"].")
|
||||
UpdateButtons()
|
||||
build_all_button_icons()
|
||||
|
||||
/datum/action/innate/mecha/mech_view_stats
|
||||
name = "View Stats"
|
||||
button_overlay_icon_state = "mech_view_stats"
|
||||
button_icon_state = "mech_view_stats"
|
||||
|
||||
/datum/action/innate/mecha/mech_view_stats/Activate()
|
||||
if(!owner || !chassis || chassis.occupant != owner)
|
||||
@@ -86,7 +86,7 @@
|
||||
|
||||
/datum/action/innate/mecha/mech_defence_mode
|
||||
name = "Toggle Defence Mode"
|
||||
button_overlay_icon_state = "mech_defense_mode_off"
|
||||
button_icon_state = "mech_defense_mode_off"
|
||||
|
||||
/datum/action/innate/mecha/mech_defence_mode/Activate(forced_state = null)
|
||||
if(!owner || !chassis || chassis.occupant != owner)
|
||||
@@ -95,7 +95,7 @@
|
||||
chassis.defence_mode = forced_state
|
||||
else
|
||||
chassis.defence_mode = !chassis.defence_mode
|
||||
button_overlay_icon_state = "mech_defense_mode_[chassis.defence_mode ? "on" : "off"]"
|
||||
button_icon_state = "mech_defense_mode_[chassis.defence_mode ? "on" : "off"]"
|
||||
if(chassis.defence_mode)
|
||||
chassis.deflect_chance = chassis.defence_mode_deflect_chance
|
||||
chassis.occupant_message("<span class='notice'>You enable [chassis] defence mode.</span>")
|
||||
@@ -103,11 +103,11 @@
|
||||
chassis.deflect_chance = initial(chassis.deflect_chance)
|
||||
chassis.occupant_message("<span class='danger'>You disable [chassis] defence mode.</span>")
|
||||
chassis.log_message("Toggled defence mode.")
|
||||
UpdateButtons()
|
||||
build_all_button_icons()
|
||||
|
||||
/datum/action/innate/mecha/mech_overload_mode
|
||||
name = "Toggle leg actuators overload"
|
||||
button_overlay_icon_state = "mech_overload_off"
|
||||
button_icon_state = "mech_overload_off"
|
||||
|
||||
/datum/action/innate/mecha/mech_overload_mode/Activate(forced_state = null)
|
||||
if(!owner || !chassis || chassis.occupant != owner)
|
||||
@@ -119,7 +119,7 @@
|
||||
chassis.leg_overload_mode = forced_state
|
||||
else
|
||||
chassis.leg_overload_mode = !chassis.leg_overload_mode
|
||||
button_overlay_icon_state = "mech_overload_[chassis.leg_overload_mode ? "on" : "off"]"
|
||||
button_icon_state = "mech_overload_[chassis.leg_overload_mode ? "on" : "off"]"
|
||||
chassis.log_message("Toggled leg actuators overload.")
|
||||
if(chassis.leg_overload_mode)
|
||||
chassis.leg_overload_mode = 1
|
||||
@@ -133,11 +133,11 @@
|
||||
chassis.step_in = initial(chassis.step_in)
|
||||
chassis.step_energy_drain = chassis.normal_step_energy_drain
|
||||
chassis.occupant_message("<span class='notice'>You disable leg actuators overload.</span>")
|
||||
UpdateButtons()
|
||||
build_all_button_icons()
|
||||
|
||||
/datum/action/innate/mecha/mech_toggle_thrusters
|
||||
name = "Toggle Thrusters"
|
||||
button_overlay_icon_state = "mech_thrusters_off"
|
||||
button_icon_state = "mech_thrusters_off"
|
||||
|
||||
/datum/action/innate/mecha/mech_toggle_thrusters/Activate()
|
||||
if(!owner || !chassis || chassis.occupant != owner)
|
||||
@@ -146,13 +146,13 @@
|
||||
chassis.thrusters_active = !chassis.thrusters_active
|
||||
if(!chassis.thrusters_active)
|
||||
chassis.step_in = initial(chassis.step_in)
|
||||
button_overlay_icon_state = "mech_thrusters_[chassis.thrusters_active ? "on" : "off"]"
|
||||
button_icon_state = "mech_thrusters_[chassis.thrusters_active ? "on" : "off"]"
|
||||
chassis.log_message("Toggled thrusters.")
|
||||
chassis.occupant_message("<font color='[chassis.thrusters_active ? "blue" : "red"]'>Thrusters [chassis.thrusters_active ? "en" : "dis"]abled.")
|
||||
|
||||
/datum/action/innate/mecha/mech_smoke
|
||||
name = "Smoke"
|
||||
button_overlay_icon_state = "mech_smoke"
|
||||
button_icon_state = "mech_smoke"
|
||||
|
||||
/datum/action/innate/mecha/mech_smoke/Activate()
|
||||
if(!owner || !chassis || chassis.occupant != owner)
|
||||
@@ -168,14 +168,14 @@
|
||||
|
||||
/datum/action/innate/mecha/mech_zoom
|
||||
name = "Zoom"
|
||||
button_overlay_icon_state = "mech_zoom_off"
|
||||
button_icon_state = "mech_zoom_off"
|
||||
|
||||
/datum/action/innate/mecha/mech_zoom/Activate()
|
||||
if(!owner || !chassis || chassis.occupant != owner)
|
||||
return
|
||||
if(owner.client)
|
||||
chassis.zoom_mode = !chassis.zoom_mode
|
||||
button_overlay_icon_state = "mech_zoom_[chassis.zoom_mode ? "on" : "off"]"
|
||||
button_icon_state = "mech_zoom_[chassis.zoom_mode ? "on" : "off"]"
|
||||
chassis.log_message("Toggled zoom mode.")
|
||||
chassis.occupant_message("<font color='[chassis.zoom_mode ? "blue" : "red"]'>Zoom mode [chassis.zoom_mode ? "en" : "dis"]abled.</font>")
|
||||
if(chassis.zoom_mode)
|
||||
@@ -183,24 +183,24 @@
|
||||
SEND_SOUND(owner, sound(chassis.zoomsound, volume = 50))
|
||||
else
|
||||
owner.client.RemoveViewMod("mecha")
|
||||
UpdateButtons()
|
||||
build_all_button_icons()
|
||||
|
||||
/datum/action/innate/mecha/mech_toggle_phasing
|
||||
name = "Toggle Phasing"
|
||||
button_overlay_icon_state = "mech_phasing_off"
|
||||
button_icon_state = "mech_phasing_off"
|
||||
|
||||
/datum/action/innate/mecha/mech_toggle_phasing/Activate()
|
||||
if(!owner || !chassis || chassis.occupant != owner)
|
||||
return
|
||||
chassis.phasing = !chassis.phasing
|
||||
button_overlay_icon_state = "mech_phasing_[chassis.phasing ? "on" : "off"]"
|
||||
button_icon_state = "mech_phasing_[chassis.phasing ? "on" : "off"]"
|
||||
chassis.occupant_message("<font color=\"[chassis.phasing?"#00f\">En":"#f00\">Dis"]abled phasing.</font>")
|
||||
UpdateButtons()
|
||||
build_all_button_icons()
|
||||
|
||||
|
||||
/datum/action/innate/mecha/mech_switch_damtype
|
||||
name = "Reconfigure arm microtool arrays"
|
||||
button_overlay_icon_state = "mech_damtype_brute"
|
||||
button_icon_state = "mech_damtype_brute"
|
||||
|
||||
/datum/action/innate/mecha/mech_switch_damtype/Activate()
|
||||
if(!owner || !chassis || chassis.occupant != owner)
|
||||
@@ -217,16 +217,16 @@
|
||||
new_damtype = "tox"
|
||||
chassis.occupant_message("A bone-chillingly thick plasteel needle protracts from the exosuit's palm.")
|
||||
chassis.damtype = new_damtype
|
||||
button_overlay_icon_state = "mech_damtype_[new_damtype]"
|
||||
button_icon_state = "mech_damtype_[new_damtype]"
|
||||
playsound(src, 'sound/mecha/mechmove01.ogg', 50, TRUE)
|
||||
UpdateButtons()
|
||||
build_all_button_icons()
|
||||
|
||||
// Floor Buffer Action
|
||||
/datum/action/innate/mecha/mech_toggle_floorbuffer
|
||||
name = "Toggle Floor Buffer"
|
||||
desc = "Movement speed is decreased while active."
|
||||
button_overlay_icon = 'icons/obj/vehicles.dmi'
|
||||
button_overlay_icon_state = "upgrade"
|
||||
button_icon = 'icons/obj/vehicles.dmi'
|
||||
button_icon_state = "upgrade"
|
||||
|
||||
/datum/action/innate/mecha/mech_toggle_floorbuffer/Activate()
|
||||
if(!chassis.floor_buffer)
|
||||
@@ -245,8 +245,8 @@
|
||||
if(!_equipment)
|
||||
return FALSE
|
||||
equipment = _equipment
|
||||
button_overlay_icon = equipment.icon
|
||||
button_overlay_icon_state = equipment.icon_state
|
||||
button_icon = equipment.icon
|
||||
button_icon_state = equipment.icon_state
|
||||
name = "Switch module to [equipment.name]"
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -70,10 +70,6 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons
|
||||
var/list/actions = list()
|
||||
/// List of paths of action datums to give to the item on New().
|
||||
var/list/actions_types = list()
|
||||
/// List of icons-sheets for a given action to override the icon.
|
||||
var/list/action_icon = list()
|
||||
/// List of icon states for a given action to override the icon_state.
|
||||
var/list/action_icon_state = list()
|
||||
|
||||
/// What materials the item yields when broken down. Some methods will not recover everything (autolathes only recover metal and glass, for example).
|
||||
var/list/materials = list()
|
||||
@@ -215,7 +211,7 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons
|
||||
/obj/item/Initialize(mapload)
|
||||
. = ..()
|
||||
for(var/path in actions_types)
|
||||
new path(src, action_icon[path], action_icon_state[path])
|
||||
new path(src)
|
||||
if(isstorage(loc)) //marks all items in storage as being such
|
||||
in_storage = TRUE
|
||||
|
||||
@@ -1028,9 +1024,9 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons
|
||||
/obj/item/proc/should_stack_with(obj/item/other)
|
||||
return type == other.type && name == other.name
|
||||
|
||||
/obj/item/proc/update_action_buttons(status_only = FALSE, force = FALSE)
|
||||
/obj/item/proc/update_action_buttons(update_flags = ALL, force = FALSE)
|
||||
for(var/datum/action/current_action as anything in actions)
|
||||
current_action.UpdateButtons(status_only, force)
|
||||
current_action.build_all_button_icons(update_flags, force)
|
||||
|
||||
/**
|
||||
* Handles the bulk of cigarette lighting interactions. You must call `light()` to actually light the cigarette.
|
||||
|
||||
@@ -18,9 +18,8 @@
|
||||
name = "Deploy Box"
|
||||
desc = "Find inner peace, here, in the box."
|
||||
check_flags = AB_CHECK_HANDS_BLOCKED | AB_CHECK_IMMOBILE | AB_CHECK_CONSCIOUS | AB_CHECK_STUNNED
|
||||
button_background_icon_state = "bg_agent"
|
||||
button_overlay_icon_state = "deploy_box"
|
||||
use_itemicon = FALSE
|
||||
background_icon_state = "bg_agent"
|
||||
button_icon_state = "deploy_box"
|
||||
/// If TRUE, the box can't be deployed
|
||||
var/on_cooldown = FALSE
|
||||
|
||||
@@ -63,11 +62,11 @@
|
||||
on_cooldown = TRUE
|
||||
addtimer(CALLBACK(src, PROC_REF(end_cooldown)), 10 SECONDS)
|
||||
owner.clear_fullscreen("agent_box")
|
||||
UpdateButtons()
|
||||
build_all_button_icons()
|
||||
|
||||
/datum/action/item_action/agent_box/proc/end_cooldown()
|
||||
on_cooldown = FALSE
|
||||
UpdateButtons()
|
||||
build_all_button_icons()
|
||||
|
||||
/datum/action/item_action/agent_box/IsAvailable()
|
||||
if(..() && !on_cooldown)
|
||||
|
||||
Reference in New Issue
Block a user