예제 #1
0
 // -------------------------------------------------------------------------------
 //
 // -------------------------------------------------------------------------------
 public void AddTown(TemplateMetaTown town)
 {
     if (town != null && !ExploredTowns.Contains(town.name))
     {
         ExploredTowns.Add(town.name);
     }
 }
예제 #2
0
 // -------------------------------------------------------------------------------
 // getHasExploredTown
 // -------------------------------------------------------------------------------
 public bool getHasExploredTown(TemplateMetaTown town)
 {
     if (town == null)
     {
         return(true);
     }
     return(TownExplorationInfo.GetTown(town.name) != null);
 }
예제 #3
0
        // -------------------------------------------------------------------------------
        // WarpTown
        // -------------------------------------------------------------------------------
        public void WarpTown(TemplateMetaTown town)
        {
            if (town == null)
            {
                throw new ArgumentException("WarpTown failed: Template is empty!");
            }

            PrepareWarp();
            Finder.party.AddTown(town);
            Finder.party.lastTown = town;
            currentTownConfig     = town;
            Finder.ui.OverrideState(UIState.Town);
            Finder.audio.PlayBGM(town.music);
            Finder.log.Hide();
            locationType = LocationType.Town;
        }
예제 #4
0
 // -------------------------------------------------------------------------------
 // AddTown
 // -------------------------------------------------------------------------------
 public void AddTown(TemplateMetaTown town)
 {
     TownExplorationInfo.AddTown(town);
 }
예제 #5
0
        // -------------------------------------------------------------------------------
        // OnEnable
        // -------------------------------------------------------------------------------
        void OnEnable()
        {
            town = Finder.map.currentTownConfig;

            imageBackground.sprite = town.imageBackground;

            TemplateMetaShop shop;

            // -- Shop: Item
            shop = town.shops.FirstOrDefault(x => x.shopType == ShopType.ShopItem);
            if (shop != null && shop.level > 0)
            {
                labelShopItem.text = shop.name;
                btnShopItem.SetActive(true);
            }
            else
            {
                btnShopItem.SetActive(false);
            }

            // -- Shop: Equipment
            shop = town.shops.FirstOrDefault(x => x.shopType == ShopType.ShopEquipment);
            if (shop != null && shop.level > 0)
            {
                labelShopEquipment.text = shop.name;
                btnShopEquipment.SetActive(true);
            }
            else
            {
                btnShopEquipment.SetActive(false);
            }

            // -- Shop: Ability
            shop = town.shops.FirstOrDefault(x => x.shopType == ShopType.ShopItemAbility);
            if (shop != null && shop.level > 0)
            {
                labelShopAbility.text = shop.name;
                btnShopAbility.SetActive(true);
            }
            else
            {
                btnShopAbility.SetActive(false);
            }

            // -- Shop: Tavern (Characters)
            shop = town.shops.FirstOrDefault(x => x.shopType == ShopType.ShopCharacter);
            if (shop != null && shop.level > 0)
            {
                labelShopTavern.text = shop.name;
                btnTavern.SetActive(true);
            }
            else
            {
                btnTavern.SetActive(false);
            }

            // -- Shop: Inn (Rest)
            shop = town.shops.FirstOrDefault(x => x.shopType == ShopType.ShopInn);
            if (shop != null && shop.level > 0)
            {
                labelShopInn.text = shop.name;
                btnInn.SetActive(true);
            }
            else
            {
                btnInn.SetActive(false);
            }

            // -- Shop: Temple (Curative)
            shop = town.shops.FirstOrDefault(x => x.shopType == ShopType.ShopItemCurative);
            if (shop != null && shop.level > 0)
            {
                labelShopTemple.text = shop.name;
                btnTemple.SetActive(true);
            }
            else
            {
                btnTemple.SetActive(false);
            }
        }