This commit is contained in:
Anuken
2019-02-19 13:43:15 -05:00
parent a815c564fb
commit cbcf237d80
9 changed files with 30 additions and 30 deletions

View File

@@ -253,7 +253,7 @@ bestwave = [LIGHT_GRAY]Best Wave: {0}
launch = < LAUNCH > launch = < LAUNCH >
launch.title = Launch Successful launch.title = Launch Successful
launch.next = [LIGHT_GRAY]next opportunity at wave {0} launch.next = [LIGHT_GRAY]next opportunity at wave {0}
launch.unable = [scarlet]Unable to LAUNCH.[] Enemies. launch.unable = [scarlet]Unable to LAUNCH.[] {0} Enemies.
launch.confirm = This will launch all resources in your core.\nYou will not be able to return to this base. launch.confirm = This will launch all resources in your core.\nYou will not be able to return to this base.
uncover = Uncover uncover = Uncover
configure = Configure Loadout configure = Configure Loadout

View File

@@ -34,7 +34,7 @@ public class Fx implements ContentList{
bigShockwave, nuclearShockwave, explosion, blockExplosion, blockExplosionSmoke, shootSmall, shootHeal, shootSmallSmoke, shootBig, shootBig2, shootBigSmoke, bigShockwave, nuclearShockwave, explosion, blockExplosion, blockExplosionSmoke, shootSmall, shootHeal, shootSmallSmoke, shootBig, shootBig2, shootBigSmoke,
shootBigSmoke2, shootSmallFlame, shootLiquid, shellEjectSmall, shellEjectMedium, shootBigSmoke2, shootSmallFlame, shootLiquid, shellEjectSmall, shellEjectMedium,
shellEjectBig, lancerLaserShoot, lancerLaserShootSmoke, lancerLaserCharge, lancerLaserChargeBegin, lightningCharge, lightningShoot, shellEjectBig, lancerLaserShoot, lancerLaserShootSmoke, lancerLaserCharge, lancerLaserChargeBegin, lightningCharge, lightningShoot,
launchFull, unitSpawn, spawnShockwave, magmasmoke, impactShockwave, impactcloud, impactsmoke; unitSpawn, spawnShockwave, magmasmoke, impactShockwave, impactcloud, impactsmoke;
@Override @Override
public void load(){ public void load(){
@@ -1160,12 +1160,5 @@ public class Fx implements ContentList{
Lines.poly(e.x, e.y, 6, e.rotation + e.fin(), 90); Lines.poly(e.x, e.y, 6, e.rotation + e.fin(), 90);
Draw.reset(); Draw.reset();
}); });
launchFull = new Effect(60, 9999999999f, e -> {
Draw.color();
Draw.alpha(e.fslope());
Fill.rect(Core.camera.position.x, Core.camera.position.y, Core.camera.width + 10, Core.camera.height + 10);
Draw.reset();
});
} }
} }

View File

@@ -111,7 +111,9 @@ public class Logic implements ApplicationListener{
@Remote(called = Loc.both) @Remote(called = Loc.both)
public static void launchZone(){ public static void launchZone(){
Effects.effect(Fx.launchFull, 0, 0); if(!headless){
ui.hudfrag.showLaunch();
}
for(Tile tile : new ObjectSetIterator<>(state.teams.get(defaultTeam).cores)){ for(Tile tile : new ObjectSetIterator<>(state.teams.get(defaultTeam).cores)){
Effects.effect(Fx.launch, tile); Effects.effect(Fx.launch, tile);

View File

@@ -33,11 +33,6 @@ public class Stats{
score += (float)((zone.conditionWave - wavesLasted) / zone.launchPeriod + 1) * 1.5f; score += (float)((zone.conditionWave - wavesLasted) / zone.launchPeriod + 1) * 1.5f;
} }
//building more stuff gives a better score slightly
score += (buildingsBuilt - buildingsDeconstructed)*0.001f;
//destroyed buildings penalize score
score -= buildingsDestroyed * 0.003f;
int capacity = zone.generator.coreBlock.itemCapacity; int capacity = zone.generator.coreBlock.itemCapacity;
//weigh used fractions of //weigh used fractions of

View File

@@ -11,7 +11,7 @@ import java.nio.ByteBuffer;
public class MapTileData{ public class MapTileData{
/** /**
* Tile size: 4 bytes. <br> * Tile size: 5 bytes. <br>
* 0: ground tile <br> * 0: ground tile <br>
* 1: wall tile <br> * 1: wall tile <br>
* 2: rotation + team <br> * 2: rotation + team <br>

View File

@@ -17,7 +17,10 @@ import io.anuke.arc.scene.ui.layout.Stack;
import io.anuke.arc.scene.ui.layout.Table; import io.anuke.arc.scene.ui.layout.Table;
import io.anuke.arc.scene.ui.layout.Unit; import io.anuke.arc.scene.ui.layout.Unit;
import io.anuke.arc.scene.utils.Elements; import io.anuke.arc.scene.utils.Elements;
import io.anuke.arc.util.*; import io.anuke.arc.util.Align;
import io.anuke.arc.util.Scaling;
import io.anuke.arc.util.Time;
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.Team;
@@ -28,9 +31,6 @@ import io.anuke.mindustry.input.Binding;
import io.anuke.mindustry.net.Net; import io.anuke.mindustry.net.Net;
import io.anuke.mindustry.net.Packets.AdminAction; import io.anuke.mindustry.net.Packets.AdminAction;
import io.anuke.mindustry.ui.IntFormat; import io.anuke.mindustry.ui.IntFormat;
import io.anuke.mindustry.ui.dialogs.FloatingDialog;
import java.lang.StringBuilder;
import static io.anuke.mindustry.Vars.*; import static io.anuke.mindustry.Vars.*;
@@ -235,7 +235,7 @@ public class HudFragment extends Fragment{
return; return;
} }
button.setText(Core.bundle.get(state.enemies() > 0 ? "launch.unable" : "launch") + "\n" + button.setText(state.enemies() > 0 ? Core.bundle.format("launch.unable", state.enemies()) : Core.bundle.get("launch") + "\n" +
Core.bundle.format("launch.next", state.wave + world.getZone().launchPeriod)); Core.bundle.format("launch.next", state.wave + world.getZone().launchPeriod));
button.getLabel().setColor(Tmp.c1.set(Color.WHITE).lerp(state.enemies() > 0 ? Color.WHITE : Pal.accent, button.getLabel().setColor(Tmp.c1.set(Color.WHITE).lerp(state.enemies() > 0 ? Color.WHITE : Pal.accent,
@@ -370,14 +370,17 @@ public class HudFragment extends Fragment{
} }
} }
public void showTextDialog(String str){ public void showLaunch(){
new FloatingDialog("$mission.info"){{ Image image = new Image("white");
shouldPause = true; image.getColor().a = 0f;
setFillParent(false); image.setFillParent(true);
getCell(cont).growX(); image.actions(Actions.fadeIn(40f / 60f));
cont.margin(15).add(str).width(400f).wrap().get().setAlignment(Align.left, Align.left); image.update(() -> {
buttons.addButton("$continue", this::hide).size(140, 60).pad(4); if(state.is(State.menu)){
}}.show(); image.remove();
}
});
Core.scene.add(image);
} }
private void toggleMenus(){ private void toggleMenus(){

View File

@@ -25,10 +25,15 @@ public class Build{
} }
Tile tile = world.tile(x, y); Tile tile = world.tile(x, y);
float prevPercent = 1f;
//just in case //just in case
if(tile == null) return; if(tile == null) return;
if(tile.entity != null){
prevPercent = tile.entity.health();
}
tile = tile.target(); tile = tile.target();
Block previous = tile.block(); Block previous = tile.block();
@@ -38,6 +43,7 @@ public class Build{
tile.setBlock(sub); tile.setBlock(sub);
tile.<BuildEntity>entity().setDeconstruct(previous); tile.<BuildEntity>entity().setDeconstruct(previous);
tile.setTeam(team); tile.setTeam(team);
tile.entity.health = tile.entity.maxHealth() * prevPercent;
if(previous.isMultiblock()){ if(previous.isMultiblock()){
int offsetx = -(previous.size - 1) / 2; int offsetx = -(previous.size - 1) / 2;

View File

@@ -39,7 +39,7 @@ public class BuildBlock extends Block{
super(name); super(name);
update = true; update = true;
size = Integer.parseInt(name.charAt(name.length() - 1) + ""); size = Integer.parseInt(name.charAt(name.length() - 1) + "");
health = 10; health = 20;
layer = Layer.placement; layer = Layer.placement;
consumesTap = true; consumesTap = true;
solidifes = true; solidifes = true;

View File

@@ -11,6 +11,7 @@ public class DifferentialGenerator extends TurbineGenerator{
public DifferentialGenerator(String name){ public DifferentialGenerator(String name){
super(name); super(name);
hasLiquids = true;
consumes.require(ConsumeItem.class); consumes.require(ConsumeItem.class);
consumes.require(ConsumeLiquid.class); consumes.require(ConsumeLiquid.class);
} }