1: [], 2: [] }, 1: { 0: [], 1: [], 2: [] }, 2: { 0: [], 1: [], 2: [] } } } fishRarityDistribution = DropGlobals.createZippedDist(raritySpawnChances, [0, 1, 2]) for fish in allFishData: if fish['location'] in ['ship', 'both']: rarityPool['ship'][fish['depth']][fish['rarity']].append(fish) if fish['location'] in ['dock', 'both']: rarityPool['dock'][fish['depth']][fish['rarity']].append(fish) def giveMeAFish(location, depth, fishHisto): rarity = DropGlobals.rollDistribution(fishRarityDistribution) potentialFish = [ x for x in rarityPool[location][depth][rarity] if fishHisto[x['id']][0] < fishHisto[x['id']][1] ] if potentialFish: return random.choice(potentialFish)
1: [], 2: [] }, 1: { 0: [], 1: [], 2: [] }, 2: { 0: [], 1: [], 2: [] } } } fishRarityDistribution = DropGlobals.createZippedDist(raritySpawnChances, [0, 1, 2]) for fish in allFishData: if fish['location'] in ['ship', 'both']: rarityPool['ship'][fish['depth']][fish['rarity']].append(fish) if fish['location'] in ['dock', 'both']: rarityPool['dock'][fish['depth']][fish['rarity']].append(fish) def giveMeAFish(location, depth, fishHisto): rarity = DropGlobals.rollDistribution(fishRarityDistribution) potentialFish = [1] if potentialFish: return random.choice(potentialFish) for x in range(3):
2: [] } }, 'dock': { 0: { 0: [], 1: [], 2: [] }, 1: { 0: [], 1: [], 2: [] }, 2: { 0: [], 1: [], 2: [] } } } fishRarityDistribution = DropGlobals.createZippedDist(raritySpawnChances, [ 0, 1, 2]) for fish in allFishData: if fish['location'] in [ 'ship', 'both']: rarityPool['ship'][fish['depth']][fish['rarity']].append(fish) if fish['location'] in [ 'dock', 'both']: rarityPool['dock'][fish['depth']][fish['rarity']].append(fish) def giveMeAFish(location, depth, fishHisto):