[wpdev-commits] xmlscripts/scripts environment.py,1.14,1.15
Brought to you by:
rip,
thiagocorrea
From: Richard M. <dr...@us...> - 2004-08-10 22:07:08
|
Update of /cvsroot/wpdev/xmlscripts/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10458 Modified Files: environment.py Log Message: A test of the locales stuff. Index: environment.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/environment.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** environment.py 16 Jul 2004 07:09:21 -0000 1.14 --- environment.py 10 Aug 2004 22:06:58 -0000 1.15 *************** *** 6,14 **** import random from wolfpack.consts import COTTONPLANTS_REGROW, ANIM_ATTACK5, TINKERING, \ ! MUSICIANSHIP, LAYER_HAIR, LAYER_BEARD from wolfpack.utilities import tobackpack from wolfpack.gumps import cGump from math import floor ! def cotton( char, item ): --- 6,14 ---- import random from wolfpack.consts import COTTONPLANTS_REGROW, ANIM_ATTACK5, TINKERING, \ ! MUSICIANSHIP, LAYER_HAIR, LAYER_BEARD, SYSLOCALE from wolfpack.utilities import tobackpack from wolfpack.gumps import cGump from math import floor ! from wolfpack.locales import localemsg def cotton( char, item ): *************** *** 18,22 **** if lastpick + COTTONPLANTS_REGROW > wolfpack.time.currenttime(): ! char.message( "You can't pick cotton here yet." ) return 1 --- 18,22 ---- if lastpick + COTTONPLANTS_REGROW > wolfpack.time.currenttime(): ! char.message( localemsg( 4 ) ) return 1 *************** *** 29,33 **** cotton.update() ! char.message( "You reach down and pick some cotton." ) # Set a timer for the cotton plant --- 29,33 ---- cotton.update() ! char.message( localemsg( 5 ) ) # Set a timer for the cotton plant *************** *** 38,42 **** if not char.checkskill( TINKERING, 0, 500 ): if random.randint( 1, 100 ) <= 25: ! additional = ' and break the parts' if item.amount > 1: --- 38,42 ---- if not char.checkskill( TINKERING, 0, 500 ): if random.randint( 1, 100 ) <= 25: ! additional = localemsg( 15 ) if item.amount > 1: *************** *** 46,52 **** item.delete() else: ! additional = '' ! char.message( "You don't manage to create the sextant%s" % additional ) else: if item.amount > 1: --- 46,52 ---- item.delete() else: ! additional = localemsg( 16 ) ! char.message( "%s%s" % ( localemsg( 14 ), additional ) ) else: if item.amount > 1: *************** *** 63,72 **** char.getbackpack().additem( item, 1, 1, 0 ) item.update() ! char.message( "You put the sextant into your backpack" ) return 1 def sextant( char, item ): ! char.message( 'Sorry but this feature is not implemented yet' ) return 1 --- 63,72 ---- char.getbackpack().additem( item, 1, 1, 0 ) item.update() ! char.message( localemsg( 17 ) ) return 1 def sextant( char, item ): ! char.message( localemsg( 0 ) ) return 1 *************** *** 117,121 **** def hairdye( char, item ): if item.container != char.getbackpack(): ! char.message( 'This item has to be in your backpack to use it.' ) return 1 --- 117,121 ---- def hairdye( char, item ): if item.container != char.getbackpack(): ! char.message( localemsg( 3 ) ) return 1 *************** *** 167,176 **** if not item or item.container != char.getbackpack(): ! char.message( 'The item has to be in your backpack to use it.' ) return # Check if it's a valid color if len( response.switches ) != 1: ! char.message( 'You have to choose a hair color.' ) return --- 167,176 ---- if not item or item.container != char.getbackpack(): ! char.message( localemsg( 3 ) ) return # Check if it's a valid color if len( response.switches ) != 1: ! char.message( localemsg( 13 ) ) return *************** *** 195,207 **** return ! char.message( 'Thats an invalid color' ) # Dying Tub def dyingtub( char, item ): if not char.canreach( item, 2 ): ! char.socket.sysmessage( "You can't reach this." ) return 1 ! char.socket.sysmessage( 'What do you want to use this on?' ) char.socket.attachtarget( 'environment.dyingtub_response', [ item.serial ] ) return 1 --- 195,207 ---- return ! char.message( localemsg( 12 ) ) # Dying Tub def dyingtub( char, item ): if not char.canreach( item, 2 ): ! char.socket.sysmessage( localemsg( 6 ) ) return 1 ! char.socket.sysmessage( localemsg( 18 ) ) char.socket.attachtarget( 'environment.dyingtub_response', [ item.serial ] ) return 1 *************** *** 211,219 **** if not dyetub or not char.canreach( dyetub, 2 ): ! char.message( "You can't reach the dyetub from here." ) return if not target.item: ! char.message( 'You need to target an item.' ) return --- 211,219 ---- if not dyetub or not char.canreach( dyetub, 2 ): ! char.message( localemsg( 6 ) ) return if not target.item: ! char.message( localemsg( 8 ) ) return *************** *** 221,229 **** if not char.gm: if target.item.getoutmostchar() != char: ! char.socket.sysmessage( "You have to have this in your belongings." ) return if not target.item.dye: ! char.socket.sysmessage( "You cannot dye this." ) return --- 221,229 ---- if not char.gm: if target.item.getoutmostchar() != char: ! char.socket.sysmessage( localemsg( 10 ) ) return if not target.item.dye: ! char.socket.sysmessage( localemsg( 11 ) ) return |