Targetp support for allied targets
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -33,6 +33,8 @@ public class ShrapnelBulletType extends BulletType{
|
||||
|
||||
@Override
|
||||
public void init(Bullet b){
|
||||
super.init(b);
|
||||
|
||||
Damage.collideLaser(b, length, hitLarge);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user