Example #1
0
    if name == 'nt':
        _ = system('cls')

    # for mac and linux(here, os.name is 'posix')
    else:
        _ = system('clear')


print(Fore.GREEN + Style.BRIGHT + "\n                          " +
      "Welcome to the beta test of the game \n" + Fore.RESET + Style.RESET_ALL)

defeated = 0
name = Fore.GREEN + input(
    "Enter Your Name Gamer: ") + Fore.RESET + Style.RESET_ALL
# name = Fore.GREEN + "Apple" + Fore.RESET (default testing name)
player = person(name, 250, 40, 100, player_items, magic_spells)
# starting scene of game
player.start_scene()

# defining enemies
enemy = person(Fore.RED + "Destroyer" + Fore.RESET, 500, 60, 150, [],
               magic_spells)
enemy2 = person(Fore.RED + "Lumos" + Fore.RESET, 600, 80, 200, [],
                magic_spells)
enemy3 = person(Fore.RED + "Alipsh" + Fore.RESET, 450, 120, 120, [],
                magic_spells)
enemies = [enemy2, enemy3]
running = True
while running:
    try:
        player.choose_Action()
Example #2
0
    "quantity": 5
}, {
    "item": Superpotion,
    "quantity": 5
}, {
    "item": Elixer,
    "quantity": 5
}, {
    "item": Hielixer,
    "quantity": 2
}, {
    "item": Greenade,
    "quantity": 5
}]
#instantiate people
player1 = person("Yaswanth:", 4060, 185, 300, 34, player_spells, player_items)
player2 = person("Ravi:    ", 3960, 155, 310, 34, player_spells, player_items)
player3 = person("Anirudh: ", 3860, 165, 288, 34, player_spells, player_items)

enemy1 = person("Ravan    ", 18000, 705, 525, 25, enemy_spells, [])
enemy2 = person("Titla    ", 1100, 130, 560, 325, enemy_spells, [])
enemy3 = person("Bhaladeva", 1200, 120, 315, 25, enemy_spells, [])
enemies = [enemy1, enemy2, enemy3]
players = [player1, player2, player3]

running = True
i = 0
print(bcolors.FAIL + bcolors.BOLD + "AN ENEMY ATTACKS!!!" + bcolors.ENDC)
while running:
    print("==================================")
Example #3
0
from classes.game import person, bcolours


magic = [{"name": "Fire", "cost" :10, "dmg": 60},
         {"name": "Thunder", "cost" :10, "dmg": 60},
         {"name": "Blizzard", "cost": 10, "dmg": 60}]






player = person (460, 65, 34, magic)

print(player.generate_spell_damage(0))
print(player.generate_spell_damage(1))
Example #4
0
}, {
    "item": superpotion,
    "quantity": 5
}, {
    "item": elixer,
    "quantity": 5
}, {
    "item": hielixer,
    "quantity": 2
}, {
    "item": grenade,
    "quantity": 4
}]

# Instantiate People
player1 = person('Dima    :', 3260, 100, 138, 34, player_spells, player_items)
player2 = person('Rinat   :', 4160, 90, 139, 34, player_spells, player_items)
player3 = person('Alma    :', 3089, 123, 155, 34, player_spells, player_items)
player4 = person('Shay-Lee:', 3333, 70, 143, 34, player_spells, player_items)

# Instantiate enemies
enemy1 = person("Pogba   :", 200, 130, 560, 325, enemy_spells, [])
enemy2 = person("Bruno   :", 1500, 700, 525, 25, enemy_spells, [])
enemy3 = person("Rashford:", 1000, 130, 560, 325, enemy_spells, [])

players = [player1, player2, player3, player4]
enemies = [enemy1, enemy2, enemy3]

running = True

print(bcolors.FAIL + bcolors.BOLD + "AN ENEMY ATTACKS!" + bcolors.ENDC)
Example #5
0
# 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, "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, 311, 34, player_spells, player_items)
player3 = person("Robot:", 3089, 174, 288, 34, player_spells, player_items)
enemy2 = person("Imp    ", 1250, 130, 560, 325, enemy_spells, [])
enemy1 = person("Magus", 11200, 701, 525, 25, enemy_spells, [])
enemy3 = person("Imp    ", 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)
while running:
	print("=================")
	print("\n\n")
	print("NAME                HP                                   MP")
Example #6
0
from classes.game import person, bcolors

magic = [{
    "name": "Fire",
    "cost": 10,
    "damage": 60
}, {
    "name": "Thunder",
    "cost": 10,
    "damage": 80
}, {
    "name": "Blizzard",
    "cost": 10,
    "damage": 70
}]

player = person(460, 65, 60, 45, magic)
print(player.generate_spell_damage(0))
print(player.generate_spell_damage(1))
Example #7
0
    'item': elixir,
    'quantity': 9
}, {
    'item': high_elixir,
    'quantity': 5
}, {
    'item': grenade,
    'quantity': 30
}]

#create a list of items and spells for each enemy
enemy_spells = [fire, blizzard, thunder, cure]
enemy_items = []

#Instatiate players
player_1 = person("Aella:", 2000, 350, 260, 34, player_spells, player_items)
player_2 = person("Puabi:", 2000, 500, 160, 34, player_spells, player_items)
player_3 = person("Efua :", 2000, 200, 360, 34, player_spells, player_items)
player_4 = person("Chiro:", 2000, 180, 330, 34, player_spells, player_items)

players = [player_1, player_2, player_3, player_4]

#Instatiate enemies
enemy_1 = person("Xanto:", 10000, 300, 400, 25, enemy_spells, enemy_items)
enemy_2 = person("Vespa:", 50000, 300, 800, 25, enemy_spells, enemy_items)
enemy_3 = person("Brevi:", 10000, 300, 400, 25, enemy_spells, enemy_items)

enemies = [enemy_1, enemy_2, enemy_3]

#The initial set up of the attack
print(bcolors.FAIL + bcolors.BOLD + "AN ENEMY ATTACKS!!!" + bcolors.ENDC)
Example #8
0
magic = [{
    "name": "Fire",
    "cost": 10,
    "dmg": 60
}, {
    "name": "Thunder",
    "cost": 10,
    "dmg": 80
}, {
    "name": "Blizard",
    "cost": 10,
    "dmg": 50
}]

#player = person(500, 65, 34, 60, magic)
player = person(1000, 65, 34, 60, magic)
enemy = person(500, 65, 34, 60, magic)

running = True
i = 0

print(bcolors.WARNING + bcolors.BOLD + " Enemy Attacks!" + bcolors.ENDC)

# add print statement with colors that enemy attacks

while running:

    player.choose_actions()
    choice = input("choose action: ")
    index = int(choice) - 1
Example #9
0
#creat some items

potion = item("potion",  "potion", "heals for 50 HP", 50)
hight_potion = item("hi_potion",  "potion", "heals for 100 HP", 100)
super_potion = item("supper_potion", "potion", "heals for 150 HP", 500)
exiler = item("exiler","exiler", "fully restor  HP/MP for party memeber", 99990)
hiexiler = item("mega_exiler", "exiler", "fully restor  HP/MP for Player", 99990)
grenad = item("grenad", "attak", "generate damage 50 HP ", 50)

player_spells = [fire, Thunder, Blizzer, meteor, quak, cure, cura]
player_items= [{"item" : potion, "quantity" : 5}, {"item" :hight_potion, "quantity" : 5},
                {"item" :super_potion, "quantity" : 5}, {"item" :exiler, "quantity" : 5}, {"item" :hiexiler, "quantity" : 2},
                {"item" :grenad, "quantity" : 5}]


player1 = person("valos", 3000, 65, 80, 34, player_spells , player_items)
player2 = person("jhony", 2500, 65, 60, 34, player_spells , player_items)
player3 = person("mikey", 2500, 65, 60, 34, player_spells , player_items)

enemy1 = person("enemy1", 700, 65, 800, 25, [], [])
enemy2 = person("enemy2", 3700, 65, 500, 25, [], [])
enemy3 = person("enemy3", 700, 65, 800, 25, [], [])
enmies = [enemy1, enemy2, enemy3]
players = [player1, player2, player3]
runing = True
i = 0

print  (bcolors.FAIL + bcolors.BOLD + " an enemy attaques" + bcolors.ENDC)

while runing :
    print (' \n =============================')
Example #10
0
meteor = spell("meteor", 70, 170, "rage")
quake = spell("quake", 100, 200, "rage")

potion = item('potion', 'potion', 'heals 50 hp', 50)  # items
hipotion = item('hipotion', 'potion', 'heals 100 hp', 100)
megapotion = item('megapotion', 'potion', 'heals 500 hp', 500)
elixir = item('elixir', 'potion', 'fully heals', 9999)

grenade = item('grenade', 'bomb', 'deals 500 damage', 500)  # attacking item

cure = spell("cure", 12, 120, "heal")  # healing spells
aid = spell("aid", 14, 150, "heal")

# instantiate
player1 = person('pekka', 465, 60, 30, 34,
                 [fire, thunder, shocker, meteor, quake, cure, aid],
                 [potion, hipotion, megapotion, elixir, grenade])
player2 = person('goblin', 800, 100, 30, 34,
                 [fire, thunder, shocker, meteor, quake, cure, aid],
                 [potion, hipotion, megapotion, elixir, grenade])
player3 = person('giant', 950, 150, 30, 34,
                 [fire, thunder, shocker, meteor, quake, cure, aid],
                 [potion, hipotion, megapotion, elixir, grenade])
enemy = person('witch', 1000, 600, 200, 45, [], [])

players = [player1, player2, player3]

running = True
i = 0

print(bcolors.FAIL + bcolors.BOLD + 'ENEMY ATTACKS!' + bcolors.ENDC)
Example #11
0
mega_elixer = item("Mega elixer","elixer","fully restores party's hp/mp",9999,5)
grenade = item("grenade","attack","deals 500 damage",500,5)

player_spells = [fire,thunder,blizzard,meteor,quake,cure,cura]
player_items = [{"item": potion,"quantity":15},
                {"item":hipotion,"quantity":5},
               {"item":superpotion,"quantity":2},
                {"item":elixer,"quantity":5},
               {"item":mega_elixer,"quantity":5},
                {"item":grenade,"quantity":5}]



player1 = person("valos",3260,132,60,34,[fire,thunder,blizzard,meteor,quake,cure,cura],[{"item": potion,"quantity":15},
                {"item":hipotion,"quantity":5},
               {"item":superpotion,"quantity":2},
                {"item":elixer,"quantity":5},
               {"item":mega_elixer,"quantity":5},
                {"item":grenade,"quantity":5}])
player2 = person("nick",4160,188,60,34,[fire,thunder,blizzard,meteor,quake,cure,cura],[{"item": potion,"quantity":15},
                {"item":hipotion,"quantity":5},
               {"item":superpotion,"quantity":2},
                {"item":elixer,"quantity":5},
               {"item":mega_elixer,"quantity":5},
                {"item":grenade,"quantity":5}])
player3 = person("robot",3089,174,60,34,[fire,thunder,blizzard,meteor,quake,cure,cura],[{"item": potion,"quantity":15},
                {"item":hipotion,"quantity":5},
               {"item":superpotion,"quantity":2},
                {"item":elixer,"quantity":5},
               {"item":mega_elixer,"quantity":5},
                {"item":grenade,"quantity":5}])
players = [ player1,player2,player3]
Example #12
0
}, {
    "item": superpotion,
    "quantity": 5
}, {
    "item": elixer,
    "quantity": 3
}, {
    "item": hielixer,
    "quantity": 1
}, {
    "item": grenade,
    "quantity": 3
}]

#Instantiate people
player1 = person('valos', 10000, 95, 300, 34, player_spells,
                 copy.deepcopy(player_items))
player2 = person('nick', 4168, 50, 311, 34, player_spells,
                 copy.deepcopy(player_items))
player3 = person('robot', 3089, 80, 288, 34, player_spells,
                 copy.deepcopy(player_items))
enemy1 = person('IMP', 1600, 130, 560, 325, player_spells, [])
enemy2 = person('magus', 10000, 221, 525, 25, player_spells, [])
enemy3 = person('IMP', 1100, 130, 560, 325, player_spells, [])

Running = True

players = [player1, player2, player3]
enemies = [enemy1, enemy2, enemy3]

while Running:
    for player in players:
Example #13
0
from classes.game import person, bcolors


magic = [
    {"name": "fire", "cost": 10, "damage": 100},
    {"name": "thunder", "cost": 10, "damage": 120},
    {"name": "blizzard", "cost": 10, "damage": 140},
]
player = person(460, 65, 60, 30, magic)
ennemy = person(1200, 65, 45, 35, magic)

run = True
i = 0
print(bcolors.FAIL + bcolors.BOLD + "ennemy attacks!" + bcolors.ENDC)

while run:

    print("=========================")
    player.choose_action()
    choice = input("choose action")
    index = int(choice) - 1
    if index == 0:
        dmg = player.generate_damage()
        ennemy.take_damage(dmg)
        print(
            "you attacked for :", dmg, "point of damage. Ennemy's HP :", ennemy.get_hp()
        )

    elif index == 1:
        player.choose_magic()
        magic_choice = int(input("choose magic spell")) - 1
Example #14
0
        "cost": 10,
        "dmg": 100
    },
    {
        "name": "Thunder",
        "cost": 12,
        "dmg": 80
    },
    {
        "name": "Blizzard",
        "cost": 10,
        "dmg": 60
    },
]

player = person(680, 65, 50, 85, magic)
enemy = person(1000, 65, 45, 35, magic)

running = True
i = 0

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()
Example #15
0
grenade = item("Grenade", "attack", "Deals 500 damage", 500)

magic = [
        {"name": "fire", "cost": 10, "dmg": 200},
        {"name": "thunder", "cost": 10, "dmg": 1300},
        {"name": "lightning", "cost": 10, "dmg": 100},
]

player_spells = [fire, blizzard, meteor, amadioha, ice, cure, cura]
player_items =  [
                {"item": potion, "quantity": 15}, {"item": hipotion,"quantity": 5},
                {"item": superpotion, "quantity": 5},{"item": ndu, "quantity": 5}, 
                {"item": anwuanwu, "quantity": 2}, {"item": grenade, "quantity": 5}
                ]

player = person(480, 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:
    print("======================")
    player.choose_action()
    choice = input(bcolors.BOLD + bcolors.HEADER + bcolors.OKGREEN + "choose action: " + bcolors.ENDC)
    index = int(choice) - 1

    if index == 0:
        dmg = player.damage()
        enemy.take_damage(dmg)
        print("You attacked for:", dmg, "points of damage." + bcolors.FAIL + "\nEnemy HP:\n", 
Example #16
0
}, {
    "item": superpotion,
    "quantity": 2
}, {
    "item": elixr,
    "quantity": 5
}, {
    "item": superelixr,
    "quantity": 3
}, {
    "item": grenade,
    "quantity": 1
}]

#instantiate people
Player1 = person("Valos", 13400, 265, 160, 4260, player_spells, player_items)
Player2 = person("Nick ", 134, 265, 160, 4260, player_spells, player_items)
Player3 = person("Robot", 134, 265, 160, 4260, player_spells, player_items)

enemy2 = person("Imp  ", 560, 325, 25, 1250, [], [])
enemy1 = person("Magus", 701, 525, 65, 11200, [], [])
enemy3 = person("Imp  ", 560, 325, 65, 1250, [], [])

Players = [Player1, Player2, Player3]
enemies = [enemy1, enemy2, enemy3]

running = True
i = 0
print("\n \n")
print(colors.BOLD + colors.FAIL + "AN ENEMY ATTACKS" + colors.ENDC)