more tutorial
This commit is contained in:
@@ -68,6 +68,16 @@ public class EventType{
|
||||
|
||||
}
|
||||
|
||||
/** Called when a player withdraws items from a block. Tutorial only.*/
|
||||
public static class WithdrawEvent{
|
||||
|
||||
}
|
||||
|
||||
/** Called when a player deposits items to a block.*/
|
||||
public static class DepositEvent{
|
||||
|
||||
}
|
||||
|
||||
public static class GameOverEvent{
|
||||
public final Team winner;
|
||||
|
||||
|
||||
@@ -37,6 +37,8 @@ public class Tutorial{
|
||||
Events.on(TurretAmmoDeliverEvent.class, event -> events.add("ammo"));
|
||||
Events.on(CoreItemDeliverEvent.class, event -> events.add("coreitem"));
|
||||
Events.on(BlockInfoEvent.class, event -> events.add("blockinfo"));
|
||||
Events.on(DepositEvent.class, event -> events.add("deposit"));
|
||||
Events.on(WithdrawEvent.class, event -> events.add("withdraw"));
|
||||
}
|
||||
|
||||
/** update tutorial state, transition if needed */
|
||||
@@ -55,7 +57,7 @@ public class Tutorial{
|
||||
|
||||
/** Resets tutorial state. */
|
||||
public void reset(){
|
||||
stage = TutorialStage.values()[0];
|
||||
stage = TutorialStage.values()[6];
|
||||
stage.begin();
|
||||
blocksPlaced.clear();
|
||||
events.clear();
|
||||
@@ -120,7 +122,13 @@ public class Tutorial{
|
||||
}
|
||||
}
|
||||
},
|
||||
waves(() -> state.wave > 2 && state.enemies() <= 0){
|
||||
withdraw(() -> event("withdraw")){
|
||||
void begin(){
|
||||
state.teams.get(defaultTeam).cores.first().entity.items.add(Items.copper, 10);
|
||||
}
|
||||
},
|
||||
deposit(() -> event("deposit")),
|
||||
waves(() -> state.wave > 2 && state.enemies() <= 0 && !world.spawner.isSpawning()){
|
||||
void begin(){
|
||||
state.rules.waveTimer = true;
|
||||
logic.runWave();
|
||||
|
||||
@@ -1,34 +1,28 @@
|
||||
package io.anuke.mindustry.input;
|
||||
|
||||
import io.anuke.annotations.Annotations.Loc;
|
||||
import io.anuke.annotations.Annotations.Remote;
|
||||
import io.anuke.arc.Core;
|
||||
import io.anuke.arc.collection.Array;
|
||||
import io.anuke.arc.function.Consumer;
|
||||
import io.anuke.arc.graphics.Color;
|
||||
import io.anuke.arc.graphics.g2d.Draw;
|
||||
import io.anuke.arc.graphics.g2d.TextureRegion;
|
||||
import io.anuke.arc.input.InputProcessor;
|
||||
import io.anuke.arc.math.Angles;
|
||||
import io.anuke.arc.math.Mathf;
|
||||
import io.anuke.arc.math.geom.Point2;
|
||||
import io.anuke.arc.math.geom.Vector2;
|
||||
import io.anuke.arc.scene.ui.layout.Table;
|
||||
import io.anuke.arc.util.Time;
|
||||
import io.anuke.arc.util.Tmp;
|
||||
import io.anuke.mindustry.content.Blocks;
|
||||
import io.anuke.mindustry.content.Fx;
|
||||
import io.anuke.mindustry.entities.Effects;
|
||||
import io.anuke.mindustry.entities.effect.ItemTransfer;
|
||||
import io.anuke.mindustry.entities.traits.BuilderTrait.BuildRequest;
|
||||
import io.anuke.mindustry.entities.type.Player;
|
||||
import io.anuke.mindustry.gen.Call;
|
||||
import io.anuke.mindustry.graphics.Pal;
|
||||
import io.anuke.annotations.Annotations.*;
|
||||
import io.anuke.arc.*;
|
||||
import io.anuke.arc.collection.*;
|
||||
import io.anuke.arc.function.*;
|
||||
import io.anuke.arc.graphics.*;
|
||||
import io.anuke.arc.graphics.g2d.*;
|
||||
import io.anuke.arc.input.*;
|
||||
import io.anuke.arc.math.*;
|
||||
import io.anuke.arc.math.geom.*;
|
||||
import io.anuke.arc.scene.ui.layout.*;
|
||||
import io.anuke.arc.util.*;
|
||||
import io.anuke.mindustry.content.*;
|
||||
import io.anuke.mindustry.entities.*;
|
||||
import io.anuke.mindustry.entities.effect.*;
|
||||
import io.anuke.mindustry.entities.traits.BuilderTrait.*;
|
||||
import io.anuke.mindustry.entities.type.*;
|
||||
import io.anuke.mindustry.game.EventType.*;
|
||||
import io.anuke.mindustry.gen.*;
|
||||
import io.anuke.mindustry.graphics.*;
|
||||
import io.anuke.mindustry.net.Net;
|
||||
import io.anuke.mindustry.net.ValidateException;
|
||||
import io.anuke.mindustry.type.Item;
|
||||
import io.anuke.mindustry.type.ItemStack;
|
||||
import io.anuke.mindustry.ui.fragments.OverlayFragment;
|
||||
import io.anuke.mindustry.net.*;
|
||||
import io.anuke.mindustry.type.*;
|
||||
import io.anuke.mindustry.ui.fragments.*;
|
||||
import io.anuke.mindustry.world.*;
|
||||
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
@@ -83,6 +77,8 @@ public abstract class InputHandler implements InputProcessor{
|
||||
int[] remaining = {accepted, accepted};
|
||||
Block block = tile.block();
|
||||
|
||||
Events.fire(new DepositEvent());
|
||||
|
||||
for(int i = 0; i < sent; i++){
|
||||
boolean end = i == sent - 1;
|
||||
Time.run(i * 3, () -> {
|
||||
|
||||
@@ -2,7 +2,7 @@ package io.anuke.mindustry.ui.fragments;
|
||||
|
||||
import io.anuke.annotations.Annotations.Loc;
|
||||
import io.anuke.annotations.Annotations.Remote;
|
||||
import io.anuke.arc.Core;
|
||||
import io.anuke.arc.*;
|
||||
import io.anuke.arc.collection.IntSet;
|
||||
import io.anuke.arc.function.BooleanProvider;
|
||||
import io.anuke.arc.function.Supplier;
|
||||
@@ -21,6 +21,7 @@ import io.anuke.arc.scene.ui.layout.Table;
|
||||
import io.anuke.arc.util.*;
|
||||
import io.anuke.mindustry.core.GameState.State;
|
||||
import io.anuke.mindustry.entities.type.Player;
|
||||
import io.anuke.mindustry.game.EventType.*;
|
||||
import io.anuke.mindustry.gen.Call;
|
||||
import io.anuke.mindustry.type.Item;
|
||||
import io.anuke.mindustry.type.Item.Icon;
|
||||
@@ -100,6 +101,8 @@ public class BlockInventoryFragment extends Fragment{
|
||||
Call.requestItem(player, tile, lastItem, amount);
|
||||
holding = false;
|
||||
holdTime = 0f;
|
||||
|
||||
Events.fire(new WithdrawEvent());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,6 +155,7 @@ public class BlockInventoryFragment extends Fragment{
|
||||
lastItem = item;
|
||||
holding = true;
|
||||
holdTime = 0f;
|
||||
Events.fire(new WithdrawEvent());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user