added some config options .conf fish
adding 4 basic items automatically to fish.yml once user updates and has no items
This commit is contained in:
parent
d910683d78
commit
94aee4ad10
3 changed files with 119 additions and 19 deletions
src/EllieBot
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
}
|
||||
];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
Loading…
Add table
Reference in a new issue