public FloatingMessage(String text, TransitionType transition = TransitionType.FIXED, Actor attachedMonster = null) { this.text = text; this.attachedMonster = attachedMonster; this.dialogSprite = new SpriteBatch(UI.getInstance().graphics); this.transitionType = transition; }
public void RecordEvent(Event e, Actor actor = null) { if (e == Event.GAME_STARTED && !PreviouslyTriggered(e)) { ui.OpenTextDialog(64, 64, 384, "Welcome to Summons! The point of the game is to crush your enemies with brute force!"); ui.OpenTextDialog(64, 64, 384, "You can click on the little mage dude there to move him."); } else if (e == Event.ACTOR_CLICKED && !PreviouslyTriggered(e)) { ui.OpenTextDialog(64, 64, 384, "Now you can click a location on the map and he'll move there if he is able."); } else if (e == Event.INVALID_ACTOR_DESTINATION) { ui.OpenTextDialog(64, 64, 384, "That location can't be reached by this character!"); } else if (e == Event.BATTLE_ENGAGED && CurrentScene != Scene.COMBAT) { CurrentScene = Scene.COMBAT; ui.ShowMessage("Fight it out!", FloatingMessage.TransitionType.EXPANDING); } else if (e == Event.MONSTER_DIED) { ui.ShowMessage("Defeated!", FloatingMessage.TransitionType.EXPANDING); } else if (e == Event.BATTLE_COMPLETED && CurrentScene == Scene.COMBAT) { CurrentScene = Scene.OVERWORLD; } else if (e == Event.TOWER_CAPTURED) { ui.ShowMessage("TOWER CAPTURED!", FloatingMessage.TransitionType.EXPANDING, actor); } else if (e == Event.START_TURN) { ui.ShowMessage(String.Format("{0}'s TURN", PlayerManager.getInstance().currentPlayer.name), FloatingMessage.TransitionType.EXPANDING); } else if (e == Event.NOT_ENOUGH_MANA) { if (!PreviouslyTriggered(e)) ui.OpenTextDialog(64, 64, 384, "You do not have enough mana to perform that action! Capture towers to gain mana each turn."); else ui.OpenTextDialog(64, 64, 384, "Not enough mana!"); } else if (e == Event.END_TURN) { PlayerManager.getInstance().EndTurn(); } if (triggered.ContainsKey(e)) triggered[e] = true; else triggered.Add(e, true); }
public void ShowMessage(String text, FloatingMessage.TransitionType transition = FloatingMessage.TransitionType.FIXED, Actor actor = null) { floatingMessageCollection.Enqueue(new FloatingMessage(text, transition, actor)); }
public void UnselectMonsters(Actor ignore) { foreach (Actor actor in this.monsterCollection) if (actor != ignore) actor.Selected = false; }
public void Capture(Actor monster, bool alert = true) { if (this.owner != monster.player) { if (this.owner != null) { this.owner.towersOwned--; // Remove from the old owner's tower count } this.owner = monster.player; this.owner.towersOwned++; // Add to the new owner's tower count if (alert) EventsManager.getInstance().RecordEvent(EventsManager.Event.TOWER_CAPTURED, monster); } }
public Route(Actor monster, int x, int y) { this.monster = monster; this.routeData = new Stack<Coordinate>(); if (monster.moveMap != null && !(monster.TileX == x && monster.TileY == y)) { if (monster.moveMap[y, x] > -1) { this.routeData = Map.getInstance().FindPath(monster.TileX, monster.TileY, x, y, monster.player); } } }