public override void Update(WorldScreen Game) { var hoverMesh = Game.HoverNode as Gem.Render.NormalMapMeshNode; if (hoverMesh == null) return; var move = hoverMesh.Tag as Move?; if (move == null || !move.HasValue) { var coordinate = hoverMesh.Tag as Coordinate?; if (coordinate == null || !coordinate.HasValue) return; if (coordinate.Value == SelectedPiece) { hoverMesh.Hilite = true; if (Game.Main.Input.Check("CLICK")) { Cancelled = true; Game.PopInputState(); } } } else { hoverMesh.Hilite = true; if (Game.Main.Input.Check("CLICK")) { var newBoard = Coerceo.ApplyMove(Game.CurrentBoard, move.Value); Game.CurrentBoard = newBoard; Game.PopInputState(); } } }
public override void Update(WorldScreen Game, World World) { if (BoundActor.CurrentAction is Actors.Actions.Idle) { Game.PopInputState(); } }
public override void Update(WorldScreen Game) { Timer += Game.ElapsedSeconds; foreach (var piece in Game.GhostPieceNodes) { var coordinate = piece.Tag as Coordinate?; if (coordinate == null || !coordinate.HasValue) continue; if (coordinate.Value == Coerceo.FindMoveNeighbor(ChosenMove.Coordinate, ChosenMove.Direction)) piece.Hilite = true; } if (Timer > 1) { var newBoard = Coerceo.ApplyMove(Game.CurrentBoard, ChosenMove); Game.CurrentBoard = newBoard; Game.PopInputState(); } }
public override void Update(WorldScreen Game) { Timer += Game.ElapsedSeconds; foreach (var piece in Game.PieceNodes) { var coordinate = piece.Tag as Coordinate?; if (coordinate == null || !coordinate.HasValue) continue; if (coordinate.Value == ChosenMove.Coordinate) piece.Hilite = true; } if (Timer > 1) { if (ChosenMove.Type == (byte)MoveType.MovePiece) Game.PushInputState(new AIMovePiece(ChosenMove)); else { var newBoard = Coerceo.ApplyMove(Game.CurrentBoard, ChosenMove); Game.CurrentBoard = newBoard; Game.PopInputState(); } } }
public override void Exposed(WorldScreen Game) { Game.PopInputState(); }
public override void Update(WorldScreen Game, World World) { if (TurnEnded) { Game.PopInputState(); return; } if (Game.HoverNode != null) { var hoverAction = Game.HoverNode.GetHoverAction(); if (hoverAction != null) hoverAction(); if (Game.Main.Input.Check("CLICK")) { var clickAction = Game.HoverNode.GetClickAction(); if (clickAction != null) clickAction(); } } int turnEnergy; if (!BoundActor.Properties.TryGetPropertyAs("turn-energy", out turnEnergy)) turnEnergy = MaxEnergy; var energySpent = MaxEnergy - turnEnergy; for (int i = 0; i < energySpent; ++i) EnergyBar[0, i].Properties[0].Values.Upsert("bg-color", new Vector3(0.2f, 0, 0)); for (int i = energySpent; i < MaxEnergy; ++i) EnergyBar[0, i].Properties[0].Values.Upsert("bg-color", new Vector3(0.7f, 0, 0)); if (energySpent + PreviewCost <= MaxEnergy) for (int i = energySpent; i < energySpent + PreviewCost; ++i) EnergyBar[0, i].Properties[0].Values.Upsert("bg-color", new Vector3(1, 0, 0)); }
public override void Exposed(WorldScreen Game, World World) { if (BoundActor.Properties.GetPropertyAs<int>("turn-energy", () => 0) == 0) Game.PopInputState(); else PrepareCombatGrid(Game, World); }