def create_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")
    cure = Spell("Cure", 12, 120, "white")
    cura = Spell("Cura", 18, 200, "white")

    spells = [fire, thunder, blizzard, meteor, quake, cure, cura]
    enemy_spells = [fire, meteor, cura]
    return spells, enemy_spells
Example #2
0
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")
cura = Spell("Cura", 32, 1500, "white")
curaga = Spell("Curaga", 50, 6000, "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)
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, cure, cura]
enemy_spells = [fire, meteor, curaga]
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")
water = Spell("Water", 25, 600, "Black")
thunder = Spell("Thunder", 25, 600, "Black")
meteor = Spell("Meteor", 40, 1400, "Black")
quake = Spell("Quake", 40, 1400, "Black")
blizzard = Spell("Blizzard", 50, 1450, "Black")

#Create white Magic
cure = Spell("Cure", 25, 620, "White")
cura = Spell("Cura", 50, 1500, "White")

#Create Some Items
potion = Item("Potion", "potion", "Heals 50 HP", 50)
hpotion = Item("Hi-Potion", "potion", "Heals 100 HP", 100)
elixer = Item("Elixer", "elixer", "Restores HP/MP of one party member", 999)
grenade = Item("Grenade", "attack", "Damages 500 damage", 500)

player_spell = [fire, thunder, blizzard, meteor, water, cure, cura]
enemy_spell = [fire, meteor, water, cure, blizzard]
player_items = [{
    "item": potion,
    "quantity": 15
}, {
    "item": hpotion,
    "quantity": 5
Example #4
0
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")
meteor = Spell("Thunder", 10, 100, "black")
chaos_bolt = Spell("Chaos", 10, 100, "black")
necromant = Spell("Necromant", 20, 200, "black")
corruption = Spell("Corruption", 14, 140, "black")

# Create good magic

cure = Spell("Cure", 12, 120, "white")
renew = Spell("Renew", 18, 200, "white")

# Create items - heal

potion = Item("Potion", "potion", "Heals 50 HP", 50)
greatpotion = Item("GreatPotion", "potion", "Heals 100 HP", 100)

# Create items - damage

molotov = Item("Cocktail Molotov", "bomb", "deals 500 damage", 500)

# Instantiate Player and enemy

player_spells = [fire, chaos_bolt, necromant, corruption, cure, renew]
player_items = [{"item": potion, "quantity": 5},
                {"item": greatpotion, "quantity": 3},
                {"item": molotov, "quantity": 2}]
Example #5
0
from Classes.game import Person, bcolors
from Classes.magic import Spell
from Classes.inventory import Item
import random

# Black Magic
fire = Spell("Fire", 15, 400, "Black")
thunder = Spell("Thunder", 15, 400, "Black")
blizzard = Spell("Blizzard", 15, 400, "Black")
meteor = Spell("Meteor", 30, 800, "Black")
quake = Spell("Quake", 20, 600, "Black")

# White Magic
cure = Spell("Cure", 10, 500, "White")
cura = Spell("Cura", 20, 1000, "White")
curaga = Spell("Curaga", 50, 6000, "White")

# Create some Items
potion = Item("Potion", "potion", "Heals for 250 HP", 250)
hipotion = Item("Hi-Potion", "potion", "Heals for 500 HP", 500)
superpotion = Item("Super Potion", "potion", "Heals for 1000 HP", 1000)
elixer = Item("Elixer", "elixer", "Fully Restores HP/MP of a party member",
              9999)
hielixer = Item("Mega Elixer", "elixer",
                "Fully restores HP/MP of all party members", 9999)

grenade = Item("Grenade", "attack", "Deals 500 damage", 500)

# Instantiate People
player_spells = [fire, thunder, blizzard, meteor, quake, cure, cura]
enemy_spells = [fire, meteor, curaga]
Example #6
0
from Classes.Game import Person, Colours
from Classes.magic import Spell
from Classes.inventory import Item
import random

# this is a list (array) of objects
'''magic = [{"name": "Fire", "cost": 10, "dmg": 120},
         {"name": "Thunder", "cost": 10, "dmg": 100},
         {"name": "Blizzard", "cost": 10, "dmg": 50}]'''

# list of spells
fire = Spell("Fire", 12, 120, "Cast")
thunder = Spell("Thunder", 15, 150, "Cast")
blizzard = Spell("Blizzard", 10, 80, "Cast")
meteor = Spell("Meteor", 20, 200, "Cast")
quake = Spell("Quake", 14, 100, "Cast")
light_cure = Spell("Light Cure", 10, 120, "Divine")
minor_cure = Spell("Minor Cure", 15, 240, "Divine")

# list of items
potion = Item("Potion", "potion", "heals 50 HP", 50)
high_potion = Item("High Potion", "potion", "heals 100 HP", 100)
super_potion = Item("Super Potion", "potion", "heals 500 HP", 500)
elixer = Item("Elixer", "elixer", "Fully restore HP/MP", 9999)
high_elixer = Item("Mega_elixer", "elixer",
                   "Fully restores HP/MP of all party", 9999)
grenade = Item("Grenade", "attack", "deals 500 damage", 500)

all_spells = [fire, thunder, blizzard, meteor, quake, light_cure, minor_cure]
enemy_spells = [fire, quake, light_cure]
all_items = [{
Example #7
0
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", 18, 100, "black")
meteor = Spell("Meteor", 20, 200, "black")
quake = Spell("Quake", 14, 120, "black")

# white magic
cure = Spell("Cure", 12, 120, "white")
cura = Spell("Cura", 18, 200, "white")

#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", 999)
hielixer = Item("MegaElixer", "elixer ", "restores", 9988)

granade = Item("Granade", "attack", " deals 500 dmg", 500)
player_spells = [fire, thunder, blizzard, meteor, quake, cure, cura]
player_items = [potion, hipotion, superpotion, elixer, hielixer]
#instantiate people
player = Person(460, 65, 60, 34, player_spells, player_items)
enemy = Person(1200, 65, 45, 25, [], [])
running = True
i = 0
print(Bcolors.FAIL + Bcolors.BOLD + "AN ENEMY Attacks" + Bcolors.ENDC)
while running:
Example #8
0
from Classes.game import Person, bgcolor
from Classes.magic import Spell
from Classes.Items_Bag import Items

# magic options
# -----attack  magic-----
fire = Spell("Fire", 5, 10, "attack")
blast = Spell("Blast", 15, 15, "attack")
cannon = Spell("Cannon", 20, 20, "attack")
blaze = Spell("Blaze", 10, 10, "attack")
double_blade = Spell("Double_Blade", 25, 25, "attack")
thunderstruck = Spell("ThunderStruck", 20, 30, "attack")
tornado = Spell("Tornado", 30, 25, "attack")

# -----healing magic-------
small_Heal = Spell("Small Heal", 15, 20, "heal")
big_Heal = Spell("Big Heal", 30, 40, "heal")

# player Magic
player_magic = [fire, blast, blaze, tornado, small_Heal, big_Heal]
enemy_magic = [fire, blast, blaze, tornado]

# inventory or bag items
venom = Items(
    "Venom",
    20,
    30,
    "attack",
)
spitterz = Items("Spitterz", 10, 15, "attack")
elixir = Items("Elixir", 40, 30, "heal")
Example #9
0
from Classes.game import Entity, BColors
from Classes.magic import Spell
from Classes.inventory import Item

# Available black spells.
flame = Spell("Flame", 10, 180, "Dark")
lightning = Spell("Lightning", 12, 1240, "Dark")
blizzard = Spell("Blizzard", 10, 100, "Dark")
quake = Spell("Quake", 15, 1800, "Dark")
meteor = Spell("Meteor", 20, 2500, "Dark")

# Available white spells.
cure = Spell("Cure", 12, 120, "White")
cura = Spell("Cura", 18, 200, "White")

# Items
potion = Item("Potion", "Potion", "Heals 50 HP", 50)
hi_potion = Item("HI Potion", "Potion", "Heals 100 HP", 100)
super_potion = Item("Super potion", "Potion", "Heals 500 HP", 500)
elixir = Item("Elixir", "Potion", "Fully restores HP and MP", 9999)
mega_elixir = Item("Mega Elixir", "Elixir",
                   "Fully restores party members' HP and MP", 9999)
grenade = Item("Grenade", "Weapon", "Deals 500 damage", 500)

player_spells = [flame, lightning, blizzard, meteor, cure]
player_items = [potion, hi_potion, super_potion, elixir, grenade]

# Entities
player = Entity(460, 65, 60, 34, player_spells, player_items)
enemy = Entity(1208, 65, 45, 25, [flame], [])
Example #10
0
#Import required classes
from Classes.game import BColors, Person
from Classes.magic import Spell
from Classes.inventory import Item
#import required modules
import random

#Create Black Magic To Attach
fire = Spell("Fire", 15, 300, "black")
thunder = Spell("Thunder", 25, 500, "black")
blizzard = Spell("Blizzard", 45, 800, "black")
meteor = Spell("Meteor", 70, 1200, "black")
quake = Spell("Quake", 110, 2000, "black")

#Create White Magic To Heal
cure = Spell("Cure", 50, 600, "white")
cura = Spell("Cura", 100, 1500, "white")

#Creat Players' 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", 100, 5)
elixir = Item("Elixir", "elixir", "Fully restores HP/MP of one party member",
              9999, 5)
megaelixir = Item("Mega Elixir", "elixir", "Fully restores party's HP/MP",
                  9999, 2)
grenade = Item("Grenade", "attack", "Deals 500 damage", 900, 5)

#Instantiate Players
player_spells = [fire, thunder, blizzard, meteor, quake, cure, cura]
player_items = [potion, hipotion, superpotion, elixir, megaelixir, grenade]
Example #11
0
from Classes.game import Person, bcolors
from Classes.magic import Spell
from Classes.inventory import Item
import random

# Create Black Magic
fire = Spell("Fire", 20, 60, "black")
fireball = Spell("Fireball", 80, 120, "black")
godFire = Spell("GodFire", 350, 800, "black")
void = Spell("Void", 600, 1200, "black")
meteor = Spell("meteor", 50, 120, "black")
end = Spell("end", 100, 300, "black")

# Create White Magic
cure = Spell("Cure", 60, 100, "white")
hyperRestore = Spell("Hyper Restore", 90, 200, "white")

# Create Items
potion = Item("Potion", "potion", "Heals 50 HP", 50)
super_potion = Item("Super Potion", "potion", "Heals 150 HP", 150)
mana_potion = Item("Mana Potion", "potion", "Restore 50 MP", 50)
magic_potion = Item("Magic Potion", "potion", "Restore 200 MP", 200)
max_potion = Item("Max Potion", "elixir", "Fully restore  HP/MP", 999999)
mega_elixir = Item("Mega Elixir", "elixir", "Fully restore HP/MP for party's members", 999999)

dynamite = Item("Dynamite", "attack", "Hit for 200 HP enemy", 200)

player_spells = [fire, fireball, godFire, void, cure, hyperRestore]
enemy_spells = [meteor, end, cure]

player_items = [{"item": potion, "quantity": 5}, {"item": super_potion, "quantity": 2},
Example #12
0
from Classes.game import Person, bcolors
from Classes.magic import Spell
from Classes.Inventory import Item


#Create offensive magic
spell_fire = Spell("Fire", 10, 100, "Earth")
spell_thunder = Spell("Thunder", 10, 120, "Weather")
spell_blizzard = Spell("Blizzard", 15, 140, "Weather")
spell_meteor = Spell("Meteor", 20, 220, "Black")
spell_quake = Spell("Quake", 20, 220, "Earth")

#Create def magic
spell_cure = Spell("Cure", 10, 120, "Life")
spell_cura = Spell("Cura", 15, 250, "Life")

# Create items
item_potion = Item("Potion", "Potion", "Heals for 50 HP", 50)
item_hipotion = Item("Hi-Potion", "Potion", "Heals for 150 HP", 150)
item_superpotion = Item("Super-Potion", "Potion", "Heals for 250 HP", 250)
item_elixer = Item("Elixer", "Elixer", "Fully restores HP/MP of target", 0)
item_megaelixer = Item("Mega-Elixer", "Elixer", "Fully restores HP/MP of party", 0)
item_fraggrenade = Item("Frag Grenade", "Thrown Weapon", "Short fuse grenade", 150)
item_hegrenade = Item("HE Grenade", "Thrown Weapon", "High Explosive grenade", 500)

#Initialise characters
player_spells = [spell_cure, spell_fire, spell_blizzard]
player_items = [item_fraggrenade, item_potion, item_superpotion, item_elixer]

player = Person(460, 65, 60, 34, player_spells,player_items)
enemy = Person(1200, 65, 45, 25, [spell_cure, spell_thunder, spell_meteor],[item_hegrenade])
Example #13
0
import random
from Classes.game import Person, bcolors
from Classes.magic import Spell
from Classes.inventory import Item

print("\n\n")

# Create black magic
fire = Spell("Fire", 10, 100, "Black")
thunder = Spell("Thunder", 10, 100, "Black")
blizzard = Spell("Frost", 10, 100, "Black")
meteor = Spell("Blast", 20, 200, "Black")
quack = Spell("Shake", 14, 140, "Black")

# Create white magic
cure = Spell("Cure", 12, 120, "white")
cura = Spell("Cura", 18, 200, "white")

# Create Items
potion = Item("Potion", "Restore", "Restores 50 HP", 50)
superpotion = Item("Super potion", "Restore", "Restores 100 HP", 100)
megapotion = Item("Mega potion", "Restore", "Restores 500 HP", 500)
elixer = Item("Elixer", "Restore",
              "Restores all HP/MP of one member of the party", 9999)
megaelixer = Item("Mega elixer", "Restore",
                  "Restores all HP/MP of all members of the party", 9999)
granade = Item("Granade", "destruction", "Deals 150 damage points to enemy",
               150)

player_spells = [fire, thunder, blizzard, meteor, quack, cure, cura]
enemy_spells = [fire, meteor, cure]
Example #14
0
# I want to test 2

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, 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, 100, "White")
cura = Spell("Cura", 18, 200, "White")
# items
potion = Item("Potion", "potion", "Heals 50 HP", 50)
elixir = Item("Elixir", "elixir", "Restores Party's HP/MP", 9999)
grenade = Item("Grenade", "attack", "deals 500 damage", 500)

player_items = [{
    "item": potion,
    "quantity": 5
}, {
    "item": elixir,
    "quantity": 5
}, {
    "item": grenade,
Example #15
0
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, 100, 'black')
thunder = Spell('Thunder', 25, 100, 'black')
meteor = Spell('Meteor', 25, 100, 'black')
blizzard = Spell('Blizzard', 40, 100, 'black')
quake = Spell('Quake', 18, 100, 'black')

#Create White Magic
cure = Spell ('Cure', 25, 620, 'white')
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', 500)
elixer = Item('Elixer', 'elixer', 'Fully restores HP/MP of one party member', 9990)
hielixer = Item('Megaelixer', 'elixer', "Fully restores party's HP/MP", 9990)

grenade = Item('Grenade', 'attack', 'Deals 300 damage', 300)

player_spells = [fire, thunder, meteor, blizzard, quake,  cure, cura]
enemy_spells = [fire, meteor, cure]
player_item = [{'item': potion, 'quantity': 15}, {'item': hipotion, 'quantity': 5},
               {'item': superpotion, 'quantity': 5}, {'item': elixer, 'quantity': 5},
               {'item': hielixer, 'quantity': 5}, {'item': potion, 'quantity': 2},
Example #16
0
from Classes.game import Person,bcolors
from termcolor import colored
from Classes.magic import Spell
import random
# Create Black Magic
fire = Spell("Fire",10,60,"black")
thunder = Spell("Thunder",15,120,"black")
quake = Spell("Quake",25,230,"black")

#Create healing magic
cure= Spell ("Cure",12,120,"white")
love= Spell ("Love",20,240,"white")

#all the magic in one place
magic=[fire,thunder,quake,cure,love]


player = Person(500,65,30,magic)
enemy = Person(500,65,30,magic)


running =True 
i=0
##PLAYER CHOICE FOR ATTACK##
print(colored("ATTACK", "red"))
while running:
    print("*************************************")
    #Allowing player to choose between attack and magic 
    player.choose_action()
    #minus 1 as indexing starts from 0
    choice=int(input("Choose action:"))-1