Surge uses / Fixes, optimizations / Turret implementation base
This commit is contained in:
@@ -53,7 +53,7 @@ public class Pathfinder{
|
||||
public Tile getTargetTile(Team team, Tile tile){
|
||||
float[][] values = paths[team.ordinal()].weights;
|
||||
|
||||
if(values == null) return tile;
|
||||
if(values == null || tile == null) return tile;
|
||||
|
||||
float value = values[tile.x][tile.y];
|
||||
|
||||
|
||||
@@ -13,8 +13,9 @@ public class AmmoTypes implements ContentList{
|
||||
public static AmmoType bulletCopper, bulletDense, bulletThorium, bulletSilicon, bulletPyratite,
|
||||
shotgunTungsten, bombExplosive, bombIncendiary, bombOil, shellCarbide, flamerThermite, weaponMissile, weaponMissileSwarm, bulletMech,
|
||||
healBlaster, bulletGlaive,
|
||||
flakLead, flakExplosive, flakPlastic, flakSurge, missileExplosive, missileIncindiary, missileSurge,
|
||||
artilleryDense, artilleryPlastic, artilleryHoming, artilleryIncindiary, artilleryExplosive,
|
||||
flakExplosive, flakPlastic, flakSurge,
|
||||
missileExplosive, missileIncindiary, missileSurge,
|
||||
artilleryDense, artilleryPlastic, artilleryHoming, artilleryIncindiary, artilleryExplosive,
|
||||
basicFlame, lancerLaser, lightning, spectreLaser, meltdownLaser, fuseShotgun, oil, water, lava, cryofluid;
|
||||
|
||||
@Override
|
||||
@@ -29,7 +30,6 @@ public class AmmoTypes implements ContentList{
|
||||
inaccuracy = 5f;
|
||||
}};
|
||||
|
||||
|
||||
bulletGlaive = new AmmoType(Items.pyratite, StandardBullets.glaive, 3){{
|
||||
shootEffect = ShootFx.shootSmall;
|
||||
smokeEffect = ShootFx.shootSmallSmoke;
|
||||
@@ -118,24 +118,19 @@ public class AmmoTypes implements ContentList{
|
||||
|
||||
//flak
|
||||
|
||||
flakLead = new AmmoType(Items.lead, FlakBullets.lead, 5){{
|
||||
shootEffect = ShootFx.shootSmall;
|
||||
smokeEffect = ShootFx.shootSmallSmoke;
|
||||
}};
|
||||
|
||||
flakExplosive = new AmmoType(Items.blastCompound, FlakBullets.explosive, 5){{
|
||||
shootEffect = ShootFx.shootSmall;
|
||||
smokeEffect = ShootFx.shootSmallSmoke;
|
||||
shootEffect = ShootFx.shootBig;
|
||||
smokeEffect = ShootFx.shootBigSmoke;
|
||||
}};
|
||||
|
||||
flakPlastic = new AmmoType(Items.plastanium, FlakBullets.plastic, 5){{
|
||||
shootEffect = ShootFx.shootSmall;
|
||||
smokeEffect = ShootFx.shootSmallSmoke;
|
||||
shootEffect = ShootFx.shootBig;
|
||||
smokeEffect = ShootFx.shootBigSmoke;
|
||||
}};
|
||||
|
||||
flakSurge = new AmmoType(Items.surgealloy, FlakBullets.surge, 5){{
|
||||
shootEffect = ShootFx.shootSmall;
|
||||
smokeEffect = ShootFx.shootSmallSmoke;
|
||||
shootEffect = ShootFx.shootBig;
|
||||
smokeEffect = ShootFx.shootBigSmoke;
|
||||
}};
|
||||
|
||||
//missiles
|
||||
|
||||
@@ -22,14 +22,18 @@ public class Recipes implements ContentList{
|
||||
new Recipe(defense, DefenseBlocks.compositeWall, new ItemStack(Items.densealloy, 12));
|
||||
new Recipe(defense, DefenseBlocks.compositeWallLarge, new ItemStack(Items.densealloy, 12 * 4));
|
||||
|
||||
new Recipe(defense, DefenseBlocks.door, new ItemStack(Items.densealloy, 12), new ItemStack(Items.silicon, 8));
|
||||
new Recipe(defense, DefenseBlocks.doorLarge, new ItemStack(Items.densealloy, 12 * 4), new ItemStack(Items.silicon, 8 * 4));
|
||||
|
||||
new Recipe(defense, DefenseBlocks.thoriumWall, new ItemStack(Items.thorium, 12));
|
||||
new Recipe(defense, DefenseBlocks.thoriumWallLarge, new ItemStack(Items.thorium, 12 * 4));
|
||||
|
||||
new Recipe(defense, DefenseBlocks.phaseWall, new ItemStack(Items.phasematter, 12));
|
||||
new Recipe(defense, DefenseBlocks.phaseWallLarge, new ItemStack(Items.phasematter, 12 * 4));
|
||||
|
||||
new Recipe(defense, DefenseBlocks.door, new ItemStack(Items.densealloy, 12), new ItemStack(Items.silicon, 8));
|
||||
new Recipe(defense, DefenseBlocks.doorLarge, new ItemStack(Items.densealloy, 12 * 4), new ItemStack(Items.silicon, 8 * 4));
|
||||
new Recipe(defense, DefenseBlocks.surgeWall, new ItemStack(Items.surgealloy, 12));
|
||||
new Recipe(defense, DefenseBlocks.surgeWallLarge, new ItemStack(Items.surgealloy, 12 * 4));
|
||||
|
||||
|
||||
//projectors
|
||||
new Recipe(defense, DefenseBlocks.mendProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.densealloy, 150), new ItemStack(Items.titanium, 150), new ItemStack(Items.silicon, 250));
|
||||
@@ -38,12 +42,13 @@ public class Recipes implements ContentList{
|
||||
new Recipe(weapon, TurretBlocks.duo, new ItemStack(Items.copper, 40));
|
||||
new Recipe(weapon, TurretBlocks.scorch, new ItemStack(Items.copper, 50), new ItemStack(Items.densealloy, 20));
|
||||
new Recipe(weapon, TurretBlocks.hail, new ItemStack(Items.copper, 60), new ItemStack(Items.densealloy, 35));
|
||||
|
||||
new Recipe(weapon, TurretBlocks.lancer, new ItemStack(Items.copper, 50), new ItemStack(Items.lead, 100), new ItemStack(Items.silicon, 90));
|
||||
new Recipe(weapon, TurretBlocks.wave, new ItemStack(Items.densealloy, 60), new ItemStack(Items.titanium, 70), new ItemStack(Items.lead, 150));
|
||||
new Recipe(weapon, TurretBlocks.swarmer, new ItemStack(Items.densealloy, 70), new ItemStack(Items.titanium, 70), new ItemStack(Items.plastanium, 90), new ItemStack(Items.silicon, 60));
|
||||
new Recipe(weapon, TurretBlocks.salvo, new ItemStack(Items.copper, 210), new ItemStack(Items.densealloy, 190), new ItemStack(Items.thorium, 130));
|
||||
new Recipe(weapon, TurretBlocks.swarmer, new ItemStack(Items.densealloy, 70), new ItemStack(Items.titanium, 70), new ItemStack(Items.plastanium, 90), new ItemStack(Items.silicon, 60));
|
||||
new Recipe(weapon, TurretBlocks.ripple, new ItemStack(Items.copper, 300), new ItemStack(Items.densealloy, 220), new ItemStack(Items.thorium, 120));
|
||||
new Recipe(weapon, TurretBlocks.cyclone, new ItemStack(Items.copper, 210), new ItemStack(Items.densealloy, 190), new ItemStack(Items.thorium, 130));
|
||||
new Recipe(weapon, TurretBlocks.fuse, new ItemStack(Items.copper, 300), new ItemStack(Items.densealloy, 220), new ItemStack(Items.thorium, 120));
|
||||
|
||||
//DISTRIBUTION
|
||||
new Recipe(distribution, DistributionBlocks.conveyor, new ItemStack(Items.copper, 1));
|
||||
|
||||
@@ -4,14 +4,11 @@ import io.anuke.mindustry.content.Items;
|
||||
import io.anuke.mindustry.content.fx.BlockFx;
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.world.blocks.Wall;
|
||||
import io.anuke.mindustry.world.blocks.defense.DeflectorWall;
|
||||
import io.anuke.mindustry.world.blocks.defense.Door;
|
||||
import io.anuke.mindustry.world.blocks.defense.MendProjector;
|
||||
import io.anuke.mindustry.world.blocks.defense.*;
|
||||
|
||||
public class DefenseBlocks extends BlockList implements ContentList{
|
||||
public static Block copperWall, copperWallLarge, compositeWall, compositeWallLarge, thoriumWall, thoriumWallLarge, door, doorLarge, deflectorwall, deflectorwalllarge,
|
||||
phaseWall, phaseWallLarge, mendProjector;
|
||||
phaseWall, phaseWallLarge, surgeWall, surgeWallLarge, mendProjector;
|
||||
|
||||
@Override
|
||||
public void load(){
|
||||
@@ -62,6 +59,15 @@ public class DefenseBlocks extends BlockList implements ContentList{
|
||||
size = 2;
|
||||
}};
|
||||
|
||||
surgeWall = new SurgeWall("surge-wall"){{
|
||||
health = 230 * wallHealthMultiplier;
|
||||
}};
|
||||
|
||||
surgeWallLarge = new SurgeWall("surge-wall-large"){{
|
||||
health = 230 * 4 * wallHealthMultiplier;
|
||||
size = 2;
|
||||
}};
|
||||
|
||||
door = new Door("door"){{
|
||||
health = 100 * wallHealthMultiplier;
|
||||
}};
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package io.anuke.mindustry.content.blocks;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||
import io.anuke.mindustry.content.AmmoTypes;
|
||||
import io.anuke.mindustry.content.fx.ShootFx;
|
||||
import io.anuke.mindustry.type.AmmoType;
|
||||
@@ -51,16 +52,26 @@ public class TurretBlocks extends BlockList implements ContentList{
|
||||
health = 120;
|
||||
}};
|
||||
|
||||
scorch = new LiquidTurret("scorch"){{
|
||||
ammoTypes = new AmmoType[]{AmmoTypes.basicFlame};
|
||||
recoil = 0f;
|
||||
reload = 4f;
|
||||
shootCone = 50f;
|
||||
ammoUseEffect = ShootFx.shellEjectSmall;
|
||||
health = 160;
|
||||
scorch = new LiquidTurret("scorch"){
|
||||
protected TextureRegion shootRegion;
|
||||
|
||||
drawer = (tile, entity) -> Draw.rect(entity.target != null ? name + "-shoot" : name, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
|
||||
}};
|
||||
@Override
|
||||
public void load(){
|
||||
super.load();
|
||||
shootRegion = Draw.region(name + "-shoot");
|
||||
}
|
||||
|
||||
{
|
||||
ammoTypes = new AmmoType[]{AmmoTypes.basicFlame};
|
||||
recoil = 0f;
|
||||
reload = 4f;
|
||||
shootCone = 50f;
|
||||
ammoUseEffect = ShootFx.shellEjectSmall;
|
||||
health = 160;
|
||||
|
||||
drawer = (tile, entity) -> Draw.rect(entity.target != null ? shootRegion : region, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
|
||||
}
|
||||
};
|
||||
|
||||
wave = new LiquidTurret("wave"){{
|
||||
ammoTypes = new AmmoType[]{AmmoTypes.water, AmmoTypes.lava, AmmoTypes.cryofluid, AmmoTypes.oil};
|
||||
@@ -180,8 +191,16 @@ public class TurretBlocks extends BlockList implements ContentList{
|
||||
}};
|
||||
|
||||
cyclone = new ItemTurret("cyclone"){{
|
||||
ammoTypes = new AmmoType[]{AmmoTypes.flakLead, AmmoTypes.flakExplosive, AmmoTypes.flakPlastic, AmmoTypes.flakSurge};
|
||||
ammoTypes = new AmmoType[]{AmmoTypes.flakExplosive, AmmoTypes.flakPlastic, AmmoTypes.flakSurge};
|
||||
xRand = 4f;
|
||||
reload = 8f;
|
||||
range = 140f;
|
||||
size = 3;
|
||||
recoil = 3f;
|
||||
shots = 2;
|
||||
rotatespeed = 20f;
|
||||
inaccuracy = 13f;
|
||||
shootCone = 30f;
|
||||
}};
|
||||
|
||||
fuse = new ItemTurret("fuse"){{
|
||||
|
||||
@@ -1,40 +1,31 @@
|
||||
package io.anuke.mindustry.content.bullets;
|
||||
|
||||
import io.anuke.mindustry.entities.bullet.BasicBulletType;
|
||||
import io.anuke.mindustry.entities.bullet.BulletType;
|
||||
import io.anuke.mindustry.entities.bullet.FlakBulletType;
|
||||
import io.anuke.mindustry.type.ContentList;
|
||||
|
||||
public class FlakBullets extends BulletList implements ContentList{
|
||||
public static BulletType lead, plastic, explosive, surge;
|
||||
public static BulletType plastic, explosive, surge;
|
||||
|
||||
@Override
|
||||
public void load(){
|
||||
|
||||
lead = new BasicBulletType(3f, 5, "bullet"){
|
||||
|
||||
plastic = new FlakBulletType(4f, 5){
|
||||
{
|
||||
bulletWidth = 7f;
|
||||
bulletHeight = 9f;
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
plastic = new BasicBulletType(3f, 5, "bullet"){
|
||||
explosive = new FlakBulletType(4f, 5){
|
||||
{
|
||||
bulletWidth = 7f;
|
||||
bulletHeight = 9f;
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
explosive = new BasicBulletType(3f, 5, "bullet"){
|
||||
surge = new FlakBulletType(4f, 5){
|
||||
{
|
||||
bulletWidth = 7f;
|
||||
bulletHeight = 9f;
|
||||
}
|
||||
};
|
||||
|
||||
surge = new BasicBulletType(3f, 5, "bullet"){
|
||||
{
|
||||
bulletWidth = 7f;
|
||||
bulletHeight = 9f;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import io.anuke.ucore.util.Mathf;
|
||||
|
||||
public class BulletFx extends FxList implements ContentList{
|
||||
public static Effect hitBulletSmall, hitBulletBig, hitFlameSmall, hitLiquid, hitLaser, hitLancer, despawn, flakExplosion, blastExplosion, plasticExplosion,
|
||||
artilleryTrail, incendTrail, missileTrail, absorb;
|
||||
artilleryTrail, incendTrail, missileTrail, absorb, flakExplosionBig;
|
||||
|
||||
@Override
|
||||
public void load(){
|
||||
@@ -197,6 +197,30 @@ public class BulletFx extends FxList implements ContentList{
|
||||
Lines.circle(e.x, e.y, 5f * e.fout());
|
||||
Draw.reset();
|
||||
});
|
||||
|
||||
flakExplosionBig = new Effect(30, e -> {
|
||||
|
||||
Draw.color(Palette.bulletYellowBack);
|
||||
e.scaled(6, i -> {
|
||||
Lines.stroke(3f * i.fout());
|
||||
Lines.circle(e.x, e.y, 3f + i.fin() * 25f);
|
||||
});
|
||||
|
||||
Draw.color(Color.GRAY);
|
||||
|
||||
Angles.randLenVectors(e.id, 6, 2f + 23f * e.finpow(), (x, y) -> {
|
||||
Fill.circle(e.x + x, e.y + y, e.fout() * 4f + 0.5f);
|
||||
});
|
||||
|
||||
Draw.color(Palette.bulletYellow);
|
||||
Lines.stroke(1f * e.fout());
|
||||
|
||||
Angles.randLenVectors(e.id + 1, 4, 1f + 23f * e.finpow(), (x, y) -> {
|
||||
Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), 1f + e.fout() * 3f);
|
||||
});
|
||||
|
||||
Draw.reset();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -368,6 +368,11 @@ public class Control extends Module{
|
||||
input.update();
|
||||
}
|
||||
|
||||
//auto-update rpc every 5 seconds
|
||||
if(Timers.get("rpcUpdate", 60 * 5)){
|
||||
Platform.instance.updateRPC();
|
||||
}
|
||||
|
||||
//check unlocked sectors
|
||||
if(world.getSector() != null && !world.getSector().complete){
|
||||
//all assigned missions are complete
|
||||
|
||||
@@ -127,7 +127,7 @@ public class NetServer extends Module{
|
||||
|
||||
if(preventDuplicates){
|
||||
for(Player player : playerGroup.all()){
|
||||
if(player.name.equalsIgnoreCase(packet.name)){
|
||||
if(player.name.trim().equalsIgnoreCase(packet.name.trim())){
|
||||
kick(id, KickReason.nameInUse);
|
||||
return;
|
||||
}
|
||||
@@ -518,6 +518,7 @@ public class NetServer extends Module{
|
||||
}
|
||||
|
||||
String fixName(String name){
|
||||
name = name.trim();
|
||||
if(name.equals("[") || name.equals("]")){
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import io.anuke.mindustry.gen.Call;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.world.Edges;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.blocks.Wall;
|
||||
import io.anuke.mindustry.world.blocks.defense.Wall;
|
||||
import io.anuke.mindustry.world.consumers.Consume;
|
||||
import io.anuke.mindustry.world.modules.ConsumeModule;
|
||||
import io.anuke.mindustry.world.modules.InventoryModule;
|
||||
|
||||
@@ -108,6 +108,10 @@ public class Bullet extends BulletEntity<BulletType> implements TeamTrait, SyncT
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(Object data){
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDamage(){
|
||||
if(owner instanceof Unit){
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package io.anuke.mindustry.entities.bullet;
|
||||
|
||||
import com.badlogic.gdx.math.Rectangle;
|
||||
import io.anuke.mindustry.content.fx.BulletFx;
|
||||
import io.anuke.mindustry.entities.Units;
|
||||
import io.anuke.ucore.core.Timers;
|
||||
|
||||
public abstract class FlakBulletType extends BasicBulletType{
|
||||
protected static Rectangle rect = new Rectangle();
|
||||
protected float explodeRange = 30f;
|
||||
|
||||
public FlakBulletType(float speed, float damage){
|
||||
super(speed, damage, "shell");
|
||||
splashDamage = 15f;
|
||||
splashDamageRadius = 34f;
|
||||
hiteffect = BulletFx.flakExplosionBig;
|
||||
bulletWidth = 8f;
|
||||
bulletHeight = 10f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Bullet b){
|
||||
super.update(b);
|
||||
if(b.getData() instanceof Integer) return;
|
||||
|
||||
if(b.timer.get(2, 6)){
|
||||
Units.getNearbyEnemies(b.getTeam(), rect.setSize(explodeRange*2f).setCenter(b.x, b.y), unit -> {
|
||||
if(b.getData() instanceof Float) return;
|
||||
|
||||
if(unit.distanceTo(b) < explodeRange){
|
||||
b.setData(0);
|
||||
Timers.run(5f, () -> {
|
||||
if(b.getData() instanceof Integer){
|
||||
b.time(b.lifetime());
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -56,6 +56,7 @@ public class Lightning extends TimedEntity implements Poolable, DrawTrait, SyncT
|
||||
Call.createLighting(lastSeed++, team, effect, color, damage, x, y, targetAngle, length);
|
||||
}
|
||||
|
||||
/**Do not invoke!*/
|
||||
@Remote(called = Loc.server)
|
||||
public static void createLighting(int seed, Team team, Effect effect, Color color, float damage, float x, float y, float targetAngle, int length){
|
||||
Lightning l = Pooling.obtain(Lightning.class);
|
||||
|
||||
@@ -251,6 +251,7 @@ public abstract class GroundUnit extends BaseUnit{
|
||||
if(enemy == null) return;
|
||||
|
||||
Tile tile = world.tileWorld(x, y);
|
||||
if(tile == null) return;
|
||||
Tile targetTile = world.pathfinder().getTargetTile(enemy, tile);
|
||||
TileEntity core = getClosestCore();
|
||||
|
||||
|
||||
@@ -68,6 +68,8 @@ public class Palette{
|
||||
|
||||
lightTrail = Color.valueOf("ffe2a9"),
|
||||
|
||||
surge = Color.valueOf("f3e979"),
|
||||
|
||||
redSpark = Color.valueOf("fbb97f"),
|
||||
orangeSpark = Color.valueOf("d2b29c"),
|
||||
|
||||
|
||||
@@ -248,7 +248,7 @@ public class WorldGenerator{
|
||||
double iceridge = rid.getValue(x+99999, y, 1f / 300f) + sim3.octaveNoise2D(2, 1f, 1f/14f, x, y)/11f;
|
||||
double elevation = elevationOf(x, y, detailed);
|
||||
double temp = vn.noise(x, y, 1f / 300f) * sim3.octaveNoise2D(detailed ? 2 : 1, 1, 1f / 13f, x, y)/13f
|
||||
+ sim3.octaveNoise2D(detailed ? 12 : 9, 0.6, 1f / 1020f, x, y);
|
||||
+ sim3.octaveNoise2D(detailed ? 12 : 9, 0.6, 1f / 1100f, x, y);
|
||||
|
||||
int lerpDst = 20;
|
||||
lerpDst *= lerpDst;
|
||||
@@ -272,7 +272,7 @@ public class WorldGenerator{
|
||||
floor = Blocks.water;
|
||||
}else if(elevation < 0.85){
|
||||
floor = Blocks.sand;
|
||||
}else if (elevation < 2.5 && temp > 0.4){
|
||||
}else if (elevation < 2.5 && temp > 0.5){
|
||||
floor = Blocks.sand;
|
||||
}else if(temp < 0.42){
|
||||
floor = Blocks.snow;
|
||||
@@ -313,7 +313,7 @@ public class WorldGenerator{
|
||||
|
||||
double elevationOf(int x, int y, boolean detailed){
|
||||
double ridge = rid.getValue(x, y, 1f / 400f);
|
||||
return sim.octaveNoise2D(detailed ? 7 : 4, 0.62, 1f / 740, x, y) * 6.1 - 1 - ridge;
|
||||
return sim.octaveNoise2D(detailed ? 7 : 4, 0.62, 1f / 800, x, y) * 6.1 - 1 - ridge;
|
||||
}
|
||||
|
||||
public static class GenResult{
|
||||
|
||||
@@ -174,7 +174,6 @@ public class ContentDisplay{
|
||||
table.add(Bundles.format("text.mech.minepower", mech.drillPower));
|
||||
table.row();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void displayUnit(Table table, UnitType unit){
|
||||
|
||||
@@ -274,7 +274,7 @@ public abstract class BaseBlock{
|
||||
/** Try offloading an item to a nearby container in its facing direction. Returns true if success.*/
|
||||
public boolean offloadDir(Tile tile, Item item){
|
||||
Tile other = tile.getNearby(tile.getRotation());
|
||||
if(other != null && other.target().getTeamID() == tile.getTeamID() && other.block().acceptItem(item, other, tile)){
|
||||
if(other != null && other.target().getTeamID() == tile.getTeamID() && other.block().acceptItem(item, other, tile)){
|
||||
other.block().handleItem(item, other, tile);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import io.anuke.mindustry.entities.TileEntity;
|
||||
import io.anuke.mindustry.entities.bullet.Bullet;
|
||||
import io.anuke.mindustry.game.Team;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.blocks.Wall;
|
||||
import io.anuke.ucore.core.Graphics;
|
||||
import io.anuke.ucore.core.Timers;
|
||||
import io.anuke.ucore.graphics.Draw;
|
||||
|
||||
@@ -8,7 +8,6 @@ import io.anuke.mindustry.entities.TileEntity;
|
||||
import io.anuke.mindustry.entities.Units;
|
||||
import io.anuke.mindustry.input.CursorType;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.blocks.Wall;
|
||||
import io.anuke.ucore.core.Effects;
|
||||
import io.anuke.ucore.core.Effects.Effect;
|
||||
import io.anuke.ucore.graphics.Draw;
|
||||
|
||||
@@ -4,7 +4,6 @@ import com.badlogic.gdx.graphics.Color;
|
||||
import io.anuke.mindustry.entities.TileEntity;
|
||||
import io.anuke.mindustry.entities.bullet.Bullet;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.blocks.Wall;
|
||||
import io.anuke.mindustry.world.blocks.defense.DeflectorWall.DeflectorEntity;
|
||||
import io.anuke.ucore.core.Graphics;
|
||||
import io.anuke.ucore.core.Timers;
|
||||
@@ -13,10 +12,10 @@ import io.anuke.ucore.util.Mathf;
|
||||
|
||||
import static io.anuke.mindustry.Vars.tilesize;
|
||||
|
||||
public class PhaseWall extends Wall{
|
||||
public class MendingWall extends Wall{
|
||||
protected float regenSpeed = 0.25f;
|
||||
|
||||
public PhaseWall(String name){
|
||||
public MendingWall(String name){
|
||||
super(name);
|
||||
update = true;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package io.anuke.mindustry.world.blocks.defense;
|
||||
|
||||
import io.anuke.mindustry.content.fx.BulletFx;
|
||||
import io.anuke.mindustry.entities.TileEntity;
|
||||
import io.anuke.mindustry.entities.bullet.Bullet;
|
||||
import io.anuke.mindustry.entities.effect.Lightning;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
|
||||
public class SurgeWall extends Wall{
|
||||
protected float lightningChance = 0.05f;
|
||||
protected float lightningDamage = 11f;
|
||||
protected int lightningLength = 20;
|
||||
|
||||
public SurgeWall(String name){
|
||||
super(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleBulletHit(TileEntity entity, Bullet bullet){
|
||||
super.handleBulletHit(entity, bullet);
|
||||
if(Mathf.chance(lightningChance)){
|
||||
Lightning.create(entity.getTeam(), BulletFx.hitLancer, Palette.surge, lightningDamage, bullet.x, bullet.y, bullet.angle() + 180f, lightningLength);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package io.anuke.mindustry.world.blocks;
|
||||
package io.anuke.mindustry.world.blocks.defense;
|
||||
|
||||
import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.world.meta.BlockGroup;
|
||||
@@ -9,7 +9,6 @@ import static io.anuke.mindustry.Vars.tilesize;
|
||||
|
||||
public class BurstTurret extends ItemTurret{
|
||||
protected float burstSpacing = 5;
|
||||
protected float xRand = 0f;
|
||||
|
||||
public BurstTurret(String name){
|
||||
super(name);
|
||||
|
||||
@@ -58,6 +58,7 @@ public abstract class Turret extends Block{
|
||||
protected float rotatespeed = 5f; //in degrees per tick
|
||||
protected float shootCone = 8f;
|
||||
protected float shootShake = 0f;
|
||||
protected float xRand = 0f;
|
||||
protected boolean targetAir = true;
|
||||
|
||||
protected Translator tr = new Translator();
|
||||
@@ -274,13 +275,13 @@ public abstract class Turret extends Block{
|
||||
entity.heat = 1f;
|
||||
|
||||
AmmoType type = peekAmmo(tile);
|
||||
useAmmo(tile);
|
||||
|
||||
tr.trns(entity.rotation, size * tilesize / 2);
|
||||
tr.trns(entity.rotation, size * tilesize / 2, Mathf.range(xRand));
|
||||
|
||||
bullet(tile, ammo.bullet, entity.rotation + Mathf.range(inaccuracy + type.inaccuracy));
|
||||
|
||||
effects(tile);
|
||||
useAmmo(tile);
|
||||
}
|
||||
|
||||
protected void bullet(Tile tile, BulletType type, float angle){
|
||||
|
||||
@@ -49,7 +49,7 @@ public class Conveyor extends Block{
|
||||
itemCapacity = 4;
|
||||
}
|
||||
|
||||
private static int compareItems(Long a, Long b){
|
||||
private static int compareItems(long a, long b){
|
||||
pos1.set(a, ItemPos.packShorts);
|
||||
pos2.set(b, ItemPos.packShorts);
|
||||
return Float.compare(pos1.y, pos2.y);
|
||||
|
||||
@@ -1,15 +1,24 @@
|
||||
package io.anuke.mindustry.world.blocks.production;
|
||||
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.ucore.graphics.Draw;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
|
||||
public class PlastaniumCompressor extends GenericCrafter{
|
||||
protected TextureRegion topRegion;
|
||||
|
||||
public PlastaniumCompressor(String name){
|
||||
super(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load(){
|
||||
super.load();
|
||||
|
||||
topRegion = Draw.region(name + "-top");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Tile tile){
|
||||
super.draw(tile);
|
||||
@@ -17,7 +26,7 @@ public class PlastaniumCompressor extends GenericCrafter{
|
||||
GenericCrafterEntity entity = tile.entity();
|
||||
|
||||
Draw.alpha(Mathf.absin(entity.totalProgress, 3f, 0.9f) * entity.warmup);
|
||||
Draw.rect(name + "-top", tile.drawx(), tile.drawy());
|
||||
Draw.rect(topRegion, tile.drawx(), tile.drawy());
|
||||
Draw.reset();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ public class UnitPad extends Block{
|
||||
protected UnitType type;
|
||||
protected float produceTime = 1000f;
|
||||
protected float launchVelocity = 0f;
|
||||
protected TextureRegion topRegion;
|
||||
|
||||
public UnitPad(String name){
|
||||
super(name);
|
||||
@@ -78,6 +79,13 @@ public class UnitPad extends Block{
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load(){
|
||||
super.load();
|
||||
|
||||
topRegion = Draw.region(name + "-top");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean outputsItems(){
|
||||
return false;
|
||||
@@ -135,7 +143,7 @@ public class UnitPad extends Block{
|
||||
|
||||
Draw.reset();
|
||||
|
||||
Draw.rect(name + "-top", tile.drawx(), tile.drawy());
|
||||
Draw.rect(topRegion, tile.drawx(), tile.drawy());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user