예제 #1
0
        public BootItem(
            int id,
            string name,
            string description,
            int notActuallyPrice,
            int defense,
            int immunity,
            int colorSheetIndex) : base(id)
        {
            DifficultyToObtain = ObtainingDifficulties.NonCraftingItem;
            CanStack           = false;
            ShouldBeForagable  = false;

            OverrideName     = name;
            NotActuallyPrice = notActuallyPrice;
            Defense          = defense;
            Immunity         = immunity;
            ColorSheetIndex  = colorSheetIndex;

            Description = Globals.GetTranslation($"boots-{id}-description");;
            if (Globals.ModRef.Helper.Translation.LocaleEnum == LocalizedContentManager.LanguageCode.en)
            {
                Description = description;
            }
        }
예제 #2
0
        /// <summary>
        /// Sets the ToString information for the given crops
        /// </summary>
        /// <param name="editedObjectInfo">The object info containing changes to apply</param>
        /// <param name="crops">The crops to set</param>
        /// <param name="randomNames">The random names to give the crops</param>
        private static void SetCropAndSeedInformation(
            EditedObjectInformation editedObjectInfo,
            List <CropItem> crops,
            List <string> randomNames,
            List <string> randomDescriptions)
        {
            for (int i = 0; i < crops.Count; i++)
            {
                CropItem crop        = crops[i];
                string   name        = randomNames[i];
                string   description = Globals.RNGGetAndRemoveRandomValueFromList(randomDescriptions);
                crop.OverrideName = name;
                crop.Description  = description;

                SeedItem seed = ItemList.GetSeedFromCrop(crop);
                seed.OverrideDisplayName = seed.CropGrowthInfo.IsTrellisCrop ?
                                           Globals.GetTranslation("trellis-text", new { itemName = name }) :
                                           Globals.GetTranslation("seed-text", new { itemName = name });
                seed.OverrideName = seed.CropGrowthInfo.IsTrellisCrop ?
                                    $"{name} Starter" :
                                    $"{name} Seeds";

                seed.Price = GetRandomSeedPrice();
                crop.Price = CalculateCropPrice(seed);

                if (!Globals.Config.RandomizeCrops)
                {
                    continue;
                }

                editedObjectInfo.ObjectInformationReplacements[crop.Id] = crop.ToString();
                editedObjectInfo.ObjectInformationReplacements[seed.Id] = seed.ToString();
            }
        }
예제 #3
0
        /// <summary>
        /// Gets the string to be used in the description for seasons
        /// </summary>
        /// <return />
        private string GetStringForSeasons()
        {
            if (AvailableSeasons.Count == 0)
            {
                return("");
            }

            if (IsSubmarineOnlyFish)
            {
                string winterSeason = Globals.GetTranslation($"seasons-winter");
                return(Globals.GetTranslation("fish-tooltip-seasons", new { seasons = winterSeason }));
            }
            else if (AvailableSeasons.Count == 4)
            {
                return(Globals.GetTranslation("fish-tooltip-seasons-all"));
            }

            string[] seasonStrings = AvailableSeasons
                                     .Select(x => x.ToString().ToLower())
                                     .Select(x => Globals.GetTranslation($"seasons-{x}"))
                                     .ToArray();

            string seasons = string.Join(", ", seasonStrings);

            return(Globals.GetTranslation("fish-tooltip-seasons", new { seasons }));
        }
예제 #4
0
        /// <summary>
        /// Creates a bundle for the Joja mart
        /// </summary>
        protected override void Populate()
        {
            BundleType = Globals.RNGGetAndRemoveRandomValueFromList(RoomBundleTypes);
            List <RequiredItem> potentialItems = new List <RequiredItem>();

            switch (BundleType)
            {
            case BundleTypes.JojaMissing:
                Name = Globals.GetTranslation("bundle-joja-missing");

                RequiredItems = new List <RequiredItem>
                {
                    new RequiredItem(ItemList.GetRandomItemAtDifficulty(ObtainingDifficulties.EndgameItem)),
                    new RequiredItem(ItemList.GetRandomItemAtDifficulty(ObtainingDifficulties.RareItem)),
                    new RequiredItem(ItemList.GetRandomItemAtDifficulty(ObtainingDifficulties.LargeTimeRequirements)),
                    new RequiredItem(ItemList.GetRandomItemAtDifficulty(ObtainingDifficulties.MediumTimeRequirements)),
                    new RequiredItem(
                        Globals.RNGGetRandomValueFromList(ItemList.GetItemsBelowDifficulty(ObtainingDifficulties.Impossible, new List <int> {
                        (int)ObjectIndexes.AnyFish
                    }))
                        )
                };
                MinimumRequiredItems = 5;
                Color = BundleColors.Blue;
                break;
            }
        }
        /// <summary>
        /// Fills the entries of the mail dictionary with the internationalized strings
        /// </summary>
        private static void PopulateMailDictionary()
        {
            List <string> mailKeys = new List <string>
            {
                "spring_19_1",
                "summer_14_1",
                "summer_20_1",
                "summer_25_1",
                "fall_3_1",
                "fall_19_1",
                "winter_2_1",
                "winter_6_1",
                "winter_12_1",
                "winter_17_1",
                "winter_21_1",
                "winter_26_1",
                "spring_6_2",
                "spring_15_2",
                "spring_21_2",
                "summer_6_2",
                "summer_15_2",
                "summer_21_2",
                "fall_6_2",
                "fall_19_2",
                "winter_5_2",
                "winter_13_2",
                "winter_19_2"
            };

            DefaultMailData = new Dictionary <string, string>();
            foreach (string mailKey in mailKeys)
            {
                DefaultMailData.Add(mailKey, Globals.GetTranslation($"mail-{mailKeys}"));
            }
        }
        /// <summary>
        /// Gets the dish name based on the id
        /// </summary>
        /// <param name="id"></param>
        private static string GetDishName(int id)
        {
            CookedItem item = (CookedItem)ItemList.Items[id];
            string     nameAndDescription = Globals.GetTranslation($"item-{id}-name-and-description", new { itemName = item.IngredientName });

            return(nameAndDescription.Split('/')[0]);
        }
예제 #7
0
        /// <summary>
        /// Gets the string to use for when the fish is a legendary fish
        /// </summary>
        /// <returns />
        public string GetStringForLegendary()
        {
            if (!IsLegendaryFish)
            {
                return("");
            }

            return(Globals.GetTranslation("fish-tooltip-legendary"));
        }
예제 #8
0
        /// <summary>
        /// Gets a list of strings for the locations to be used in the description
        /// </summary>
        /// <returns></returns>
        private List <string> GetLocationStrings()
        {
            List <string> output = new List <string>();

            foreach (Locations location in AvailableLocations)
            {
                output.Add(Globals.GetTranslation($"fish-{location.ToString().ToLower()}-location"));
            }
            return(output);
        }
예제 #9
0
        /// <summary>
        /// Not used normally - but when it is, used for the ObjectInformation string
        /// </summary>
        /// <returns />
        public override string ToString()
        {
            if (Id == (int)ObjectIndexes.Coffee)
            {
                return($"{Name}/150/1/Crafting/{Globals.GetTranslation("item-coffee-name", new { itemName = CoffeeIngredient })}/{Globals.GetTranslation("item-coffee-description")}/drink/0 0 0 0 0 0 0 0 0 1 0/120");
            }

            Globals.ConsoleError($"Called the ToString of unexpected item {Id}: {Name}");
            return("");
        }
예제 #10
0
        /// <summary>
        /// Changes the UI to be clear about what settings to use if using random bundles
        /// </summary>
        public static Dictionary <string, string> ModifyRemixedBundleUI()
        {
            Dictionary <string, string> stringReplacements = new Dictionary <string, string>();

            stringReplacements["AGO_CCB"]         = Globals.GetTranslation("ui-remixed-bundle-title");
            stringReplacements["AGO_CCB_Tooltip"] = Globals.GetTranslation("ui-remixed-bundle-tooltip");
            stringReplacements["AGO_Year1Completable_Tooltip"] = Globals.GetTranslation("ui-year1-completable-tooltip");

            return(stringReplacements);
        }
예제 #11
0
        /// <summary>
        /// Randomize fruit tree information
        /// </summary>
        /// <param name="editedObjectInfo">The edited object information</param>
        private static void RandomizeFruitTrees(EditedObjectInformation editedObjectInfo)
        {
            int[] fruitTreesIds = new int[]
            {
                (int)ObjectIndexes.CherrySapling,
                (int)ObjectIndexes.ApricotSapling,
                (int)ObjectIndexes.OrangeSapling,
                (int)ObjectIndexes.PeachSapling,
                (int)ObjectIndexes.PomegranateSapling,
                (int)ObjectIndexes.AppleSapling
            };
            List <Item> allPotentialTreesItems = ItemList.Items.Values.Where(x =>
                                                                             fruitTreesIds.Contains(x.Id) || x.DifficultyToObtain < ObtainingDifficulties.Impossible
                                                                             ).ToList();

            List <Item> treeItems = Globals.RNGGetRandomValuesFromList(allPotentialTreesItems, 6);

            string[] seasons = { "spring", "spring", "summer", "summer", "fall", "fall" };
            seasons[Globals.RNG.Next(0, 6)] = "winter";

            int[] prices = treeItems.Select(x => x.GetPriceForObtainingDifficulty(0.2)).ToArray();
            if (!Globals.Config.RandomizeFruitTrees)
            {
                return;
            }

            // Fruit tree asset replacements
            var fruitTreeReplacements = new Dictionary <int, string>();

            // The Trees are incremented starting with cherry
            for (int i = 0; i < treeItems.Count; i++)
            {
                int    price         = prices[i];
                string season        = seasons[i];
                string seasonDisplay = Globals.GetTranslation($"seasons-{season}");
                Item   treeItem      = treeItems[i];
                string treeItemName  = treeItem.DisplayName;
                string fruitTreeName = treeItem.Id == fruitTreesIds[i] ?
                                       Globals.GetTranslation("item-recursion-sapling-name") :
                                       Globals.GetTranslation("sapling-text", new { itemName = treeItemName });
                string fruitTreeEnglishName = treeItem.Id == fruitTreesIds[i] ?
                                              "Recursion Sapling" :
                                              $"{treeItem.Name} Sapling";

                int fruitTreeId = fruitTreesIds[i];

                string fruitTreeValue = $"{i}/{season}/{treeItem.Id}/{price}";
                editedObjectInfo.FruitTreeReplacements[fruitTreeId] = fruitTreeValue;

                ItemList.Items[fruitTreeId].OverrideName = fruitTreeEnglishName;
                string fruitTreeObjectValue = $"{fruitTreeName}/{price / 2}/-300/Basic -74/{fruitTreeName}/{Globals.GetTranslation("sapling-description", new { itemName = treeItemName, season = seasonDisplay })}";
                editedObjectInfo.ObjectInformationReplacements[fruitTreeId] = fruitTreeObjectValue;
            }
        }
        /// <summary>
        /// Get the string that's used for seasons when displaying the tooltip
        /// </summary>
        /// <returns>The seasons string</returns>
        public string GetSeasonsStringForDisplay(bool useCommaDelimiter = false)
        {
            string seasonsString = "";

            foreach (Seasons season in GrowingSeasons)
            {
                seasonsString += $"{Globals.GetTranslation($"seasons-{season.ToString().ToLower()}")} ";
            }
            seasonsString = seasonsString.Trim().ToLower();
            return(seasonsString.Replace(" ", ", "));
        }
예제 #13
0
        /// <summary>
        /// Gets the string used for the weather part of the tooltip
        /// </summary>
        /// <returns />
        public string GetStringForWeather()
        {
            if (Weathers.Count != 1)
            {
                return("");
            }

            string weather = Globals.GetTranslation($"fish-weather-{Weathers[0].ToString().ToLower()}");

            return(Globals.GetTranslation("fish-tooltip-weather", new { weather }));
        }
예제 #14
0
        /// <summary>
        /// Gets the string to be used in the description for locations
        /// </summary>
        /// <returns>A string in the following format: Lives in the [loc1], [loc2], and [loc3].</returns>
        private string GetStringForLocations()
        {
            if (AvailableLocations.Count == 0)
            {
                return("");
            }
            List <string> locationStrings = GetLocationStrings();
            string        locations       = string.Join(", ", locationStrings);

            return(Globals.GetTranslation("fish-tooltip-locations", new { locations }));
        }
예제 #15
0
        /// <summary>
        /// Replaces the title screen graphics
        /// </summary>
        /// <param name="titleMenu">The title menu - passed if we're already on the title screen</param>
        private void ReplaceTitleScreen(TitleMenu titleMenu = null)
        {
            _currentLocale = _mod.Helper.Translation.Locale;
            AddReplacement("Minigames/TitleButtons", $"Assets/Minigames/{Globals.GetTranslation("title-graphic")}");
            _mod.Helper.Content.InvalidateCache("Minigames/TitleButtons");

            if (titleMenu != null)
            {
                LanguageCode code = _mod.Helper.Translation.LocaleEnum;
                _mod.Helper.Reflection.GetMethod(titleMenu, "OnLanguageChange", true).Invoke(code);
            }
        }
예제 #16
0
        /// <summary>
        /// Converts the given time to a 12-hour time,
        /// e.g. 1400 - 2:00pm
        /// </summary>
        /// <param name="timeRange"></param>
        /// <return />
        private static string GetStringForTime(int time)
        {
            if (time > 2359)
            {
                time -= 2400;
            }
            string      timeString = time.ToString("D4");
            DateTime    dateTime   = DateTime.ParseExact(timeString, "HHmm", CultureInfo.InvariantCulture);
            CultureInfo culture    = CultureInfo.CreateSpecificCulture(Globals.ModRef.Helper.Translation.Locale);

            return(dateTime.ToString(Globals.GetTranslation("time-format"), culture).ToLower());
        }
예제 #17
0
        /// <summary>
        /// Generates the bundle for the given season
        /// </summary>
        /// <param name="season">The season</param>
        /// <param name="color">The color to use</param>
        private void GenerateSeasonBundle(Seasons season, BundleColors color)
        {
            string seasonString = Globals.GetTranslation($"seasons-{season.ToString().ToLower()}");

            seasonString = $"{seasonString[0].ToString().ToUpper()}{seasonString.Substring(1)}";

            Name = Globals.GetTranslation("bundle-fishtank-seasonal", new { season = seasonString });
            List <RequiredItem> potentialItems = RequiredItem.CreateList(FishItem.Get(season));

            RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
            MinimumRequiredItems = Math.Min(Range.GetRandomValue(6, 8), RequiredItems.Count);
            Color = color;
        }
예제 #18
0
        /// <summary>
        /// Generates a bundle of crops belonging to the given season
        /// </summary>
        /// <param name="season">The season</param>
        /// <param name="color">The color of the bundle</param>
        private void GenerateBundleForSeasonCrops(Seasons season, BundleColors color)
        {
            string seasonString = Globals.GetTranslation($"seasons-{season.ToString().ToLower()}");

            seasonString = $"{seasonString[0].ToString().ToUpper()}{seasonString.Substring(1)}";

            Name = Globals.GetTranslation("bundle-pantry-crops", new { season = seasonString });
            List <RequiredItem> potentialItems = RequiredItem.CreateList(ItemList.GetCrops(season));

            RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
            MinimumRequiredItems = 6;
            Color = color;
        }
        /// <summary>
        /// Generates the bundle for foraging items
        /// </summary>
        /// <param name="season">The season</param>
        /// <param name="color">The color of the bundle</param>
        private void GenerateForagingBundle(Seasons season, BundleColors color)
        {
            string seasonString = Globals.GetTranslation($"seasons-{season.ToString().ToLower()}");

            seasonString = $"{seasonString[0].ToString().ToUpper()}{seasonString.Substring(1)}";

            Name = Globals.GetTranslation($"bundle-crafting-foraging", new { season = seasonString });
            List <RequiredItem> potentialItems = RequiredItem.CreateList(ItemList.GetForagables(season));
            int numberOfChoices = Math.Min(potentialItems.Count, 8);

            RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, numberOfChoices);
            MinimumRequiredItems = Range.GetRandomValue(4, numberOfChoices);
            Color = color;
        }
예제 #20
0
        /// <summary>
        /// Populates the bundle with the name, required items, minimum required, and color
        /// </summary>
        protected override void Populate()
        {
            int moneyAmount = 0;

            BundleType = Globals.RNGGetAndRemoveRandomValueFromList(RoomBundleTypes);
            int bundleNameFlavorID = 1;

            switch (BundleType)
            {
            case BundleTypes.Vault2500:
                bundleNameFlavorID = Range.GetRandomValue(1, 7);
                moneyAmount        = Range.GetRandomValue(500, 3500);
                break;

            case BundleTypes.Vault5000:
                bundleNameFlavorID = Range.GetRandomValue(1, 6);
                moneyAmount        = Range.GetRandomValue(4000, 7000);
                break;

            case BundleTypes.Vault10000:
                bundleNameFlavorID = Range.GetRandomValue(1, 6);
                moneyAmount        = Range.GetRandomValue(7500, 12500);
                break;

            case BundleTypes.Vault25000:
                bundleNameFlavorID = Range.GetRandomValue(1, 7);
                moneyAmount        = Range.GetRandomValue(20000, 30000);
                break;

            default:
                return;
            }

            RequiredItems = new List <RequiredItem> {
                new RequiredItem()
                {
                    MoneyAmount = moneyAmount
                }
            };

            string moneyString      = moneyAmount.ToString("N0", new CultureInfo(Globals.ModRef.Helper.Translation.Locale));
            string bundleNameFlavor = Globals.GetTranslation($"{BundleType.ToString()}-{bundleNameFlavorID}");

            Name            = $"{Globals.GetTranslation("vault-money-format", new { moneyString })}: {bundleNameFlavor}";
            ImageNameSuffix = $"-{bundleNameFlavorID}";

            Color = Globals.RNGGetRandomValueFromList(
                Enum.GetValues(typeof(BundleColors)).Cast <BundleColors>().ToList());
        }
예제 #21
0
        /// <summary>
        /// Gets the string replacements for the Strings/Locations.xnb
        /// </summary>
        /// <returns>The dictionary of replacements</returns>
        public static Dictionary <string, string> GetLocationStringReplacements()
        {
            Dictionary <string, string> stringReplacements = new Dictionary <string, string>();

            if (Globals.Config.Crops.Randomize)
            {
                string sweetGemBerryName = ItemList.GetItemName((int)ObjectIndexes.SweetGemBerry);
                stringReplacements["Woods_Statue"] = Globals.GetTranslation("Woods_Statue", new { cropName = sweetGemBerryName });

                string beetName = ItemList.GetItemName((int)ObjectIndexes.Beet);
                stringReplacements["Railroad_Box_MrQiNote"] = Globals.GetTranslation("Railroad_Box_MrQiNote", new { cropName = beetName });
            }

            return(stringReplacements);
        }
예제 #22
0
        /// <summary>
        /// Sets up the rice objects
        /// </summary>
        /// <param name="editedObjectInfo">The object info containing changes to apply</param>
        public static void SetUpRice(EditedObjectInformation editedObjectInfo)
        {
            CropItem unmilledRice = (CropItem)ItemList.Items[(int)ObjectIndexes.UnmilledRice];
            string   riceName     = unmilledRice.OverrideName;

            unmilledRice.OverrideName        = $"Unmilled {riceName}";
            unmilledRice.OverrideDisplayName = Globals.GetTranslation("unmilled-rice-name", new { itemName = riceName });
            editedObjectInfo.ObjectInformationReplacements[(int)ObjectIndexes.UnmilledRice] = unmilledRice.ToString();

            Item rice = ItemList.Items[(int)ObjectIndexes.Rice];

            rice.OverrideName = riceName;
            editedObjectInfo.ObjectInformationReplacements[(int)ObjectIndexes.Rice] =
                $"{riceName}/100/5/Basic/{riceName}/{Globals.GetTranslation("item-rice-description")}";
        }
예제 #23
0
        /// <summary>
        /// Gets the string replacesments for the StringsFromCSFiles xnb file
        /// </summary>
        /// <returns />
        public static Dictionary <string, string> GetCSFileStringReplacements()
        {
            Dictionary <string, string> stringReplacements = new Dictionary <string, string>();

            // Fix the "Parsnip" string at the start of the game
            string parsnipSeedName = ItemList.Items[(int)ObjectIndexes.ParsnipSeeds].Name;

            stringReplacements["Farmer.cs.1918"] = Globals.GetTranslation("Farmer.cs.1918", new { seedName = parsnipSeedName });

            // Fix the queen of sauce strings so it doesn't say the wrong recipe
            if (Globals.Config.Fish.Randomize || Globals.Config.Crops.Randomize)
            {
                stringReplacements["TV.cs.13151"] = Globals.GetTranslation("TV.cs.13151");
                stringReplacements["TV.cs.13153"] = Globals.GetTranslation("TV.cs.13153");
            }

            return(stringReplacements);
        }
        /// <summary>
        /// Creates a bundle with random items
        /// </summary>
        protected void PopulateRandomBundle()
        {
            BundleType = Globals.RNGGetRandomValueFromList(_randomBundleTypes);
            List <RequiredItem> potentialItems = new List <RequiredItem>();

            switch (BundleType)
            {
            case BundleTypes.AllRandom:
                Name           = Globals.GetTranslation("bundle-random-all");
                potentialItems = RequiredItem.CreateList(ItemList.Items.Values.Where(x =>
                                                                                     x.DifficultyToObtain <ObtainingDifficulties.Impossible &&
                                                                                                           x.Id> -4)
                                                         .ToList());
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = 4;
                break;

            case BundleTypes.AllLetter:
                string letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
                string randomLetter;
                do
                {
                    randomLetter = letters[Range.GetRandomValue(0, letters.Length - 1)].ToString();
                    letters.Replace(randomLetter, "");
                    potentialItems = RequiredItem.CreateList(
                        ItemList.Items.Values.Where(x =>
                                                    (
                                                        (x.OverrideDisplayName == null && x.Name.StartsWith(randomLetter, StringComparison.InvariantCultureIgnoreCase)) ||
                                                        (x.OverrideDisplayName != null && x.OverrideDisplayName.StartsWith(randomLetter, StringComparison.InvariantCultureIgnoreCase))
                                                    ) &&
                                                    x.Id > -4
                                                    ).ToList()
                        );
                } while (potentialItems.Count < 4);
                Name                 = Globals.GetTranslation("bundle-random-letter", new { letter = randomLetter });
                ImageNameSuffix      = randomLetter;
                RequiredItems        = Globals.RNGGetRandomValuesFromList(potentialItems, 8);
                MinimumRequiredItems = 3;
                break;
            }

            Color = Globals.RNGGetRandomValueFromList(
                Enum.GetValues(typeof(BundleColors)).Cast <BundleColors>().ToList());
        }
예제 #25
0
        /// <summary>
        /// Sets up the coffee beans and coffee objects
        /// </summary>
        /// <param name="editedObjectInfo">The object info containing changes to apply</param>
        /// <param name="coffeeName">The name of the coffee item</param>
        private static void SetUpCoffee(EditedObjectInformation editedObjectInfo, string coffeeName)
        {
            if (!Globals.Config.RandomizeCrops)
            {
                return;
            }

            Item coffee = ItemList.Items[(int)ObjectIndexes.Coffee];

            coffee.OverrideName     = $"Hot {coffeeName}";
            coffee.CoffeeIngredient = coffeeName;
            editedObjectInfo.ObjectInformationReplacements[(int)ObjectIndexes.Coffee] = coffee.ToString();

            Item coffeeBean = ItemList.Items[(int)ObjectIndexes.CoffeeBean];

            coffeeBean.OverrideName        = $"{coffeeName} Bean";
            coffeeBean.OverrideDisplayName = Globals.GetTranslation("coffee-bean-name", new { itemName = coffeeName });
            editedObjectInfo.ObjectInformationReplacements[(int)ObjectIndexes.CoffeeBean] = coffeeBean.ToString();
        }
예제 #26
0
        public BundleImageBuilder() : base()
        {
            BaseFileName = Globals.GetTranslation("junimo-note-graphic");
            SubDirectory = "Bundles";
            SetUpPointsToBundlesMap();
            PositionsToOverlay = PointsToBundlesMap.Keys.ToList();

            BundleImageNames = Directory.GetFiles($"{ImageDirectory}")
                               .Where(x => x.EndsWith(".png"))
                               .Select(x => Path.GetFileNameWithoutExtension(x))
                               .OrderBy(x => x).ToList();
            ValidateImages();

            ImageHeightInPx        = 32;
            ImageWidthInPx         = 32;
            OffsetWidthInPx        = 32;
            OffsetHeightInPx       = 32;
            InitialHeightOffetInPx = 180;
        }
예제 #27
0
        public BootItem(
            int id,
            string name,
            int notActuallyPrice,
            int defense,
            int immunity,
            int colorSheetIndex) : base(id)
        {
            DifficultyToObtain = ObtainingDifficulties.NonCraftingItem;
            CanStack           = false;
            ShouldBeForagable  = false;

            OverrideName     = name;
            Description      = Globals.GetTranslation($"boots-{id}-description");;
            NotActuallyPrice = notActuallyPrice;
            Defense          = defense;
            Immunity         = immunity;
            ColorSheetIndex  = colorSheetIndex;
        }
        /// <summary>
        /// Fills the entries of the quest dictionary with the internationalized strings
        /// </summary>
        private static void PopulateQuestDictionary()
        {
            ParsnipCropId    = ((SeedItem)ItemList.Items[(int)ObjectIndexes.ParsnipSeeds]).CropGrowthInfo.CropId;
            DefaultQuestData = new Dictionary <int, string>
            {
                { 3, Globals.GetTranslation("quest-3", new { crop = ItemList.GetItemName((int)ObjectIndexes.Beet) }) },
                { 6, Globals.GetTranslation("quest-6", new { crop = ItemList.GetItemName(ParsnipCropId), cropId = ParsnipCropId }) },
                { 22, Globals.GetTranslation("quest-22", new { fish = ItemList.GetItemName((int)ObjectIndexes.LargemouthBass) }) },
            };

            List <int> nonStaticQuestIds = new List <int>
            {
                101, 103, 104, 105, 106, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125
            };

            foreach (int questId in nonStaticQuestIds)
            {
                DefaultQuestData.Add(questId, Globals.GetTranslation($"quest-{questId}"));
            }
        }
        /// <summary>
        /// Populates the given quest and mail replacement dictionaries
        /// </summary>
        /// <param name="questReplacements">The dictionary of quest replacements to fill</param>
        /// <param name="mailReplacements">The dictionary of mail replacements to fill</param>
        private static void RandomizeQuestsAndMailStrings(
            Dictionary <int, string> questReplacements,
            Dictionary <string, string> mailReplacements)
        {
            foreach (int questId in DefaultQuestData.Keys)
            {
                object tokenObject = GetTokenObject(questId);

                string questString = DefaultQuestData[questId];
                questString = Globals.GetTranslation($"quest-{questId}", tokenObject);
                questReplacements.Add(questId, questString);

                if (QuestToMailMap.ContainsKey(questId) && DefaultMailData.ContainsKey(QuestToMailMap[questId]))
                {
                    string mailKey    = QuestToMailMap[questId];
                    string mailString = Globals.GetTranslation($"mail-{mailKey}", tokenObject);
                    mailReplacements.Add(mailKey, mailString);
                }
            }
        }
예제 #30
0
        /// <summary>
        /// Gets the string to be used for the time part of the description
        /// </summary>
        /// <returns />
        private string GetTimesString()
        {
            string timesString = "";

            if (ExcludedTimes.MinValue > 0 && ExcludedTimes.MaxValue > 0)
            {
                string fromTime = GetStringForTime(ExcludedTimes.MinValue);
                string toTime   = GetStringForTime(ExcludedTimes.MaxValue);
                timesString = Globals.GetTranslation("fish-tooltip-excluded-times", new { fromTime, toTime });
            }
            else if (Times.MinValue == 600 && Times.MaxValue == 2600)
            {
                timesString = Globals.GetTranslation("fish-tooltip-all-day");
            }
            else
            {
                string fromTime = GetStringForTime(Times.MinValue);
                string toTime   = GetStringForTime(Times.MaxValue);
                timesString = Globals.GetTranslation("fish-tooltip-time-range", new { fromTime, toTime });
            }
            return(timesString);
        }