This repository has been archived on 2022-12-03. You can view files and clone it, but cannot push or open issues or pull requests.
texty/lib/item.py

9 lines
424 B
Python
Raw Permalink Normal View History

2022-05-04 14:26:32 +02:00
class Item: # Reprezentuje vybavitelný předmět
2022-05-04 10:16:30 +02:00
def __init__(self,name:str,attack:int = 0,defense:int = 0) -> None:
2022-05-04 14:26:32 +02:00
self.name = name # Název, jak je zobrazován hráči
if attack == 0 and defense > 0: # Nastaví typ předmětu
2022-05-04 10:16:30 +02:00
self.type = "armor"
else:
self.type = "weapon"
2022-05-04 14:26:32 +02:00
self.attack = attack # Stat útoku
self.defense = defense # Stat obrany