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()){{
|
mineCommand = new UnitCommand("mine", "production", Binding.unitCommandMine, u -> new MinerAI()){{
|
||||||
refreshOnSelect = true;
|
refreshOnSelect = true;
|
||||||
}};
|
}};
|
||||||
enterPayloadCommand = new UnitCommand("enterPayload", "downOpen", Binding.unitCommandEnterPayload, u -> new BoostAI()){{
|
enterPayloadCommand = new UnitCommand("enterPayload", "downOpen", Binding.unitCommandEnterPayload, null){{
|
||||||
switchToMove = false;
|
switchToMove = false;
|
||||||
drawTarget = true;
|
drawTarget = true;
|
||||||
resetTarget = false;
|
resetTarget = false;
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ public class UnitStance extends MappableContent{
|
|||||||
}};
|
}};
|
||||||
ram = new UnitStance("ram", "rightOpen", Binding.unitStanceRam);
|
ram = new UnitStance("ram", "rightOpen", Binding.unitStanceRam);
|
||||||
boost = new UnitStance("boost", "up", Binding.unitStanceBoost){{
|
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);
|
holdPosition = new UnitStance("holdposition", "effect", Binding.unitStanceHoldPosition);
|
||||||
mineAuto = new UnitStance("mineauto", "settings", null, false);
|
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())){
|
if(ai.attackTarget != null && unit.within(ai.attackTarget, unit.range())){
|
||||||
unit.command().command(UnitCommand.moveCommand);
|
unit.command().command(UnitCommand.moveCommand);
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
unit.updateBoosting(true, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ public class CommandAI extends AIController{
|
|||||||
commandController.updateUnit();
|
commandController.updateUnit();
|
||||||
}else{
|
}else{
|
||||||
defaultBehavior();
|
defaultBehavior();
|
||||||
if(hasStance(UnitStance.boost) && unit.type.canBoost){
|
if(shouldBoost() && unit.type.canBoost){
|
||||||
//auto land when near target
|
//auto land when near target
|
||||||
if(attackTarget != null && unit.within(attackTarget, unit.range())){
|
if(attackTarget != null && unit.within(attackTarget, unit.range())){
|
||||||
unit.updateBoosting(false);
|
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(){
|
public void clearCommands(){
|
||||||
commandQueue.clear();
|
commandQueue.clear();
|
||||||
targetPos = null;
|
targetPos = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user