Removed usage of BoostAI in enter payload command
This commit is contained in:
@@ -87,7 +87,7 @@ public class UnitCommand extends MappableContent{
|
||||
mineCommand = new UnitCommand("mine", "production", Binding.unitCommandMine, u -> new MinerAI()){{
|
||||
refreshOnSelect = true;
|
||||
}};
|
||||
enterPayloadCommand = new UnitCommand("enterPayload", "downOpen", Binding.unitCommandEnterPayload, u -> new BoostAI()){{
|
||||
enterPayloadCommand = new UnitCommand("enterPayload", "downOpen", Binding.unitCommandEnterPayload, null){{
|
||||
switchToMove = false;
|
||||
drawTarget = true;
|
||||
resetTarget = false;
|
||||
|
||||
@@ -89,7 +89,7 @@ public class UnitStance extends MappableContent{
|
||||
}};
|
||||
ram = new UnitStance("ram", "rightOpen", Binding.unitStanceRam);
|
||||
boost = new UnitStance("boost", "up", Binding.unitStanceBoost){{
|
||||
incompatibleCommands.addAll(UnitCommand.rebuildCommand, UnitCommand.repairCommand, UnitCommand.assistCommand);
|
||||
incompatibleCommands.addAll(UnitCommand.rebuildCommand, UnitCommand.repairCommand, UnitCommand.assistCommand, UnitCommand.enterPayloadCommand);
|
||||
}};
|
||||
holdPosition = new UnitStance("holdposition", "effect", Binding.unitStanceHoldPosition);
|
||||
mineAuto = new UnitStance("mineauto", "settings", null, false);
|
||||
|
||||
@@ -16,6 +16,8 @@ public class BoostAI extends AIController{
|
||||
if(ai.attackTarget != null && unit.within(ai.attackTarget, unit.range())){
|
||||
unit.command().command(UnitCommand.moveCommand);
|
||||
}
|
||||
}else{
|
||||
unit.updateBoosting(true, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ public class CommandAI extends AIController{
|
||||
commandController.updateUnit();
|
||||
}else{
|
||||
defaultBehavior();
|
||||
if(hasStance(UnitStance.boost) && unit.type.canBoost){
|
||||
if(shouldBoost() && unit.type.canBoost){
|
||||
//auto land when near target
|
||||
if(attackTarget != null && unit.within(attackTarget, unit.range())){
|
||||
unit.updateBoosting(false);
|
||||
@@ -171,6 +171,10 @@ public class CommandAI extends AIController{
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean shouldBoost(){
|
||||
return hasStance(UnitStance.boost) || command == UnitCommand.enterPayloadCommand;
|
||||
}
|
||||
|
||||
public void clearCommands(){
|
||||
commandQueue.clear();
|
||||
targetPos = null;
|
||||
|
||||
Reference in New Issue
Block a user