mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-27 06:54:18 +01:00
Marshalling wands update (#21921)
# Summary This PR updates the marshalling wands and gives them intent based coloring. In addition, hold a second wand in your hand, the settings will be automatically synced. ## Changes - Update marshalling wand sprite (more the structure then the actual sprites). - Added color modes, updated text, added mechanical hints and two hand sync to marshall wands. - Added signal for mob intent changes (unused at the moment). - Adjusted Hangar Tech round start spawn points in the breakroom. - Added second marshalling wand to each Hangar Tech locker. ## Preview (Note this preview has been made prior further pixel adjustments, consider it a demo.) 
This commit is contained in:
@@ -3,18 +3,34 @@
|
||||
desc = "A marshalling wand, used to direct air or space faring vessels during takeoff and landing."
|
||||
icon_state = "marshallingwand"
|
||||
item_state = "marshallingwand"
|
||||
build_from_parts = TRUE
|
||||
worn_overlay = "bulb"
|
||||
worn_overlay_color = LIGHT_COLOR_WHITE
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
light_system = MOVABLE_LIGHT
|
||||
light_color = LIGHT_COLOR_RED
|
||||
light_range = 2
|
||||
action_button_name = "Toggle Marshalling Wands"
|
||||
|
||||
/obj/item/flashlight/marshallingwand/mechanics_hints(mob/user, distance, is_adjacent)
|
||||
. += ..()
|
||||
. += "ALT-click the marshalling wand to turn it on and off. Everytime you turn it on it will be blue, signaling and idle intent."
|
||||
. += "Using the wand will change its color based of your intent. Each intent has a different output."
|
||||
. += "Holding two marshalling wands in your hands will mirror the state of one to the other, so that they are always in sync."
|
||||
|
||||
// Override brights. The marshalling wands are meant to be always bright, this will toggle the on and off instead.
|
||||
/obj/item/flashlight/marshallingwand/AltClick(mob/user)
|
||||
if(!use_check_and_message(user))
|
||||
if(!isturf(user.loc))
|
||||
to_chat(user, SPAN_WARNING("You cannot turn the light on while in this [user.loc].")) //To prevent some lighting anomalities.)
|
||||
to_chat(user, SPAN_WARNING("You cannot turn the light on while in this [user.loc].")) // To prevent some lighting anomalities.)
|
||||
return FALSE
|
||||
toggle()
|
||||
if(on)
|
||||
set_light_color(LIGHT_COLOR_BLUE) // Default to blue (stand-by) when turned on
|
||||
worn_overlay_color = light_color
|
||||
else
|
||||
worn_overlay_color = LIGHT_COLOR_WHITE
|
||||
update_icon()
|
||||
mirror_held_wands(src)
|
||||
user.update_action_buttons()
|
||||
return TRUE
|
||||
|
||||
@@ -22,16 +38,73 @@
|
||||
AltClick(usr)
|
||||
|
||||
/obj/item/flashlight/marshallingwand/attack_self(mob/user)
|
||||
// Are we holding one or two wands?
|
||||
var/wand_invariant = ""
|
||||
if(ismob(loc))
|
||||
var/mob/m = loc
|
||||
var/item = m.get_inactive_hand()
|
||||
if(item && istype(item, /obj/item/flashlight/marshallingwand))
|
||||
wand_invariant = "wands"
|
||||
else
|
||||
wand_invariant = "wand"
|
||||
|
||||
if(!on)
|
||||
to_chat(user, SPAN_WARNING("The wands need to be on before you can direct craft with them!"))
|
||||
to_chat(user, SPAN_WARNING("The [wand_invariant] need to be turned on before you can direct crafts with them!"))
|
||||
return
|
||||
|
||||
switch(user.a_intent)
|
||||
if(I_HELP)
|
||||
user.visible_message(SPAN_NOTICE("[user] points the marshalling wand forward, directing a pilot to take off."), SPAN_NOTICE("You point the marshalling wand forward, directing a pilot to take off."))
|
||||
set_light_color(LIGHT_COLOR_GREEN) // Green for go!
|
||||
if(I_DISARM)
|
||||
user.visible_message(SPAN_NOTICE("[user] waves the marshalling wand toward themself, directing a pilot to approach."), SPAN_NOTICE("You wave the marshalling wand toward yourself, directing a pilot to approach."))
|
||||
set_light_color(LIGHT_COLOR_BLUE) // Blue for stand-by - Idle while nothing is happening yet.
|
||||
if(I_GRAB)
|
||||
user.visible_message(SPAN_NOTICE("[user] holds the marshalling wand out, directing a pilot to cease movement."), SPAN_NOTICE("You hold the marshalling wand out, directing a pilot to cease movement."))
|
||||
set_light_color(LIGHT_COLOR_YELLOW) // Yellow for hold - Last checks are in progress. Prepare for takeoff!
|
||||
if(I_HURT)
|
||||
user.visible_message(SPAN_WARNING("[user] frantically waves the marshalling wand!"), SPAN_WARNING("You wave the marshalling wand frantically!"))
|
||||
set_light_color(LIGHT_COLOR_RED) // Stop! Craft is being serviced or shutting down.
|
||||
worn_overlay_color = light_color
|
||||
|
||||
switch(light_color)
|
||||
if(LIGHT_COLOR_GREEN)
|
||||
user.visible_message(SPAN_NOTICE("[user] quickly waves the marshalling [wand_invariant] forward, giving the craft the lift-off signal!"), SPAN_NOTICE("You wave the marshalling [wand_invariant] forward quickly, directing the craft to take off."))
|
||||
if(LIGHT_COLOR_BLUE)
|
||||
user.visible_message(SPAN_NOTICE("[user] holds the marshalling [wand_invariant] close to themselves, deck is idle, don't do any unexpected things!"), SPAN_NOTICE("You hold the marshalling [wand_invariant] close to yourself, signaling an idle stance..."))
|
||||
if(LIGHT_COLOR_YELLOW)
|
||||
user.visible_message(SPAN_WARNING("[user] holds the marshalling [wand_invariant] out to the sides, indicating that the craft is being checked before lift off, prepare for lift off!"), SPAN_WARNING("You hold the marshalling [wand_invariant] out to your sides, indicating that the craft is being prepared for lift off."))
|
||||
if(LIGHT_COLOR_RED)
|
||||
user.visible_message(SPAN_WARNING("[user] steadily holds the marshalling [wand_invariant] above their head in a cross! Hold all movement!"), SPAN_WARNING("You hold the marshalling [wand_invariant] in a cross above your head, signaling full stop."))
|
||||
|
||||
update_icon()
|
||||
mirror_held_wands(src)
|
||||
|
||||
/obj/item/flashlight/marshallingwand/update_icon()
|
||||
overlays.Cut()
|
||||
if(on)
|
||||
var/image/I = overlay_image(icon, "marshallingwand-overlay", light_color)
|
||||
I.blend_mode = BLEND_OVERLAY
|
||||
AddOverlays(I)
|
||||
icon_state = "[initial(icon_state)]-on"
|
||||
item_state = "[initial(icon_state)]-on"
|
||||
set_light_range_power_color(light_range, flashlight_power, light_color)
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
item_state = initial(item_state)
|
||||
set_light_on(on)
|
||||
update_held_icon()
|
||||
|
||||
/obj/item/flashlight/marshallingwand/proc/mirror_held_wands(var/obj/item/flashlight/marshallingwand/source_wand)
|
||||
// If we are holding a wand in the other hand, make sure to mirror the state of this one to it, so that they are always in sync.
|
||||
if(ismob(loc))
|
||||
var/mob/m = loc
|
||||
var/item_act = m.get_active_hand()
|
||||
var/item_inact = m.get_inactive_hand()
|
||||
if(!item_act || !item_inact || !istype(item_act, /obj/item/flashlight/marshallingwand) || !istype(item_inact, /obj/item/flashlight/marshallingwand))
|
||||
return // Only one wand or different item, abort.
|
||||
var/obj/item/flashlight/marshallingwand/target_wand
|
||||
if(item_act == source_wand) // Check which one needs the update.
|
||||
target_wand = item_inact
|
||||
else
|
||||
target_wand = item_act
|
||||
target_wand.on = source_wand.on
|
||||
target_wand.set_light_color(source_wand.light_color)
|
||||
target_wand.worn_overlay_color = source_wand.worn_overlay_color
|
||||
target_wand.update_icon()
|
||||
|
||||
Reference in New Issue
Block a user