Ammo things added

This commit is contained in:
Anuken
2018-04-01 21:07:52 -04:00
parent ec5f74b753
commit 20b95fa063
5 changed files with 20 additions and 9 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

View File

@ -1,7 +1,7 @@
#Autogenerated file. Do not modify. #Autogenerated file. Do not modify.
#Sun Apr 01 11:42:10 EDT 2018 #Sun Apr 01 16:18:18 EDT 2018
version=release version=release
androidBuildCode=809 androidBuildCode=811
name=Mindustry name=Mindustry
code=3.4 code=3.4
build=custom build build=custom build

View File

@ -0,0 +1,4 @@
package io.anuke.mindustry.content;
public class AmmoTypes {
}

View File

@ -2,7 +2,14 @@ package io.anuke.mindustry.resource;
import io.anuke.mindustry.entities.bullets.BulletType; import io.anuke.mindustry.entities.bullets.BulletType;
public abstract class AmmoType { public class AmmoType {
public final Item item;
public final BulletType bullet;
public final int multiplier;
public abstract BulletType getBullet(Item item); public AmmoType(Item item, BulletType result, int multiplier){
this.item = item;
this.bullet = result;
this.multiplier = multiplier;
}
} }

View File

@ -5,6 +5,7 @@ import io.anuke.mindustry.entities.*;
import io.anuke.mindustry.entities.bullets.BulletType; import io.anuke.mindustry.entities.bullets.BulletType;
import io.anuke.mindustry.graphics.fx.Fx; import io.anuke.mindustry.graphics.fx.Fx;
import io.anuke.mindustry.graphics.Layer; import io.anuke.mindustry.graphics.Layer;
import io.anuke.mindustry.resource.AmmoType;
import io.anuke.mindustry.resource.Item; import io.anuke.mindustry.resource.Item;
import io.anuke.mindustry.world.*; import io.anuke.mindustry.world.*;
import io.anuke.ucore.core.Effects; import io.anuke.ucore.core.Effects;
@ -38,9 +39,7 @@ public class Turret extends Block{
protected float shotTransation = 2; protected float shotTransation = 2;
protected float shotDelayScale = 0; protected float shotDelayScale = 0;
protected String shootsound = "shoot"; protected String shootsound = "shoot";
protected io.anuke.mindustry.entities.bullets.BulletType bullet = BulletType.iron; protected AmmoType[] ammoTypes;
protected Item ammo;
protected int ammoMultiplier = 20;
protected int maxammo = 400; protected int maxammo = 400;
protected float rotatespeed = 0.2f; protected float rotatespeed = 0.2f;
protected float shootCone = 5f; protected float shootCone = 5f;
@ -67,12 +66,13 @@ public class Turret extends Block{
@Override @Override
public void setStats(){ public void setStats(){
super.setStats(); super.setStats();
/*
if(ammo != null) stats.add("ammo", ammo); if(ammo != null) stats.add("ammo", ammo);
if(ammo != null) stats.add("ammocapacity", maxammo); if(ammo != null) stats.add("ammocapacity", maxammo);
if(ammo != null) stats.add("ammoitem", ammoMultiplier); if(ammo != null) stats.add("ammoitem", ammoMultiplier);*/
stats.add("range", (int)range); stats.add("range", (int)range);
stats.add("inaccuracy", (int)inaccuracy); stats.add("inaccuracy", (int)inaccuracy);
stats.add("damageshot", bullet.damage); //stats.add("damageshot", bullet.damage);
stats.add("shotssecond", Strings.toFixed(60f/reload, 1)); stats.add("shotssecond", Strings.toFixed(60f/reload, 1));
stats.add("shots", shots); stats.add("shots", shots);
} }