protected void PlaceMinableAt(AsteroidsDungeon location, Random rand, int sx, int sy) { double r = rand.NextDouble(); if (r < 0.65) { location.netObjects.Add(new Vector2(sx, sy), new StardewValley.Object(new Vector2(sx, sy), rand.NextDouble() < 0.5 ? 846 : 847, 1) { Name = "Stone", MinutesUntilReady = 12 }); } else if (r < 0.85) { int[] ores = new int[] { 95, 95, 849, 850, 764, 765, int.MaxValue, int.MaxValue, int.MaxValue }; int[] breaks = new int[] { 15, 15, 6, 8, 10, 12 }; int ore_ = rand.Next(ores.Length); int ore = ores[ore_]; if (ore == int.MaxValue) { var obj = new DynamicGameAssets.Game.CustomObject((DynamicGameAssets.PackData.ObjectPackData)DynamicGameAssets.Mod.Find(ItemIds.MythiciteOreMinable)); obj.Name = "Stone"; obj.MinutesUntilReady = 24; location.netObjects.Add(new Vector2(sx, sy), obj); } else { location.netObjects.Add(new Vector2(sx, sy), new StardewValley.Object(new Vector2(sx, sy), ore, 1) { Name = "Stone", MinutesUntilReady = breaks[ore_] }); } } else if (r < 0.95) { int[] gems = new int[] { 2, 4, 6, 8, 10, 12, 14, 44, 44, 44, 46, 46 }; int gem_ = rand.Next(gems.Length); int gem = gems[gem_]; location.netObjects.Add(new Vector2(sx, sy), new StardewValley.Object(new Vector2(sx, sy), gem, 1) { Name = "Stone", MinutesUntilReady = 10 }); } else { location.netObjects.Add(new Vector2(sx, sy), new StardewValley.Object(new Vector2(sx, sy), 819, 1) { Name = "Stone", MinutesUntilReady = 10 }); } }
private static void DoDrops(BreakableContainer __instance, GameLocation location, Farmer who) { Random r = new Random((int)__instance.tileLocation.X + (int)__instance.tileLocation.Y * 10000 + (int)Game1.stats.DaysPlayed); int x = (int)__instance.tileLocation.X; int y = (int)__instance.tileLocation.Y; if (r.NextDouble() < 0.2) { return; } if (Game1.random.NextDouble() <= 0.075 && Game1.player.team.SpecialOrderRuleActive("DROP_QI_BEANS")) { Game1.createMultipleObjectDebris(890, x, y, r.Next(1, 3), who.UniqueMultiplayerID, location); } if (r.NextDouble() < 0.01) { Game1.createItemDebris(new DynamicGameAssets.Game.CustomObject(DynamicGameAssets.Mod.Find(ItemIds.SoulSapphire) as ObjectPackData), __instance.TileLocation * Game1.tileSize, 0, location); } if (r.NextDouble() < 0.65) { Item item = null; Item item2 = null; switch (r.Next(5)) { case 0: case 1: case 2: case 3: case 4: //item = new DynamicGameAssets.Game.CustomObject( DynamicGameAssets.Mod.Find( ItemIds.LunarWheat ) as ObjectPackData ) { Stack = 4 + r.Next( 13 ) }; item2 = new DynamicGameAssets.Game.CustomObject(DynamicGameAssets.Mod.Find(ItemIds.LunarWheatSeeds) as ObjectPackData) { Stack = 1 + r.Next(6) }; break; } if (item != null) { Game1.createItemDebris(item, __instance.TileLocation * Game1.tileSize, 0, location); } if (item2 != null && r.NextDouble() < 0.25) { Game1.createItemDebris(item2, __instance.TileLocation * Game1.tileSize, 0, location); } } else if (r.NextDouble() < 0.75) { Game1.createItemDebris(new DynamicGameAssets.Game.CustomObject(DynamicGameAssets.Mod.Find(ItemIds.MythiciteOre) as ObjectPackData) { Stack = 1 + r.Next(4) }, __instance.TileLocation * Game1.tileSize, 0, location); } }