Skip to content

Commit

Permalink
Why would you put it on a turf anyway?
Browse files Browse the repository at this point in the history
  • Loading branch information
Bokkiewokkie committed Jun 20, 2024
1 parent 6d0981e commit b77b483
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions nsv13/code/modules/overmap/shieldgen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@

/obj/effect/temp_visual/overmap_shield_hit
name = "Shield hit"
icon = 'nsv13/icons/overmap/shieldhit.dmi';
icon = 'nsv13/icons/overmap/shieldhit.dmi'
icon_state = "shieldhit"
duration = 0.75 SECONDS
layer = ABOVE_MOB_LAYER+0.1
Expand All @@ -349,17 +349,18 @@
/obj/effect/temp_visual/overmap_shield_hit/Initialize(mapload, obj/structure/overmap/OM)
. = ..()
//Scale up the shield hit icon to roughly fit the overmap ship that owns us.
if(!OM)
if(!OM || !istype(OM))
log_runtime("Shield hit effect was made with no ship!")
return INITIALIZE_HINT_QDEL
overmap = OM
var/matrix/desired = new()
var/icon/I = icon(overmap.icon)
var/icon/I = icon(OM.icon)
var/resize_x = I.Width()/96
var/resize_y = I.Height()/96
desired.Scale(resize_x,resize_y)
desired.Turn(overmap.angle)
desired.Turn(OM.angle)
transform = desired
overmap.vis_contents += src
OM.vis_contents |= src
overmap = OM

/obj/effect/temp_visual/overmap_shield_hit/Destroy()
overmap?.vis_contents -= src
Expand Down
2 changes: 1 addition & 1 deletion nsv13/code/modules/overmap/weapons/damage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Bullet reactions
if(shield_result)
var/damage_sound = pick('nsv13/sound/effects/ship/damage/shield_hit.ogg', 'nsv13/sound/effects/ship/damage/shield_hit2.ogg')
if(!impact_sound_cooldown)
new /obj/effect/temp_visual/overmap_shield_hit(get_turf(src), src)
new /obj/effect/temp_visual/overmap_shield_hit(src, src)
relay(damage_sound)
if(P.damage >= 15) //Flak begone
shake_everyone(5)
Expand Down

0 comments on commit b77b483

Please sign in to comment.