示例#1
0
 def place_party(self):
     """Stick the party close to the waypoint."""
     x0, y0 = self.entrance.pos
     entry_points = list(pfov.WalkReach(self.scene, x0, y0, 3, True).tiles)
     for m in self.scene.contents:
         if self.scene.is_model(m) and m.pos in entry_points:
             entry_points.remove(m.pos)
     for pc in self.party:
         if pc.is_alright():
             if entry_points:
                 pos = random.choice(entry_points)
                 entry_points.remove(pos)
             else:
                 pos = self.entrance.pos
             pc.pos = pos
             self.scene.contents.append(pc)
             pfov.PCPointOfView(self.scene, pos[0], pos[1], 15)
    def __init__( self, screen, camp ):
        self.screen = screen
        self.camp = camp
        self.scene = camp.scene
        self.view = maps.SceneView( camp.scene )
        self.time = 0
        self.safe_camp_bonus = 0

        self.record_anim = False

        # Update the view of all party members.
        for pc in camp.party:
            if pc.pos and pc.is_alright():
                x,y = pc.pos
                pfov.PCPointOfView( camp.scene, x, y, 15 )

        # Hide any monsters who can manage it.
        for m in self.scene.contents:
            if isinstance( m, characters.Character ) and m.can_use_stealth() and m.is_hostile( camp ):
                m.hidden = True

        # Focus on the first PC.
        x,y = camp.first_living_pc().pos
        self.view.focus( screen, x, y )
 def update_party_position( self, party ):
     self.in_sight = set()
     for pc in party:
         if pc.is_alright():
             self.in_sight |= pfov.PCPointOfView( self, pc.pos[0], pc.pos[1], 10 ).tiles