Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PTBF] Hallucination - Meet the Sniper #27579

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions code/modules/hallucinations/effects/major.dm
Original file line number Diff line number Diff line change
Expand Up @@ -408,3 +408,66 @@
if(images && images[1])
images[1].icon = 'icons/mob/alien.dmi'
images[1].icon_state = "alienh_pounce"

/**
* # Hallucination - Sniper
*
* Fires a penetrator round at the target. On hit, knockdown + stam loss + hallucinated blood splatter for a bit.
*/
/obj/effect/hallucination/sniper
PollardTheDragon marked this conversation as resolved.
Show resolved Hide resolved
duration = 15 SECONDS

/obj/effect/hallucination/sniper/Initialize(mapload, mob/living/carbon/target)
. = ..()

// Find a start spot for the sniper bullet
var/list/possible_turfs = list()
for(var/turf/t in range(world.view + 5, target))
if(get_dist(t, target.loc) > world.view)
possible_turfs += t
if(!length(possible_turfs))
return

// Fire the bullet
var/turf/shot_loc = get_turf(pick(possible_turfs))
var/obj/item/projectile/bullet/sniper/penetrator/hallucination/bullet = new(shot_loc)
PollardTheDragon marked this conversation as resolved.
Show resolved Hide resolved
bullet.Angle = round(get_angle(src, target))
// Start flying
bullet.trajectory = new(bullet.x, bullet.y, bullet.z, bullet.pixel_x, bullet.pixel_y, bullet.Angle, SSprojectiles.global_pixel_speed)
bullet.last_projectile_move = world.time
bullet.has_been_fired = TRUE
target.playsound_local(shot_loc, 'sound/weapons/gunshots/gunshot_sniper.ogg', 50)

/obj/item/projectile/bullet/sniper/penetrator/hallucination
damage_type = STAMINA
knockdown = 2

/obj/item/projectile/bullet/sniper/penetrator/hallucination/on_hit(atom/target, blocked, hit_zone)
. = ..()
// Force blood splatter
var/turf/target_loca = get_turf(target)
var/mob/living/L = target
var/mob/living/carbon/human/H
var/splatter_dir = dir
if(starting)
splatter_dir = get_dir(starting, target_loca)
if(isalien(L))
new /obj/effect/temp_visual/dir_setting/bloodsplatter/xenosplatter(target_loca, splatter_dir)
else
var/blood_color = "#C80000"
if(ishuman(target))
H = target
blood_color = H.dna.species.blood_color
new /obj/effect/temp_visual/dir_setting/bloodsplatter(target_loca, splatter_dir, blood_color)
PollardTheDragon marked this conversation as resolved.
Show resolved Hide resolved
if(prob(33))
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.make_bloody_hands(H.get_blood_dna_list(), H.get_blood_color())
1 change: 1 addition & 0 deletions code/modules/hallucinations/hallucinations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ GLOBAL_LIST_INIT(hallucinations, list(
/obj/effect/hallucination/assault = 10,
/obj/effect/hallucination/terror_infestation = 10,
/obj/effect/hallucination/loose_energy_ball = 10,
/obj/effect/hallucination/sniper = 10,
)
))

Expand Down
Loading