Adding new files
This commit is contained in:
17
traits.py
Normal file
17
traits.py
Normal file
@@ -0,0 +1,17 @@
|
||||
class Trait:
|
||||
def __init__(self, name, buff_value):
|
||||
self.name = name
|
||||
self.buff_value = buff_value
|
||||
|
||||
def trigger_effect(self):
|
||||
print(self.name + " gives a buff of", self.buff_value)
|
||||
|
||||
class RewardTrait(Trait):
|
||||
def set_price(self, price):
|
||||
self.price = price
|
||||
|
||||
savant_trait = RewardTrait("Savant" , 5)
|
||||
savant_trait.set_price(2000)
|
||||
print(savant_trait.price)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user