Ignore:
Timestamp:
07/21/10 17:11:48 (9 years ago)
Author:
beliar
Message:

Patch by Beliar.

  • Added basic support for adding items on the map. Currently no interaction with the items are possible.
  • Added a bottle to the "Mall" map, its lying between the wooden crate and the "To farm" "door".
Location:
trunk/game/scripts/objects
Files:
1 added
3 edited

Legend:

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

    r584 r592  
    1616#   along with PARPG.  If not, see <http://www.gnu.org/licenses/>. 
    1717 
    18 import containers, doors 
     18import containers 
     19import doors 
    1920import actors 
     21import items 
    2022import sys 
    2123 
    22 object_modules = [containers, actors, doors] 
     24OBJECT_MODULES = [containers, actors, doors, items] 
    2325 
    2426def getAllObjects (): 
     
    2628       mapped to the classes themselves""" 
    2729    result = {} 
    28     for module in object_modules: 
     30    for module in OBJECT_MODULES: 
    2931        for class_name in module.__all__: 
    30             result[class_name] = getattr (module,class_name) 
     32            result[class_name] = getattr (module, class_name) 
    3133    return result 
    3234 
    33 def createObject(info, extra = {}): 
     35def createObject(info, extra = None): 
    3436    """Called when we need to get an actual object. 
    3537       @type info: dict 
     
    3941       @return: the object""" 
    4042    # First, we try to get the type and ID, which every game_obj needs. 
     43    extra = extra or {} 
    4144    try: 
    4245        obj_type = info.pop('type') 
  • trunk/game/scripts/objects/base.py

    r590 r592  
    253253        self.is_carryable = True 
    254254        self.in_container = None 
     255        self.on_map = None 
     256        self.agent = None 
    255257        self.weight = weight 
    256258        self.bulk = bulk 
  • trunk/game/scripts/objects/composed.py

    r584 r592  
    9494        super(CarryableItem, self).prepareStateForSaving(state) 
    9595        del state["in_container"] 
     96        del state["on_map"] 
     97        del state["agent"] 
    9698 
    9799    def getStateForSaving(self): 
Note: See TracChangeset for help on using the changeset viewer.