Skip to content

Commit

Permalink
Fixed space dragon's gust ability hitting people through walls (BeeSt…
Browse files Browse the repository at this point in the history
…ation#11121)

* Update space_dragon.dm

* stuffs

* Update space_dragon.dm
  • Loading branch information
XeonMations authored and EvilDragonfiend committed Jul 30, 2024
1 parent 01d39bc commit 57f99c4
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions code/modules/mob/living/simple_animal/hostile/space_dragon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
/// A multiplier to how much each use of wing gust should add to the tiredness variable. Set to 5 if the current rift is destroyed.
var/tiredness_mult = 1
/// The distance Space Dragon's gust reaches
var/gust_distance = 4
var/gust_distance = 3
/// The amount of tiredness to add to Space Dragon per use of gust
var/gust_tiredness = 30
/// Determines whether or not Space Dragon is in the middle of using wing gust. If set to true, prevents him from moving and doing certain actions.
Expand Down Expand Up @@ -414,13 +414,20 @@
overlay.appearance_flags = RESET_COLOR
add_overlay(overlay)
playsound(src, 'sound/effects/gravhit.ogg', 100, TRUE)
for (var/mob/living/candidate in view(gust_distance, src))
if(candidate == src || candidate.faction_check_mob(src))
var/list/candidates_flung = list()
for (var/turf/epicenter in view(1, usr.loc))
if(istype(epicenter, /turf/closed)) //Gusts dont go through walls.
continue
for (var/mob/living/mob in view(gust_distance, epicenter))
if(mob == src || mob.faction_check_mob(src))
continue
candidates_flung |= mob

for(var/mob/living/candidate in candidates_flung)
visible_message("<span class='boldwarning'>[candidate] is knocked back by the gust!</span>")
to_chat(candidate, "<span class='userdanger'>You're knocked back by the gust!</span>")
var/dir_to_target = get_dir(get_turf(src), get_turf(candidate))
var/throwtarget = get_edge_target_turf(target, dir_to_target)
var/throwtarget = get_edge_target_turf(candidate, dir_to_target)
candidate.safe_throw_at(throwtarget, 10, 1, src)
candidate.Paralyze(50)
addtimer(CALLBACK(src, PROC_REF(reset_status)), 4 + ((tiredness * tiredness_mult) / 10))
Expand Down

0 comments on commit 57f99c4

Please sign in to comment.