def place_random_critter(self, dlvl, hd, x, y): crit = util.random_by_level(dlvl, critters.mobs.values()) if crit is None: return crit = crit() crit.hd = dlvl - hd # crit.adjust_hd(hd) self.place_critter(crit, x, y)
def place_critter(self, crit_level, crit_hd, x, y): crit = util.random_by_level(crit_level, critters.Critter.ALL) if crit is None: return crit = crit() crit.adjust_hd(crit_hd) self.map_critters.append(crit) self.critter_xy_cache[(x, y)] = crit crit.place(x, y, self)