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>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>true</ImplicitUsings>
|
<ImplicitUsings>true</ImplicitUsings>
|
||||||
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
|
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
|
||||||
<Version>6.1.0</Version>
|
<Version>6.1.1</Version>
|
||||||
|
|
||||||
<!-- Output/build -->
|
<!-- Output/build -->
|
||||||
<RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory>
|
<RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory>
|
||||||
|
|
|
@ -15,17 +15,91 @@ public sealed class FishConfigService : ConfigServiceBase<FishConfig>
|
||||||
IPubSub pubSub)
|
IPubSub pubSub)
|
||||||
: base(FILE_PATH, serializer, pubSub, _changeKey)
|
: 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();
|
Migrate();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Migrate()
|
private void Migrate()
|
||||||
{
|
{
|
||||||
if (data.Version < 2)
|
if (data.Version < 11)
|
||||||
{
|
{
|
||||||
ModifyConfig(c =>
|
ModifyConfig(c =>
|
||||||
{
|
{
|
||||||
c.Version = 2;
|
c.Version = 11;
|
||||||
c.RequireCaptcha = true;
|
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
|
# DO NOT CHANGE
|
||||||
version: 2
|
version: 11
|
||||||
weatherSeed: w%29';^eGE)9oWHM(aI9I;%1[.r^z2ZS7ShV,l')o(e%#"hVzb>oxQq^`.&/7srh
|
weatherSeed: w%29';^eGE)9oWHM(aI9I;%1[.r^z2ZS7ShV,l')o(e%#"hVzb>oxQq^`.&/7srh
|
||||||
requireCaptcha: true
|
requireCaptcha: true
|
||||||
starEmojis:
|
starEmojis:
|
||||||
|
@ -45,40 +45,66 @@ trash:
|
||||||
items:
|
items:
|
||||||
- id: 1
|
- id: 1
|
||||||
itemType: Pole
|
itemType: Pole
|
||||||
name: "Wooden Rod"
|
name: Wooden Rod
|
||||||
description: "Better than catching it with bare hands."
|
emoji: ''
|
||||||
|
description: Better than catching it with bare hands.
|
||||||
price: 1000
|
price: 1000
|
||||||
|
uses:
|
||||||
|
durationMinutes:
|
||||||
fishMultiplier: 1.2
|
fishMultiplier: 1.2
|
||||||
|
trashMultiplier:
|
||||||
|
maxStarMultiplier:
|
||||||
|
rareMultiplier:
|
||||||
|
fishingSpeedMultiplier:
|
||||||
- id: 11
|
- id: 11
|
||||||
itemType: Pole
|
itemType: Pole
|
||||||
name: Magnet on a Stick
|
name: Magnet on a Stick
|
||||||
description: "Attracts all trash, not just metal."
|
emoji: ''
|
||||||
|
description: Attracts all trash, not just metal.
|
||||||
price: 3000
|
price: 3000
|
||||||
|
uses:
|
||||||
|
durationMinutes:
|
||||||
fishMultiplier: 0.9
|
fishMultiplier: 0.9
|
||||||
trashMultiplier: 2
|
trashMultiplier: 2
|
||||||
|
maxStarMultiplier:
|
||||||
|
rareMultiplier:
|
||||||
|
fishingSpeedMultiplier:
|
||||||
- id: 21
|
- id: 21
|
||||||
itemType: Bait
|
itemType: Bait
|
||||||
name: "Corn"
|
name: Corn
|
||||||
description: "Just some cooked corn."
|
emoji: ''
|
||||||
|
description: Just some cooked corn.
|
||||||
price: 100
|
price: 100
|
||||||
uses: 100
|
uses: 100
|
||||||
|
durationMinutes:
|
||||||
|
fishMultiplier:
|
||||||
|
trashMultiplier:
|
||||||
|
maxStarMultiplier:
|
||||||
rareMultiplier: 1.1
|
rareMultiplier: 1.1
|
||||||
|
fishingSpeedMultiplier:
|
||||||
- id: 31
|
- id: 31
|
||||||
itemType: Potion
|
itemType: Potion
|
||||||
name: "A Cup of Tea"
|
name: A Cup of Tea
|
||||||
description: "Helps you focus."
|
emoji: ''
|
||||||
|
description: Helps you focus.
|
||||||
price: 12000
|
price: 12000
|
||||||
|
uses:
|
||||||
durationMinutes: 30
|
durationMinutes: 30
|
||||||
|
fishMultiplier:
|
||||||
|
trashMultiplier:
|
||||||
maxStarMultiplier: 1.1
|
maxStarMultiplier: 1.1
|
||||||
|
rareMultiplier:
|
||||||
fishingSpeedMultiplier: 1.01
|
fishingSpeedMultiplier: 1.01
|
||||||
|
|
||||||
- id: 41
|
- id: 41
|
||||||
itemType: Boat
|
itemType: Boat
|
||||||
name: "Canoe"
|
name: Canoe
|
||||||
description: "Lets you fish a little faster."
|
emoji: ''
|
||||||
|
description: Lets you fish a little faster.
|
||||||
price: 3000
|
price: 3000
|
||||||
|
uses:
|
||||||
|
durationMinutes:
|
||||||
|
fishMultiplier:
|
||||||
|
trashMultiplier:
|
||||||
|
maxStarMultiplier: 1.1
|
||||||
|
rareMultiplier:
|
||||||
fishingSpeedMultiplier: 1.201
|
fishingSpeedMultiplier: 1.201
|
||||||
maxStarMultiplier: 1.1
|
|
Loading…
Add table
Reference in a new issue