Added prompt for loading legacy research data

This commit is contained in:
Anuken
2020-11-26 10:22:01 -05:00
parent e1ddf115e0
commit 465219540c
8 changed files with 19 additions and 15 deletions

View File

@@ -23,7 +23,7 @@ gameover.waiting = [accent]Waiting for next map...
highscore = [accent]New highscore! highscore = [accent]New highscore!
copied = Copied. copied = Copied.
indev.notready = This part of the game isn't ready yet indev.notready = This part of the game isn't ready yet
indev.campaign = [accent]You've reached the end of the campaign![]\n\nThis is as far as the content goes. Interplanetary travel will be added in future updates. indev.campaign = [accent]Congratulations! You've reached the end of the campaign![]\n\nThis is as far as the content goes right now. Interplanetary travel will be added in future updates.
load.sound = Sounds load.sound = Sounds
load.map = Maps load.map = Maps
@@ -149,6 +149,9 @@ unlocked = New content unlocked!
available = New research available! available = New research available!
completed = [accent]Completed completed = [accent]Completed
techtree = Tech Tree techtree = Tech Tree
research.legacy = [accent]5.0[] research data found.\nDo you want to [accent]load this data[], or [accent]discard it[] and restart research in the new campaign (recommended)?
research.load = Load
research.discard = Discard
research.list = [lightgray]Research: research.list = [lightgray]Research:
research = Research research = Research
researched = [lightgray]{0} researched. researched = [lightgray]{0} researched.

View File

@@ -422,7 +422,7 @@ public class TechTree implements ContentList{
node(additiveReconstructor, Seq.with(new SectorComplete(biomassFacility)), () -> { node(additiveReconstructor, Seq.with(new SectorComplete(biomassFacility)), () -> {
node(multiplicativeReconstructor, () -> { node(multiplicativeReconstructor, () -> {
node(exponentialReconstructor, () -> { node(exponentialReconstructor, Seq.with(new SectorComplete(overgrowth)), () -> {
node(tetrativeReconstructor, () -> { node(tetrativeReconstructor, () -> {
}); });

View File

@@ -1349,7 +1349,7 @@ public class UnitTypes implements ContentList{
collides = false; collides = false;
healPercent = 15f; healPercent = 15f;
splashDamage = 240f; splashDamage = 230f;
splashDamageRadius = 120f; splashDamageRadius = 120f;
}}; }};
}}); }});

View File

@@ -397,8 +397,8 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
/** Actually destroys the unit, removing it and creating explosions. **/ /** Actually destroys the unit, removing it and creating explosions. **/
public void destroy(){ public void destroy(){
float explosiveness = 2f + item().explosiveness * stack().amount / 2.4f; float explosiveness = 2f + item().explosiveness * stack().amount / 3f;
float flammability = item().flammability * stack().amount / 2.4f; float flammability = item().flammability * stack().amount / 3f;
Damage.dynamicExplosion(x, y, flammability, explosiveness, 0f, bounds() / 2f, Pal.darkFlame, state.rules.damageExplosions); Damage.dynamicExplosion(x, y, flammability, explosiveness, 0f, bounds() / 2f, Pal.darkFlame, state.rules.damageExplosions);
float shake = hitSize / 3f; float shake = hitSize / 3f;

View File

@@ -6,7 +6,6 @@ import arc.struct.*;
import arc.util.*; import arc.util.*;
import mindustry.content.*; import mindustry.content.*;
import mindustry.game.EventType.*; import mindustry.game.EventType.*;
import mindustry.io.legacy.*;
import mindustry.maps.*; import mindustry.maps.*;
import mindustry.type.*; import mindustry.type.*;
import mindustry.world.blocks.storage.*; import mindustry.world.blocks.storage.*;
@@ -27,13 +26,6 @@ public class Universe{
public Universe(){ public Universe(){
load(); load();
//load legacy research
Events.on(ClientLoadEvent.class, e -> {
if(Core.settings.has("unlocks")){
LegacyIO.readResearch();
}
});
//update base coverage on capture //update base coverage on capture
Events.on(SectorCaptureEvent.class, e -> { Events.on(SectorCaptureEvent.class, e -> {
if(!net.client() && state.isCampaign()){ if(!net.client() && state.isCampaign()){

View File

@@ -23,6 +23,7 @@ import mindustry.gen.*;
import mindustry.graphics.*; import mindustry.graphics.*;
import mindustry.graphics.g3d.*; import mindustry.graphics.g3d.*;
import mindustry.input.*; import mindustry.input.*;
import mindustry.io.legacy.*;
import mindustry.maps.*; import mindustry.maps.*;
import mindustry.type.*; import mindustry.type.*;
import mindustry.ui.*; import mindustry.ui.*;
@@ -140,6 +141,13 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
return this; return this;
} }
//load legacy research
if(Core.settings.has("unlocks") && !Core.settings.has("junction-unlocked")){
Core.app.post(() -> {
ui.showCustomConfirm("@research", "@research.legacy", "@research.load", "@research.discard", LegacyIO::readResearch, () -> Core.settings.remove("unlocks"));
});
}
rebuildButtons(); rebuildButtons();
mode = look; mode = look;
selected = hovered = launchSector = null; selected = hovered = launchSector = null;

View File

@@ -54,6 +54,7 @@ public class LaserTurret extends PowerTurret{
super.updateTile(); super.updateTile();
if(bulletLife > 0 && bullet != null){ if(bulletLife > 0 && bullet != null){
wasShooting = true;
tr.trns(rotation, size * tilesize / 2f, 0f); tr.trns(rotation, size * tilesize / 2f, 0f);
bullet.rotation(rotation); bullet.rotation(rotation);
bullet.set(x + tr.x, y + tr.y); bullet.set(x + tr.x, y + tr.y);
@@ -65,6 +66,7 @@ public class LaserTurret extends PowerTurret{
bullet = null; bullet = null;
} }
}else if(reload > 0){ }else if(reload > 0){
wasShooting = true;
Liquid liquid = liquids.current(); Liquid liquid = liquids.current();
float maxUsed = consumes.<ConsumeLiquidBase>get(ConsumeType.liquid).amount; float maxUsed = consumes.<ConsumeLiquidBase>get(ConsumeType.liquid).amount;
@@ -76,7 +78,6 @@ public class LaserTurret extends PowerTurret{
coolEffect.at(x + Mathf.range(size * tilesize / 2f), y + Mathf.range(size * tilesize / 2f)); coolEffect.at(x + Mathf.range(size * tilesize / 2f), y + Mathf.range(size * tilesize / 2f));
} }
} }
} }
@Override @Override

View File

@@ -205,7 +205,7 @@ public abstract class Turret extends ReloadTurret{
} }
public boolean isActive(){ public boolean isActive(){
return target != null || (logicControlled() && logicShooting) || (isControlled() && unit.isShooting()); return target != null || wasShooting;
} }
public void targetPosition(Posc pos){ public void targetPosition(Posc pos){