fix: Cleans up code with feeding pets and adds batch coin flips random check (#1717)
This commit is contained in:
parent
183f6fa4ac
commit
29ea813242
5 changed files with 186 additions and 128 deletions
|
|
@ -72,7 +72,7 @@ public partial class DawnsMusicBox : Item, ISecurable
|
|||
{ MusicName.ValoriaShips, new DawnsMusicInfo(1075140, DawnsMusicRarity.Rare) }
|
||||
};
|
||||
|
||||
public static readonly MusicName[] _commonTracks =
|
||||
private static readonly MusicName[] _commonTracks =
|
||||
{
|
||||
MusicName.Samlethe, MusicName.Sailing, MusicName.Britain2, MusicName.Britain1,
|
||||
MusicName.Bucsden, MusicName.Forest_a, MusicName.Cove, MusicName.Death,
|
||||
|
|
@ -86,7 +86,7 @@ public partial class DawnsMusicBox : Item, ISecurable
|
|||
MusicName.Mountn_a, MusicName.Wind, MusicName.Yew, MusicName.Zento
|
||||
};
|
||||
|
||||
public static readonly MusicName[] _uncommonTracks =
|
||||
private static readonly MusicName[] _uncommonTracks =
|
||||
{
|
||||
MusicName.GwennoConversation, MusicName.DreadHornArea, MusicName.ElfCity,
|
||||
MusicName.GoodEndGame, MusicName.GoodVsEvil, MusicName.GreatEarthSerpents,
|
||||
|
|
@ -94,7 +94,7 @@ public partial class DawnsMusicBox : Item, ISecurable
|
|||
MusicName.MinocNegative, MusicName.ParoxysmusLair, MusicName.Paws
|
||||
};
|
||||
|
||||
public static readonly MusicName[] _rareTracks =
|
||||
private static readonly MusicName[] _rareTracks =
|
||||
{
|
||||
MusicName.SelimsBar, MusicName.SerpentIsleCombat_U7, MusicName.ValoriaShips
|
||||
};
|
||||
|
|
@ -117,9 +117,16 @@ public partial class DawnsMusicBox : Item, ISecurable
|
|||
{
|
||||
Weight = 1.0;
|
||||
|
||||
_tracks = new List<MusicName>();
|
||||
var shuffledTracks = GetTracks(DawnsMusicRarity.Common);
|
||||
shuffledTracks.Shuffle();
|
||||
|
||||
GetTracks(DawnsMusicRarity.Common).RandomSample(4, _tracks);
|
||||
_tracks =
|
||||
[
|
||||
shuffledTracks[0],
|
||||
shuffledTracks[1],
|
||||
shuffledTracks[2],
|
||||
shuffledTracks[3]
|
||||
];
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1075198; // Dawn's Music Box
|
||||
|
|
@ -131,8 +138,7 @@ public partial class DawnsMusicBox : Item, ISecurable
|
|||
return;
|
||||
}
|
||||
|
||||
box.Tracks = new List<MusicName>();
|
||||
box.Tracks.AddRange(Tracks);
|
||||
box.Tracks = [..Tracks];
|
||||
}
|
||||
|
||||
public override void GetProperties(IPropertyList list)
|
||||
|
|
@ -257,7 +263,7 @@ public partial class DawnsMusicBox : Item, ISecurable
|
|||
private void Deserialize(IGenericReader reader, int version)
|
||||
{
|
||||
var count = reader.ReadInt();
|
||||
_tracks = new List<MusicName>();
|
||||
_tracks = [];
|
||||
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue