public override void EnterState() { Player = new Guardian_Roguelike.World.Creatures.Dwarf(); DispCons = libtcodWrapper.RootConsole.GetNewConsole(90, 30); CreationStep = 0; }
public GameState() : base() { DEBUG_PassedMilliseconds = 0; SkipAI = false; CurMode = Modes.Normal; if (Utilities.InterStateResources.Instance.Resources.ContainsKey("Game_FOVHandler")) { Utilities.InterStateResources.Instance.Resources.Remove("Game_FOVHandler"); } if (Utilities.InterStateResources.Instance.Resources.ContainsKey("Game_PathFinder")) { Utilities.InterStateResources.Instance.Resources.Remove("Game_PathFinder"); } if (Utilities.InterStateResources.Instance.Resources.ContainsKey("Game_CurrentLevel")) { Utilities.InterStateResources.Instance.Resources.Remove("Game_CurrentLevel"); } if (Utilities.InterStateResources.Instance.Resources.ContainsKey("Game_NotableEventsLog")) { Utilities.InterStateResources.Instance.Resources.Remove("Game_NotableEventsLog"); } if (Utilities.InterStateResources.Instance.Resources.ContainsKey("Game_DeathData")) { Utilities.InterStateResources.Instance.Resources.Remove("Game_DeathData"); } Utilities.InterStateResources.Instance.Resources.Add("Game_FOVHandler", new libtcodWrapper.TCODFov(90, 30)); Utilities.InterStateResources.Instance.Resources.Add("Game_PathFinder", new libtcodWrapper.TCODPathFinding((libtcodWrapper.TCODFov)Utilities.InterStateResources.Instance.Resources["Game_FOVHandler"], 1)); Utilities.InterStateResources.Instance.Resources.Add("Game_CurrentLevel", new World.Map()); /* * World.Creatures.Dwarf tPlayer = new Guardian_Roguelike.World.Creatures.Dwarf(); * tPlayer.Position.X = tPlayer.Position.Y = 1; * tPlayer.FirstName = "Urist"; * tPlayer.LastName = "Litasterar"; * tPlayer.DrawColor = libtcodWrapper.ColorPresets.ForestGreen;*/ if (Utilities.InterStateResources.Instance.Resources.ContainsKey("Game_PlayerCreature")) { Utilities.InterStateResources.Instance.Resources.Remove("Game_PlayerCreature"); } World.Creatures.CreatureBase tPlayer = new World.Creatures.Dwarf(); tPlayer.Generate(); tPlayer.DrawColor = libtcodWrapper.ColorPresets.ForestGreen; Utilities.InterStateResources.Instance.Resources.Add("Game_PlayerCreature", tPlayer); StatusCons = libtcodWrapper.RootConsole.GetNewConsole(90, 5); MapCons = libtcodWrapper.RootConsole.GetNewConsole(90, 30); MsgCons = libtcodWrapper.RootConsole.GetNewConsole(90, 5); Player = (World.Creatures.Dwarf)Utilities.InterStateResources.Instance.Resources["Game_PlayerCreature"]; Player.BaseAim += 2; Player.BaseEnergy += 2; Player.BaseSpeed += 2; Player.BaseStrength += 2; Player.BaseVigor += 2; Player.FirstName = "Urist"; Player.LastName = "Litasterar"; CurrentLevel = (World.Map)Utilities.InterStateResources.Instance.Resources["Game_CurrentLevel"]; CurrentLevel.Creatures.Add(Player); Player.Position = CurrentLevel.GetFirstWalkable(); Utilities.MessageLog.AddMsg("Get running, " + Player.FirstName + "!"); TurnsPassed = SkipTurns = 0; LevelNumber = 1; Utilities.InterStateResources.Instance.Resources.Add("Game_DeathData", new Utilities.DeathData(Player, null, 0, 1)); }