Changeset 532
- Timestamp:
- 03/19/10 01:08:21 (10 years ago)
- Location:
- trunk/game
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/game/scripts/gui/dialoguegui.py
r473 r532 56 56 57 57 def get_stuff(state, thing): 58 if not state['pc'].inventory.has(thing): 59 state['pc'].inventory.placeItem(thing) 60 print "You've now have the %s" % thing 58 if not state['pc'].inventory.findItem(name = thing): 59 try : 60 self.npc.give(self.npc.inventory.findItem(name = thing), state['pc']) 61 print "You've now have the %s" % thing 62 except ValueError : 63 print "NPC doesn't have the %s" % thing 61 64 62 65 def give_stuff(state,thing): -
trunk/game/scripts/gui/inventorygui.py
r483 r532 140 140 """Show the inventory. 141 141 @return: None""" 142 self.updateInventoryButtons() 142 143 self.inventory.show() 143 144 -
trunk/game/scripts/objects/actors.py
r480 r532 286 286 if inventory == None: 287 287 self.inventory = Inventory() 288 self.inventory.placeItem(CarryableItem(ID = 632, 289 name = "box", 290 image = "/gui/inv_images/inv_box.png")) 291 288 292 else: 289 293 self.inventory = inventory … … 331 335 self.behaviour.pc = pc.behaviour.agent 332 336 self.behaviour.idle() 337 338 def give (self, item, actor): 339 """Gives the specified item to the different actor. Raises an exception if the item was invalid or not found 340 @type item: Carryable 341 @param item: The item object to give 342 @param actor: Person to give item to""" 343 if item == None: 344 raise ValueError("I don't have %s" % item.name) 345 self.inventory.takeItem(item) 346 actor.inventory.placeItem(item) 333 347 334 348 def setup(self):
Note: See TracChangeset
for help on using the changeset viewer.