Revenant laser

This commit is contained in:
Anuken 2018-10-02 12:49:27 -04:00
parent 3f93b5c63b
commit 860727d27a
4 changed files with 18 additions and 4 deletions

View File

@ -217,7 +217,9 @@ public class AmmoTypes implements ContentList{
//power
lancerLaser = new AmmoType(TurretBullets.lancerLaser);
lancerLaser = new AmmoType(TurretBullets.lancerLaser){{
range = 60f;
}};
lightning = new AmmoType(TurretBullets.lightning);

View File

@ -98,10 +98,11 @@ public class UnitTypes implements ContentList{
health = 250;
mass = 4f;
speed = 0.14f*mass;
hitsize = 12f;
maxVelocity = 1.4f;
drag = 0.01f;
isFlying = true;
weapon = Weapons.bomber;
weapon = Weapons.laserBurster;
}};
phantom = new UnitType("phantom", Phantom.class, Phantom::new){{

View File

@ -8,7 +8,7 @@ import io.anuke.mindustry.type.Weapon;
public class Weapons implements ContentList{
public static Weapon blaster, blasterSmall, glaiveBlaster, droneBlaster, healBlaster, chainBlaster, shockgun,
sapper, swarmer, bomber, bomberTrident, flakgun, flamethrower, missiles, artillery;
sapper, swarmer, bomber, bomberTrident, flakgun, flamethrower, missiles, artillery, laserBurster;
@Override
public void load(){
@ -160,6 +160,15 @@ public class Weapons implements ContentList{
inaccuracy = 40f;
ammo = AmmoTypes.bombExplosive;
}};
laserBurster = new Weapon("bomber"){{
reload = 80f;
shake = 3f;
width = 0f;
roundrobin = true;
ejectEffect = Fx.none;
ammo = AmmoTypes.lancerLaser;
}};
}
@Override

View File

@ -27,6 +27,8 @@ public class AmmoType extends Content {
public Effect shootEffect = Fx.none;
/**Extra smoke effect created when shooting.*/
public Effect smokeEffect = Fx.none;
/**Range. Use a value < 0 to calculate from bullet.*/
public float range = -1f;
/**
* Creates an AmmoType with no liquid or item. Used for power-based ammo.
@ -63,7 +65,7 @@ public class AmmoType extends Content {
* Returns maximum distance the bullet this ammo type has can travel.
*/
public float getRange(){
return bullet.speed * bullet.lifetime;
return range < 0 ? bullet.speed * bullet.lifetime : range;
}
@Override