[MIRROR] Ports Tau Ceti's welding animation! [MDB IGNORE] (#14311)

* Ports Tau Ceti's welding animation! (#67725)

add: welding now has an animation!

* Ports Tau Ceti's welding animation!

* wew

Co-authored-by: dragomagol <66640614+dragomagol@users.noreply.github.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
This commit is contained in:
SkyratBot
2022-06-19 22:32:21 +01:00
committed by GitHub
co-authored by dragomagol Gandalf
parent 3dca2254c5
commit f44ab4155e
7 changed files with 9 additions and 50 deletions
+1 -26
View File
@@ -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.
@@ -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 ..()
@@ -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)
Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

@@ -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 ..()
Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

-1
View File
@@ -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"