def __init__(self, rpg): self.clicked = False self.newSlot = 0 self.slot1Taken = 0 self.slot2Taken = 0 self.slot3Taken = 0 self.slot4Taken = 0 self.slot5Taken = 0 self.icon5 = image(rpg, "CREATE Task Folder\Image Assets\Transparent.png", "") self.icon5.consoleDefault(rpg, 0) self.slot5 = Button(rpg, "") self.slot5.consoleTextDefault(rpg, 0) self.icon4 = image(rpg, "CREATE Task Folder\Image Assets\Transparent.png", "") self.icon4.consoleDefault(rpg, 132) self.slot4 = Button(rpg, "") self.slot4.consoleTextDefault(rpg, 132) self.icon3 = image(rpg, "CREATE Task Folder\Image Assets\Transparent.png", "") self.icon3.consoleDefault(rpg, 264) self.slot3 = Button(rpg, "") self.slot3.consoleTextDefault(rpg, 264) self.icon2 = image(rpg, "CREATE Task Folder\Image Assets\Transparent.png", "") self.icon2.consoleDefault(rpg, 396) self.slot2 = Button(rpg, "") self.slot2.consoleTextDefault(rpg, 396) self.icon1 = image(rpg, "CREATE Task Folder\Image Assets\Transparent.png", "") self.icon1.consoleDefault(rpg, 528) self.slot1 = Button(rpg, "") self.slot1.consoleTextDefault(rpg, 528) self.arrow = image(rpg, "CREATE Task Folder\Image Assets\Transparent.png", "") self.arrow.width, self.arrow.height = 80, 60 self.arrow.top, self.arrow.left = 600, 970 self.arrow.transparent = True
def __init__(self, rpg): #LoadButton Settings self.loadButton = Button(rpg, "Load") self.loadButton.startDefault(rpg, 75, 0) #New game button self.newGameButton = Button(rpg, "New Game") self.newGameButton.startDefault(rpg, 0, 0) #Quit Button self.quitButton = Button(rpg, "Quit") self.quitButton.startDefault(rpg, 150, 0) #Project Logo self.logo = image(rpg, 'CREATE Task Folder\Image Assets\GUI_images\ProjectLogo.png', "")#pylint: disable = anomalous-backslash-in-string self.logo.top = (rpg.settings.screen_height*.5) - (self.logo.height/2) - 200 self.logo.left = (rpg.settings.screen_width*.5) - (self.logo.width/2)
def __init__(self, rpg): self.upArrow = image( rpg, 'CREATE Task Folder\Image Assets\GUI_images\Arrow.png', "") #pylint: disable = anomalous-backslash-in-string self.upArrow.width = 50 self.upArrow.height = 210 self.upArrow.top = (rpg.settings.screen_height) - ( self.upArrow.height * 2) self.upArrow.left = 1000 self.upArrow.clickable = True self.upArrow.border = True self.downArrow = image( rpg, 'CREATE Task Folder\Image Assets\GUI_images\downArrow.png', "") #pylint: disable = anomalous-backslash-in-string self.downArrow.width = 50 self.downArrow.height = 210 self.downArrow.top = ( rpg.settings.screen_height) - self.downArrow.height self.downArrow.left = 1000 self.downArrow.border = True self.downArrow.clickable = True self.notificationImage = image( rpg, 'CREATE Task Folder\Image Assets\Weapon_Images\Copper Sword Info.png', "") self.notificationImage.width = 800 self.notificationImage.height = 196 self.notificationImage.top = (rpg.settings.screen_height) - 331 self.notificationImage.left = 99.995 self.notificationImage.border = True self.infoBox = square(rpg) self.infoBox.width = 266.67 self.infoBox.height = 196 self.infoBox.top = (rpg.settings.screen_height) - 331 self.infoBox.left = 99.995 self.okButton = Button(rpg, "Ok") self.okButton.width = 266.67 self.okButton.height = 40 self.okButton.top = (rpg.settings.screen_height) - 135 self.okButton.left = 99.995 self.equipButton = Button(rpg, "Equip") self.equipButton.width = 266.67 self.equipButton.height = 40 self.equipButton.top = (rpg.settings.screen_height) - 135 self.equipButton.left = 366.66 self.deleteButton = Button(rpg, "Delete") self.deleteButton.width = 266.67 self.deleteButton.height = 40 self.deleteButton.top = (rpg.settings.screen_height) - 135 self.deleteButton.left = 633.33 self.infoShow = False self.equipItem = None self.blackScreen = Button(rpg, "") self.blackScreen.width = 999.99 self.blackScreen.height = 420 self.blackScreen.top = rpg.settings.screen_height - 420 self.blackScreen.left = 0 self.blackScreen.clickable = False self.weapons = rpg.player.weapons self.weapon_inventory = rpg.player.weapon_inventory self.armors = rpg.player.armors self.armor_inventory = rpg.player.armor_inventory self.buffs = rpg.player.buffs self.buff_inventory = rpg.player.buff_inventory self.miscs = rpg.player.miscs self.misc_inventory = rpg.player.misc_inventory self.quest_items = rpg.player.quest_items self.quest_inventory = rpg.player.quest_inventory self.set = 0 self.list = self.weapon_inventory self.inventory = "Weapon Inventory" self.namelist = self.weapons self.msgList = [] self.iconList = [] self.infoList = [] self.icon1 = image(rpg, self.get(self.set + 1, "Icon"), "") self.icon1.inventoryDefault(rpg, -360, 0) self.box1 = Button(rpg, self.get(self.set + 1, "Msg")) self.box1.inventoryDefault(rpg, -360, 0) self.icon2 = image(rpg, self.get(self.set + 2, "Icon"), "") self.icon2.inventoryDefault(rpg, -300, 0) self.box2 = Button(rpg, self.get(self.set + 2, "Msg")) self.box2.inventoryDefault(rpg, -300, 0) self.icon3 = image(rpg, self.get(self.set + 3, "Icon"), "") self.icon3.inventoryDefault(rpg, -240, 0) self.box3 = Button(rpg, self.get(self.set + 3, "Msg")) self.box3.inventoryDefault(rpg, -240, 0) self.icon4 = image(rpg, self.get(self.set + 4, "Icon"), "") self.icon4.inventoryDefault(rpg, -180, 0) self.box4 = Button(rpg, self.get(self.set + 4, "Msg")) self.box4.inventoryDefault(rpg, -180, 0) self.icon5 = image(rpg, self.get(self.set + 5, "Icon"), "") self.icon5.inventoryDefault(rpg, -120, 0) self.box5 = Button(rpg, self.get(self.set + 5, "Msg")) self.box5.inventoryDefault(rpg, -120, 0) self.icon6 = image(rpg, self.get(self.set + 6, "Icon"), "") self.icon6.inventoryDefault(rpg, -60, 0) self.box6 = Button(rpg, self.get(self.set + 6, "Msg")) self.box6.inventoryDefault(rpg, -60, 0) self.icon7 = image(rpg, self.get(self.set + 7, "Icon"), "") self.icon7.inventoryDefault(rpg, -360, 333.33) self.box7 = Button(rpg, self.get(self.set + 7, "Msg")) self.box7.inventoryDefault(rpg, -360, 333.33) self.icon8 = image(rpg, self.get(self.set + 8, "Icon"), "") self.icon8.inventoryDefault(rpg, -300, 333.33) self.box8 = Button(rpg, self.get(self.set + 8, "Msg")) self.box8.inventoryDefault(rpg, -300, 333.33) self.icon9 = image(rpg, self.get(self.set + 9, "Icon"), "") self.icon9.inventoryDefault(rpg, -240, 333.33) self.box9 = Button(rpg, self.get(self.set + 9, "Msg")) self.box9.inventoryDefault(rpg, -240, 333.33) self.icon10 = image(rpg, self.get(self.set + 10, "Icon"), "") self.icon10.inventoryDefault(rpg, -180, 333.33) self.box10 = Button(rpg, self.get(self.set + 10, "Msg")) self.box10.inventoryDefault(rpg, -180, 333.33) self.icon11 = image(rpg, self.get(self.set + 11, "Icon"), "") self.icon11.inventoryDefault(rpg, -120, 333.33) self.box11 = Button(rpg, self.get(self.set + 11, "Msg")) self.box11.inventoryDefault(rpg, -120, 333.33) self.icon12 = image(rpg, self.get(self.set + 12, "Icon"), "") self.icon12.inventoryDefault(rpg, -60, 333.33) self.box12 = Button(rpg, self.get(self.set + 12, "Msg")) self.box12.inventoryDefault(rpg, -60, 333.33) self.icon13 = image(rpg, self.get(self.set + 13, "Icon"), "") self.icon13.inventoryDefault(rpg, -360, 666.67) self.box13 = Button(rpg, self.get(self.set + 13, "Msg")) self.box13.inventoryDefault(rpg, -360, 666.67) self.icon14 = image(rpg, self.get(self.set + 14, "Icon"), "") self.icon14.inventoryDefault(rpg, -300, 666.67) self.box14 = Button(rpg, self.get(self.set + 14, "Msg")) self.box14.inventoryDefault(rpg, -300, 666.67) self.icon15 = image(rpg, self.get(self.set + 15, "Icon"), "") self.icon15.inventoryDefault(rpg, -240, 666.67) self.box15 = Button(rpg, self.get(self.set + 15, "Msg")) self.box15.inventoryDefault(rpg, -240, 666.67) self.icon16 = image(rpg, self.get(self.set + 16, "Icon"), "") self.icon16.inventoryDefault(rpg, -180, 666.67) self.box16 = Button(rpg, self.get(self.set + 16, "Msg")) self.box16.inventoryDefault(rpg, -180, 666.67) self.icon17 = image(rpg, self.get(self.set + 17, "Icon"), "") self.icon17.inventoryDefault(rpg, -120, 666.67) self.box17 = Button(rpg, self.get(self.set + 17, "Msg")) self.box17.inventoryDefault(rpg, -120, 666.67) self.icon18 = image(rpg, self.get(self.set + 18, "Icon"), "") self.icon18.inventoryDefault(rpg, -60, 666.67) self.box18 = Button(rpg, self.get(self.set + 18, "Msg")) self.box18.inventoryDefault(rpg, -60, 666.67) self.weaponTag = image( rpg, 'CREATE Task Folder\Image Assets\GUI_images\WeaponTag.png', "Weapon Inventory" ) #pylint: disable = anomalous-backslash-in-string self.weaponTag.tagDefault(rpg, 0) self.armorTag = image( rpg, 'CREATE Task Folder\Image Assets\GUI_images\ArmorTag.png', "Armor Inventory" ) #pylint: disable = anomalous-backslash-in-string self.armorTag.tagDefault(rpg, 180) self.buffTag = image( rpg, 'CREATE Task Folder\Image Assets\GUI_images\BuffTag.png', "Buff Inventory") #pylint: disable = anomalous-backslash-in-string self.buffTag.tagDefault(rpg, 360) self.miscTag = image( rpg, 'CREATE Task Folder\Image Assets\GUI_images\MiscTag.png', "Misc Inventory") #pylint: disable = anomalous-backslash-in-string self.miscTag.tagDefault(rpg, 540) self.questTag = image( rpg, 'CREATE Task Folder\Image Assets\GUI_images\QuestTag.png', "Quest Inventory" ) #pylint: disable = anomalous-backslash-in-string self.questTag.tagDefault(rpg, 720) self.gold = image( rpg, 'CREATE Task Folder\Image Assets\GUI_images\GoldTag.png', "Gold: {}".format(rpg.player.gold) ) #pylint: disable = anomalous-backslash-in-string self.gold.tagDefault(rpg, 899.99) self.gold.width = 100 self.gold.clickable = False
class Inventory: def __init__(self, rpg): self.upArrow = image( rpg, 'CREATE Task Folder\Image Assets\GUI_images\Arrow.png', "") #pylint: disable = anomalous-backslash-in-string self.upArrow.width = 50 self.upArrow.height = 210 self.upArrow.top = (rpg.settings.screen_height) - ( self.upArrow.height * 2) self.upArrow.left = 1000 self.upArrow.clickable = True self.upArrow.border = True self.downArrow = image( rpg, 'CREATE Task Folder\Image Assets\GUI_images\downArrow.png', "") #pylint: disable = anomalous-backslash-in-string self.downArrow.width = 50 self.downArrow.height = 210 self.downArrow.top = ( rpg.settings.screen_height) - self.downArrow.height self.downArrow.left = 1000 self.downArrow.border = True self.downArrow.clickable = True self.notificationImage = image( rpg, 'CREATE Task Folder\Image Assets\Weapon_Images\Copper Sword Info.png', "") self.notificationImage.width = 800 self.notificationImage.height = 196 self.notificationImage.top = (rpg.settings.screen_height) - 331 self.notificationImage.left = 99.995 self.notificationImage.border = True self.infoBox = square(rpg) self.infoBox.width = 266.67 self.infoBox.height = 196 self.infoBox.top = (rpg.settings.screen_height) - 331 self.infoBox.left = 99.995 self.okButton = Button(rpg, "Ok") self.okButton.width = 266.67 self.okButton.height = 40 self.okButton.top = (rpg.settings.screen_height) - 135 self.okButton.left = 99.995 self.equipButton = Button(rpg, "Equip") self.equipButton.width = 266.67 self.equipButton.height = 40 self.equipButton.top = (rpg.settings.screen_height) - 135 self.equipButton.left = 366.66 self.deleteButton = Button(rpg, "Delete") self.deleteButton.width = 266.67 self.deleteButton.height = 40 self.deleteButton.top = (rpg.settings.screen_height) - 135 self.deleteButton.left = 633.33 self.infoShow = False self.equipItem = None self.blackScreen = Button(rpg, "") self.blackScreen.width = 999.99 self.blackScreen.height = 420 self.blackScreen.top = rpg.settings.screen_height - 420 self.blackScreen.left = 0 self.blackScreen.clickable = False self.weapons = rpg.player.weapons self.weapon_inventory = rpg.player.weapon_inventory self.armors = rpg.player.armors self.armor_inventory = rpg.player.armor_inventory self.buffs = rpg.player.buffs self.buff_inventory = rpg.player.buff_inventory self.miscs = rpg.player.miscs self.misc_inventory = rpg.player.misc_inventory self.quest_items = rpg.player.quest_items self.quest_inventory = rpg.player.quest_inventory self.set = 0 self.list = self.weapon_inventory self.inventory = "Weapon Inventory" self.namelist = self.weapons self.msgList = [] self.iconList = [] self.infoList = [] self.icon1 = image(rpg, self.get(self.set + 1, "Icon"), "") self.icon1.inventoryDefault(rpg, -360, 0) self.box1 = Button(rpg, self.get(self.set + 1, "Msg")) self.box1.inventoryDefault(rpg, -360, 0) self.icon2 = image(rpg, self.get(self.set + 2, "Icon"), "") self.icon2.inventoryDefault(rpg, -300, 0) self.box2 = Button(rpg, self.get(self.set + 2, "Msg")) self.box2.inventoryDefault(rpg, -300, 0) self.icon3 = image(rpg, self.get(self.set + 3, "Icon"), "") self.icon3.inventoryDefault(rpg, -240, 0) self.box3 = Button(rpg, self.get(self.set + 3, "Msg")) self.box3.inventoryDefault(rpg, -240, 0) self.icon4 = image(rpg, self.get(self.set + 4, "Icon"), "") self.icon4.inventoryDefault(rpg, -180, 0) self.box4 = Button(rpg, self.get(self.set + 4, "Msg")) self.box4.inventoryDefault(rpg, -180, 0) self.icon5 = image(rpg, self.get(self.set + 5, "Icon"), "") self.icon5.inventoryDefault(rpg, -120, 0) self.box5 = Button(rpg, self.get(self.set + 5, "Msg")) self.box5.inventoryDefault(rpg, -120, 0) self.icon6 = image(rpg, self.get(self.set + 6, "Icon"), "") self.icon6.inventoryDefault(rpg, -60, 0) self.box6 = Button(rpg, self.get(self.set + 6, "Msg")) self.box6.inventoryDefault(rpg, -60, 0) self.icon7 = image(rpg, self.get(self.set + 7, "Icon"), "") self.icon7.inventoryDefault(rpg, -360, 333.33) self.box7 = Button(rpg, self.get(self.set + 7, "Msg")) self.box7.inventoryDefault(rpg, -360, 333.33) self.icon8 = image(rpg, self.get(self.set + 8, "Icon"), "") self.icon8.inventoryDefault(rpg, -300, 333.33) self.box8 = Button(rpg, self.get(self.set + 8, "Msg")) self.box8.inventoryDefault(rpg, -300, 333.33) self.icon9 = image(rpg, self.get(self.set + 9, "Icon"), "") self.icon9.inventoryDefault(rpg, -240, 333.33) self.box9 = Button(rpg, self.get(self.set + 9, "Msg")) self.box9.inventoryDefault(rpg, -240, 333.33) self.icon10 = image(rpg, self.get(self.set + 10, "Icon"), "") self.icon10.inventoryDefault(rpg, -180, 333.33) self.box10 = Button(rpg, self.get(self.set + 10, "Msg")) self.box10.inventoryDefault(rpg, -180, 333.33) self.icon11 = image(rpg, self.get(self.set + 11, "Icon"), "") self.icon11.inventoryDefault(rpg, -120, 333.33) self.box11 = Button(rpg, self.get(self.set + 11, "Msg")) self.box11.inventoryDefault(rpg, -120, 333.33) self.icon12 = image(rpg, self.get(self.set + 12, "Icon"), "") self.icon12.inventoryDefault(rpg, -60, 333.33) self.box12 = Button(rpg, self.get(self.set + 12, "Msg")) self.box12.inventoryDefault(rpg, -60, 333.33) self.icon13 = image(rpg, self.get(self.set + 13, "Icon"), "") self.icon13.inventoryDefault(rpg, -360, 666.67) self.box13 = Button(rpg, self.get(self.set + 13, "Msg")) self.box13.inventoryDefault(rpg, -360, 666.67) self.icon14 = image(rpg, self.get(self.set + 14, "Icon"), "") self.icon14.inventoryDefault(rpg, -300, 666.67) self.box14 = Button(rpg, self.get(self.set + 14, "Msg")) self.box14.inventoryDefault(rpg, -300, 666.67) self.icon15 = image(rpg, self.get(self.set + 15, "Icon"), "") self.icon15.inventoryDefault(rpg, -240, 666.67) self.box15 = Button(rpg, self.get(self.set + 15, "Msg")) self.box15.inventoryDefault(rpg, -240, 666.67) self.icon16 = image(rpg, self.get(self.set + 16, "Icon"), "") self.icon16.inventoryDefault(rpg, -180, 666.67) self.box16 = Button(rpg, self.get(self.set + 16, "Msg")) self.box16.inventoryDefault(rpg, -180, 666.67) self.icon17 = image(rpg, self.get(self.set + 17, "Icon"), "") self.icon17.inventoryDefault(rpg, -120, 666.67) self.box17 = Button(rpg, self.get(self.set + 17, "Msg")) self.box17.inventoryDefault(rpg, -120, 666.67) self.icon18 = image(rpg, self.get(self.set + 18, "Icon"), "") self.icon18.inventoryDefault(rpg, -60, 666.67) self.box18 = Button(rpg, self.get(self.set + 18, "Msg")) self.box18.inventoryDefault(rpg, -60, 666.67) self.weaponTag = image( rpg, 'CREATE Task Folder\Image Assets\GUI_images\WeaponTag.png', "Weapon Inventory" ) #pylint: disable = anomalous-backslash-in-string self.weaponTag.tagDefault(rpg, 0) self.armorTag = image( rpg, 'CREATE Task Folder\Image Assets\GUI_images\ArmorTag.png', "Armor Inventory" ) #pylint: disable = anomalous-backslash-in-string self.armorTag.tagDefault(rpg, 180) self.buffTag = image( rpg, 'CREATE Task Folder\Image Assets\GUI_images\BuffTag.png', "Buff Inventory") #pylint: disable = anomalous-backslash-in-string self.buffTag.tagDefault(rpg, 360) self.miscTag = image( rpg, 'CREATE Task Folder\Image Assets\GUI_images\MiscTag.png', "Misc Inventory") #pylint: disable = anomalous-backslash-in-string self.miscTag.tagDefault(rpg, 540) self.questTag = image( rpg, 'CREATE Task Folder\Image Assets\GUI_images\QuestTag.png', "Quest Inventory" ) #pylint: disable = anomalous-backslash-in-string self.questTag.tagDefault(rpg, 720) self.gold = image( rpg, 'CREATE Task Folder\Image Assets\GUI_images\GoldTag.png', "Gold: {}".format(rpg.player.gold) ) #pylint: disable = anomalous-backslash-in-string self.gold.tagDefault(rpg, 899.99) self.gold.width = 100 self.gold.clickable = False def get(self, number, what): if what == "Msg": stack = 0 msg = "" msgThere = False try: while msgThere == False: msg = self.namelist[number - 1] if msg not in self.msgList: stack = stack + self.namelist.count(msg) self.msgList.append(msg) msgThere = True return ("{} x{}".format(msg, stack)) else: number = number + 1 except Exception: return ("") elif what == "Icon": icon = "" iconThere = False try: while iconThere == False: icon = self.list[number - 1].icon if icon not in self.iconList: self.iconList.append(icon) iconThere = True return (icon) else: number = number + 1 except Exception: return ('CREATE Task Folder\Image Assets\Transparent.png') elif what == "Info": info = "" infoThere = False try: while infoThere == False: info = self.list[number - 1].info if info not in self.infoList: self.infoList.append(info) infoThere = True self.equipItem = self.list[number - 1] return (info) else: number = number + 1 except Exception: return ('CREATE Task Folder\Image Assets\Transparent.png') def mouseEvents(self, rpg, mous_pos): if self.downArrow.rect.collidepoint(mous_pos): self.set = self.set + 18 if self.set > 90: self.set = 0 if self.upArrow.rect.collidepoint(mous_pos): self.set = self.set - 18 if self.set < 0: self.set = 0 if self.weaponTag.rect.collidepoint(mous_pos): self.list = self.weapon_inventory self.inventory = "Weapon Inventory" self.namelist = self.weapons self.set = 0 if self.armorTag.rect.collidepoint(mous_pos): self.list = self.armor_inventory self.inventory = "Armor Inventory" self.namelist = self.armors self.set = 0 if self.buffTag.rect.collidepoint(mous_pos): self.list = self.buff_inventory self.inventory = "Buff Inventory" self.namelist = self.buffs self.set = 0 if self.miscTag.rect.collidepoint(mous_pos): self.list = self.misc_inventory self.inventory = "Misc Inventory" self.namelist = self.miscs self.set = 0 if self.questTag.rect.collidepoint(mous_pos): self.list = self.quest_inventory self.inventory = "Quest Inventory" self.namelist = self.quest_items self.set = 0 if self.box1.rect.collidepoint(mous_pos): self.info(self.set + 1) if self.okButton.rect.collidepoint(mous_pos) and self.infoShow == True: self.infoShow = False if self.equipButton.rect.collidepoint( mous_pos) and self.infoShow == True: try: if self.equipButton.msg == "Equip": rpg.player.weapon_equipped = self.equipItem elif self.equipButton.msg == "Use": rpg.player.useBuff(self.equipItem) except Exception: pass self.infoShow = False if self.deleteButton.rect.collidepoint( mous_pos) and self.infoShow == True: try: rpg.player.deleteInventory(self.inventory, self.equipItem) except Exception: pass self.infoShow = False self.update(rpg) def info(self, number): self.infoShow = True if self.list == self.weapon_inventory or self.list == self.armor_inventory: self.notificationImage.image = pygame.image.load( self.get(number, "Info")) self.equipButton.msg = "Equip" elif self.list == self.buff_inventory: self.equipButton.msg = "Use" self.notificationImage.image = pygame.image.load( self.get(number, "Info")) elif self.list == self.misc_inventory or self.list == self.quest_inventory: self.equipButton.msg = "" self.notificationImage.image = pygame.image.load( self.get(number, "Info")) def update(self, rpg): self.msgList = [] self.iconList = [] self.infoList = [] self.gold.msg = ("Gold: {}".format(rpg.player.gold)) self.box1.msg = self.get(self.set + 1, "Msg") self.icon1.image = pygame.image.load(self.get(self.set + 1, "Icon")).convert_alpha() self.box2.msg = self.get(self.set + 2, "Msg") self.icon2.image = pygame.image.load(self.get(self.set + 2, "Icon")).convert_alpha() self.box3.msg = self.get(self.set + 3, "Msg") self.icon3.image = pygame.image.load(self.get(self.set + 3, "Icon")).convert_alpha() self.box4.msg = self.get(self.set + 4, "Msg") self.icon4.image = pygame.image.load(self.get(self.set + 4, "Icon")).convert_alpha() self.box5.msg = self.get(self.set + 5, "Msg") self.icon5.image = pygame.image.load(self.get(self.set + 5, "Icon")).convert_alpha() self.box6.msg = self.get(self.set + 6, "Msg") self.icon6.image = pygame.image.load(self.get(self.set + 6, "Icon")).convert_alpha() self.box7.msg = self.get(self.set + 7, "Msg") self.icon7.image = pygame.image.load(self.get(self.set + 7, "Icon")).convert_alpha() self.box8.msg = self.get(self.set + 8, "Msg") self.icon8.image = pygame.image.load(self.get(self.set + 8, "Icon")).convert_alpha() self.box9.msg = self.get(self.set + 9, "Msg") self.icon9.image = pygame.image.load(self.get(self.set + 9, "Icon")).convert_alpha() self.box10.msg = self.get(self.set + 10, "Msg") self.icon10.image = pygame.image.load(self.get( self.set + 10, "Icon")).convert_alpha() self.box11.msg = self.get(self.set + 11, "Msg") self.icon11.image = pygame.image.load(self.get( self.set + 11, "Icon")).convert_alpha() self.box12.msg = self.get(self.set + 12, "Msg") self.icon12.image = pygame.image.load(self.get( self.set + 12, "Icon")).convert_alpha() self.box13.msg = self.get(self.set + 13, "Msg") self.icon13.image = pygame.image.load(self.get( self.set + 13, "Icon")).convert_alpha() self.box14.msg = self.get(self.set + 14, "Msg") self.icon14.image = pygame.image.load(self.get( self.set + 14, "Icon")).convert_alpha() self.box15.msg = self.get(self.set + 15, "Msg") self.icon15.image = pygame.image.load(self.get( self.set + 15, "Icon")).convert_alpha() self.box16.msg = self.get(self.set + 16, "Msg") self.icon16.image = pygame.image.load(self.get( self.set + 16, "Icon")).convert_alpha() self.box17.msg = self.get(self.set + 17, "Msg") self.icon17.image = pygame.image.load(self.get( self.set + 17, "Icon")).convert_alpha() self.box18.msg = self.get(self.set + 18, "Msg") self.icon18.image = pygame.image.load(self.get( self.set + 18, "Icon")).convert_alpha() self.weapons = rpg.player.weapons self.weapon_inventory = rpg.player.weapon_inventory self.armors = rpg.player.armors self.armor_inventory = rpg.player.armor_inventory self.buffs = rpg.player.buffs self.buff_inventory = rpg.player.buff_inventory self.miscs = rpg.player.miscs self.misc_inventory = rpg.player.misc_inventory self.quest_items = rpg.player.quest_items self.quest_inventory = rpg.player.quest_inventory def draw(self, rpg): self.upArrow.draw() self.downArrow.draw() self.box1.draw() self.icon1.draw() self.box2.draw() self.icon2.draw() self.box3.draw() self.icon3.draw() self.box4.draw() self.icon4.draw() self.box5.draw() self.icon5.draw() self.box6.draw() self.icon6.draw() self.box7.draw() self.icon7.draw() self.box8.draw() self.icon8.draw() self.box9.draw() self.icon9.draw() self.box10.draw() self.icon10.draw() self.box11.draw() self.icon11.draw() self.box12.draw() self.icon12.draw() self.box13.draw() self.icon13.draw() self.box14.draw() self.icon14.draw() self.box15.draw() self.icon15.draw() self.box16.draw() self.icon16.draw() self.box17.draw() self.icon17.draw() self.box18.draw() self.icon18.draw() self.weaponTag.draw() self.armorTag.draw() self.buffTag.draw() self.miscTag.draw() self.questTag.draw() self.gold.draw() if self.infoShow == True: self.blackScreen.draw() self.okButton.draw() self.deleteButton.draw() self.equipButton.draw() self.notificationImage.draw() self.infoBox.draw()
def __init__(self, rpg): self.hpStat = Button(rpg, "HP: {}/{}".format(rpg.player.hp, rpg.player.maxhp)) self.hpStat.statDefault(rpg, -420, 0) self.stamStat = Button(rpg, "Stamina: {}/{}".format(rpg.player.stamina, rpg.player.stamina_max)) self.stamStat.statDefault(rpg, -350, 0) self.manaStat = Button(rpg, "Mana: {}/{}".format(rpg.player.mana, rpg.player.mana_max)) self.manaStat.statDefault(rpg, -280, 0) self.speedStat = Button(rpg, "Speed: {}".format(rpg.player.speed)) self.speedStat.statDefault(rpg, -210, 0) self.physAtckStat = Button(rpg, "Physical Attack: {}".format(rpg.player.physical_attack)) self.physAtckStat.statDefault(rpg, -140, 0) self.magicAtckStat = Button(rpg, "Magic Attack: {}".format(rpg.player.magic_attack)) self.magicAtckStat.statDefault(rpg, -70, 0) self.physDefStat = Button(rpg, "Physical Defense: {}".format(rpg.player.physical_defense)) self.physDefStat.statDefault(rpg, -420, 350) self.magicDefStat = Button(rpg, "Magic Defense: {}".format(rpg.player.magic_defense)) self.magicDefStat.statDefault(rpg, -350, 350) self.fireResist = Button(rpg, "Fire Resistance: {}".format(rpg.player.fire_resist)) self.fireResist.statDefault(rpg, -280, 350) self.poisonResist = Button(rpg, "Poison Resistance: {}".format(rpg.player.poison_resist)) self.poisonResist.statDefault(rpg, -210, 350) self.waterResist = Button(rpg, "Water Resistance: {}".format(rpg.player.water_resist)) self.waterResist.statDefault(rpg, -140, 350) self.earthResist = Button(rpg, "Earth Resistance: {}".format(rpg.player.earth_resist)) self.earthResist.statDefault(rpg, -70, 350) self.windResist = Button(rpg, "Wind Resistance: {}".format(rpg.player.wind_resist)) self.windResist.statDefault(rpg, -420, 700) self.evasion = Button(rpg, "Evasion: {}".format(rpg.player.evasion)) self.evasion.statDefault(rpg, -350, 700) self.accuracyStat = Button(rpg, "Accuracy: {}".format(rpg.player.accuracy)) self.accuracyStat.statDefault(rpg, -280, 700) self.critStat = Button(rpg, "Crit Chance: {}".format(rpg.player.crit_chance)) self.critStat.statDefault(rpg, -210, 700) self.critMult = Button(rpg, "Crit Multiplier: {}".format(rpg.player.crit_mult)) self.critMult.statDefault(rpg, -140, 700) self.luckStat = Button(rpg, "Luck: {}".format(rpg.player.luck)) self.luckStat.statDefault(rpg, -70, 700)
class playerConsole: def __init__(self, rpg): self.clicked = False self.newSlot = 0 self.slot1Taken = 0 self.slot2Taken = 0 self.slot3Taken = 0 self.slot4Taken = 0 self.slot5Taken = 0 self.icon5 = image(rpg, "CREATE Task Folder\Image Assets\Transparent.png", "") self.icon5.consoleDefault(rpg, 0) self.slot5 = Button(rpg, "") self.slot5.consoleTextDefault(rpg, 0) self.icon4 = image(rpg, "CREATE Task Folder\Image Assets\Transparent.png", "") self.icon4.consoleDefault(rpg, 132) self.slot4 = Button(rpg, "") self.slot4.consoleTextDefault(rpg, 132) self.icon3 = image(rpg, "CREATE Task Folder\Image Assets\Transparent.png", "") self.icon3.consoleDefault(rpg, 264) self.slot3 = Button(rpg, "") self.slot3.consoleTextDefault(rpg, 264) self.icon2 = image(rpg, "CREATE Task Folder\Image Assets\Transparent.png", "") self.icon2.consoleDefault(rpg, 396) self.slot2 = Button(rpg, "") self.slot2.consoleTextDefault(rpg, 396) self.icon1 = image(rpg, "CREATE Task Folder\Image Assets\Transparent.png", "") self.icon1.consoleDefault(rpg, 528) self.slot1 = Button(rpg, "") self.slot1.consoleTextDefault(rpg, 528) self.arrow = image(rpg, "CREATE Task Folder\Image Assets\Transparent.png", "") self.arrow.width, self.arrow.height = 80, 60 self.arrow.top, self.arrow.left = 600, 970 self.arrow.transparent = True def drawConsole(self): self.slot1.draw() self.icon1.draw() self.slot2.draw() self.icon2.draw() self.slot3.draw() self.icon3.draw() self.slot4.draw() self.icon4.draw() self.slot5.draw() self.icon5.draw() if self.clicked == False: self.arrow.draw() def showNextText(self, rpg, nextText, nextTextPart2, nextIcon): self.slot5.msg = self.slot4.msg self.slot5.msg2 = self.slot4.msg2 self.icon5.image = self.icon4.image self.slot4.msg = self.slot3.msg self.slot4.msg2 = self.slot3.msg2 self.icon4.image = self.icon3.image self.slot3.msg = self.slot2.msg self.slot3.msg2 = self.slot2.msg2 self.icon3.image = self.icon2.image self.slot2.msg = self.slot1.msg self.slot2.msg2 = self.slot1.msg2 self.icon2.image = self.icon1.image self.slot1.msg = nextText self.slot1.msg2 = nextTextPart2 self.icon1.image = nextIcon while self.clicked == False: self.mouseEvents(rpg) rpg._update_screen() self.clicked = False def mouseEvents(self, rpg): for event in pygame.event.get(): if event.type == pygame.MOUSEBUTTONDOWN: mous_pos = pygame.mouse.get_pos() if rpg.borders.mapSquare.rect.collidepoint(mous_pos): self.clicked = True def resetConsole(self): self.slot5.msg = "" self.slot4.msg = "" self.slot3.msg = "" self.slot2.msg = "" self.slot1.msg = "" self.slot5.msg2 = "" self.slot4.msg2 = "" self.slot3.msg2 = "" self.slot2.msg2 = "" self.slot1.msg2 = ""
def __init__(self, rpg): self.choice1 = Button(rpg, "") self.choice1.choiceDefault(rpg, 0) self.choice2 = Button(rpg, "") self.choice2.choiceDefault(rpg, -70) self.choice3 = Button(rpg, "") self.choice3.choiceDefault(rpg, -140) self.choice4 = Button(rpg, "") self.choice4.choiceDefault(rpg, -210) self.choice5 = Button(rpg, "") self.choice5.choiceDefault(rpg, -280) self.choice6 = Button(rpg, "") self.choice6.choiceDefault(rpg, -350)
class choiceButtons(): def __init__(self, rpg): self.choice1 = Button(rpg, "") self.choice1.choiceDefault(rpg, 0) self.choice2 = Button(rpg, "") self.choice2.choiceDefault(rpg, -70) self.choice3 = Button(rpg, "") self.choice3.choiceDefault(rpg, -140) self.choice4 = Button(rpg, "") self.choice4.choiceDefault(rpg, -210) self.choice5 = Button(rpg, "") self.choice5.choiceDefault(rpg, -280) self.choice6 = Button(rpg, "") self.choice6.choiceDefault(rpg, -350) def draw(self): self.choice1.draw() self.choice2.draw() self.choice3.draw() self.choice4.draw() self.choice5.draw() self.choice6.draw() def editChoices(self, choice1Text, choice2Text, choice3Text, choice4Text, choice5Text, choice6Text): self.choice1.msg = choice1Text self.choice2.msg = choice2Text self.choice3.msg = choice3Text self.choice4.msg = choice4Text self.choice5.msg = choice5Text self.choice6.msg = choice6Text def mouseEvents(self, rpg, mous_pos): if self.choice1.rect.collidepoint(mous_pos): rpg.playerConsole.newSlot = 1 rpg.playerConsole.showNextText("", "No") rpg.playerConsole.newSlot = 0
def __init__(self, rpg): self.playerIcon = image(rpg, rpg.player.icon, rpg.player.name)#pylint: disable = anomalous-backslash-in-string self.playerIcon.iconDefault(rpg, -315) self.playerSquare = square(rpg) self.playerSquare.combatDefault(rpg, -315) self.playerAttack = Button(rpg, "Attack") self.playerAttack.combatDefault(rpg, -367.5, 0) self.playerDefend = Button(rpg, "Defend") self.playerDefend.combatDefault(rpg, -367.5, 205) self.playerRest = Button(rpg, "Rest") self.playerRest.combatDefault(rpg, -315, 0) self.playerUse = Button(rpg, "Use Item") self.playerUse.combatDefault(rpg, -315, 205) self.equipped_allies = rpg.player.equipped_allies try: if self.equipped_allies[0]: #self.ally1Icon = image(rpg, rpg.player.equipped_allies[0].icon, rpg.player.equipped_allies[0].name) #self.ally1Icon.iconDefault(rpg, -210) self.ally1Square = square(rpg) self.ally1Square.combatDefault(rpg, -210) self.ally1Attack = Button(rpg, "Attack") self.ally1Attack.combatDefault(rpg, -262.5, 0) self.ally1Defend = Button(rpg, "Defend") self.ally1Defend.combatDefault(rpg, -262.5, 205) self.ally1Rest = Button(rpg, "Rest") self.ally1Rest.combatDefault(rpg, -210, 0) self.ally1Use = Button(rpg, "Use Item") self.ally1Use.combatDefault(rpg, -210, 205) if self.equipped_allies[1]: #self.ally2Icon = image(rpg, rpg.player.equipped_allies[1].icon, rpg.player.equipped_allies[1].name) #self.ally2Icon.iconDefault(rpg, -105) self.ally2Square = square(rpg) self.ally2Square.combatDefault(rpg, -105) self.ally2Attack = Button(rpg, "Attack") self.ally2Attack.combatDefault(rpg, -157.5, 0) self.ally2Defend = Button(rpg, "Defend") self.ally2Defend.combatDefault(rpg, -157.5, 205) self.ally2Rest = Button(rpg, "Rest") self.ally2Rest.combatDefault(rpg, -105, 0) self.ally2Use = Button(rpg, "Use Item") self.ally2Use.combatDefault(rpg, -105, 205) if self.equipped_allies[2]: #self.ally3Icon = image(rpg, rpg.player.equipped_allies[2].icon, rpg.player.equipped_allies[2].name) #self.ally3Icon.iconDefault(rpg, 0) self.ally3Square = square(rpg) self.ally3Square.combatDefault(rpg, 0) self.ally3Attack = Button(rpg, "Attack") self.ally3Attack.combatDefault(rpg, -52.5, 0) self.ally3Defend = Button(rpg, "Defend") self.ally3Defend.combatDefault(rpg, -52.5, 205) self.ally3Rest = Button(rpg, "Rest") self.ally3Rest.combatDefault(rpg, 0, 0) self.ally3Use = Button(rpg, "Use Item") self.ally3Use.combatDefault(rpg, 0, 205) except: pass self.background = image(rpg, "CREATE Task Folder\Image Assets\Transparent.png", "") self.background.left, self.background.top = 0, 0 self.background.width, self.background.height = 1050, 660 self.enemyImage = image(rpg, self.enemy.image, "") self.enemyImage.left, self.enemyImage.top = 250, 220 self.enemyImage.width, self.enemyImage.height = 550, 420 self.enemyImage.transparent = True self.enemyInfo = Button(rpg, "{} - Level: {}".format(self.enemy.name, self.enemy.level)) self.enemyInfo.width, self.enemyInfo.height = 550, 35 self.enemyInfo.left, self.enemyInfo.top = 250, 80 self.enemyInfo.clickable = False self.enemyHP = Button(rpg, "HP: {}/{}".format(self.enemy.hp, self.enemy.maxhp)) self.enemyHP.width, self.enemyHP.height = 275, 35 self.enemyHP.left, self.enemyHP.top = 250, 115 self.enemyHP.transparent = True self.enemyHP.clickable = False self.enemyHPbar = Button(rpg, "") self.enemyHPbar.width, self.enemyHPbar.height = 275, 35 self.enemyHPbar.left, self.enemyHPbar.top = 250, 115 self.enemyHPbar.button_color = (200, 0, 0) self.enemyHPbar.text_color = (200, 0, 0) self.enemyHPbar.clickable = False self.enemyStamina = Button(rpg, "Stamina: {}/{}".format(self.enemy.stamina, self.enemy.stamina_max)) self.enemyStamina.width, self.enemyStamina.height = 275, 35 self.enemyStamina.left, self.enemyStamina.top = 525, 115 self.enemyStamina.transparent = True self.enemyStamina.clickable = False self.enemyStaminaBar = Button(rpg, "") self.enemyStaminaBar.width, self.enemyStaminaBar.height = 275, 35 self.enemyStaminaBar.left, self.enemyStaminaBar.top = 525, 115 self.enemyStaminaBar.button_color = (0, 200, 0) self.enemyStaminaBar.text_color = (0, 200, 0) self.enemyStaminaBar.clickable = False self.enemyMana = Button(rpg, "Mana: {}/{}".format(self.enemy.mana, self.enemy.mana_max)) self.enemyMana.width, self.enemyMana.height = 550, 35 self.enemyMana.left, self.enemyMana.top = 250, 150 self.enemyMana.transparent = True self.enemyMana.clickable = False self.enemyManaBar = Button(rpg, "") self.enemyManaBar.width, self.enemyManaBar.height = 550, 35 self.enemyManaBar.left, self.enemyManaBar.top = 250, 150 self.enemyManaBar.button_color = (0, 0, 200) self.enemyManaBar.text_color = (0, 0, 200) self.enemyManaBar.clickable = False self.enemyStats = False
class combatGUI: def __init__(self, rpg): self.playerIcon = image(rpg, rpg.player.icon, rpg.player.name)#pylint: disable = anomalous-backslash-in-string self.playerIcon.iconDefault(rpg, -315) self.playerSquare = square(rpg) self.playerSquare.combatDefault(rpg, -315) self.playerAttack = Button(rpg, "Attack") self.playerAttack.combatDefault(rpg, -367.5, 0) self.playerDefend = Button(rpg, "Defend") self.playerDefend.combatDefault(rpg, -367.5, 205) self.playerRest = Button(rpg, "Rest") self.playerRest.combatDefault(rpg, -315, 0) self.playerRunAway = Button(rpg, "Run Away") self.playerRunAway.combatDefault(rpg, -315, 205) self.equipped_allies = rpg.player.equipped_allies try: if self.equipped_allies[0]: self.ally1Icon = image(rpg, rpg.player.equipped_allies[0].icon, rpg.player.equipped_allies[0].name) self.ally1Icon.iconDefault(rpg, -210) self.ally1Square = square(rpg) self.ally1Square.combatDefault(rpg, -210) self.ally1Attack = Button(rpg, "Attack") self.ally1Attack.combatDefault(rpg, -262.5, 0) self.ally1Defend = Button(rpg, "Defend") self.ally1Defend.combatDefault(rpg, -262.5, 205) self.ally1Rest = Button(rpg, "Rest") self.ally1Rest.combatDefault(rpg, -210, 0) self.ally1runAway = Button(rpg, "Run Away") self.ally1runAway.combatDefault(rpg, -210, 205) if self.equipped_allies[1]: self.ally2Icon = image(rpg, rpg.player.equipped_allies[1].icon, rpg.player.equipped_allies[1].name) self.ally2Icon.iconDefault(rpg, -105) self.ally2Square = square(rpg) self.ally2Square.combatDefault(rpg, -105) self.ally2Attack = Button(rpg, "Attack") self.ally2Attack.combatDefault(rpg, -157.5, 0) self.ally2Defend = Button(rpg, "Defend") self.ally2Defend.combatDefault(rpg, -157.5, 205) self.ally2Rest = Button(rpg, "Rest") self.ally2Rest.combatDefault(rpg, -105, 0) self.ally2runAway = Button(rpg, "Run Away") self.ally2runAway.combatDefault(rpg, -105, 205) if self.equipped_allies[2]: self.ally3Icon = image(rpg, rpg.player.equipped_allies[2].icon, rpg.player.equipped_allies[2].name) self.ally3Icon.iconDefault(rpg, 0) self.ally3Square = square(rpg) self.ally3Square.combatDefault(rpg, 0) self.ally3Attack = Button(rpg, "Attack") self.ally3Attack.combatDefault(rpg, -52.5, 0) self.ally3Defend = Button(rpg, "Defend") self.ally3Defend.combatDefault(rpg, -52.5, 205) self.ally3Rest = Button(rpg, "Rest") self.ally3Rest.combatDefault(rpg, 0, 0) self.ally3runAway = Button(rpg, "Run Away") self.ally3runAway.combatDefault(rpg, 0, 205) except: pass self.background = image(rpg, "CREATE Task Folder\Image Assets\Transparent.png", "") self.background.left, self.background.top = 0, 0 self.background.width, self.background.height = 1050, 660 self.enemy = monster(rpg) self.enemy.goblin() self.enemyImage = image(rpg, self.enemy.image, "") self.enemyImage.left, self.enemyImage.top = 250, 220 self.enemyImage.width, self.enemyImage.height = 550, 420 self.enemyImage.transparent = True self.enemyInfo = Button(rpg, "{} - Level: {}".format(self.enemy.name, self.enemy.level)) self.enemyInfo.width, self.enemyInfo.height = 550, 35 self.enemyInfo.left, self.enemyInfo.top = 250, 80 self.enemyInfo.clickable = False self.enemyHP = Button(rpg, "HP: {}/{}".format(self.enemy.hp, self.enemy.maxhp)) self.enemyHP.width, self.enemyHP.height = 275, 35 self.enemyHP.left, self.enemyHP.top = 250, 115 self.enemyHP.transparent = True self.enemyHP.clickable = False self.enemyHPbar = Button(rpg, "") self.enemyHPbar.width, self.enemyHPbar.height = 275, 35 self.enemyHPbar.left, self.enemyHPbar.top = 250, 115 self.enemyHPbar.button_color = (200, 0, 0) self.enemyHPbar.text_color = (200, 0, 0) self.enemyHPbar.clickable = False self.enemyStamina = Button(rpg, "Stamina: {}/{}".format(self.enemy.stamina, self.enemy.stamina_max)) self.enemyStamina.width, self.enemyStamina.height = 275, 35 self.enemyStamina.left, self.enemyStamina.top = 525, 115 self.enemyStamina.transparent = True self.enemyStamina.clickable = False self.enemyStaminaBar = Button(rpg, "") self.enemyStaminaBar.width, self.enemyStaminaBar.height = 275, 35 self.enemyStaminaBar.left, self.enemyStaminaBar.top = 525, 115 self.enemyStaminaBar.button_color = (0, 200, 0) self.enemyStaminaBar.text_color = (0, 200, 0) self.enemyStaminaBar.clickable = False self.enemyMana = Button(rpg, "Mana: {}/{}".format(self.enemy.mana, self.enemy.mana_max)) self.enemyMana.width, self.enemyMana.height = 550, 35 self.enemyMana.left, self.enemyMana.top = 250, 150 self.enemyMana.transparent = True self.enemyMana.clickable = False self.enemyManaBar = Button(rpg, "") self.enemyManaBar.width, self.enemyManaBar.height = 550, 35 self.enemyManaBar.left, self.enemyManaBar.top = 250, 150 self.enemyManaBar.button_color = (0, 0, 200) self.enemyManaBar.text_color = (0, 0, 200) self.enemyManaBar.clickable = False self.enemyStats = True self.attack = False self.defend = False self.rest = False self.runAway = False self.battleOver = False self.increaseMonsterDefend = False self.increasePlayerDefend = False def mouseEvents(self, mous_pos): if self.enemyImage.rect.collidepoint(mous_pos): if self.enemyStats == False: self.enemyStats = True else: self.enemyStats = False if self.playerAttack.rect.collidepoint(mous_pos): self.attack = True if self.playerDefend.rect.collidepoint(mous_pos): self.defend = True if self.playerRest.rect.collidepoint(mous_pos): self.rest = True if self.playerRunAway.rect.collidepoint(mous_pos): self.runAway = True def update(self): self.enemyMana.msg = "Mana: {}/{}".format(self.enemy.mana, self.enemy.mana_max) try: if self.enemy.mana > 0: self.enemyManaBar.width = 275 * ((self.enemy.mana/self.enemy.mana_max)) else: self.enemyMana.msg = "Mana: 0/{}".format(self.enemy.mana_max) self.enemyManaBar.width = 0 self.enemyMana.transparent = False except Exception: self.enemyManaBar.width = 0 self.enemyMana.transparent = False self.enemyStamina.msg = "Stamina: {}/{}".format(self.enemy.stamina, self.enemy.stamina_max) try: if self.enemy.stamina > 0: self.enemyStaminaBar.width = 275 * ((self.enemy.stamina/self.enemy.stamina_max)) else: self.enemyStamina.msg = "Stamina: 0/{}".format(self.enemy.stamina_max) self.enemyStaminaBar.width = 0 self.enemyStamina.transparent = False except Exception: self.enemyStaminaBar.width = 0 self.enemyStamina.transparent = False self.enemyHP.msg = "HP: {}/{}".format(self.enemy.hp, self.enemy.maxhp) try: if self.enemy.hp > 0: self.enemyHPbar.width = 275 * ((self.enemy.hp/self.enemy.maxhp)) else: self.enemyHP.msg = "HP: 0/{}".format(self.enemy.maxhp) self.enemyHPbar.width = 0 self.enemyHP.transparent = False except Exception: self.enemyHPbar.width = 0 self.enemyHP.transparent = False self.enemyInfo.msg = "{} - Level: {}".format(self.enemy.name, self.enemy.level) self.enemyImage.image = pygame.image.load(self.enemy.image) def draw(self): self.update() self.background.draw() self.enemyImage.draw() self.playerIcon.draw() self.playerAttack.draw() self.playerDefend.draw() self.playerRest.draw() self.playerRunAway.draw() self.playerSquare.draw() try: if self.equipped_allies[0]: self.ally1Attack.draw() self.ally1Defend.draw() self.ally1Rest.draw() self.ally1runAway.draw() self.ally1Square.draw() if self.equipped_allies[1]: self.ally2Attack.draw() self.ally2Defend.draw() self.ally2Rest.draw() self.ally2runAway.draw() self.ally2Square.draw() if self.equipped_allies[2]: self.ally3Attack.draw() self.ally3Defend.draw() self.ally3Rest.draw() self.ally3runAway.draw() self.ally3Square.draw() except: pass if self.enemyStats == True: self.enemyInfo.draw() self.enemyHPbar.draw() self.enemyHP.draw() self.enemyStaminaBar.draw() self.enemyStamina.draw() self.enemyManaBar.draw() self.enemyMana.draw()