Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #SHIT TO DO
- #Create objects: units and classes, items
- #Create function for spawning items
- #Way to pick up items
- #Game timer for cooldowns
- #World creation
- #AI
- class world:
- def __init__(self, size):
- self.size = size
- class items:
- def __init__(self, name, itemType, objectState = 'item'):
- self.name = name
- self.itemType = itemType
- class consumables(items):
- def __init__(self):
- pass
- class equipables(items):
- def __init__(self):
- pass
- class player:
- #Every unit should have basic attributes that are shared among all
- def __init__(self, name, hp = 100, sp = 50, atk = 15, defense = 7, speed = 10, inventory = [], equips = [], objectState = 'player',healthCooldown = False, manaCooldown = False):
- self.name = name
- self.hp = hp
- self.sp = sp
- self.atk = atk
- self.defense = defense
- self.inventory = inventory
- self.equips = equips
- self.healthCooldown = healthCooldown
- self.manaCooldown = manaCooldown
- def attack(self, enemy):
- #Basic formula when a unit attacks another unit
- enemy.hp = enemy.hp - (enemy.defense - self.attack)
- def heal(self):
- #When a unit wants to recover health... it will add HP and subtract from inventory
- self.hp += self.inventory[potions.hp]
- #Cool down *Need to figure out how to make a game timer*
- self.healthCooldown = True
- def manaPot(self):
- #When a unit wants to recover mana... it will add SP and subtract from inventory
- self.sp += self.inventory[potions.sp]
- #Cool down *Need to figure out how to make a game timer*
- self.manaCooldown = True
- class warrior(player):
- def __init__(self):
- player.__init__(self)
- self.attack = 20
- class mage(player):
- def __init__(self):
- pass
- class assassin(player):
- def __init__(self):
- pass
- class tank(player):
- def __init__(self):
- pass
- class healer(player):
- def __init__(self):
- pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement