mirror of
https://github.com/guezoloic/BakersAdventure.git
synced 2026-03-31 19:11:42 +00:00
add oldproject folder
This commit is contained in:
29
entity/Heros.py
Executable file
29
entity/Heros.py
Executable file
@@ -0,0 +1,29 @@
|
||||
from random import randint
|
||||
|
||||
class Hero():
|
||||
def __init__(self, life:int, mana:int, punch_damage:int,magic:bool, range:bool, strength:bool , name:str):
|
||||
#int
|
||||
self.punch_damage = punch_damage
|
||||
self.started_life = life
|
||||
self.life = life
|
||||
self.mana = mana
|
||||
self.name = name
|
||||
|
||||
#bool
|
||||
self.magic = magic
|
||||
self.range = range
|
||||
self.strength = strength
|
||||
|
||||
def is_dodging(self):
|
||||
#bool
|
||||
|
||||
if randint(1, 4) == 4: return True
|
||||
else: return False
|
||||
|
||||
|
||||
baker_warrior = Hero(125, 50, 34, 0, 0, 1, "baker warrior") #speciality : strength
|
||||
baker_magician = Hero(60, 120, 30, 1, 0, 0, "baker magician") #speciality : magic
|
||||
baker_dwarf = Hero(90, 80, 100, 0, 0, 0, "baker dwarf") #speciality : his fists
|
||||
baker_archer = Hero(65, 60, 25, 0, 1, 0, "baker archer") #speciality : ranger
|
||||
|
||||
print("Heros class loaded")
|
||||
40
entity/Inventory.py
Executable file
40
entity/Inventory.py
Executable file
@@ -0,0 +1,40 @@
|
||||
from entity.Utilities import*
|
||||
|
||||
class Inventory():
|
||||
def __init__(self):
|
||||
self.content = [
|
||||
[], #knifes
|
||||
[], #swords
|
||||
[], #bows
|
||||
[], #crossbows
|
||||
[], #magic_sticks
|
||||
[], #healing Potions
|
||||
]
|
||||
|
||||
def is_inventory_full(self, item):
|
||||
if item == knife:
|
||||
if len(self.content[0]) < 4: self.content[0].append(item)
|
||||
else: return False
|
||||
|
||||
if item == sword:
|
||||
if len(self.content[1]) < 4: self.content[1].append(item)
|
||||
else: return False
|
||||
|
||||
if item == bow:
|
||||
if len(self.content[2]) < 4: self.content[2].append(item)
|
||||
else: return False
|
||||
|
||||
if item == crossbow:
|
||||
if len(self.content[3]) < 4: self.content[3].append(item)
|
||||
else: return False
|
||||
|
||||
if item == magic_stick:
|
||||
if len(self.content[4]) < 4: self.content[4].append(item)
|
||||
else: return False
|
||||
|
||||
if item == healing_potion:
|
||||
if len(self.content[5]) <2: self.content[5].append(item)
|
||||
else: return False
|
||||
|
||||
baker_inventory = Inventory()
|
||||
print("Inventory class loaded")
|
||||
25
entity/Monsters.py
Executable file
25
entity/Monsters.py
Executable file
@@ -0,0 +1,25 @@
|
||||
import random
|
||||
import os
|
||||
|
||||
class Monster():
|
||||
def __init__(self, mana:int, big:bool):
|
||||
#monster's name
|
||||
|
||||
file = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'names.txt')
|
||||
with open(f"{file}") as txt: self.name = txt.readlines()[random.randint(0, len(file))]
|
||||
#int
|
||||
self.life = random.randint(150, 500)
|
||||
self.mana = mana
|
||||
self.damage = 25
|
||||
|
||||
#bool
|
||||
if big:
|
||||
self.life += 150
|
||||
self.damage += 35
|
||||
|
||||
def is_dodging():
|
||||
#bool
|
||||
if random.randint(1, 7) == 5: return True
|
||||
else: return False
|
||||
|
||||
print("Monsters class loaded")
|
||||
33
entity/Utilities.py
Executable file
33
entity/Utilities.py
Executable file
@@ -0,0 +1,33 @@
|
||||
import random
|
||||
|
||||
class Weapon():
|
||||
def __init__(self, damage_send:int, durability:int, magic:bool, range:bool, strength:bool, name):
|
||||
#int
|
||||
|
||||
self.damage = damage_send
|
||||
self.durability = durability
|
||||
self.name = name
|
||||
|
||||
#bool
|
||||
|
||||
self.magic = magic
|
||||
self.range = range
|
||||
self.strength = strength
|
||||
|
||||
|
||||
|
||||
knife = Weapon(100 + random.randint(0, 20), 10 + random.randint(0, 15), 0, 0, 1, "knife")
|
||||
sword = Weapon(124 + random.randint(0, 10), 7 + random.randint(0, 15), 0, 0, 1, "sword")
|
||||
bow = Weapon(120 + random.randint(0, 25), 14 + random.randint(0, 7), 0, 1, 0, "bow")
|
||||
crossbow = Weapon(100 + random.randint(0, 15), 17 + random.randint(0, 15), 0, 1, 0, "crossbow")
|
||||
magic_stick = Weapon(150 + random.randint(0, 35), 50 + random.randint(0, 15), 1, 0, 0, "magic_stick")
|
||||
|
||||
print("weapons class loaded")
|
||||
|
||||
class Potion():
|
||||
def __init__(self, heal:int):
|
||||
self.heal = heal
|
||||
|
||||
healing_potion = Potion(random.randint(5, 40))
|
||||
|
||||
print("potion class loaded")
|
||||
18239
entity/names.txt
Executable file
18239
entity/names.txt
Executable file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user