def reset(self): self.health = c.Counter(0, self.max_health) self.stats = c.LinkedCounters(0, self.max_stat_points) self.fighting = self.stats.set_counter("fighting", c.Counter(0, self.max_fighting)) self.hunting = self.stats.set_counter("hunting", c.Counter(0, self.max_hunting))
def __init__(self, max_health: int = 3, can_learn: bool = False, can_learn_code: bool = False, max_stat_points: int = 4, max_hunting: int = 3, max_fighting: int = 3, can_move: bool = True, can_heal: bool = False, can_learn_healing: bool = False): self.can_learn_healing = can_learn_healing self.can_heal = can_heal self.learned_healing: bool = False self.max_stat_points: int = max_stat_points self.max_fighting = max_fighting self.max_hunting = max_hunting self.max_health: int = max_health self.can_learn: bool = can_learn self.can_learn_code: bool = can_learn_code self.learned_code: bool = False self.can_move: bool = can_move self.health: c.Counter = c.Counter(0, self.max_health) self.stats: c.LinkedCounters = c.LinkedCounters( 0, self.max_stat_points) self.fighting: c.LinkedCounter = self.stats.set_counter( "fighting", c.Counter(0, self.max_fighting)) self.hunting: c.LinkedCounter = self.stats.set_counter( "hunting", c.Counter(0, self.max_hunting))
def __init__(self, max_health: int, stat_points: int): self.max_health = max_health self.stat_points = stat_points self.health = Health(max_health) self.connected_stats = counter.LinkedCounters(0, stat_points) self.fighting = self.connected_stats.set_counter("Hunting", counter.Counter(0, stat_points)) self.hunting = self.connected_stats.set_counter("Fighting", counter.Counter(0, stat_points)) self.can_heal = False
def __init__(self, max_h): self.max_h = max_h self.health = counter.Counter(0, max_h) self._alive: bool = True
def __init__(self): self.cats: Dict[Name, "Cat"] = {} self.herbs = counter.Counter(0, -1) self.prey = counter.Counter(0, -1)
def __init__(self, name: str): self.name = name self.herbs = c.Counter(0, -1) self.prey = c.Counter(0, -1) self.cats: Dict[Name, Cat] = {} self.is_frozen: bool = False