Unlockable cleanup / Added javelin ship / Mobile fixes

This commit is contained in:
Anuken
2018-07-01 15:44:56 -04:00
parent 02b8e34242
commit 95d01f0ef5
27 changed files with 759 additions and 608 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 310 B

After

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 306 B

After

Width:  |  Height:  |  Size: 384 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 458 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 320 B

After

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 309 B

After

Width:  |  Height:  |  Size: 351 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 331 B

+26
View File
@@ -484,3 +484,29 @@ block.powerinfinite.name=Power Infinite
block.unloader.name=Unloader block.unloader.name=Unloader
block.sortedunloader.name=Sorted Unloader block.sortedunloader.name=Sorted Unloader
block.vault.name=Vault block.vault.name=Vault
block.wave.name=Wave
block.swarmer.name=Swarmer
block.salvo.name=Salvo
block.ripple.name=Ripple
block.phase-conveyor.name=Phase Conveyor
block.overflow-gate.name=Overflow Gate
block.bridge-conveyor.name=Bridge Conveyor
block.plastanium-compressor.name=Plastanium Compressor
block.pyratite-mixer.name=Pyratite Mixer
block.blast-mixer.name=Blast Mixer
block.solidifer.name=Solidifer
block.solar-panel.name=Solar Panel
block.solar-panel-large.name=Large Solar Panel
block.oil-extractor.name=Oil Extractor
block.javelin-ship-factory.name=Javelin Ship factory
block.drone-factory.name=Drone Factory
block.fabricator-factory.name=Fabricator Factory
block.repair-point.name=Repair Point
block.resupply-point.name=Resupply Point
block.pulse-conduit.name=Pulse Conduit
block.phase-conduit.name=Phase Conduit
block.liquid-router.name=Liquid Router
block.liquid-tank.name=Liquid Tank
block.liquid-junction.name=Liquid Junction
block.bridge-conduit.name=Bridge Conduit
block.rotary-pump.name=Rotary Pump
File diff suppressed because it is too large Load Diff
Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 KiB

After

Width:  |  Height:  |  Size: 130 KiB

+1 -1
View File
@@ -27,7 +27,7 @@ import io.anuke.ucore.util.OS;
import java.util.Locale; import java.util.Locale;
public class Vars{ public class Vars{
public static final boolean testMobile = false; public static final boolean testMobile = true;
//shorthand for whether or not this is running on android or ios //shorthand for whether or not this is running on android or ios
public static boolean mobile; public static boolean mobile;
public static boolean ios; public static boolean ios;
@@ -2,6 +2,7 @@ package io.anuke.mindustry.content;
import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.Array;
import io.anuke.mindustry.content.bullets.*; import io.anuke.mindustry.content.bullets.*;
import io.anuke.mindustry.content.fx.BulletFx;
import io.anuke.mindustry.content.fx.Fx; import io.anuke.mindustry.content.fx.Fx;
import io.anuke.mindustry.content.fx.ShootFx; import io.anuke.mindustry.content.fx.ShootFx;
import io.anuke.mindustry.game.Content; import io.anuke.mindustry.game.Content;
@@ -10,7 +11,7 @@ import io.anuke.mindustry.type.ContentList;
public class AmmoTypes implements ContentList { public class AmmoTypes implements ContentList {
public static AmmoType bulletTungsten, bulletLead, bulletCarbide, bulletThorium, bulletSilicon, bulletPyratite, public static AmmoType bulletTungsten, bulletLead, bulletCarbide, bulletThorium, bulletSilicon, bulletPyratite,
shotgunTungsten, bombExplosive, bombIncendiary, bombOil, shellCarbide, flamerThermite, shotgunTungsten, bombExplosive, bombIncendiary, bombOil, shellCarbide, flamerThermite, weaponMissile,
flakLead, flakExplosive, flakPlastic, flakSurge, missileExplosive, missileIncindiary, missileSurge, flakLead, flakExplosive, flakPlastic, flakSurge, missileExplosive, missileIncindiary, missileSurge,
artilleryCarbide, artilleryPlastic, artilleryHoming, artilleryIncindiary, artilleryExplosive, artilleryCarbide, artilleryPlastic, artilleryHoming, artilleryIncindiary, artilleryExplosive,
basicFlame, lancerLaser, lightning, spectreLaser, meltdownLaser, fuseShotgun, oil, water, lava, cryofluid; basicFlame, lancerLaser, lightning, spectreLaser, meltdownLaser, fuseShotgun, oil, water, lava, cryofluid;
@@ -50,6 +51,12 @@ public class AmmoTypes implements ContentList {
shootEffect = ShootFx.shootSmallFlame; shootEffect = ShootFx.shootSmallFlame;
}}; }};
weaponMissile = new AmmoType(Items.carbide, MissileBullets.javelin, 2) {{
shootEffect = BulletFx.hitBulletSmall;
smokeEffect = Fx.none;
reloadMultiplier = 1.2f;
}};
//bullets //bullets
bulletLead = new AmmoType(Items.lead, StandardBullets.lead, 5) {{ bulletLead = new AmmoType(Items.lead, StandardBullets.lead, 5) {{
+10 -8
View File
@@ -9,7 +9,7 @@ import io.anuke.mindustry.type.Mech;
import io.anuke.mindustry.type.Upgrade; import io.anuke.mindustry.type.Upgrade;
public class Mechs implements ContentList { public class Mechs implements ContentList {
public static Mech alpha, delta, tau, omega, dart, trident, javelin, halberd; public static Mech alpha, delta, tau, omega, dart, javelin, trident, halberd;
/**These are not new mechs, just re-assignments for convenience.*/ /**These are not new mechs, just re-assignments for convenience.*/
public static Mech starterDesktop, starterMobile; public static Mech starterDesktop, starterMobile;
@@ -57,16 +57,18 @@ public class Mechs implements ContentList {
trailColor = Palette.lightTrail; trailColor = Palette.lightTrail;
}}; }};
trident = new Mech("trident-ship", true){{
drillPower = 1;
speed = 0.4f;
maxSpeed = 3f;
drag = 0.1f;
}};
javelin = new Mech("javelin-ship", true){{ javelin = new Mech("javelin-ship", true){{
drillPower = -1; drillPower = -1;
speed = 0.4f; speed = 0.4f;
maxSpeed = 3.6f;
drag = 0.09f;
weapon = Weapons.missiles;
trailColor = Color.valueOf("d3ddff");
}};
trident = new Mech("trident-ship", true){{
drillPower = 1;
speed = 0.4f;
maxSpeed = 3f; maxSpeed = 3f;
drag = 0.1f; drag = 0.1f;
}}; }};
@@ -123,7 +123,7 @@ public class Recipes implements ContentList{
new Recipe(units, UpgradeBlocks.dartFactory, new ItemStack(Items.lead, 150), new ItemStack(Items.silicon, 200), new ItemStack(Items.titanium, 240)) 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 .setDesktop(); //dart is desktop only, because it's the starter mobile ship
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.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.deltaFactory, new ItemStack(Items.carbide, 160), new ItemStack(Items.silicon, 220), new ItemStack(Items.titanium, 250)) new Recipe(units, UpgradeBlocks.deltaFactory, new ItemStack(Items.carbide, 160), new ItemStack(Items.silicon, 220), new ItemStack(Items.titanium, 250))
.setDesktop(); .setDesktop();
@@ -9,7 +9,7 @@ import io.anuke.mindustry.type.Upgrade;
import io.anuke.mindustry.type.Weapon; import io.anuke.mindustry.type.Weapon;
public class Weapons implements ContentList { public class Weapons implements ContentList {
public static Weapon blaster, chainBlaster, shockgun, sapper, swarmer, bomber, flakgun, flamethrower; public static Weapon blaster, chainBlaster, shockgun, sapper, swarmer, bomber, flakgun, flamethrower, missiles;
@Override @Override
public void load() { public void load() {
@@ -22,6 +22,17 @@ public class Weapons implements ContentList {
setAmmo(AmmoTypes.bulletLead); setAmmo(AmmoTypes.bulletLead);
}}; }};
missiles = new Weapon("missiles") {{
length = 1.5f;
reload = 40f;
shots = 2;
inaccuracy = 10f;
roundrobin = false;
roundrobin = true;
ejectEffect = Fx.none;
setAmmo(AmmoTypes.weaponMissile);
}};
chainBlaster = new Weapon("chain-blaster") {{ chainBlaster = new Weapon("chain-blaster") {{
length = 1.5f; length = 1.5f;
reload = 20f; reload = 20f;
@@ -5,13 +5,13 @@ import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.blocks.units.MechFactory; import io.anuke.mindustry.world.blocks.units.MechFactory;
public class UpgradeBlocks extends BlockList { public class UpgradeBlocks extends BlockList {
public static Block deltaFactory, tauFactory, omegaFactory, dartFactory, tridentFactory, javelinFactory, halberdFactory; public static Block deltaFactory, tauFactory, omegaFactory, dartFactory, javelinFactory, tridentFactory, halberdFactory;
@Override @Override
public void load() { public void load() {
deltaFactory = new MechFactory("delta-mech-factory"){{ deltaFactory = new MechFactory("delta-mech-factory"){{
mech = Mechs.delta; mech = Mechs.delta;
size = 2; size = 2;
}}; }};
tauFactory = new MechFactory("tau-mech-factory"){{ tauFactory = new MechFactory("tau-mech-factory"){{
@@ -29,13 +29,13 @@ public class UpgradeBlocks extends BlockList {
size = 2; size = 2;
}}; }};
tridentFactory = new MechFactory("trident-ship-factory"){{ javelinFactory = new MechFactory("javelin-ship-factory"){{
mech = Mechs.trident; mech = Mechs.javelin;
size = 2; size = 2;
}}; }};
javelinFactory = new MechFactory("javelin-ship-factory"){{ tridentFactory = new MechFactory("trident-ship-factory"){{
mech = Mechs.javelin; mech = Mechs.trident;
size = 2; size = 2;
}}; }};
@@ -7,7 +7,7 @@ import io.anuke.mindustry.graphics.Palette;
import io.anuke.mindustry.type.ContentList; import io.anuke.mindustry.type.ContentList;
public class MissileBullets extends BulletList implements ContentList { public class MissileBullets extends BulletList implements ContentList {
public static BulletType explosive, incindiary, surge; public static BulletType explosive, incindiary, surge, javelin;
@Override @Override
public void load() { public void load() {
@@ -50,5 +50,20 @@ public class MissileBullets extends BulletList implements ContentList {
bulletHeight = 9f; bulletHeight = 9f;
} }
}; };
javelin = new MissileBulletType(2.5f, 10, "missile") {
{
bulletWidth = 8f;
bulletHeight = 8f;
bulletShrink = 0f;
drag = -0.02f;
keepVelocity = false;
splashDamageRadius = 25f;
splashDamage = 15f;
lifetime = 90f;
hiteffect = BulletFx.blastExplosion;
despawneffect = BulletFx.blastExplosion;
}
};
} }
} }
@@ -120,6 +120,12 @@ public class Control extends Module{
state.set(State.playing); state.set(State.playing);
}); });
Events.on(WorldLoadGraphicsEvent.class, () -> {
if(mobile){
Core.camera.position.set(players[0].x, players[0].y, 0);
}
});
Events.on(ResetEvent.class, () -> { Events.on(ResetEvent.class, () -> {
for(Player player : players){ for(Player player : players){
player.reset(); player.reset();
@@ -227,15 +227,13 @@ public class Renderer extends RendererModule{
blocks.skipLayer(Layer.turret); blocks.skipLayer(Layer.turret);
blocks.drawBlocks(Layer.laser); blocks.drawBlocks(Layer.laser);
overlays.drawBottom();
drawAndInterpolate(playerGroup, p -> true, Player::drawBuildRequests);
drawAllTeams(true); drawAllTeams(true);
drawAndInterpolate(bulletGroup); drawAndInterpolate(bulletGroup);
drawAndInterpolate(effectGroup); drawAndInterpolate(effectGroup);
overlays.drawBottom();
drawAndInterpolate(playerGroup, p -> true, Player::drawBuildRequests);
overlays.drawTop(); overlays.drawTop();
if(pixelate) if(pixelate)
@@ -23,12 +23,16 @@ import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.blocks.Floor; import io.anuke.mindustry.world.blocks.Floor;
import io.anuke.mindustry.world.blocks.storage.CoreBlock.CoreEntity; import io.anuke.mindustry.world.blocks.storage.CoreBlock.CoreEntity;
import io.anuke.mindustry.world.blocks.units.MechFactory;
import io.anuke.ucore.core.*; import io.anuke.ucore.core.*;
import io.anuke.ucore.entities.EntityGroup; import io.anuke.ucore.entities.EntityGroup;
import io.anuke.ucore.entities.trait.SolidTrait; import io.anuke.ucore.entities.trait.SolidTrait;
import io.anuke.ucore.graphics.Draw; import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.graphics.Lines; import io.anuke.ucore.graphics.Lines;
import io.anuke.ucore.util.*; import io.anuke.ucore.util.Angles;
import io.anuke.ucore.util.Mathf;
import io.anuke.ucore.util.ThreadQueue;
import io.anuke.ucore.util.Timer;
import java.io.DataInput; import java.io.DataInput;
import java.io.DataOutput; import java.io.DataOutput;
@@ -59,7 +63,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
public boolean isLocal = false; public boolean isLocal = false;
public Timer timer = new Timer(4); public Timer timer = new Timer(4);
public TargetTrait target; public TargetTrait target;
public CarriableTrait pickupTarget; public TargetTrait moveTarget;
private boolean respawning; private boolean respawning;
private float walktime; private float walktime;
@@ -551,18 +555,23 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
float targetX = Core.camera.position.x, targetY = Core.camera.position.y; float targetX = Core.camera.position.x, targetY = Core.camera.position.y;
float attractDst = 15f; float attractDst = 15f;
if(pickupTarget != null && !pickupTarget.isDead()){ if(moveTarget != null && !moveTarget.isDead()){
targetX = pickupTarget.getX(); targetX = moveTarget.getX();
targetY = pickupTarget.getY(); targetY = moveTarget.getY();
attractDst = 0f; attractDst = 0f;
if(distanceTo(pickupTarget) < 2f){ if(distanceTo(moveTarget) < 2f){
carry(pickupTarget); if(moveTarget instanceof CarriableTrait){
carry((CarriableTrait) moveTarget);
}else if(moveTarget instanceof TileEntity && ((TileEntity) moveTarget).tile.block() instanceof MechFactory){
Tile tile = ((TileEntity) moveTarget).tile;
tile.block().tapped(tile, this);
}
pickupTarget = null; moveTarget = null;
} }
}else{ }else{
pickupTarget = null; moveTarget = null;
} }
movement.set(targetX - x, targetY - y).limit(mech.speed); movement.set(targetX - x, targetY - y).limit(mech.speed);
@@ -542,7 +542,7 @@ public class AndroidInput extends InputHandler implements GestureListener{
Unit unit = Units.getClosest(player.getTeam(), Graphics.world(x, y).x, Graphics.world(x, y).y, 4f, u -> !u.isFlying() && u.getMass() <= player.mech.carryWeight); Unit unit = Units.getClosest(player.getTeam(), Graphics.world(x, y).x, Graphics.world(x, y).y, 4f, u -> !u.isFlying() && u.getMass() <= player.mech.carryWeight);
if(unit != null){ if(unit != null){
player.pickupTarget = unit; player.moveTarget = unit;
Effects.effect(Fx.select, unit.getX(), unit.getY()); Effects.effect(Fx.select, unit.getX(), unit.getY());
} }
} }
@@ -122,7 +122,9 @@ public abstract class InputHandler extends InputAdapter{
} }
//call tapped event //call tapped event
CallBlocks.onTileTapped(player, tile); if(tile.getTeam() == player.getTeam()){
CallBlocks.onTileTapped(player, tile);
}
//consume tap event if necessary //consume tap event if necessary
if(tile.getTeam() == player.getTeam() && tile.block().consumesTap){ if(tile.getTeam() == player.getTeam() && tile.block().consumesTap){
+1 -1
View File
@@ -48,7 +48,7 @@ public class Liquid implements UnlockableContent{
@Override @Override
public void load() { public void load() {
iconRegion = Draw.region("icon-liquid-" + name); iconRegion = Draw.region("liquid-icon-" + name);
} }
@Override @Override
@@ -26,6 +26,7 @@ import java.io.DataInputStream;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
import static io.anuke.mindustry.Vars.mobile;
import static io.anuke.mindustry.Vars.tilesize; import static io.anuke.mindustry.Vars.tilesize;
public class MechFactory extends Block{ public class MechFactory extends Block{
@@ -52,6 +53,8 @@ public class MechFactory extends Block{
if(checkValidTap(tile, player)){ if(checkValidTap(tile, player)){
CallBlocks.onMechFactoryBegin(player, tile); CallBlocks.onMechFactoryBegin(player, tile);
}else if(player.isLocal && mobile){
player.moveTarget = tile.entity;
} }
} }
@@ -23,7 +23,7 @@ public class LiquidFilterValue implements StatValue {
for (int i = 0; i < list.size; i++) { for (int i = 0; i < list.size; i++) {
Liquid item = list.get(i); Liquid item = list.get(i);
table.addImage("liquid-icon").color(item.color).size(8*3).padRight(2).padLeft(2).padTop(2).padBottom(2); table.addImage(item.getContentIcon()).size(8*3).padRight(2).padLeft(2).padTop(2).padBottom(2);
if(i != list.size - 1){ if(i != list.size - 1){
table.add("/"); table.add("/");
} }
@@ -19,6 +19,6 @@ public class LiquidValue implements ContentStatValue {
@Override @Override
public void display(Table table) { public void display(Table table) {
table.addImage("liquid-icon").color(liquid.color).size(8*3); table.addImage(liquid.getContentIcon()).size(8*3);
} }
} }
@@ -133,7 +133,16 @@ public class Generators {
context.generate("liquid-icons", () -> { context.generate("liquid-icons", () -> {
for(Liquid liquid : Liquid.all()){ for(Liquid liquid : Liquid.all()){
Image image = context.get("liquid-icon");
for (int x = 0; x < image.width(); x++) {
for (int y = 0; y < image.height(); y++) {
Color color = image.getColor(x, y);
color.mul(liquid.color);
image.draw(x, y, color);
}
}
image.save("liquid-icon-" + liquid.name);
} }
}); });