Tutorial fixes
This commit is contained in:
@@ -1,15 +1,13 @@
|
||||
package io.anuke.mindustry.game;
|
||||
|
||||
import io.anuke.arc.Core;
|
||||
import io.anuke.arc.Events;
|
||||
import io.anuke.arc.*;
|
||||
import io.anuke.arc.collection.*;
|
||||
import io.anuke.mindustry.Vars;
|
||||
import io.anuke.mindustry.content.Items;
|
||||
import io.anuke.mindustry.game.EventType.UnlockEvent;
|
||||
import io.anuke.mindustry.*;
|
||||
import io.anuke.mindustry.content.*;
|
||||
import io.anuke.mindustry.game.EventType.*;
|
||||
import io.anuke.mindustry.type.*;
|
||||
|
||||
import static io.anuke.mindustry.Vars.content;
|
||||
import static io.anuke.mindustry.Vars.state;
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
|
||||
/** Stores player unlocks. Clientside only. */
|
||||
public class GlobalData{
|
||||
@@ -40,7 +38,9 @@ public class GlobalData{
|
||||
}
|
||||
|
||||
public void addItem(Item item, int amount){
|
||||
unlockContent(item);
|
||||
if(amount > 0){
|
||||
unlockContent(item);
|
||||
}
|
||||
modified = true;
|
||||
items.getAndIncrement(item, 0, amount);
|
||||
state.stats.itemsDelivered.getAndIncrement(item, 0, amount);
|
||||
|
||||
@@ -20,7 +20,7 @@ import static io.anuke.mindustry.Vars.*;
|
||||
/** Handles tutorial state. */
|
||||
public class Tutorial{
|
||||
private static final int mineCopper = 18;
|
||||
private static final int blocksToBreak = 3, blockOffset = 5;
|
||||
private static final int blocksToBreak = 3, blockOffset = -6;
|
||||
|
||||
private ObjectSet<String> events = new ObjectSet<>();
|
||||
private ObjectIntMap<Block> blocksPlaced = new ObjectIntMap<>();
|
||||
@@ -179,7 +179,7 @@ public class Tutorial{
|
||||
state.wave = 5;
|
||||
|
||||
//end tutorial, never show it again
|
||||
Core.settings.put("tutorial", true);
|
||||
Core.settings.put("playedtutorial", true);
|
||||
Core.settings.save();
|
||||
}
|
||||
|
||||
@@ -230,7 +230,7 @@ public class Tutorial{
|
||||
Tile core = state.teams.get(defaultTeam).cores.first();
|
||||
for(int i = 0; i < blocksToBreak; i++){
|
||||
world.removeBlock(world.ltile(core.x + blockOffset, core.y + i));
|
||||
world.tile(core.x + blockOffset, core.y + i).setBlock(Blocks.scrapWall);
|
||||
world.tile(core.x + blockOffset, core.y + i).setBlock(Blocks.scrapWall, defaultTeam);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user