def cancelPurchase(self): if hasattr(self.originalSupply, 'keys'): gagIds = self.originalSupply.keys() for gagId in gagIds: base.localAvatar.setGagAmmo(gagId, self.originalSupply.get(gagId)) self.originalSupply = {} Shop.cancelPurchase(self)
def cancelPurchase(self): if self.upgradesPurchased: if self.originalUpgrades[0] < base.localAvatar.getPUInventory()[0]: if base.localAvatar.getMyBattle(): if base.localAvatar.getMyBattle().getTurretManager(): base.localAvatar.getMyBattle().getTurretManager().destroyGui() base.localAvatar.setPUInventory(self.originalUpgrades) Shop.cancelPurchase(self)
def __init__(self, distShop, doneEvent): Shop.__init__(self, distShop, doneEvent) self.distShop.addItem('Whole Cream \nPie', ItemType.UPGRADE, 200, 'phase_3.5/maps/cannon-icon.png', upgradeID=0, maxUpgrades=1) self.distShop.addItem('Whole Fruit \nPie', ItemType.UPGRADE, 150, 'phase_3.5/maps/cannon-icon.png', upgradeID=1, maxUpgrades=1) self.distShop.addItem('Birthday Cake', ItemType.UPGRADE, 500, 'phase_3.5/maps/cannon-icon.png', upgradeID=2, maxUpgrades=1) self.distShop.addItem('Wedding Cake', ItemType.UPGRADE, 750, 'phase_3.5/maps/cannon-icon.png', upgradeID=3, maxUpgrades=1) self.distShop.addItem('+20 Laff', ItemType.HEAL, 100, 'phase_3.5/maps/ice-cream-cone.png', heal=20, healCooldown=5, showTitle=True) self.items = self.distShop.getItems()
def confirmPurchase(self): ammoList = [] gagIds = [] for gag in self.backpack.getGags(): gagId = GagGlobals.getIDByName(gag.getName()) gagIds.append(gagId) ammoList.append(self.backpack.getSupply(gag.getName())) self.distShop.sendUpdate('confirmPurchase', [gagIds, ammoList, base.localAvatar.getMoney()]) Shop.confirmPurchase(self)
def confirmPurchase(self): self.distShop.sendUpdate('confirmPurchase', [[base.localAvatar.getPUInventory()[0], base.localAvatar.getPUInventory()[1]], base.localAvatar.getMoney()]) if self.upgradesPurchased: if base.localAvatar.getPUInventory()[0] > 0: if base.localAvatar.getMyBattle(): if base.localAvatar.getMyBattle().getTurretManager(): if not base.localAvatar.getMyBattle().getTurretManager().myTurret: base.localAvatar.getMyBattle().getTurretManager().createTurretButton() Shop.confirmPurchase(self)
def cancelPurchase(self): if self.upgradesPurchased: if self.originalUpgrades[0] < base.localAvatar.getPUInventory()[0]: if base.localAvatar.getMyBattle(): if base.localAvatar.getMyBattle().getTurretManager(): base.localAvatar.getMyBattle().getTurretManager( ).destroyGui() base.localAvatar.setPUInventory(self.originalUpgrades) Shop.cancelPurchase(self)
def confirmPurchase(self): ammoList = [] if not hasattr(self.originalSupply, 'keys'): gagIds = [] else: gagIds = self.originalSupply.keys() for gagId in gagIds: ammoList.append(base.localAvatar.getBackpack().getSupply(GagGlobals.getGagByID(gagId))) self.distShop.sendUpdate('confirmPurchase', [gagIds, ammoList, base.localAvatar.getMoney()]) Shop.confirmPurchase(self)
def confirmPurchase(self): self.distShop.sendUpdate('confirmPurchase', [[ base.localAvatar.getPUInventory()[0], base.localAvatar.getPUInventory()[1] ], base.localAvatar.getMoney()]) if self.upgradesPurchased: if base.localAvatar.getPUInventory()[0] > 0: if base.localAvatar.getMyBattle(): if base.localAvatar.getMyBattle().getTurretManager(): if not base.localAvatar.getMyBattle().getTurretManager( ).myTurret: base.localAvatar.getMyBattle().getTurretManager( ).createTurretButton() Shop.confirmPurchase(self)
def setup(self): invIcons = loader.loadModel("phase_3.5/models/gui/inventory_icons.bam") self.distShop.addItem(WholeCreamPie, ItemType.GAG, 2, invIcons.find('**/inventory_creampie')) self.distShop.addItem(BirthdayCake, ItemType.GAG, 5, invIcons.find('**/inventory_cake')) self.distShop.addItem(CreamPieSlice, ItemType.GAG, 1, invIcons.find('**/inventory_cream_pie_slice')) self.distShop.addItem(TNT, ItemType.GAG, 20, invIcons.find('**/inventory_tnt')) self.distShop.addItem(SeltzerBottle, ItemType.GAG, 2, invIcons.find('**/inventory_seltzer_bottle')) self.distShop.addItem(WholeFruitPie, ItemType.GAG, 3, invIcons.find('**/inventory_fruitpie')) self.distShop.addItem(WeddingCake, ItemType.GAG, 100, invIcons.find('**/inventory_wedding')) self.distShop.addItem(FruitPieSlice, ItemType.GAG, 1, invIcons.find('**/inventory_fruit_pie_slice')) self.distShop.addItem(GrandPiano, ItemType.GAG, 15, invIcons.find('**/inventory_piano')) self.distShop.addItem(BambooCane, ItemType.GAG, 25, invIcons.find('**/inventory_bamboo_cane')) self.distShop.addItem(JugglingBalls, ItemType.GAG, 45, invIcons.find('**/inventory_juggling_cubes')) self.distShop.addItem(Megaphone, ItemType.GAG, 15, invIcons.find('**/inventory_megaphone')) self.items = self.distShop.getItems() Shop.setup(self) invIcons.removeNode() del invIcons
def setup(self): invIcons = loader.loadModel("phase_3.5/models/gui/inventory_icons.bam") self.distShop.addItem(WholeCreamPie, ItemType.GAG, 3, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.WholeCreamPie])) self.distShop.addItem(BirthdayCake, ItemType.GAG, 6, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.BirthdayCake])) self.distShop.addItem(CreamPieSlice, ItemType.GAG, 1, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.CreamPieSlice])) self.distShop.addItem(TNT, ItemType.GAG, 12, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.TNT])) self.distShop.addItem(SeltzerBottle, ItemType.GAG, 1, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.SeltzerBottle])) self.distShop.addItem(WholeFruitPie, ItemType.GAG, 4, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.WholeFruitPie])) self.distShop.addItem(WeddingCake, ItemType.GAG, 100, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.WeddingCake])) self.distShop.addItem(FruitPieSlice, ItemType.GAG, 1, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.FruitPieSlice])) self.distShop.addItem(GrandPiano, ItemType.GAG, 12, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.GrandPiano])) self.distShop.addItem(BambooCane, ItemType.GAG, 12, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.BambooCane])) self.distShop.addItem(JugglingBalls, ItemType.GAG, 25, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.JugglingBalls])) self.distShop.addItem(Safe, ItemType.GAG, 15, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.Safe])) self.distShop.addItem(Megaphone, ItemType.GAG, 12, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.Megaphone])) self.distShop.addItem(Cupcake, ItemType.GAG, 1, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.Cupcake])) self.distShop.addItem(TrapDoor, ItemType.GAG, 3, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.TrapDoor])) self.distShop.addItem(Quicksand, ItemType.GAG, 1, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.Quicksand])) self.distShop.addItem(Lipstick, ItemType.GAG, 8, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.Lipstick])) self.distShop.addItem(Foghorn, ItemType.GAG, 6, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.Foghorn])) self.distShop.addItem(Aoogah, ItemType.GAG, 1, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.Aoogah])) self.distShop.addItem(ElephantHorn, ItemType.GAG, 3, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.ElephantHorn])) self.distShop.addItem(Opera, ItemType.GAG, 100, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.Opera])) self.distShop.addItem(BikeHorn, ItemType.GAG, 1, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.BikeHorn])) self.distShop.addItem(Whistle, ItemType.GAG, 2, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.Whistle])) self.distShop.addItem(Bugle, ItemType.GAG, 6, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.Bugle])) self.distShop.addItem(PixieDust, ItemType.GAG, 18, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.PixieDust])) self.distShop.addItem(Anvil, ItemType.GAG, 2, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.Anvil])) self.distShop.addItem(FlowerPot, ItemType.GAG, 1, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.FlowerPot])) self.distShop.addItem(Sandbag, ItemType.GAG, 2, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.Sandbag])) self.distShop.addItem(Geyser, ItemType.GAG, 50, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.Geyser])) self.distShop.addItem(BigWeight, ItemType.GAG, 8, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.BigWeight])) self.distShop.addItem(StormCloud, ItemType.GAG, 6, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.StormCloud])) self.distShop.addItem(WaterGlass, ItemType.GAG, 1, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.WaterGlass])) self.distShop.addItem(WaterGun, ItemType.GAG, 1, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.WaterGun])) self.distShop.addItem(FireHose, ItemType.GAG, 3, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.FireHose])) self.distShop.addItem(SquirtingFlower, ItemType.GAG, 1, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.SquirtFlower])) self.items = self.distShop.getItems() Shop.setup(self) invIcons.removeNode() del invIcons
def __init__(self, distShop, doneEvent): Shop.__init__(self, distShop, doneEvent, wantTurretCount=1) self.distShop.addItem('Whole Cream \nPie', ItemType.UPGRADE, 200, 'phase_3.5/maps/cannon-icon.png', upgradeID=0, maxUpgrades=1) self.distShop.addItem('Whole Fruit \nPie', ItemType.UPGRADE, 150, 'phase_3.5/maps/cannon-icon.png', upgradeID=1, maxUpgrades=1) self.distShop.addItem('+20 Laff', ItemType.HEAL, 100, 'phase_3.5/maps/ice-cream-cone.png', heal=20, healCooldown=5, showTitle=True) self.items = self.distShop.getItems()
def setup(self): invIcons = loader.loadModel('phase_3.5/models/gui/inventory_icons.bam') self.distShop.addItem(WholeCreamPie, ItemType.GAG, 5, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.WholeCreamPie])) self.distShop.addItem(BirthdayCake, ItemType.GAG, 10, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.BirthdayCake])) self.distShop.addItem(CreamPieSlice, ItemType.GAG, 3, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.CreamPieSlice])) self.distShop.addItem(TNT, ItemType.GAG, 20, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.TNT])) self.distShop.addItem(SeltzerBottle, ItemType.GAG, 3, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.SeltzerBottle])) self.distShop.addItem(WholeFruitPie, ItemType.GAG, 4, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.WholeFruitPie])) self.distShop.addItem(WeddingCake, ItemType.GAG, 100, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.WeddingCake])) self.distShop.addItem(FruitPieSlice, ItemType.GAG, 2, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.FruitPieSlice])) self.distShop.addItem(GrandPiano, ItemType.GAG, 25, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.GrandPiano])) self.distShop.addItem(BambooCane, ItemType.GAG, 17, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.BambooCane])) self.distShop.addItem(JugglingBalls, ItemType.GAG, 35, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.JugglingBalls])) self.distShop.addItem(Safe, ItemType.GAG, 20, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.Safe])) self.distShop.addItem(Megaphone, ItemType.GAG, 15, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.Megaphone])) self.distShop.addItem(Cupcake, ItemType.GAG, 1, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.Cupcake])) self.distShop.addItem(TrapDoor, ItemType.GAG, 5, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.TrapDoor])) self.distShop.addItem(Quicksand, ItemType.GAG, 3, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.Quicksand])) self.distShop.addItem(Lipstick, ItemType.GAG, 12, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.Lipstick])) self.distShop.addItem(Foghorn, ItemType.GAG, 8, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.Foghorn])) self.distShop.addItem(Aoogah, ItemType.GAG, 3, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.Aoogah])) self.distShop.addItem(ElephantHorn, ItemType.GAG, 5, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.ElephantHorn])) self.distShop.addItem(Opera, ItemType.GAG, 200, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.Opera])) self.distShop.addItem(BikeHorn, ItemType.GAG, 2, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.BikeHorn])) self.distShop.addItem(Whistle, ItemType.GAG, 4, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.Whistle])) self.distShop.addItem(Bugle, ItemType.GAG, 8, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.Bugle])) self.distShop.addItem(PixieDust, ItemType.GAG, 25, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.PixieDust])) self.distShop.addItem(Anvil, ItemType.GAG, 4, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.Anvil])) self.distShop.addItem(FlowerPot, ItemType.GAG, 3, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.FlowerPot])) self.distShop.addItem(Sandbag, ItemType.GAG, 4, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.Sandbag])) self.distShop.addItem(Geyser, ItemType.GAG, 75, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.Geyser])) self.distShop.addItem(BigWeight, ItemType.GAG, 14, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.BigWeight])) self.distShop.addItem(StormCloud, ItemType.GAG, 8, invIcons.find(GagGlobals.InventoryIconByName[CIGlobals.StormCloud])) self.items = self.distShop.getItems() Shop.setup(self) invIcons.removeNode() del invIcons
def enter(self): self.originalUpgrades = base.localAvatar.getPUInventory() self.upgradesPurchased = False Shop.enter(self)
def enter(self): Shop.enter(self) self.originalSupply = base.localAvatar.getBackpackAmmo()
def __init__(self, distShop, doneEvent, wantFullShop=False): Shop.__init__(self, distShop, doneEvent, wantFullShop=wantFullShop) self.distShop = distShop self.backpack = base.localAvatar.getBackpack() self.setup()
def __init__(self, distShop, doneEvent): Shop.__init__(self, distShop, doneEvent) self.distShop = distShop self.backpack = base.localAvatar.getBackpack() self.originalSupply = {} self.setup()
def cancelPurchase(self): for gagName, supply in self.originalSupply.iteritems(): base.localAvatar.getBackpack().setSupply(supply, gagName) base.localAvatar.updateBackpackAmmo() Shop.cancelPurchase(self)
def exit(self): Shop.exit(self) self.originalSupply = {}
def __init__(self, distShop, doneEvent): Shop.__init__(self, distShop, doneEvent) self.distShop = distShop self.backpack = base.localAvatar.getBackpack() self.setup()
def update(self): Shop.update(self)
def update(self, page=None): Shop.update(self, page)
def exit(self): Shop.exit(self) self.originalUpgrades = None self.upgradesPurchased = None
def enter(self): Shop.enter(self)
def exit(self): Shop.exit(self) self.originalUpgrades = None self.upgradesPurchased = None return