Ignore:
Timestamp:
02/03/10 13:21:45 (10 years ago)
Author:
maximinus_parpg
Message:

More clean up of the code.
Finshed first pass.
So should be at least stands compliant.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/game/scripts/objects/action.py

    r451 r477  
    5151        """@type engine: Engine reference 
    5252           @param engine: A reference to the engine. 
    53            @param container: A reference to the container 
    54            """ 
     53           @param container: A reference to the container""" 
    5554        self.engine = engine 
    5655        self.container = container 
     
    6564        except ValueError: 
    6665            self.engine.view.hud.createExamineBox(self.container.name, \ 
    67                                               "The container is locked") 
     66                                                  "The container is locked") 
    6867         
    6968class UnlockBoxAction(Action): 
    7069    """Unlocks a box. Needs to be more generic, but will do for now.""" 
    7170    def __init__(self,  container): 
    72         """@param container: A reference to the container 
    73            """ 
     71        """@param container: A reference to the container""" 
    7472        self.container = container 
    7573     
     
    8179    """Locks a box. Needs to be more generic, but will do for now.""" 
    8280    def __init__(self, container): 
    83         """@param container: A reference to the container 
    84            """ 
     81        """@param container: A reference to the container""" 
    8582        self.container = container 
     83         
    8684    def execute(self): 
    8785        """Lock the box.""" 
     
    9795           @param examine_name: Name of the object to be examined. 
    9896           @type examine_name: String 
    99            @param examine_name: Description of the object to be examined. 
    100            """ 
     97           @param examine_name: Description of the object to be examined.""" 
    10198        self.engine = engine 
    10299        self.examine_name = examine_name 
     
    114111           @param engine: A reference to the engine. 
    115112           @type npc: NonPlayerCharacter 
    116            @param npc: NPC to interact with. 
    117            """ 
     113           @param npc: NPC to interact with.""" 
    118114        self.engine = engine 
    119115        self.npc = npc 
    120116         
    121117    def execute(self): 
    122         """Talk with the NPC when we are close enough, otherwise 
    123            we move close. 
     118        """Talk with the NPC when close enough, otherwise move closer. 
    124119           @return: None""" 
    125          
     120       
    126121        pc = self.engine.game_state.PC 
    127122        npc_coordinates = self.npc.getLocation().getLayerCoordinates() 
     
    129124         
    130125        distance_squared = (npc_coordinates.x - pc_coordinates.x) *\ 
    131                          (npc_coordinates.x - pc_coordinates.x) +\ 
    132                          (npc_coordinates.y - pc_coordinates.y) *\ 
    133                          (npc_coordinates.y - pc_coordinates.y) 
    134          
     126                           (npc_coordinates.x - pc_coordinates.x) +\ 
     127                           (npc_coordinates.y - pc_coordinates.y) *\ 
     128                           (npc_coordinates.y - pc_coordinates.y) 
    135129         
    136130        # If we are too far away, we approach the NPC again 
     
    152146                 
    153147            self.engine.game_state.PC.behaviour.idle() 
    154             self.engine.game_state.PC.nextAction = None  
     148            self.engine.game_state.PC.nextAction = None 
Note: See TracChangeset for help on using the changeset viewer.