Implemented trident

This commit is contained in:
Anuken 2018-08-24 23:32:08 -04:00
parent 8c3f3ac304
commit 9465497481
10 changed files with 572 additions and 538 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 B

After

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 B

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

After

Width:  |  Height:  |  Size: 139 KiB

View File

@ -250,6 +250,7 @@ public class Mechs implements ContentList{
speed = 0.4f;
maxSpeed = 3f;
drag = 0.1f;
armor = 10f;
weaponOffsetX = -1;
weaponOffsetY = -1;
trailColor = Palette.lightTrail;
@ -264,6 +265,7 @@ public class Mechs implements ContentList{
speed = 0.11f;
maxSpeed = 3.4f;
drag = 0.01f;
armor = 5f;
weapon = Weapons.missiles;
trailColor = Color.valueOf("d3ddff");
}
@ -310,12 +312,18 @@ public class Mechs implements ContentList{
}
};
trident = new Mech("trident-ship", true){{
drillPower = 1;
speed = 0.4f;
maxSpeed = 3f;
drag = 0.1f;
}};
trident = new Mech("trident-ship", true){
{
drillPower = 4;
speed = 0.12f;
maxSpeed = 3.4f;
drag = 0.035f;
turnCursor = false;
armor = 30f;
trailColor = Color.valueOf("84f491");
weapon = Weapons.bomberTrident;
}
};
halberd = new Mech("halberd-ship", true){{
drillPower = 2;

View File

@ -127,6 +127,9 @@ public class Recipes implements ContentList{
//bodies
new Recipe(units, UpgradeBlocks.dartFactory, new ItemStack(Items.lead, 150), new ItemStack(Items.silicon, 200), new ItemStack(Items.titanium, 240)).setDesktop(); //dart is desktop only, because it's the starter mobile ship
new Recipe(units, UpgradeBlocks.javelinFactory, new ItemStack(Items.lead, 200), new ItemStack(Items.silicon, 250), new ItemStack(Items.titanium, 300), new ItemStack(Items.plastanium, 200));
new Recipe(units, UpgradeBlocks.tridentFactory, new ItemStack(Items.lead, 200), new ItemStack(Items.silicon, 250), new ItemStack(Items.titanium, 300), new ItemStack(Items.plastanium, 200));
new Recipe(units, UpgradeBlocks.halberdFactory, new ItemStack(Items.lead, 200), new ItemStack(Items.silicon, 250), new ItemStack(Items.titanium, 300), new ItemStack(Items.plastanium, 200));
new Recipe(units, UpgradeBlocks.deltaFactory, new ItemStack(Items.densealloy, 160), new ItemStack(Items.silicon, 220), new ItemStack(Items.titanium, 250)).setDesktop();
new Recipe(units, UpgradeBlocks.omegaFactory, new ItemStack(Items.densealloy, 160), new ItemStack(Items.silicon, 220), new ItemStack(Items.titanium, 250)).setDesktop();
new Recipe(units, UpgradeBlocks.tauFactory, new ItemStack(Items.densealloy, 160), new ItemStack(Items.silicon, 220), new ItemStack(Items.titanium, 250)).setDesktop();

View File

@ -8,7 +8,7 @@ import io.anuke.mindustry.type.ContentList;
import io.anuke.mindustry.type.Weapon;
public class Weapons implements ContentList{
public static Weapon blaster, droneBlaster, healBlaster, chainBlaster, shockgun, sapper, swarmer, bomber, flakgun, flamethrower, missiles;
public static Weapon blaster, droneBlaster, healBlaster, chainBlaster, shockgun, sapper, swarmer, bomber, bomberTrident, flakgun, flamethrower, missiles;
@Override
public void load(){
@ -124,6 +124,18 @@ public class Weapons implements ContentList{
inaccuracy = 40f;
ammo = AmmoTypes.bombExplosive;
}};
bomberTrident = new Weapon("bomber"){{
length = 0f;
width = 2f;
reload = 9f;
shots = 2;
roundrobin = true;
ejectEffect = Fx.none;
velocityRnd = 1f;
inaccuracy = 40f;
ammo = AmmoTypes.bombExplosive;
}};
}
@Override

View File

@ -585,7 +585,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
if(!ui.chatfrag.chatOpen()){
float baseLerp = mech.getRotationAlpha(this);
if(!isShooting()){
if(!isShooting() || !mech.turnCursor){
if(!movement.isZero()){
rotation = Mathf.slerpDelta(rotation, mech.flying ? velocity.angle() : movement.angle(), 0.13f * baseLerp);
}
@ -661,7 +661,9 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
target = Units.getClosestTarget(team, x, y, getWeapon().getAmmo().getRange());
}else if(target.isValid()){
//rotate toward and shoot the target
rotation = Mathf.slerpDelta(rotation, angleTo(target), 0.2f);
if(mech.turnCursor){
rotation = Mathf.slerpDelta(rotation, angleTo(target), 0.2f);
}
Vector2 intercept =
Predict.intercept(x, y, target.getX(), target.getY(), target.getVelocity().x - velocity.x, target.getVelocity().y - velocity.y, getWeapon().getAmmo().bullet.speed);

View File

@ -41,6 +41,7 @@ public class Mech implements UnlockableContent{
public Color trailColor = Palette.boostFrom;
public Color trailColorTo = Palette.boostTo;
public int itemCapacity = 30;
public boolean turnCursor = true;
public float weaponOffsetX, weaponOffsetY;
public Weapon weapon = Weapons.blaster;

View File

@ -77,6 +77,7 @@ public class MassDriver extends Block{
MassDriverEntity other = target.entity();
entity.reload = 1f;
entity.power.amount = 0f;
DriverBulletData data = Pooling.obtain(DriverBulletData.class);
data.from = entity;