public void Activate(LocationData l) { tileEngine.LoadMap(l.Map, 50, 50); Game.PushScreen(this); Game.ScriptEngine.ExecuteScript(EntrySequence); cursorX = 0; cursorY = 0; cursor.BoundingRectangle = tileEngine.BoundingRectangle(cursorX, cursorY); setupIndex = 0; enemies = EnemyGenerator.Generate(); State = BattleState.NOTIF; positions.Clear(); foreach (Character c in Player.Party) { c.CurrMovementPoints = c.MaxMovementPoints; } Game.ScriptEngine.ExecuteScript(AI.Stupid); }
public void Activate(LocationData l) { playerX = l.TownEntryX; playerY = l.TownEntryY; playerAvatar.SpriteState = l.TownEntryDirection; switch (l.TownEntryDirection) { case AvatarDirection.UP: playerFront.X = playerX; playerFront.Y = playerY - 1; break; case AvatarDirection.DOWN: playerFront.X = playerX; playerFront.Y = playerY + 1; break; case AvatarDirection.LEFT: playerFront.X = playerX - 1; playerFront.Y = playerY; break; case AvatarDirection.RIGHT: playerFront.X = playerX + 1; playerFront.Y = playerY; break; } tileEngine.LoadMap(l.Map, MiResolution.VirtualWidth / 2 - playerAvatar.Width / 2 - playerX * playerAvatar.Width, MiResolution.VirtualHeight / 2 - playerAvatar.Height / 2 - playerY * playerAvatar.Height ); playerAvatar.BoundingRectangle = tileEngine.BoundingRectangle(playerX, playerY); events = l.Events; Game.PushScreen(this); Game.ScriptEngine.ExecuteScript(EntrySequence); }