Fixed build errors

This commit is contained in:
Anuken
2018-05-01 16:02:42 -04:00
parent 8a83e0fc1a
commit 1bf728359d
5 changed files with 34 additions and 9 deletions

View File

@@ -21,6 +21,8 @@ public class AmmoType {
public final float quantityMultiplier;
/**Reload speed multiplier.*/
public float speedMultiplier = 1f;
/**Bullet recoil strength.*/
public float recoil = 0f;
/**Effect created when shooting.*/
public Effect shootEffect = Fx.none;
/**Extra smoke effect created when shooting.*/

View File

@@ -94,10 +94,15 @@ public class Weapon extends Upgrade{
void shootInternal(Player p, float x, float y, float rotation, boolean left){
Angles.shotgun(shots, spacing, rotation, f -> bullet(p, x, y, f + Mathf.range(inaccuracy)));
tr.trns(rotation, 3f);
AmmoType type = p.inventory.getAmmo();
tr.trns(rotation + 180f, type.recoil);
p.velocity.add(tr);
tr.trns(rotation, 3f);
Effects.shake(shake, shake, x, y);
Effects.effect(ejectEffect, x, y, rotation * -Mathf.sign(left));
Effects.effect(type.shootEffect, x + tr.x, y + tr.y, rotation, p);