Re-definition of all ammo and new turrets

This commit is contained in:
Anuken
2018-05-28 12:28:50 -04:00
parent 83c3a80766
commit 857f36e01a
42 changed files with 985 additions and 850 deletions

View File

@@ -1,5 +1,6 @@
package io.anuke.mindustry.entities.bullet;
import com.badlogic.gdx.utils.Array;
import io.anuke.mindustry.content.StatusEffects;
import io.anuke.mindustry.content.fx.BulletFx;
import io.anuke.mindustry.entities.StatusEffect;
@@ -7,6 +8,10 @@ import io.anuke.ucore.core.Effects;
import io.anuke.ucore.entities.BaseBulletType;
public abstract class BulletType extends BaseBulletType<Bullet>{
private static int lastid = 0;
private static Array<BulletType> types = new Array<>();
public final int id;
/**Knockback in velocity.*/
public float knockback;
/**Whether this bullet hits tiles.*/
@@ -19,11 +24,14 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
public float armorPierce = 0f;
public BulletType(float speed, float damage){
this.id = lastid ++;
this.speed = speed;
this.damage = damage;
lifetime = 40f;
hiteffect = BulletFx.hitBulletSmall;
despawneffect = BulletFx.despawn;
types.add(this);
}
@Override
@@ -35,4 +43,12 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
public void despawned(Bullet b){
Effects.effect(despawneffect, b.x, b.y, b.angle());
}
public static BulletType getByID(int id){
return types.get(id);
}
public static Array<BulletType> all(){
return types;
}
}

View File

@@ -7,7 +7,7 @@ public class Brute extends GroundUnitType {
public Brute(String name) {
super(name);
setAmmo(AmmoTypes.basicIron);
setAmmo(AmmoTypes.bulletIron);
}
}

View File

@@ -16,7 +16,7 @@ public class Cruiser extends FlyingUnitType {
public Cruiser(){
super("vtol");
setAmmo(AmmoTypes.basicIron);
setAmmo(AmmoTypes.bulletIron);
speed = 0.2f;
maxVelocity = 1.4f;
health = 300f;

View File

@@ -7,6 +7,6 @@ public class Scout extends GroundUnitType {
public Scout(){
super("scout");
setAmmo(AmmoTypes.basicIron);
setAmmo(AmmoTypes.bulletIron);
}
}

View File

@@ -15,7 +15,7 @@ public class Vtol extends FlyingUnitType {
public Vtol(){
super("vtol");
setAmmo(AmmoTypes.basicIron);
setAmmo(AmmoTypes.bulletIron);
speed = 0.3f;
maxVelocity = 2f;
reload = 7;