Exemple #1
0
 def spawn_npcs(self):
     """Spawns NPCs into the Dungeon field"""
     free_spaces = True
     counter = 1
     while free_spaces:
         if "N" in self.map:
             npc = Orc("NPC" + str(counter), 250, 1.4)
             wep = Weapon("Axe" + str(counter), 15, 0.7)
             npc.weapon = wep
             self.npcs[npc.name] = npc
             self.ingame[npc.name] = npc
             npc.location = self.get_position_in_map("N")
             self.map = (self.map[:self.map.find("N")] + "O" +
                         self.map[self.map.find("N") + 1:])
             counter += 1
         else:
             free_spaces = False