Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void openTreasureMenuEndFunction(int extra)
- {
- this.lastUser.gainExperience(5, 10 * (this.clearWaterDistance + 1));
- this.doneFishing(this.lastUser, true);
- this.lastUser.completelyStopAnimatingOrDoingAction();
- List<Item> list = new List<Item>();
- if (extra == 1)
- {
- list.Add(new Object(this.whichFish, 1, false, -1, this.fishQuality));
- }
- float num = 1f;
- while (Game1.random.NextDouble() <= (double)num)
- {
- num *= 0.4f;
- switch (Game1.random.Next(4))
- {
- case 0:
- if (this.clearWaterDistance >= 5 && Game1.random.NextDouble() < 0.03)
- {
- list.Add(new Object(386, Game1.random.Next(1, 3), false, -1, 0));
- }
- else
- {
- List<int> list2 = new List<int>();
- if (this.clearWaterDistance >= 4)
- {
- list2.Add(384);
- }
- if (this.clearWaterDistance >= 3 && (list2.Count<int>() == 0 || Game1.random.NextDouble() < 0.6))
- {
- list2.Add(380);
- }
- if (list2.Count<int>() == 0 || Game1.random.NextDouble() < 0.6)
- {
- list2.Add(378);
- }
- if (list2.Count<int>() == 0 || Game1.random.NextDouble() < 0.6)
- {
- list2.Add(388);
- }
- if (list2.Count<int>() == 0 || Game1.random.NextDouble() < 0.6)
- {
- list2.Add(390);
- }
- list2.Add(382);
- list.Add(new Object(list2.ElementAt(Game1.random.Next(list2.Count<int>())), Game1.random.Next(2, 7) * ((Game1.random.NextDouble() < 0.05 + (double)this.lastUser.luckLevel * 0.015) ? 2 : 1), false, -1, 0));
- if (Game1.random.NextDouble() < 0.05 + (double)this.lastUser.LuckLevel * 0.03)
- {
- list.Last<Item>().Stack *= 2;
- }
- }
- break;
- case 1:
- if (this.clearWaterDistance >= 4 && Game1.random.NextDouble() < 0.1 && this.lastUser.FishingLevel >= 6)
- {
- list.Add(new Object(687, 1, false, -1, 0));
- }
- else if (this.lastUser.FishingLevel >= 6)
- {
- list.Add(new Object(685, 1, false, -1, 0));
- }
- else
- {
- list.Add(new Object(685, 10, false, -1, 0));
- }
- break;
- case 2:
- if (Game1.random.NextDouble() < 0.1 && this.lastUser != null && this.lastUser.archaeologyFound != null && this.lastUser.archaeologyFound.ContainsKey(102) && this.lastUser.archaeologyFound[102][0] < 19)
- {
- list.Add(new Object(102, 1, false, -1, 0));
- Game1.showGlobalMessage("You found a lost book. The library has been expanded.");
- }
- else if (Game1.player.archaeologyFound.Count<KeyValuePair<int, int[]>>() > 0)
- {
- if (Game1.random.NextDouble() < 0.25 && this.lastUser.FishingLevel > 1)
- {
- list.Add(new Object(Game1.random.Next(585, 588), 1, false, -1, 0));
- }
- else if (Game1.random.NextDouble() < 0.5 && this.lastUser.FishingLevel > 1)
- {
- list.Add(new Object(Game1.random.Next(103, 120), 1, false, -1, 0));
- }
- else
- {
- list.Add(new Object(535, 1, false, -1, 0));
- }
- }
- else
- {
- list.Add(new Object(382, Game1.random.Next(1, 3), false, -1, 0));
- }
- break;
- case 3:
- switch (Game1.random.Next(3))
- {
- case 0:
- if (this.clearWaterDistance >= 4)
- {
- list.Add(new Object(537 + ((Game1.random.NextDouble() < 0.4) ? Game1.random.Next(-2, 0) : 0), Game1.random.Next(1, 4), false, -1, 0));
- }
- else if (this.clearWaterDistance >= 3)
- {
- list.Add(new Object(536 + ((Game1.random.NextDouble() < 0.4) ? -1 : 0), Game1.random.Next(1, 4), false, -1, 0));
- }
- else
- {
- list.Add(new Object(535, Game1.random.Next(1, 4), false, -1, 0));
- }
- if (Game1.random.NextDouble() < 0.05 + (double)this.lastUser.LuckLevel * 0.03)
- {
- list.Last<Item>().Stack *= 2;
- }
- break;
- case 1:
- if (this.lastUser.FishingLevel < 2)
- {
- list.Add(new Object(382, Game1.random.Next(1, 4), false, -1, 0));
- }
- else
- {
- if (this.clearWaterDistance >= 4)
- {
- list.Add(new Object((Game1.random.NextDouble() < 0.3) ? 82 : ((Game1.random.NextDouble() < 0.5) ? 64 : 60), Game1.random.Next(1, 3), false, -1, 0));
- }
- else if (this.clearWaterDistance >= 3)
- {
- list.Add(new Object((Game1.random.NextDouble() < 0.3) ? 84 : ((Game1.random.NextDouble() < 0.5) ? 70 : 62), Game1.random.Next(1, 3), false, -1, 0));
- }
- else
- {
- list.Add(new Object((Game1.random.NextDouble() < 0.3) ? 86 : ((Game1.random.NextDouble() < 0.5) ? 66 : 68), Game1.random.Next(1, 3), false, -1, 0));
- }
- if (Game1.random.NextDouble() < 0.028 * (double)((float)this.clearWaterDistance / 5f))
- {
- list.Add(new Object(72, 1, false, -1, 0));
- }
- if (Game1.random.NextDouble() < 0.05)
- {
- list.Last<Item>().Stack *= 2;
- }
- }
- break;
- case 2:
- if (this.lastUser.FishingLevel < 2)
- {
- list.Add(new Object(770, Game1.random.Next(1, 4), false, -1, 0));
- }
- else
- {
- float num2 = (1f + (float)Game1.dailyLuck) * ((float)this.clearWaterDistance / 5f);
- if (Game1.random.NextDouble() < 0.05 * (double)num2 && !this.lastUser.specialItems.Contains(14))
- {
- list.Add(new MeleeWeapon(14)
- {
- specialItem = true
- });
- }
- if (Game1.random.NextDouble() < 0.05 * (double)num2 && !this.lastUser.specialItems.Contains(51))
- {
- list.Add(new MeleeWeapon(51)
- {
- specialItem = true
- });
- }
- if (Game1.random.NextDouble() < 0.07 * (double)num2)
- {
- switch (Game1.random.Next(3))
- {
- case 0:
- list.Add(new Ring(516 + ((Game1.random.NextDouble() < (double)((float)this.lastUser.LuckLevel / 11f)) ? 1 : 0)));
- break;
- case 1:
- list.Add(new Ring(518 + ((Game1.random.NextDouble() < (double)((float)this.lastUser.LuckLevel / 11f)) ? 1 : 0)));
- break;
- case 2:
- list.Add(new Ring(Game1.random.Next(529, 535)));
- break;
- }
- }
- if (Game1.random.NextDouble() < 0.02 * (double)num2)
- {
- list.Add(new Object(166, 1, false, -1, 0));
- }
- if (this.lastUser.FishingLevel > 5 && Game1.random.NextDouble() < 0.001 * (double)num2)
- {
- list.Add(new Object(74, 1, false, -1, 0));
- }
- if (Game1.random.NextDouble() < 0.01 * (double)num2)
- {
- list.Add(new Object(127, 1, false, -1, 0));
- }
- if (Game1.random.NextDouble() < 0.01 * (double)num2)
- {
- list.Add(new Object(126, 1, false, -1, 0));
- }
- if (Game1.random.NextDouble() < 0.01 * (double)num2)
- {
- list.Add(new Ring(527));
- }
- if (Game1.random.NextDouble() < 0.01 * (double)num2)
- {
- list.Add(new Boots(Game1.random.Next(504, 514)));
- }
- if (list.Count<Item>() == 1)
- {
- list.Add(new Object(72, 1, false, -1, 0));
- }
- }
- break;
- }
- break;
- }
- }
- if (list.Count<Item>() == 0)
- {
- list.Add(new Object(685, Game1.random.Next(1, 4) * 5, false, -1, 0));
- }
- Game1.activeClickableMenu = new ItemGrabMenu(list);
- (Game1.activeClickableMenu as ItemGrabMenu).source = 3;
- this.lastUser.completelyStopAnimatingOrDoingAction();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement