Skip to content

Commit

Permalink
Dir assist now prioritises non-xenos (#6461)
Browse files Browse the repository at this point in the history
# About the pull request
This PR makes it so when using dir assist against a xeno and a non-xeno
on the same tile the attack will prioritize the non-xeno over the xeno.
<!-- Remove this text and explain what the purpose of your PR is.

Mention if you have tested your changes. If you changed a map, make sure
you used the mapmerge tool.
If this is an Issue Correction, you can type "Fixes Issue #169420" to
link the PR to the corresponding Issue number #169420.

Remember: something that is self-evident to you might not be to others.
Explain your rationale fully, even if you feel it goes without saying.
-->

# Explain why it's good for the game
You are more likely to want to target the marine than shove\slash the
xeno ontop of the marine.
It is annoying when John runner stands ontop of the guy you are
currently pulling and now you have to click the 3 remaining pixels
visible.
# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog
:cl:
qol: Dir-assist will now prioritize non-xenos over xenos.
/:cl:
  • Loading branch information
Git-Nivrak committed Jun 18, 2024
1 parent 8c300a4 commit 86f1566
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion code/_onclick/xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

if(isturf(target) && tile_attack) //Attacks on turfs must be done indirectly through directional attacks or clicking own sprite.
var/turf/T = target
var/mob/living/non_xeno_target
for(var/mob/living/L in T)
if (!iscarbon(L))
if (!alt)
Expand All @@ -21,13 +22,19 @@

if (!L.is_xeno_grabbable() || L == src) //Xenos never attack themselves.
continue
var/isxeno = isxeno(L)
if(!isxeno)
non_xeno_target = L
if (L.body_position == LYING_DOWN)
alt = L
continue
else if (!isxeno)
break
target = L
break
if (target == T && alt)
target = alt
if(non_xeno_target)
target = non_xeno_target
if (T && ignores_resin) // Will not target resin walls and doors if this is set to true. This is normally only set to true through a directional attack.
if(istype(T, /obj/structure/mineral_door/resin))
var/obj/structure/mineral_door/resin/attacked_door = T
Expand Down

0 comments on commit 86f1566

Please sign in to comment.