diff --git a/src/EllieBot/EllieBot.csproj b/src/EllieBot/EllieBot.csproj index e623461..87916e7 100644 --- a/src/EllieBot/EllieBot.csproj +++ b/src/EllieBot/EllieBot.csproj @@ -4,7 +4,7 @@ <Nullable>enable</Nullable> <ImplicitUsings>true</ImplicitUsings> <SatelliteResourceLanguages>en</SatelliteResourceLanguages> - <Version>6.1.0</Version> + <Version>6.1.1</Version> <!-- Output/build --> <RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory> diff --git a/src/EllieBot/Modules/Games/Fish/FishConfigService.cs b/src/EllieBot/Modules/Games/Fish/FishConfigService.cs index efabc52..8383aa7 100644 --- a/src/EllieBot/Modules/Games/Fish/FishConfigService.cs +++ b/src/EllieBot/Modules/Games/Fish/FishConfigService.cs @@ -15,17 +15,91 @@ public sealed class FishConfigService : ConfigServiceBase<FishConfig> IPubSub pubSub) : base(FILE_PATH, serializer, pubSub, _changeKey) { + AddParsedProp("captcha", + static (conf) => conf.RequireCaptcha, + bool.TryParse, + ConfigPrinters.ToString); + + AddParsedProp("chance.nothing", + static (conf) => conf.Chance.Nothing, + int.TryParse, + ConfigPrinters.ToString); + + AddParsedProp("chance.fish", + static (conf) => conf.Chance.Fish, + int.TryParse, + ConfigPrinters.ToString); + + AddParsedProp("chance.trash", + static (conf) => conf.Chance.Trash, + int.TryParse, + ConfigPrinters.ToString); + Migrate(); } private void Migrate() { - if (data.Version < 2) + if (data.Version < 11) { ModifyConfig(c => { - c.Version = 2; - c.RequireCaptcha = true; + c.Version = 11; + if (c.Items is { Count: > 0 }) + return; + c.Items = + [ + new FishItem + { + Id = 1, + ItemType = FishItemType.Pole, + Name = "Wooden Rod", + Description = "Better than catching it with bare hands.", + Price = 1000, + FishMultiplier = 1.2 + }, + new FishItem + { + Id = 11, + ItemType = FishItemType.Pole, + Name = "Magnet on a Stick", + Description = "Attracts all trash, not just metal.", + Price = 3000, + FishMultiplier = 0.9, + TrashMultiplier = 2 + }, + new FishItem + { + Id = 21, + ItemType = FishItemType.Bait, + Name = "Corn", + Description = "Just some cooked corn.", + Price = 100, + Uses = 100, + RareMultiplier = 1.1 + }, + new FishItem + { + Id = 31, + ItemType = FishItemType.Potion, + Name = "A Cup of Tea", + Description = "Helps you focus.", + Price = 12000, + DurationMinutes = 30, + MaxStarMultiplier = 1.1, + FishingSpeedMultiplier = 1.01 + }, + new FishItem + { + Id = 41, + ItemType = FishItemType.Boat, + Name = "Canoe", + Description = "Lets you fish a little faster.", + Price = 3000, + FishingSpeedMultiplier = 1.201, + MaxStarMultiplier = 1.1 + } + ]; }); } } diff --git a/src/EllieBot/data/fish.yml b/src/EllieBot/data/fish.yml index e04be6a..b2504bc 100644 --- a/src/EllieBot/data/fish.yml +++ b/src/EllieBot/data/fish.yml @@ -1,5 +1,5 @@ # DO NOT CHANGE -version: 2 +version: 11 weatherSeed: w%29';^eGE)9oWHM(aI9I;%1[.r^z2ZS7ShV,l')o(e%#"hVzb>oxQq^`.&/7srh requireCaptcha: true starEmojis: @@ -45,40 +45,66 @@ trash: items: - id: 1 itemType: Pole - name: "Wooden Rod" - description: "Better than catching it with bare hands." + name: Wooden Rod + emoji: '' + description: Better than catching it with bare hands. price: 1000 + uses: + durationMinutes: fishMultiplier: 1.2 - + trashMultiplier: + maxStarMultiplier: + rareMultiplier: + fishingSpeedMultiplier: - id: 11 itemType: Pole name: Magnet on a Stick - description: "Attracts all trash, not just metal." + emoji: '' + description: Attracts all trash, not just metal. price: 3000 + uses: + durationMinutes: fishMultiplier: 0.9 trashMultiplier: 2 - + maxStarMultiplier: + rareMultiplier: + fishingSpeedMultiplier: - id: 21 itemType: Bait - name: "Corn" - description: "Just some cooked corn." + name: Corn + emoji: '' + description: Just some cooked corn. price: 100 uses: 100 + durationMinutes: + fishMultiplier: + trashMultiplier: + maxStarMultiplier: rareMultiplier: 1.1 - + fishingSpeedMultiplier: - id: 31 itemType: Potion - name: "A Cup of Tea" - description: "Helps you focus." + name: A Cup of Tea + emoji: '' + description: Helps you focus. price: 12000 + uses: durationMinutes: 30 + fishMultiplier: + trashMultiplier: maxStarMultiplier: 1.1 + rareMultiplier: fishingSpeedMultiplier: 1.01 - - id: 41 itemType: Boat - name: "Canoe" - description: "Lets you fish a little faster." + name: Canoe + emoji: '' + description: Lets you fish a little faster. price: 3000 + uses: + durationMinutes: + fishMultiplier: + trashMultiplier: + maxStarMultiplier: 1.1 + rareMultiplier: fishingSpeedMultiplier: 1.201 - maxStarMultiplier: 1.1 \ No newline at end of file