Added unit stances
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user