Update of /cvsroot/wpdev/xmlscripts/scripts
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23448/scripts
Modified Files:
equipment.py
Log Message:
This fixes a glitch where it wouldn't update the stats on Unequip.
Index: equipment.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/equipment.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** equipment.py 14 Sep 2003 21:41:36 -0000 1.3
--- equipment.py 26 Jan 2004 06:23:08 -0000 1.4
***************
*** 1,3 ****
--- 1,6 ----
+ import wolfpack
+ from wolfpack.utilities import *
+
# Check for Strength Requirements
def onWearItem( player, wearer, item, layer ):
***************
*** 16,20 ****
else:
player.message( 'You cannot wear that item, you seem not agile enough.' )
! return 1
if item.hastag( 'req_int' ) and wearer.intelligence < int( item.gettag( 'req_int' ) ):
--- 19,23 ----
else:
player.message( 'You cannot wear that item, you seem not agile enough.' )
! return 1
if item.hastag( 'req_int' ) and wearer.intelligence < int( item.gettag( 'req_int' ) ):
***************
*** 24,49 ****
else:
player.message( 'You cannot wear that item, you seem not smart enough.' )
! return 1
return 0
def onEquip( char, item, layer ):
! # Boni?
if item.hastag( 'boni_str' ):
char.strength = char.strength + int( item.gettag( 'boni_str' ) )
!
if item.hastag( 'boni_dex' ):
char.dexterity = char.dexterity + int( item.gettag( 'boni_dex' ) )
!
if item.hastag( 'boni_int' ):
char.intelligence = char.intelligence + int( item.gettag( 'boni_int' ) )
!
def onUnequip( char, item, layer ):
if item.hastag( 'boni_str' ):
char.strength = char.strength - int( item.gettag( 'boni_str' ) )
!
if item.hastag( 'boni_dex' ):
char.dexterity = char.dexterity - int( item.gettag( 'boni_dex' ) )
!
if item.hastag( 'boni_int' ):
char.intelligence = char.intelligence - int( item.gettag( 'boni_int' ) )
--- 27,57 ----
else:
player.message( 'You cannot wear that item, you seem not smart enough.' )
! return 1
return 0
def onEquip( char, item, layer ):
! # Bonus Strength
if item.hastag( 'boni_str' ):
char.strength = char.strength + int( item.gettag( 'boni_str' ) )
! # Bonus Dex
if item.hastag( 'boni_dex' ):
char.dexterity = char.dexterity + int( item.gettag( 'boni_dex' ) )
! # Bonus Int
if item.hastag( 'boni_int' ):
char.intelligence = char.intelligence + int( item.gettag( 'boni_int' ) )
! # Update Stats
! char.updatestats()
!
def onUnequip( char, item, layer ):
+ # Bonus Str
if item.hastag( 'boni_str' ):
char.strength = char.strength - int( item.gettag( 'boni_str' ) )
! # Bonus Dex
if item.hastag( 'boni_dex' ):
char.dexterity = char.dexterity - int( item.gettag( 'boni_dex' ) )
! # Bonus Int
if item.hastag( 'boni_int' ):
char.intelligence = char.intelligence - int( item.gettag( 'boni_int' ) )
+ # Update Stats
+ char.updatestats()
|