Implemented ammo ressuplying

This commit is contained in:
Anuken
2018-04-24 21:38:57 -04:00
parent 8581213126
commit deefab8a5b
25 changed files with 259 additions and 114 deletions

View File

@@ -1,16 +1,16 @@
package io.anuke.mindustry.content;
import io.anuke.mindustry.content.bullets.TurretBullets;
import io.anuke.mindustry.content.fx.ShootFx;
import io.anuke.mindustry.resource.Weapon;
public class Weapons {
public static final Weapon
blaster = new Weapon("blaster", 12, TurretBullets.basicIron) {
{
effect = ShootFx.shootSmall;
length = 2f;
}
};
blaster = new Weapon("blaster") {{
length = 1.5f;
reload = 15f;
roundrobin = true;
ejectEffect = ShootFx.shellEjectSmall;
setAmmo(AmmoTypes.basicIron);
}};
}

View File

@@ -90,15 +90,16 @@ public class ShootFx {
shellEjectSmall = new GroundEffect(30f, 400f, e -> {
Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Palette.lightishGray, e.fin());
float rot = e.rotation + 90f;
for(int i : Mathf.signs){
float len = (2f + e.finpow()*6f) * i;
float lr = rot + e.fin()*30f*i;
Draw.rect("white",
e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.fin()),
e.y + Angles.trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.fin()),
1f, 2f, rot + e.fin()*50f*i);
}
float rot = Math.abs(e.rotation) + 90f;
int i = Mathf.sign(e.rotation);
float len = (2f + e.finpow()*6f) * i;
float lr = rot + e.fin()*30f*i;
Draw.rect("white",
e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.fin()),
e.y + Angles.trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.fin()),
1f, 2f, rot + e.fin()*50f*i);
Draw.color();
}),