init python:
class Items( renpy.python.RevertableObject ):
def __init__( self, trait1, trait2, trait3, trait4 ):
self.trait1 = trait1
self.trait2 = trait2
self.trait3 = trait3
self.trait4 = trait4
class Potion( renpy.python.RevertableObject ):
def __init__( self, trait1, trait2, trait3, trait4 ):
self.trait1 = trait1
self.trait2 = trait2
self.trait3 = trait3
self.trait4 = trait4
def preparePotion( item1, item2 ):
return Potion( item1.trait1 + item2.trait1, item1.trait2 + item2.trait2, item1.trait3 + item2.trait3, item1.trait4 + item2.trait4 )
default toadSlime = Item( 1, 1, 1, 2 )
default batBlood = Item( 2, 1, 2, 1 )
default inventory = []
label whatever:
"You're mixing toad slime with bat blood"
$ createdPotion = preparePotion( toadSlime, batBlood )
"You now have a new potion in your inventory"
$ inventory.append( createdPotion )