diff --git a/code/__DEFINES/dcs/signals/signals_action.dm b/code/__DEFINES/dcs/signals/signals_action.dm index 8933490dc66..66a4ffc894b 100644 --- a/code/__DEFINES/dcs/signals/signals_action.dm +++ b/code/__DEFINES/dcs/signals/signals_action.dm @@ -57,3 +57,8 @@ /// From /datum/action/cooldown/spell/touch/lay_on_hands/proc/determine_if_this_hurts_instead(), sent to the /mob/living/carbon/hurtguy: (/mob/living/carbon/mendicant) #define COMSIG_ON_LAY_ON_HANDS "mob_ability_lay_on_hands" + +/// From /datum/action/innate/dash/proc/teleport when teleport is successful +#define COMSIG_DASH_ACTION_DASHED "dash_action_dashed" +/// From /datum/action/innate/dash/proc/charge when charges are replenished +#define COMSIG_DASH_ACTION_CHARGED "dash_action_charged" diff --git a/code/datums/dash_weapon.dm b/code/datums/dash_weapon.dm index 8a02894bc1e..c55ce0be79b 100644 --- a/code/datums/dash_weapon.dm +++ b/code/datums/dash_weapon.dm @@ -68,12 +68,14 @@ current_charges-- addtimer(CALLBACK(src, PROC_REF(charge)), charge_rate) owner?.update_mob_action_buttons() + SEND_SIGNAL(src, COMSIG_DASH_ACTION_DASHED) return TRUE /// Callback for [/proc/teleport] to increment our charges after use. /datum/action/innate/dash/proc/charge() current_charges = clamp(current_charges + 1, 0, max_charges) + SEND_SIGNAL(src, COMSIG_DASH_ACTION_CHARGED) var/obj/item/dashing_item = target if(!istype(dashing_item)) diff --git a/code/modules/mining/lavaland/mining_loot/megafauna/hierophant.dm b/code/modules/mining/lavaland/mining_loot/megafauna/hierophant.dm index 520502aaf30..38f51568544 100644 --- a/code/modules/mining/lavaland/mining_loot/megafauna/hierophant.dm +++ b/code/modules/mining/lavaland/mining_loot/megafauna/hierophant.dm @@ -2,9 +2,9 @@ /obj/item/hierophant_club name = "hierophant club" - desc = "The strange technology of this large club allows various nigh-magical teleportation feats. It used to beat you, but now you can set the beat." - icon_state = "hierophant_club_ready_beacon" - inhand_icon_state = "hierophant_club_ready_beacon" + desc = "The shriveled remains of the Hierophant hold some remnant of its power. It used it to beat you, but now you can set the beat." + icon_state = "hierophant_club" + inhand_icon_state = "hierophant_club" icon_angle = -135 icon = 'icons/obj/mining_zones/artefacts.dmi' lefthand_file = 'icons/mob/inhands/64x64_lefthand.dmi' @@ -33,6 +33,9 @@ . = ..() AddElement(/datum/element/update_icon_updates_onmob) blink = new(src) + update_appearance(UPDATE_OVERLAYS) + + RegisterSignals(blink, list(COMSIG_DASH_ACTION_CHARGED, COMSIG_DASH_ACTION_DASHED), PROC_REF(on_action_updated)) /obj/item/hierophant_club/Destroy(force) QDEL_NULL(blink) @@ -91,9 +94,23 @@ return ITEM_INTERACT_SUCCESS return NONE -/obj/item/hierophant_club/update_icon_state() - icon_state = inhand_icon_state = "hierophant_club[blink?.current_charges > 0 ? "_ready" : ""][!QDELETED(beacon) ? "" : "_beacon"]" - return ..() +/// When dash action is used or recharges, update icon state +/obj/item/hierophant_club/proc/on_action_updated() + SIGNAL_HANDLER + update_appearance(UPDATE_OVERLAYS) + +/obj/item/hierophant_club/update_overlays() + . = ..() + if (QDELETED(beacon)) + . += "hierophant_beacon" + if (blink?.current_charges) + . += "hierophant_ready" + +/obj/item/hierophant_club/worn_overlays(mutable_appearance/standing, isinhands, icon_file) + . = ..() + if (blink?.current_charges) + . += "hierophant_ready" + /obj/item/hierophant_club/ui_action_click(mob/user, action) if (teleporting) @@ -212,7 +229,7 @@ user.update_mob_action_buttons() user.visible_message(span_hierophant_warning("[user] places a strange machine beneath [user.p_their()] feet!"), span_hierophant("You detach the hierophant beacon, allowing you to teleport yourself and any allies to it at any time!")) to_chat(user, span_hierophant("You can remove the beacon to place it again by striking it with the club.")) - update_appearance(UPDATE_ICON_STATE) + update_appearance(UPDATE_OVERLAYS) /obj/item/hierophant_club/proc/beacon_destroyed(datum/source) SIGNAL_HANDLER @@ -222,7 +239,7 @@ else visible_message(span_hierophant("With a loud snap, a new beacon appears at [src]'s pommel.")) playsound(src, 'sound/effects/magic/blind.ogg', 50, TRUE, -4) - update_appearance(UPDATE_ICON_STATE) + update_appearance(UPDATE_OVERLAYS) #define HIEROPHANT_BLINK_RANGE 5 #define HIEROPHANT_BLINK_COOLDOWN (15 SECONDS) @@ -240,14 +257,10 @@ /datum/action/innate/dash/hierophant/teleport(mob/user, atom/target) var/dist = get_dist(user, target) if(dist > HIEROPHANT_BLINK_RANGE) - user.balloon_alert(user, "destination out of range!") + user.balloon_alert(user, "too far!") return FALSE - . = ..() - - var/obj/item/hierophant_club/club = target - if(!istype(club)) - club.update_appearance(UPDATE_ICON_STATE) + return ..() /datum/action/innate/dash/hierophant/charge() . = ..() diff --git a/icons/mob/inhands/64x64_lefthand.dmi b/icons/mob/inhands/64x64_lefthand.dmi index 25b5feddc22..b2e48a848b2 100644 Binary files a/icons/mob/inhands/64x64_lefthand.dmi and b/icons/mob/inhands/64x64_lefthand.dmi differ diff --git a/icons/mob/inhands/64x64_righthand.dmi b/icons/mob/inhands/64x64_righthand.dmi index f3a9caa9183..9ab5cb39381 100644 Binary files a/icons/mob/inhands/64x64_righthand.dmi and b/icons/mob/inhands/64x64_righthand.dmi differ diff --git a/icons/obj/mining_zones/artefacts.dmi b/icons/obj/mining_zones/artefacts.dmi index 86cfdcd7624..4c4dda6aa20 100644 Binary files a/icons/obj/mining_zones/artefacts.dmi and b/icons/obj/mining_zones/artefacts.dmi differ