Ejemplo n.º 1
0
def load_inventory():
    inventory = [
        Item("Potion", "potion", "Heals 50 HP", 50, 5),
        Item("Hi-Potion", "potion", "Heals 100 HP", 100, 3),
        Item("Super-Potion", "potion", "Heals 200 HP", 200, 2),
        Item("Elixir", "elixir", "Full recovery of one user", 9999, 1),
        Item("Mega-Elixir", "Mega-elixir", "Full recovery", 9999, 1),
        Item("Grenade", "attack", "It Explodes. Hit for 500 HP", 500, 1)
    ]

    return inventory
Ejemplo n.º 2
0
fire = Spell("Fire", 10, 120, "black")
thunder = Spell("Thunder", 10, 120, "black")
blizzard = Spell("Blizzard", 10, 120, "black")
meteor = Spell("Meteor", 20, 200, "black")
quake = Spell("Quake", 14, 140, "black")
black_magick = [fire, thunder, blizzard, meteor, quake]

# Create White Magic

cure = Spell("Cure", 12, 120, 'white')
cura = Spell('Cura', 18, 200, 'white')
white_magick = [cure, cura]

# Create Items
potion = Item("Potion", "potion", "Heals 50 HP", 50, 3)
hi_potion = Item("Hi-Potion", "potion", "Heals 100 HP", 100, 1)
super_potion = Item("Super-Potion", "potion", "Heals 500 HP", 500, 1)
elixir = Item("Elixir", "elixir", "Replenishes the mp and hp of a party "
              "member", 9999, 1)
hi_elixir = Item("Hi-Elixer", "elixir", "Replenishes the whole party's hp and "
                 "mp", 9999, 1)
grenade = Item("Grenade", "attack", "Deals 500 damage", 500, 2)

# player inventory
player_items = [potion, hi_potion, super_potion, elixir, hi_elixir, grenade]

# Instantiate player and enemy
player_Boromir = Person("Boromir", 450, 65, 60, 34,
                        black_magick + white_magick, player_items)
player_Rohomir = Person("Rohomir", 420, 85, 20, 34,
Ejemplo n.º 3
0
from classes.game import Person, bcolors, Imp, Enemy
from classes.spell import Spell
from classes.inventory import Item
import random


fire = Spell('Fire', 10, 60, 'black')
thunder = Spell('Thunder', 10, 60, 'black')
blizzard = Spell('Blizzard', 10, 60, 'black')
meteor = Spell('Meteor', 15, 70, 'black')
quake = Spell('Quake', 20, 80, 'black')
        
cure = Spell('Cure', 15, 40, 'white')
heal = Spell('Heal', 20, 45, 'white')

potion = Item('Potion', 'potion', 'Heal 50 HP', 50)
hipotion = Item('Hi-Potion', 'potion', 'Heal 100 HP', 100)
elixir = Item('Elixir', 'elixir', 'Fully heal HP/MP of one party member', 9999)
mega_elixir = Item('Mega Elixir', 'elixir', 'Fully heal HP/MP of all party member', 9999)
grenade = Item('Grenade', 'attack', 'Deal 100 damage', 100)

player1_items = [{'item' : potion, 'quantity' : 5}, 
                {'item' : hipotion, 'quantity' : 2}, 
                {'item' : elixir, 'quantity' : 1}, 
                {'item' : mega_elixir, 'quantity' : 1},
                {'item' : grenade, 'quantity' : 1}
                ]
                
player2_items = [{'item' : potion, 'quantity' : 5}, 
                {'item' : hipotion, 'quantity' : 2}, 
                {'item' : elixir, 'quantity' : 1}, 
Ejemplo n.º 4
0
import random

# Create black magic
fire = Spell("Fire", 10, 300, "Black")
thunder = Spell("Thunder", 10, 300, "Black")
blizzard = Spell("Blizzard", 10, 300, "Black")
meteor = Spell("Meteor", 20, 500, "Black")
quake = Spell("Quake", 14, 280, "Black")

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

# Create items

potion = Item("Potion", "potion", "Heals 50 damage", 50)
hipotion = Item("Hi-Potion", "potion", "Heals 100 damage", 100)
megapotion = Item("Mega-Potion", "potion", "Heals 500 damage", 500)
elixer = Item("Elixer", "elixer", "Restores full HP/MP of one party member",
              9999)
megaelixer = Item("Mega-Elixer", "elixer",
                  "Restores full HP/MP of all party members", 9999)
grenade = Item("Grenade", "attack", "Attacks enemy for 500 HP", 500)

player_spells = [fire, thunder, blizzard, meteor, quake, cure, cura]
player_items = [{
    "item": potion,
    "quantity": 15
}, {
    "item": hipotion,
    "quantity": 5
Ejemplo n.º 5
0
print("\n\n")

# Create black magic
fire = Spell("Fire      75 ", 10, 75, "black")
thunder = Spell("Thunder   100", 15, 100, "black")
blizzard = Spell("Blizzard  125", 17, 250, "black")
meteor = Spell("Meteor    190", 25, 500, "black")
quake = Spell("Quake     500", 40, 700, "black")

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

#Create some items
potion = Item("Potion", "potion", "Heals 50HP", 50)
hipotion = Item("Alex's 'special' potion", "potion", "Heals 100HP", 100)
Bob = Item("Bob piss", "potion", "Heals 200HP", 200)
elixer = Item("Elixer", "elixer", "Fully restores HP/MP of one party member",
              9999)
hielixer = Item("Fruity elixer", "elixer",
                "Fully restores HP/MP for whole party", 9999)
poison = Item("Literal poison", "potion", "Why would you, you dumb f**k", -10)
battery = Item("Dodgy battery", "attack", "????", 300)

player_spells = [fire, thunder, blizzard, meteor, cure, cura]
player_items = [{
    "item": potion,
    "quantity": 5
}, {
    "item": hipotion,
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", 50)
highpotion = Item("Hi-Potion", "potion", "Heals 100", 100)
superpotion = Item("Super-Potion", "potion", "Heals 500", 500)
elexir = Item("Elexir", "elixir", "Fully restores HP", 9999)
hielixir = Item("MegaElixir", "elixir", "Fully restores party HP", 9999)

granade = Item("Granade", "attack", "Deals 500 damage", 500)

player_spells = [fire, thunder, blizzard, meteor, quake, cure, cura]
player_items = [{
    "item": potion,
    "quantity": 15
}, {
    "item": highpotion,
    "quantity": 5
}, {
Ejemplo n.º 7
0
from classes.inventory import Item

# BLACK MAGIC
fire = Spell("Fire", 32, 520, "Black")
thunder = Spell("Thunder", 50, 600, "Black")
blizzard = Spell("Blizzard", 47, 570, "Black")
meteor = Spell("Meteor", 45, 550, "Black")
quake = Spell("Quake", 35, 540, "Black")

# WHITE MAGIC
cure = Spell("Cure", 45, 520, "White")
bura = Spell("Bura", 55, 550, "White")
heloy = Spell("Heloy", 59, 570, "White")

# CREATE SOME ITEMS
potion = Item("Potion", "potion", "Heals 50 health points", 700)
hi_potion = Item("Hi-Potion", "potion", "Heals 100 health points", 1500)
super_potion = Item("Super-Potion", "potion", "Heals 500 health points", 3000)
elixer = Item("Elixer", "elixer",
              "Fully restores health points / magic points of one party member", 9999)
mega_elixer = Item("Mega-Elixer", "elixer",
                   "Fully restores party's health points / magic points", 9999)
grenade = Item("Grenade", "attack", "Deals 500 damage", 2200)

player_spells = [fire, thunder, blizzard, meteor, quake, cure, bura, heloy]
enemy_spells = [fire, thunder, cure]
player_items = [
    {"item": potion, "qty": 2},
    {"item": hi_potion, "qty": 3},
    {"item": super_potion, "qty": 5},
    {"item": elixer, "qty": 2},
Ejemplo n.º 8
0
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, 'Quantity': 5},
                 {'item': superpotion, 'Quantity': 5},
                 {'item': elixir, 'Quantity': 5},
                 {'item': hielixir, 'Quantity': 5},
                 {'item': grenade, 'Quantity': 5}]
Ejemplo n.º 9
0
import os
import time

#Magic spells
fireBall = Spell("FireBall", 10, 100, "black")
thunder = Spell("Thunder Strike", 9, 90, "black")
blizzard = Spell("Blizzard", 8, 80, "black")
meteor = Spell("Meteor", 20, 180, "black")
quake = Spell("Earth Quake", 15, 140, "black")

#White magic
cure = Spell("Cure", 12, 120, "white")
greaterCure = Spell("Greater Cure", 18, 200, "white")

## Create items
potion = Item("Potion", "potion", "Heals 50 HP", 50)
big_potion = Item("Big-Potion", "potion", "Heals 100 HP", 100)
super_potion = Item("Super Potion", "potion", "Heals 500 HP", 500)
elixer_potion = Item("Red Elixer", "elixer", "Heals 100% HP", 9999)

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

player_spells = [fireBall, thunder, blizzard, meteor, quake, cure, greaterCure]
player_items = [potion, big_potion, super_potion, elixer_potion, grenade]

#people
player = Person(460, 65, 60, 34, player_spells, player_items)
enemy = Person(1200, 65, 45, 25, [], [])

running = True
Ejemplo n.º 10
0
# Healing spells:
refresh = Spell("Refresh", 25, 620, "white")
refresh2 = Spell("Refresh II", 32, 1500, "white")
refresh3 = Spell("Refresh III", 50, 6000, "white")

# Spells usable by enemies
# Offensive spells:
sixShot = Spell("Static Burst", 25, 600, "black")
quickDraw = Spell("Graviton Cannon", 250, 600, "black")
chargedShot = Spell("Bash", 25, 600, "black")
dustEye = Spell("Electromagnetic Wave", 40, 1200, "black")
hackTech = Spell("System Overload", 14, 140, "black")

# Create items
potion = Item("Tonic", "potion", "Heals 50 HP", 50)
hipotion = Item("Hi-tonic", "potion", "Heals 100 HP", 100)
superpotion = Item("Super Tonic", "potion", "Heals 1000 HP", 1000)
elixir = Item("Nano Lubricant", "elixir",
              "Fully restores HP/MP of one party member", 9999)
megaelixir = Item("Super Nano Lubricant", "elixer",
                  "Fully restores party's HP/MP", 9999)

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

player_spells = [
    staticBurst, gravitonCannon, bash, electromagneticWave, systemOverload,
    refresh, refresh2, refresh3
]
player_items = [{
    "item": potion,
Ejemplo n.º 11
0
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", 45, 1400, "black")

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

# Items
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)
Ejemplo n.º 12
0
from classes.inventory import Item

# Black Magic's
fire = Spell("Fire", 15, 150, "black")
thunder = Spell("Thunder", 20, 200, "black")
blizzard = Spell("Blizzard", 15, 100, "black")
meteor = Spell("Meteor", 10, 150, "black")
quake = Spell("Quake", 20, 250, "black")

# White Magic's
cure = Spell("Cure", 15, 120, "white")
cura = Spell("Cura", 20, 250, "white")
mana = Spell("MP+", 0, 30, "blue")

# 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,
Ejemplo n.º 13
0
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")
heaven = Spell("Heaven", 18, 200, "White")

# Create Items
small_potion = Item("Small health potion", "Potion", "Heals 50 HP", 50)
med_potion = Item("Medium health potion", "Potion", "Heals 100 HP", 100)
large_potion = Item("Large health potion", "Potion", "Heals 300 HP", 300)
small_elixer = Item("Small elixer", "Elixer", "Restores 25 MP", 25)
large_elixer = Item("Large elixier", "Elixer", "Restores 50 MP", 50)

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
}, {
Ejemplo n.º 14
0
import random

#creating black magic
fire = Spell('Fire', 25, 500, 'black')
thunder = Spell('Thunder', 25, 600, 'black')
blizzard = Spell('Blizzard', 25, 800, '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')

# 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', 'Full restores HP/MP of 1 party member',
              9999)
megaelixir = Item('MegaElixir', 'elixir', 'Full restores party\'s HP/MP', 9999)
grenade = Item('Grenade', 'attack', 'Deals 500 damage', 500)

player_spell = [fire, thunder, blizzard, meteor, cure, cura]
player_items = [{
    'item': potion,
    'quantity': 15
}, {
    'item': hipotion,
    'quantity': 5
}, {
Ejemplo n.º 15
0
from classes.inventory import Item

# magic
# Create Black Magic
fire = Spell('Fire', 10, 150, 'black')
thunder = Spell('Thunder', 12, 170, 'black')
blizzard = Spell('Blizzard', 15, 200, "black")
meteor = Spell('Meteor', 20, 250, "black")
quake = Spell('Quake', 8, 120, "black")

# Create White Magic
cure = Spell('Cure', 10, 150, "white")
cura = Spell('Cura', 18, 250, "white")

# Items
potion = Item("Potion", "potion", "Restore 50HP", 50)
hipotion = Item("Hi-Potion", "hipotion", "Restore 100HP", 100)
superpotion = Item("SuperPotion", "superpotion", "Restore 200HP", 200)
elixir = Item("Elixir", "elixir",
              "Fully restore HP/MP for one member of party", 9999)
hielixir = Item("HiElixir", "hielixir",
                "Fully restore HP/MP for all members of party", 9999)

grenade = Item("Grenade", "attack", "Deal 500HP damage", 500)

player_spell = [fire, thunder, blizzard, meteor, quake, cure, cura]
player_item = [{
    "item": potion,
    'quantity': 10
}, {
    'item': hipotion,
Ejemplo n.º 16
0
ice = Spell("Ice Spear", 30, 895, "Elemental")
shadow = Spell("Shadow Strike", 115, 910, "Elemental")

# Enemy's Element Magic
darkness = Spell("Darkness", 50, 800, "Elemental")
acid = Spell("Acid Breath", 70, 900, "Elemental")
sand = Spell("Sand Attack", 30, 400, "Elemental")
scorch = Spell("Scorched Earth", 100, 1000, "Elemental")

# Healing Magic
cure = Spell("Cure", 22, 320, "Healing")
cura = Spell("Strong Cure", 40, 200, "Healing")
bigcure = Spell("Power Cure", 40, 2000, "Healing")

# Create Items
potion1 = Item("Healing Potion", "potion", "Heals 50 HP", 50)
potion2 = Item("Strong Potion", "potion", "Heals 100 HP", 100)
potion3 = Item("Cure All Potion", "potion", "Heals 500 HP", 500)
lemonade = Item("Sandwich", "elixir", "Fully restores HP or MP", 10000)
limeade = Item("MegaSandwich", "elixir",
               "Fully restores party member's HP or MP", 10000)
star = Item("Throwing Stars", "attack", "Deals 150 damage", 150)

# Instantiate Characters
player_spells = [fire, water, ice, shadow, cure, cura]
player_items = [{
    "item": potion1,
    "quantity": 15
}, {
    "item": potion2,
    "quantity": 5
Ejemplo n.º 17
0
print("NAME               HP                                   MP")
print("                   _________________________            __________")

# Create attacks
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")
ayur = Spell("Ayur", 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)
elixir = Item("Elixir", "elixir", "Fully restore HP / MP of one parity member",
              9999)
hiElixir = Item("MegaElixir", "elixir", "Fully rstores party's HP / MP", 9999)

# Create a grenade item
grenade = Item("Grenade", "atatck", "Deals 500 Damage", 500)

# Create a list of spells and items to be used by player
player_spells = [fire, thunder, blizzard, meteor, cure, ayur]
player_items = [{
    "item": potion,
    "quantity": 15
}, {
Ejemplo n.º 18
0
#Black magic

fire = spell("fire", 10, 100, "black")
Thunder = spell("Thunder", 10, 100, "black")
Rage = spell("Rage", 10, 100, "black")
Quake = spell("Quake", 10, 100, "black")
Blizzard = spell("Blizzard", 10, 100, "black")

#White Magic

cure = spell ("cure", 12, 120, "white")
cura = spell ("cura", 15, 200, "white")

# 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
Ejemplo n.º 19
0
import random

# Create Black Magic
fire = Spell("Fire Ball", 10, 100, "black")
thunder = Spell("Thunder Bolt", 10, 124, "black")
blizzard = Spell("Freezing Blizzard", 10, 100, "black")
meteor = Spell("Meteor Strike", 25, 250, "black")
quake = Spell("Fire Ball", 14, 140, "black")

# Create White Magic
cure = Spell("Cure", 12, 120, "white")
cura = Spell("Cura", 18, 200, "white")
curaga = Spell("Cura", 18, 500, "white")

# Create Potion Items
potion = Item("Restore", "potion", "Heals 50 HP", 50)
hipotion = Item("Large Restore", "potion", "Heals 100 HP", 100)
superpotion = Item("Full Restore", "potion", "Heals all HP", 9999)

# Create Elixer Items
elixer = Item("Elixer", "elixer", "Fully restores HP/MP of one party member",
              9999)
hielixer = Item("Mega Elixer", "elixer",
                "Fully restores HP/MP of entire party", 9999)

# Create Attack Items
grenade = Item("Cherry Bomb", "attack", "Deals 500 damage", 500)

player_spells = [fire, thunder, blizzard, meteor, cure, cura]
player_items = [{
    "item": potion,
Ejemplo n.º 20
0
from classes.magic import Spell
from classes.inventory import Item

# Create Black Magic
fire = Spell("Fire", 10, 100, "black")
thunder = Spell("Thunder", 12, 120, "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 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)
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}]
Ejemplo n.º 21
0
import random

#instantiate spells
#Black magic
fire = Spell("Fire", 10, 100, "black")
thunder = Spell("Thunder", 20, 200, "black")
blizzard = Spell("Blizzard", 15, 150, "black")
meteor = Spell("Meteor", 8, 80, "black")
quake = Spell("Quake", 12, 120, "black")

#white magic
cure = Spell("Cure", 10, 100, "white")
heal = Spell("Heal", 20, 200, "white")

#instantiate items
potion_clw = Item("CLW Potion", "potion", "A potion to heal 50 HP", 50)
potion_csw = Item("CSW Potion", "potion", "A potion to heal 100 HP", 100)
potion_heal = Item("Heal Potion", "potion",
                   "A potion to Heal the player for 200 HP", 200)
potion_restore = Item("Restore Player Potion", "elixer",
                      "A potion to restore the player of all HP and MP", 9999)
potion_restoreParty = Item("Restore Party Potion", "elixer",
                           "A potion to restore the party of all HP and MP",
                           9999)

grenade = Item("Holy Hand Grenade", "weapon",
               "A Holy Hand Grenade, doing 200 damage", 200)

spells = [fire, thunder, blizzard, meteor, quake, cure, heal]
items = [{
    "item": potion_clw,
Ejemplo n.º 22
0
print(Fore.CYAN + "Cyan" + Fore.RESET)
print(Fore.WHITE + "White" + Fore.RESET)
print()

# Create Magic
fire = Spell("Fire", "black", 100, 10)
thunder = Spell("Thunder", "black", 100, 10)
blizzard = Spell("Blizzard", "black", 100, 10)
quake = Spell("Quake", "black", 150, 15)
meteor = Spell("Meteor", "black", 200, 20)
cure = Spell("Cure", "white", 100, 10)
cura = Spell("Cura", "white", 200, 20)
curaga = Spell("Curaga", "white", 300, 30)

# 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)
Ejemplo n.º 23
0
# Black magic

Fire = Spell("Fire", 10, 50, "black")
Thunder = Spell("Thunder", 15, 75, "black")
Blizzard = Spell("Blizzard", 20, 100, "black")
Meteor = Spell("Meteor", 25, 120, "black")
Quake = Spell("Quake", 30, 150, "black")

# White magic

cure_level1 = Spell("Cure", 15, 75, "White")
cure_level2 = Spell("Cure", 25, 125, "White")

# Adding Items

potion = Item("Potion", "potion", "Heals 50 HP", 50)
ultra_potion = Item("Ultra potion", "potion", "Heals 100 HP", 100)
super_potion = Item("Super potion", "potion", "Heals 150 HP", 150)
elixir = Item("Elixir", "elixir",
              "Fully restores HP/MP of one of the party member", 9999)
mega_elixir = Item("Mega elixir", "elixir", "Fully restores party's HP/MP",
                   9999)
grenade = Item("Grenade", "attack", "Attacks for 500 HP", 500)

player_spell = [
    Fire, Thunder, Blizzard, Meteor, Quake, cure_level1, cure_level2
]
player_items = [{
    "item": potion,
    "quantity": 15
}, {
Ejemplo n.º 24
0
from classes.inventory import Item

# black magic
fire = Spell("Fire", 10, 500, "black")
thunder = Spell("Thunder", 12, 580, "black")
blizzard = Spell("Blizzard", 14, 640, "black")
meteor = Spell("Meteor", 16, 720, "black")
blake = Spell("Blake", 18, 800, "black")

# white magic
cure = Spell("Cure", 12, 620, "white")
cura = Spell("Cura", 16, 1500, "white")

player_magic = [fire, thunder, blizzard, meteor, blake, cure, cura]

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)
elixir = Item("Elixir", "elixer", "Fullly restores HP on one member", 99999)
hielixir = Item("MegaElixir", "elixer", "Fullly restores HP for all", 99999)

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

player1_items = [{
    "item": potion,
    "quantity": 5
}, {
    "item": hipotion,
    "quantity": 3
}, {
    "item": superpotion,
Ejemplo n.º 25
0
from classes.magic import Spell
from classes.inventory import Item

# Create offensive spells
fireball = Spell("Fireball", 10, 100, "offensive")
thunder = Spell("Thunder", 11, 110, "offensive")
blizzard = Spell("Blizzard", 10, 100, "offensive")
meteor = Spell("Meteor", 20, 200, "offensive")
earthquake = Spell("Earthquake", 14, 140, "offensive")

# Create defensive spells
cure = Spell("Cure", 12, 120, "defensive")
powerful_cure = Spell("Powerful cure", 18, 200, "defensive")

# Create Items
potion = Item("Potion", "potion", "Heals 50 HP", 50)
big_potion = Item("Big potion", "potion", "Heals 100 HP", 100)
super_potion = Item("Super potion", "potion", "Heals 300 HP", 300)
elixir = Item("Elixir", "elixir", "Fully restores HP/MP of one party member",
              9999)
mega_elixir = Item("Mega elixir", "elixir", "Fully restores party's HP/MP",
                   9999)

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

# Inventory and spellBook
player_spells = [
    fireball, thunder, blizzard, meteor, earthquake, cure, powerful_cure
]
player_items = [{
    "item": potion,
Ejemplo n.º 26
0
import random

# Create Black Magic
fire = Spell("Wild Fire", 25, 640, "black")
lightning = Spell("Lightning Strike", 30, 700, "black")
water = Spell("Tsunami", 20, 600, "black")
meteor = Spell("Meteor Shower", 40, 1200, "black")
quake = Spell("Earthquake", 28, 850, "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", 250)
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
Ejemplo n.º 27
0
# 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', 35, 1500, 'white')
curage = Spell('Curaga', 50, 6000, 'white')

# 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 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, curage]

player_items = [{'item': potion, 'quantity': 15}, 
                {'item': hipotion, 'quantity': 5}, 
                {'item': superpotion, 'quantity': 5}, 
                {'item': elixer, 'quantity': 5},
Ejemplo n.º 28
0
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", 60, 200, "black")
quake = Spell("quake", 14, 140, "black")

# create white magic
cure = Spell("cure", 12, 120, "white")
cura = Spell("cura", 18, 180, "white")

#create some items
potion = Item("Potion", "potion", "Heals for 50 HP.", 50)
hipotion = Item("HI-Potion", "potion", "Heals for 100 HP.", 100)
superpotion = Item("Super Potion", "potion", "Heals for 500 HP.", 500)
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 for 500 damage.", 500)

player_spells = [fire, thunder, blizzard, meteor, quake, cura, cure]
player_items = [{
    'item': potion,
    'quantity': 15
}, {
    'item': hipotion,
Ejemplo n.º 29
0
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]
player_items = [{
    "item": potion,
    "quantity": 15
}, {
    "item": hipotion,
Ejemplo n.º 30
0
    def startFight(self):
        fight = True

        print("Loading configuration...")

        dataLoader = JsonLoader()

        config = Config("./config/", dataLoader)
        config.loadConfigs()

        stats = Statistics(self.message)

        actions = Actions(self.message)

        actionElements = ["Attack", "Cast spell",
                          "Use item", "Check characters' statistics"]

        players = []
        enemies = []
        spells = []
        items = []

        for spell in config.getSpells():
            spells.append(
                Spell(spell["name"], spell["cost"], spell["value"], spell["school"]))

        for item in config.getItems():
            items.append(Item(item["name"], item["itemType"],
                              item["description"], item["value"]))

        for player in config.getPlayers():
            players.append(Character(player["name"], player["hp"], player["mp"],
                                     player["atk"], player["df"], player["spells"], player["items"]))

        for enemy in config.getEnemies():
            enemies.append(Character(enemy["name"], enemy["hp"], enemy["mp"],
                                     enemy["atk"], enemy["df"], enemy["spells"], enemy["items"]))

        alivePlayers = players
        aliveEnemies = enemies
        deadPlayers = []
        deadEnemies = []

        # time.sleep(3)

        print("Loading done.")

        # time.sleep(2)

        print("Starting fight!")

        # time.sleep(3)

        while fight:

            self.message.playerTurn()

            for player in alivePlayers:
                stats.getStats(alivePlayers, aliveEnemies)
                print("Current character: " + player.name)
                takenAction = False
                while not takenAction:
                    self.menu.display("Actions", actionElements)
                    actionChoice = self.menu.getChoice(
                        actionElements, "Choose action")
                    attack = False
                    normalAttack = False
                    heal = False
                    elixer = False

                    if actionChoice == 3:
                        self.message.players()
                        stats.getAttrs(alivePlayers)
                        self.message.enemies()
                        stats.getAttrs(aliveEnemies)
                        continue

                    elif actionChoice == 0:
                        value = player.getAtk()
                        attack = True
                        normalAttack = True
                    elif actionChoice == 1:
                        playerSpells = player.getSpells()
                        if not playerSpells:
                            continue

                        spellsName = []
                        for i in playerSpells:
                            spellsName.append(spells[i].getName() + " (value: " + str(spells[i].getValue())
                                              + ", cost: " + str(spells[i].getCost()) + ")")
                        spellsName.append("Back")

                        self.menu.display("Spells", spellsName)
                        spellChoice = self.menu.getChoice(
                            spellsName, "Choose spell")

                        if spellChoice == len(spellsName) - 1:
                            continue

                        chosenSpell = spells[playerSpells[spellChoice]]
                        casted = actions.castSpell(player, chosenSpell, True)

                        if not casted:
                            continue
                        elif casted:
                            value = chosenSpell.getValue()

                        if chosenSpell.getSchool() == "attack":
                            attack = True
                        elif chosenSpell.getSchool() == "white":
                            heal = True
                    elif actionChoice == 2:
                        playerItems = player.getItems()
                        if not playerItems:
                            continue
                        itemsName = []
                        for i in playerItems:
                            id = i["id"]
                            quantity = str(i["quantity"])
                            itemsName.append(items[id].getName()
                                             + " - " + items[id].getDescription() + " (" + quantity + "x)")
                        itemsName.append("Back")

                        self.menu.display("Items", itemsName)
                        itemChoice = self.menu.getChoice(itemsName, "Choose item")

                        if itemChoice == len(itemsName) - 1:
                            continue

                        chosenItem = ItemManager(items[playerItems[itemChoice]["id"]],
                                                 playerItems[itemChoice]["quantity"])

                        used = actions.useItem(
                            player, chosenItem, itemChoice, True)

                        if not used:
                            continue
                        else:
                            value = chosenItem.getItem().getValue()

                        if chosenItem.getItem().getType() == "potion":
                            heal = True
                        elif chosenItem.getItem().getType() == "attack":
                            attack = True
                        elif chosenItem.getItem().getType() == "elixer":
                            elixer = True

                    if attack == True:
                        enemiesName = []
                        for enemy in aliveEnemies:
                            enemiesName.append(enemy.getName())
                        enemiesName.append("Back")

                        self.menu.display("Enemies", enemiesName)
                        enemyChoice = self.menu.getChoice(
                            enemiesName, "Choose enemy")

                        if enemyChoice == len(enemiesName) - 1:
                            continue

                        if normalAttack:
                            defense = round(
                                aliveEnemies[enemyChoice].getDf() / 50)
                            if defense == 0:
                                defense = 1

                            value = round(value / defense)

                        actions.attack(
                            player, aliveEnemies[enemyChoice], value)
                    elif heal == True:
                        actions.heal(player, value)
                    elif elixer == True:
                        actions.elixer(player)

                    takenAction = True

                deadEnemies = CheckAlive.getDead(
                    deadEnemies, aliveEnemies, self.message)
                aliveEnemies = CheckAlive.getAlive(aliveEnemies)

                if not aliveEnemies:
                    print("Won")
                    fight = False
                    break

            self.message.enemyTurn()
            for enemy in aliveEnemies:
                takenAction = False
                while not takenAction:
                    attack = False
                    normalAttack = False
                    heal = False
                    elixer = False
                    actionChoice = random.randint(0, 2)

                    if actionChoice == 0:
                        attack = True
                        normalAttack = True
                    elif actionChoice == 1:
                        enemiesSpells = enemy.getSpells()
                        if not enemiesSpells:
                            continue
                        spellChoice = random.randrange(0, len(enemiesSpells))

                        chosenSpell = spells[enemiesSpells[spellChoice]]

                        if chosenSpell.getSchool() == "white" and enemy.getHp() >= enemy.getMaxHp() * 0.9:
                            continue

                        casted = actions.castSpell(enemy, chosenSpell)

                        if not casted:
                            continue
                        elif casted:
                            value = chosenSpell.getValue()

                        if chosenSpell.getSchool() == "attack":
                            attack = True
                        elif chosenSpell.getSchool() == "white":
                            heal = True
                    elif actionChoice == 2:
                        enemyItems = enemy.getItems()
                        if not enemyItems:
                            continue

                        itemChoice = random.randrange(0, len(enemyItems))

                        chosenItem = ItemManager(items[enemyItems[itemChoice]["id"]],
                                                 enemyItems[itemChoice]["quantity"])

                        if enemy.getHp() >= enemy.getMaxHp() * 0.9:
                            enoughHp = False
                        else:
                            enoughHp = True

                        if enemy.getMp() >= enemy.getMaxMp() * 0.9:
                            enoughMp = False
                        else:
                            enoughMp = True

                        if chosenItem.getItem().getType() == "Potion" and not enoughHp:
                            continue
                        elif chosenItem.getItem().getType() == "Elixer" and (not enoughHp or not enoughMp):
                            continue

                        used = actions.useItem(enemy, chosenItem, itemChoice)

                        if not used:
                            continue
                        else:
                            value = chosenItem.getItem().getValue()

                        if chosenItem.getItem().getType() == "potion":
                            heal = True
                        elif chosenItem.getItem().getType() == "attack":
                            attack = True
                        elif chosenItem.getItem().getType() == "elixer":
                            elixer = True

                    time.sleep(1)
                    if attack == True:
                        target = random.randrange(0, len(alivePlayers))

                        if normalAttack:
                            defense = round(alivePlayers[target].getDf() / 50)
                            if defense == 0:
                                defense = 1

                            value = round(value / defense)

                        actions.attack(enemy, alivePlayers[target], value)
                    elif heal == True:
                        actions.heal(enemy, value)
                    elif elixer == True:
                        actions.elixer(enemy)

                    takenAction = True

                deadPlayers = CheckAlive.getDead(
                    deadPlayers, alivePlayers, self.message)
                alivePlayers = CheckAlive.getAlive(alivePlayers)

                if not alivePlayers:
                    print("Lose")
                    fight = False
                    break