Re: Using items on each other
A possible solution is method names. For example: pistol.ammo_used() or lockbox.key_used(). I'm assuming you use inheritance, so each item is a child of the generic item. You can use getattr to get the method name, or else print some generic message like "A banana and a pistol? No way." or something like that.
Alternatively, I guess you could have a module or dictionary dedicated to these functions, so like pistol_with_ammo or pizza_with_knife if your items are just names or if you prefer that for some reason. That also makes it a little bit easier for the order to be flipped around--what if someone used the ammo with the pistol instead of the other way around?
-- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector