void StartDay() { EventCardDeck.Instance.GetCard(); InitMonsterMove(); foreach (Hero hero in heroes) { hero.timeline.Reset(); hero.IsSleeping = false; } foreach (Well well in wells) { Cell a = Cell.FromId(well.Cell.Index); if (a.Inventory.Heroes.Count == 0) { well.ResetWell(); } } narrator.MoveNarrator(); narrator.CheckLegendCards(); playerTurn = new Queue <Player>(players); }
void Start() { string saveDirectory = null; if (!PhotonNetwork.OfflineMode) { saveDirectory = (string)PhotonNetwork.CurrentRoom.CustomProperties["Save"]; } playerTurn = new Queue <Player>(players); castle = Castle.Instance; castle.Init(players.Count); monstersToMove = new List <Enemy>(); narrator = new Narrator(); heroes = new List <Hero>(); farmers = new List <Farmer>(); gors = new List <Enemy>(); skrals = new List <Enemy>(); wardraks = new List <Enemy>(); towerskrals = new List <Enemy>(); wells = new List <Well>(); // Add each player's respective hero foreach (Player p in players) { string hero = (string)p.CustomProperties["Class"]; if (hero != null) { switch (hero) { case "Warrior": heroes.Add(Warrior.Instance); break; case "Archer": heroes.Add(Archer.Instance); break; case "Mage": heroes.Add(Mage.Instance); break; case "Dwarf": heroes.Add(Dwarf.Instance); break; } string mainHero = (string)PhotonNetwork.LocalPlayer.CustomProperties["Class"]; if (hero.Equals(mainHero)) { mainHeroIndex = heroes.Count - 1; } } } // heroes.Add(Archer.Instance); // heroes.Add(Dwarf.Instance); // heroes.Add(Mage.Instance); EventManager.TriggerMainHeroInit(MainHero); CharChoice.Init(heroes); CharChoice.choice = MainHero; if (saveDirectory == null) { NewGame(); } else { LoadGame(saveDirectory); } narrator.CheckLegendCards(); GiveTurn(); }