mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 23:58:07 +01:00
[MIRROR] Refactor, improve, and rename canUseTopic to be can_perform_action [MDB IGNORE] (#19391)
* Refactor, improve, and rename canUseTopic to be can_perform_action * updoot * https://github.com/tgstation/tgstation/pull/72876 https://github.com/tgstation/tgstation/pull/72876 --------- Co-authored-by: Tim <timothymtorres@gmail.com> Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
This commit is contained in:
@@ -379,7 +379,7 @@
|
||||
if(!is_operational)
|
||||
return
|
||||
var/name = tgui_input_text(usr, "What do you want to name this recipe?", "Recipe Name", MAX_NAME_LEN)
|
||||
if(!usr.canUseTopic(src, !issilicon(usr)))
|
||||
if(!usr.can_perform_action(src, ALLOW_SILICON_REACH))
|
||||
return
|
||||
if(saved_recipes[name] && tgui_alert(usr, "\"[name]\" already exists, do you want to overwrite it?",, list("Yes", "No")) == "No")
|
||||
return
|
||||
@@ -527,7 +527,7 @@
|
||||
. = ..()
|
||||
if(. == SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN)
|
||||
return
|
||||
if(!can_interact(user) || !user.canUseTopic(src, !issilicon(user), FALSE, no_tk = TRUE))
|
||||
if(!can_interact(user) || !user.can_perform_action(src, ALLOW_SILICON_REACH|FORBID_TELEKINESIS_REACH))
|
||||
return
|
||||
replace_beaker(user)
|
||||
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
. = ..()
|
||||
if(. == SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN)
|
||||
return
|
||||
if(!can_interact(user) || !user.canUseTopic(src, !issilicon(user), FALSE, no_tk = TRUE))
|
||||
if(!can_interact(user) || !user.can_perform_action(src, ALLOW_SILICON_REACH|FORBID_TELEKINESIS_REACH))
|
||||
return
|
||||
replace_beaker(user)
|
||||
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
|
||||
|
||||
@@ -126,7 +126,7 @@ This will not clean any inverted reagents. Inverted reagents will still be corre
|
||||
if(processing_reagents)
|
||||
to_chat(user, "<span class='notice'> The [src] is currently processing a batch!")
|
||||
return
|
||||
if(!can_interact(user) || !user.canUseTopic(src, be_close = TRUE, no_dexterity = FALSE, no_tk = TRUE))
|
||||
if(!can_interact(user) || !user.can_perform_action(src, FORBID_TELEKINESIS_REACH))
|
||||
return ..()
|
||||
replace_beaker(user, BEAKER1)
|
||||
|
||||
@@ -135,7 +135,7 @@ This will not clean any inverted reagents. Inverted reagents will still be corre
|
||||
if(processing_reagents)
|
||||
to_chat(user, "<span class='notice'> The [src] is currently processing a batch!")
|
||||
return
|
||||
if(!can_interact(user) || !user.canUseTopic(src, be_close = TRUE, no_dexterity = FALSE, no_tk = TRUE))
|
||||
if(!can_interact(user) || !user.can_perform_action(src, FORBID_TELEKINESIS_REACH))
|
||||
return
|
||||
replace_beaker(user, BEAKER2)
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
. = ..()
|
||||
if(. == SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN)
|
||||
return
|
||||
if(!can_interact(user) || !user.canUseTopic(src, !issilicon(user), FALSE, no_tk = TRUE))
|
||||
if(!can_interact(user) || !user.can_perform_action(src, ALLOW_SILICON_REACH|FORBID_TELEKINESIS_REACH))
|
||||
return
|
||||
replace_beaker(user)
|
||||
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
|
||||
@@ -386,7 +386,7 @@
|
||||
"Name",
|
||||
name_default,
|
||||
MAX_NAME_LEN)
|
||||
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, !issilicon(usr)))
|
||||
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.can_perform_action(src, ALLOW_SILICON_REACH))
|
||||
return FALSE
|
||||
// Start filling
|
||||
if(item_type == "pill")
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
. = ..()
|
||||
if(. == SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN)
|
||||
return
|
||||
if(!can_interact(user) || !user.canUseTopic(src, !issilicon(user), FALSE, no_tk = TRUE))
|
||||
if(!can_interact(user) || !user.can_perform_action(src, ALLOW_SILICON_REACH|FORBID_TELEKINESIS_REACH))
|
||||
return
|
||||
eject_beaker()
|
||||
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
. = ..()
|
||||
if(. == SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN)
|
||||
return
|
||||
if(!can_interact(user) || !user.canUseTopic(src, !issilicon(user), FALSE, no_tk = TRUE))
|
||||
if(!can_interact(user) || !user.can_perform_action(src, ALLOW_SILICON_REACH|FORBID_TELEKINESIS_REACH))
|
||||
return
|
||||
if(operating)
|
||||
return
|
||||
@@ -201,7 +201,7 @@
|
||||
/obj/machinery/reagentgrinder/ui_interact(mob/user) // The microwave Menu //I am reasonably certain that this is not a microwave
|
||||
. = ..()
|
||||
|
||||
if(operating || !user.canUseTopic(src, !issilicon(user)))
|
||||
if(operating || !user.can_perform_action(src, ALLOW_SILICON_REACH))
|
||||
return
|
||||
|
||||
var/list/options = list()
|
||||
@@ -232,7 +232,7 @@
|
||||
choice = show_radial_menu(user, src, options, require_near = !issilicon(user))
|
||||
|
||||
// post choice verification
|
||||
if(operating || (isAI(user) && machine_stat & NOPOWER) || !user.canUseTopic(src, !issilicon(user)))
|
||||
if(operating || (isAI(user) && machine_stat & NOPOWER) || !user.can_perform_action(src, ALLOW_SILICON_REACH))
|
||||
return
|
||||
|
||||
switch(choice)
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
if(!user.can_write(tool))
|
||||
return
|
||||
var/custom_label = tgui_input_text(user, "What would you like to label the blood pack?", "Blood Pack", name, MAX_NAME_LEN)
|
||||
if(!user.canUseTopic(src, be_close = TRUE))
|
||||
if(!user.can_perform_action(src))
|
||||
return
|
||||
if(user.get_active_held_item() != tool)
|
||||
return
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
possible_transfer_amounts = list()
|
||||
|
||||
/obj/item/reagent_containers/chem_pack/AltClick(mob/living/user)
|
||||
if(user.canUseTopic(src, be_close = TRUE, no_dexterity = TRUE) && !sealed)
|
||||
if(user.can_perform_action(src, NEED_DEXTERITY) && !sealed)
|
||||
if(iscarbon(user) && (HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50)))
|
||||
to_chat(user, span_warning("Uh... whoops! You accidentally spill the content of the bag onto yourself."))
|
||||
SplashReagents(user)
|
||||
|
||||
@@ -533,7 +533,7 @@
|
||||
if(!inputvalue)
|
||||
return
|
||||
|
||||
if(user.canUseTopic(src, be_close = TRUE))
|
||||
if(user.can_perform_action(src))
|
||||
name = "[(inputvalue ? "[inputvalue]" : null)] bottle"
|
||||
|
||||
//types of syrups
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
update_appearance()
|
||||
|
||||
/obj/item/reagent_containers/hypospray/medipen/attack_self(mob/user)
|
||||
if(user.canUseTopic(src, be_close = TRUE, no_dexterity = FALSE, no_tk = TRUE, need_hands = FALSE, floor_okay = TRUE))
|
||||
if(user.can_perform_action(src, FORBID_TELEKINESIS_REACH|ALLOW_RESTING))
|
||||
inject(user, user)
|
||||
|
||||
/obj/item/reagent_containers/hypospray/medipen/update_icon_state()
|
||||
|
||||
@@ -426,7 +426,7 @@
|
||||
"Blue" = "sprayer_med_blue")
|
||||
|
||||
/obj/item/reagent_containers/spray/medical/AltClick(mob/user)
|
||||
if(unique_reskin && !current_skin && user.canUseTopic(src, be_close = TRUE, no_dexterity = TRUE))
|
||||
if(unique_reskin && !current_skin && user.can_perform_action(src, NEED_DEXTERITY))
|
||||
reskin_obj(user)
|
||||
|
||||
/obj/item/reagent_containers/spray/medical/reskin_obj(mob/M)
|
||||
|
||||
Reference in New Issue
Block a user