Made Corvus/Vela no longer stop to shoot with command AI
This commit is contained in:
@@ -68,7 +68,18 @@ public class CommandAI extends AIController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateVisuals();
|
updateVisuals();
|
||||||
updateTargeting();
|
//only autotarget if the unit supports it
|
||||||
|
if(targetPos == null || unit.type.autoFindTarget){
|
||||||
|
updateTargeting();
|
||||||
|
}else if(attackTarget == null){
|
||||||
|
//if the unit does not have an attack target, is currently moving, and does not have autotargeting, stop attacking stuff
|
||||||
|
target = null;
|
||||||
|
for(var mount : unit.mounts){
|
||||||
|
if(mount.weapon.controllable){
|
||||||
|
mount.target = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(attackTarget != null && invalid(attackTarget)){
|
if(attackTarget != null && invalid(attackTarget)){
|
||||||
attackTarget = null;
|
attackTarget = null;
|
||||||
|
|||||||
@@ -212,6 +212,8 @@ public class UnitType extends UnlockableContent{
|
|||||||
bounded = true,
|
bounded = true,
|
||||||
/** if true, this unit is detected as naval - do NOT assign this manually! Initialized in init() */
|
/** if true, this unit is detected as naval - do NOT assign this manually! Initialized in init() */
|
||||||
naval = false,
|
naval = false,
|
||||||
|
/** if false, RTS AI controlled units do not automatically attack things while moving. This is automatically assigned. */
|
||||||
|
autoFindTarget = true,
|
||||||
|
|
||||||
/** if true, this modded unit always has a -outline region generated for its base. Normally, outlines are ignored if there are no top = false weapons. */
|
/** if true, this modded unit always has a -outline region generated for its base. Normally, outlines are ignored if there are no top = false weapons. */
|
||||||
alwaysCreateOutline = false,
|
alwaysCreateOutline = false,
|
||||||
@@ -688,6 +690,9 @@ public class UnitType extends UnlockableContent{
|
|||||||
lightRadius = Math.max(60f, hitSize * 2.3f);
|
lightRadius = Math.max(60f, hitSize * 2.3f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if a status effects slows a unit when firing, don't shoot while moving.
|
||||||
|
autoFindTarget = !weapons.contains(w -> w.shootStatus.speedMultiplier < 0.99f);
|
||||||
|
|
||||||
clipSize = Math.max(clipSize, lightRadius * 1.1f);
|
clipSize = Math.max(clipSize, lightRadius * 1.1f);
|
||||||
singleTarget = weapons.size <= 1 && !forceMultiTarget;
|
singleTarget = weapons.size <= 1 && !forceMultiTarget;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user