Targetp support for allied targets

This commit is contained in:
Anuken 2021-01-09 10:31:44 -05:00
parent b762a5028b
commit 21fd20ea5b
8 changed files with 18 additions and 5 deletions

View File

@ -131,6 +131,11 @@ public class LogicAI extends AIController{
unit.approach(vec);
}
@Override
protected boolean checkTarget(Teamc target, float x, float y, float range){
return false;
}
//always retarget
@Override
protected boolean retarget(){

View File

@ -334,6 +334,7 @@ public abstract class BulletType extends Content{
bullet.type = this;
bullet.owner = owner;
bullet.team = team;
bullet.time = 0f;
bullet.vel.trns(angle, speed * velocityScl);
if(backMove){
bullet.set(x - bullet.vel.x * Time.delta, y - bullet.vel.y * Time.delta);

View File

@ -33,6 +33,8 @@ public class ShrapnelBulletType extends BulletType{
@Override
public void init(Bullet b){
super.init(b);
Damage.collideLaser(b, length, hitLarge);
}

View File

@ -158,7 +158,7 @@ abstract class PayloadComp implements Posc, Rotc, Hitboxc, Unitc{
pad = (width - (itemSize) * items) / items;
}
for (Payload p : payloads){
for(Payload p : payloads){
table.image(p.icon(Cicon.small)).size(itemSize).padRight(pad);
}
}

View File

@ -123,7 +123,7 @@ public class AIController implements UnitController{
targets[i] = findTarget(mountX, mountY, weapon.bullet.range(), weapon.bullet.collidesAir, weapon.bullet.collidesGround);
}
if(Units.invalidateTarget(targets[i], unit.team, mountX, mountY, weapon.bullet.range())){
if(checkTarget(targets[i], mountX, mountY, weapon.bullet.range())){
targets[i] = null;
}
}
@ -149,6 +149,10 @@ public class AIController implements UnitController{
}
}
protected boolean checkTarget(Teamc target, float x, float y, float range){
return Units.invalidateTarget(target, unit.team, x, y, range);
}
protected boolean shouldShoot(){
return true;
}

View File

@ -182,11 +182,11 @@ public class UnitType extends UnlockableContent{
var count = new float[]{-1};
bars.table().update(t -> {
if(count[0] != payload.payloadUsed()) {
if(count[0] != payload.payloadUsed()){
payload.contentInfo(t, 8 * 2, 270);
count[0] = payload.payloadUsed();
}
}).growX().left();
}).growX().left().height(0f).pad(0f);
}
}).growX();

View File

@ -31,6 +31,7 @@ public class CommandCenter extends Block{
destructible = true;
solid = true;
configurable = true;
drawDisabled = false;
config(UnitCommand.class, (CommandBuild build, UnitCommand command) -> {
build.team.data().command = command;

View File

@ -1,3 +1,3 @@
org.gradle.daemon=true
org.gradle.jvmargs=-Xms256m -Xmx1024m
archash=b2f3d212c1a88a62f140f5cb04f4c86e61332d1c
archash=c55aa1fe790c50db389225d9a2287b57f71260ff