AI bugfixes / Balance
This commit is contained in:
@@ -18,6 +18,10 @@ public class BombBulletType extends BasicBulletType{
|
||||
hitSound = Sounds.explosion;
|
||||
}
|
||||
|
||||
public BombBulletType(float damage, float radius){
|
||||
this(damage, radius, "shell");
|
||||
}
|
||||
|
||||
public BombBulletType(){
|
||||
this(1f, 1f, "shell");
|
||||
}
|
||||
|
||||
@@ -13,6 +13,9 @@ import mindustry.game.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.graphics.*;
|
||||
import mindustry.type.*;
|
||||
import mindustry.world.*;
|
||||
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
public abstract class BulletType extends Content{
|
||||
public float lifetime = 40f;
|
||||
@@ -98,6 +101,11 @@ public abstract class BulletType extends Content{
|
||||
public float weaveMag = -1f;
|
||||
public float hitShake = 0f;
|
||||
|
||||
public int puddles;
|
||||
public float puddleRange;
|
||||
public float puddleAmount = 5f;
|
||||
public Liquid puddleLiquid = Liquids.water;
|
||||
|
||||
public float lightRadius = 16f;
|
||||
public float lightOpacity = 0.3f;
|
||||
public Color lightColor = Pal.powerLight;
|
||||
@@ -144,6 +152,13 @@ public abstract class BulletType extends Content{
|
||||
}
|
||||
}
|
||||
|
||||
if(puddleLiquid != null && puddles > 0){
|
||||
for(int i = 0; i < puddles; i++){
|
||||
Tile tile = world.tileWorld(x + Mathf.range(puddleRange), y + Mathf.range(puddleRange));
|
||||
Puddles.deposit(tile, puddleLiquid, puddleAmount);
|
||||
}
|
||||
}
|
||||
|
||||
if(Mathf.chance(incendChance)){
|
||||
Damage.createIncend(x, y, incendSpread, incendAmount);
|
||||
}
|
||||
|
||||
@@ -13,8 +13,9 @@ import mindustry.type.*;
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
@Component
|
||||
abstract class WeaponsComp implements Teamc, Posc, Rotc{
|
||||
abstract class WeaponsComp implements Teamc, Posc, Rotc, Velc{
|
||||
@Import float x, y, rotation, reloadMultiplier;
|
||||
@Import Vec2 vel;
|
||||
|
||||
/** minimum cursor distance from unit, fixes 'cross-eyed' shooting */
|
||||
static final float minAimDst = 18f;
|
||||
@@ -111,6 +112,7 @@ abstract class WeaponsComp implements Teamc, Posc, Rotc{
|
||||
if(mount.shoot && //must be shooting
|
||||
(ammo > 0 || !state.rules.unitAmmo || team().rules().infiniteAmmo) && //check ammo
|
||||
(!weapon.alternate || mount.side == weapon.flipSprite) &&
|
||||
vel.len() >= mount.weapon.minShootVelocity && //check velocity requirements
|
||||
mount.reload <= 0.0001f && //reload has to be 0
|
||||
Angles.within(weapon.rotate ? mount.rotation : this.rotation, mount.targetRotation, mount.weapon.shootCone) //has to be within the cone
|
||||
){
|
||||
|
||||
Reference in New Issue
Block a user