Waveskip / Stat fixes / 3x3 thermalpump / Removed liquid tiers

This commit is contained in:
Anuken
2019-03-01 23:01:12 -05:00
parent 1e111d29d9
commit d82d0ae923
18 changed files with 20 additions and 35 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 B

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 268 B

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 B

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 B

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 250 B

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 510 B

After

Width:  |  Height:  |  Size: 510 B

View File

@@ -727,7 +727,6 @@ public class Blocks implements ContentList{
mechanicalPump = new Pump("mechanical-pump"){{ mechanicalPump = new Pump("mechanical-pump"){{
requirements(Category.liquid, ItemStack.with(Items.copper, 30, Items.lead, 20)); requirements(Category.liquid, ItemStack.with(Items.copper, 30, Items.lead, 20));
pumpAmount = 0.1f; pumpAmount = 0.1f;
tier = 0;
}}; }};
rotaryPump = new Pump("rotary-pump"){{ rotaryPump = new Pump("rotary-pump"){{
@@ -737,17 +736,15 @@ public class Blocks implements ContentList{
liquidCapacity = 30f; liquidCapacity = 30f;
hasPower = true; hasPower = true;
size = 2; size = 2;
tier = 1;
}}; }};
thermalPump = new Pump("thermal-pump"){{ thermalPump = new Pump("thermal-pump"){{
requirements(Category.liquid, ItemStack.with(Items.copper, 160, Items.lead, 130, Items.silicon, 60, Items.titanium, 80, Items.thorium, 70)); requirements(Category.liquid, ItemStack.with(Items.copper, 160, Items.lead, 130, Items.silicon, 60, Items.titanium, 80, Items.thorium, 70));
pumpAmount = 0.275f; pumpAmount = 0.22f;
consumes.power(0.30f); consumes.power(0.30f);
liquidCapacity = 40f; liquidCapacity = 40f;
hasPower = true; hasPower = true;
size = 2; size = 3;
tier = 2;
}}; }};
conduit = new Conduit("conduit"){{ conduit = new Conduit("conduit"){{
@@ -949,7 +946,7 @@ public class Blocks implements ContentList{
waterExtractor = new SolidPump("water-extractor"){{ waterExtractor = new SolidPump("water-extractor"){{
requirements(Category.production, ItemStack.with(Items.copper, 50, Items.graphite, 50, Items.lead, 40)); requirements(Category.production, ItemStack.with(Items.copper, 50, Items.graphite, 50, Items.lead, 40));
result = Liquids.water; result = Liquids.water;
pumpAmount = 0.065f; pumpAmount = 0.13f;
size = 2; size = 2;
liquidCapacity = 30f; liquidCapacity = 30f;
rotateSpeed = 1.4f; rotateSpeed = 1.4f;
@@ -963,7 +960,7 @@ public class Blocks implements ContentList{
updateEffect = Fx.pulverize; updateEffect = Fx.pulverize;
liquidCapacity = 50f; liquidCapacity = 50f;
updateEffectChance = 0.05f; updateEffectChance = 0.05f;
pumpAmount = 0.09f; pumpAmount = 0.25f;
size = 3; size = 3;
liquidCapacity = 30f; liquidCapacity = 30f;

View File

@@ -12,14 +12,12 @@ public class Liquids implements ContentList{
water = new Liquid("water", Color.valueOf("596ab8")){{ water = new Liquid("water", Color.valueOf("596ab8")){{
heatCapacity = 0.4f; heatCapacity = 0.4f;
tier = 0;
effect = StatusEffects.wet; effect = StatusEffects.wet;
}}; }};
slag = new Liquid("slag", Color.valueOf("ffa166")){{ slag = new Liquid("slag", Color.valueOf("ffa166")){{
temperature = 1f; temperature = 1f;
viscosity = 0.8f; viscosity = 0.8f;
tier = 2;
effect = StatusEffects.melting; effect = StatusEffects.melting;
}}; }};
@@ -28,14 +26,12 @@ public class Liquids implements ContentList{
flammability = 1.2f; flammability = 1.2f;
explosiveness = 1.2f; explosiveness = 1.2f;
heatCapacity = 0.7f; heatCapacity = 0.7f;
tier = 1;
effect = StatusEffects.tarred; effect = StatusEffects.tarred;
}}; }};
cryofluid = new Liquid("cryofluid", Color.valueOf("6ecdec")){{ cryofluid = new Liquid("cryofluid", Color.valueOf("6ecdec")){{
heatCapacity = 0.9f; heatCapacity = 0.9f;
temperature = 0.25f; temperature = 0.25f;
tier = 1;
effect = StatusEffects.freezing; effect = StatusEffects.freezing;
}}; }};
} }

View File

@@ -143,16 +143,21 @@ public class Units{
/**Returns the closest target enemy. First, units are checked, then tile entities.*/ /**Returns the closest target enemy. First, units are checked, then tile entities.*/
public static TargetTrait getClosestTarget(Team team, float x, float y, float range){ public static TargetTrait getClosestTarget(Team team, float x, float y, float range){
return getClosestTarget(team, x, y, range, u -> !u.isDead() && u.isAdded()); return getClosestTarget(team, x, y, range, Unit::isValid);
} }
/**Returns the closest target enemy. First, units are checked, then tile entities.*/ /**Returns the closest target enemy. First, units are checked, then tile entities.*/
public static TargetTrait getClosestTarget(Team team, float x, float y, float range, Predicate<Unit> unitPred){ public static TargetTrait getClosestTarget(Team team, float x, float y, float range, Predicate<Unit> unitPred){
return getClosestTarget(team, x, y, range, unitPred, t -> true);
}
/**Returns the closest target enemy. First, units are checked, then tile entities.*/
public static TargetTrait getClosestTarget(Team team, float x, float y, float range, Predicate<Unit> unitPred, Predicate<Tile> tilePred){
Unit unit = getClosestEnemy(team, x, y, range, unitPred); Unit unit = getClosestEnemy(team, x, y, range, unitPred);
if(unit != null){ if(unit != null){
return unit; return unit;
}else{ }else{
return findEnemyTile(team, x, y, range, tile -> true); return findEnemyTile(team, x, y, range, tilePred);
} }
} }

View File

@@ -462,11 +462,8 @@ public class Player extends Unit implements BuilderTrait, ShooterTrait{
//region update methods //region update methods
Vector2 last = new Vector2();
@Override @Override
public void update(){ public void update(){
last.set(this);
hitTime -= Time.delta(); hitTime -= Time.delta();
@@ -685,7 +682,7 @@ public class Player extends Unit implements BuilderTrait, ShooterTrait{
if(target == null){ if(target == null){
isShooting = false; isShooting = false;
if(Core.settings.getBool("autotarget")){ if(Core.settings.getBool("autotarget")){
target = Units.getClosestTarget(team, x, y, getWeapon().bullet.range(), u -> u.getTeam() != Team.none); target = Units.getClosestTarget(team, x, y, getWeapon().bullet.range(), u -> u.getTeam() != Team.none, u -> u.getTeam() != Team.none);
if(mech.canHeal && target == null){ if(mech.canHeal && target == null){
target = Geometry.findClosest(x, y, world.indexer.getDamaged(Team.blue)); target = Geometry.findClosest(x, y, world.indexer.getDamaged(Team.blue));

View File

@@ -25,8 +25,6 @@ public class Liquid extends UnlockableContent{
public Color flameColor = Color.valueOf("ffb763"); public Color flameColor = Color.valueOf("ffb763");
/**The associated status effect.*/ /**The associated status effect.*/
public StatusEffect effect = StatusEffects.none; public StatusEffect effect = StatusEffects.none;
/**Pump tier. Controls which pumps can use this liquid.*/
public int tier;
/**Displayed icon. TODO fix it by removing autogen, draw icons manually*/ /**Displayed icon. TODO fix it by removing autogen, draw icons manually*/
public TextureRegion iconRegion; public TextureRegion iconRegion;

View File

@@ -23,7 +23,6 @@ import io.anuke.arc.util.Time;
import io.anuke.arc.util.Tmp; import io.anuke.arc.util.Tmp;
import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.core.GameState.State;
import io.anuke.mindustry.game.EventType.StateChangeEvent; import io.anuke.mindustry.game.EventType.StateChangeEvent;
import io.anuke.mindustry.game.Team;
import io.anuke.mindustry.game.UnlockableContent; import io.anuke.mindustry.game.UnlockableContent;
import io.anuke.mindustry.gen.Call; import io.anuke.mindustry.gen.Call;
import io.anuke.mindustry.graphics.Pal; import io.anuke.mindustry.graphics.Pal;
@@ -466,12 +465,8 @@ public class HudFragment extends Fragment{
}else{ }else{
state.wavetime = 0f; state.wavetime = 0f;
} }
}).growY().fillX().right().width(40f).update(l -> { }).growY().fillX().right().width(40f)
boolean vis = !state.rules.waveTimer && ((Net.server() || players[0].isAdmin) || !Net.active()); .visible(() -> state.rules.waves && ((Net.server() || players[0].isAdmin) || !Net.active()) && state.enemies() == 0
boolean paused = state.is(State.paused) || !vis; && state.wavetime < state.rules.waveSpacing - 60);
l.getStyle().imageUp = Core.scene.skin.getDrawable(vis ? "icon-play" : "clear");
l.touchable(!paused ? Touchable.enabled : Touchable.disabled);
}).visible(() -> !state.rules.waveTimer && ((Net.server() || players[0].isAdmin) || !Net.active()) && unitGroups[Team.red.ordinal()].size() == 0);
} }
} }

View File

@@ -28,7 +28,6 @@ import static io.anuke.mindustry.Vars.*;
public class Conveyor extends Block{ public class Conveyor extends Block{
private static final float itemSpace = 0.135f * 3f; private static final float itemSpace = 0.135f * 3f;
private static final float offsetScl = 128f * 3f;
private static final float minmove = 1f / (Short.MAX_VALUE - 2); private static final float minmove = 1f / (Short.MAX_VALUE - 2);
private static ItemPos drawpos = new ItemPos(); private static ItemPos drawpos = new ItemPos();
private static ItemPos pos1 = new ItemPos(); private static ItemPos pos1 = new ItemPos();

View File

@@ -160,7 +160,7 @@ public class Drill extends Block{
} }
}); });
stats.add(BlockStat.drillSpeed, 60f / drillTime, StatUnit.itemsSecond); stats.add(BlockStat.drillSpeed, 60f / drillTime * size * size, StatUnit.itemsSecond);
} }
@Override @Override

View File

@@ -21,8 +21,6 @@ public class Pump extends LiquidBlock{
/**Pump amount per tile this block is on.*/ /**Pump amount per tile this block is on.*/
protected float pumpAmount = 1f; protected float pumpAmount = 1f;
/**Maximum liquid tier this pump can use.*/
protected int tier = 0;
public Pump(String name){ public Pump(String name){
super(name); super(name);
@@ -42,7 +40,7 @@ public class Pump extends LiquidBlock{
@Override @Override
public void setStats(){ public void setStats(){
super.setStats(); super.setStats();
stats.add(BlockStat.liquidOutputSpeed, 60f * pumpAmount, StatUnit.liquidSecond); stats.add(BlockStat.liquidOutputSpeed, 60f * pumpAmount * size * size, StatUnit.liquidSecond);
} }
@Override @Override
@@ -115,7 +113,7 @@ public class Pump extends LiquidBlock{
} }
protected boolean isValid(Tile tile){ protected boolean isValid(Tile tile){
return tile != null && tile.floor().liquidDrop != null && tier >= tile.floor().liquidDrop.tier; return tile != null && tile.floor().liquidDrop != null;
} }
} }

View File

@@ -69,7 +69,7 @@ public class SolidPump extends Pump{
if(isMultiblock()){ if(isMultiblock()){
for(Tile other : tile.getLinkedTiles(tempTiles)){ for(Tile other : tile.getLinkedTiles(tempTiles)){
if(isValid(other)){ if(isValid(other)){
fraction += 1f / size; fraction += 1f / (size * size);
} }
} }
}else{ }else{

View File

@@ -222,7 +222,7 @@ public class MechPad extends Block{
player.rotation = 90f; player.rotation = 90f;
player.baseRotation = 90f; player.baseRotation = 90f;
player.set(x, y); player.setNet(x, y);
player.beginRespawning(this); player.beginRespawning(this);
} }
} }