Added unit stances

This commit is contained in:
Anuken
2023-09-20 21:55:06 -04:00
parent 0d1c56fb60
commit 3e15f70efa
11 changed files with 206 additions and 30 deletions

View File

@@ -182,7 +182,12 @@ public class AIController implements UnitController{
mount.aimY = to.y;
}
unit.isShooting |= (mount.shoot = mount.rotate = shoot);
mount.shoot = mount.rotate = shoot;
if(!shouldFire()){
mount.shoot = false;
}
unit.isShooting |= mount.shoot;
if(mount.target == null && !shoot && !Angles.within(mount.rotation, mount.weapon.baseRotation, 0.01f) && noTargetTime >= rotateBackTimer){
mount.rotate = true;
@@ -202,6 +207,11 @@ public class AIController implements UnitController{
return Units.invalidateTarget(target, unit.team, x, y, range);
}
/** @return whether the unit should actually fire bullets (as opposed to just targeting something) */
public boolean shouldFire(){
return true;
}
public boolean shouldShoot(){
return true;
}