Skip to content

Commit

Permalink
bugfix: Few Projectile Runtimes (#5257)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gottfrei authored Jun 22, 2024
1 parent 424046b commit a84407f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,15 +212,16 @@ Difficulty: Very Hard
icon_state = initial(icon_state)

/mob/living/simple_animal/hostile/megafauna/colossus/proc/shoot_projectile(turf/marker, set_angle)
if(!isnum(set_angle) && (!marker || marker == loc))
// a lot of sleeps around colossus shooting, so its better to check if our marker is still exist by this point
if(QDELETED(marker) || marker == loc)
return
var/turf/startloc = get_turf(src)
var/obj/item/projectile/P = new /obj/item/projectile/colossus(startloc)
P.preparePixelProjectile(marker, marker, startloc)
P.preparePixelProjectile(marker, marker, src)
P.firer = src
if(target)
P.original = target
P.fire(set_angle)
P.fire(isnum(set_angle) ? set_angle : null)

/mob/living/simple_animal/hostile/megafauna/colossus/proc/random_shots(do_sleep = TRUE)
ranged_cooldown = world.time + 30
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
shoot_projectile(marker, set_angle - 15, FALSE, FALSE)
else
var/obj/item/projectile/herald/teleshot/H = new(startloc)
H.preparePixelProjectile(marker, marker, startloc)
H.preparePixelProjectile(marker, marker, src)
H.firer = src
H.damage = H.damage * dif_mult_dmg
if(target)
Expand Down
21 changes: 11 additions & 10 deletions code/modules/projectiles/projectile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,17 @@
var/list/shift = list("x" = 0, "y" = 0)
var/turf/step_over = get_step(target_loca, splatter_dir)

if(get_splatter_blockage(step_over, target, splatter_dir, target_loca)) //If you can't cross the tile or any of its relevant obstacles...
shift = pixel_shift_dir(splatter_dir) //Pixel shift the blood there instead (so you can't see wallsplatter through walls).
else
target_loca = step_over
L.add_splatter_floor(target_loca, shift_x = shift["x"], shift_y = shift["y"])
if(istype(H))
for(var/mob/living/carbon/human/M in step_over) //Bloody the mobs who're infront of the spray.
M.bloody_hands(H)
/* Uncomment when bloody_body stops randomly not transferring blood colour.
M.bloody_body(H) */
if(step_over)
if(get_splatter_blockage(step_over, target, splatter_dir, target_loca)) //If you can't cross the tile or any of its relevant obstacles...
shift = pixel_shift_dir(splatter_dir) //Pixel shift the blood there instead (so you can't see wallsplatter through walls).
else
target_loca = step_over
L.add_splatter_floor(target_loca, shift_x = shift["x"], shift_y = shift["y"])
if(istype(H))
for(var/mob/living/carbon/human/M in step_over) //Bloody the mobs who're infront of the spray.
M.bloody_hands(H)
/* Uncomment when bloody_body stops randomly not transferring blood colour.
M.bloody_body(H) */

else if(impact_effect_type)
new impact_effect_type(target_loca, hitx, hity)
Expand Down

0 comments on commit a84407f

Please sign in to comment.