mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-26 14:47:50 +01:00
[MIRROR] Fixes some click bugs (#12673)
Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
co-authored by
Cameron Lennox
parent
a766b686d4
commit
897de881b3
@@ -558,10 +558,10 @@ About the new airlock wires panel:
|
||||
/obj/machinery/door/airlock/click_ctrl(mob/user) //Hold door open
|
||||
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
|
||||
if(user.is_incorporeal())
|
||||
return
|
||||
return CLICK_ACTION_BLOCKING
|
||||
|
||||
if(!Adjacent(user))
|
||||
return
|
||||
return CLICK_ACTION_BLOCKING
|
||||
|
||||
if(user.a_intent == I_HURT)
|
||||
visible_message(span_warning("[user] hammers on \the [src]!"), span_warning("Someone hammers loudly on \the [src]!"))
|
||||
@@ -569,13 +569,13 @@ About the new airlock wires panel:
|
||||
if(icon_state == "door_closed" && arePowerSystemsOn())
|
||||
flick("door_deny", src)
|
||||
playsound(src, knock_hammer_sound, 50, 0, 3)
|
||||
return
|
||||
return CLICK_ACTION_SUCCESS
|
||||
|
||||
if(user.a_intent == I_GRAB) //Hold door open
|
||||
hold_open = user
|
||||
visible_message(span_info("[user] begins holding \the [src] open."), span_info("Someone has started holding \the [src] open."))
|
||||
attack_hand(user)
|
||||
return
|
||||
return CLICK_ACTION_SUCCESS
|
||||
|
||||
if(arePowerSystemsOn())
|
||||
if(isElectrified())
|
||||
@@ -590,11 +590,12 @@ About the new airlock wires panel:
|
||||
if(icon_state == "door_closed")
|
||||
flick("door_deny", src)
|
||||
playsound(src, knock_sound, 50, 0, 3)
|
||||
return
|
||||
return CLICK_ACTION_SUCCESS
|
||||
|
||||
visible_message(span_info("[user] knocks on \the [src]."), span_info("Someone knocks on \the [src]."))
|
||||
add_fingerprint(user)
|
||||
playsound(src, knock_unpowered_sound, 50, 0, 3)
|
||||
return CLICK_ACTION_SUCCESS
|
||||
|
||||
/obj/machinery/door/airlock/tgui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
|
||||
@@ -32,18 +32,21 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list(
|
||||
* on the item in the slot if the users active hand is empty
|
||||
*/
|
||||
/mob/proc/attack_ui(slot, params)
|
||||
var/obj/item/W = get_active_held_item()
|
||||
var/obj/item/active_item = get_active_held_item()
|
||||
var/obj/item/equipped_item = get_item_by_slot(slot)
|
||||
var/list/modifiers = params2list(params)
|
||||
|
||||
if(istype(W))
|
||||
if(equip_to_slot_if_possible(W, slot,0,0,0))
|
||||
if(istype(equipped_item))
|
||||
if(active_item)
|
||||
equipped_item.attackby(active_item, src) //Wearing an item and item in hand.
|
||||
return TRUE
|
||||
|
||||
if(!W)
|
||||
// Activate the item
|
||||
var/obj/item/I = get_item_by_slot(slot)
|
||||
if(istype(I))
|
||||
var/list/modifiers = params2list(params)
|
||||
I.attack_hand(src, modifiers)
|
||||
equipped_item.attack_hand(src, modifiers) //Wearing an item w/ no item in hand.
|
||||
return TRUE
|
||||
|
||||
if(istype(active_item))
|
||||
if(equip_to_slot_if_possible(active_item, slot,0,0,0)) //NOT wearing an item, but DO have item in hand.
|
||||
return TRUE
|
||||
|
||||
return FALSE
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
/obj/vehicle/bike/click_ctrl(mob/user)
|
||||
if(Adjacent(user) && anchored)
|
||||
toggle()
|
||||
return toggle_proc(user)
|
||||
else
|
||||
return ..()
|
||||
|
||||
@@ -65,18 +65,23 @@
|
||||
set name = "Toggle Engine"
|
||||
set category = "Object.Vehicle" //ChompEDIT - TGPanel
|
||||
set src in view(0)
|
||||
toggle_proc(usr)
|
||||
|
||||
if(!isliving(usr) || HAS_TRAIT(usr, TRAIT_AMBIENT_PEST_MOB))
|
||||
return
|
||||
/obj/vehicle/bike/proc/toggle_proc(mob/user)
|
||||
if(!isliving(user) || HAS_TRAIT(user, TRAIT_AMBIENT_PEST_MOB))
|
||||
return CLICK_ACTION_BLOCKING
|
||||
|
||||
if(usr.incapacitated()) return
|
||||
if(user.incapacitated())
|
||||
return CLICK_ACTION_BLOCKING
|
||||
|
||||
if(!on && cell && cell.charge > charge_use)
|
||||
turn_on()
|
||||
src.visible_message("\The [src] rumbles to life.", "You hear something rumble deeply.")
|
||||
visible_message("\The [src] rumbles to life.", "You hear something rumble deeply.")
|
||||
return CLICK_ACTION_SUCCESS
|
||||
else
|
||||
turn_off()
|
||||
src.visible_message("\The [src] putters before turning off.", "You hear something putter slowly.")
|
||||
visible_message("\The [src] putters before turning off.", "You hear something putter slowly.")
|
||||
return CLICK_ACTION_SUCCESS
|
||||
|
||||
/obj/vehicle/bike/click_alt(var/mob/user)
|
||||
if(Adjacent(user))
|
||||
|
||||
Reference in New Issue
Block a user