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