refactoring altclick interaction to allow parent calls without forcing the turf contents stat menu open.

This commit is contained in:
Ghommie
2019-11-29 00:40:16 +01:00
parent 8cec8fa506
commit 3b8aebbbc2
99 changed files with 269 additions and 162 deletions

View File

@@ -114,7 +114,8 @@
/mob/living/silicon/ai/CtrlClickOn(var/atom/A)
A.AICtrlClick(src)
/mob/living/silicon/ai/AltClickOn(var/atom/A)
A.AIAltClick(src)
if(!A.AIAltClick(src))
altclick_listed_turf(A)
/*
The following criminally helpful code is just the previous code cleaned up;
@@ -125,9 +126,10 @@
/* Atom Procs */
/atom/proc/AICtrlClick()
return
/atom/proc/AIAltClick(mob/living/silicon/ai/user)
AltClick(user)
return
return AltClick(user)
/atom/proc/AIShiftClick()
return
/atom/proc/AICtrlShiftClick()
@@ -151,6 +153,7 @@
shock_perm(usr)
else
shock_restore(usr)
return TRUE
/obj/machinery/door/airlock/AIShiftClick() // Opens and closes doors!
if(obj_flags & EMAGGED)
@@ -185,10 +188,12 @@
return
toggle_on()
add_fingerprint(usr)
return TRUE
/* Holopads */
/obj/machinery/holopad/AIAltClick(mob/living/silicon/ai/user)
hangup_all_calls()
return TRUE
//
// Override TurfAdjacent for AltClicking

View File

@@ -353,8 +353,17 @@
Unused except for AI
*/
/mob/proc/AltClickOn(atom/A)
A.AltClick(src)
return
if(!A.AltClick(src))
altclick_listed_turf(A)
/mob/proc/altclick_listed_turf(atom/A)
var/turf/T = get_turf(A)
if(T == A.loc || T == A)
if(T == listed_turf)
listed_turf = null
else if(TurfAdjacent(T))
listed_turf = T
client.statpanel = T.name
/mob/living/carbon/AltClickOn(atom/A)
if(!stat && mind && iscarbon(A) && A != src)
@@ -366,18 +375,7 @@
..()
/atom/proc/AltClick(mob/user)
SEND_SIGNAL(src, COMSIG_CLICK_ALT, user)
var/turf/T = get_turf(src)
if(T && user.TurfAdjacent(T))
user.listed_turf = T
user.client.statpanel = T.name
// Use this instead of /mob/proc/AltClickOn(atom/A) where you only want turf content listing without additional atom alt-click interaction
/atom/proc/AltClickNoInteract(mob/user, atom/A)
var/turf/T = get_turf(A)
if(T && user.TurfAdjacent(T))
user.listed_turf = T
user.client.statpanel = T.name
. = SEND_SIGNAL(src, COMSIG_CLICK_ALT, user)
/mob/proc/TurfAdjacent(turf/T)
return T.Adjacent(src)

View File

@@ -110,7 +110,8 @@
/mob/living/silicon/robot/CtrlClickOn(atom/A)
A.BorgCtrlClick(src)
/mob/living/silicon/robot/AltClickOn(atom/A)
A.BorgAltClick(src)
if(!A.BorgAltClick(src))
altclick_listed_turf(A)
/atom/proc/BorgCtrlShiftClick(mob/living/silicon/robot/user) //forward to human click if not overridden
CtrlShiftClick(user)
@@ -154,20 +155,17 @@
..()
/atom/proc/BorgAltClick(mob/living/silicon/robot/user)
AltClick(user)
return
return AltClick(user)
/obj/machinery/door/airlock/BorgAltClick(mob/living/silicon/robot/user) // Eletrifies doors. Forwards to AI code.
if(get_dist(src,user) <= user.interaction_range)
AIAltClick()
else
..()
return AIAltClick()
return ..()
/obj/machinery/turretid/BorgAltClick(mob/living/silicon/robot/user) //turret lethal on/off. Forwards to AI code.
if(get_dist(src,user) <= user.interaction_range)
AIAltClick()
else
..()
return AIAltClick()
return ..()
/*
As with AI, these are not used in click code,

View File

@@ -125,6 +125,7 @@
moved = FALSE
user.update_action_buttons(TRUE)
to_chat(user, "<span class='notice'>Action button positions have been reset.</span>")
return TRUE
/obj/screen/movable/action_button/hide_toggle/proc/InitialiseIcon(datum/hud/owner_hud)

View File

@@ -31,7 +31,7 @@
ShiftClickOn(A)
return
if(modifiers["alt"])
AltClickNoInteract(src, A)
altclick_listed_turf(A)
return
if(modifiers["ctrl"])
CtrlClickOn(A)

View File

@@ -106,6 +106,7 @@
if(!can_be_rotated.Invoke(user, rotation) || !can_user_rotate.Invoke(user, rotation))
return
BaseRot(user, rotation)
return TRUE
/datum/component/simple_rotation/proc/WrenchRot(datum/source, obj/item/I, mob/living/user)
if(!can_be_rotated.Invoke(user,default_rotation_direction) || !can_user_rotate.Invoke(user,default_rotation_direction))

View File

@@ -57,7 +57,7 @@
var/screen_start_x = 4 //These two are where the storage starts being rendered, screen_loc wise.
var/screen_start_y = 2
//End
var/limited_random_access = FALSE //Quick if statement in accessible_items to determine if we care at all about what people can access at once.
var/limited_random_access_stack_position = 0 //If >0, can only access top <x> items
var/limited_random_access_stack_bottom_up = FALSE //If TRUE, above becomes bottom <x> items
@@ -762,7 +762,7 @@
if(!isliving(user) || !user.CanReach(parent))
return
if(check_locked(source, user, TRUE))
return
return TRUE
var/atom/A = parent
if(!quickdraw)
@@ -770,19 +770,20 @@
user_show_to_mob(user)
if(rustle_sound)
playsound(A, "rustle", 50, 1, -5)
return
return TRUE
if(!user.incapacitated())
if(user.can_hold_items() && !user.incapacitated())
var/obj/item/I = locate() in real_location()
if(!I)
return
A.add_fingerprint(user)
remove_from_storage(I, get_turf(user))
if(!user.put_in_hands(I))
to_chat(user, "<span class='notice'>You fumble for [I] and it falls on the floor.</span>")
return
user.visible_message("<span class='warning'>[user] fumbles with the [parent], letting [I] fall on the floor.</span>", \
"<span class='notice'>You fumble with [parent], letting [I] fall on the floor.</span>")
return TRUE
user.visible_message("<span class='warning'>[user] draws [I] from [parent]!</span>", "<span class='notice'>You draw [I] from [parent].</span>")
return
return TRUE
/datum/component/storage/proc/action_trigger(datum/signal_source, datum/action/source)
gather_mode_switch(source.owner)

View File

@@ -182,12 +182,14 @@
open_machine()
/obj/machinery/sleeper/AltClick(mob/user)
. = ..()
if(!user.canUseTopic(src, !issilicon(user)))
return
if(state_open)
close_machine()
else
open_machine()
return TRUE
/obj/machinery/sleeper/examine(mob/user)
. = ..()

View File

@@ -132,8 +132,8 @@
..()
if(!user.canUseTopic(src))
return
else
eject_part(user)
eject_part(user)
return TRUE
/obj/machinery/aug_manipulator/power_change()
..()

View File

@@ -133,12 +133,13 @@
..()
/obj/structure/frame/computer/AltClick(mob/user)
..()
. = ..()
if(!isliving(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
if(anchored)
to_chat(usr, "<span class='warning'>You must unwrench [src] before rotating it!</span>")
return
return TRUE
setDir(turn(dir, -90))
return TRUE

View File

@@ -170,19 +170,19 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0)
return TRUE
/obj/machinery/computer/card/AltClick(mob/user)
..()
. = ..()
if(!user.canUseTopic(src, !issilicon(user)) || !is_operational())
return
if(inserted_modify_id)
if(id_eject(user, inserted_modify_id))
inserted_modify_id = null
updateUsrDialog()
return
return TRUE
if(inserted_scan_id)
if(id_eject(user, inserted_scan_id))
inserted_scan_id = null
updateUsrDialog()
return
return TRUE
/obj/machinery/computer/card/ui_interact(mob/user)
. = ..()

View File

@@ -5,7 +5,7 @@
if(contained_id)
contained_id.forceMove(get_turf(src))
return ..()
/obj/machinery/computer/prisoner/examine(mob/user)
. = ..()
@@ -15,8 +15,9 @@
/obj/machinery/computer/prisoner/AltClick(mob/user)
..()
id_eject(user)
return ..()
return TRUE
/obj/machinery/computer/prisoner/proc/id_insert(mob/user, obj/item/card/id/prisoner/P)
if(istype(P))

View File

@@ -115,8 +115,10 @@
return TRUE
/obj/machinery/defibrillator_mount/AltClick(mob/living/carbon/user)
. = ..()
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE))
return
. = TRUE
if(!defib)
to_chat(user, "<span class='warning'>It'd be hard to remove a defib unit from a mount that has none.</span>")
return

View File

@@ -153,9 +153,11 @@
. += "<span class='notice'>Alt-click to toggle modes.</span>"
/obj/item/grenade/barrier/AltClick(mob/living/carbon/user)
. = ..()
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE))
return
toggle_mode(user)
return TRUE
/obj/item/grenade/barrier/proc/toggle_mode(mob/user)
switch(mode)

View File

@@ -97,8 +97,10 @@
do_the_dishes(TRUE)
/obj/machinery/dish_drive/AltClick(mob/living/user)
. = ..()
if(user.canUseTopic(src, !issilicon(user)))
do_the_dishes(TRUE)
return TRUE
/obj/machinery/dish_drive/proc/do_the_dishes(manual)
if(!contents.len)

View File

@@ -164,9 +164,11 @@
toggle_open(user)
/obj/machinery/dna_scannernew/AltClick(mob/user)
. = ..()
if(!user.canUseTopic(src, !issilicon(user)))
return
interact(user)
return TRUE
/obj/machinery/dna_scannernew/MouseDrop_T(mob/target, mob/user)
if(user.stat || user.lying || !Adjacent(user) || !user.Adjacent(target) || !iscarbon(target) || !user.IsAdvancedToolUser())

View File

@@ -51,10 +51,12 @@
open_machine()
/obj/machinery/harvester/AltClick(mob/user)
. = ..()
if(harvesting || !user || !isliving(user) || state_open)
return
if(can_harvest())
start_harvest()
return TRUE
/obj/machinery/harvester/proc/can_harvest()
if(!powered(EQUIP) || state_open || !occupant || !iscarbon(occupant))

View File

@@ -16,6 +16,7 @@
. += "<span class='notice'>Alt-click it to start a wash cycle.</span>"
/obj/machinery/washing_machine/AltClick(mob/user)
. = ..()
if(!user.canUseTopic(src))
return
@@ -24,11 +25,11 @@
if(state_open)
to_chat(user, "<span class='notice'>Close the door first</span>")
return
return TRUE
if(bloody_mess)
to_chat(user, "<span class='warning'>[src] must be cleaned up first.</span>")
return
return TRUE
if(has_corgi)
bloody_mess = 1
@@ -37,6 +38,7 @@
update_icon()
addtimer(CALLBACK(src, .proc/wash_cycle), 200)
START_PROCESSING(SSfastprocess, src)
return TRUE
/obj/machinery/washing_machine/process()
if (!busy)

View File

@@ -138,8 +138,10 @@
chassis.toggle_strafe()
/obj/mecha/AltClick(mob/living/user)
. = ..()
if((user == occupant) && user.canUseTopic(src))
toggle_strafe()
return TRUE
/obj/mecha/proc/toggle_strafe()
strafe = !strafe

View File

@@ -517,16 +517,17 @@ update_label("John Doe", "Clowny")
return
if(user.incapacitated() || !istype(user))
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return
return TRUE
if(alert("Are you sure you want to recolor your id?", "Confirm Repaint", "Yes", "No") == "Yes")
var/energy_color_input = input(usr,"","Choose Energy Color",id_color) as color|null
if(!in_range(src, user) || !energy_color_input)
return
return TRUE
if(user.incapacitated() || !istype(user))
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return
return TRUE
id_color = sanitize_hexcolor(energy_color_input, desired_format=6, include_crunch=1)
update_icon()
return TRUE
/obj/item/card/id/knight/Initialize()
. = ..()

View File

@@ -945,10 +945,12 @@
to_chat(user, "<span class='notice'>You [suction ? "enable" : "disable"] the board's suction function.</span>")
/obj/item/circuitboard/machine/dish_drive/AltClick(mob/living/user)
. = ..()
if(!user.Adjacent(src))
return
transmit = !transmit
to_chat(user, "<span class='notice'>You [transmit ? "enable" : "disable"] the board's automatic disposal transmission.</span>")
return TRUE
/obj/item/circuitboard/machine/stacking_unit_console
name = "Stacking Machine Console (Machine Board)"

View File

@@ -150,11 +150,13 @@
ui.open()
/obj/item/toy/crayon/spraycan/AltClick(mob/user)
. = ..()
if(user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
if(has_cap)
is_capped = !is_capped
to_chat(user, "<span class='notice'>The cap on [src] is now [is_capped ? "on" : "off"].</span>")
update_icon()
return TRUE
/obj/item/toy/crayon/proc/staticDrawables()

View File

@@ -828,14 +828,14 @@ GLOBAL_LIST_EMPTY(PDAs)
send_message(U,list(P))
/obj/item/pda/AltClick()
..()
. = ..()
if(id)
remove_id()
playsound(src, 'sound/machines/terminal_eject_disc.ogg', 50, 1)
else
remove_pen()
playsound(src, 'sound/machines/button4.ogg', 50, 1)
return TRUE
/obj/item/pda/CtrlClick()
..()

View File

@@ -32,6 +32,7 @@
. += "<span class='notice'>Can be used again to interrupt the effect early. The recharge time is the same as the time spent in desync.</span>"
/obj/item/desynchronizer/AltClick(mob/living/user)
. = ..()
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
var/new_duration = input(user, "Set the duration (5-300):", "Desynchronizer", duration / 10) as null|num
@@ -40,6 +41,7 @@
new_duration = CLAMP(new_duration, 50, max_duration)
duration = new_duration
to_chat(user, "<span class='notice'>You set the duration to [DisplayTimeText(duration)].</span>")
return TRUE
/obj/item/desynchronizer/proc/desync(mob/living/user)
if(sync_holder)

View File

@@ -182,14 +182,16 @@
return ..()
/obj/item/geiger_counter/AltClick(mob/living/user)
. = ..()
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE))
return ..()
return
if(!scanning)
to_chat(usr, "<span class='warning'>[src] must be on to reset its radiation level!</span>")
return 0
return TRUE
radiation_count = 0
to_chat(usr, "<span class='notice'>You flush [src]'s radiation counts, resetting it to normal.</span>")
update_icon()
return TRUE
/obj/item/geiger_counter/emag_act(mob/user)
. = ..()

View File

@@ -45,9 +45,11 @@ GLOBAL_LIST_EMPTY(GPS_list)
add_overlay("working")
/obj/item/gps/AltClick(mob/user)
. = ..()
if(!user.canUseTopic(src, BE_CLOSE))
return
toggletracking(user)
return TRUE
/obj/item/gps/proc/toggletracking(mob/user)
if(!user.canUseTopic(src, BE_CLOSE))

View File

@@ -18,12 +18,14 @@
. += "<span class='notice'>Insert [src] into an active quantum pad to link it.</span>"
/obj/item/quantum_keycard/AltClick(mob/living/user)
. = ..()
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
to_chat(user, "<span class='notice'>You start pressing [src]'s unlink button...</span>")
if(do_after(user, 40, target = src))
to_chat(user, "<span class='notice'>The keycard beeps twice and disconnects the quantum link.</span>")
qpad = null
return TRUE
/obj/item/quantum_keycard/update_icon()
if(qpad)

View File

@@ -326,8 +326,10 @@ GLOBAL_LIST_INIT(channel_tokens, list(
secure_radio_connections[ch_name] = add_radio(src, GLOB.radiochannels[ch_name])
/obj/item/radio/headset/AltClick(mob/living/user)
. = ..()
if(!istype(user) || !Adjacent(user) || user.incapacitated())
return
if (command)
use_command = !use_command
to_chat(user, "<span class='notice'>You toggle high-volume mode [use_command ? "on" : "off"].</span>")
return TRUE

View File

@@ -587,10 +587,10 @@ SLIME SCANNER
to_chat(user, "<span class='info'>Temperature: [round(environment.temperature-T0C, 0.01)] &deg;C ([round(environment.temperature, 0.01)] K)</span>")
/obj/item/analyzer/AltClick(mob/user) //Barometer output for measuring when the next storm happens
..()
. = ..()
if(user.canUseTopic(src))
. = TRUE
if(cooldown)
to_chat(user, "<span class='warning'>[src]'s barometer function is preparing itself.</span>")
return

View File

@@ -138,11 +138,13 @@
toggle_igniter(user)
/obj/item/flamethrower/AltClick(mob/user)
. = ..()
if(ptank && isliving(user) && user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
user.put_in_hands(ptank)
ptank = null
to_chat(user, "<span class='notice'>You remove the plasma tank from [src]!</span>")
update_icon()
return TRUE
/obj/item/flamethrower/examine(mob/user)
. = ..()

View File

@@ -320,11 +320,12 @@
M.update_inv_hands()
/obj/item/melee/transforming/energy/sword/cx/AltClick(mob/living/user)
. = ..()
if(!in_range(src, user)) //Basic checks to prevent abuse
return
if(user.incapacitated() || !istype(user))
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return
return TRUE
if(alert("Are you sure you want to recolor your blade?", "Confirm Repaint", "Yes", "No") == "Yes")
var/energy_color_input = input(usr,"","Choose Energy Color",light_color) as color|null
@@ -332,6 +333,7 @@
light_color = sanitize_hexcolor(energy_color_input, desired_format=6, include_crunch=1)
update_icon()
update_light()
return TRUE
/obj/item/melee/transforming/energy/sword/cx/examine(mob/user)
. = ..()

View File

@@ -70,6 +70,7 @@
update_icon()
/obj/item/pet_carrier/AltClick(mob/living/user)
. = ..()
if(open || !user.canUseTopic(src, BE_CLOSE))
return
locked = !locked
@@ -79,6 +80,7 @@
else
playsound(user, 'sound/machines/boltsup.ogg', 30, TRUE)
update_icon()
return TRUE
/obj/item/pet_carrier/attack(mob/living/target, mob/living/user)
if(user.a_intent == INTENT_HARM)

View File

@@ -350,6 +350,7 @@
. = ..()
/obj/item/stack/AltClick(mob/living/user)
. = ..()
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
if(is_cyborg)
@@ -363,10 +364,11 @@
max = get_amount()
stackmaterial = min(max, stackmaterial)
if(stackmaterial == null || stackmaterial <= 0 || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
return TRUE
else
change_stack(user, stackmaterial)
to_chat(user, "<span class='notice'>You take [stackmaterial] sheets out of the stack</span>")
return TRUE
/obj/item/stack/proc/change_stack(mob/user, amount)
if(!use(amount, TRUE, FALSE))

View File

@@ -755,23 +755,13 @@
STR.rustle_sound = FALSE
STR.max_w_class = WEIGHT_CLASS_BULKY
STR.can_hold = typecacheof(fitting_swords)
STR.quickdraw = TRUE
/obj/item/storage/belt/sabre/examine(mob/user)
. = ..()
if(length(contents))
. += "<span class='notice'>Alt-click it to quickly draw the blade.</span>"
/obj/item/storage/belt/sabre/AltClick(mob/user)
if(!iscarbon(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
if(length(contents))
var/obj/item/I = contents[1]
user.visible_message("[user] takes [I] out of [src].", "<span class='notice'>You take [I] out of [src].</span>")
user.put_in_hands(I)
update_icon()
else
to_chat(user, "[src] is empty.")
/obj/item/storage/belt/sabre/update_icon()
. = ..()
if(isliving(loc))

View File

@@ -157,6 +157,7 @@
to_chat(user, "<span class='notice'>You take \a [W] out of the pack.</span>")
else
to_chat(user, "<span class='notice'>There are no [icon_type]s left in the pack.</span>")
return TRUE
/obj/item/storage/fancy/cigarettes/update_icon()
if(fancy_open || !contents.len)

View File

@@ -114,11 +114,12 @@
. += "<span class='notice'>Alt-click to [open ? "close":"open"] it.</span>"
/obj/item/storage/lockbox/medal/AltClick(mob/user)
. = ..()
if(user.canUseTopic(src, BE_CLOSE))
if(!SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED))
open = (open ? FALSE : TRUE)
update_icon()
..()
return TRUE
/obj/item/storage/lockbox/medal/PopulateContents()
new /obj/item/clothing/accessory/medal/gold/captain(src)

View File

@@ -338,11 +338,12 @@
M.update_inv_hands()
/obj/item/toy/sword/cx/AltClick(mob/living/user)
. = ..()
if(!in_range(src, user)) //Basic checks to prevent abuse
return
if(user.incapacitated() || !istype(user))
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return
return TRUE
if(alert("Are you sure you want to recolor your blade?", "Confirm Repaint", "Yes", "No") == "Yes")
var/energy_color_input = input(usr,"","Choose Energy Color",light_color) as color|null
@@ -350,6 +351,7 @@
light_color = sanitize_hexcolor(energy_color_input, desired_format=6, include_crunch=1)
update_icon()
update_light()
return TRUE
/obj/item/toy/sword/cx/worn_overlays(isinhands, icon_file)
. = ..()

View File

@@ -541,6 +541,7 @@
clean_blood()
/obj/item/twohanded/dualsaber/hypereutactic/AltClick(mob/living/user)
. = ..()
if(!user.canUseTopic(src, BE_CLOSE, FALSE) || hacked)
return
if(user.incapacitated() || !istype(user))
@@ -553,6 +554,7 @@
light_color = sanitize_hexcolor(energy_color_input, desired_format=6, include_crunch=1)
update_icon()
update_light()
return TRUE
/obj/item/twohanded/dualsaber/hypereutactic/worn_overlays(isinhands, icon_file)
. = ..()
@@ -659,6 +661,7 @@
qdel(src)
/obj/item/twohanded/spear/AltClick(mob/user)
. = ..()
if(user.canUseTopic(src, BE_CLOSE))
..()
if(!explosive)
@@ -667,6 +670,7 @@
var/input = stripped_input(user,"What do you want your war cry to be? You will shout it when you hit someone in melee.", ,"", 50)
if(input)
src.war_cry = input
return TRUE
/obj/item/twohanded/spear/CheckParts(list/parts_list)
var/obj/item/shard/tip = locate() in parts_list

View File

@@ -234,6 +234,7 @@
. = ..()
if(unique_reskin && (!current_skin || always_reskinnable) && user.canUseTopic(src, BE_CLOSE, NO_DEXTERY))
reskin_obj(user)
return TRUE
/obj/proc/reskin_obj(mob/M)
if(!LAZYLEN(unique_reskin))

View File

@@ -449,6 +449,9 @@
item_chair = null
var/turns = 0
/obj/structure/chair/brass/ComponentInitialize()
return //it spins with the power of ratvar, not components.
/obj/structure/chair/brass/Destroy()
STOP_PROCESSING(SSfastprocess, src)
. = ..()
@@ -464,6 +467,7 @@
return
/obj/structure/chair/brass/AltClick(mob/living/user)
. = ..()
turns = 0
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
@@ -475,6 +479,7 @@
user.visible_message("<span class='notice'>[user] stops [src]'s uncontrollable spinning.</span>", \
"<span class='notice'>You grab [src] and stop its wild spinning.</span>")
STOP_PROCESSING(SSfastprocess, src)
return TRUE
/obj/structure/chair/bronze
name = "brass chair"

View File

@@ -526,11 +526,12 @@
to_chat(user, "<span class='warning'>You fail to break out of [src]!</span>")
/obj/structure/closet/AltClick(mob/user)
..()
. = ..()
if(!user.canUseTopic(src, be_close=TRUE) || !isturf(loc))
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return
return TRUE
togglelock(user)
return TRUE
/obj/structure/closet/CtrlShiftClick(mob/living/user)
if(!HAS_TRAIT(user, TRAIT_SKITTISH))

View File

@@ -102,9 +102,11 @@
return attack_hand(user)
/obj/structure/extinguisher_cabinet/AltClick(mob/living/user)
. = ..()
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
toggle_cabinet(user)
return TRUE
/obj/structure/extinguisher_cabinet/proc/toggle_cabinet(mob/user)
if(opened && broken)

View File

@@ -167,11 +167,12 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an
. += "<span class='notice'>The speaker is [beeper ? "enabled" : "disabled"]. Alt-click to toggle it.</span>"
/obj/structure/bodycontainer/morgue/AltClick(mob/user)
..()
. = ..()
if(!user.canUseTopic(src, !issilicon(user)))
return
beeper = !beeper
to_chat(user, "<span class='notice'>You turn the speaker function [beeper ? "on" : "off"].</span>")
return TRUE
/obj/structure/bodycontainer/morgue/update_icon()
if (!connected || connected.loc != src) // Open or tray is gone.

View File

@@ -167,10 +167,12 @@
return TRUE
/obj/structure/reflector/AltClick(mob/user)
. = ..()
if(!user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
else if(finished)
rotate(user)
return TRUE
//TYPES OF REFLECTORS, SINGLE, DOUBLE, BOX

View File

@@ -52,9 +52,11 @@
edit_emitter(user)
/obj/effect/sound_emitter/AltClick(mob/user)
. = ..()
if(check_rights_for(user.client, R_SOUNDS))
activate(user)
to_chat(user, "<span class='notice'>Sound emitter activated.</span>")
return TRUE
/obj/effect/sound_emitter/proc/edit_emitter(mob/user)
var/dat = ""

View File

@@ -162,9 +162,11 @@
access_display(user)
/obj/item/clockwork/slab/AltClick(mob/living/user)
. = ..()
if(is_servant_of_ratvar(user) && linking && user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
linking = null
to_chat(user, "<span class='notice'>Object link canceled.</span>")
return TRUE
/obj/item/clockwork/slab/proc/access_display(mob/living/user)
if(!is_servant_of_ratvar(user))

View File

@@ -5,7 +5,7 @@
ShiftClickOn(A)
return
if(modifiers["alt"])
AltClickNoInteract(src, A)
altclick_listed_turf(A)
return
if(ishuman(A))

View File

@@ -823,11 +823,11 @@
return ..()
/obj/machinery/airalarm/AltClick(mob/user)
..()
. = ..()
if(!user.canUseTopic(src, !issilicon(user)) || !isturf(loc))
return
else
togglelock(user)
togglelock(user)
return TRUE
/obj/machinery/airalarm/proc/togglelock(mob/living/user)
if(stat & (NOPOWER|BROKEN))

View File

@@ -338,10 +338,9 @@ Pipelines + Other Objects -> Pipe network
/obj/machinery/atmospherics/AltClick(mob/living/L)
if(is_type_in_list(src, GLOB.ventcrawl_machinery))
L.handle_ventcrawl(src)
return
..()
if(is_type_in_typecache(src, GLOB.ventcrawl_machinery))
return L.handle_ventcrawl(src)
return ..()
/obj/machinery/atmospherics/proc/can_crawl_through()

View File

@@ -44,6 +44,7 @@ Thus, the two variables affect pump operation are set in New():
return ..()
/obj/machinery/atmospherics/components/binary/pump/AltClick(mob/user)
. = ..()
var/area/A = get_area(src)
var/turf/T = get_turf(src)
if(user.canUseTopic(src, BE_CLOSE, FALSE,))
@@ -51,6 +52,7 @@ Thus, the two variables affect pump operation are set in New():
to_chat(user,"<span class='notice'>You maximize the pressure on the [src].</span>")
investigate_log("Pump, [src.name], was maximized by [key_name(usr)] at [x], [y], [z], [A]", INVESTIGATE_ATMOS)
message_admins("Pump, [src.name], was maximized by [ADMIN_LOOKUPFLW(usr)] at [ADMIN_COORDJMP(T)], [A]")
return TRUE
/obj/machinery/atmospherics/components/binary/pump/layer1
piping_layer = PIPING_LAYER_MIN

View File

@@ -28,6 +28,7 @@
return ..()
/obj/machinery/atmospherics/components/trinary/filter/AltClick(mob/user)
. = ..()
var/area/A = get_area(src)
var/turf/T = get_turf(src)
if(user.canUseTopic(src, BE_CLOSE, FALSE,))
@@ -35,6 +36,7 @@
to_chat(user,"<span class='notice'>You maximize the pressure on the [src].</span>")
investigate_log("Filter, [src.name], was maximized by [key_name(usr)] at [x], [y], [z], [A]", INVESTIGATE_ATMOS)
message_admins("Filter, [src.name], was maximized by [ADMIN_LOOKUPFLW(usr)] at [ADMIN_COORDJMP(T)], [A]")
return TRUE
/obj/machinery/atmospherics/components/trinary/filter/layer1
piping_layer = PIPING_LAYER_MIN

View File

@@ -30,6 +30,7 @@
return ..()
/obj/machinery/atmospherics/components/trinary/mixer/AltClick(mob/user)
. = ..()
var/area/A = get_area(src)
var/turf/T = get_turf(src)
if(user.canUseTopic(src, BE_CLOSE, FALSE,))
@@ -37,6 +38,7 @@
to_chat(user,"<span class='notice'>You maximize the pressure on the [src].</span>")
investigate_log("Mixer, [src.name], was maximized by [key_name(usr)] at [x], [y], [z], [A]", INVESTIGATE_ATMOS)
message_admins("Mixer, [src.name], was maximized by [ADMIN_LOOKUPFLW(usr)] at [ADMIN_COORDJMP(T)], [A]")
return TRUE
//node 3 is the outlet, nodes 1 & 2 are intakes
/obj/machinery/atmospherics/components/trinary/mixer/layer1

View File

@@ -399,13 +399,14 @@
return ..()
/obj/machinery/atmospherics/components/unary/cryo_cell/AltClick(mob/user)
. = ..()
if(user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
if(state_open)
close_machine()
else
open_machine()
update_icon()
return ..()
return TRUE
/obj/machinery/atmospherics/components/unary/cryo_cell/update_remote_sight(mob/living/user)
return // we don't see the pipe network while inside cryo.

View File

@@ -210,13 +210,15 @@
min_temperature = max(T0C - (initial(min_temperature) + L * 15), TCMB) //73.15K with T1 stock parts
/obj/machinery/atmospherics/components/unary/thermomachine/freezer/AltClick(mob/living/user)
. = ..()
var/area/A = get_area(src)
var/turf/T = get_turf(src)
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE))
return
target_temperature = min_temperature
target_temperature = min_temperature
investigate_log("was set to [target_temperature] K by [key_name(usr)]", INVESTIGATE_ATMOS)
message_admins("[src.name] was minimized by [ADMIN_LOOKUPFLW(usr)] at [ADMIN_COORDJMP(T)], [A]")
return TRUE
/obj/machinery/atmospherics/components/unary/thermomachine/heater
name = "heater"
@@ -240,6 +242,7 @@
max_temperature = T20C + (initial(max_temperature) * L) //573.15K with T1 stock parts
/obj/machinery/atmospherics/components/unary/thermomachine/heater/AltClick(mob/living/user)
. = ..()
var/area/A = get_area(src)
var/turf/T = get_turf(src)
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE))
@@ -247,3 +250,4 @@
target_temperature = max_temperature
investigate_log("was set to [target_temperature] K by [key_name(usr)]", INVESTIGATE_ATMOS)
message_admins("[src.name] was maximized by [ADMIN_LOOKUPFLW(usr)] at [ADMIN_COORDJMP(T)], [A]")
return TRUE

View File

@@ -81,11 +81,13 @@
return air_contents
/obj/machinery/portable_atmospherics/AltClick(mob/living/user)
. = ..()
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, !ismonkey(user)))
return
if(holding)
to_chat(user, "<span class='notice'>You remove [holding] from [src].</span>")
replace_tank(user, TRUE)
return TRUE
/obj/machinery/portable_atmospherics/examine(mob/user)
. = ..()

View File

@@ -76,12 +76,14 @@
to_chat(user, "<span class='notice'>[src] linked to [C].</span>")
/obj/item/supplypod_beacon/AltClick(mob/user)
. = ..()
if (!user.canUseTopic(src, !issilicon(user)))
return
if (express_console)
unlink_console()
else
to_chat(user, "<span class='notice'>There is no linked console!</span>")
return TRUE
/obj/item/supplypod_beacon/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/pen)) //give a tag that is visible from the linked express console

View File

@@ -253,16 +253,14 @@ BLIND // can't see anything
H.update_suit_sensors()
/obj/item/clothing/under/AltClick(mob/user)
if(..())
return 1
. = ..()
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
if(attached_accessory)
remove_accessory(user)
else
if(attached_accessory)
remove_accessory(user)
else
rolldown()
rolldown()
return TRUE
/obj/item/clothing/under/verb/jumpsuit_adjust()
set name = "Adjust Jumpsuit Style"

View File

@@ -427,19 +427,17 @@
..()
/obj/item/clothing/glasses/AltClick(mob/user)
. = ..()
if(glass_colour_type && ishuman(user))
var/mob/living/carbon/human/H = user
if(H.client)
if(H.client.prefs)
if(src == H.glasses)
H.client.prefs.uses_glasses_colour = !H.client.prefs.uses_glasses_colour
if(H.client.prefs.uses_glasses_colour)
to_chat(H, "You will now see glasses colors.")
else
to_chat(H, "You will no longer see glasses colors.")
H.update_glasses_color(src, 1)
else
return ..()
if(H.client?.prefs && src == H.glasses)
H.client.prefs.uses_glasses_colour = !H.client.prefs.uses_glasses_colour
if(H.client.prefs.uses_glasses_colour)
to_chat(H, "You will now see glasses colors.")
else
to_chat(H, "You will no longer see glasses colors.")
H.update_glasses_color(src, 1)
return TRUE
/obj/item/clothing/glasses/proc/change_glass_color(mob/living/carbon/human/H, datum/client_colour/glass_colour/new_color_type)
var/old_colour_type = glass_colour_type

View File

@@ -116,8 +116,10 @@
toggle_helmet_light(user)
/obj/item/clothing/head/hardhat/weldhat/AltClick(mob/user)
. = ..()
if(user.canUseTopic(src, BE_CLOSE))
toggle_welding_screen(user)
return TRUE
/obj/item/clothing/head/hardhat/weldhat/proc/toggle_welding_screen(mob/living/user)
if(weldingvisortoggle(user))

View File

@@ -104,16 +104,16 @@
. += "<span class='notice'>Alt-click to take a candy corn.</span>"
/obj/item/clothing/head/fedora/det_hat/AltClick(mob/user)
if(user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
..()
if(loc == user)
if(candy_cooldown < world.time)
var/obj/item/reagent_containers/food/snacks/candy_corn/CC = new /obj/item/reagent_containers/food/snacks/candy_corn(src)
user.put_in_hands(CC)
to_chat(user, "You slip a candy corn from your hat.")
candy_cooldown = world.time+1200
else
to_chat(user, "You just took a candy corn! You should wait a couple minutes, lest you burn through your stash.")
. = ..()
if(loc == user && user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
if(candy_cooldown < world.time)
var/obj/item/reagent_containers/food/snacks/candy_corn/CC = new /obj/item/reagent_containers/food/snacks/candy_corn(src)
user.put_in_hands(CC)
to_chat(user, "You slip a candy corn from your hat.")
candy_cooldown = world.time+1200
else
to_chat(user, "You just took a candy corn! You should wait a couple minutes, lest you burn through your stash.")
return TRUE
//Mime

View File

@@ -22,11 +22,11 @@
/obj/item/clothing/head/soft/AltClick(mob/user)
..()
. = ..()
if(!user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
else
flip(user)
flip(user)
return TRUE
/obj/item/clothing/head/soft/proc/flip(mob/user)

View File

@@ -23,11 +23,11 @@
adjustmask(user)
/obj/item/clothing/mask/breath/AltClick(mob/user)
..()
. = ..()
if(!user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
else
adjustmask(user)
adjustmask(user)
return TRUE
/obj/item/clothing/mask/breath/examine(mob/user)
. = ..()

View File

@@ -964,13 +964,12 @@
. += energy_overlay
/obj/item/clothing/suit/space/hardsuit/lavaknight/AltClick(mob/living/user)
if(user.incapacitated() || !istype(user))
. = ..()
if(!in_range(src, user) || !istype(user))
return
if(user.incapacitated())
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return
if(!in_range(src, user))
return
if(user.incapacitated() || !istype(user) || !in_range(src, user))
return
return TRUE
if(alert("Are you sure you want to recolor your armor stripes?", "Confirm Repaint", "Yes", "No") == "Yes")
var/energy_color_input = input(usr,"","Choose Energy Color",energy_color) as color|null
@@ -986,6 +985,7 @@
user.update_inv_wear_suit()
light_color = energy_color
update_light()
return TRUE
/obj/item/clothing/suit/space/hardsuit/lavaknight/examine(mob/user)
. = ..()

View File

@@ -92,11 +92,11 @@
//Toggle exosuits for different aesthetic styles (hoodies, suit jacket buttons, etc)
/obj/item/clothing/suit/toggle/AltClick(mob/user)
..()
. = ..()
if(!user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
else
suit_toggle(user)
suit_toggle(user)
return TRUE
/obj/item/clothing/suit/toggle/ui_action_click()
suit_toggle()

View File

@@ -67,10 +67,12 @@
return
/obj/item/clothing/accessory/AltClick(mob/user)
. = ..()
if(istype(user) && user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
if(initial(above_suit))
above_suit = !above_suit
to_chat(user, "[src] will be worn [above_suit ? "above" : "below"] your suit.")
return TRUE
/obj/item/clothing/accessory/examine(mob/user)
. = ..()

View File

@@ -187,9 +187,11 @@
return time2text(world.time + 432000, ":ss")
/obj/item/detective_scanner/AltClick(mob/living/user)
. = ..()
// Best way for checking if a player can use while not incapacitated, etc
if(!user.canUseTopic(src, be_close=TRUE))
return
. = TRUE
if(!LAZYLEN(log))
to_chat(user, "<span class='notice'>Cannot clear logs, the scanner has no logs.</span>")
return

View File

@@ -186,8 +186,10 @@
..()
/obj/machinery/microwave/AltClick(mob/user)
. = ..()
if(user.canUseTopic(src, !issilicon(usr)))
cook()
return TRUE
/obj/machinery/microwave/ui_interact(mob/user)
. = ..()

View File

@@ -130,9 +130,11 @@
update_icon()
/obj/item/toy/cards/singlecard/cas/AltClick(mob/living/user)
. = ..()
if(!ishuman(user) || !user.canUseTopic(src, BE_CLOSE))
return
Flip()
return TRUE
/obj/item/toy/cards/singlecard/cas/update_icon()
if(flipped)

View File

@@ -181,10 +181,11 @@
else
return ..()
//this helps you not blow up so easily by overriding unlocking which results in an immediate boom.
/obj/structure/closet/crate/secure/loot/AltClick(mob/living/user)
if(!user.canUseTopic(src, BE_CLOSE))
return
return attack_hand(user) //this helps you not blow up so easily by overriding unlocking which results in an immediate boom.
if(user.canUseTopic(src, BE_CLOSE))
attack_hand(user)
return TRUE
/obj/structure/closet/crate/secure/loot/attackby(obj/item/W, mob/user)
if(locked)

View File

@@ -59,6 +59,7 @@ GLOBAL_LIST_INIT(marker_beacon_colors, list(
/obj/item/stack/marker_beacon/AltClick(mob/living/user)
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE))
return
. = TRUE
var/input_color = input(user, "Choose a color.", "Beacon Color") as null|anything in GLOB.marker_beacon_colors
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE))
return
@@ -128,9 +129,10 @@ GLOBAL_LIST_INIT(marker_beacon_colors, list(
return ..()
/obj/structure/marker_beacon/AltClick(mob/living/user)
..()
. = ..()
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE))
return
. = TRUE
var/input_color = input(user, "Choose a color.", "Beacon Color") as null|anything in GLOB.marker_beacon_colors
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE))
return

View File

@@ -29,6 +29,7 @@
/mob/living/simple_animal/hostile/guardian/bomb/AltClickOn(atom/movable/A)
if(!istype(A))
altclick_listed_turf(A)
return
if(loc == summoner)
to_chat(src, "<span class='danger'><B>You must be manifested to create bombs!</span></B>")

View File

@@ -105,8 +105,9 @@
/mob/living/simple_animal/hostile/guardian/healer/AltClickOn(atom/movable/A)
if(!istype(A))
altclick_listed_turf(A)
return
if(src.loc == summoner)
if(loc == summoner)
to_chat(src, "<span class='danger'><B>You must be manifested to warp a target!</span></B>")
return
if(!beacon)

View File

@@ -267,6 +267,7 @@ Difficulty: Medium
/mob/living/simple_animal/hostile/megafauna/dragon/AltClickOn(atom/movable/A)
if(!istype(A))
altclick_listed_turf(A)
return
if(swoop_cooldown >= world.time)
to_chat(src, "<span class='warning'>You need to wait 20 seconds between swoop attacks!</span>")

View File

@@ -441,7 +441,7 @@ Difficulty: Normal
/mob/living/simple_animal/hostile/megafauna/hierophant/AltClickOn(atom/A) //player control handler(don't give this to a player holy fuck)
if(!istype(A) || get_dist(A, src) <= 2)
return
return altclick_listed_turf(A)
blink(A)
//Hierophant overlays

View File

@@ -8,6 +8,7 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, typecacheof(list(
/mob/living/proc/handle_ventcrawl(atom/A)
if(!ventcrawler || !Adjacent(A))
return
. = TRUE //return value to stop the client from being shown the turf contents stat tab on alt-click.
if(stat)
to_chat(src, "You must be conscious to do this!")
return

View File

@@ -126,7 +126,7 @@
portable_drive.verb_pickup()
/obj/item/modular_computer/AltClick(mob/user)
..()
. = ..()
if(issilicon(user))
return
@@ -142,7 +142,7 @@
return
if(ai_slot)
ai_slot.try_eject(null, user)
return TRUE
// Gets IDs/access levels from card slot. Would be useful when/if PDAs would become modular PCs.
/obj/item/modular_computer/GetAccess()

View File

@@ -86,8 +86,8 @@
/obj/item/modular_computer/laptop/AltClick(mob/user)
if(screen_on) // Close it.
try_toggle_open(user)
else
return ..()
return TRUE
return ..()
/obj/item/modular_computer/laptop/proc/toggle_open(mob/living/user=null)
if(screen_on)

View File

@@ -94,8 +94,9 @@
cpu.eject_card()
/obj/machinery/modular_computer/AltClick(mob/user)
. = ..()
if(cpu)
cpu.AltClick(user)
return cpu.AltClick(user)
//ATTACK HAND IGNORING PARENT RETURN VALUE
// On-click handling. Turns on the computer if it's off and opens the GUI.

View File

@@ -122,6 +122,7 @@
. += "<span class='notice'>Alt-click [src] to fold it into a paper plane.</span>"
/obj/item/paper/AltClick(mob/living/carbon/user, obj/item/I)
. = ..()
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user), NO_TK))
return
to_chat(user, "<span class='notice'>You fold [src] into the shape of a plane!</span>")
@@ -134,3 +135,4 @@
I = new plane_type(user, src)
user.put_in_hands(I)
return TRUE

View File

@@ -46,13 +46,14 @@
. += "<span class='notice'>Alt-click to change its focusing, allowing you to set how big of an area it will capture.</span>"
/obj/item/camera/AltClick(mob/user)
. = ..()
if(!user.canUseTopic(src, BE_CLOSE))
return
var/desired_x = input(user, "How high do you want the camera to shoot, between [picture_size_x_min] and [picture_size_x_max]?", "Zoom", picture_size_x) as num
var/desired_y = input(user, "How wide do you want the camera to shoot, between [picture_size_y_min] and [picture_size_y_max]?", "Zoom", picture_size_y) as num
picture_size_x = min(CLAMP(desired_x, picture_size_x_min, picture_size_x_max), CAMERA_PICTURE_SIZE_HARD_LIMIT)
picture_size_y = min(CLAMP(desired_y, picture_size_y_min, picture_size_y_max), CAMERA_PICTURE_SIZE_HARD_LIMIT)
return TRUE
/obj/item/camera/attack(mob/living/carbon/human/M, mob/user)
return

View File

@@ -702,11 +702,11 @@
return ..()
/obj/machinery/power/apc/AltClick(mob/user)
..()
. = ..()
if(!user.canUseTopic(src, !issilicon(user)) || !isturf(loc))
return
else
togglelock(user)
togglelock(user)
return TRUE
/obj/machinery/power/apc/proc/togglelock(mob/living/user)
if(obj_flags & EMAGGED)

View File

@@ -225,10 +225,11 @@
spread = 2
/obj/item/gun/ballistic/shotgun/automatic/combat/compact/AltClick(mob/living/user)
. = ..()
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
toggle_stock(user)
. = ..()
return TRUE
/obj/item/gun/ballistic/shotgun/automatic/combat/compact/examine(mob/user)
. = ..()
@@ -289,8 +290,10 @@
to_chat(user, "You switch to tube A.")
/obj/item/gun/ballistic/shotgun/automatic/dual_tube/AltClick(mob/living/user)
. = ..()
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
pump()
return TRUE
// DOUBLE BARRELED SHOTGUN and IMPROVISED SHOTGUN are in revolver.dm

View File

@@ -428,10 +428,11 @@
return final_list
/obj/machinery/chem_dispenser/AltClick(mob/living/user)
. = ..()
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return
replace_beaker(user)
return
return TRUE
/obj/machinery/chem_dispenser/drinks/Initialize()
. = ..()

View File

@@ -29,10 +29,11 @@
icon_state = "mixer0b"
/obj/machinery/chem_heater/AltClick(mob/living/user)
. = ..()
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return
replace_beaker(user)
return
return TRUE
/obj/machinery/chem_heater/proc/replace_beaker(mob/living/user, obj/item/reagent_containers/new_beaker)
if(beaker)

View File

@@ -112,10 +112,11 @@
return ..()
/obj/machinery/chem_master/AltClick(mob/living/user)
. = ..()
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return
replace_beaker(user)
return
return TRUE
/obj/machinery/chem_master/proc/replace_beaker(mob/living/user, obj/item/reagent_containers/new_beaker)
if(beaker)

View File

@@ -237,10 +237,11 @@
return ..()
/obj/machinery/computer/pandemic/AltClick(mob/living/user)
. = ..()
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return
replace_beaker(user)
return
return TRUE
/obj/machinery/computer/pandemic/proc/replace_beaker(mob/living/user, obj/item/reagent_containers/new_beaker)
if(beaker)

View File

@@ -338,8 +338,10 @@
return FALSE
/obj/item/hypospray/mkii/AltClick(mob/user)
. = ..()
if(vial)
vial.attack_self(user)
return TRUE
// Gunna allow this for now, still really don't approve - Pooj
/obj/item/hypospray/mkii/emag_act(mob/user)

View File

@@ -94,6 +94,7 @@
if(react_loc)
reagents.reaction(react_loc, TOUCH)
reagents.clear_reagents()
return TRUE
/obj/item/reagent_containers/rag/towel
name = "towel"

View File

@@ -14,6 +14,7 @@
return
if(disk)
eject()
return TRUE
/obj/item/nanite_hijacker/examine(mob/user)
. = ..()

View File

@@ -35,6 +35,7 @@
update_icon()
else
to_chat(user, "<span class='warning'>Access denied.</span>")
return TRUE
/obj/item/nanite_remote/emag_act(mob/user)
. = ..()

View File

@@ -284,6 +284,7 @@ GLOBAL_VAR_INIT(hhmysteryRoomNumber, 1337)
var/datum/action/peepholeCancel/PHC = new
user.overlay_fullscreen("remote_view", /obj/screen/fullscreen/impaired, 1)
PHC.Grant(user)
return TRUE
/turf/closed/indestructible/hoteldoor/check_eye(mob/user)
if(get_dist(get_turf(src), get_turf(user)) >= 2)

View File

@@ -49,6 +49,7 @@
return ..()
/obj/vehicle/ridden/AltClick(mob/user)
. = ..()
if(inserted_key && user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
if(!is_occupant(user))
to_chat(user, "<span class='notice'>You must be riding the [src] to remove [src]'s key!</span>")
@@ -57,7 +58,7 @@
inserted_key.forceMove(drop_location())
user.put_in_hands(inserted_key)
inserted_key = null
return ..()
return TRUE
/obj/vehicle/ridden/driver_move(mob/user, direction)
if(key_type && !is_key(inserted_key))

View File

@@ -94,6 +94,7 @@
qdel(src)
/obj/vehicle/ridden/scooter/skateboard/AltClick(mob/user)
. = ..()
var/datum/component/riding/R = src.GetComponent(/datum/component/riding)
if (!adjusted_speed)
R.vehicle_move_delay = 0
@@ -103,6 +104,7 @@
R.vehicle_move_delay = 1
to_chat(user, "<span class='notice'>You adjust the wheels on [src] to make it go slower.</span>")
adjusted_speed = FALSE
return TRUE
//CONSTRUCTION
/obj/item/scooter_frame

View File

@@ -37,15 +37,11 @@
name = "[sizeword][dildo_shape] [can_customize ? "custom " : ""][dildo_type]"
/obj/item/dildo/AltClick(mob/living/user)
if(QDELETED(src))
return
if(!isliving(user))
return
if(isAI(user))
return
if(user.stat > 0)//unconscious or dead
. = ..()
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return
customize(user)
return TRUE
/obj/item/dildo/proc/customize(mob/living/user)
if(!can_customize)

View File

@@ -56,7 +56,7 @@
add_overlay(tertiary_overlay)
/obj/item/clothing/AltClick(mob/living/user)
..()
. = ..()
if(hasprimary | hassecondary | hastertiary)
var/choice = input(user,"polychromic thread options", "Clothing Recolor") as null|anything in list("[hasprimary ? "Primary Color" : ""]", "[hassecondary ? "Secondary Color" : ""]", "[hastertiary ? "Tertiary Color" : ""]") //generates a list depending on the enabled overlays
switch(choice) //Lets the list's options actually lead to something
@@ -78,6 +78,7 @@
tertiary_color = sanitize_hexcolor(tertiary_color_input, desired_format=6, include_crunch=1)
update_icon()
user.regenerate_icons()
return TRUE
/obj/item/clothing/examine(mob/user)
. = ..()

View File

@@ -162,9 +162,6 @@ SLEEPER CODE IS IN game/objects/items/devices/dogborg_sleeper.dm !
to_chat(user, "<span class='alert'>[GLOB.meta_gas_names[id]]: [round(gas_concentration*100, 0.01)] %</span>")
to_chat(user, "<span class='info'>Temperature: [round(environment.temperature-T0C)] &deg;C</span>")
/obj/item/analyzer/nose/AltClick(mob/user) //Barometer output for measuring when the next storm happens
. = ..()
/obj/item/analyzer/nose/afterattack(atom/target, mob/user, proximity)
. = ..()
if(!proximity)

View File

@@ -207,8 +207,10 @@
var/mob/M = loc
M.update_inv_hands()
/obj/item/gun/ballistic/automatic/AM4B/AltClick(mob/living/user)
. = ..()
if(!in_range(src, user)) //Basic checks to prevent abuse
return
. = TRUE
if(user.incapacitated() || !istype(user))
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return
@@ -217,6 +219,7 @@
if(body_color_input)
body_color = sanitize_hexcolor(body_color_input, desired_format=6, include_crunch=1)
update_icon()
/obj/item/gun/ballistic/automatic/AM4B/examine(mob/user)
. = ..()
. += "<span class='notice'>Alt-click to recolor it.</span>"

View File

@@ -30,8 +30,10 @@ obj/item/gun/energy/e_gun/cx/update_icon()
M.update_inv_hands()
obj/item/gun/energy/e_gun/cx/AltClick(mob/living/user)
. = ..()
if(!in_range(src, user)) //Basic checks to prevent abuse
return
. = TRUE
if(user.incapacitated() || !istype(user))
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return

View File

@@ -83,15 +83,17 @@
return 1
/obj/item/gun/energy/pumpaction/AltClick(mob/living/user) //for changing firing modes since attackself is already used for pumping
. = ..()
if(!in_range(src, user)) //Basic checks to prevent abuse
return
if(user.incapacitated() || !istype(user))
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return
if(ammo_type.len > 1)
select_fire(user)
update_icon()
if(user.incapacitated() || !istype(user))
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
else
select_fire(user)
update_icon()
return TRUE
/obj/item/gun/energy/pumpaction/examine(mob/user) //so people don't ask HOW TO CHANGE FIRING MODE
. = ..()