def getALegendaryFish(model=None):
    if model:
        model = 'lgLeg%s' % model
        if model in modelToLegendaryFishData:
            return modelToLegendaryFishData[model]
        else:
            return DropGlobals.rollDistribution(legendaryFishDistribution)
    else:
        return DropGlobals.rollDistribution(legendaryFishDistribution)
def getALegendaryFish(model = None):
    if model:
        model = 'lgLeg%s' % model
        if model in modelToLegendaryFishData:
            return modelToLegendaryFishData[model]
        else:
            return DropGlobals.rollDistribution(legendaryFishDistribution)
    else:
        return DropGlobals.rollDistribution(legendaryFishDistribution)
def giveMeAFish(location, depth, fishHisto):
    rarity = DropGlobals.rollDistribution(fishRarityDistribution)
    potentialFish = [1]
    if potentialFish:
        return random.choice(potentialFish)

    for x in range(3):
        if x != rarity:
            continue
        [1][x]
        continue
def giveMeAFish(location, depth, fishHisto):
    rarity = DropGlobals.rollDistribution(fishRarityDistribution)
    potentialFish = [1]
    if potentialFish:
        return random.choice(potentialFish)

    for x in range(3):
        if x != rarity:
            continue
        [1][x]
        continue
Esempio n. 5
0
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)
    for i in [ x for x in range(3) if x != rarity ]:
        potentialFish = [ x for x in rarityPool[location][depth][i] if fishHisto[x['id']][0] < fishHisto[x['id']] ]
        if potentialFish:
            return random.choice(potentialFish)

    return
            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):
Esempio n. 7
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):
    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)
 def startShopping(self, storeType):
     self.accept('makeSale', self.sendRequestMakeSale)
     self.acceptOnce('exitStore', self.finishShopping)
     self.acceptOnce('makeShipSale', self.sendRequestMakeShipSale)
     self.acceptOnce('purchaseAccessories', self.sendRequestAccessories)
     self.acceptOnce('requestMusic', self.sendRequestMusic)
     self.acceptOnce('requestStowaway', self.sendRequestStowaway)
     self.storeType = storeType
     simpleStoreList = getBase().config.GetString('want-simple-stores', '').lower()
     useSimpleStore = 1
     if storeType == InteractGlobals.STORE:
         storeItems = DropGlobals.getStoreItems(self.uniqueId)
         inventory = ItemGlobals.getLegalStoreItems(storeItems)
         if not inventory:
             inventory = self.shopInventory[:]
         elif self.avatarType.isA(AvatarTypes.Blacksmith):
             inventory += DAGGER_AMMO_SHELF_L1 + DAGGER_AMMO_SHELF_L2 + DAGGER_POUCH_SHELF
         elif self.avatarType.isA(AvatarTypes.Gunsmith):
             inventory += PISTOL_AMMO_SHELF_L1 + PISTOL_AMMO_SHELF_L2 + PISTOL_POUCH_SHELF + BOMB_AMMO_SHELF_L1 + BOMB_AMMO_SHELF_L2 + GRENADE_POUCH_SHELF + CANNON_AMMO_SHELF_L1 + CANNON_AMMO_SHELF_L2 + CANNON_POUCH_SHELF
         elif self.avatarType.isA(AvatarTypes.Grenadier):
             inventory += BOMB_AMMO_SHELF_L1 + BOMB_AMMO_SHELF_L2 + GRENADE_POUCH_SHELF
         elif self.avatarType.isA(AvatarTypes.Merchant):
             inventory += PISTOL_AMMO_SHELF_L1
         
         if hasattr(self.cr.distributedDistrict, 'siegeManager') and self.cr.distributedDistrict.siegeManager.getPvpEnabled() and self.cr.distributedDistrict.siegeManager.getUseRepairKit() and self.avatarType.isA(AvatarTypes.Gunsmith):
             inventory += SIEGE_SHELF
         
         if useSimpleStore:
             self.storeMenuGUI = SimpleStoreGUI.MerchantStoreGUI(inventory, PLocalizer.MerchantStore, self)
         else:
             self.storeMenuGUI = StoreGUI.StoreGUI(inventory, PLocalizer.MerchantStore)
     elif storeType == InteractGlobals.MUSICIAN:
         self.fadeIval = Sequence(Func(self.setTransparency, 1.0), self.colorScaleInterval(1.0, VBase4(1.0, 1.0, 1.0, 0.0)), Func(self.hide))
         self.fadeIval.start()
         inventory = self.shopInventory[:]
         self.storeMenuGUI = MusicianGUI.MusicianGUI(inventory, PLocalizer.InteractMusician)
     elif storeType == InteractGlobals.STOWAWAY:
         inventory = self.shopInventory[:]
         self.storeMenuGUI = StowawayGUI.StowawayGUI(inventory, PLocalizer.StowawayMenuTitle)
     elif storeType == InteractGlobals.SHIPS:
         self.storeMenuGUI = ShipStoreGUI.ShipStoreGUI(SHIP_SHELF, PLocalizer.Shipyard)
     elif storeType == InteractGlobals.TRAIN:
         pass
     elif storeType == InteractGlobals.UPGRADE:
         pass
     elif storeType == InteractGlobals.ACCESSORIES_STORE:
         self.fadeIval = Sequence(Func(self.setTransparency, 1.0), self.colorScaleInterval(1.0, VBase4(1.0, 1.0, 1.0, 0.0)), Func(self.hide))
         self.fadeIval.start()
         if useSimpleStore:
             self.storeMenuGUI = SimpleStoreGUI.AccessoriesStoreGUI(npc = self, shopId = self.getShopId())
         else:
             self.storeMenuGUI = AccessoriesStoreGUI.AccessoriesStoreGUI(npc = self, shopId = self.getShopId())
     elif storeType == InteractGlobals.TATTOO_STORE:
         self.fadeIval = Sequence(Func(self.setTransparency, 1.0), self.colorScaleInterval(1.0, VBase4(1.0, 1.0, 1.0, 0.0)), Func(self.hide))
         self.fadeIval.start()
         if useSimpleStore:
             self.storeMenuGUI = SimpleStoreGUI.TattooStoreGUI(npc = self, shopId = self.getShopId())
         else:
             self.storeMenuGUI = TattooStoreGUI.TattooStoreGUI(npc = self, shopId = self.getShopId())
     elif storeType == InteractGlobals.JEWELRY_STORE:
         self.fadeIval = Sequence(Func(self.setTransparency, 1.0), self.colorScaleInterval(1.0, VBase4(1.0, 1.0, 1.0, 0.0)), Func(self.hide))
         self.fadeIval.start()
         if useSimpleStore:
             self.storeMenuGUI = SimpleStoreGUI.JewelryStoreGUI(npc = self, shopId = self.getShopId())
         else:
             self.storeMenuGUI = JewelryStoreGUI.JewelryStoreGUI(npc = self, shopId = self.getShopId())
     elif storeType == InteractGlobals.BARBER_STORE:
         self.fadeIval = Sequence(Func(self.setTransparency, 1.0), self.colorScaleInterval(1.0, VBase4(1.0, 1.0, 1.0, 0.0)), Func(self.hide))
         self.fadeIval.start()
         self.storeMenuGUI = BarberStoreGUI.BarberStoreGUI(npc = self, shopId = self.getShopId())
     elif storeType == InteractGlobals.PVP_REWARDS_TATTOO:
         self.fadeIval = Sequence(Func(self.setTransparency, 1.0), self.colorScaleInterval(1.0, VBase4(1.0, 1.0, 1.0, 0.0)), Func(self.hide))
         self.fadeIval.start()
         self.storeMenuGUI = TattooStoreGUI.TattooStoreGUI(npc = self, shopId = PiratesGlobals.PRIVATEER_TATTOOS)
     elif storeType == InteractGlobals.PVP_REWARDS_HATS:
         self.fadeIval = Sequence(Func(self.setTransparency, 1.0), self.colorScaleInterval(1.0, VBase4(1.0, 1.0, 1.0, 0.0)), Func(self.hide))
         self.fadeIval.start()
         self.storeMenuGUI = AccessoriesStoreGUI.AccessoriesStoreGUI(npc = self, shopId = PiratesGlobals.PRIVATEER_HATS)
     elif storeType == InteractGlobals.PVP_REWARDS_COATS:
         self.fadeIval = Sequence(Func(self.setTransparency, 1.0), self.colorScaleInterval(1.0, VBase4(1.0, 1.0, 1.0, 0.0)), Func(self.hide))
         self.fadeIval.start()
         self.storeMenuGUI = AccessoriesStoreGUI.AccessoriesStoreGUI(npc = self, shopId = PiratesGlobals.PRIVATEER_COATS)
     elif storeType == InteractGlobals.CATALOG_STORE:
         self.storeMenuGUI = SimpleStoreGUI.CatalogStoreGUI(npc = self, shopId = self.getShopId())
     
     self.accept(InventoryGlobals.getCategoryChangeMsg(localAvatar.getInventoryId(), InventoryType.ItemTypeMoney), self.saleFinishedResponse)
            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):
    def startShopping(self, storeType):
        self.accept('makeSale', self.sendRequestMakeSale)
        self.acceptOnce('exitStore', self.finishShopping)
        self.acceptOnce('makeShipSale', self.sendRequestMakeShipSale)
        self.acceptOnce('purchaseAccessories', self.sendRequestAccessories)
        self.acceptOnce('requestMusic', self.sendRequestMusic)
        self.acceptOnce('requestStowaway', self.sendRequestStowaway)
        self.storeType = storeType
        simpleStoreList = getBase().config.GetString('want-simple-stores', '').lower()
        useSimpleStore = 1
        if storeType == InteractGlobals.STORE:
            storeItems = DropGlobals.getStoreItems(self.uniqueId)
            inventory = ItemGlobals.getLegalStoreItems(storeItems)
            if not inventory:
                inventory = self.shopInventory[:]
            elif self.avatarType.isA(AvatarTypes.Blacksmith):
                inventory += DAGGER_AMMO_SHELF_L1 + DAGGER_AMMO_SHELF_L2 + DAGGER_POUCH_SHELF
            elif self.avatarType.isA(AvatarTypes.Gunsmith):
                inventory += PISTOL_AMMO_SHELF_L1 + PISTOL_AMMO_SHELF_L2 + PISTOL_POUCH_SHELF + BOMB_AMMO_SHELF_L1 + BOMB_AMMO_SHELF_L2 + GRENADE_POUCH_SHELF + CANNON_AMMO_SHELF_L1 + CANNON_AMMO_SHELF_L2 + CANNON_POUCH_SHELF
            elif self.avatarType.isA(AvatarTypes.Grenadier):
                inventory += BOMB_AMMO_SHELF_L1 + BOMB_AMMO_SHELF_L2 + GRENADE_POUCH_SHELF
            elif self.avatarType.isA(AvatarTypes.Merchant):
                inventory += PISTOL_AMMO_SHELF_L1

            if hasattr(self.cr.distributedDistrict, 'siegeManager') and self.cr.distributedDistrict.siegeManager.getPvpEnabled() and self.cr.distributedDistrict.siegeManager.getUseRepairKit() and self.avatarType.isA(AvatarTypes.Gunsmith):
                inventory += SIEGE_SHELF

            if useSimpleStore:
                self.storeMenuGUI = SimpleStoreGUI.MerchantStoreGUI(inventory, PLocalizer.MerchantStore, self)
            else:
                self.storeMenuGUI = StoreGUI.StoreGUI(inventory, PLocalizer.MerchantStore)
        elif storeType == InteractGlobals.MUSICIAN:
            self.fadeIval = Sequence(Func(self.setTransparency, 1.0), self.colorScaleInterval(1.0, VBase4(1.0, 1.0, 1.0, 0.0)), Func(self.hide))
            self.fadeIval.start()
            inventory = self.shopInventory[:]
            self.storeMenuGUI = MusicianGUI.MusicianGUI(inventory, PLocalizer.InteractMusician)
        elif storeType == InteractGlobals.STOWAWAY:
            inventory = self.shopInventory[:]
            self.storeMenuGUI = StowawayGUI.StowawayGUI(inventory, PLocalizer.StowawayMenuTitle)
        elif storeType == InteractGlobals.SHIPS:
            self.storeMenuGUI = ShipStoreGUI.ShipStoreGUI(SHIP_SHELF, PLocalizer.Shipyard)
        elif storeType == InteractGlobals.TRAIN:
            pass
        elif storeType == InteractGlobals.UPGRADE:
            pass
        elif storeType == InteractGlobals.ACCESSORIES_STORE:
            self.fadeIval = Sequence(Func(self.setTransparency, 1.0), self.colorScaleInterval(1.0, VBase4(1.0, 1.0, 1.0, 0.0)), Func(self.hide))
            self.fadeIval.start()
            if useSimpleStore:
                self.storeMenuGUI = SimpleStoreGUI.AccessoriesStoreGUI(npc = self, shopId = self.getShopId())
            else:
                self.storeMenuGUI = AccessoriesStoreGUI.AccessoriesStoreGUI(npc = self, shopId = self.getShopId())
        elif storeType == InteractGlobals.TATTOO_STORE:
            self.fadeIval = Sequence(Func(self.setTransparency, 1.0), self.colorScaleInterval(1.0, VBase4(1.0, 1.0, 1.0, 0.0)), Func(self.hide))
            self.fadeIval.start()
            if useSimpleStore:
                self.storeMenuGUI = SimpleStoreGUI.TattooStoreGUI(npc = self, shopId = self.getShopId())
            else:
                self.storeMenuGUI = TattooStoreGUI.TattooStoreGUI(npc = self, shopId = self.getShopId())
        elif storeType == InteractGlobals.JEWELRY_STORE:
            self.fadeIval = Sequence(Func(self.setTransparency, 1.0), self.colorScaleInterval(1.0, VBase4(1.0, 1.0, 1.0, 0.0)), Func(self.hide))
            self.fadeIval.start()
            if useSimpleStore:
                self.storeMenuGUI = SimpleStoreGUI.JewelryStoreGUI(npc = self, shopId = self.getShopId())
            else:
                self.storeMenuGUI = JewelryStoreGUI.JewelryStoreGUI(npc = self, shopId = self.getShopId())
        elif storeType == InteractGlobals.BARBER_STORE:
            self.fadeIval = Sequence(Func(self.setTransparency, 1.0), self.colorScaleInterval(1.0, VBase4(1.0, 1.0, 1.0, 0.0)), Func(self.hide))
            self.fadeIval.start()
            self.storeMenuGUI = BarberStoreGUI.BarberStoreGUI(npc = self, shopId = self.getShopId())
        elif storeType == InteractGlobals.PVP_REWARDS_TATTOO:
            self.fadeIval = Sequence(Func(self.setTransparency, 1.0), self.colorScaleInterval(1.0, VBase4(1.0, 1.0, 1.0, 0.0)), Func(self.hide))
            self.fadeIval.start()
            self.storeMenuGUI = TattooStoreGUI.TattooStoreGUI(npc = self, shopId = PiratesGlobals.PRIVATEER_TATTOOS)
        elif storeType == InteractGlobals.PVP_REWARDS_HATS:
            self.fadeIval = Sequence(Func(self.setTransparency, 1.0), self.colorScaleInterval(1.0, VBase4(1.0, 1.0, 1.0, 0.0)), Func(self.hide))
            self.fadeIval.start()
            self.storeMenuGUI = AccessoriesStoreGUI.AccessoriesStoreGUI(npc = self, shopId = PiratesGlobals.PRIVATEER_HATS)
        elif storeType == InteractGlobals.PVP_REWARDS_COATS:
            self.fadeIval = Sequence(Func(self.setTransparency, 1.0), self.colorScaleInterval(1.0, VBase4(1.0, 1.0, 1.0, 0.0)), Func(self.hide))
            self.fadeIval.start()
            self.storeMenuGUI = AccessoriesStoreGUI.AccessoriesStoreGUI(npc = self, shopId = PiratesGlobals.PRIVATEER_COATS)
        elif storeType == InteractGlobals.CATALOG_STORE:
            self.storeMenuGUI = SimpleStoreGUI.CatalogStoreGUI(npc = self, shopId = self.getShopId())

        self.accept(InventoryGlobals.getCategoryChangeMsg(localAvatar.getInventoryId(), InventoryType.ItemTypeMoney), self.saleFinishedResponse)