}, { 'item': elixir, 'quantity': 5 }, { 'item': megaelixir, 'quantity': 2 }, { 'item': grenade, 'quantity': 5 }] enemy1_spell = [fire, meteor, curaga] enemy_spell = [fire, meteor, cure] # instantiate players player1 = Person('Valos', 3260, 132, 300, 34, player_spell, player_items) player2 = Person('Blah', 4160, 188, 338, 34, player_spell, player_items) player3 = Person('Test', 3089, 174, 299, 34, player_spell, player_items) enemy1 = Person('Boss', 18200, 701, 525, 24, enemy1_spell, []) enemy2 = Person('Imp1', 1250, 130, 560, 325, enemy_spell, []) enemy3 = Person('Imp2', 1250, 130, 560, 325, enemy_spell, []) players = [player1, player2, player3] enemies = [enemy1, enemy2, enemy3] running = True i = 0 print(bcolors.FAIL + bcolors.BOLD + 'AN ENEMY ATTACKS!' + bcolors.ENDC) #end the style with ENDC
}, { "item": super_potion, "quantity": 5 }, { "item": elixir, "quantity": 5 }, { "item": hi_elixir, "quantity": 2 }, { "item": grenade, "quantity": 5 }] # Instantiate Players player1 = Person("Venom :", 3460, 123, 300, 34, player_spells, player_items) player2 = Person("Beast :", 4650, 135, 310, 34, player_spells, player_items) player3 = Person("Robot :", 2460, 167, 260, 34, player_spells, player_items) enemy1 = Person("Sagrus", 1250, 130, 560, 325, enemy_spells, []) enemy2 = Person("Thanos", 11200, 700, 650, 25, enemy_spells, []) enemy3 = Person("Netrus", 1250, 130, 560, 325, enemy_spells, []) players = [player1, player2, player3] enemies = [enemy1, enemy2, enemy3] running = True print(bColors.FAIL + bColors.BOLD + "Enemy attacks" + bColors.ENDC) while running:
# Create Items potion = Item("Potion", "potion", "Heals 50 HP", 50) hipotion = Item("Hi-Potion", "potion", "Heals 100 HP", 100) superpotion = Item("Super Potion", "potion", "Heals 350 HP", 350) elixer = Item("Elixer", "elixer", "Fully restores HP/MP of one party member", 9999) hielixer = Item("MegaElixer", "elixer", "Fully restores party's HP/MP", 9999) grenade = Item("Grenade", "attack", "Deals 500 damage", 500) player_magic = [fire, thunder, blizzard, meteor, cure, cura] enemy_magic = [fire, thunder, blizzard, cure] player_items = [{"item": potion, "quantity": 5}, {"item": elixer, "quantity": 2}, {"item": grenade, "quantity": 1}] player1 = Person("Bob ", 1500, 355, 166, 200, player_magic, player_items) player2 = Person("Dave ", 1800, 420, 150, 150, player_magic, player_items) player3 = Person("Monica ", 1990, 228, 250, 50, player_magic, player_items) enemy1 = Person("Ork ", 2500, 300, 100, 100, enemy_magic, []) enemy2 = Person("Roger ", 11000, 900, 520, 120, enemy_magic, []) enemy3 = Person("Ork ", 2500, 300, 100, 100, enemy_magic, []) players = [player1, player2, player3] enemies = [enemy1, enemy2, enemy3] running = True print(BColors.FAIL + BColors.BOLD + "AN ENEMY ATTACKS!" + BColors.ENDC) while running: print("================")
# Create Items potion = Item("Potion", "potion", 50, 10, "Heals for 50 HP") hipotion = Item("Hi-Potion", "potion", 500, 10, "Heals for 500 HP") elixer = Item("Elixer", "elixer", 9999, 5, "Fully restores your HP and MP") hielixer = Item("Hi-Elixer", "elixer", 9999, 5, "Fully restores your party's HP and MP") grenade = Item("Grenade", "attack", 500, 2, "Deals 500 damage") nuke = Item("Nuke", "attack", 2000, 3, "Deals 2000 damage") player_magic = [fire, thunder, blizzard, quake, meteor, cure, cura] player_items = [potion, hipotion, elixer, hielixer, grenade, nuke] enemy_magic = [fire, meteor, curaga] enemy_items = [potion, elixer, grenade] # Create People player1 = Person("Valos", 1000, 120, 200, 50, player_magic, player_items) player2 = Person("Malas", 1000, 120, 200, 50, player_magic, player_items) player3 = Person("Rotas", 1000, 120, 200, 50, player_magic, player_items) enemy1 = Person("Baddy", 1000, 120, 200, 50, enemy_magic, enemy_items) enemy2 = Person("Maddy", 1000, 120, 200, 50, enemy_magic, enemy_items) enemy3 = Person("Kaddy", 1000, 120, 200, 50, enemy_magic, enemy_items) players = [player1, player2, player3] enemies = [enemy1, enemy2, enemy3] print("RPG Battle Script") print() print("AN ENEMY ATTACKS!") print("Type 'exit' if you get bored!") print()
}, { "item": superpotion, "quantity": 1 }, { "item": elixir, "quantity": 3 }, { "item": hielixir, "quantity": 1 }, { "item": grenade, "quantity": 3 }] #instantiate people player1 = Person("Valos", 3260, 132, 300, 34, player_magic, player1_items) player2 = Person("Nick ", 4160, 176, 310, 34, player_magic, player2_items) player3 = Person("Robot", 3940, 168, 290, 34, player_magic, player3_items) enemy1 = Person("Magus", 17500, 130, 285, 25, player_magic, []) enemy2 = Person("Imper", 11200, 100, 340, 25, player_magic, []) enemy3 = Person("Impro", 11200, 100, 340, 25, player_magic, []) players = [player1, player2, player3] enemies = [enemy1, enemy2, enemy3] running = True i = 0 while running: print("===================================")
superpotion = Item("Super Potion", "potion", "Heals 500 HP", 500) elixir = Item("Elixir", "elixir", "Fully restores HP/MP of one party member", 9999) megaelixir = Item("Mega Elixir", "elixir", "Fully restores HP/MP of all party members", 9999) grenade = Item("Grenade", "attack", "Deals 500 points of damage", 500) # Instantiate People player_spells = [fire, thunder, blizzard, meteor, cure, cura] player_items = [{"item": potion, "quantity": 15}, {"item": hipotion, "quantity": 5}, {"item": superpotion, "quantity": 5}, {"item": elixir, "quantity": 5}, {"item": megaelixir, "quantity": 2}, {"item": grenade, "quantity": 5}] player = Person(460, 65, 60, 34, player_spells, player_items) enemy = Person(1200, 65, 45, 25, [], []) running = True print(BColors.FAIL + BColors.BOLD + "AN ENEMY ATTACKS!" + BColors.ENDC) while running: print("===============================") player.choose_action() choice = input("Choose action: ") index = int(choice) - 1 if index == 0: dmg = player.generate_damage() enemy.take_damage(dmg) print("You attacked for", dmg, "points of damage.")
'quantity': 5 }, { 'item': superpotion, 'quantity': 5 }, { 'item': elixer, 'quantity': 5 }, { 'item': hielixer, 'quantity': 2 }, { 'item': grenade, 'quantity': 5 }] player1 = Person('Jeri', 3260, 132, 300, 34, player_spells, player_items) player2 = Person('Mindy', 4160, 188, 311, 34, player_spells, player_items) player3 = Person('Tim', 3089, 174, 288, 34, player_spells, player_items) enemy1 = Person('Imp', 1250, 130, 560, 325, enemy_spells, []) enemy2 = Person('Magus', 18200, 701, 525, 25, enemy_spells, []) enemy3 = Person('Imp', 1250, 130, 560, 325, enemy_spells, []) players = [player1, player2, player3] enemies = [enemy1, enemy2, enemy3] running = True i = 0 print(bcolors.FAIL + bcolors.BOLD + 'AN ENEMY ATTACKS !' + bcolors.ENDC) while running: print('=' * 160)
}, { "item": superpotion, "quantity": 5 }, { "item": elixer, "quantity": 5 }, { "item": megaelixer, "quantity": 2 }, { "item": grenade, "quantity": 5 }] # Player/Enemy Instances player1 = Person("Valos:", 3260, 132, 300, 34, player_magic, player_items) player2 = Person("Nick :", 4160, 188, 311, 34, player_magic, player_items) player3 = Person("Robot:", 3089, 174, 288, 34, player_magic, player_items) enemy = Person("Enemy", 11200, 701, 525, 25, [], []) players = [player1, player2, player3] running = True i = 0 print(bcolors.FAIL + bcolors.BOLD + "AN ENEMY ATTACKS" + bcolors.ENDC) while running: print("=" * 60) print("\n\n")
potion = Item("Potion", "potion", "Heals 100 HP", 100) hipotion = Item("Hi-Potion", "potion", "Heals 300 HP", 300) superpotion = Item("Super Potion", "potion", "Heals 1000 HP", 1000) elixir = Item("Elixir", "elixir", "Fully replenishes HP/MP of one party member", 9999) hielixir = Item("Hi-Elixir", "elixir", "Fully replenishes HP/MP of all party members", 9999) grenade = Item("Grenade", "attack", "Deals 500 Dmg", 500) player_spells = [fire, thunder, blizzard, meteor, quake, cure, cura] player_items = [{"item": potion, "quantity": 15}, {"item":hipotion, "quantity": 5}, {"item": superpotion, "quantity": 5}, {"item": elixir, "quantity": 5}, {"item":hielixir, "quantity": 2}, {"item": grenade, "quantity": 5}] player1 = Person("Valos", 3260, 130,60,34, player_spells, player_items) player2 = Person("Nick ", 4160, 180,60,34, player_spells, player_items) player3 = Person("Robot", 3090, 170,60,34, player_spells, player_items) enemy = Person("Magus", 11200, 250, 350, 25, [], []) players = [player1, player2, player3] running = True print(bcolors.FAIL + bcolors.BOLD + "An Enemy Attacks!" + bcolors.ENDC) while running: print("====================================================") print("Name HP MP") for player in players:
# Items potion = Item("Potion", "potion", "Heals 50 HP", 50, 5) hi_potion = Item("Hi-Potion", "potion", "Heals 100 HP", 100, 2) super_potion = Item("Super Potion", "potion", "Heals 500 HP", 500, 1) elixer = Item("Elixer", "elixer", "Fully Restores HP/MP", 9999, 1) grenade = Item("Grenade", "grenade", "Deals 500 damage", 300, 1) enemy_super_potion = Item("Super Potion", "potion", "Heals 500 HP", 500, 1) enemy_elixer = Item("Elixer", "elixer", "Fully Restores HP/MP", 9999, 1) enemy_grenade = Item("Grenade", "grenade", "Deals 500 damage", 300, 1) magics = [fire, thunder, blizzard, meteor, quake, cure, cura, mana] items = [potion, hi_potion, super_potion, elixer, grenade] player_name = "NoobUser" player = Person(player_name, 1200, 100, 60, 34, magics, items) enemy = Person("Jose(AI)", 1200, 100, 45, 25, magics, [enemy_super_potion, enemy_elixer, enemy_grenade]) #Player Stats print(Bcolors.HEADER + "▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬" + Bcolors.ENDC) print(Bcolors.BOLD + Bcolors.HEADER + "Player 1: " + player_name + Bcolors.BOLD + Bcolors.OKGREEN + " HP " + str(player.hp) + "/" + str(player.maxhp) + Bcolors.BOLD + Bcolors.OKBLUE + " MP " + str(player.mp) + "/" + str(player.maxmp) + Bcolors.ENDC) player.get_stats() print(Bcolors.BOLD + Bcolors.HEADER + "Player 2: " + enemy.name + Bcolors.BOLD + Bcolors.OKGREEN + " HP " + str(enemy.hp) + "/" + str(enemy.maxhp) + Bcolors.BOLD + Bcolors.OKBLUE + " MP " +
}, { "item": superpotion, "quantity": 5 }, { "item": elixer, "quantity": 5 }, { "item": hielixer, "quantity": 2 }, { "item": grenade, "quantity": 5 }] # Instantiate People player1 = Person("Hulk : ", 3472, 145, 300, 34, player_spells, player_items) player2 = Person("Thor : ", 4672, 134, 321, 34, player_spells, player_items) player3 = Person("Ironman: ", 3123, 210, 153, 34, player_spells, player_items) enemy1 = Person("Loki :", 2031, 130, 534, 325, enemy_spell, []) enemy2 = Person("Thanos:", 12602, 684, 632, 25, enemy_spell, []) enemy3 = Person("Ultron:", 2031, 130, 534, 325, enemy_spell, []) players = [player1, player2, player3] enemies = [enemy1, enemy2, enemy3] running = True i = 0 print(bcolors.FAIL + bcolors.BOLD + "RPG Bettle Game !" + bcolors.ENDC) while running:
from flask import Flask, request from classes.game import Person, bcolors app = Flask(__name__) magic = [{"name": "Fire", "cost": 10, "dmg":120}, {"name": "Water", "cost": 5, "dmg":80}, {"name": "Air", "cost": 7, "dmg":113}] player = Person(460, 65, 60, 34, magic) enemy = Person(1200, 65, 45, 25, magic) @app.route('/', methods=['GET', 'POST']) def recieve_message(): if request.method == 'GET': response = form_response({'text': 'start', 'payload': 'bubu'}) return response else: payload = request.get_json() response = form_response(payload) return response def form_response(payload): if payload["text"] == 'start': return player.choose_action() if __name__ == '__main__': app.run()
bomb = Item("Bomb", "Attack", "Deals 100 points of damage", 100) player_spells = [fire, thunder, blizzard, meteor, quake, cure, heaven] player_items = [{ "item": med_potion, "quantity": 3 }, { "item": small_elixer, "quantity": 5 }, { "item": bomb, "quantity": 4 }] player = Person(500, 65, 60, 35, player_spells, player_items) enemy = Person(1200, 65, 35, 25, [], []) running = True print(bcolors.FAIL + bcolors.BOLD + "AN ENEMY ATTACKS!" + bcolors.ENDC) while running: print( "======================================================================" ) player.choose_action() choice = input("Choose action: ") index = int(choice) - 1 if index == 0:
}, { "item": superpotion, "quantity": 5 }, { "item": elixer, "quantity": 5 }, { "item": hielixer, "quantity": 2 }, { "item": grenade, "quantity": 1 }] #Instantiates Player and NPC(s) player1 = Person("Buttz", 3260, 10, 300, 34, player_spells, player_items) player2 = Person("Cloud", 4160, 188, 311, 34, player_spells, player_items) player3 = Person("Vaan ", 2089, 174, 288, 34, player_spells, player_items) enemy1 = Person("Imp ", 1250, 130, 560, 325, enemy_spells, []) enemy2 = Person("Scaar", 11200, 701, 525, 25, enemy_spells, []) enemy3 = Person("Imp ", 1250, 130, 560, 325, enemy_spells, []) players = [player1, player2, player3] enemies = [enemy1, enemy2, enemy3] defeated_enemies = 0 defeated_players = 0 running = True i = 0
"quantity": 5 }, { "item": superpotion, "quantity": 5 }, { "item": elixer, "quantity": 5 }, { "item": hielixer, "quantity": 2 }, { "item": grenade, "quantity": 5 }] #Instantiate people player1 = Person('Valos:', 3260, 132, 300, 34, player_spells, player_items) player2 = Person('Nick :', 4160, 188, 260, 34, player_spells, player_items) player3 = Person('Robot:', 3090, 174, 289, 34, player_spells, player_items) enemy1 = Person('Imp :', 1250, 130, 560, 325, enemy_spells, []) enemy2 = Person('Magus:', 11200, 221, 525, 20, enemy_spells, []) enemy3 = Person('Imp :', 1250, 130, 560, 325, enemy_spells, []) players = [player1, player2, player3] enemies = [enemy1, enemy2, enemy3] running = True print(bcolors.FAIL + bcolors.BOLD + "AN ENEMY ATTACKS" + bcolors.ENDC) while running:
}, { 'item': superpotion, 'quantity': 1 }, { 'item': elixir, 'quantity': 5 }, { 'item': megaelixir, 'quantity': 1 }, { 'item': grenade, 'quantity': 10 }] # Instantiate People: player1 = Person("Valos", 1200, 65, 150, 34, player_spells, player_items) player2 = Person("Nick ", 4000, 65, 200, 34, player_spells, player_items) player3 = Person("Robot", 4000, 65, 300, 34, player_spells, player_items) enemy2 = Person("Imp ", 1250, 130, 560, 325, enemy_spells, []) enemy1 = Person("Magus", 11200, 65, 600, 25, enemy_spells, []) enemy3 = Person("Imp ", 1250, 130, 560, 325, enemy_spells, []) players = [player1, player2, player3] enemies = [enemy1, enemy2, enemy3] running = True i = 0 print(bcolors.FAIL + bcolors.BOLD + 'AN ENEMY ATTACKS!' + bcolors.ENDC) while running:
# create some item potion = Item("Potion", "potion", "Heals 50 hp", 50) hipotion = Item("Hi-potion", "potion", "Heals 100 hp", 100) superpotion = Item("Super-potion", "potion", "Heals 500 hp", 500) elixer = Item("Elixer", "Elixer", "Fully restores HP/MP of the party member", 9999) hielixier = Item("MegaElixier", "Elixer", "Fully restore partys hp/mp", 9999) grenade = Item("grenade", "attacls", "Deals 500 Damage", 500) #Instantiate People player_spell = [fire, Thunder, Rage, Quake, Blizzard, cure, cura] player_item = [potion, hipotion, superpotion, elixer, hielixier, grenade] player = Person (1000, 65, 60, 34, player_spell, player_item) enemy = Person (1200, 65, 60, 34, [], []) runnning = True i = 0 # print('''bcolors.FAIL +''' bcolors.BOLD + "AN ENEMY ATTACKS!" + bcolors.ENDC) print(bcolors.FAIL + bcolors.BOLD + "AN ENEMY ATTACKS!" + bcolors.ENDC) while runnning: print ("====================") player.choose_action() choice = input("Choose Action") index = int(choice) - 1 # print("Your choose", choice)
"Fully restores HP/MP of one party member", 9999) megaelixer = Item("MegaElixer", "elixer", "Fully restores party's HP/MP", 13000) grenade = Item("Grenade", "attack", "Deals 500 damage", 900) player_magic = [fire, thunder, blizzard, meteor, cure, cura] player_items = [{"item": potion, "quantity": 15}, {"item": hipotion, "quantity": 5}, {"item": superpotion, "quantity": 5}, {"item": elixer, "quantity": 5}, {"item": megaelixer, "quantity": 2}, {"item": grenade, "quantity": 5}] # Instantiate People player1 = Person("Shubh:", 4000, 130, 288, 34, player_magic, player_items) player2 = Person("Valos:", 4600, 140, 250, 34, player_magic, player_items) player3 = Person("Robot:", 3060, 150, 300, 34, player_magic, player_items) enemy = Person("Enemy", 12000, 220, 400, 25, [], []) players = [player1, player2, player3] running = True print(Bcolors.FAIL + Bcolors.BOLD + "AN ENEMY ATTACKS" + Bcolors.ENDC) while running: print("================\n\n") print("NAME: HP MP") for player in players: player.get_stats()
hipotion = Item("Hi-Potion", "potion", "Heals 100 HP", 100) superpotion = Item("Super Potion", "potion", "Heals 1000 HP", 1000) elixir = Item("Elixir", 'elixir', "Fully restores HP/MP of 1 Party Member", 9999) hielixir = Item("MegaElixir", "elixir", "Fully restores party's MP/HP", 9999) grenade = Item("Grenade", "attack", "Deals 500 damage", 500) player_spells = [fire, thunder, blizzard, meteor, quake, cure, cura] enemy_spells = [fire, meteor, curaga] player_items = [{"item": potion, "quantity": 15}, {"item": hipotion, "quantity": 5}, {"item": superpotion, "quantity": 5}, {"item": elixir, "quantity": 5}, {"item": hielixir, "quantity": 2}, {"item": grenade, "quantity": 5}] # Instantiate People player1 = Person("Steve_Rogers ", 3260, 132, 300, 34, player_spells, player_items) player2 = Person("Tony_Stark ", 4160, 188, 311, 34, player_spells, player_items) player3 = Person("Thor_Odinson ", 3089, 174, 288, 34, player_spells, player_items) enemy1 = Person("Thanos ", 18200, 701, 525, 25, enemy_spells, []) enemy2 = Person("Hella ", 1250, 130, 560, 325, enemy_spells, []) enemy3 = Person("HYDRA ", 1250, 130, 560, 325, enemy_spells, []) players = [player1, player2, player3] enemies = [enemy2, enemy1, enemy3] running = True i = 0 print(bcolors.FAIL + bcolors.BOLD + "AN ENEMY ATTACKS" + bcolors.ENDC)
magic = [{ "name": "Fire", "cost": 10, "dmg": 100 }, { "name": "Thunder", "cost": 10, "dmg": 124 }, { "name": "Blizzard", "cost": 100, "dmg": 60 }] player = Person(900, 65, 60, 34, magic) enemy = Person(1200, 65, 45, 25, magic) running = True i = 0 print("An Enemy Attacks!") while running: print("=========================================") player.choose_action() choice = input("Choose an Action: ") index = int(choice) - 1
potion = Item("Potion", "potion", "Heals 50 HP", 50) hipotion = Item("Hi-Potion", "potion", "Heals 100 HP", 100) superpotion = Item("Super Potion", "potion", "Heals 500 HP", 1000) elixer = Item("Elixer", "elixer", "Fully restores HP/MP of one party member", 9999) hielixer = Item("MegaElixer", "elixer", "Fully restores party's HP/MP ", 9999) grenade = Item("Grenade", "attack", "Deals 500 damage", 500) player_spells = [fire, thunder, blizzard, meteor, quake, cure, cura] enemy_spell = [fire, meteor, cure, curaga] player_items = [{"item": potion, "quantity": 15}, {"item": hipotion, "quantity": 5}, {"item": superpotion, "quantity": 5}, {"item": elixer, "quantity": 5}, {"item": hielixer, "quantity": 2}, {"item": grenade, "quantity": 5}] # Instantiate people player1 = Person("Pradip:", 3260, 132, 300, 40, player_spells, player_items) player2 = Person("Nirmal:", 4260, 188, 311, 40, player_spells, player_items) player3 = Person("Sikey :", 3089, 174, 285, 40, player_spells, player_items) enemy1 = Person("Imp: ", 900, 130, 560, 325, enemy_spell, []) enemy2 = Person("Magus:", 11200, 999, 525, 50, enemy_spell, []) enemy3 = Person("Imp: ", 900, 130, 560, 325, enemy_spell, []) players = [player1, player2, player3] enemies = [enemy1, enemy2, enemy3] running = True i = 0 print(bcolors.FAIL + bcolors.BOLD + "AN ENEMY ATTACKS" + bcolors.ENDC)
from classes.magic import Spell # create black magic fire = Spell("fire", 10, 100, "black") thunder = Spell("thunder", 10, 100, "black") blizzard = Spell("blizzard", 10, 100, "black") meteor = Spell("meteor", 20, 200, "black") quake = Spell("quake", 14, 140, "black") # create white magic cure = Spell("cure", 12, 120, "white") cura = Spell("cura", 18, 200, "white") # list of dictionaries player = Person(460, 65, 60, 34, [fire,thunder,blizzard,meteor,cure,cura]) enemy = Person(1200, 65, 45, 25, []) running = True i = 0 print(bcolors.FAIL + bcolors.BOLD + "AN ENEMY ATTACKS!" + bcolors.ENDC) while running: # player choose attack or magic, using 1 or 2 # then it attacks the enemy print("==============================") player.choose_action() choice = input("Choose action:")
"item": hielixer, "quantity": 2 }, { "item": grenade, "quantity": 5 }] enemy_items = [{ "item": special, "quantity": 2 }, { "item": elixer, "quantity": 1 }] player1 = Person("Valos:", 3260, 132, 300, 34, player_spells, player_items) player2 = Person("Nick: ", 4160, 188, 311, 34, player_spells, player_items) player3 = Person("Robot:", 3089, 174, 288, 34, player_spells, player_items) enemy2 = Person("Imp: ", 1250, 130, 560, 325, [], []) enemy1 = Person("Magus:", 11200, 701, 525, 25, [], enemy_items) enemy3 = Person("Imp: ", 1250, 130, 560, 325, [], []) players = [player1, player2, player3] enemies = [enemy2, enemy1, enemy3] running = True i = 0 print("\n") print(bcolors.FAIL + bcolors.BOLD + "An Enemy Attacks!" + bcolors.ENDC) while running:
}, { "item": elixir, "quantity": 5 }, { "item": megaelixir, "quantity": 2 }, { "item": grenade, "quantity": 5 }] enemy_spells = [sixShot, quickDraw, chargedShot, dustEye, hackTech] boss_spells = [sixShot, quickDraw, chargedShot, dustEye, hackTech] # Instantiate People player1 = Person("Talos", 3260, 132, 300, 34, player_spells, player_items) player2 = Person("Rose ", 4160, 188, 311, 34, player_spells, player_items) player3 = Person("Jin ", 3089, 174, 288, 34, player_spells, player_items) enemy1 = Person("Goon ", 1250, 999999, 560, 325, enemy_spells, []) enemy2 = Person("Vex ", 18200, 999999, 525, 25, enemy_spells, []) enemy3 = Person("Goon ", 1250, 999999, 560, 325, enemy_spells, []) players = [player1, player2, player3] enemies = [enemy1, enemy2, enemy3] running = True print( "==================================================================================" )
hipotion = Item("Hi-Potion", "potion", "Heals 100 HP", 500) ultrapotion = Item("Ultra Potion", "potion", "Heals 500 HP", 1000) elixer = Item("Elixer", 'elixer', "Fully restores HP/MP of one party member", 9999) megaelixer = Item("MegaElixer", 'elixer', "Fully restores HP/MP of one party member", 9999) grenade = Item("Grenade", 'attack', "Deals 500 damage", 10000) player_spells = [fire, lightning, water, meteor, quake, cure, cura] enemy_spells = [fire, meteor, curaga] player_items = [{"item": potion, "quantity": 15}, {"item": hipotion, "quantity": 5}, {"item": ultrapotion, "quantity": 5}, {"item": elixer, "quantity": 5}, {"item": megaelixer, "quantity": 2}, {"item": grenade, "quantity": 5}] # Instantiate People player1 = Person("John: ", 1000, 130, 340, 34, player_spells, player_items) player2 = Person("Leah: ", 1000, 140, 280, 34, player_spells, player_items) player3 = Person("Joe : ", 1000, 170, 300, 34, player_spells, player_items) enemy1 = Person("Imp ", 1250, 130, 560, 325, enemy_spells, []) enemy2 = Person("Magus ", 11200, 700, 525, 25, enemy_spells, []) enemy3 = Person("Imp ", 1250, 130, 560, 325, enemy_spells, []) players = [player1, player2, player3] enemies = [enemy1, enemy2, enemy3] running = True i = 0 print(Bcolors.FAIL + Bcolors.BOLD + "Get Ready! The battle begins!" + Bcolors.ENDC)
from classes.game import Person, bcolors magic = [{ 'name': 'Fire', 'cost': 10, 'dmg': 60 }, { 'name': 'Thunder', 'cost': 10, 'dmg': 60 }, { 'name': 'Blizzard', 'cost': 10, 'dmg': 60 }] player = Person(460, 65, 60, 34, magic) print(player.generate_spell_damage(0)) print(player.generate_spell_damage(1))
}, { "item": superpotion, "quantity": 5 }, { "item": elixer, "quantity": 5 }, { "item": hielixer, "quantity": 2 }, { "item": grenade, "quantity": 5 }] # Instantiate People / Person(hp, mp, atk, df, magic) player1 = Person("Valos ", 3260, 132, 300, 34, player_spells, player_items) player2 = Person("Nick ", 4160, 188, 300, 34, player_spells, player_items) player3 = Person("Robot ", 3089, 174, 300, 34, player_spells, player_items) enemy1 = Person("Imp ", 1250, 130, 560, 325, enemy_spells, []) enemy2 = Person("Magus ", 18200, 701, 525, 25, enemy_spells, []) enemy3 = Person("Imp ", 1250, 130, 560, 325, enemy_spells, []) players = [player1, player2, player3] enemies = [enemy1, enemy2, enemy3] running = True print(bcolors.FAIL + bcolors.BOLD + "AN ENEMY ATACKS!" + bcolors.ENDC) while running:
cura = Spell("Cura", 32, 1500, "white") #Create some items potion = Item("Potion", "potion", "Heals 50 HP", 50) hiPotion = Item("Hi-Potion", "potion", "Heals 100 HP", 100) superPotion = Item("Super Potion", "potion", "Heals 500 HP", 1000) elixir = Item("Elixir", "elixir", "Fully restores HP/MP of one party member", 9999) megaElixir = Item("MegaElixir", "elixir", "Fully restores party's HP/MP", 9999) grenade = Item("Grenade", "attack", "Deals 500 damage", 500) #Instantiate People playerSpells = [fire, thunder, blizzard, meteor, quake, cure, cura] playerItems = [{"item": potion, "quantity": 15}, {"item": hiPotion, "quantity": 5}, {"item": superPotion, "quantity": 5}, {"item": elixir, "quantity": 5}, {"item": megaElixir, "quantity": 2}, {"item": grenade, "quantity": 5}] player = Person("Valos:", 3260, 132, 300 , 34, playerSpells, playerItems) player2 = Person("Cody :", 4160, 188, 311 , 34, playerSpells, playerItems) player3 = Person("Robot:", 3089, 174, 288 , 34, playerSpells, playerItems) players = [player, player2, player3] enemySpells = [fire, meteor, cure] enemy = Person("Imp ", 1250, 130, 560, 325, enemySpells, []) enemy2 = Person("Magus", 18200, 223, 525, 25, enemySpells, []) enemy3 = Person("Imp ", 1250, 130, 560, 325, enemySpells, []) enemies = [enemy, enemy2, enemy3] running = True print(BackgroundColors.FAIL + BackgroundColors.BOLD + "ENEMIES ATTACK!" + BackgroundColors.ENDC ) while running:
}, { 'item': superpotion, 'quantity': 5 }, { 'item': elixer, 'quantity': 5 }, { 'item': megaelixer, 'quantity': 2 }, { 'item': grenade, 'quantity': 5 }] # instantiate people player1 = Person("Ash", 461, 65, 60, 34, player_spells, player_items) player2 = Person("Kun", 460, 65, 60, 34, player_spells, player_items) player3 = Person("Anv", 416, 65, 60, 34, player_spells, player_items) players = [player1, player2, player3] enemy1 = Person("Gul", 700, 65, 45, 23, player_spells, player_items) enemy2 = Person("Pnw", 700, 65, 45, 23, player_spells, player_items) enemies = [enemy1, enemy2] running = True print(bcolors.FAIL + bcolors.BOLD + 'AN ENEMY ATTACKS!!!' + bcolors.ENDC) while running: print('===================') print(
}, { 'item': superpotion, 'quantity': 1 }, { 'item': elixir, 'quantity': 1 }, { 'item': hielixir, 'quantity': 1 }, { 'item': grenade, 'quantity': 2 }] # Initiate Players player1 = Person('Andrew', 460, 65, 60, 34, player_spell, player_item) player2 = Person('Max', 460, 65, 60, 34, player_spell, player_item) player3 = Person('Robot', 460, 65, 60, 34, player_spell, player_item) enemy = Person('Barbarian', 1200, 64, 45, 25, [], []) players = [player1, player2, player3] running = True print(bcolors.FAIL + bcolors.BOLD + "AN ENEMY ATTACKS!!!" + bcolors.ENDC) while running: print('=' * 50) for player in players: player.get_stats()