public static FishPoolEntry Object(double chance, int obj, double luck = 0) { FishPoolEntry fish = new FishPoolEntry(); fish.Chance = chance; fish.LuckFactor = luck; fish.ObjectID = obj; return(fish); }
public static FishPoolEntry Preset(double chance, string loc, double luck = 0) { FishPoolEntry fish = new FishPoolEntry(); fish.Chance = chance; fish.LuckFactor = luck; fish.LocationPreset = loc; return(fish); }
public static FishPoolEntry FinalObject(int obj) { FishPoolEntry fish = new FishPoolEntry(); fish.Chance = 1.0; fish.OnlyTryIfNoneSelectedYet = true; fish.ObjectID = obj; return(fish); }
public static FishPoolEntry FinalPreset(string loc) { FishPoolEntry fish = new FishPoolEntry(); fish.Chance = 1.0; fish.OnlyTryIfNoneSelectedYet = true; fish.LocationPreset = loc; return(fish); }
public static FishPoolEntry chooseEntry(List <FishPoolEntry> entries) { FishPoolEntry ret = null; foreach (var entry in entries) { if (entry.OnlyTryIfNoneSelectedYet && ret != null) { continue; } if (Game1.random.NextDouble() < entry.Chance + Game1.dailyLuck * entry.LuckFactor) { ret = entry; } } return(ret); }