From b6ef04c5905a6fc617dd911d183859dbf6a96385 Mon Sep 17 00:00:00 2001 From: Ivan2004fantom Date: Tue, 28 May 2024 12:39:37 +0300 Subject: [PATCH 1/5] Structure Containers --- maps/torch_fd/fd_torch.dm | 1 + mods/_fd/structure_storage/README.md | 76 ++++++++ .../structure_storage/_structure_storage.dm | 4 + .../structure_storage/_structure_storage.dme | 8 + mods/_fd/structure_storage/code/storage.dm | 172 ++++++++++++++++++ mods/_fd/structure_storage/icons/storage.dmi | Bin 0 -> 4965 bytes 6 files changed, 261 insertions(+) create mode 100644 mods/_fd/structure_storage/README.md create mode 100644 mods/_fd/structure_storage/_structure_storage.dm create mode 100644 mods/_fd/structure_storage/_structure_storage.dme create mode 100644 mods/_fd/structure_storage/code/storage.dm create mode 100644 mods/_fd/structure_storage/icons/storage.dmi diff --git a/maps/torch_fd/fd_torch.dm b/maps/torch_fd/fd_torch.dm index 372261de95845..7286bb2964319 100644 --- a/maps/torch_fd/fd_torch.dm +++ b/maps/torch_fd/fd_torch.dm @@ -256,6 +256,7 @@ #include "../../mods/_fd/multitile_vehicles/_multitile_vehicles.dme" #include "../../mods/_fd/old_space_cannons/_old_space_cannons.dme" #include "../../mods/_fd/random_rooms/_random_rooms.dme" + #include "../../mods/_fd/structure_storage/_structure_storage.dme" #include "../../mods/_fd/_maps/airfield/_airfield.dme" #include "../../mods/_fd/_maps/ares/_ares.dme" diff --git a/mods/_fd/structure_storage/README.md b/mods/_fd/structure_storage/README.md new file mode 100644 index 0000000000000..702662f97e85d --- /dev/null +++ b/mods/_fd/structure_storage/README.md @@ -0,0 +1,76 @@ + +#### Список PRов: + + + + +## Контейнеры в структурах + +ID мода: STRUCTURE_STORAGE + + +### Описание мода + +Добавляет в игру контейнеры в структурах для хранения предметов. + + +### Изменения *кор кода* + +- Отсутствуют + + +### Оверрайды + +- Отсутствуют + + +### Дефайны + +- Отсутствуют + + +### Используемые файлы, не содержащиеся в модпаке + +- Отсутствуют + + +### Авторы: + +ChemistryOneLove + diff --git a/mods/_fd/structure_storage/_structure_storage.dm b/mods/_fd/structure_storage/_structure_storage.dm new file mode 100644 index 0000000000000..8bdb6207425c3 --- /dev/null +++ b/mods/_fd/structure_storage/_structure_storage.dm @@ -0,0 +1,4 @@ +/singleton/modpack/structure_storage + name = "Контейнеры в структурах" + desc = "Добавляет в игру контейнеры внутри структур, до этого контейнеры были только в предметах." + author = "ChemistryOneLove" diff --git a/mods/_fd/structure_storage/_structure_storage.dme b/mods/_fd/structure_storage/_structure_storage.dme new file mode 100644 index 0000000000000..bce29bc49573f --- /dev/null +++ b/mods/_fd/structure_storage/_structure_storage.dme @@ -0,0 +1,8 @@ +#ifndef MODPACK_STRUCTURE_STORAGE +#define MODPACK_STRUCTURE_STORAGE + +#include "_structure_storage.dm" + +#include "code/storage.dm" + +#endif diff --git a/mods/_fd/structure_storage/code/storage.dm b/mods/_fd/structure_storage/code/storage.dm new file mode 100644 index 0000000000000..88bad991bf742 --- /dev/null +++ b/mods/_fd/structure_storage/code/storage.dm @@ -0,0 +1,172 @@ +// Structures that store things! +/obj/structure/storage + name = "filing cabinet" + desc = "A large cabinet with drawers." + icon = 'mods/_fd/structure_storage/icons/storage.dmi' + icon_state = "chestdrawer_white" + density = TRUE + anchored = TRUE + atom_flags = ATOM_FLAG_NO_TEMP_CHANGE | ATOM_FLAG_CLIMBABLE + obj_flags = OBJ_FLAG_ANCHORABLE + var/obj/item/storage/internal/structure/storage + /// The number of storage slots in this container. + var/slots = 6 + /// Max size of objects that this object can store (in effect only if can_hold isn't set) + var/max_w_class = ITEM_SIZE_NORMAL + /// Total storage cost of items this can hold. Will be autoset based on storage_slots if left null. + var/storage_space = null + /// Mob can enter this container? + var/mob_can_enter = FALSE + +/obj/structure/storage/Initialize() + . = ..() + storage = new/obj/item/storage/internal/structure(src, slots, max_w_class, storage_space) + +/obj/item/storage/internal/structure/New(obj/MI) + ..() + +/obj/structure/storage/Destroy() + QDEL_NULL(storage) + . = ..() + +/obj/structure/storage/attack_hand(mob/user as mob) + if (storage.handle_attack_hand(user)) + ..(user) + +/obj/structure/storage/MouseDrop(obj/over_object as obj) + if (mob_can_enter) + if (storage.handle_mousedrop(usr, over_object)) + ..(over_object) + return + +/obj/structure/storage/emp_act(severity) + storage.emp_act(severity) + ..() + +/obj/structure/storage/chestdrawer + name = "chest drawer" + icon_state = "chestdrawer_walnut" + slots = 8 + storage_space = 15 + +/obj/structure/storage/nightstand + name = "nightstand" + icon_state = "nightstand" + slots = null + storage_space = 10 + max_w_class = ITEM_SIZE_SMALL + +/obj/structure/storage/chest + name = "chest" + icon_state = "chestdrawer" + slots = null + storage_space = 25 + max_w_class = ITEM_SIZE_LARGE + +/obj/structure/storage/chest/wardrobe + name = "wardrobe" + icon_state = "wardrobe" + slots = null + storage_space = 35 + max_w_class = ITEM_SIZE_LARGE + +/obj/structure/storage/chest/wardrobe2 + name = "wardrobe" + icon_state = "wardrobe2" + slots = null + storage_space = 32 + max_w_class = ITEM_SIZE_NORMAL + +/obj/structure/storage/vehicles + name = "containment unit" + icon_state = "container" + density = FALSE + slots = null + storage_space = 20 + max_w_class = ITEM_SIZE_NORMAL + atom_flags = ATOM_FLAG_NO_TEMP_CHANGE + obj_flags = OBJ_FLAG_CONDUCTIBLE + +/obj/structure/storage/wall + name = "wall cabinet" + icon_state = "wallcabinet" + density = FALSE + slots = null + storage_space = 10 + max_w_class = ITEM_SIZE_NORMAL + atom_flags = ATOM_FLAG_NO_TEMP_CHANGE + obj_flags = OBJ_FLAG_CONDUCTIBLE + +/obj/structure/storage/table + name = "table drawer" + icon_state = "table_drawer" + slots = null + storage_space = 10 + density = FALSE + max_w_class = ITEM_SIZE_SMALL + obj_flags = OBJ_FLAG_CONDUCTIBLE + var/can_be_placed_on = /obj/structure/table + var/should_be_destroyed = TRUE + +/obj/structure/storage/table/Initialize() + . = ..() + var/obj/A = locate(can_be_placed_on) in loc + if(!istype(A, can_be_placed_on)) + if(should_be_destroyed) + no_place() +// START_PROCESSING(SSprocessing, src) +/* +/obj/structure/storage/table/Process() + . = ..() + visible_message("[src] Нюхает тёрф под собой") + var/obj/A = locate(can_be_placed_on) in loc + visible_message("[src] Нашёл [A]!") + if(!istype(A, can_be_placed_on)) + visible_message("МЫ НЕ МОЖЕМ ПОСТАВИТЬ [src] НА [A]") + if(should_be_destroyed) + visible_message("РАЗЪЁБЫВАЕМ [src]") + no_place() +*/ +/obj/structure/storage/table/proc/no_place() + storage.empty_all() + visible_message("\The [src] breaks down, scattering everything that was inside!") + new /obj/item/stack/material/steel(src.loc) + src.Destroy() + +/obj/structure/storage/table/attackby(obj/item/W, mob/user, click_params) + if(isCrowbar(W) && user.a_intent == I_HURT) + to_chat(user, "You are start to take down \the [src]!") + if(W.in_use) + return + W.in_use = 1 + if(!do_after(user, 30, W)) + W.in_use = 0 + to_chat(user, "You must be still to take down \the [src]!") + return + W.in_use = 0 + no_place() + ..() + +/obj/item/storage/internal/structure/New(newloc, slots, slot_size, storage_space) + storage_slots = slots + max_w_class = slot_size + max_storage_space = storage_space + ..() + +/obj/item/storage/internal/structure/handle_attack_hand(mob/user as mob) + + if(user in range(1, master_item.loc)) + src.add_fingerprint(user) + src.open(user) + return 0 + + for(var/mob/M in range(1, master_item.loc)) + if (M.s_active == src) + src.close(M) + return 1 + +/obj/item/storage/proc/empty_all() + var/turf/T = get_turf(src) + for(var/obj/item/I in contents) + remove_from_storage(I, T, 1) + finish_bulk_removal() diff --git a/mods/_fd/structure_storage/icons/storage.dmi b/mods/_fd/structure_storage/icons/storage.dmi new file mode 100644 index 0000000000000000000000000000000000000000..035e38d62c303941f557d893443600d50e37b7d5 GIT binary patch literal 4965 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 literal 0 HcmV?d00001 From 722979b2881dcb781641ff66890e70767f3a8772 Mon Sep 17 00:00:00 2001 From: VoiceInYourHead Date: Wed, 29 May 2024 13:21:58 +0300 Subject: [PATCH 2/5] Combat stances FIX --- mods/_fd/combat_stances/code/item.dm | 4 +++- mods/_fd/combat_stances/code/weapons.dm | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/mods/_fd/combat_stances/code/item.dm b/mods/_fd/combat_stances/code/item.dm index 76709f7555fe2..cdf7429a3f755 100644 --- a/mods/_fd/combat_stances/code/item.dm +++ b/mods/_fd/combat_stances/code/item.dm @@ -19,7 +19,9 @@ /obj/item/attack_self(mob/living/carbon/user) . = ..() - if(melee_strikes) + var/obj/item/melee/I + + if(melee_strikes && !istype(I, /obj/item/melee/energy/)) swap_stances(user) /obj/item/proc/swap_stances(mob/user) diff --git a/mods/_fd/combat_stances/code/weapons.dm b/mods/_fd/combat_stances/code/weapons.dm index d5d007b11e9a2..93ed7ccd30e7e 100644 --- a/mods/_fd/combat_stances/code/weapons.dm +++ b/mods/_fd/combat_stances/code/weapons.dm @@ -2,6 +2,12 @@ melee_strikes = list(/singleton/combo_strike/swipe_strike/sword_slashes, /singleton/combo_strike/swipe_strike/mixed_combo) lunge_dist = 4 +/obj/item/material/armblade/resolve_attackby(atom/atom, mob/living/user, click_params) + if(!isnull(melee_strike) && !user.skill_check(SKILL_COMBAT, SKILL_EXPERIENCED) && prob(src.fail_chance)) + return 1 + + ..() + /obj/item/material/armblade/claws melee_strikes = list(/singleton/combo_strike/precise_strike/fast_attacks) @@ -18,6 +24,12 @@ fail_chance = 30 lunge_dist = 2 +/obj/item/melee/baton/cattleprod/AltClick(mob/user) + if(melee_strikes) + swap_stances(user) + + ..() + /obj/item/melee/cultblade melee_strikes = list(/singleton/combo_strike/swipe_strike/sword_slashes, /singleton/combo_strike/swipe_strike/mixed_combo) lunge_dist = 3 @@ -26,11 +38,23 @@ melee_strikes = list(/singleton/combo_strike/swipe_strike/sword_slashes, /singleton/combo_strike/swipe_strike/mixed_combo) fail_chance = 40 +/obj/item/melee/energy/sword/AltClick(mob/user) + if(melee_strikes) + swap_stances(user) + + ..() + /obj/item/melee/energy/blade melee_strikes = list(/singleton/combo_strike/swipe_strike/sword_slashes, /singleton/combo_strike/swipe_strike/mixed_combo) fail_chance = 60 lunge_dist = 4 +/obj/item/melee/energy/blade/AltClick(mob/user) + if(melee_strikes) + swap_stances(user) + + ..() + /obj/item/material/harpoon melee_strikes = list(/singleton/combo_strike/swipe_strike/polearm_mixed) From 1c9ef5658111ca7ab950e73b234778a48f88d704 Mon Sep 17 00:00:00 2001 From: Chaplain Maximum Date: Sun, 2 Jun 2024 19:28:00 +0300 Subject: [PATCH 3/5] Adding stuff to Pyro Orb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit В последствии стоит оформить в соответствии с указанным в MOD, но это позже. --- .../machine_construction/frame.dm | 4 +-- code/game/machinery/barrier.dm | 2 +- code/game/machinery/camera/camera.dm | 18 +++++----- code/game/machinery/camera/camera_assembly.dm | 17 +++++----- code/game/machinery/computer/ai_core.dm | 4 +-- code/game/machinery/doors/airlock.dm | 4 +-- code/game/machinery/doors/braces.dm | 21 ++++++------ code/game/machinery/doors/door.dm | 24 ++++++------- code/game/machinery/doors/firedoor.dm | 31 ++++++++--------- .../game/machinery/doors/firedoor_assembly.dm | 2 +- code/game/machinery/floor_light.dm | 2 +- code/game/machinery/nuclear_bomb.dm | 8 ++--- code/game/machinery/self_destruct.dm | 2 +- code/game/objects/items/stacks/rods.dm | 28 +++++++-------- .../objects/items/weapons/material/shards.dm | 8 ++--- .../game/objects/items/weapons/tanks/tanks.dm | 34 +++++++++---------- code/game/objects/structures/catwalk.dm | 2 +- code/game/objects/structures/door_assembly.dm | 8 ++--- 18 files changed, 109 insertions(+), 110 deletions(-) diff --git a/code/game/machinery/_machines_base/machine_construction/frame.dm b/code/game/machinery/_machines_base/machine_construction/frame.dm index 268b709d7194e..f5253eae7faff 100644 --- a/code/game/machinery/_machines_base/machine_construction/frame.dm +++ b/code/game/machinery/_machines_base/machine_construction/frame.dm @@ -20,11 +20,11 @@ machine.anchored = TRUE if(isWelder(I)) var/obj/item/weldingtool/WT = I - if(!WT.can_use(3, user)) + if(!WT.can_use(3, user) && (istype(I, /obj/item/weldingtool))) return TRUE playsound(machine.loc, 'sound/items/Welder.ogg', 50, 1) if(do_after(user, (I.toolspeed * 2) SECONDS, machine, DO_REPAIR_CONSTRUCT)) - if (!WT.remove_fuel(3, user)) + if (!WT.remove_fuel(3, user) && (istype(I, /obj/item/weldingtool))) return TRUE TRANSFER_STATE(/singleton/machine_construction/default/deconstructed) to_chat(user, SPAN_NOTICE("You deconstruct \the [machine].")) diff --git a/code/game/machinery/barrier.dm b/code/game/machinery/barrier.dm index 9b3d83f9ec8c6..9f65060440143 100644 --- a/code/game/machinery/barrier.dm +++ b/code/game/machinery/barrier.dm @@ -43,7 +43,7 @@ return TRUE if (isWelder(I)) var/obj/item/weldingtool/W = I - if (!W.can_use(1, user)) + if (!W.can_use(1, user) && (istype(I, /obj/item/weldingtool))) return TRUE if (!emagged) to_chat(user, SPAN_WARNING("\The [src]'s locking clamps are not damaged.")) diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 21a422ecadfb4..eabbb391d649c 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -378,19 +378,19 @@ return null -/obj/machinery/camera/proc/weld(obj/item/weldingtool/WT, mob/user) +/obj/machinery/camera/proc/weld(obj/item/I, mob/user) if(busy) return 0 - - if(WT.can_use(1, user)) - to_chat(user, SPAN_NOTICE("You start to weld \the [src]..")) + var/obj/item/weldingtool/WT = I + if(!WT.can_use(1, user) && (istype(I, /obj/item/weldingtool))) return TRUE + to_chat(user, SPAN_NOTICE("You start to weld \the [src]..")) + playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) + busy = 1 + if(do_after(user, 10 SECONDS, src, DO_REPAIR_CONSTRUCT) && WT.remove_fuel(1, user)) playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) - busy = 1 - if(do_after(user, 10 SECONDS, src, DO_REPAIR_CONSTRUCT) && WT.remove_fuel(1, user)) - playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) - busy = 0 - return 1 + busy = 0 + return 1 busy = 0 return 0 diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm index 6134ca6841ce2..861adeacba38a 100644 --- a/code/game/machinery/camera/camera_assembly.dm +++ b/code/game/machinery/camera/camera_assembly.dm @@ -152,19 +152,20 @@ if(!anchored) ..() -/obj/item/camera_assembly/proc/weld(obj/item/weldingtool/WT, mob/user) +/obj/item/camera_assembly/proc/weld(obj/item/I, mob/user) if(busy) return 0 - if(WT.can_use(1, user)) - to_chat(user, SPAN_NOTICE("You start to weld \the [src]..")) + var/obj/item/weldingtool/WT = I + if(!WT.can_use(1, user) && (istype(I, /obj/item/weldingtool))) return TRUE + to_chat(user, SPAN_NOTICE("You start to weld \the [src]..")) + playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) + busy = 1 + if(do_after(user, 2 SECONDS, src, DO_REPAIR_CONSTRUCT) && WT.remove_fuel(1, user)) playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) - busy = 1 - if(do_after(user, 2 SECONDS, src, DO_REPAIR_CONSTRUCT) && WT.remove_fuel(1, user)) - playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) - busy = 0 - return 1 + busy = 0 + return 1 busy = 0 return 0 diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm index aba3ba37b95f8..a46b3ccc627bf 100644 --- a/code/game/machinery/computer/ai_core.dm +++ b/code/game/machinery/computer/ai_core.dm @@ -356,7 +356,7 @@ var/global/list/empty_playable_ai_cores = list() USE_FEEDBACK_FAILURE("\The [src] needs to be unanchored from the floor before you can dismantle it with \the [tool].") return TRUE var/obj/item/weldingtool/welder = tool - if (!welder.can_use(1, user, "to deconstruct \the [src]")) + if (!welder.can_use(1, user, "to deconstruct \the [src]") && (istype(tool, /obj/item/weldingtool))) return TRUE user.visible_message( SPAN_NOTICE("\The [user] starst dismantling \the [src] with \a [tool]."), @@ -365,7 +365,7 @@ var/global/list/empty_playable_ai_cores = list() playsound(src, 'sound/items/Welder.ogg', 50, TRUE) if (!user.do_skilled(SKILL_CONSTRUCTION, 2 SECONDS, src, do_flags = DO_REPAIR_CONSTRUCT) || !user.use_sanity_check(src, tool)) return TRUE - if (!welder.remove_fuel(1, user)) + if (!welder.remove_fuel(1, user) && (istype(tool, /obj/item/weldingtool))) return TRUE new /obj/item/stack/material/plasteel(loc, 4) user.visible_message( diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index ecb6656f2f4f1..a9efedf06095f 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -905,7 +905,7 @@ About the new airlock wires panel: if(isWelder(item)) var/obj/item/weldingtool/WT = item - if(!WT.remove_fuel(3,user)) + if(!WT.remove_fuel(3,user) && (istype(item, /obj/item/weldingtool))) return 0 cut_verb = "cutting" cut_sound = 'sound/items/Welder.ogg' @@ -1024,7 +1024,7 @@ About the new airlock wires panel: if (!repairing && isWelder(C) && operating != DOOR_OPERATING_YES && density) var/obj/item/weldingtool/W = C - if(!W.can_use(1, user)) + if(!W.can_use(1, user) && (istype(C, /obj/item/weldingtool))) return TRUE playsound(src, 'sound/items/Welder.ogg', 50, 1) user.visible_message(SPAN_WARNING("\The [user] begins welding \the [src] [welded ? "open" : "closed"]!"), diff --git a/code/game/machinery/doors/braces.dm b/code/game/machinery/doors/braces.dm index 4eca72c9674f7..9433c44f3f4e5 100644 --- a/code/game/machinery/doors/braces.dm +++ b/code/game/machinery/doors/braces.dm @@ -114,19 +114,18 @@ to_chat(user, SPAN_NOTICE("\The [src] does not require repairs.")) return TRUE var/obj/item/weldingtool/welder = item - if (welder.can_use(1, user)) - playsound(src, 'sound/items/Welder.ogg', 100, 1) + if (!welder.can_use(1, user) && (istype(item, /obj/item/weldingtool))) return TRUE + playsound(src, 'sound/items/Welder.ogg', 100, 1) + user.visible_message( + SPAN_ITALIC("\The [user] begins repairing damage on \a [src]."), + SPAN_ITALIC("You begin repairing damage on the [src].") + ) + if (do_after(user, (item.toolspeed * 3) SECONDS, airlock, DO_DEFAULT | DO_USER_UNIQUE_ACT | DO_PUBLIC_PROGRESS) && welder.remove_fuel(1, user)) user.visible_message( - SPAN_ITALIC("\The [user] begins repairing damage on \a [src]."), - SPAN_ITALIC("You begin repairing damage on the [src].") + SPAN_ITALIC("\The [user] repairs damage on \a [src]."), + SPAN_ITALIC("You repair damage on the [src].") ) - if (do_after(user, (item.toolspeed * 3) SECONDS, airlock, DO_DEFAULT | DO_USER_UNIQUE_ACT | DO_PUBLIC_PROGRESS) && welder.remove_fuel(1, user)) - user.visible_message( - SPAN_ITALIC("\The [user] repairs damage on \a [src]."), - SPAN_ITALIC("You repair damage on the [src].") - ) - restore_health(rand(75, 150)) - return TRUE + restore_health(rand(75, 150)) return ..() diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 91d421afdb131..1d3763acf7580 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -227,18 +227,18 @@ return TRUE var/obj/item/weldingtool/welder = I - if(welder.can_use(2, user)) - to_chat(user, SPAN_NOTICE("You start to fix dents and weld \the [repairing] into place.")) - playsound(src, 'sound/items/Welder.ogg', 100, 1) - if(do_after(user, (0.5 * repairing.amount) SECONDS, src, DO_REPAIR_CONSTRUCT) && welder.remove_fuel(2, user)) - if (!repairing) - return TRUE//the materials in the door have been removed before welding was finished. - - to_chat(user, SPAN_NOTICE("You finish repairing the damage to \the [src].")) - restore_health(repairing.amount * DOOR_REPAIR_AMOUNT) - update_icon() - qdel(repairing) - repairing = null + if(!welder.can_use(2, user) && (istype(I, /obj/item/weldingtool))) return TRUE + to_chat(user, SPAN_NOTICE("You start to fix dents and weld \the [repairing] into place.")) + playsound(src, 'sound/items/Welder.ogg', 100, 1) + if(do_after(user, (0.5 * repairing.amount) SECONDS, src, DO_REPAIR_CONSTRUCT) && welder.remove_fuel(2, user)) + if (!repairing) + return TRUE//the materials in the door have been removed before welding was finished. + + to_chat(user, SPAN_NOTICE("You finish repairing the damage to \the [src].")) + restore_health(repairing.amount * DOOR_REPAIR_AMOUNT) + update_icon() + qdel(repairing) + repairing = null return TRUE if(repairing && isCrowbar(I)) diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index eab86cc2e7329..4f5cc9327aa17 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -200,25 +200,24 @@ if(isWelder(C) && !repairing) var/obj/item/weldingtool/W = C - if(W.can_use(2, user)) + if(!W.can_use(2, user) && (istype(C, /obj/item/weldingtool))) return TRUE + user.visible_message( + SPAN_WARNING("\The [user] starts [!blocked ? "welding \the [src] shut" : "cutting open \the [src]"]."), + SPAN_DANGER("You start [!blocked ? "welding \the [src] closed" : "cutting open \the [src]"]."), + SPAN_ITALIC("You hear welding.") + ) + playsound(loc, 'sound/items/Welder.ogg', 50, TRUE) + if(do_after(user, (C.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) + if(!W.remove_fuel(2, user)) + return TRUE + blocked = !blocked user.visible_message( - SPAN_WARNING("\The [user] starts [!blocked ? "welding \the [src] shut" : "cutting open \the [src]"]."), - SPAN_DANGER("You start [!blocked ? "welding \the [src] closed" : "cutting open \the [src]"]."), + SPAN_DANGER("\The [user] [blocked ? "welds \the [src] shut" : "cuts open \the [src]"]."), + SPAN_DANGER("You [blocked ? "weld shut" : "undo the welds on"] \the [src]."), SPAN_ITALIC("You hear welding.") ) - playsound(loc, 'sound/items/Welder.ogg', 50, TRUE) - if(do_after(user, (C.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) - if(!W.remove_fuel(2, user)) - return TRUE - blocked = !blocked - user.visible_message( - SPAN_DANGER("\The [user] [blocked ? "welds \the [src] shut" : "cuts open \the [src]"]."), - SPAN_DANGER("You [blocked ? "weld shut" : "undo the welds on"] \the [src]."), - SPAN_ITALIC("You hear welding.") - ) - playsound(loc, 'sound/items/Welder2.ogg', 50, TRUE) - update_icon() - return TRUE + playsound(loc, 'sound/items/Welder2.ogg', 50, TRUE) + update_icon() if(density && isScrewdriver(C)) hatch_open = !hatch_open diff --git a/code/game/machinery/doors/firedoor_assembly.dm b/code/game/machinery/doors/firedoor_assembly.dm index a0d4dfab35289..1adabcc376f6d 100644 --- a/code/game/machinery/doors/firedoor_assembly.dm +++ b/code/game/machinery/doors/firedoor_assembly.dm @@ -72,7 +72,7 @@ USE_FEEDBACK_FAILURE("\The [src] needs to be unanchored before you can dismantle it.") return TRUE var/obj/item/weldingtool/welder = tool - if (!welder.can_use(1, user, "to dismantle \the [src].")) + if (!welder.can_use(1, user, "to dismantle \the [src].") && (istype(tool, /obj/item/weldingtool))) return TRUE user.visible_message( SPAN_NOTICE("\The [user] starts dismantling \the [src] with \a [tool]."), diff --git a/code/game/machinery/floor_light.dm b/code/game/machinery/floor_light.dm index 56a94de5874d2..58a1687cbb1c5 100644 --- a/code/game/machinery/floor_light.dm +++ b/code/game/machinery/floor_light.dm @@ -48,7 +48,7 @@ var/global/list/floor_light_cache = list() if (isWelder(W) && (health_damaged() || MACHINE_IS_BROKEN(src))) var/obj/item/weldingtool/WT = W - if(!WT.can_use(1, user)) + if(!WT.can_use(1, user) && (istype(W, /obj/item/weldingtool))) return TRUE playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) if(!do_after(user, (W.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) diff --git a/code/game/machinery/nuclear_bomb.dm b/code/game/machinery/nuclear_bomb.dm index ff89950593470..782dab26d6526 100644 --- a/code/game/machinery/nuclear_bomb.dm +++ b/code/game/machinery/nuclear_bomb.dm @@ -84,7 +84,7 @@ var/global/bomb_set if(0) if(isWelder(O)) var/obj/item/weldingtool/WT = O - if(!WT.can_use(5, user)) + if(!WT.can_use(5, user) && (istype(O, /obj/item/weldingtool))) return TRUE user.visible_message( @@ -93,7 +93,7 @@ var/global/bomb_set ) if(do_after(user, (O.toolspeed * 4) SECONDS, src, DO_REPAIR_CONSTRUCT)) - if(!src || !user || !WT.remove_fuel(5, user)) return TRUE + if(!src || !user || (!WT.remove_fuel(5, user) && (istype(O, /obj/item/weldingtool)))) return TRUE user.visible_message( SPAN_NOTICE("\The [user] cuts through the bolt covers on \the [src]."), SPAN_NOTICE("You cut through the bolt covers on \the [src].") @@ -120,7 +120,7 @@ var/global/bomb_set if(2) if(isWelder(O)) var/obj/item/weldingtool/WT = O - if(!WT.can_use(5, user)) + if(!WT.can_use(5, user) && (istype(O, /obj/item/weldingtool))) return TRUE user.visible_message( @@ -129,7 +129,7 @@ var/global/bomb_set ) if(do_after(user, (O.toolspeed * 4) SECONDS, src, DO_REPAIR_CONSTRUCT)) - if(!src || !user || !WT.remove_fuel(5, user)) return TRUE + if(!src || !user || (!WT.remove_fuel(5, user) && (istype(O, /obj/item/weldingtool)))) return TRUE user.visible_message( SPAN_NOTICE("\The [user] cuts apart the anchoring system sealant on \the [src]."), SPAN_NOTICE("You cut apart the anchoring system's sealant.") diff --git a/code/game/machinery/self_destruct.dm b/code/game/machinery/self_destruct.dm index cccbcb79a7499..07ffdebee2f15 100644 --- a/code/game/machinery/self_destruct.dm +++ b/code/game/machinery/self_destruct.dm @@ -12,7 +12,7 @@ /obj/machinery/self_destruct/use_tool(obj/item/W, mob/living/user, list/click_params) if(isWelder(W)) var/obj/item/weldingtool/WT = W - if(damaged && WT.can_use(5, user)) + if(damaged && (WT.can_use(5, user) && (istype(W, /obj/item/weldingtool)) )) user.visible_message( SPAN_NOTICE("\The [user] begins to repair \the [src]."), SPAN_NOTICE("You begin repairing [src].") diff --git a/code/game/objects/items/stacks/rods.dm b/code/game/objects/items/stacks/rods.dm index 1349ceb1c8569..65727d3296ddd 100644 --- a/code/game/objects/items/stacks/rods.dm +++ b/code/game/objects/items/stacks/rods.dm @@ -53,20 +53,20 @@ to_chat(user, SPAN_WARNING("You need at least two rods to do this.")) return TRUE - if(WT.remove_fuel(1,user)) - var/obj/item/stack/material/new_item = material.place_sheet(usr.loc) - new_item.add_to_stacks(usr) - user.visible_message( - SPAN_NOTICE("\The [user] welds \the [src] into \a [material.sheet_singular_name]."), - SPAN_NOTICE("You weld \the [src] into \a [material.sheet_singular_name].") - ) - var/obj/item/stack/material/rods/R = src - src = null - var/replace = (user.get_inactive_hand()==R) - R.use(2) - if (!R && replace) - user.put_in_hands(new_item) - return TRUE + if(!WT.remove_fuel(1,user) && (istype(W, /obj/item/weldingtool))) return TRUE + var/obj/item/stack/material/new_item = material.place_sheet(usr.loc) + new_item.add_to_stacks(usr) + user.visible_message( + SPAN_NOTICE("\The [user] welds \the [src] into \a [material.sheet_singular_name]."), + SPAN_NOTICE("You weld \the [src] into \a [material.sheet_singular_name].") + ) + var/obj/item/stack/material/rods/R = src + src = null + var/replace = (user.get_inactive_hand()==R) + R.use(2) + if (!R && replace) + user.put_in_hands(new_item) + return TRUE return ..() diff --git a/code/game/objects/items/weapons/material/shards.dm b/code/game/objects/items/weapons/material/shards.dm index 27cab3fbd64b3..e63419043bc1b 100644 --- a/code/game/objects/items/weapons/material/shards.dm +++ b/code/game/objects/items/weapons/material/shards.dm @@ -50,10 +50,10 @@ /obj/item/material/shard/attackby(obj/item/W as obj, mob/user as mob) if(isWelder(W) && material.shard_can_repair) var/obj/item/weldingtool/WT = W - if(WT.remove_fuel(1, user)) - material.place_sheet(get_turf(src)) - qdel(src) - return + if(!WT.remove_fuel(1, user) && (istype(W, /obj/item/weldingtool))) return + material.place_sheet(get_turf(src)) + qdel(src) + return return ..() /obj/item/material/shard/Crossed(AM as mob|obj) diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm index 6c46316a95145..7e25d7b68584c 100644 --- a/code/game/objects/items/weapons/tanks/tanks.dm +++ b/code/game/objects/items/weapons/tanks/tanks.dm @@ -210,24 +210,24 @@ var/global/list/tank_gauge_cache = list() if (GET_FLAGS(tank_flags, TANK_FLAG_FORCED)) to_chat(user, SPAN_WARNING("\The [src]'s emergency relief valve must be closed before you can weld it shut!")) return - if(WT.can_use(1,user)) - add_fingerprint(user) - if(!GET_FLAGS(tank_flags, TANK_FLAG_WELDED)) - to_chat(user, SPAN_NOTICE("You begin welding the \the [src] emergency pressure relief valve.")) - if(do_after(user, (W.toolspeed * 4) SECONDS, src, DO_PUBLIC_UNIQUE) && WT.remove_fuel(1, user)) - to_chat(user, "[SPAN_NOTICE("You carefully weld \the [src] emergency pressure relief valve shut.")][SPAN_WARNING(" \The [src] may now rupture under pressure!")]") - SET_FLAGS(tank_flags, TANK_FLAG_WELDED) - CLEAR_FLAGS(tank_flags, TANK_FLAG_LEAKING) - else - GLOB.bombers += "[key_name(user)] attempted to weld a [src]. [air_contents.temperature-T0C]" - log_and_message_admins("attempted to weld a [src]. [air_contents.temperature-T0C]", user) - if(WT.welding) - to_chat(user, SPAN_DANGER("You accidentally rake \the [W] across \the [src]!")) - maxintegrity -= rand(2,6) - integrity = min(integrity,maxintegrity) - air_contents.add_thermal_energy(rand(2000,50000)) + if(!WT.can_use(1,user) && (istype(W, /obj/item/weldingtool))) return + add_fingerprint(user) + if(!GET_FLAGS(tank_flags, TANK_FLAG_WELDED)) + to_chat(user, SPAN_NOTICE("You begin welding the \the [src] emergency pressure relief valve.")) + if(do_after(user, (W.toolspeed * 4) SECONDS, src, DO_PUBLIC_UNIQUE) && (WT.remove_fuel(1, user) && (istype(W, /obj/item/weldingtool)))) + to_chat(user, "[SPAN_NOTICE("You carefully weld \the [src] emergency pressure relief valve shut.")][SPAN_WARNING(" \The [src] may now rupture under pressure!")]") + SET_FLAGS(tank_flags, TANK_FLAG_WELDED) + CLEAR_FLAGS(tank_flags, TANK_FLAG_LEAKING) else - to_chat(user, SPAN_NOTICE("The emergency pressure relief valve has already been welded.")) + GLOB.bombers += "[key_name(user)] attempted to weld a [src]. [air_contents.temperature-T0C]" + log_and_message_admins("attempted to weld a [src]. [air_contents.temperature-T0C]", user) + if(!WT.welding && (istype(W, /obj/item/weldingtool))) return + to_chat(user, SPAN_DANGER("You accidentally rake \the [W] across \the [src]!")) + maxintegrity -= rand(2,6) + integrity = min(integrity,maxintegrity) + air_contents.add_thermal_energy(rand(2000,50000)) + else + to_chat(user, SPAN_NOTICE("The emergency pressure relief valve has already been welded.")) /obj/item/tank/attack_self(mob/user as mob) add_fingerprint(user) diff --git a/code/game/objects/structures/catwalk.dm b/code/game/objects/structures/catwalk.dm index 9b8aee7d392f9..dc3d84431ef37 100644 --- a/code/game/objects/structures/catwalk.dm +++ b/code/game/objects/structures/catwalk.dm @@ -100,7 +100,7 @@ // Welding Tool - Deconstruct if (isWelder(tool)) var/obj/item/weldingtool/welder = tool - if (!welder.remove_fuel(1, user)) + if (!welder.remove_fuel(1, user) && (istype(tool, /obj/item/weldingtool))) return TRUE deconstruct(user) return TRUE diff --git a/code/game/objects/structures/door_assembly.dm b/code/game/objects/structures/door_assembly.dm index 421c4481e3adb..6d899e7062c43 100644 --- a/code/game/objects/structures/door_assembly.dm +++ b/code/game/objects/structures/door_assembly.dm @@ -332,7 +332,7 @@ if (glass) var/glass_noun = istext(glass) ? "[glass] plating" : "glass panel" var/obj/item/weldingtool/welder = tool - if (!welder.can_use(1, user, "to remove \the [src]'s [glass_noun].")) + if (!welder.can_use(1, user, "to remove \the [src]'s [glass_noun].") && (istype(tool, /obj/item/weldingtool))) return TRUE playsound(src, 'sound/items/Welder2.ogg', 50, TRUE) user.visible_message( @@ -344,7 +344,7 @@ if (!glass) USE_FEEDBACK_FAILURE("\The [src]'s state has changed.") return TRUE - if (!welder.remove_fuel(1, user)) + if (!welder.remove_fuel(1, user) && (istype(tool, /obj/item/weldingtool))) return TRUE var/obj/item/stack/material/stack if (istext(glass)) @@ -366,7 +366,7 @@ USE_FEEDBACK_FAILURE("\The [src] must be unanchored before you can dismantle it.") return TRUE var/obj/item/weldingtool/welder = tool - if (!welder.can_use(1, user, "to dismantle \the [src].")) + if (!welder.can_use(1, user, "to dismantle \the [src].") && (istype(tool, /obj/item/weldingtool))) return TRUE playsound(src, 'sound/items/Welder2.ogg', 50, TRUE) user.visible_message( @@ -378,7 +378,7 @@ if (anchored) USE_FEEDBACK_FAILURE("\The [src] must be unanchored before you can dismantle it.") return TRUE - if (!welder.remove_fuel(1, user)) + if (!welder.remove_fuel(1, user) && (istype(tool, /obj/item/weldingtool))) return TRUE var/obj/item/stack/material/steel/stack = new(loc, 4) transfer_fingerprints_to(stack) From ca0f2df29722d4f676b86249cd228283bb16ec52 Mon Sep 17 00:00:00 2001 From: Chaplain Maximum Date: Mon, 3 Jun 2024 21:11:22 +0300 Subject: [PATCH 4/5] Adding stuff to Pyro Orb: Part two --- .../game/objects/items/weapons/tanks/tanks.dm | 3 +- .../crates_lockers/closets/__closet.dm | 4 +- code/game/objects/structures/drain.dm | 2 +- code/game/objects/structures/lattice.dm | 2 +- .../objects/structures/windoor_assembly.dm | 4 +- code/game/objects/structures/window.dm | 2 +- code/game/turfs/simulated/floor_attackby.dm | 33 +++++----- code/game/turfs/simulated/wall_attacks.dm | 4 +- .../components/unary/vent_pump.dm | 4 +- .../components/unary/vent_scrubber.dm | 4 +- code/modules/clothing/spacesuits/breaches.dm | 2 +- code/modules/materials/material_sheets.dm | 3 +- code/modules/mechs/components/_components.dm | 27 ++++---- code/modules/mechs/components/frame.dm | 4 +- code/modules/mechs/mech_wreckage.dm | 2 +- code/modules/mob/living/bot/bot.dm | 2 +- .../modules/mob/living/silicon/robot/robot.dm | 2 +- .../computers/modular_computer/interaction.dm | 2 +- .../overmap/contacts/contact_sensors.dm | 5 +- code/modules/persistence/graffiti.dm | 2 +- code/modules/power/apc.dm | 4 +- code/modules/power/singularity/emitter.dm | 62 ++++++++++--------- .../power/singularity/field_generator.dm | 38 ++++++------ code/modules/power/smes.dm | 2 +- .../recycling/disposal-construction.dm | 2 +- code/modules/recycling/disposal.dm | 29 +++++---- code/modules/recycling/disposalpipe.dm | 6 +- code/modules/recycling/sortingmachinery.dm | 22 +++---- code/modules/surgery/other.dm | 2 +- code/modules/surgery/robotics.dm | 2 +- 30 files changed, 147 insertions(+), 135 deletions(-) diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm index 7e25d7b68584c..191f5f4bc58a9 100644 --- a/code/game/objects/items/weapons/tanks/tanks.dm +++ b/code/game/objects/items/weapons/tanks/tanks.dm @@ -214,7 +214,8 @@ var/global/list/tank_gauge_cache = list() add_fingerprint(user) if(!GET_FLAGS(tank_flags, TANK_FLAG_WELDED)) to_chat(user, SPAN_NOTICE("You begin welding the \the [src] emergency pressure relief valve.")) - if(do_after(user, (W.toolspeed * 4) SECONDS, src, DO_PUBLIC_UNIQUE) && (WT.remove_fuel(1, user) && (istype(W, /obj/item/weldingtool)))) + if(do_after(user, (W.toolspeed * 4) SECONDS, src, DO_PUBLIC_UNIQUE)) + if(!WT.remove_fuel(1, user) && istype(W, /obj/item/weldingtool)) return to_chat(user, "[SPAN_NOTICE("You carefully weld \the [src] emergency pressure relief valve shut.")][SPAN_WARNING(" \The [src] may now rupture under pressure!")]") SET_FLAGS(tank_flags, TANK_FLAG_WELDED) CLEAR_FLAGS(tank_flags, TANK_FLAG_LEAKING) diff --git a/code/game/objects/structures/crates_lockers/closets/__closet.dm b/code/game/objects/structures/crates_lockers/closets/__closet.dm index c89398ebfe9ec..88c2473662003 100644 --- a/code/game/objects/structures/crates_lockers/closets/__closet.dm +++ b/code/game/objects/structures/crates_lockers/closets/__closet.dm @@ -309,7 +309,7 @@ // Welding weapon - Dismantle closet if (isWelder(weapon)) var/obj/item/weldingtool/welder = weapon - if (!welder.remove_fuel(1, user)) + if (!welder.remove_fuel(1, user) && istype(weapon, /obj/item/weldingtool)) return TRUE slice_into_parts(weapon, user) return TRUE @@ -344,7 +344,7 @@ if (!HAS_FLAGS(setup, CLOSET_CAN_BE_WELDED)) USE_FEEDBACK_FAILURE("\The [src] can't be welded shut.") return TRUE - if (!welder.can_use(1, user)) + if (!welder.can_use(1, user) && istype(tool, /obj/item/weldingtool)) return TRUE welded = !welded update_icon() diff --git a/code/game/objects/structures/drain.dm b/code/game/objects/structures/drain.dm index a994317b3c6ea..029e0fbc0c4e5 100644 --- a/code/game/objects/structures/drain.dm +++ b/code/game/objects/structures/drain.dm @@ -16,7 +16,7 @@ // Welding Tool - Weld the drain closed if (isWelder(tool)) var/obj/item/weldingtool/welder = tool - if (!welder.remove_fuel(1, user)) + if (!welder.remove_fuel(1, user) && (istype(tool, /obj/item/weldingtool))) return TRUE welded = !welded user.visible_message( diff --git a/code/game/objects/structures/lattice.dm b/code/game/objects/structures/lattice.dm index a0a5a11c780de..ca134d1826924 100644 --- a/code/game/objects/structures/lattice.dm +++ b/code/game/objects/structures/lattice.dm @@ -81,7 +81,7 @@ // Welder - Deconstruct if (isWelder(tool)) var/obj/item/weldingtool/welder = tool - if (!welder.remove_fuel(1, user)) + if (!welder.remove_fuel(1, user) && (istype(tool, /obj/item/weldingtool))) return TRUE deconstruct(user) return TRUE diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm index 2a8a24ebd0432..57fce7810af99 100644 --- a/code/game/objects/structures/windoor_assembly.dm +++ b/code/game/objects/structures/windoor_assembly.dm @@ -254,7 +254,7 @@ USE_FEEDBACK_FAILURE("\The [src] needs to be unanchored before you can dismantle it.") return TRUE var/obj/item/weldingtool/welder = tool - if (!welder.can_use(1, user, "to dismantle \the [src].")) + if (!welder.can_use(1, user, "to dismantle \the [src].") && (istype(tool, /obj/item/weldingtool))) return TRUE playsound(src, 'sound/items/Welder2.ogg', 50, TRUE) user.visible_message( @@ -269,7 +269,7 @@ if (anchored) USE_FEEDBACK_FAILURE("\The [src] needs to be unanchored before you can dismantle it.") return TRUE - if (!welder.remove_fuel(1, user)) + if (!welder.remove_fuel(1, user) && (istype(tool, /obj/item/weldingtool))) return TRUE var/obj/item/stack/material/glass/reinforced/glass = new(loc, 5) transfer_fingerprints_to(glass) diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 34e48decd8bb3..c4adbd3468302 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -441,7 +441,7 @@ USE_FEEDBACK_FAILURE("\The [src] needs some [get_material_display_name()] applied before you can weld it.") return TRUE var/obj/item/weldingtool/welder = tool - if (!welder.remove_fuel(1, user)) + if (!welder.remove_fuel(1, user) && (istype(tool, /obj/item/weldingtool))) return TRUE restore_health(repair_pending) repair_pending = 0 diff --git a/code/game/turfs/simulated/floor_attackby.dm b/code/game/turfs/simulated/floor_attackby.dm index 385ed1245d277..5452f8fa9dd9c 100644 --- a/code/game/turfs/simulated/floor_attackby.dm +++ b/code/game/turfs/simulated/floor_attackby.dm @@ -165,23 +165,24 @@ else if(isWelder(C)) var/obj/item/weldingtool/welder = C - if(welder.can_use(2, user) && (is_plating())) - if(broken || burnt) - welder.remove_fuel(2, user) - to_chat(user, SPAN_NOTICE("You fix some dents on the broken plating.")) - playsound(src, 'sound/items/Welder.ogg', 80, 1) - icon_state = "plating" - burnt = null - broken = null - return TRUE - else - welder.remove_fuel(2, user) + if((!welder.can_use(2, user) && istype(C, /obj/item/weldingtool)) && (is_plating())) return + if(broken || burnt) + welder.remove_fuel(2, user) + to_chat(user, SPAN_NOTICE("You fix some dents on the broken plating.")) + playsound(src, 'sound/items/Welder.ogg', 80, 1) + icon_state = "plating" + burnt = null + broken = null + return TRUE + else + welder.remove_fuel(2, user) + playsound(src, 'sound/items/Welder.ogg', 80, 1) + visible_message(SPAN_NOTICE("\The [user] has started melting the plating's reinforcements!")) + if(do_after(user, (C.toolspeed * 5) SECONDS, src, DO_REPAIR_CONSTRUCT)) + if(welder.isOn() && welder_melt() && istype(C, /obj/item/weldingtool)) return + visible_message(SPAN_WARNING("\The [user] has melted the plating's reinforcements! It should be possible to pry it off.")) playsound(src, 'sound/items/Welder.ogg', 80, 1) - visible_message(SPAN_NOTICE("\The [user] has started melting the plating's reinforcements!")) - if(do_after(user, (C.toolspeed * 5) SECONDS, src, DO_REPAIR_CONSTRUCT) && welder.isOn() && welder_melt()) - visible_message(SPAN_WARNING("\The [user] has melted the plating's reinforcements! It should be possible to pry it off.")) - playsound(src, 'sound/items/Welder.ogg', 80, 1) - return TRUE + return TRUE else if(istype(C, /obj/item/gun/energy/plasmacutter) && (is_plating()) && !broken && !burnt) var/obj/item/gun/energy/plasmacutter/cutter = C diff --git a/code/game/turfs/simulated/wall_attacks.dm b/code/game/turfs/simulated/wall_attacks.dm index c42e94e3f2001..fc62e0e27a4cc 100644 --- a/code/game/turfs/simulated/wall_attacks.dm +++ b/code/game/turfs/simulated/wall_attacks.dm @@ -153,7 +153,7 @@ if(locate(/obj/overlay/wallrot) in src) if(isWelder(W)) var/obj/item/weldingtool/WT = W - if(!WT.can_use(1, user)) + if(!WT.can_use(1, user) && istype(W, /obj/item/weldingtool)) return TRUE WT.remove_fuel(1,user) @@ -172,7 +172,7 @@ if(thermite) if(isWelder(W)) var/obj/item/weldingtool/WT = W - if(!WT.can_use(1, user)) + if(!WT.can_use(1, user) && istype(W, /obj/item/weldingtool)) return TRUE WT.remove_fuel(1, user) thermitemelt(user) diff --git a/code/modules/atmospherics/components/unary/vent_pump.dm b/code/modules/atmospherics/components/unary/vent_pump.dm index ebab8d4ca57f3..5a0aa58580abc 100644 --- a/code/modules/atmospherics/components/unary/vent_pump.dm +++ b/code/modules/atmospherics/components/unary/vent_pump.dm @@ -306,7 +306,7 @@ if (isWelder(W)) var/obj/item/weldingtool/WT = W - if(!WT.can_use(1,user)) + if(!WT.can_use(1,user) && istype(W, /obj/item/weldingtool)) return TRUE to_chat(user, SPAN_NOTICE("Now welding \the [src].")) @@ -315,7 +315,7 @@ if(!do_after(user, (W.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) return TRUE - if(!src || !WT.remove_fuel(1, user)) + if(!src || (!WT.remove_fuel(1, user) && istype(W, /obj/item/weldingtool))) return TRUE welded = !welded diff --git a/code/modules/atmospherics/components/unary/vent_scrubber.dm b/code/modules/atmospherics/components/unary/vent_scrubber.dm index b551fe791ea4b..979507880fcc5 100644 --- a/code/modules/atmospherics/components/unary/vent_scrubber.dm +++ b/code/modules/atmospherics/components/unary/vent_scrubber.dm @@ -208,7 +208,7 @@ var/obj/item/weldingtool/WT = W - if(!WT.can_use(1,user)) + if(!WT.can_use(1,user) && istype(W, /obj/item/weldingtool)) return TRUE to_chat(user, SPAN_NOTICE("Now welding \the [src].")) @@ -217,7 +217,7 @@ if(!do_after(user, (W.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) return TRUE - if(!src || !WT.remove_fuel(1, user)) + if(!src || (!WT.remove_fuel(1, user) && istype(W, /obj/item/weldingtool))) return TRUE welded = !welded diff --git a/code/modules/clothing/spacesuits/breaches.dm b/code/modules/clothing/spacesuits/breaches.dm index 9650607935e5a..db53f691c20e4 100644 --- a/code/modules/clothing/spacesuits/breaches.dm +++ b/code/modules/clothing/spacesuits/breaches.dm @@ -223,7 +223,7 @@ return var/obj/item/weldingtool/WT = W - if(!WT.remove_fuel(5)) + if(!WT.remove_fuel(5) && istype(W, /obj/item/weldingtool)) return repair_breaches(DAMAGE_BRUTE, 3, user) diff --git a/code/modules/materials/material_sheets.dm b/code/modules/materials/material_sheets.dm index f1d96d7ddd9d0..e7baeea70bf33 100644 --- a/code/modules/materials/material_sheets.dm +++ b/code/modules/materials/material_sheets.dm @@ -166,7 +166,8 @@ if(reinf_material && reinf_material.stack_type && isWelder(W)) var/obj/item/weldingtool/WT = W - if(WT.remove_fuel(2, user) && use(2)) + if(use(2)) + if(istype(W, /obj/item/weldingtool) && !WT.remove_fuel(2, user)) return to_chat(user,SPAN_NOTICE("You recover some [reinf_material.use_name] from \the [src].")) reinf_material.place_sheet(get_turf(user), 1) return TRUE diff --git a/code/modules/mechs/components/_components.dm b/code/modules/mechs/components/_components.dm index 46e21a94e2602..c99b054c564b8 100644 --- a/code/modules/mechs/components/_components.dm +++ b/code/modules/mechs/components/_components.dm @@ -129,25 +129,26 @@ /obj/item/mech_component/proc/update_components() return -/obj/item/mech_component/proc/repair_brute_generic(obj/item/weldingtool/WT, mob/user) - if(!istype(WT)) +/obj/item/mech_component/proc/repair_brute_generic(obj/item/W, mob/user) + var/obj/item/weldingtool/WT = W + if(!IsWelder(W)) return if(!brute_damage) to_chat(user, SPAN_NOTICE("You inspect \the [src] but find nothing to weld.")) return - if(!WT.isOn()) + if(istype(W, /obj/item/weldingtool) && !WT.isOn()) to_chat(user, SPAN_WARNING("Turn \the [WT] on, first.")) return - if(WT.can_use((SKILL_MAX + 1) - user.get_skill_value(SKILL_CONSTRUCTION), user)) - user.visible_message( - SPAN_NOTICE("\The [user] begins welding the damage on \the [src]..."), - SPAN_NOTICE("You begin welding the damage on \the [src]...") - ) - var/repair_value = 10 * max(user.get_skill_value(SKILL_CONSTRUCTION), user.get_skill_value(SKILL_DEVICES)) - if(user.do_skilled(1 SECOND, SKILL_DEVICES , src, 0.6) && brute_damage && WT.remove_fuel((SKILL_MAX + 1) - user.get_skill_value(SKILL_CONSTRUCTION), user)) - repair_brute_damage(repair_value) - to_chat(user, SPAN_NOTICE("You mend the damage to \the [src].")) - playsound(user.loc, 'sound/items/Welder.ogg', 25, 1) + if(istype(W, /obj/item/weldingtool) && !WT.can_use((SKILL_MAX + 1) - user.get_skill_value(SKILL_CONSTRUCTION), user)) return + user.visible_message( + SPAN_NOTICE("\The [user] begins welding the damage on \the [src]..."), + SPAN_NOTICE("You begin welding the damage on \the [src]...") + ) + var/repair_value = 10 * max(user.get_skill_value(SKILL_CONSTRUCTION), user.get_skill_value(SKILL_DEVICES)) + if(user.do_skilled(1 SECOND, SKILL_DEVICES , src, 0.6) && brute_damage && WT.remove_fuel((SKILL_MAX + 1) - user.get_skill_value(SKILL_CONSTRUCTION), user)) + repair_brute_damage(repair_value) + to_chat(user, SPAN_NOTICE("You mend the damage to \the [src].")) + playsound(user.loc, 'sound/items/Welder.ogg', 25, 1) /obj/item/mech_component/proc/repair_burn_generic(obj/item/stack/cable_coil/CC, mob/user) if(!istype(CC)) diff --git a/code/modules/mechs/components/frame.dm b/code/modules/mechs/components/frame.dm index 1c760653d82cf..cc2147a620bc0 100644 --- a/code/modules/mechs/components/frame.dm +++ b/code/modules/mechs/components/frame.dm @@ -250,7 +250,7 @@ USE_FEEDBACK_FAILURE("\The [src]'s reinforcements need to be secured before you can weld them.") return TRUE var/obj/item/weldingtool/welder = tool - if (!welder.can_use(1, user, "to weld \the [src]'s internal reinforcements")) + if (istype(tool, /obj/item/weldingtool) && !welder.can_use(1, user, "to weld \the [src]'s internal reinforcements")) return TRUE var/current_state = is_reinforced playsound(src, 'sound/items/Welder.ogg', 50, TRUE) @@ -270,7 +270,7 @@ if (current_state != is_reinforced) USE_FEEDBACK_FAILURE("\The [src]'s state has changed.") return TRUE - if (!welder.remove_fuel(1, user)) + if (istype(tool, /obj/item/weldingtool) && !welder.remove_fuel(1, user)) return TRUE is_reinforced = is_reinforced == FRAME_REINFORCED_WELDED ? FRAME_REINFORCED_SECURE : FRAME_REINFORCED_WELDED update_icon() diff --git a/code/modules/mechs/mech_wreckage.dm b/code/modules/mechs/mech_wreckage.dm index 650d9f64e34b8..beebac88492cf 100644 --- a/code/modules/mechs/mech_wreckage.dm +++ b/code/modules/mechs/mech_wreckage.dm @@ -60,7 +60,7 @@ return TRUE if (isWelder(tool)) var/obj/item/weldingtool/welder = tool - if (!welder.remove_fuel(1, user)) + if (istype(tool, /obj/item/weldingtool) && !welder.remove_fuel(1, user)) return TRUE else if (istype(tool, /obj/item/gun/energy/plasmacutter)) var/obj/item/gun/energy/plasmacutter/plasmacutter = tool diff --git a/code/modules/mob/living/bot/bot.dm b/code/modules/mob/living/bot/bot.dm index e5cd3e03dfce4..f0ee618365c47 100644 --- a/code/modules/mob/living/bot/bot.dm +++ b/code/modules/mob/living/bot/bot.dm @@ -132,7 +132,7 @@ USE_FEEDBACK_FAILURE("\The [src]'s access panel must be open to repair it.") return TRUE var/obj/item/weldingtool/welder = tool - if (!welder.can_use(5, user, "to repair \the [src].")) + if (istype(tool, /obj/item/weldingtool) && !welder.can_use(5, user, "to repair \the [src].")) return TRUE welder.remove_fuel(5, user) health = min(maxHealth, health + 10) diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index b416caf8282ba..65fa8a0560a26 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -797,7 +797,7 @@ USE_FEEDBACK_FAILURE("\The [src] has no physical damage to repair.") return TRUE var/obj/item/weldingtool/welder = tool - if (!welder.can_use(1, user, "to repair \the [src]'s physical damage.")) + if (istype(tool, /obj/item/weldingtool) && !welder.can_use(1, user, "to repair \the [src]'s physical damage.")) return TRUE playsound(src, 'sound/items/Welder.ogg', 50, TRUE) user.visible_message( diff --git a/code/modules/modular_computers/computers/modular_computer/interaction.dm b/code/modules/modular_computers/computers/modular_computer/interaction.dm index 3002f4171e5a6..b3878acf7a71a 100644 --- a/code/modules/modular_computers/computers/modular_computer/interaction.dm +++ b/code/modules/modular_computers/computers/modular_computer/interaction.dm @@ -169,7 +169,7 @@ if(isWelder(W)) var/obj/item/weldingtool/WT = W var/damage = get_damage_value() - if(!WT.can_use(round(damage/75), user)) + if(istype(W, /obj/item/weldingtool) && !WT.can_use(round(damage/75), user)) return if(!get_damage_value()) diff --git a/code/modules/overmap/contacts/contact_sensors.dm b/code/modules/overmap/contacts/contact_sensors.dm index c9019eb19433c..34cee51939136 100644 --- a/code/modules/overmap/contacts/contact_sensors.dm +++ b/code/modules/overmap/contacts/contact_sensors.dm @@ -216,11 +216,12 @@ if (!damage) to_chat(user, SPAN_WARNING("\The [src] doesn't need any repairs.")) return TRUE - if (!WT.can_use(1, user)) + if (istype(tool, /obj/item/weldingtool) && !WT.can_use(1, user)) return TRUE to_chat(user, SPAN_NOTICE("You start repairing the damage to [src].")) playsound(src, 'sound/items/Welder.ogg', 100, 1) - if (do_after(user, max(5, damage / 5), src, DO_REPAIR_CONSTRUCT) && WT.remove_fuel(1, user)) + if (do_after(user, max(5, damage / 5), src, DO_REPAIR_CONSTRUCT)) + if(istype(tool, /obj/item/weldingtool) && !WT.remove_fuel(1, user)) return to_chat(user, SPAN_NOTICE("You finish repairing the damage to [src].")) revive_health() return TRUE diff --git a/code/modules/persistence/graffiti.dm b/code/modules/persistence/graffiti.dm index 7c247b4a21432..b0de9186903b5 100644 --- a/code/modules/persistence/graffiti.dm +++ b/code/modules/persistence/graffiti.dm @@ -49,7 +49,7 @@ // Welding Torch - Remove decal if (isWelder(tool)) var/obj/item/weldingtool/welder = tool - if (!welder.can_use(1, user, "to remove \the [src].")) + if (istype(tool, /obj/item/weldingtool) && !welder.can_use(1, user, "to remove \the [src].")) return TRUE playsound(src, 'sound/items/Welder2.ogg', 50, TRUE) user.visible_message( diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 6f6c6952c3647..97a961a32ceff 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -555,14 +555,14 @@ to_chat(user, SPAN_WARNING("The wire connection is in the way.")) return TRUE var/obj/item/weldingtool/WT = W - if (!WT.can_use(3, user)) + if (istype(W, /obj/item/weldingtool) && !WT.can_use(3, user)) return TRUE user.visible_message(SPAN_WARNING("\The [user] begins to weld \the [src]."), \ "You start welding the APC frame...", \ "You hear welding.") playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) if(do_after(user, (W.toolspeed * 5) SECONDS, src, DO_REPAIR_CONSTRUCT) && opened && has_electronics == 0 && !terminal()) - if(!WT.remove_fuel(3, user)) + if(istype(W, /obj/item/weldingtool) && !WT.remove_fuel(3, user)) return TRUE if (emagged || MACHINE_IS_BROKEN(src) || opened==2) new /obj/item/stack/material/steel(loc) diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm index 283348f893548..d7f727f3e33f5 100644 --- a/code/modules/power/singularity/emitter.dm +++ b/code/modules/power/singularity/emitter.dm @@ -213,43 +213,45 @@ if (EMITTER_LOOSE) to_chat(user, SPAN_WARNING("\The [src] needs to be wrenched to the floor.")) if (EMITTER_WRENCHED) - if (WT.can_use(1, user)) - playsound(loc, 'sound/items/Welder.ogg', 50, TRUE) + if (istype(W, /obj/item/weldingtool) && !WT.can_use(1, user)) + return TRUE + playsound(loc, 'sound/items/Welder.ogg', 50, TRUE) + user.visible_message( + SPAN_NOTICE("\The [user] starts to weld \the [src] to the floor."), + SPAN_NOTICE("You start to weld \the [src] to the floor."), + SPAN_ITALIC("You hear welding.") + ) + if (do_after(user, (W.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) + if (istype(W, /obj/item/weldingtool) && !WT.remove_fuel(1, user)) + return TRUE + state = EMITTER_WELDED + playsound(loc, 'sound/items/Welder2.ogg', 50, TRUE) user.visible_message( - SPAN_NOTICE("\The [user] starts to weld \the [src] to the floor."), - SPAN_NOTICE("You start to weld \the [src] to the floor."), + SPAN_NOTICE("\The [user] welds \the [src] to the floor."), + SPAN_NOTICE("You weld the base of \the [src] to the floor, securing it in place."), SPAN_ITALIC("You hear welding.") ) - if (do_after(user, (W.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) - if (!WT.remove_fuel(1, user)) - return TRUE - state = EMITTER_WELDED - playsound(loc, 'sound/items/Welder2.ogg', 50, TRUE) - user.visible_message( - SPAN_NOTICE("\The [user] welds \the [src] to the floor."), - SPAN_NOTICE("You weld the base of \the [src] to the floor, securing it in place."), - SPAN_ITALIC("You hear welding.") - ) - connect_to_network() + connect_to_network() if (EMITTER_WELDED) - if (WT.can_use(1, user)) - playsound(loc, 'sound/items/Welder.ogg', 50, TRUE) + if (istype(W, /obj/item/weldingtool) && !WT.can_use(1, user)) + return TRUE + playsound(loc, 'sound/items/Welder.ogg', 50, TRUE) + user.visible_message( + SPAN_NOTICE("\The [user] starts to cut \the [src] free from the floor."), + SPAN_NOTICE("You start to cut \the [src] free from the floor."), + SPAN_ITALIC("You hear welding.") + ) + if (do_after(user, (W.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) + if (istype(W, /obj/item/weldingtool) && !WT.remove_fuel(1, user)) + return TRUE + state = EMITTER_WRENCHED + playsound(loc, 'sound/items/Welder2.ogg', 50, TRUE) user.visible_message( - SPAN_NOTICE("\The [user] starts to cut \the [src] free from the floor."), - SPAN_NOTICE("You start to cut \the [src] free from the floor."), + SPAN_NOTICE("\The [user] cuts \the [src] free from the floor."), + SPAN_NOTICE("You cut \the [src] free from the floor."), SPAN_ITALIC("You hear welding.") ) - if (do_after(user, (W.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) - if (!WT.remove_fuel(1, user)) - return TRUE - state = EMITTER_WRENCHED - playsound(loc, 'sound/items/Welder2.ogg', 50, TRUE) - user.visible_message( - SPAN_NOTICE("\The [user] cuts \the [src] free from the floor."), - SPAN_NOTICE("You cut \the [src] free from the floor."), - SPAN_ITALIC("You hear welding.") - ) - disconnect_from_network() + disconnect_from_network() return TRUE if (istype(W, /obj/item/card/id) || istype(W, /obj/item/modular_computer)) diff --git a/code/modules/power/singularity/field_generator.dm b/code/modules/power/singularity/field_generator.dm index 41d7c5223a950..2a63598f55d08 100644 --- a/code/modules/power/singularity/field_generator.dm +++ b/code/modules/power/singularity/field_generator.dm @@ -124,26 +124,28 @@ field_generator power level display to_chat(user, SPAN_WARNING("The [src.name] needs to be wrenched to the floor.")) return TRUE if(1) - if (WT.can_use(1,user)) - playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1) - user.visible_message("[user.name] starts to weld the [src.name] to the floor.", \ - "You start to weld the [src] to the floor.", \ - "You hear welding") - if (do_after(user, (W.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) - if(!src || !WT.remove_fuel(1, user)) return TRUE - state = 2 - to_chat(user, "You weld the field generator to the floor.") + if (istype(W, /obj/item/weldingtool) && !WT.can_use(1,user)) + return TRUE + playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1) + user.visible_message("[user.name] starts to weld the [src.name] to the floor.", \ + "You start to weld the [src] to the floor.", \ + "You hear welding") + if (do_after(user, (W.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) + if(!src || (istype(W, /obj/item/weldingtool) && !WT.remove_fuel(1, user))) return TRUE + state = 2 + to_chat(user, "You weld the field generator to the floor.") return TRUE if(2) - if (WT.can_use(1,user)) - playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1) - user.visible_message("[user.name] starts to cut the [src.name] free from the floor.", \ - "You start to cut the [src] free from the floor.", \ - "You hear welding") - if (do_after(user, (W.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) - if(!src || !WT.remove_fuel(1, user)) return TRUE - state = 1 - to_chat(user, "You cut the [src] free from the floor.") + if (istype(W, /obj/item/weldingtool) && !WT.can_use(1,user)) + return TRUE + playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1) + user.visible_message("[user.name] starts to cut the [src.name] free from the floor.", \ + "You start to cut the [src] free from the floor.", \ + "You hear welding") + if (do_after(user, (W.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) + if(!src || (istype(W, /obj/item/weldingtool) && !WT.remove_fuel(1, user))) return TRUE + state = 1 + to_chat(user, "You cut the [src] free from the floor.") return TRUE return ..() diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm index a29b73f876c9b..c901e70bb8392 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -251,7 +251,7 @@ if(isWelder(W)) var/obj/item/weldingtool/WT = W - if(!WT.can_use(5, user)) + if(istype(W, /obj/item/weldingtool) && !WT.can_use(5, user)) return TRUE if(!damage) to_chat(user, "\The [src] is already fully repaired.") diff --git a/code/modules/recycling/disposal-construction.dm b/code/modules/recycling/disposal-construction.dm index 39ad646424aa1..b19a35495b34d 100644 --- a/code/modules/recycling/disposal-construction.dm +++ b/code/modules/recycling/disposal-construction.dm @@ -163,7 +163,7 @@ USE_FEEDBACK_FAILURE("\The [src] needs to be anchored to the floor before you can weld it.") return TRUE var/obj/item/weldingtool/welder = tool - if (!welder.can_use(1, user, "to weld \the [src] down.")) + if (istype(tool, /obj/item/weldingtool) && !welder.can_use(1, user, "to weld \the [src] down.")) return TRUE playsound(src, 'sound/items/Welder2.ogg', 50, TRUE) user.visible_message( diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index fd7ce6915d233..7ced320219f89 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -106,17 +106,18 @@ GLOBAL_LIST_EMPTY(diversion_junctions) to_chat(user, "Eject the items first!") return TRUE var/obj/item/weldingtool/W = I - if(W.can_use(1,user)) - playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1) - to_chat(user, "You start slicing the floorweld off the disposal unit.") - - if(do_after(user, (I.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) - if(!src || !W.remove_fuel(1, user)) return - to_chat(user, "You sliced the floorweld off the disposal unit.") - var/obj/structure/disposalconstruct/machine/C = new (loc, src) - src.transfer_fingerprints_to(C) - C.update() - qdel(src) + if(istype(I, /obj/item/weldingtool) && !W.can_use(1,user)) + return + playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1) + to_chat(user, "You start slicing the floorweld off the disposal unit.") + + if(do_after(user, (I.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) + if(!src || (istype(I, /obj/item/weldingtool) && !W.remove_fuel(1, user))) return + to_chat(user, "You sliced the floorweld off the disposal unit.") + var/obj/structure/disposalconstruct/machine/C = new (loc, src) + src.transfer_fingerprints_to(C) + C.update() + qdel(src) return TRUE else to_chat(user, "You need more welding fuel to complete this task.") @@ -653,7 +654,7 @@ GLOBAL_LIST_EMPTY(diversion_junctions) USE_FEEDBACK_FAILURE("\The [src]'s power connection needs to be disconnected before you can remove \the [src] from the floor.") return TRUE var/obj/item/weldingtool/welder = tool - if (!welder.can_use(1, user, "to slice \the [src]'s floorweld.")) + if (istype(tool, /obj/item/weldingtool) && !welder.can_use(1, user, "to slice \the [src]'s floorweld.")) return TRUE playsound(src, 'sound/items/Welder2.ogg', 50, TRUE) user.visible_message( @@ -661,7 +662,9 @@ GLOBAL_LIST_EMPTY(diversion_junctions) SPAN_NOTICE("You start slicing \the [src]'s floorweld with \the [tool]."), SPAN_ITALIC("You hear the sound of welding.") ) - if (!user.do_skilled((tool.toolspeed * 2) SECONDS, SKILL_CONSTRUCTION, src, do_flags = DO_REPAIR_CONSTRUCT) || !user.use_sanity_check(src, tool) || !welder.remove_fuel(1, user)) + if (!user.do_skilled((tool.toolspeed * 2) SECONDS, SKILL_CONSTRUCTION, src, do_flags = DO_REPAIR_CONSTRUCT) || !user.use_sanity_check(src, tool)) + return TRUE + if(istype(tool, /obj/item/weldingtool) && !welder.remove_fuel(1,user)) return TRUE playsound(src, 'sound/items/Welder2.ogg', 50, TRUE) user.visible_message( diff --git a/code/modules/recycling/disposalpipe.dm b/code/modules/recycling/disposalpipe.dm index 1b507a75b7846..a527963298720 100644 --- a/code/modules/recycling/disposalpipe.dm +++ b/code/modules/recycling/disposalpipe.dm @@ -228,14 +228,16 @@ // Welding Tool - Cut pipe if (isWelder(tool)) var/obj/item/weldingtool/welder = tool - if (!welder.can_use(1, user, "to slice \the [src].")) + if (istype(tool, /obj/item/weldingtool) && !welder.can_use(1, user, "to slice \the [src].")) return TRUE playsound(src, 'sound/items/Welder2.ogg', 50, TRUE) user.visible_message( SPAN_NOTICE("\The [user] starts slicing \the [src] with \a [tool]."), SPAN_NOTICE("You start slicing \the [src] with \the [tool].") ) - if (!user.do_skilled((tool.toolspeed * 3) SECONDS, SKILL_CONSTRUCTION, src, do_flags = DO_REPAIR_CONSTRUCT) || !user.use_sanity_check(src, tool) || !welder.remove_fuel(1, user)) + if (!user.do_skilled((tool.toolspeed * 3) SECONDS, SKILL_CONSTRUCTION, src, do_flags = DO_REPAIR_CONSTRUCT) || !user.use_sanity_check(src, tool)) + return TRUE + if(istype(tool, /obj/item/weldingtool) && !welder.remove_fuel(1,user)) return TRUE welded() user.visible_message( diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index eb286cf4c8571..fc9173ae5c75e 100644 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -606,20 +606,18 @@ return TRUE if (isWelder(I) && c_mode==1) var/obj/item/weldingtool/W = I - if(W.can_use(1,user)) - to_chat(user, "You start slicing the floorweld off the delivery chute.") - if(do_after(user, (I.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) - playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1) - if(!src || !W.remove_fuel(1, user)) return - to_chat(user, "You sliced the floorweld off the delivery chute.") - var/obj/structure/disposalconstruct/C = new (loc, src) - C.update() - qdel(src) - return TRUE - else + if(istype(W, /obj/item/weldingtool) && !W.can_use(1,user)) to_chat(user, "You need more welding fuel to complete this task.") return TRUE - + to_chat(user, "You start slicing the floorweld off the delivery chute.") + if(do_after(user, (I.toolspeed * 2) SECONDS, src, DO_REPAIR_CONSTRUCT)) + playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1) + if(!src || !W.remove_fuel(1, user)) return + to_chat(user, "You sliced the floorweld off the delivery chute.") + var/obj/structure/disposalconstruct/C = new (loc, src) + C.update() + qdel(src) + return TRUE return ..() /obj/machinery/disposal/deliveryChute/Destroy() diff --git a/code/modules/surgery/other.dm b/code/modules/surgery/other.dm index 6580ddc3a9f51..afc2d6e985f85 100644 --- a/code/modules/surgery/other.dm +++ b/code/modules/surgery/other.dm @@ -122,7 +122,7 @@ return FALSE if(isWelder(tool)) var/obj/item/weldingtool/welder = tool - if(!welder.remove_fuel(1,user)) + if(istype(tool, /obj/item/weldingtool) && !welder.remove_fuel(1,user)) return FALSE return (target_zone == BP_CHEST) && istype(target.back, /obj/item/rig) && !(target.back.canremove) diff --git a/code/modules/surgery/robotics.dm b/code/modules/surgery/robotics.dm index cb420de843231..5e08e82f55e62 100644 --- a/code/modules/surgery/robotics.dm +++ b/code/modules/surgery/robotics.dm @@ -215,7 +215,7 @@ return FALSE if(isWelder(tool)) var/obj/item/weldingtool/welder = tool - if(!welder.remove_fuel(1,user)) + if(istype(tool, /obj/item/weldingtool) && !welder.remove_fuel(1,user)) return FALSE if(istype(tool, /obj/item/gun/energy/plasmacutter)) var/obj/item/gun/energy/plasmacutter/cutter = tool From 6493e41558990264c4809d9e00db82dfe907a28d Mon Sep 17 00:00:00 2001 From: Chaplain Maximum Date: Mon, 3 Jun 2024 21:59:38 +0300 Subject: [PATCH 5/5] Adding stuff to Pyro Orb: Part 3 --- code/modules/tables/tables.dm | 4 +- code/modules/xenoarcheaology/finds/finds.dm | 19 +++++----- maps/sierra/structures/other.dm | 20 +++++----- mods/_fd/hestia_missiles/code/missile.dm | 7 ++-- mods/_fd/hestia_missiles/code/missile_old.dm | 7 ++-- .../hestia_missiles/code/presets/breacher.dm | 7 ++-- .../code/atmospheric_retention_field.dm | 4 +- mods/machinery/code/gravity_generator/base.dm | 2 +- .../projectile/guns/energy/laser_handmade.dm | 4 +- packs/infinity/structures/barrier.dm | 38 +++++++++---------- 10 files changed, 58 insertions(+), 54 deletions(-) diff --git a/code/modules/tables/tables.dm b/code/modules/tables/tables.dm index 872d71bf06306..3695f649cde5f 100644 --- a/code/modules/tables/tables.dm +++ b/code/modules/tables/tables.dm @@ -154,14 +154,14 @@ USE_FEEDBACK_FAILURE("\The [src] isn't damaged.") return TRUE var/obj/item/weldingtool/welder = weapon - if (!welder.can_use(1, user, "to repair \the [src]")) + if (istype(weapon, /obj/item/weldingtool) && !welder.can_use(1, user, "to repair \the [src]")) return TRUE playsound(src, 'sound/items/Welder.ogg', 50, TRUE) user.visible_message( SPAN_NOTICE("\The [user] starts repairing \the [src] with \a [weapon]."), SPAN_NOTICE("You start repairing \the [src] with \the [weapon].") ) - if (!user.do_skilled((weapon.toolspeed * 2) SECONDS, SKILL_CONSTRUCTION, src, do_flags = DO_REPAIR_CONSTRUCT) || !user.use_sanity_check(src, weapon) || !welder.remove_fuel(1)) + if (!user.do_skilled((weapon.toolspeed * 2) SECONDS, SKILL_CONSTRUCTION, src, do_flags = DO_REPAIR_CONSTRUCT) || !user.use_sanity_check(src, weapon) || (istype(weapon, /obj/item/weldingtool) && !welder.remove_fuel(1))) return TRUE playsound(src, 'sound/items/Welder.ogg', 50, TRUE) restore_health(get_max_health() / 5) // 20% repair per application diff --git a/code/modules/xenoarcheaology/finds/finds.dm b/code/modules/xenoarcheaology/finds/finds.dm index cf3a3616e3be9..2089ea3424f4a 100644 --- a/code/modules/xenoarcheaology/finds/finds.dm +++ b/code/modules/xenoarcheaology/finds/finds.dm @@ -41,19 +41,20 @@ if(isWelder(I)) var/obj/item/weldingtool/W = I - if(W.can_use(2, user)) - var/obj/item/inside = locate() in src - if(inside) - inside.dropInto(loc) - visible_message(SPAN_INFO("\The [src] burns away revealing \the [inside].")) - else - visible_message(SPAN_INFO("\The [src] burns away into nothing.")) - qdel(src) - W.remove_fuel(2, user) + if(istype(I, /obj/item/weldingtool) && !W.can_use(2, user)) + return else if (W.can_use(1, user, silent = TRUE)) visible_message(SPAN_INFO("A few sparks fly off \the [src], but nothing else happens.")) W.remove_fuel(1) return + var/obj/item/inside = locate() in src + if(inside) + inside.dropInto(loc) + visible_message(SPAN_INFO("\The [src] burns away revealing \the [inside].")) + else + visible_message(SPAN_INFO("\The [src] burns away into nothing.")) + qdel(src) + W.remove_fuel(2, user) else if(istype(I, /obj/item/device/core_sampler)) var/obj/item/device/core_sampler/S = I diff --git a/maps/sierra/structures/other.dm b/maps/sierra/structures/other.dm index d78c4e9f0f0df..e085e8dcd98dd 100644 --- a/maps/sierra/structures/other.dm +++ b/maps/sierra/structures/other.dm @@ -25,16 +25,16 @@ /obj/item/target/use_tool(obj/item/tool, mob/living/user, list/click_params) if (isWelder(tool)) var/obj/item/weldingtool/welder = tool - if (welder.remove_fuel(0, user)) - ClearOverlays() - bulletholes.Cut() - hp = initial(hp) - user.visible_message( - SPAN_NOTICE("[user] slices off uneven chunks of aluminium and scorch marks from [src]."), - SPAN_NOTICE("You slice off uneven chunks of aluminium and scorch marks from [src]."), - SPAN_NOTICE("You hear welding."), - ) - return TRUE + if (istype(tool, /obj/item/weldingtool) && !welder.remove_fuel(0, user)) + return TRUE + ClearOverlays() + bulletholes.Cut() + hp = initial(hp) + user.visible_message( + SPAN_NOTICE("[user] slices off uneven chunks of aluminium and scorch marks from [src]."), + SPAN_NOTICE("You slice off uneven chunks of aluminium and scorch marks from [src]."), + SPAN_NOTICE("You hear welding."), + ) return ..() /obj/item/target/syndicate diff --git a/mods/_fd/hestia_missiles/code/missile.dm b/mods/_fd/hestia_missiles/code/missile.dm index 0c6c49360b581..eea72136e67d1 100644 --- a/mods/_fd/hestia_missiles/code/missile.dm +++ b/mods/_fd/hestia_missiles/code/missile.dm @@ -198,9 +198,10 @@ if(isWelder(I)) var/obj/item/weldingtool/WT = I - if(WT.remove_fuel(0, user)) - damage = 20 - playsound(loc, 'sound/items/Welder.ogg', 100, 1) + if(istype(I, /obj/item/weldingtool) && !WT.remove_fuel(0, user)) + return + damage = 20 + playsound(loc, 'sound/items/Welder.ogg', 100, 1) if(damage <= 2) return diff --git a/mods/_fd/hestia_missiles/code/missile_old.dm b/mods/_fd/hestia_missiles/code/missile_old.dm index e14adb3b6b08d..40cea76c353c3 100644 --- a/mods/_fd/hestia_missiles/code/missile_old.dm +++ b/mods/_fd/hestia_missiles/code/missile_old.dm @@ -67,9 +67,10 @@ if(isWelder(I)) var/obj/item/weldingtool/WT = I - if(WT.remove_fuel(0, user)) - damage = 20 - playsound(loc, 'sound/items/Welder.ogg', 100, 1) + if(istype(I, /obj/item/weldingtool) && !WT.remove_fuel(0, user)) + return + damage = 20 + playsound(loc, 'sound/items/Welder.ogg', 100, 1) if(damage <= 2) return diff --git a/mods/_fd/hestia_missiles/code/presets/breacher.dm b/mods/_fd/hestia_missiles/code/presets/breacher.dm index 7ec7f6c6f65d2..89b7cfa3252d4 100644 --- a/mods/_fd/hestia_missiles/code/presets/breacher.dm +++ b/mods/_fd/hestia_missiles/code/presets/breacher.dm @@ -85,9 +85,10 @@ if(isWelder(I)) var/obj/item/weldingtool/WT = I - if(WT.remove_fuel(0, user)) - damage = 20 - playsound(loc, 'sound/items/Welder.ogg', 100, 1) + if(istype(I, /obj/item/weldingtool) && !WT.remove_fuel(0, user)) + return + damage = 20 + playsound(loc, 'sound/items/Welder.ogg', 100, 1) if(damage <= 2) return diff --git a/mods/atmos_ret_field/code/atmospheric_retention_field.dm b/mods/atmos_ret_field/code/atmospheric_retention_field.dm index 8229214286399..bcd6c2c78516b 100644 --- a/mods/atmos_ret_field/code/atmospheric_retention_field.dm +++ b/mods/atmos_ret_field/code/atmospheric_retention_field.dm @@ -88,7 +88,7 @@ if(hatch_open && (isWelder(tool))) var/obj/item/weldingtool/welder = tool - if (!welder.remove_fuel(5, user)) + if (istype(tool, /obj/item/weldingtool) && !!welder.remove_fuel(5, user)) to_chat(user, SPAN_WARNING("You need more fuel to complete this task.")) return TRUE // uses up 5 fuel. @@ -96,7 +96,7 @@ playsound(loc, pick('sound/items/Welder.ogg', 'sound/items/Welder2.ogg'), 50, 1) if(do_after(user, 2 SECONDS, src, DO_REPAIR_CONSTRUCT)) - if(!src || !user || !welder.remove_fuel(5, user)) + if(!src || !user || (istype(I, /obj/item/weldingtool) && !welder.remove_fuel(5, user))) return TRUE to_chat(user, SPAN_NOTICE("You fully disassemble \the [src]. There were no salvageable parts.")) diff --git a/mods/machinery/code/gravity_generator/base.dm b/mods/machinery/code/gravity_generator/base.dm index 6c2b012d64d8e..42182b7d0f79d 100644 --- a/mods/machinery/code/gravity_generator/base.dm +++ b/mods/machinery/code/gravity_generator/base.dm @@ -208,7 +208,7 @@ playsound(loc, 'sound/items/Welder2.ogg', 50, 1) var/obj/item/weldingtool/WT = tool - if(!do_after(user, 15 SECONDS, middle) || !user.use_sanity_check(src, tool) || !WT.remove_fuel(1, user) || broken_state != GRAV_NEEDS_WELDING) + if(!do_after(user, 15 SECONDS, middle) || !user.use_sanity_check(src, tool) || (istype(tool, /obj/item/weldingtool) && !WT.remove_fuel(1, user)) || broken_state != GRAV_NEEDS_WELDING) return TRUE health += 250 diff --git a/packs/infinity/items/projectile/guns/energy/laser_handmade.dm b/packs/infinity/items/projectile/guns/energy/laser_handmade.dm index b6ccf0b8d5448..756308e3f27c5 100644 --- a/packs/infinity/items/projectile/guns/energy/laser_handmade.dm +++ b/packs/infinity/items/projectile/guns/energy/laser_handmade.dm @@ -186,8 +186,8 @@ if(13) if(isWelder(tool)) var/obj/item/weldingtool/T = tool - if(T.remove_fuel(0,user)) - if(!src || !T.isOn()) return TRUE + if(istype(tool, /obj/item/weldingtool) && !T.remove_fuel(0,user)) + if(!src || (istype(tool, /obj/item/weldingtool) && !T.isOn())) return TRUE playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1) to_chat(user, SPAN_NOTICE("You weld the cables into places.")) buildstate++ diff --git a/packs/infinity/structures/barrier.dm b/packs/infinity/structures/barrier.dm index ee3f51f755029..3d1dda4bfe9a5 100644 --- a/packs/infinity/structures/barrier.dm +++ b/packs/infinity/structures/barrier.dm @@ -110,18 +110,19 @@ if(health == maxhealth) to_chat(user, SPAN_NOTICE("\The [src] is fully repaired.")) return TRUE - if(!WT.isOn()) + if(istype(tool, /obj/item/weldingtool) && !WT.isOn()) to_chat(user, SPAN_NOTICE("[tool] should be turned on firstly.")) return TRUE - if(WT.remove_fuel(0,user)) - visible_message(SPAN_WARNING("[user] is repairing \the [src]...")) - playsound(src, 'sound/items/Welder.ogg', 100, 1) - if(do_after(user, max(5, health / 5), src) && WT?.isOn()) - to_chat(user, SPAN_NOTICE("You finish repairing the damage to [src].")) - playsound(src, 'sound/items/Welder2.ogg', 100, 1) - health = maxhealth - else + if(istype(tool, /obj/item/weldingtool) && !WT.remove_fuel(0,user)) to_chat(user, SPAN_NOTICE("You need more welding fuel to complete this task.")) + return TRUE + visible_message(SPAN_WARNING("[user] is repairing \the [src]...")) + playsound(src, 'sound/items/Welder.ogg', 100, 1) + if(do_after(user, max(5, health / 5), src) && WT?.isOn()) + to_chat(user, SPAN_NOTICE("You finish repairing the damage to [src].")) + playsound(src, 'sound/items/Welder2.ogg', 100, 1) + health = maxhealth + update_icon() return TRUE @@ -261,18 +262,17 @@ /obj/item/barrier/use_tool(obj/item/tool, mob/user, list/click_params) if(health != 200 && isWelder(tool)) var/obj/item/weldingtool/WT = tool - if(!WT.isOn()) + if(istype(tool, /obj/item/weldingtool) && !WT.isOn()) to_chat(user, SPAN_NOTICE("The [tool] should be turned on firstly.")) return TRUE - if(WT.remove_fuel(0,user)) - to_chat(user, SPAN_NOTICE("You start repairing the damage to [src].")) - playsound(src, 'sound/items/Welder.ogg', 100, 1) - if(do_after(user, max(5, health / 5), src) && WT?.isOn()) - to_chat(user, SPAN_NOTICE("You finish repairing the damage to [src].")) - playsound(src, 'sound/items/Welder2.ogg', 100, 1) - health = 200 - return TRUE - else + if(istype(tool, /obj/item/weldingtool) && !WT.remove_fuel(0,user)) to_chat(user, SPAN_NOTICE("You need more welding fuel to complete this task.")) return TRUE + to_chat(user, SPAN_NOTICE("You start repairing the damage to [src].")) + playsound(src, 'sound/items/Welder.ogg', 100, 1) + if(do_after(user, max(5, health / 5), src) && WT?.isOn()) + to_chat(user, SPAN_NOTICE("You finish repairing the damage to [src].")) + playsound(src, 'sound/items/Welder2.ogg', 100, 1) + health = 200 + return TRUE return ..()