Ignore:
Timestamp:
06/30/10 18:47:25 (10 years ago)
Author:
beliar
Message:

Patch by Beliar.

  • Minor modifications to dialogue files that check for an active quest and the quest variable instead of only for the quest variable
  • Containers now have a "replaceItem" method that can be used to replace an item with another. The new item will be at the same item position the old one was
  • Added "UseAction?" class that can be used when you need to execute commands that need a carryable item
  • Added ReplaceItem? command to UseAction?. This replaces the item, that the command is called on, with a new item of the given object type
  • Changed Box to have a "Use" Action with the display text "Open" that replaces the Box with Boots and sets the "open_box" variable of the fedex quest to 1
  • Added replace_stuff command to dialogues, this replaces an item, in either the pc's or npc's inventory (who), of the given item_id (old_item) with an new object of the given object_type(new_item)
  • When the player has opened the box it is possible to tell Janie who rewraps the Boots (replaces the boots in the pc's inventory with the Box)
  • checkAttributes method in GameModel? now does a deep copy instead of a shallow one.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/game/scripts/gamestate.py

    r570 r571  
    2626        self.object_ids = {} 
    2727        self.current_map_name = None 
     28        self.maps = {} 
    2829         
    2930         
     
    4243                self.objects[map_id][object_id] = game_object 
    4344            self.object_ids[object_id] = map_id 
    44          
     45     
     46    def deleteObject(self, object_id): 
     47        """Removes an object from the dictionaries 
     48        @param object_id: ID of the object 
     49        @type object_id: str 
     50        """ 
     51        if self.hasObject(object_id): 
     52            map_id = self.getMapOfObject(object_id) 
     53            if map_id: 
     54                inst = self.maps[map_id].agent_layer.getInstance(object_id) 
     55                self.maps[map_id].agent_layer.deleteInstance(inst) 
     56                del self.objects[map_id][object_id] 
     57            del self.object_ids[object_id] 
     58             
     59             
    4560    def getObjectsFromMap(self, map_id): 
    4661        """Gets all objects that are currently on the given map. 
Note: See TracChangeset for help on using the changeset viewer.