from classes.game import bcolors, Person from classes.magic import Spell from classes.inventory import Item import random # Creating Black Magic fire = Spell("Fire", 25, 600, "black") thunder = Spell("Thunder", 25, 600, "black") blizzard = Spell("Blizzard", 25, 600, "black") meteor = Spell("Meteor", 40, 1200, "black") quake = Spell("Quake", 14, 140, "black") # Creating White Magic cure = Spell("Cure", 25, 620, "white") cura = Spell("Cura", 32, 1500, "white") curaga = Spell("Curaga", 50, 6000, "white") # Creating Items potion = Item("Potion", "potion", "Heals 50 HP", 50) hipotion = Item("Hi-Potion", "potion", "Heals 100 HP", 100) superpotion = Item("Super Potion", "potion", "Heals for 1000 HP", 1000) elixer = Item("Elixer", "elixer", "Fully restores HP/MP of one party member", 9999) hielixer = Item("Mege Elixer", "elixer", "Fully restores HP/MP of party", 9999) grenade = Item("Grenade", "attack", "Deals 500 damage", 500) player_spells = [fire, thunder, blizzard, quake, cure, cura] player_items = [{"item": potion, "quantity": 15}, {"item": hipotion, "quantity": 5},
from classes.game import Person from classes.magic import Spell from classes.colors import bcolors from classes.inventory import Item # Attack Magic fire = Spell("Fire Heat", 27, 150, "Dark") thunder = Spell("Thunder", 30, 160, "Dark") blizzard = Spell("Blizzard", 35, 170, "Dark") quake = Spell("Quake", 40, 180, "Dark") meteor = Spell("Meteor", 43, 190, "Dark") crunch = Spell("Crunch", 45, 200, "Dark") dark_pulse = Spell("Dark Pulse", 47, 210, "Dark") shadow_ball = Spell("Shadow Ball", 50, 220, "Dark") destiny_bond = Spell("Destiny Bond", 53, 230, "Dark") # Heal magic cure = Spell("Recover", 20, 300, "Healing") cure2 = Spell("Regenerator", 25, 350, "Healing") # Usables heal_potion1 = Item("Heal Potion(Low)", "potion", "Heals 50 HP", 150) heal_potion2 = Item("Hi-Heal Potion", "potion", "Heals 100 HP", 200) heal_potion3 = Item("Super Heal Potion", "potion", "Heals 500 HP", 600) heal_elixir = Item("Elixir", "elixir", "Heals full HP/MP of one member", 99999) heal_mega_elixir = Item("Mega Elixir", "elixir", "Heals full HP/MP of the whole team", 999999) # Damage Items grenade = Item("Grenade", "throwable", "Deals 500 damage", 500)
# import classes from classes.game import Person, Bcolors from classes.magic import Spell from classes.inventory import Item import random from time import sleep # Create black magic abilities > name, cost, dmg, type fire = Spell("Fire", 60, 500, "black") thunder = Spell("Thunder", 60, 500, "black") blizzard = Spell("Blizzard", 70, 500, "black") Quake = Spell("Quake", 70, 500, "black") metero = Spell("metero", 70, 500, "black") # Create white mahic (heal) abilities > name, cost, dmg, type cure = Spell("Cure", 40, 500, "white") cura = Spell("Cura", 78, 500, "white") # Create items > name, type, description, prop 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 one party member", 9999) megaelixer = Item("MegaElixer", "elixer", "Fully restores party HP/MP", 9999) grenade = Item("Grenade", "attack", "Deals 500 damage", 500) # Create player inventory with items quantity player_items = [{ "item": potion,
from classes.game import Person, Bcolours from classes.magic import Spell from classes.inventory import Item import random # Create Black magic fire = Spell("Fire", 10, 600, "black") thunder = Spell("Thunder", 10, 600, "black") blizzard = Spell("Blizzard", 10, 600, "black") meteor = Spell("Meteor", 20, 1200, "black") quake = Spell("Quake", 14, 800, "black") # Create White Magic cure = Spell("Cure", 12, 620, "white") cura = Spell("Cura", 18, 1500, "white") curaga = Spell("Curaga", 20, 3000, "white") # Create some Items potion = Item("Potion", "potion", "Heals 200 HP", 200) hipotion = Item("Hi-Potion", "potion", "Heals 500 HP", 500) superpotion = Item("Super Potion", "potion", "Heals 1000 HP", 1000) elixer = Item("Elixer", "elixer", "Fully restores HP/MP of one party member", 9999) megaelixer = Item("Mega Elixer", "elixer", "Fully restores party's HP/MP", 9999) grenade = Item("Grenade", "attack", "Deals 500 damage", 500) player_spells = [fire, thunder, blizzard, meteor, cure, cura] enemy_spells1 = [fire, cure] enemy_spells2 = [blizzard, cure] enemy_spells3 = [curaga, meteor, thunder] player_items = [{"item": potion, "quantity": 15}, {"item": hipotion, "quantity": 5},
from classes.game import Person, bcolors from classes.magic import Spell from classes.inventory import Item import random # Create black Magic fire = Spell(name="Fire", cost=25, dmg=600, type="black") thunder = Spell(name="Thunder", cost=25, dmg=500, type="black") blizzard = Spell(name="Blizzard", cost=25, dmg=550, type="black") meteor = Spell(name="Meteor", cost=40, dmg=1200, type="black") quake = Spell(name="Quake", cost=35, dmg=900, type="black") # Create white magic heal = Spell(name="Heal", cost=25, dmg=600, type="white") cure = Spell(name="Cure", cost=35, dmg=1500, type="white") # create Item potion = Item(name="Potion", type="potion", description="Heals 50 HP", prop=50) hipotion = Item(name="Hi-Potion", type="potion", description="Heals 100 HP", prop=100) superpotion = Item(name="Super Potion", type="potion", description="Heals 500 HP", prop=500) elixer = Item(name="Elixer", type="elixer", description="Fully restores MP/HP of one party member", prop=9999) hielixer = Item(name="MegaElixer",
from classes.game import Person, bcolors from classes.magic import Spell from classes.inventory import Item import random # Create Black Magic fire = Spell("Fire", 10, 500, "black") thunder = Spell("Thunder", 12, 510, "black") blizzard = Spell("Blizzard", 8, 570, "black") meteor = Spell("Meteor", 20, 1100, "black") quake = Spell("Quake", 14, 940, "black") # Create White Magic cure = Spell("Cure", 10, 700, "white") cura = Spell("Thunder", 12, 1000, "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 500HP", 500) elixir = Item("Elixer", "elixir", "Fully restores HP/MP of one party member", 9999) hielixir = Item("Mega-Elixer", "elixir", "Fully restores party's member", 9999) grenade = Item("Grenade", "attack", "Deals 500 damage", 500) player_spells = [fire, thunder, blizzard, meteor, quake, cure, cura] player_items = [{ "item": potion, "quantity": 15
# Author- Bedabrata Bora # Project 2- A very Simple terminal game from classes.game import Character, Colors from classes.magic import Spell # Create black magic fire = Spell(name="Fire", cost=20, dmg=150, type="Black") thunder = Spell(name="Thunder", cost=10, dmg=80, type="Black") quake = Spell(name="Quake", cost=15, dmg=100, type="Black") hurricane = Spell(name="Hurricane", cost=25, dmg=180, type="Black") hydro = Spell(name="Hydro Pump", cost=30, dmg=200, type="Black") # Create White Magic cure = Spell(name="Cure", cost=12, dmg=120, type="White") heal = Spell(name="Heal", cost=20, dmg=200, type="White") powers = [fire, thunder, quake, hurricane, hydro, cure, heal] player = Character(hp=460, mp=80, atk=80, df=40, magic=powers) # Player stats enemy = Character(hp=1200, mp=65, atk=60, df=30, magic=[]) # Enemy stats game = True # Game is running while game: print("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++") player.select_action() choice = input("Select an option: ") index = int(choice) - 1 if index == 0: # Player wishes to attack
from classes.game import Person, bgcolor from classes.magic import Spell from classes.inventory import Item import random # Create Black Magic Fire = Spell("Fire", 25, 600, "black") Thunder = Spell("Thunder", 25, 600, "black") Blizzard = Spell("Blizzard", 25, 600, "black") Meteor = Spell("Meteor", 40, 1200, "black") Quake = Spell("Quake", 14, 140, "black") # Create White Magic Cure = Spell("Cura", 25, 620, "white") Cura = Spell("Cura", 50, 1500, "white") Curaga = Spell("Curaga", 50, 6000, "white") # Create new Itmes potion = Item("Potion", "potion", "Heals 50 HP", 50) hipotion = Item("Hi - Potion", "potion", "Heals 100 HP", 100) superpotion = Item("Super Potion", "potion", "Heals 1000 HP", 1000) elixer = Item("Elixer", "elixer", "Fully restores HP/MP of one party member", 9999) hielixer = Item("Mega Elixer", "elixer", "Fully restores party's HP/MP", 9999) grenade = Item("Grenade", "attack", "Deals 500 damage", 500) # Instantiate People player_spells = [Fire, Thunder, Blizzard, Meteor, Cure, Cura] player_items = [{ "item": potion,
from classes.game import Person, bcolors from classes.magic import Spell from classes.inventory import Item import random # Create Black Magic fire = Spell('Fire', 25, 600, 'black') thunder = Spell('Thunder', 25, 600, 'black') blizzard = Spell('Blizzard', 25, 600, 'black') meteor = Spell('Meteor', 40, 1200, 'black') quake = Spell('Quake', 14, 140, 'black') # Create White Magic cure = Spell('Cure', 25, 620, 'white') curea = 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 1000 HP', 1000) elixir = Item('Elixir', 'elixir', 'Fully restores HP/MP of one party member', 9999) hielixir = Item('MegaElixir', 'elixir', 'Fully restores parties HP/MP', 9999) grenade = Item('Grenade', 'attack', 'Deals 500 damage', 500) player_spells = [fire, thunder, blizzard, meteor, cure, curea] player_items = [{ 'item': potion, 'quantity': 15 }, {
from classes.game import Person, Bcolors from classes.magic import Spell from classes.inventory import Item import random #black magic fire = Spell("Fire", 25, 600, "black") thunder = Spell("thunder", 25, 600, "black") blizzard = Spell("blizzard", 25, 600, "black") meteor = Spell("meteor", 40, 1200, "black") quake = Spell("quake", 14, 140, "black") #white magic cure = Spell("Cure", 25, 620, "white") cura = Spell("Cura", 35, 1500, "white") #Create some items potion = Item("Potion", "potion", "Heals 300 HP", 50) hipotion = Item("Hi-Potion", "potion", "Heals 500 HP", 100) superpotion = Item("Super Potion", "potion", "Heals 100 HP", 500) elixer = Item("Elixer", "elixer", "Fully restores HP/MP of one party member", 9999) megaelixer = Item("MegaElixer", "elixer", "Fully restores all party's HP/MP", 9999) grenade = Item("Grenade", "attack", "Deals 500 damage", 500) player_magic = [fire, thunder, blizzard, meteor, cure, cura] player_item = [{ "item": potion, "quantity": 15
import time import math from classes.game import Person, bcolors from classes.magic import Spell from classes.inventory import Item ##################################################################################################### # create black magic fire = Spell("Fire", 10, 100, "Black") blizzard = Spell("Blizzard", 11, 130, "Black") thunder = Spell("Thunder", 15, 170, "Black") meteor = Spell("Meteor", 15, 170, "Black") quake = Spell("Quake", 10, 100, "Black") # create white magic cure = Spell("Cure", 12, 120, "White") cura = Spell("Cura", 18, 200, "White") # Creating 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", 500) elixer = Item("Elixer", "elixer", "Fully Restores the HP & MP of One Member", 9999) hielixer = Item("Mega Elixer", "elixer", "Fully Restores the HP & MP of All Members", 9999) grenade = Item("Grenade", "weapon", "Deals 500 Damage", 500) # create players
from classes.game import Person, bcolors from classes.magic import Spell from classes.inventory import Item import random # Create Black Magic DMG_SPELL_NAME = "black" HEAL_SPELL_NAME = "white" fire = Spell("Fire", 10, 100, DMG_SPELL_NAME) thunder = Spell("Thunder", 10, 100, DMG_SPELL_NAME) blizzard = Spell("Blizzard", 10, 100, DMG_SPELL_NAME) meteor = Spell("Meteor", 20, 200, DMG_SPELL_NAME) quake = Spell("Quake", 14, 140, DMG_SPELL_NAME) # Create WHite Magic cure = Spell("Cure", 12, 120, HEAL_SPELL_NAME) cura = Spell("Cura", 18, 180, HEAL_SPELL_NAME) # Create some items. ITEM_TYPES = ["Potion", "Elixir", "Attack", "MegaElixir"] potion = Item("Potion", ITEM_TYPES[0], "Heals 50 HP", 50) hipotion = Item("Hiper Potion", ITEM_TYPES[0], "Heals 100 HP", 100) superpotion = Item("Super Potion", ITEM_TYPES[0], "Heals 500 HP", 500) elixir = Item("Elixir", ITEM_TYPES[1], "Fully restores HP/MP of one party member", 9999) megaelixir = Item("Mega Elixir", ITEM_TYPES[3], "Fully restores party's HP/MP.", 9999) grenade = Item("Grenade", ITEM_TYPES[2], "Deals 500 damage", 500)
from classes.game import Person, bcolors from classes.magic import Spell #Spells available to player firebolt = Spell("firebolt", 50, 80, "fire") icebolt = Spell("icebolt", 40, 75, "ice") heal = Spell("heal", 30, 45, "restoration") healingHand = Spell("healing hand", 50, 100, "restoration") #Characters player = Person("Raknar", 1, 500, 100, 10, 10, 10, 10, 0) friend = Person("Dog", 1, 150, 0, 5, 5, 5, 0, 0) enemy_1 = Person("Goblin", 1, 350, 70, 10, 10, 10, 10, 2) enemy_2 = Person("Thrall", 10, 900, 300, 30, 40, 50, 40, 2) loop = True global target_current target_current = enemy_1 def targets_show(type): i=0 if str(type) == "hostile": for hostiles in targets_hostile: print(i+1, targets_hostile[i].get_Name()) i+=1 elif str(type) == "friendly": for friendlies in targets_friendly: print(i+1, targets_friendly[i].get_Name()) i+=1
from classes.game import Person, bcolors from classes.magic import Spell from classes.inventory import Item # 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") # 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", 500) elixer = Item("Elixer", "elixer", "Fully restores HP/MP of one party member", 9999) hielixer = Item("Mega-Elixer", "elixer", "Fully restores HP/MP of all", 9999) grenade = Item("Grenade", "attack", "Deals 500 damage", 500) player_spells = [fire, thunder, blizzard, meteor, cure, cura] player_items = [potion, hipotion, superpotion, elixer, hielixer, grenade] #Instantiate People player = Person(460, 65, 60, 34, player_spells, player_items ) enemy = Person(1200, 65, 45, 25, [], [])
from classes.game import Person, Bcolors from classes.magic import Spell from classes.Inventory import Item import random # player options option = ['1', '2', '3'] option1 = ['1', '2', '3', '4', '5', '6'] option2 = ['1', '2', '3', '4', '5', '6', '7'] # These are Black magic fire = Spell("Fire", 17, 700, "Dark") thunder = Spell("Thunder", 22, 850, "Dark") blizzard = Spell("Blizzard", 20, 800, "Dark") meteor = Spell("Meteor", 30, 1200, "Dark") quake = Spell("Quake", 14, 440, "Dark") # white spell cure = Spell("Cure", 12, 750, "white") cura = Spell("Cura", 18, 1500, "white") # Create some Items potion = Item("potion", "potion", "Heals 50 HP", 50, 15) hipotion = Item("Hi-potion", "potion", "Heals 100 HP", 100, 5) superpotion = Item("Super potion", "potion", "Heals 500 HP", 500, 2) elixer = Item("Elixer", "elixer", "Fully restores HP/MP of one party member", 9999, 1) megaelixer = Item("MegaElixer", "elixer", "Fully restores HP/MP of whole party", 9999, 1) grenade = Item("Grenade", "attack", "Deals 3000 damage", 3000, 1)
from classes.game import Player, bcolors from classes.magic import Spell from classes.inventory import Item import random # Create black magic Fire = Spell("Fire", 25, 600, "Black") Thunder = Spell("Thunder", 25, 600, "Black") Blizzard = Spell("Blizzard", 20, 400, "Black") Meteor = Spell("Meteor", 40, 1200, "Black") Quake = Spell("Quake", 25, 850, "Black") # create white magic Cure = Spell("Cure", 25, 600, "White") Aspirin = Spell("Aspirin", 35, 1200, "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 1000 HP", 1000) elixir = Item("Elixir", "elixir", "Fully restores HP of one party", 10000) hielixir = Item("MegaElixir", "elixir", "Fully restores HP/MP", 10000) grenade = Item("Granade", "attack", "Deals 500 damage", 500) player1_spells = [Fire, Thunder, Blizzard, Meteor, Cure, Aspirin] player1_items = [{ 'item': potion, 'Quantity': 15 }, { 'item': hipotion,
from classes.game import Person, bcolors from classes.magic import Spell fire = Spell("Fire", 10, 100, "black") thunder = Spell("Fire", 10, 100, "black") blizzard = Spell("Blizzard", 10, 100, "black") quake = Spell("Quake", 10, 100, "black") meteor = Spell("Meteor", 10, 100, "black") cure = Spell("Cure", 10, 100, "white") magic = [{ "name": "fire", "cost": 10, "dmg": 60 }, { "name": "thunder", "cost": 10, "dmg": 80 }, { "name": "blizzard", "cost": 10, "dmg": 60 }] player = Person(460, 65, 60, 34, [fire, thunder, blizzard, meteor, cure]) enemy = Person(1200, 65, 45, 25, magic) running = True i = 0