From 2eaf2fcf9f813bd6fecf97b5e82b466e8d10e321 Mon Sep 17 00:00:00 2001 From: homexp13 Date: Fri, 19 Jul 2024 16:09:57 +0300 Subject: [PATCH 1/2] attack_self --- code/game/objects/items/stacks/medical.dm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/game/objects/items/stacks/medical.dm b/code/game/objects/items/stacks/medical.dm index 9e6e5c78c0f..f8466e4e361 100644 --- a/code/game/objects/items/stacks/medical.dm +++ b/code/game/objects/items/stacks/medical.dm @@ -21,6 +21,10 @@ var/alien = FALSE +/obj/item/stack/medical/attack_self(mob/user) + . = ..() + attack(user, user) + /obj/item/stack/medical/attack(mob/living/M, mob/living/user) . = ..() if(.) From 8832949e469078c5b2e862f56960c447ad021702 Mon Sep 17 00:00:00 2001 From: homexp13 Date: Sat, 20 Jul 2024 13:32:57 +0300 Subject: [PATCH 2/2] action --- .../items/reagent_containers/hypospray.dm | 41 ------------------- .../reagent_containers/reagent_container.dm | 10 ++--- 2 files changed, 3 insertions(+), 48 deletions(-) diff --git a/code/game/objects/items/reagent_containers/hypospray.dm b/code/game/objects/items/reagent_containers/hypospray.dm index 185321e1928..55b8431ca47 100644 --- a/code/game/objects/items/reagent_containers/hypospray.dm +++ b/code/game/objects/items/reagent_containers/hypospray.dm @@ -107,47 +107,6 @@ return TRUE -//Копипипаста с кода выше, переделать -/obj/item/reagent_containers/hypospray/unique_action(mob/living/carbon/user) - . = ..() - if(user.species.species_flags & ROBOTIC_LIMBS) - return FALSE - - if(inject_mode == HYPOSPRAY_INJECT_MODE_DRAW) - balloon_alert(user, "You don't think this is a good idea...") - return FALSE - - if(!reagents.total_volume) - balloon_alert(user, "Hypospray is empty!") - return FALSE - - if(skilllock && user.skills.getRating(SKILL_MEDICAL) < SKILL_MEDICAL_NOVICE) - user.visible_message(span_notice("[user] fumbles around figuring out how to use the [src]."), - span_notice("You fumble around figuring out how to use the [src].")) - if(!do_after(user, SKILL_TASK_EASY, NONE, user_display = BUSY_ICON_UNSKILLED)) - return FALSE - - if(!user.can_inject(user, TRUE, user.zone_selected, TRUE)) - return FALSE - - var/list/injected = list() - for(var/datum/reagent/R in reagents.reagent_list) - injected += R.name - - to_chat(user, span_notice("You inject yourself with [src]!")) - record_reagent_consumption(min(amount_per_transfer_from_this, reagents.total_volume), injected, user) - - // /mob/living/carbon/human/attack_hand causes - // changeNext_move(7) which creates a delay - // This line overrides the delay, and will absolutely break everything - user.changeNext_move(3) // please don't break the game - - playsound(loc, 'sound/items/hypospray.ogg', 50, 1) - reagents.reaction(user, INJECT, min(amount_per_transfer_from_this, reagents.total_volume) / reagents.total_volume) - var/trans = reagents.trans_to(user, amount_per_transfer_from_this) - to_chat(user, span_notice("[trans] units injected. [reagents.total_volume] units remaining in [src]. ")) // better to not balloon - return TRUE - /obj/item/reagent_containers/hypospray/afterattack_alternate(atom/A, mob/living/user) if(!istype(user)) return FALSE diff --git a/code/game/objects/items/reagent_containers/reagent_container.dm b/code/game/objects/items/reagent_containers/reagent_container.dm index dd13fced782..e091d7043d8 100644 --- a/code/game/objects/items/reagent_containers/reagent_container.dm +++ b/code/game/objects/items/reagent_containers/reagent_container.dm @@ -28,15 +28,11 @@ if(!possible_transfer_amounts) verbs -= /obj/item/reagent_containers/verb/set_APTFT -/obj/item/reagent_containers/attack_hand_alternate(mob/living/user) +/obj/item/reagent_containers/attack_self(mob/living/user) . = ..() - if(!possible_transfer_amounts) - return - var/result = tgui_input_list(user, "Amount per transfer from this:","[src]", possible_transfer_amounts) - if(result) - amount_per_transfer_from_this = result + afterattack(user, user) //If player uses the container, use it on themselves -/obj/item/reagent_containers/interact(mob/user) +/obj/item/reagent_containers/unique_action(mob/user, special_treatment) . = ..() if(.) return