コード例 #1
0
def create_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", "elixir",
                  "Fully restores HP and MP of one party member", 9999)
    mega_elixir = Item("Mega-Elixir", "elixir",
                       "Fully restores party's HP and MP", 9999)
    grenade = Item("Grenade", "attack", "Deals 200 damage", 200)
    items = [potion, hi_potion, super_potion, elixir, mega_elixir, grenade]
    return items
コード例 #2
0
ファイル: main.py プロジェクト: Sudhanshu5harma/Working_Dir
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,
コード例 #3
0
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
}, {
    "item": elixer,
    "quantity": 5
コード例 #4
0
# 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}]


player = Person(500, 200, 45, 35, player_spells, player_items )
コード例 #5
0
ファイル: main.py プロジェクト: br34th5/Python
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]
player_items = [{
    "item": potion,
    "quantity": 3
コード例 #6
0
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], [])

running = True  # Flag for the on-going battle.
コード例 #7
0
# 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 = [{
    "Item": potion,
    "Quantity": 15
}, {
    "Item": high_potion,
    "Quantity": 5
コード例 #8
0

#Create dark magic, which deals damage
fire = Magic("Fire", 10, 200, "dark")
thunder = Magic("Thunder", 12, 240, "dark")
blizzard = Magic("Blizzard", 8, 160, "dark")
meteor = Magic("Meteor", 20, 1000, "dark")
earthquake = Magic("Earthquake", 15, 800, "dark")

#Create light magic, which heals
cure = Magic("Cure", 12, 1200, "light")
cure_max = Magic("Max Cure", 25, 3000, "light")
cure_ultra = Magic("Ultra Cure", 50, 6000, "light")

#Create items
potion = Item("Potion", "potion", "Heals 500 HP", 500)
high_potion = Item("High Potion", "potion", "Heals 1500 HP", 1500)
super_potion = Item("Super Potion", "potion", "Heals 4000 HP", 4000)

elixir = Item("Elixir", "elixir", "Fully restores HP and MP of one party member", 9001)
high_elixir = Item("High Elixir", "elixir", "Fully restores party's HP and MP", 9999)

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

#Instantiate People
#Players
player_magics = [fire, thunder, blizzard, meteor, cure, cure_max]

player_items = [
    {"item": potion, "quantity": 10}, 
    {"item": high_potion, "quantity": 5}, 
コード例 #9
0
ファイル: main.py プロジェクト: dnlolski/PyTextRPG
from Classes.inventory import Item
import random

# Crate Black Magic
fire = Spell("Fire Ball", 25, 600, "black")
thunder = Spell("Thunder Bolt", 25, 600, "black")
blizzard = Spell("Blizzard", 25, 600, "black")
meteor = Spell("Meteor", 40, 1200, "black")
quake = Spell("Quake", 14, 120, "black")

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

# Create new Items
potion = Item("Potion", "potion", "Heals 50 HP", 200)
hiPotion = Item("Hi-Potion", "potion", "Heals 100 HP", 500)
superPotion = Item("Super Potion", "potion", "Heals 500 HP", 1000)
elixir = Item("Elixir", "elixir", "Fully restores HP/MP", 9999)
megaElixir = Item("MegaElixir", "elixir", "Fully restores party's HP/MP", 9999)

scrollOfFire = Item("Scroll of Fire", "attack", "Deals 500 damage", 500)

player_spells = [fire, thunder, blizzard, meteor, quake, cure, cura]
player_items = [{
    "item": potion,
    "quantity": 5
}, {
    "item": hiPotion,
    "quantity": 3
}, {
コード例 #10
0
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},
                {"item": mana_potion, "quantity": 5}, {"item": magic_potion, "quantity": 2},
                {"item": max_potion, "quantity": 1}, {"item": mega_elixir, "quantity": 1},
                {"item": dynamite, "quantity": 1}]
コード例 #11
0
ファイル: main.py プロジェクト: aalemi76/RPG-Battle-Project
#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]
player1 = Person("Aegon", 3260, 332, 430, player_spells, player_items)
player2 = Person("Ario ", 4160, 408, 550, player_spells, player_items)
player3 = Person("Tony ", 3089, 474, 370, player_spells, player_items)
#Instantiate Enemies and their properties
コード例 #12
0
ファイル: main.py プロジェクト: Shafin580/Python-Projects
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]
player_items = [{
    "item": potion,
    "quantity": 3
}, {
コード例 #13
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", 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,
    "quantity": 5
}]
player = Person(600, 60, 56, 45, [fire, thunder, blizzard, meteor, cure, cura],
                player_items, "Valos")
コード例 #14
0
ファイル: main.py プロジェクト: saumya-singh/Battle
import random

# Create Black Magic
fire = Spells("Fire", 85, 900, "black")
thunder = Spells("Thunder", 90, 1000, "black")
blizzard = Spells("Blizzard", 75, 700, "black")
meteor = Spells("Meteor", 40, 390, "black")
quake = Spells("Quake", 30, 260, "black")

# Create White Magic
cure = Spells("Cure", 60, 600, "white")
cura = Spells("Cura", 90, 1000, "white")
curaga = Spells("Curaga", 220, "30%", "white")

# Create some Items
potion = Item("Potion", "potion", "Heals 250 HP", 250)
hipotion = Item("Hi-Potion", "potion", "Heals 600 HP", 450)
superpotion = Item("Super Potion", "potion", "Heals 800 HP", 800)
elixer = Item("Elixer", "elixer", "Fully restores HP/MP of one party member",
              9999)
hielixer = Item("Hi-Elixer", "hi-elixer", "Fully restores party's HP/MP", 9999)

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

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