[wpdev-commits] xmlscripts/scripts/commands addtree.py,1.8,1.9
Brought to you by:
rip,
thiagocorrea
From: Richard M. <dr...@us...> - 2004-08-14 06:29:45
|
Update of /cvsroot/wpdev/xmlscripts/scripts/commands In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25990/commands Modified Files: addtree.py Log Message: Updates Index: addtree.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/addtree.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** addtree.py 14 Aug 2004 05:45:33 -0000 1.8 --- addtree.py 14 Aug 2004 06:29:36 -0000 1.9 *************** *** 9,16 **** import wolfpack from wolfpack.consts import WPDT_ITEM from wolfpack.utilities import hex2dec from wolfpack import console ! from random import randint """ --- 9,17 ---- import wolfpack + import random from wolfpack.consts import WPDT_ITEM from wolfpack.utilities import hex2dec from wolfpack import console ! """ *************** *** 28,32 **** jungletreeindex = [ 'jungle1', 'jungle2', 'jungle3', 'jungle4', 'jungle5', 'jungle6', 'jungle7' ] ! treeindex = ['cca','ccb','ccc','ccd','cd0','cd3','cd6','cda','cdd','ce0','ce3','ce6','cf8','cfe','d01', 'd94', 'd98', 'd9c', 'da0', 'da4', 'da8'] trees = \ --- 29,33 ---- jungletreeindex = [ 'jungle1', 'jungle2', 'jungle3', 'jungle4', 'jungle5', 'jungle6', 'jungle7' ] ! treeindex = ['cca','ccb','ccc','ccd','cd0','cd3','cd6','cd8','cda','cdd','ce0','ce3','ce6','cf8','cfe','d01', 'd94', 'd98', 'd9c', 'da0', 'da4', 'da8'] trees = \ *************** *** 48,57 **** 'cfe': [ 'cfe', 'cff' ], # Cypress 'd01': [ 'd01', 'd02' ], # Cypress ! 'd94': [ 'd94', 'd95' ], ! 'd98': [ 'd98', 'd99' ], ! 'd9c': [ 'd9c', 'd9d' ], ! 'da0': [ 'da0', 'da1' ], ! 'da4': [ 'da4', 'da5' ], ! 'da8': [ 'da8', 'da9' ] } --- 49,58 ---- 'cfe': [ 'cfe', 'cff' ], # Cypress 'd01': [ 'd01', 'd02' ], # Cypress ! 'd94': [ 'd94', 'd95' ], # Apple ! 'd98': [ 'd98', 'd99' ], # Apple ! 'd9c': [ 'd9c', 'd9d' ], # Peach ! 'da0': [ 'da0', 'da1' ], # Peach ! 'da4': [ 'da4', 'da5' ], # Pear ! 'da8': [ 'da8', 'da9' ] # Pear } *************** *** 245,251 **** if len(arguments) > 0: item = str( arguments.strip() ) ! if item == 'random': ! randomtrees = [ randint(0,2), randint(0,12), randint(2,12), randint(0,20), randint(13,15), randint(16,20) ] ! item = treeindex[ randomtrees[ randint( 0, 5 ) ] ] if item in trees: if wolfpack.getdefinition( WPDT_ITEM, trees[item][TREE] ) and wolfpack.getdefinition( WPDT_ITEM, trees[item][LEAVES] ): --- 246,272 ---- if len(arguments) > 0: item = str( arguments.strip() ) ! if item == 'forest': ! item = treeindex[ random.randint(0, 12) ] ! if item in trees: ! if wolfpack.getdefinition( WPDT_ITEM, trees[item][TREE] ) and wolfpack.getdefinition( WPDT_ITEM, trees[item][LEAVES] ): ! socket.sysmessage( "Where do you want to place the tree '%s', '%s' ?" % ( trees[item][TREE], trees[item][LEAVES ]) ) ! socket.attachtarget( 'commands.addtree.createtree', [ item ] ) ! return ! elif item == 'fruit': ! item = treeindex[ random.randint( 16, 21 ) ] ! if item in trees: ! if wolfpack.getdefinition( WPDT_ITEM, trees[item][TREE] ) and wolfpack.getdefinition( WPDT_ITEM, trees[item][LEAVES] ): ! socket.sysmessage( "Where do you want to place the tree '%s', '%s' ?" % ( trees[item][TREE], trees[item][LEAVES ]) ) ! socket.attachtarget( 'commands.addtree.createtree', [ item ] ) ! return ! elif item == 'swamp': ! item = treeindex[ random.randint(13, 15) ] ! if item in trees: ! if wolfpack.getdefinition( WPDT_ITEM, trees[item][TREE] ) and wolfpack.getdefinition( WPDT_ITEM, trees[item][LEAVES] ): ! socket.sysmessage( "Where do you want to place the tree '%s', '%s' ?" % ( trees[item][TREE], trees[item][LEAVES ]) ) ! socket.attachtarget( 'commands.addtree.createtree', [ item ] ) ! return ! elif item == 'random': ! item = random.choice( treeindex ) if item in trees: if wolfpack.getdefinition( WPDT_ITEM, trees[item][TREE] ) and wolfpack.getdefinition( WPDT_ITEM, trees[item][LEAVES] ): *************** *** 266,272 **** return else: ! socket.sysmessage( "Usage: addtree [id, yew, jungle[1-7], random") else: ! socket.sysmessage( "Usage: addtree [id, yew, jungle[1-7], random") def onLoad(): --- 287,293 ---- return else: ! socket.sysmessage( "Usage: addtree [ id, yew, jungle[1-7], random, forest, fruit, swamp ]" ) else: ! socket.sysmessage( "Usage: addtree [ id, yew, jungle[1-7], random, forest, fruit, swamp ]" ) def onLoad(): |