Removed Rules#tutorial

This commit is contained in:
Anuken
2020-11-20 11:23:30 -05:00
parent 139fa329d4
commit 814065bf8e
10 changed files with 33 additions and 57 deletions

View File

@@ -465,7 +465,8 @@ public class TechTree implements ContentList{
//TODO change positions? //TODO change positions?
node(impact0078, Seq.with( node(impact0078, Seq.with(
new SectorComplete(tarFields), new SectorComplete(tarFields),
new Research(Items.thorium) new Research(Items.thorium),
new Research(coreFoundation)
), () -> { ), () -> {
node(desolateRift, Seq.with( node(desolateRift, Seq.with(
new SectorComplete(impact0078), new SectorComplete(impact0078),

View File

@@ -995,6 +995,7 @@ public class UnitTypes implements ContentList{
shots = 2; shots = 2;
inaccuracy = 5f; inaccuracy = 5f;
velocityRnd = 0.2f; velocityRnd = 0.2f;
shootSound = Sounds.missile;
bullet = new MissileBulletType(3f, 12){{ bullet = new MissileBulletType(3f, 12){{
width = 8f; width = 8f;
@@ -1055,7 +1056,7 @@ public class UnitTypes implements ContentList{
ejectEffect = Fx.casing1; ejectEffect = Fx.casing1;
rotateSpeed = 8f; rotateSpeed = 8f;
bullet = missiles; bullet = missiles;
shootSound = Sounds.shoot; shootSound = Sounds.missile;
rotate = true; rotate = true;
occlusion = 6f; occlusion = 6f;
}}, }},
@@ -1066,7 +1067,7 @@ public class UnitTypes implements ContentList{
rotateSpeed = 8f; rotateSpeed = 8f;
ejectEffect = Fx.casing1; ejectEffect = Fx.casing1;
bullet = missiles; bullet = missiles;
shootSound = Sounds.shoot; shootSound = Sounds.missile;
rotate = true; rotate = true;
occlusion = 6f; occlusion = 6f;
}}, }},
@@ -1147,7 +1148,7 @@ public class UnitTypes implements ContentList{
y = 27f; y = 27f;
rotateSpeed = 2f; rotateSpeed = 2f;
reload = 9f; reload = 9f;
shootSound = Sounds.flame; shootSound = Sounds.shoot;
occlusion = 7f; occlusion = 7f;
rotate = true; rotate = true;
recoil = 0.5f; recoil = 0.5f;

View File

@@ -164,7 +164,7 @@ public class Control implements ApplicationListener, Loadable{
if(state.isCampaign() && !net.client() && !headless){ if(state.isCampaign() && !net.client() && !headless){
//save gameover sate immediately //save gameover sate immediately
if(saves.getCurrent() != null && !state.rules.tutorial){ if(saves.getCurrent() != null){
saves.getCurrent().save(); saves.getCurrent().save();
} }
} }
@@ -479,10 +479,6 @@ public class Control implements ApplicationListener, Loadable{
if(state.isGame()){ if(state.isGame()){
input.update(); input.update();
if(state.rules.tutorial){
tutorial.update();
}
//auto-update rpc every 5 seconds //auto-update rpc every 5 seconds
if(timer.get(0, 60 * 5)){ if(timer.get(0, 60 * 5)){
platform.updateRPC(); platform.updateRPC();

View File

@@ -140,12 +140,6 @@ public class UI implements ApplicationListener, Loadable{
} }
} }
//draw overlay for buttons
if(state.rules.tutorial){
control.tutorial.draw();
Draw.flush();
}
Events.fire(Trigger.uiDrawEnd); Events.fire(Trigger.uiDrawEnd);
} }

View File

@@ -32,8 +32,6 @@ public class Rules{
public boolean attackMode = false; public boolean attackMode = false;
/** Whether this is the editor gamemode. */ /** Whether this is the editor gamemode. */
public boolean editor = false; public boolean editor = false;
/** Whether the tutorial is enabled. False by default. */
public boolean tutorial = false;
/** Whether a gameover can happen at all. Set this to false to implement custom gameover conditions. */ /** Whether a gameover can happen at all. Set this to false to implement custom gameover conditions. */
public boolean canGameOver = true; public boolean canGameOver = true;
/** Whether reactors can explode and damage other blocks. */ /** Whether reactors can explode and damage other blocks. */

View File

@@ -85,7 +85,7 @@ public class Saves{
lastTimestamp = Time.millis(); lastTimestamp = Time.millis();
} }
if(state.isGame() && !state.gameOver && current != null && current.isAutosave() && !state.rules.tutorial){ if(state.isGame() && !state.gameOver && current != null && current.isAutosave()){
time += Time.delta; time += Time.delta;
if(time > Core.settings.getInt("saveinterval") * 60){ if(time > Core.settings.getInt("saveinterval") * 60){
saving = true; saving = true;

View File

@@ -35,30 +35,28 @@ public class PausedDialog extends BaseDialog{
cont.button("@back", Icon.left, this::hide).name("back"); cont.button("@back", Icon.left, this::hide).name("back");
cont.button("@settings", Icon.settings, ui.settings::show).name("settings"); cont.button("@settings", Icon.settings, ui.settings::show).name("settings");
if(!state.rules.tutorial){ if(!state.isCampaign() && !state.isEditor()){
if(!state.isCampaign() && !state.isEditor()){
cont.row();
cont.button("@savegame", Icon.save, save::show);
cont.button("@loadgame", Icon.upload, load::show).disabled(b -> net.active());
}
cont.row(); cont.row();
cont.button("@savegame", Icon.save, save::show);
cont.button("@hostserver", Icon.host, () -> { cont.button("@loadgame", Icon.upload, load::show).disabled(b -> net.active());
if(net.server() && steam){
platform.inviteFriends();
}else{
if(steam){
ui.host.runHost();
}else{
ui.host.show();
}
}
}).disabled(b -> !((steam && net.server()) || !net.active())).colspan(2).width(dw * 2 + 20f).update(e -> e.setText(net.server() && steam ? "@invitefriends" : "@hostserver"));
} }
cont.row(); cont.row();
cont.button("@hostserver", Icon.host, () -> {
if(net.server() && steam){
platform.inviteFriends();
}else{
if(steam){
ui.host.runHost();
}else{
ui.host.show();
}
}
}).disabled(b -> !((steam && net.server()) || !net.active())).colspan(2).width(dw * 2 + 20f).update(e -> e.setText(net.server() && steam ? "@invitefriends" : "@hostserver"));
cont.row();
cont.button("@quit", Icon.exit, this::showQuitConfirm).colspan(2).width(dw + 20f).update(s -> s.setText(control.saves.getCurrent() != null && control.saves.getCurrent().isAutosave() ? "@save.quit" : "@quit")); cont.button("@quit", Icon.exit, this::showQuitConfirm).colspan(2).width(dw + 20f).update(s -> s.setText(control.saves.getCurrent() != null && control.saves.getCurrent().isAutosave() ? "@save.quit" : "@quit"));
}else{ }else{
@@ -95,10 +93,7 @@ public class PausedDialog extends BaseDialog{
} }
void showQuitConfirm(){ void showQuitConfirm(){
ui.showConfirm("@confirm", state.rules.tutorial ? "@quit.confirm.tutorial" : "@quit.confirm", () -> { ui.showConfirm("@confirm", "@quit.confirm", () -> {
if(state.rules.tutorial){
Core.settings.put("playedtutorial", true);
}
wasClient = net.client(); wasClient = net.client();
if(net.client()) netClient.disconnectQuietly(); if(net.client()) netClient.disconnectQuietly();
runExitSave(); runExitSave();
@@ -112,7 +107,7 @@ public class PausedDialog extends BaseDialog{
return; return;
} }
if(control.saves.getCurrent() == null || !control.saves.getCurrent().isAutosave() || state.rules.tutorial || wasClient){ if(control.saves.getCurrent() == null || !control.saves.getCurrent().isAutosave() || wasClient){
logic.reset(); logic.reset();
return; return;
} }

View File

@@ -96,13 +96,13 @@ public class HudFragment extends Fragment{
//minimap + position //minimap + position
parent.fill(t -> { parent.fill(t -> {
t.name = "minimap/position"; t.name = "minimap/position";
t.visible(() -> Core.settings.getBool("minimap") && !state.rules.tutorial && shown); t.visible(() -> Core.settings.getBool("minimap") && shown);
//minimap //minimap
t.add(new Minimap()).name("minimap"); t.add(new Minimap()).name("minimap");
t.row(); t.row();
//position //position
t.label(() -> player.tileX() + "," + player.tileY()) t.label(() -> player.tileX() + "," + player.tileY())
.visible(() -> Core.settings.getBool("position") && !state.rules.tutorial) .visible(() -> Core.settings.getBool("position"))
.touchable(Touchable.disabled) .touchable(Touchable.disabled)
.name("position"); .name("position");
t.top().right(); t.top().right();
@@ -319,12 +319,12 @@ public class HudFragment extends Fragment{
.update(label -> label.color.set(Color.orange).lerp(Color.scarlet, Mathf.absin(Time.time(), 2f, 1f)))).touchable(Touchable.disabled); .update(label -> label.color.set(Color.orange).lerp(Color.scarlet, Mathf.absin(Time.time(), 2f, 1f)))).touchable(Touchable.disabled);
}); });
//tutorial text //TODO tutorial text
parent.fill(t -> { parent.fill(t -> {
t.name = "tutorial"; t.name = "tutorial";
Runnable resize = () -> { Runnable resize = () -> {
t.clearChildren(); t.clearChildren();
t.top().right().visible(() -> state.rules.tutorial); t.top().right().visible(() -> false);
t.stack(new Button(){{ t.stack(new Button(){{
marginLeft(48f); marginLeft(48f);
labelWrap(() -> control.tutorial.stage.text() + (control.tutorial.canNext() ? "\n\n" + Core.bundle.get("tutorial.next") : "")).width(!Core.graphics.isPortrait() ? 400f : 160f).pad(2f); labelWrap(() -> control.tutorial.stage.text() + (control.tutorial.canNext() ? "\n\n" + Core.bundle.get("tutorial.next") : "")).width(!Core.graphics.isPortrait() ? 400f : 160f).pad(2f);
@@ -465,7 +465,7 @@ public class HudFragment extends Fragment{
public void showUnlock(UnlockableContent content){ public void showUnlock(UnlockableContent content){
//some content may not have icons... yet //some content may not have icons... yet
//also don't play in the tutorial to prevent confusion //also don't play in the tutorial to prevent confusion
if(state.isMenu() || state.rules.tutorial) return; if(state.isMenu()) return;
Sounds.message.play(); Sounds.message.play();
@@ -788,7 +788,7 @@ public class HudFragment extends Fragment{
} }
private boolean canSkipWave(){ private boolean canSkipWave(){
return state.rules.waves && ((net.server() || player.admin) || !net.active()) && state.enemies == 0 && !spawner.isSpawning() && !state.rules.tutorial; return state.rules.waves && ((net.server() || player.admin) || !net.active()) && state.enemies == 0 && !spawner.isSpawning();
} }
} }

View File

@@ -139,11 +139,6 @@ public class ItemTurret extends Turret{
//must not be found //must not be found
ammo.add(new ItemEntry(item, (int)type.ammoMultiplier)); ammo.add(new ItemEntry(item, (int)type.ammoMultiplier));
//fire events for the tutorial
if(state.rules.tutorial){
Events.fire(new TurretAmmoDeliverEvent());
}
} }
@Override @Override

View File

@@ -366,10 +366,6 @@ public class CoreBlock extends StorageBlock{
}else{ }else{
super.handleItem(source, item); super.handleItem(source, item);
} }
if(state.rules.tutorial){
Events.fire(new CoreItemDeliverEvent());
}
} }
} }
} }