diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 66bca8c3f3e..ca8ce4889d9 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -1,4 +1,5 @@ GLOBAL_DATUM_INIT(fire_overlay, /mutable_appearance, mutable_appearance('icons/effects/fire.dmi', "fire")) +GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons/effects/welding_effect.dmi', "welding_sparks", GASFIRE_LAYER, ABOVE_LIGHTING_PLANE)) /// Anything you can pick up and hold. /obj/item @@ -1001,11 +1002,6 @@ GLOBAL_DATUM_INIT(fire_overlay, /mutable_appearance, mutable_appearance('icons/e delay *= toolspeed * skill_modifier - // SKYRAT EDIT ADDITION - if(welding_sparks) // If we have sparks, assume we are a welding tool. - target.add_overlay(welding_sparks) - // SKYRAT EDIT END - // Play tool sound at the beginning of tool usage. play_tool_sound(target, volume) @@ -1015,34 +1011,18 @@ GLOBAL_DATUM_INIT(fire_overlay, /mutable_appearance, mutable_appearance('icons/e if(ismob(target)) if(!do_mob(user, target, delay, extra_checks=tool_check)) - // SKYRAT EDIT ADDITION - if(welding_sparks) - target.cut_overlay(welding_sparks) - // SKYRAT EDIT END return else if(!do_after(user, delay, target=target, extra_checks=tool_check)) - // SKYRAT EDIT ADDITION - if(welding_sparks) - target.cut_overlay(welding_sparks) - // SKYRAT EDIT END return else // Invoke the extra checks once, just in case. if(extra_checks && !extra_checks.Invoke()) - // SKYRAT EDIT ADDITION - if(welding_sparks) - target.cut_overlay(welding_sparks) - // SKYRAT EDIT END return // Use tool's fuel, stack sheets or charges if amount is set. if(amount && !use(amount)) - // SKYRAT EDIT ADDITION - if(welding_sparks) - target.cut_overlay(welding_sparks) - // SKYRAT EDIT END return // Play tool sound at the end of tool usage, @@ -1050,11 +1030,6 @@ GLOBAL_DATUM_INIT(fire_overlay, /mutable_appearance, mutable_appearance('icons/e if(delay >= MIN_TOOL_SOUND_DELAY) play_tool_sound(target, volume) - // SKYRAT EDIT ADDITION - if(welding_sparks) - target.cut_overlay(welding_sparks) - // SKYRAT EDIT END - return TRUE /// Called before [obj/item/proc/use_tool] if there is a delay, or by [obj/item/proc/use_tool] if there isn't. Only ever used by welding tools and stacks, so it's not added on any other [obj/item/proc/use_tool] checks. diff --git a/code/game/objects/items/tools/weldingtool.dm b/code/game/objects/items/tools/weldingtool.dm index 2eb35b7259d..df34eb5bc8d 100644 --- a/code/game/objects/items/tools/weldingtool.dm +++ b/code/game/objects/items/tools/weldingtool.dm @@ -122,6 +122,11 @@ dyn_explosion(src, plasmaAmount/5, explosion_cause = src) // 20 plasma in a standard welder has a 4 power explosion. no breaches, but enough to kill/dismember holder qdel(src) +/obj/item/weldingtool/use_tool(atom/target, mob/living/user, delay, amount, volume, datum/callback/extra_checks) + target.add_overlay(GLOB.welding_sparks) + . = ..() + target.cut_overlay(GLOB.welding_sparks) + /obj/item/weldingtool/attack(mob/living/carbon/human/attacked_humanoid, mob/living/user) if(!istype(attacked_humanoid)) return ..() diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm index c06babcfd0b..4368e0002ef 100644 --- a/code/modules/projectiles/guns/energy/special.dm +++ b/code/modules/projectiles/guns/energy/special.dm @@ -167,8 +167,11 @@ return (!QDELETED(cell) && cell.use(amount ? amount * charge_weld : charge_weld)) /obj/item/gun/energy/plasmacutter/use_tool(atom/target, mob/living/user, delay, amount=1, volume=0, datum/callback/extra_checks) + if(amount) + target.add_overlay(GLOB.welding_sparks) . = ..() + target.cut_overlay(GLOB.welding_sparks) else . = ..(amount=1) diff --git a/icons/effects/welding_effect.dmi b/icons/effects/welding_effect.dmi new file mode 100644 index 00000000000..8b8db2dcaea Binary files /dev/null and b/icons/effects/welding_effect.dmi differ diff --git a/modular_skyrat/modules/welding_sparks/code/weldingtool.dm b/modular_skyrat/modules/welding_sparks/code/weldingtool.dm deleted file mode 100644 index eeb6dc0358e..00000000000 --- a/modular_skyrat/modules/welding_sparks/code/weldingtool.dm +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Modularity is a neccessary evil. - * - * It makes everything far harder, yet it is the only way to achieve salvation. - * - * Without it, we would be nothing. - * - * These are the side effects of our choice to achieve salvation. - */ - -/obj/item - /// An image effect for displaying a welding effect for items that support it. - var/image/welding_sparks - -/obj/item/Initialize(mapload) - . = ..() - if(tool_behaviour == TOOL_WELDER) // If we act like a welder, set up some spark effects. - welding_sparks = image('modular_skyrat/modules/welding_sparks/icons/welding_effect.dmi', "welding_sparks", GASFIRE_LAYER) - welding_sparks.plane = ABOVE_LIGHTING_PLANE - -/obj/item/Destroy(force) - QDEL_NULL(welding_sparks) - return ..() diff --git a/modular_skyrat/modules/welding_sparks/icons/welding_effect.dmi b/modular_skyrat/modules/welding_sparks/icons/welding_effect.dmi deleted file mode 100644 index 57bc4c981d2..00000000000 Binary files a/modular_skyrat/modules/welding_sparks/icons/welding_effect.dmi and /dev/null differ diff --git a/tgstation.dme b/tgstation.dme index e54acd3d604..68f36dc2239 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -5913,7 +5913,6 @@ #include "modular_skyrat\modules\vox_sprites\code\head.dm" #include "modular_skyrat\modules\vox_sprites\code\security.dm" #include "modular_skyrat\modules\vox_sprites\code\sneakers.dm" -#include "modular_skyrat\modules\welding_sparks\code\weldingtool.dm" #include "modular_skyrat\modules\wrestlingring\code\wrestlingring.dm" #include "modular_skyrat\modules\xenoarch\code\area.dm" #include "modular_skyrat\modules\xenoarch\code\modules\hydroponics\amauri.dm"