mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-21 01:37:13 +07:00
Misc bugfixes, AI hit retaliation
This commit is contained in:
parent
f6e68e91d0
commit
6740b60af2
@ -122,6 +122,13 @@ public class CommandAI extends AIController{
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hit(Bullet bullet){
|
||||
if(unit.team.isAI() && bullet.owner instanceof Teamc teamc && teamc.team() != unit.team && attackTarget == null){
|
||||
commandTarget(teamc, true);
|
||||
}
|
||||
}
|
||||
|
||||
public static float cohesionScl = 0.3f;
|
||||
public static float cohesionRad = 3f, separationRad = 1.1f, separationScl = 1f, flockMult = 0.5f;
|
||||
|
||||
|
@ -39,7 +39,7 @@ public class UnitTypes{
|
||||
//legs
|
||||
public static @EntityDef({Unitc.class, Legsc.class}) UnitType corvus, atrax,
|
||||
merui, cleroi, anthicus,
|
||||
tecta, collaris; //TODO horrid name here
|
||||
tecta, collaris;
|
||||
|
||||
//legs, legacy
|
||||
public static @EntityDef(value = {Unitc.class, Legsc.class}, legacy = true) UnitType spiroct, arkyid, toxopid;
|
||||
@ -2523,7 +2523,6 @@ public class UnitTypes{
|
||||
spread = 3.5f;
|
||||
}};
|
||||
|
||||
//TODO make this look nicer
|
||||
bullet = new RailBulletType(){{
|
||||
length = 160f;
|
||||
damage = 48f;
|
||||
@ -2699,7 +2698,6 @@ public class UnitTypes{
|
||||
fragBullets = 5;
|
||||
fragVelocityMin = 1f;
|
||||
|
||||
//TODO
|
||||
fragBullet = new BasicBulletType(8f, 25){{
|
||||
sprite = "missile-large";
|
||||
width = 8f;
|
||||
@ -3324,7 +3322,6 @@ public class UnitTypes{
|
||||
weaveMag = 4;
|
||||
weaveScale = 4;
|
||||
lifetime = 55f;
|
||||
//TODO better
|
||||
shootEffect = Fx.shootBig2;
|
||||
smokeEffect = Fx.shootSmokeTitan;
|
||||
splashDamage = 60f;
|
||||
@ -3454,7 +3451,6 @@ public class UnitTypes{
|
||||
|
||||
despawnEffect = Fx.none;
|
||||
|
||||
//TODO diff effect
|
||||
hitEffect = despawnEffect = new ExplosionEffect(){{
|
||||
lifetime = 30f;
|
||||
waveStroke = 2f;
|
||||
@ -3571,7 +3567,6 @@ public class UnitTypes{
|
||||
mirror = false;
|
||||
shoot = new ShootHelix();
|
||||
|
||||
//TODO cooler + balancing
|
||||
bullet = new BasicBulletType(5f, 34){{
|
||||
width = 7f;
|
||||
height = 12f;
|
||||
@ -3946,7 +3941,6 @@ public class UnitTypes{
|
||||
|
||||
float coreFleeRange = 500f;
|
||||
|
||||
//TODO bad name
|
||||
evoke = new ErekirUnitType("evoke"){{
|
||||
coreUnitDock = true;
|
||||
controller = u -> new BuilderAI(true, coreFleeRange);
|
||||
|
@ -263,6 +263,13 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
||||
return hittable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void collision(Hitboxc other, float x, float y){
|
||||
if(other instanceof Bullet bullet){
|
||||
controller.hit(bullet);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int itemCapacity(){
|
||||
return type.itemCapacity;
|
||||
|
@ -6,6 +6,10 @@ public interface UnitController{
|
||||
void unit(Unit unit);
|
||||
Unit unit();
|
||||
|
||||
default void hit(Bullet bullet){
|
||||
|
||||
}
|
||||
|
||||
default boolean isValidController(){
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user