diff --git a/code/game/objects/effects/temporary_visuals/miscellaneous.dm b/code/game/objects/effects/temporary_visuals/miscellaneous.dm
index dfc5fb94d5..363bb1b05a 100644
--- a/code/game/objects/effects/temporary_visuals/miscellaneous.dm
+++ b/code/game/objects/effects/temporary_visuals/miscellaneous.dm
@@ -313,12 +313,12 @@
duration = 5
/obj/effect/temp_visual/impact_effect/Initialize(mapload, atom/target, obj/item/projectile/P)
- if(target == P.original) //the projectile hit the target originally clicked
- pixel_x = P.p_x + target.pixel_x - 16 + rand(-4,4)
- pixel_y = P.p_y + target.pixel_y - 16 + rand(-4,4)
+ if(target == P.original)
+ pixel_x = target.pixel_x + P.p_x - 16
+ pixel_y = target.pixel_y + P.p_y - 16
else
- pixel_x = target.pixel_x + rand(-4,4)
- pixel_y = target.pixel_y + rand(-4,4)
+ pixel_x = target.pixel_x + rand(2, -2)
+ pixel_y = target.pixel_y + rand(2, -2)
. = ..()
/obj/effect/temp_visual/impact_effect/red_laser
diff --git a/code/game/turfs/closed.dm b/code/game/turfs/closed.dm
index c9eb1a6762..76b8314fcc 100644
--- a/code/game/turfs/closed.dm
+++ b/code/game/turfs/closed.dm
@@ -153,16 +153,3 @@
desc = "A wall made out of a strange metal. The squares on it pulse in a predictable pattern."
icon = 'icons/turf/walls/hierophant_wall.dmi'
icon_state = "wall"
-
-/turf/closed/bullet_act(obj/item/projectile/Proj)
- . = ..()
- if((. != -1) && !Proj.nodamage && (Proj.damage_type == BRUTE || Proj.damage_type == BURN))
- var/mutable_appearance/bullet_hole = mutable_appearance('icons/effects/effects.dmi', "bullet_hole", BULLET_HOLE_LAYER)
-
- var/random_x = rand(-13, 13)
- bullet_hole.pixel_x += random_x
-
- var/random_y = rand(-13, 13)
- bullet_hole.pixel_y += random_y
-
- add_overlay(bullet_hole, TRUE)
diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm
index baee3b31c1..8ab9a4e682 100644
--- a/code/game/turfs/simulated/walls.dm
+++ b/code/game/turfs/simulated/walls.dm
@@ -25,6 +25,8 @@
/turf/closed/wall/clockwork)
smooth = SMOOTH_TRUE
+ var/list/damage_decals
+
/turf/closed/wall/examine(mob/user)
..()
deconstruction_hints(user)
@@ -113,7 +115,7 @@
playsound(src, 'sound/items/welder.ogg', 100, 1)
if(TOX)
playsound(src, 'sound/effects/spray2.ogg', 100, 1)
- return 0
+ return FALSE
/turf/closed/wall/attack_paw(mob/living/user)
user.changeNext_move(CLICK_CD_MELEE)
@@ -137,7 +139,7 @@
else
playsound(src, 'sound/effects/bang.ogg', 50, 1)
to_chat(user, text("You punch the wall."))
- return 1
+ return TRUE
/turf/closed/wall/attack_hand(mob/user)
user.changeNext_move(CLICK_CD_MELEE)
@@ -168,9 +170,23 @@
var/turf/T = user.loc //get user's location for delay checks
//the istype cascade has been spread among various procs for easy overriding
- if(try_wallmount(W,user,T) || try_decon(W,user,T) || try_destroy(W,user,T))
+ if(try_clean(W, user, T) || try_wallmount(W, user, T) || try_decon(W, user, T) || try_destroy(W, user, T))
return
+/turf/closed/wall/proc/try_clean(obj/item/W, mob/user, turf/T)
+ if((user.a_intent != INTENT_HELP) || !damage_decals.len || !istype(W, /obj/item/weldingtool))
+ return FALSE
+ var/obj/item/weldingtool/WT = W
+ if(WT.remove_fuel(0, user))
+ to_chat(user, "You begin fixing dents on the wall...")
+ playsound(src, W.usesound, 100, 1)
+ if(do_after(user, slicing_duration * W.toolspeed * 0.5, target = src))
+ if(iswallturf(src) && user && !QDELETED(WT) && WT.isOn() && !QDELETED(T) && (user.loc == T) && (user.get_active_held_item() == WT) && damage_decals.len)
+ to_chat(user, "You fix some dents on the wall.")
+ cut_overlay(damage_decals)
+ LAZYCLEARLIST(damage_decals)
+ return TRUE
+ return FALSE
/turf/closed/wall/proc/try_wallmount(obj/item/W, mob/user, turf/T)
//check for wall mounted frames
@@ -178,53 +194,50 @@
var/obj/item/wallframe/F = W
if(F.try_build(src, user))
F.attach(src, user)
- return 1
+ return TRUE
//Poster stuff
else if(istype(W, /obj/item/poster))
place_poster(W,user)
- return 1
-
- return 0
+ return TRUE
+ return FALSE
/turf/closed/wall/proc/try_decon(obj/item/W, mob/user, turf/T)
- if( istype(W, /obj/item/weldingtool) )
+ if(istype(W, /obj/item/weldingtool))
var/obj/item/weldingtool/WT = W
- if( WT.remove_fuel(0,user) )
+ if(WT.remove_fuel(0, user))
to_chat(user, "You begin slicing through the outer plating...")
playsound(src, W.usesound, 100, 1)
- if(do_after(user, slicing_duration*W.toolspeed, target = src))
- if(!iswallturf(src) || !user || !WT || !WT.isOn() || !T)
- return 1
- if( user.loc == T && user.get_active_held_item() == WT )
+ if(do_after(user, slicing_duration * W.toolspeed, target = src))
+ if(iswallturf(src) && user && !QDELETED(WT) && WT.isOn() && !QDELETED(T) && (user.loc == T) && (user.get_active_held_item() == WT))
to_chat(user, "You remove the outer plating.")
dismantle_wall()
- return 1
- else if( istype(W, /obj/item/gun/energy/plasmacutter) )
+ return TRUE
+ else if(istype(W, /obj/item/gun/energy/plasmacutter))
to_chat(user, "You begin slicing through the outer plating...")
playsound(src, 'sound/items/welder.ogg', 100, 1)
- if(do_after(user, slicing_duration*W.toolspeed, target = src))
- if(!iswallturf(src) || !user || !W || !T)
- return 1
- if( user.loc == T && user.get_active_held_item() == W )
+ if(do_after(user, slicing_duration * W.toolspeed, target = src))
+ if(!iswallturf(src) || !user || QDELETED(W) || QDELETED(T))
+ return TRUE
+ if((user.loc == T) && (user.get_active_held_item() == W))
to_chat(user, "You remove the outer plating.")
dismantle_wall()
visible_message("The wall was sliced apart by [user]!", "You hear metal being sliced apart.")
- return 1
- return 0
+ return TRUE
+ return FALSE
/turf/closed/wall/proc/try_destroy(obj/item/W, mob/user, turf/T)
if(istype(W, /obj/item/pickaxe/drill/jackhammer))
var/obj/item/pickaxe/drill/jackhammer/D = W
if(!iswallturf(src) || !user || !W || !T)
- return 1
+ return TRUE
if( user.loc == T && user.get_active_held_item() == W )
D.playDigSound()
dismantle_wall()
visible_message("[user] smashes through the [name] with the [W.name]!", "You hear the grinding of metal.")
- return 1
- return 0
+ return TRUE
+ return FALSE
/turf/closed/wall/proc/thermitemelt(mob/user)
@@ -295,3 +308,8 @@
ChangeTurf(/turf/open/floor/plating)
return TRUE
return FALSE
+
+/turf/closed/wall/proc/add_damage_decal(var/mutable_appearance/decal)
+ cut_overlay(damage_decals)
+ LAZYADD(damage_decals, decal)
+ add_overlay(damage_decals)
diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm
index 5a6116bf66..ce3d9607bc 100644
--- a/code/modules/projectiles/projectile.dm
+++ b/code/modules/projectiles/projectile.dm
@@ -85,6 +85,16 @@
/obj/item/projectile/proc/on_hit(atom/target, blocked = FALSE)
var/turf/target_loca = get_turf(target)
+ if(!nodamage && (damage_type == BRUTE || damage_type == BURN) && istype(target_loca, /turf/closed/wall) && prob(75))
+ var/turf/closed/wall/W = target_loca
+ var/mutable_appearance/decal = mutable_appearance('icons/effects/effects.dmi', "bullet_hole", TURF_DECAL_LAYER)
+ if(target == original)
+ decal.pixel_x = target.pixel_x + p_x - 16
+ decal.pixel_y = target.pixel_y + p_y - 16
+ else
+ decal.pixel_x = target.pixel_x + rand(2, -2)
+ decal.pixel_y = target.pixel_y + rand(2, -2)
+ W.add_damage_decal(decal)
if(!isliving(target))
if(impact_effect_type)
new impact_effect_type(target_loca, target, src)