next level logic

This commit is contained in:
Crizomb 2025-01-28 04:11:53 +01:00
parent ee2a5fdf08
commit 37bed1fd33
16 changed files with 130 additions and 38 deletions

View file

@ -11,7 +11,18 @@ public class AttackProjectile : AttackHandler
public override bool Attack()
{
// If no target (target is dead an destroyed)
if (!_minecraftUnit.MovementHandler.TargetUnit) _minecraftUnit.MovementHandler.UpdateNearest();
if (!_minecraftUnit.MovementHandler.TargetUnit)
{
if (_minecraftUnit.IsTeamA)
{
if (GlobalsVariable.AliveUnitsTeamB.Count == 0) return false;
}
else
{
if (GlobalsVariable.AliveUnitsTeamA.Count == 0) return false;
}
_minecraftUnit.MovementHandler.UpdateNearest();
}
float launchAngle = findLaunchAngle();
//print(launchAngle);
// If target not reachable