def genOpponent(MaxLevel): """Generates a monster with level chosen by user, max MaxLevel""" #If Player has won over a level 1 opponent, he's given choice of other #opponents up to his level (1..maximal level won + 1) if MaxLevel != 1: while 1: UI.printNow("Select monster level to battle (1.. " + str(MaxLevel) + " ): ") choice = UI.inputNumber() if (choice < 1) or (choice > MaxLevel): print("Invalid choice!") else: break else: choice = 1 #Generate a random monster of a given level Monster = Character.CharClass() Monster.generate(choice) Monster.Name = "Level " + str(Monster.Level) + " Monster" return Monster
Player.DEX = 19 Player.CON = 19 Player.MaxHealth = 1000 Player.Health = 1000 Player.calcModifiers() Player.Gold = 10000 def charGenRollForStats (): """Roll for player stats and display them""" global Player Player.generate() Player.showInfo() Player = Character.CharClass() Arena = BattleField.BattleFieldClass(Player) NewWorld = World.WorldClass() NewCell1 = World.CellClass() NewCell2 = World.CellClass() ToCell1 = World.CellExitClass() ToCell1.Name = "To Cell 1" ToCell1.Cell = NewCell1 ToCell2 = World.CellExitClass() ToCell2.Name = "To Cell 2" ToCell2.Cell = NewCell2 NewCell1.Name = "Cell 1" NewCell1.Exits = [ToCell2]