Targetp support for allied targets
This commit is contained in:
@@ -131,6 +131,11 @@ public class LogicAI extends AIController{
|
|||||||
unit.approach(vec);
|
unit.approach(vec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean checkTarget(Teamc target, float x, float y, float range){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//always retarget
|
//always retarget
|
||||||
@Override
|
@Override
|
||||||
protected boolean retarget(){
|
protected boolean retarget(){
|
||||||
|
|||||||
@@ -334,6 +334,7 @@ public abstract class BulletType extends Content{
|
|||||||
bullet.type = this;
|
bullet.type = this;
|
||||||
bullet.owner = owner;
|
bullet.owner = owner;
|
||||||
bullet.team = team;
|
bullet.team = team;
|
||||||
|
bullet.time = 0f;
|
||||||
bullet.vel.trns(angle, speed * velocityScl);
|
bullet.vel.trns(angle, speed * velocityScl);
|
||||||
if(backMove){
|
if(backMove){
|
||||||
bullet.set(x - bullet.vel.x * Time.delta, y - bullet.vel.y * Time.delta);
|
bullet.set(x - bullet.vel.x * Time.delta, y - bullet.vel.y * Time.delta);
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ public class ShrapnelBulletType extends BulletType{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(Bullet b){
|
public void init(Bullet b){
|
||||||
|
super.init(b);
|
||||||
|
|
||||||
Damage.collideLaser(b, length, hitLarge);
|
Damage.collideLaser(b, length, hitLarge);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ abstract class PayloadComp implements Posc, Rotc, Hitboxc, Unitc{
|
|||||||
pad = (width - (itemSize) * items) / items;
|
pad = (width - (itemSize) * items) / items;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Payload p : payloads){
|
for(Payload p : payloads){
|
||||||
table.image(p.icon(Cicon.small)).size(itemSize).padRight(pad);
|
table.image(p.icon(Cicon.small)).size(itemSize).padRight(pad);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ public class AIController implements UnitController{
|
|||||||
targets[i] = findTarget(mountX, mountY, weapon.bullet.range(), weapon.bullet.collidesAir, weapon.bullet.collidesGround);
|
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;
|
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(){
|
protected boolean shouldShoot(){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -182,11 +182,11 @@ public class UnitType extends UnlockableContent{
|
|||||||
|
|
||||||
var count = new float[]{-1};
|
var count = new float[]{-1};
|
||||||
bars.table().update(t -> {
|
bars.table().update(t -> {
|
||||||
if(count[0] != payload.payloadUsed()) {
|
if(count[0] != payload.payloadUsed()){
|
||||||
payload.contentInfo(t, 8 * 2, 270);
|
payload.contentInfo(t, 8 * 2, 270);
|
||||||
count[0] = payload.payloadUsed();
|
count[0] = payload.payloadUsed();
|
||||||
}
|
}
|
||||||
}).growX().left();
|
}).growX().left().height(0f).pad(0f);
|
||||||
}
|
}
|
||||||
}).growX();
|
}).growX();
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ public class CommandCenter extends Block{
|
|||||||
destructible = true;
|
destructible = true;
|
||||||
solid = true;
|
solid = true;
|
||||||
configurable = true;
|
configurable = true;
|
||||||
|
drawDisabled = false;
|
||||||
|
|
||||||
config(UnitCommand.class, (CommandBuild build, UnitCommand command) -> {
|
config(UnitCommand.class, (CommandBuild build, UnitCommand command) -> {
|
||||||
build.team.data().command = command;
|
build.team.data().command = command;
|
||||||
|
|||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
org.gradle.daemon=true
|
org.gradle.daemon=true
|
||||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||||
archash=b2f3d212c1a88a62f140f5cb04f4c86e61332d1c
|
archash=c55aa1fe790c50db389225d9a2287b57f71260ff
|
||||||
|
|||||||
Reference in New Issue
Block a user