mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 00:29:02 +01:00
Converts more attackby's to interactions (#93106)
## About The Pull Request Converts the following: - Medical Kiosk - Implant case - Flamethrower - Chemical implant case - Pappercutter Also I've looked at some alt click procs and adjusted some of their returns
This commit is contained in:
@@ -778,6 +778,9 @@
|
||||
/obj/item/card/id/click_alt(mob/living/user)
|
||||
if(!alt_click_can_use_id(user))
|
||||
return NONE
|
||||
if (registered_account.being_dumped)
|
||||
registered_account.bank_card_talk(span_warning("内部服务器错误"), TRUE)
|
||||
return CLICK_ACTION_SUCCESS
|
||||
if(registered_account.account_debt)
|
||||
var/choice = tgui_alert(user, "Choose An Action", "Bank Account", list("Withdraw", "Pay Debt"))
|
||||
if(!choice || QDELETED(user) || QDELETED(src) || !alt_click_can_use_id(user) || loc != user)
|
||||
@@ -785,9 +788,6 @@
|
||||
if(choice == "Pay Debt")
|
||||
pay_debt(user)
|
||||
return CLICK_ACTION_SUCCESS
|
||||
if (registered_account.being_dumped)
|
||||
registered_account.bank_card_talk(span_warning("内部服务器错误"), TRUE)
|
||||
return CLICK_ACTION_SUCCESS
|
||||
if(loc != user)
|
||||
to_chat(user, span_warning("You must be holding the ID to continue!"))
|
||||
return CLICK_ACTION_BLOCKING
|
||||
@@ -803,17 +803,17 @@
|
||||
return CLICK_ACTION_BLOCKING
|
||||
if(!alt_click_can_use_id(user))
|
||||
return CLICK_ACTION_BLOCKING
|
||||
if(registered_account.adjust_money(-amount_to_remove, "System: Withdrawal"))
|
||||
var/obj/item/holochip/holochip = new (user.drop_location(), amount_to_remove)
|
||||
user.put_in_hands(holochip)
|
||||
to_chat(user, span_notice("You withdraw [amount_to_remove] credits into a holochip."))
|
||||
SSblackbox.record_feedback("amount", "credits_removed", amount_to_remove)
|
||||
log_econ("[amount_to_remove] credits were removed from [src] owned by [src.registered_name]")
|
||||
return CLICK_ACTION_SUCCESS
|
||||
else
|
||||
if(!registered_account.adjust_money(-amount_to_remove, "System: Withdrawal"))
|
||||
var/difference = amount_to_remove - registered_account.account_balance
|
||||
registered_account.bank_card_talk(span_warning("ERROR: The linked account requires [difference] more credit\s to perform that withdrawal."), TRUE)
|
||||
return CLICK_ACTION_BLOCKING
|
||||
var/obj/item/holochip/holochip = new (user.drop_location(), amount_to_remove)
|
||||
user.put_in_hands(holochip)
|
||||
to_chat(user, span_notice("You withdraw [amount_to_remove] credits into a holochip."))
|
||||
SSblackbox.record_feedback("amount", "credits_removed", amount_to_remove)
|
||||
log_econ("[amount_to_remove] credits were removed from [src] owned by [registered_name]")
|
||||
return CLICK_ACTION_SUCCESS
|
||||
|
||||
|
||||
/obj/item/card/id/click_alt_secondary(mob/user)
|
||||
if(!alt_click_can_use_id(user))
|
||||
|
||||
@@ -809,6 +809,10 @@
|
||||
)
|
||||
register_context()
|
||||
register_item_context()
|
||||
// If default crayon red colour, pick a more fun spraycan colour
|
||||
if(!paint_color)
|
||||
set_painting_tool_color(pick(COLOR_CRAYON_RED, COLOR_CRAYON_ORANGE, COLOR_CRAYON_YELLOW, COLOR_CRAYON_GREEN, COLOR_CRAYON_BLUE, COLOR_CRAYON_PURPLE))
|
||||
refill()
|
||||
|
||||
/obj/item/toy/crayon/spraycan/add_context(atom/source, list/context, obj/item/held_item, mob/living/user)
|
||||
. = ..()
|
||||
@@ -859,13 +863,6 @@
|
||||
reagents.trans_to(user, used, volume_multiplier, transferred_by = user, methods = VAPOR)
|
||||
return OXYLOSS
|
||||
|
||||
/obj/item/toy/crayon/spraycan/Initialize(mapload)
|
||||
. = ..()
|
||||
// If default crayon red colour, pick a more fun spraycan colour
|
||||
if(!paint_color)
|
||||
set_painting_tool_color(pick(COLOR_CRAYON_RED, COLOR_CRAYON_ORANGE, COLOR_CRAYON_YELLOW, COLOR_CRAYON_GREEN, COLOR_CRAYON_BLUE, COLOR_CRAYON_PURPLE))
|
||||
refill()
|
||||
|
||||
/obj/item/toy/crayon/spraycan/examine(mob/user)
|
||||
. = ..()
|
||||
if(charges != INFINITE_CHARGES)
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
/obj/item/desynchronizer/click_alt(mob/living/user)
|
||||
var/new_duration = tgui_input_number(user, "Set the duration", "Desynchronizer", duration / 10, max_duration, 5)
|
||||
if(!new_duration || QDELETED(user) || QDELETED(src) || !usr.can_perform_action(src, NEED_DEXTERITY))
|
||||
if(!new_duration || QDELETED(user) || QDELETED(src) || !user.can_perform_action(src, NEED_DEXTERITY))
|
||||
return CLICK_ACTION_BLOCKING
|
||||
duration = new_duration
|
||||
to_chat(user, span_notice("You set the duration to [DisplayTimeText(duration)]."))
|
||||
|
||||
@@ -112,9 +112,9 @@
|
||||
|
||||
/obj/item/geiger_counter/click_alt(mob/living/user)
|
||||
if(!scanning)
|
||||
to_chat(usr, span_warning("[src] must be on to reset its radiation level!"))
|
||||
to_chat(user, span_warning("[src] must be on to reset its radiation level!"))
|
||||
return CLICK_ACTION_BLOCKING
|
||||
to_chat(usr, span_notice("You flush [src]'s radiation counts, resetting it to normal."))
|
||||
to_chat(user, span_notice("You flush [src]'s radiation counts, resetting it to normal."))
|
||||
last_perceived_radiation_danger = null
|
||||
update_appearance(UPDATE_ICON)
|
||||
return CLICK_ACTION_SUCCESS
|
||||
|
||||
@@ -45,9 +45,10 @@
|
||||
|
||||
/obj/item/quantum_keycard/click_alt(mob/living/user)
|
||||
to_chat(user, span_notice("You start pressing [src]'s unlink button..."))
|
||||
if(do_after(user, 4 SECONDS, target = src))
|
||||
to_chat(user, span_notice("The keycard beeps twice and disconnects the quantum link."))
|
||||
set_pad()
|
||||
if(!do_after(user, 4 SECONDS, target = src))
|
||||
return CLICK_ACTION_BLOCKING
|
||||
to_chat(user, span_notice("The keycard beeps twice and disconnects the quantum link."))
|
||||
set_pad()
|
||||
return CLICK_ACTION_SUCCESS
|
||||
|
||||
/obj/item/quantum_keycard/proc/set_pad(obj/machinery/quantumpad/new_pad)
|
||||
|
||||
@@ -21,13 +21,13 @@
|
||||
throw_range = 7
|
||||
custom_materials = list(/datum/material/iron=SMALL_MATERIAL_AMOUNT *2)
|
||||
interaction_flags_click = NEED_LITERACY|NEED_LIGHT|ALLOW_RESTING
|
||||
custom_price = PAYCHECK_COMMAND
|
||||
/// Verbose/condensed
|
||||
var/mode = SCANNER_VERBOSE
|
||||
/// HEALTH/WOUND
|
||||
var/scanmode = SCANMODE_HEALTH
|
||||
/// Advanced health analyzer
|
||||
var/advanced = FALSE
|
||||
custom_price = PAYCHECK_COMMAND
|
||||
/// If this analyzer will give a bonus to wound treatments apon woundscan.
|
||||
var/give_wound_treatment_bonus = FALSE
|
||||
var/last_scan_text
|
||||
@@ -190,7 +190,7 @@
|
||||
render_list += "<span class='alert ml-1'>Fatigue level: [target.getStaminaLoss()]%.</span><br>"
|
||||
else
|
||||
render_list += "<span class='alert ml-1'>Subject appears to be suffering from fatigue.</span><br>"
|
||||
|
||||
|
||||
// Check for brain - both organic (carbon) and synthetic (cyborg MMI)
|
||||
var/has_brain = FALSE
|
||||
if(target.get_organ_slot(ORGAN_SLOT_BRAIN))
|
||||
@@ -199,7 +199,7 @@
|
||||
var/mob/living/silicon/robot/cyborg_target = target
|
||||
if(cyborg_target.mmi?.brain)
|
||||
has_brain = TRUE
|
||||
|
||||
|
||||
if(!has_brain) // kept exclusively for soul purposes
|
||||
render_list += "<span class='alert ml-1'>Subject lacks a brain.</span><br>"
|
||||
|
||||
|
||||
@@ -25,7 +25,9 @@
|
||||
var/lit = FALSE //on or off
|
||||
var/operating = FALSE//cooldown
|
||||
var/obj/item/weldingtool/weldtool = null
|
||||
/// The igniter stored in the flamethrower
|
||||
var/obj/item/assembly/igniter/igniter = null
|
||||
/// The plasma tank that we shoot gas from
|
||||
var/obj/item/tank/internals/plasma/ptank = null
|
||||
var/warned_admins = FALSE //for the message_admins() when lit
|
||||
//variables for prebuilt flamethrowers
|
||||
@@ -94,9 +96,9 @@
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
|
||||
/obj/item/flamethrower/wrench_act(mob/living/user, obj/item/tool)
|
||||
. = TRUE
|
||||
. = ITEM_INTERACT_SUCCESS
|
||||
if(status)
|
||||
return FALSE
|
||||
return ITEM_INTERACT_BLOCKING
|
||||
tool.play_tool_sound(src)
|
||||
var/turf/T = get_turf(src)
|
||||
if(weldtool)
|
||||
@@ -119,34 +121,34 @@
|
||||
update_appearance()
|
||||
return TRUE
|
||||
|
||||
/obj/item/flamethrower/attackby(obj/item/W, mob/user, list/modifiers, list/attack_modifiers)
|
||||
if(isigniter(W))
|
||||
var/obj/item/assembly/igniter/I = W
|
||||
if(I.secured)
|
||||
return
|
||||
/obj/item/flamethrower/item_interaction(mob/living/user, obj/item/tool, list/modifiers)
|
||||
if(isigniter(tool))
|
||||
var/obj/item/assembly/igniter/inserting_igniter = tool
|
||||
if(inserting_igniter.secured)
|
||||
return ITEM_INTERACT_BLOCKING
|
||||
if(igniter)
|
||||
return
|
||||
if(!user.transferItemToLoc(W, src))
|
||||
return
|
||||
igniter = I
|
||||
return ITEM_INTERACT_BLOCKING
|
||||
if(!user.transferItemToLoc(tool, src))
|
||||
return ITEM_INTERACT_BLOCKING
|
||||
igniter = inserting_igniter
|
||||
update_appearance()
|
||||
return
|
||||
|
||||
else if(istype(W, /obj/item/tank/internals/plasma))
|
||||
balloon_alert(user, "attached")
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
if(istype(tool, /obj/item/tank/internals/plasma))
|
||||
if(ptank)
|
||||
if(user.transferItemToLoc(W,src))
|
||||
ptank.forceMove(get_turf(src))
|
||||
ptank = W
|
||||
to_chat(user, span_notice("You swap the plasma tank in [src]!"))
|
||||
return
|
||||
if(!user.transferItemToLoc(W, src))
|
||||
return
|
||||
ptank = W
|
||||
if(!user.transferItemToLoc(tool, src))
|
||||
return ITEM_INTERACT_BLOCKING
|
||||
ptank.forceMove(get_turf(src))
|
||||
ptank = tool
|
||||
to_chat(user, span_notice("You swap the plasma tank in [src]!"))
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
if(!user.transferItemToLoc(tool, src))
|
||||
return ITEM_INTERACT_BLOCKING
|
||||
ptank = tool
|
||||
update_appearance()
|
||||
return
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
|
||||
else
|
||||
return ..()
|
||||
return NONE
|
||||
|
||||
/obj/item/flamethrower/return_analyzable_air()
|
||||
if(ptank)
|
||||
|
||||
@@ -95,9 +95,7 @@
|
||||
desc = "A glass case containing a remote chemical implant."
|
||||
imp_type = /obj/item/implant/chem
|
||||
|
||||
/obj/item/implantcase/chem/attackby(obj/item/W, mob/user, list/modifiers, list/attack_modifiers)
|
||||
if(istype(W, /obj/item/reagent_containers/syringe) && imp)
|
||||
W.interact_with_atom(imp, user, modifiers)
|
||||
return TRUE
|
||||
else
|
||||
return ..()
|
||||
/obj/item/implantcase/chem/item_interaction(mob/living/user, obj/item/tool, list/modifiers)
|
||||
if(!istype(tool, /obj/item/reagent_containers/syringe) && imp)
|
||||
return NONE
|
||||
return tool.interact_with_atom(imp, user, modifiers)
|
||||
|
||||
@@ -462,11 +462,13 @@
|
||||
var/datum/action/innate/origami/origami_action = locate() in user.actions
|
||||
if(origami_action?.active) //Origami masters can fold water
|
||||
make_plane(user, /obj/item/paperplane/syndicate)
|
||||
else if(do_after(user, 1 SECONDS, target = src, progress=TRUE))
|
||||
var/turf/open/target = get_turf(src)
|
||||
target.MakeSlippery(TURF_WET_WATER, min_wet_time = 10 SECONDS, wet_time_to_add = 5 SECONDS)
|
||||
to_chat(user, span_notice("As you try to fold [src] into the shape of a plane, it disintegrates into water!"))
|
||||
qdel(src)
|
||||
return CLICK_ACTION_SUCCESS
|
||||
if(!do_after(user, 1 SECONDS, target = src, progress=TRUE))
|
||||
return CLICK_ACTION_BLOCKING
|
||||
var/turf/open/target = get_turf(src)
|
||||
target.MakeSlippery(TURF_WET_WATER, min_wet_time = 10 SECONDS, wet_time_to_add = 5 SECONDS)
|
||||
to_chat(user, span_notice("As you try to fold [src] into the shape of a plane, it disintegrates into water!"))
|
||||
qdel(src)
|
||||
return CLICK_ACTION_SUCCESS
|
||||
|
||||
#undef ENERGY_TO_SPEAK
|
||||
|
||||
@@ -599,13 +599,13 @@
|
||||
. += span_notice("Alt-click it to quickly draw the blade.")
|
||||
|
||||
/obj/item/storage/belt/sheath/click_alt(mob/user)
|
||||
if(length(contents))
|
||||
var/obj/item/I = contents[1]
|
||||
user.visible_message(span_notice("[user] takes [I] out of [src]."), span_notice("You take [I] out of [src]."))
|
||||
user.put_in_hands(I)
|
||||
update_appearance()
|
||||
else
|
||||
if(!length(contents))
|
||||
balloon_alert(user, "it's empty!")
|
||||
return CLICK_ACTION_BLOCKING
|
||||
var/obj/item/stored_item = contents[1]
|
||||
user.visible_message(span_notice("[user] takes [stored_item] out of [src]."), span_notice("You take [stored_item] out of [src]."))
|
||||
user.put_in_hands(stored_item)
|
||||
update_appearance()
|
||||
return CLICK_ACTION_SUCCESS
|
||||
|
||||
/obj/item/storage/belt/sheath/update_icon_state()
|
||||
|
||||
Reference in New Issue
Block a user