Fixed maps converting improperly / Minor balancing
This commit is contained in:
@@ -35,7 +35,7 @@ public class Mechs implements ContentList{
|
||||
boostSpeed = 0.95f;
|
||||
buildPower = 1.2f;
|
||||
engineColor = Color.valueOf("ffd37f");
|
||||
health = 300f;
|
||||
health = 250f;
|
||||
|
||||
weapon = new Weapon("blaster"){{
|
||||
length = 1.5f;
|
||||
@@ -75,7 +75,7 @@ public class Mechs implements ContentList{
|
||||
weapon = new Weapon("shockgun"){{
|
||||
shake = 2f;
|
||||
length = 1f;
|
||||
reload = 40f;
|
||||
reload = 45f;
|
||||
shotDelay = 3f;
|
||||
roundrobin = true;
|
||||
shots = 2;
|
||||
@@ -163,12 +163,12 @@ public class Mechs implements ContentList{
|
||||
weaponOffsetX = 1;
|
||||
weaponOffsetY = 0;
|
||||
engineColor = Color.valueOf("feb380");
|
||||
health = 300f;
|
||||
health = 310f;
|
||||
buildPower = 1.5f;
|
||||
weapon = new Weapon("swarmer"){{
|
||||
length = 1.5f;
|
||||
recoil = 4f;
|
||||
reload = 60f;
|
||||
reload = 50f;
|
||||
shots = 4;
|
||||
spacing = 8f;
|
||||
inaccuracy = 8f;
|
||||
|
||||
@@ -28,6 +28,7 @@ public class LiquidBulletType extends BulletType{
|
||||
statusDuration = 90f;
|
||||
despawnEffect = Fx.none;
|
||||
hitEffect = Fx.hitLiquid;
|
||||
smokeEffect = Fx.none;
|
||||
shootEffect = Fx.none;
|
||||
drag = 0.009f;
|
||||
knockback = 0.55f;
|
||||
|
||||
@@ -40,6 +40,8 @@ public class LegacyMapIO{
|
||||
for(int x = 0; x < map.width; x++){
|
||||
for(int y = 0; y < map.height; y++){
|
||||
tiles[x][y] = new CachedTile();
|
||||
tiles[x][y].x = (short)x;
|
||||
tiles[x][y].y = (short)y;
|
||||
}
|
||||
}
|
||||
state.rules.spawns = groups;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package io.anuke.mindustry.world;
|
||||
|
||||
import io.anuke.arc.collection.IntMap;
|
||||
import io.anuke.mindustry.entities.type.TileEntity;
|
||||
import io.anuke.mindustry.game.Team;
|
||||
import io.anuke.mindustry.world.modules.*;
|
||||
@@ -10,7 +9,6 @@ import io.anuke.mindustry.world.modules.*;
|
||||
* Prevents garbage when loading previews.
|
||||
*/
|
||||
public class CachedTile extends Tile{
|
||||
private static IntMap<TileEntity> entities = new IntMap<>();
|
||||
|
||||
public CachedTile(){
|
||||
super(0, 0);
|
||||
@@ -23,7 +21,8 @@ public class CachedTile extends Tile{
|
||||
|
||||
@Override
|
||||
protected void preChanged(){
|
||||
super.setTeam(Team.none);
|
||||
//this basically overrides the old tile code and doesn't remove from proximity
|
||||
team = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -33,19 +32,14 @@ public class CachedTile extends Tile{
|
||||
Block block = block();
|
||||
|
||||
if(block.hasEntity()){
|
||||
//cache all entity types so only one is ever created per block type. do not add it.
|
||||
if(!entities.containsKey(block.id)){
|
||||
TileEntity n = block.newEntity();
|
||||
n.cons = new ConsumeModule(entity);
|
||||
n.tile = this;
|
||||
if(block.hasItems) n.items = new ItemModule();
|
||||
if(block.hasLiquids) n.liquids = new LiquidModule();
|
||||
if(block.hasPower) n.power = new PowerModule();
|
||||
entities.put(block.id, n);
|
||||
}
|
||||
|
||||
entity = entities.get(block.id);
|
||||
|
||||
TileEntity n = block.newEntity();
|
||||
n.cons = new ConsumeModule(entity);
|
||||
n.tile = this;
|
||||
n.block = block;
|
||||
if(block.hasItems) n.items = new ItemModule();
|
||||
if(block.hasLiquids) n.liquids = new LiquidModule();
|
||||
if(block.hasPower) n.power = new PowerModule();
|
||||
entity = n;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -439,6 +439,6 @@ public class Tile implements Position, TargetTrait{
|
||||
|
||||
@Override
|
||||
public String toString(){
|
||||
return floor.name + ":" + block.name + ":" + content.block(overlay) + "[" + x + "," + y + "] " + "entity=" + (entity == null ? "null" : (entity.getClass()));
|
||||
return floor.name + ":" + block.name + ":" + content.block(overlay) + "[" + x + "," + y + "] " + "entity=" + (entity == null ? "null" : (entity.getClass())) + ":" + getTeam();
|
||||
}
|
||||
}
|
||||
@@ -214,7 +214,8 @@ public class MassDriver extends Block{
|
||||
|
||||
@Override
|
||||
public boolean acceptItem(Item item, Tile tile, Tile source){
|
||||
return tile.entity.items.total() < itemCapacity;
|
||||
//mass drivers that ouput only cannot accept items
|
||||
return tile.entity.items.total() < itemCapacity && linkValid(tile);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user