Skip to content

Commit

Permalink
Merge pull request tgstation#2481 from Tenebrosity/projectileimpactno…
Browse files Browse the repository at this point in the history
…ises

Adds generic impact noises to all projectiles
  • Loading branch information
fleure committed Feb 2, 2014
2 parents 8fa0db4 + 84b9a63 commit 153aae9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions code/modules/projectiles/projectile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
anchored = 1 //There's a reason this is here, Mport. God fucking damn it -Agouri. Find&Fix by Pete. The reason this is here is to stop the curving of emitter shots.
pass_flags = PASSTABLE
mouse_opacity = 0
hitsound = 'sound/weapons/pierce.ogg'
var/bumped = 0 //Prevents it from hitting more than one guy at once
var/def_zone = "" //Aiming at
var/mob/firer = null//Who shot it
Expand Down Expand Up @@ -59,8 +60,14 @@
var/mob/living/L = target
return L.apply_effects(stun, weaken, paralyze, irradiate, stutter, eyeblur, drowsy, blocked)

proc/vol_by_damage()
if(src.damage)
return Clamp((src.damage) * 2, 30, 100)// Multiply projectile damage by 2, then clamp the value between 30 and 100
else
return 40 //if the projectile doesn't do damage, play its hitsound at 40% volume

Bump(atom/A as mob|obj|turf|area)

if(A == firer)
loc = A.loc
return 0 //cannot shoot yourself
Expand All @@ -83,8 +90,11 @@
var/distance = get_dist(get_turf(A), starting) // Get the distance between the turf shot from and the mob we hit and use that for the calculations.
def_zone = ran_zone(def_zone, max(100-(7*distance), 5)) //Lower accurancy/longer range tradeoff. 7 is a balanced number to use.
if(silenced)
playsound(loc, hitsound, 5, 1, -1)
M << "<span class='userdanger'>You've been shot in the [parse_zone(def_zone)] by [src]!</span>"
else
var/volume = vol_by_damage()
playsound(loc, hitsound, volume, 1, -1)
M.visible_message("<span class='danger'>[M] is hit by [src] in the [parse_zone(def_zone)]!", \
"<span class='userdanger'>[M] is hit by [src] in the [parse_zone(def_zone)]!") //X has fired Y is now given by the guns so you cant tell who shot you if you could not see the shooter
add_logs(firer, M, "shot", object="[src]", addition=reagent_note)
Expand Down
5 changes: 5 additions & 0 deletions code/modules/projectiles/projectile/beams.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE
damage = 20
damage_type = BURN
hitsound = 'sound/weapons/sear.ogg'
flag = "laser"
eyeblur = 2

Expand All @@ -12,6 +13,7 @@
icon_state = "laser"
pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE
damage = 0
hitsound = null
damage_type = BURN
flag = "laser"
eyeblur = 2
Expand Down Expand Up @@ -58,6 +60,7 @@
/obj/item/projectile/bluetag
name = "lasertag beam"
icon_state = "bluelaser"
hitsound = null
pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE
damage = 0
damage_type = BURN
Expand All @@ -73,6 +76,7 @@
/obj/item/projectile/redtag
name = "lasertag beam"
icon_state = "laser"
hitsound = null
pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE
damage = 0
damage_type = BURN
Expand All @@ -87,6 +91,7 @@

/obj/item/projectile/omnitag//A laser tag bolt that stuns EVERYONE
name = "lasertag beam"
hitsound = null
icon_state = "omnilaser"
pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE
damage = 0
Expand Down
1 change: 1 addition & 0 deletions code/modules/projectiles/projectile/energy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
stun = 10
weaken = 10
stutter = 10
hitsound = "sparks"

on_hit(var/atom/target, var/blocked = 0)
if(!ismob(target) || blocked >= 2) //Fully blocked by mob or collided with dense object - burst into sparks!
Expand Down
Binary file added sound/weapons/sear.ogg
Binary file not shown.

0 comments on commit 153aae9

Please sign in to comment.