Allow dual-targetting of enemies directly in front

This commit is contained in:
stevenhowes
2021-02-05 20:17:34 +00:00
parent 13b13832bb
commit ed9a764cde
2 changed files with 5 additions and 4 deletions
Binary file not shown.
+5 -4
View File
@@ -273,10 +273,11 @@ ENDPROC
REM Calculate player ship's phaser arc
DEF PROCplayer_arc_calculatetarget
NoseX% = PlayerLocation%(X) + PlayerHitbox%(0) + (PlayerHitbox%(2)/2)
NoseX% = PlayerLocation%(x) + PlayerHitbox%(0) + (PlayerHitbox%(2)/2)
NoseXLeft% = PlayerLocation%(X) + PlayerHitbox%(0)
NoseXRight% = PlayerLocation%(X) + PlayerHitbox%(0) + PlayerHitbox%(2)
NoseY% = (PlayerLocation%(Y) + PlayerHitbox%(1) + PlayerHitbox%(3))
LeftDistance% = 1000
LeftID% = -1
RightDistance% = 1000
@@ -291,13 +292,13 @@ DEF PROCplayer_arc_calculatetarget
DistanceX% = ABS(NoseX% - ((LeftCornerX% + RightCornerX%) / 2))
IF (DistanceY%/5) > DistanceX% THEN
IF (NoseX% - ((LeftCornerX% + RightCornerX%) / 2)) > 0 THEN
IF (NoseXRight% - ((LeftCornerX% + RightCornerX%) / 2)) > 0 THEN
IF DistanceY% < LeftDistance% THEN
LeftDistance% = DistanceY%
LeftID% = Enemy%
ENDIF
ENDIF
IF (NoseX% - ((LeftCornerX% + RightCornerX%) / 2)) < 0 THEN
IF (NoseXLeft% - ((LeftCornerX% + RightCornerX%) / 2)) < 0 THEN
IF DistanceY% < RightDistance% THEN
RightDistance% = DistanceY%
RightID% = Enemy%