Merge pull request #5444 from DeityLink/gunnss

Impacts hotfix
This commit is contained in:
d3athrow
2015-07-21 12:04:55 -05:00
committed by DeityLink
5 changed files with 28 additions and 16 deletions

View File

@@ -25,17 +25,14 @@
mouse_opacity = 0
var/tmp/atom/BeamSource
/obj/effect/overlay/beam/New(turf/loc, var/lifetime = 10, var/fade = 0)
/obj/effect/overlay/beam/New(turf/loc, var/lifetime = 10, var/fade = 0, var/src_icon = 'icons/effects/beam.dmi')
..()
icon = src_icon
spawn if(fade)
animate(src, alpha=0, time=lifetime)
spawn(lifetime)
returnToPool(src)
/obj/effect/overlay/beam/impact
icon='icons/obj/projectiles_impacts.dmi'
icon_state=""
/obj/effect/overlay/palmtree_r
name = "Palm tree"

View File

@@ -190,7 +190,7 @@
if(istype(permutated,/list)) permutated.Add(A)
return 0
else if(!custom_impact)
var/obj/effect/overlay/beam/impact/impact = getFromPool(/obj/effect/overlay/beam,get_turf(src))
var/obj/effect/overlay/beam/impact = getFromPool(/obj/effect/overlay/beam,get_turf(src),10,0,'icons/obj/projectiles_impacts.dmi')
switch(get_dir(src,A))
if(NORTH)
impact.pixel_y = 16

View File

@@ -276,7 +276,6 @@ var/list/beam_master = list()
src.Move(step)
error -= distB
target_dir = dA
world << "dir is [dir]"
if(error < 0)
target_dir = dA + dB

View File

@@ -10,6 +10,7 @@
icon = 'icons/obj/projectiles_experimental.dmi'
icon_state = "ricochet_head"
animate_movement = 0
custom_impact = 1
var/pos_from = EAST //which side of the turf is the shot coming from
var/pos_to = SOUTH //which side of the turf is the shot heading to
var/bouncin = 0
@@ -201,12 +202,24 @@
pos_to = NORTH
pos_from = WEST
/obj/item/projectile/ricochet/proc/bulletdies()
/obj/item/projectile/ricochet/proc/bulletdies(var/atom/A = null)
var/obj/effect/overlay/beam/impact = getFromPool(/obj/effect/overlay/beam,get_turf(src),10,0,'icons/obj/projectiles_impacts.dmi')
if(A)
switch(get_dir(src,A))
if(NORTH)
impact.pixel_y = 16
if(SOUTH)
impact.pixel_y = -16
if(EAST)
impact.pixel_x = 16
if(WEST)
impact.pixel_x = -16
impact.icon_state = "ricochet_hit"
playsound(impact, 'sound/weapons/pierce.ogg', 30, 1)
spawn()
density = 0
invisibility = 101
//del(src)
loc = null
returnToPool(src)
OnDeath()
@@ -247,20 +260,23 @@
if(istype(A,/mob/living/carbon/human))
var/mob/living/carbon/human/H = A
if(istype(H.wear_suit,/obj/item/clothing/suit/armor/laserproof))// bwoing!!
visible_message("<span class='warning'>\the [src.name] bounces off \the [A.name]'s [H.wear_suit]!</span>")
bounce()
else
visible_message("<span class='warning'>\the [A.name] is hit by \the [src.name] in the [parse_zone(def_zone)]!</span>")
A.bullet_act(src, def_zone)
admin_warn(A)
bulletdies()
bulletdies(A)
else
visible_message("<span class='warning'>\the [A.name] is hit by \the [src.name] in the [parse_zone(def_zone)]!</span>")
A.bullet_act(src, def_zone)
admin_warn(A)
bulletdies()
bulletdies(A)
else if(is_type_in_list(A,ricochet_bump))//beware fuel tanks!
visible_message("<span class='warning'>\the [A.name] is hit by \the [src.name]!</span>")
A.bullet_act(src)
bulletdies()
bulletdies(A)
else if((istype(A,/obj/structure/window) || istype(A,/obj/machinery/door/window) || istype(A,/obj/machinery/door/firedoor/border_only)) && (A.loc == src.loc))
//all this part is to prevent a bug that causes the shot to go through walls
@@ -664,7 +680,7 @@
..()
/obj/item/projectile/spur/Bump(atom/A as mob|obj|turf|area)
var/obj/effect/overlay/beam/impact/impact = getFromPool(/obj/effect/overlay/beam,get_turf(src))
var/obj/effect/overlay/beam/impact = getFromPool(/obj/effect/overlay/beam,get_turf(src),10,0,'icons/obj/projectiles_impacts.dmi')
switch(get_dir(src,A))
if(NORTH)
impact.pixel_y = 16
@@ -684,7 +700,7 @@
/obj/item/projectile/spur/process_step()
if(kill_count <= 0)
var/obj/effect/overlay/beam/impact/impact = getFromPool(/obj/effect/overlay/beam,get_turf(src))
var/obj/effect/overlay/beam/impact = getFromPool(/obj/effect/overlay/beam,get_turf(src),10,0,'icons/obj/projectiles_impacts.dmi')
impact.icon_state = "spur_2"
..()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB