示例#1
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", 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, "quantity": 5},
                {"item": superpotion, "quantity": 5}, {"item": elixer, "quantity": 5},
                {"item": hielixer, "quantity": 2}, {"item": grenade, "quantity": 5}]

示例#2
0
import random

#Creating Black Magic
Fire = Spell("Fire", 50, 7500, "Black")
Blizzard = Spell("Blizzard", 20, 2500, "Black")
Quake = Spell("Quake", 2, 500, "Black")
Thunder = Spell("Thunder", 35, 4000, "Black")
Meteor = Spell("Meteor", 60, 8000, "Black")
Splash = Spell("Splash", 7, 1100, "Black")

#Creating White Magic
Cure = Spell("Cure", 25, 4500, "White")
Cura = Spell("Cura", 40, 7700, "White")

#Create some Items
Potion = Item("Potion", "Potion", "Heals", 3000)
HighPotion = Item("Hi-Potion", "Potion", "Heals 100", 6000)
SuperPotion = Item("Su-Potion", "Potion", "Heals 500 ", 10000)
Elixir = Item("Elixir", "Elixir", "Fully Restores one party Member", 99999)
MegaElixir = Item("Mega-Elixir", "Elixir", "Fully Restores all party Member",
                  99999)
Grenade = Item("Grenade", "Attack", "Deals 500 Damage", 5700)
Molotov = Item("Molotov", "Attack", "Deals 250 Damage", 3250)
Spikes = Item("Spikes", "Attack", "Deals 200 Damage", 2200)
NinjaStars = Item("Ninja-Stars", "Attack", "Deals 400 Damage", 4600)

#Instantiation Persons
Player1_Spells = [Fire, Thunder, Meteor, Splash, Cure, Cura]
Player1_Items = [{
    "Item": Potion,
    "Quantity": 10
示例#3
0
from Classes.Magic import Magic
from Classes.Inventory import Item
import random

# Create Some Magics
fire = Magic(name="Fire", cost=45, dmg=110, magic_type="black")
ice = Magic(name="Ice", cost=55, dmg=120, magic_type="black")
earth = Magic(name="Earth", cost=65, dmg=130, magic_type="black")
heal = Magic(name="Heal", cost=50, dmg=250, magic_type="white")
mass_heal = Magic(name="Mass Heal", cost=75, dmg=500, magic_type="white")
player_magics = [fire, ice, earth, heal, mass_heal]

# Create Some Items
small_hp_potion = Item(name="Small HP Potion",
                       item_type="potion",
                       description="Heals for 150 HP",
                       value=150,
                       quantity=3)
medium_hp_potion = Item(name="Medium HP Potion",
                        item_type="potion",
                        description="Heals for 300 HP",
                        value=300,
                        quantity=3)
large_hp_potion = Item(name="Large HP Potion",
                       item_type="potion",
                       description="Heals for 750 HP",
                       value=750,
                       quantity=3)
super_elixer = Item(name="Super Elixer",
                    item_type="elixer",
                    description="Fully restores HP/MP",
示例#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")
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:
示例#5
0
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])

running = True
示例#6
0
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},
               {'item': grenade, 'quantity': 5}]

#Instatiate people