# HG changeset patch # User Stefano Rivera # Date 1282853401 -7200 # Node ID 10d3265f0bfa52d159c51a561e94ea9d0747a8f4 # Parent b03debaec72d2174423e0d31b3134284c43c2093 Decreasing cans on shelf diff -r b03debaec72d -r 10d3265f0bfa Resources/images/mess/cans_on_shelf.png Binary file Resources/images/mess/cans_on_shelf.png has changed diff -r b03debaec72d -r 10d3265f0bfa Resources/images/mess/shelf_1_can.png Binary file Resources/images/mess/shelf_1_can.png has changed diff -r b03debaec72d -r 10d3265f0bfa Resources/images/mess/shelf_2_cans.png Binary file Resources/images/mess/shelf_2_cans.png has changed diff -r b03debaec72d -r 10d3265f0bfa Resources/images/mess/shelf_3_cans.png Binary file Resources/images/mess/shelf_3_cans.png has changed diff -r b03debaec72d -r 10d3265f0bfa gamelib/scenes/mess.py --- a/gamelib/scenes/mess.py Thu Aug 26 21:51:27 2010 +0200 +++ b/gamelib/scenes/mess.py Thu Aug 26 22:10:01 2010 +0200 @@ -93,27 +93,30 @@ NAME = "mess.cans" INTERACTS = { - "cans": InteractImage(165, 209, "cans_on_shelf.png"), - "nocans": InteractNoImage(165, 209, 50, 50), + '3cans': InteractImage(165, 209, 'shelf_3_cans.png'), + '2cans': InteractImage(165, 209, 'shelf_2_cans.png'), + '1cans': InteractImage(165, 209, 'shelf_1_can.png'), + '0cans': InteractNoImage(165, 209, 50, 50), } - INITIAL = "cans" + INITIAL = '3cans' INITIAL_DATA = { - 'cans_vended': 0, + 'cans_available': 3, } def interact_without(self): - starting_cans = self.get_data('cans_vended') - if starting_cans < 3: + starting_cans = self.get_data('cans_available') + if starting_cans > 0: can = FullCan("full_can") self.state.add_item(can) self.state.add_inventory_item(can.name) - self.set_data('cans_vended', starting_cans + 1) + self.set_data('cans_available', starting_cans - 1) + self.set_interact('%icans' % (starting_cans - 1)) return Result({ - 0: "Best before along time in the past. Better not eat these.", - 1: "Mmmm. Nutritious Bacteria Stew.", - 2: "Candied silkworms. Who stocked this place!?", + 3: "Best before along time in the past. Better not eat these.", + 2: "Mmmm. Nutritious Bacteria Stew.", + 1: "Candied silkworms. Who stocked this place!?", }[starting_cans]) else: return Result("The rest of the cans are rusted beyond usefulness.")