예제 #1
0
    def render(self, console, x, y, width, border):
        formatted_text = self.format_text(self.text, width, width - 2)

        # separate the text from the border in case there is a hovered text color
        console.print(x, y, border, colors.white())
        console.print(x + 1, y, formatted_text, self.color)
        console.print(x + 1 + len(formatted_text), y, border, colors.white())
예제 #2
0
 def __init__(self, engine, x: int, y: int):
     super().__init__(engine, x, y, "W", colors.white(), colors.brown(),
                      WolfAI(self), "Wolf")
     self.alive = True
     self.asleep = False
     self.max_hunger = stats.Stats.map()["wolf"]["max-hunger"]
     self.max_health = stats.Stats.map()["wolf"]["max-health"]
     self.max_energy = stats.Stats.map()["wolf"]["max-energy"]
     self.curr_hunger = stats.Stats.map()["wolf"]["starting-hunger"]
     self.curr_health = stats.Stats.map()["wolf"]["starting-health"]
     self.curr_energy = stats.Stats.map()["wolf"]["starting-energy"]
     self.curr_health = stats.Stats.map()["wolf"]["starting-health"]
     self.critical_health_threshold = stats.Stats.map(
     )["wolf"]["critical-health-threshold"]
     self.hunger_loss = stats.Stats.map()["wolf"]["hunger-loss"]
     self.energy_loss = stats.Stats.map()["wolf"]["energy-loss"]
     self.vision_distance = stats.Stats.map()["wolf"]["vision-distance"]
     self.attk_dmg = stats.Stats.map()["wolf"]["attack-damage"]
     self.hunger_threshold = stats.Stats.map()["wolf"]["hunger-threshold"]
     self.tired_threshold = stats.Stats.map()["wolf"]["tired-threshold"]
     self.need_a_snack_chance = stats.Stats.map(
     )["wolf"]["need-a-snack-chance"]
     self.attacker = None
     self.recent_actions = []
     self.hidden = False
예제 #3
0
 def __init__(self, x, y):
     self.x = x
     self.y = y
     self.char = ord("B")
     self.fg_color = colors.white()
     self.bg_color = colors.light_gray()
     self.occupied = False
예제 #4
0
 def __init__(self, engine, x: int, y: int):
     super().__init__(engine, x, y, "H", colors.white(),
                      colors.hunter_green(), HunterAI(self), "Hunter",
                      "the")
     self.human_name = self.get_human_name()
     self.name = "Hunter"
     self.alive = True
     self.asleep = False
     self.hidden = False
     self.attacked = False
     self.max_hunger = stats.Stats.map()["hunter"]["max-hunger"]
     self.max_health = stats.Stats.map()["hunter"]["max-health"]
     self.max_energy = stats.Stats.map()["hunter"]["max-energy"]
     self.curr_hunger = stats.Stats.map()["hunter"]["starting-hunger"]
     self.curr_health = stats.Stats.map()["hunter"]["starting-health"]
     self.curr_energy = stats.Stats.map()["hunter"]["starting-energy"]
     self.vision_distance = stats.Stats.map()["hunter"]["vision-distance"]
     self.attk_dmg = stats.Stats.map()["hunter"]["attack-damage"]
     self.bandage_threshold = stats.Stats.map(
     )["hunter"]["bandage-threshold"]
     self.bandage_heal_amount = stats.Stats.map(
     )["hunter"]["bandage-heal-amount"]
     self.memory = HunterMemory()
     self.max_recent_actions = stats.Stats.map(
     )["hunter"]["max-recent-actions"]
     self.min_recent_actions = stats.Stats.map(
     )["hunter"]["min-recent-actions"]
     self.days_survived = 1
     self.rt_spawn_time = time()
     self.bow = bw.Bow()
     self.bed = None
     self.accuracy = stats.Stats.map()["hunter"]["accuracy"]
예제 #5
0
 def __init__(self, id, text, engine):
     super().__init__(colors.white(), colors.popcorn())
     self.id = id
     self.text = text
     self.engine = engine
     self.height = 1
     self.width = len(text)
예제 #6
0
 def __init__(self, id, text, width, panel_width, engine):
     self.id = id
     self.text = text
     self.width = width
     self.panel_width = panel_width
     self.engine = engine
     self.height = 4
     self.color = colors.white()
예제 #7
0
 def __init__(self, engine, x, y):
     self.engine = engine
     self.x = x
     self.y = y
     self.char = ord("C")
     self.fg_color = colors.white()
     self.bg_color = colors.safe_blue()
     self.components = [FirePit(engine), Bedroll(), WoodPile()]
     self.name = "Camp"
     self.entity_name = self.name
예제 #8
0
 def __init__(self, engine, x: int, y: int):
     super().__init__(engine, x, y, "R", colors.white(),
                      colors.light_gray(), RabbitAI(self), "Rabbit")
     self.alive = True
     self.asleep = False
     self.max_health = stats.Stats.map()["rabbit"]["max-health"]
     self.curr_health = stats.Stats.map()["rabbit"]["starting-health"]
     self.nutritional_value = stats.Stats.map(
     )["rabbit"]["nutritional-value"]
     self.vision_distance = stats.Stats.map()["rabbit"]["vision-distance"]
     self.recent_actions = []
     self.burrow = None
     self.hidden = False
예제 #9
0
 def __init__(self, engine, x: int, y: int):
     super().__init__(engine, x, y, self.char, colors.white(), colors.light_gray(), self.ai, "Deer")
     self.alive = True
     self.asleep = False
     self.max_health = stats.Stats.map()["deer"]["max-health"]
     self.curr_health = stats.Stats.map()["deer"]["starting-health"]
     self.nutritional_value = stats.Stats.map()["deer"]["nutritional-value"]
     self.vision_distance = stats.Stats.map()["deer"]["vision-distance"]
     self.roam_distance = stats.Stats.map()["deer"]["roam-distance"]
     self.attack_damage = stats.Stats.map()["deer"]["attack-damage"]
     self.stop_pursuit_chance = stats.Stats.map()["deer"]["stop-pursuit-chance"]
     self.attacked = None
     self.recent_actions = []
     self.hidden = False
예제 #10
0
 def __init__(self, text, color=colors.white()):
     self.text = text
     self.color = color