[wpdev-commits] xmlscripts/scripts environment.py,1.4,1.5
Brought to you by:
rip,
thiagocorrea
|
From: <dar...@us...> - 2003-09-15 12:42:18
|
Update of /cvsroot/wpdev/xmlscripts/scripts
In directory sc8-pr-cvs1:/tmp/cvs-serv16462
Modified Files:
environment.py
Log Message:
Added the dying tub to environment.py
Added logging constants for socket.log.
Index: environment.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/environment.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** environment.py 21 Aug 2003 22:34:27 -0000 1.4
--- environment.py 15 Sep 2003 12:42:15 -0000 1.5
***************
*** 192,195 ****
--- 192,229 ----
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
+
+ def dyingtub_response( char, args, target ):
+ dyetub = wolfpack.finditem( args[0] )
+
+ 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
+
+ # Valid Target?
+ 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
+
+ target.item.color = dyetub.color
+ target.item.update()
+ char.soundeffect( 0x023e )
+
# Table of IDs mapped to handler functions
actions = {
***************
*** 221,225 ****
# Hair Dyes
0xe27: hairdye,
! 0xeff: hairdye
}
--- 255,263 ----
# Hair Dyes
0xe27: hairdye,
! 0xeff: hairdye,
!
! # Dye Tub
! 0xfab: dyingtub,
!
}
|