Skip to content

Commit

Permalink
Empulse effects update (#13001)
Browse files Browse the repository at this point in the history
* try1

* for goliath rocket

* now correct

* rename overlay
  • Loading branch information
Deahaka authored Apr 15, 2024
1 parent d09849b commit e4dbde1
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 12 deletions.
3 changes: 3 additions & 0 deletions code/__DEFINES/sound.dm
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,6 @@
#define SOUND_AREA_LARGE_METALLIC SOUND_ENVIRONMENT_QUARRY
#define SOUND_AREA_SMALL_METALLIC SOUND_ENVIRONMENT_BATHROOM
#define SOUND_AREA_ASTEROID SOUND_ENVIRONMENT_CAVE

#define EMP_DEFAULT 'sound/effects/EMPulse.ogg'
#define EMP_SEBB 'sound/effects/sound_effects_sebb_explode.ogg'
2 changes: 1 addition & 1 deletion code/datums/spells/emplosion.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
/obj/effect/proc_holder/spell/targeted/emplosion/cast(list/targets)

for(var/mob/living/target in targets)
empulse(target.loc, emp_heavy, emp_light)
empulse(target.loc, emp_heavy, emp_light, custom_effects = EMP_SEBB)

return
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
if(!ninjacost(C,0)) // EMP's now cost 1,000Energy about 30%
var/mob/living/carbon/human/U = affecting
playsound(U, 'sound/effects/EMPulse.ogg', VOL_EFFECTS_MASTER)
empulse(U, 2, 3) //Procs sure are nice. Slightly weaker than wizard's disable tch.
empulse(U, 2, 3, custom_effects = EMP_SEBB) //Procs sure are nice. Slightly weaker than wizard's disable tch.
s_coold = 2
cell.use(C*10)
return
21 changes: 16 additions & 5 deletions code/game/objects/empulse.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
/proc/empulse(turf/epicenter, heavy_range, light_range, log=0)
/obj/effect/overlay/temp/heavy_emp
icon = 'icons/effects/sebb.dmi'
icon_state = "sebb_explode"
layer = ABOVE_LIGHTING_PLANE
pixel_x = -175 // We need these offsets to force center the sprite because BYOND is dumb
pixel_y = -175
appearance_flags = RESET_COLOR

/proc/empulse(turf/epicenter, heavy_range, light_range, log=0, custom_effects = EMP_DEFAULT)
if(!epicenter) return

if(!istype(epicenter, /turf))
Expand All @@ -12,19 +20,22 @@

SEND_SIGNAL(SSexplosions, COMSIG_EXPLOSIONS_EMPULSE, epicenter, heavy_range, light_range)

if(heavy_range > 1)
if(custom_effects == EMP_SEBB)
var/obj/effect/overlay/temp/heavy_emp/S = new(epicenter)
S.anchored = TRUE
QDEL_IN(S, 1 SECOND)
else if(heavy_range > 1)
var/obj/effect/overlay/pulse = new /obj/effect/overlay(epicenter)
pulse.icon = 'icons/effects/effects.dmi'
pulse.icon_state = "emppulse"
pulse.name = "emp pulse"
pulse.anchored = TRUE
QDEL_IN(pulse, 20)
QDEL_IN(pulse, 2 SECONDS)

if(heavy_range > light_range)
light_range = heavy_range

for(var/mob/M in range(heavy_range, epicenter))
M.playsound_local(null, 'sound/effects/EMPulse.ogg', VOL_EFFECTS_MASTER, null, FALSE)
M.playsound_local(null, custom_effects, VOL_EFFECTS_MASTER, null, FALSE)

for(var/atom/T in range(light_range, epicenter))
var/distance = get_dist(epicenter, T)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/mines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
icon_state = "empmine"

/obj/item/mine/emp/trigger_act(obj)
empulse(src, 2, 3)
empulse(src, 2, 3, custom_effects = EMP_SEBB)

/obj/item/mine/emp/anchored
anchored = TRUE
3 changes: 2 additions & 1 deletion code/game/objects/items/weapons/grenades/emgrenade.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
icon_state = "emp"
item_state = "emp"
origin_tech = "materials=2;magnets=3"
activate_sound = 'sound/weapons/sound_effects_sebb_beep.ogg'

/obj/item/weapon/grenade/empgrenade/prime()
..()
if(empulse(src, 4, 10))
if(empulse(src, 4, 10, custom_effects = EMP_SEBB))
qdel(src)
return

2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/implants/implant.dm
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@
/datum/action/item_action/implant/emp_implant/Activate()
var/obj/item/weapon/implant/emp/S = target
if (S.uses > 0)
empulse(S.imp_in, 3, 5)
empulse(S.imp_in, 3, 5, custom_effects = EMP_SEBB)
S.uses--
if (!S.uses)
qdel(S)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/projectiles/projectile/special.dm
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
damage = 10

/obj/item/projectile/missile/emp/on_hit(atom/target, def_zone = BP_CHEST, blocked = 0)
empulse(target, 4, 10)
empulse(target, 4, 10, custom_effects = EMP_SEBB)
return 1

/obj/item/projectile/anti_singulo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
empulse(get_turf(holder), range / 2, range)

/datum/artifact_effect/emp/DoEffectDestroy()
empulse(get_turf(holder), 7, range)
empulse(get_turf(holder), 7, range, custom_effects = EMP_SEBB)
Binary file added icons/effects/sebb.dmi
Binary file not shown.
Binary file added sound/effects/sound_effects_sebb_explode.ogg
Binary file not shown.
Binary file added sound/weapons/sound_effects_sebb_beep.ogg
Binary file not shown.

0 comments on commit e4dbde1

Please sign in to comment.