So, my question is, if I were to make a Race based on this class, say, an elf. I make the elf like this: elf = Race('Elf', 100, 50, 60, 90)
If the elf got into combat, how do I make his health go down in that one instance, or any of his other stats go up based on a bonus of some sort, like if he had some kind of equipment giving him +(stat)?
Kind of a specific question, I know.
Here is the class Race I have set up so far. . .
class Race(object):
race = None
health = None
strength = None
speed = None
endurance = None
def __init__(self, race, health, strength, speed, endurance):
self.race = race
self.health = health
self.strength = strength
self.speed = speed
self.endurance = endurance
def set_race(self, race):
self.race = race
def set_health(self, health):
self.health = health
def set_strength(self, strength):
self.strength = strength
def set_speed(self, speed):
self.speed = speed
def set_endurance(self, endurance):
self.endurance = endurance
Criticism is welcome, so long as its constructive!