[wpdev-commits] xmlscripts/scripts/wolfpack properties.py,1.8,1.9
Brought to you by:
rip,
thiagocorrea
From: Richard M. <dr...@us...> - 2004-09-06 17:36:33
|
Update of /cvsroot/wpdev/xmlscripts/scripts/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11251/wolfpack Modified Files: properties.py Log Message: Yay, now the properties transfer to the player status! Tags should always override. Index: properties.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/properties.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** properties.py 5 Sep 2004 21:06:41 -0000 1.8 --- properties.py 6 Sep 2004 17:36:22 -0000 1.9 *************** *** 96,101 **** return info[1] ! # Tag overrides properties ! if item.hastag(info[0]): # HITSOUND and MISSSOUND need special treatment beacuse of # the list character. --- 96,101 ---- return info[1] ! # Tags Always go first, override system. ! if item.hastag( info[0] ): # HITSOUND and MISSSOUND need special treatment beacuse of # the list character. *************** *** 104,107 **** --- 104,117 ---- else: return int(item.gettag(info[0])) + + elif item.hasintproperty( info[0] ): + return int( item.getintproperty( info[0], 0 ) ) + + elif item.hasstrproperty( info[0] ): + if property == HITSOUND or property == MISSSOUND: + return str(item.getstrproperty( info[0], '' ) ).split(',') + else: + return str(item.getstrproperty( info[0], '' ) ) + else: # See if our weapon info has anything for the *************** *** 130,133 **** --- 140,144 ---- return value + elif itemcheck(item, ITEM_ARMOR) or itemcheck(item, ITEM_SHIELD): if armorinfo.ARMORINFO.has_key(item.baseid): *************** *** 145,148 **** --- 156,165 ---- if armorinfo.ARMOR_RESNAME_BONI[resname].has_key(property): value += armorinfo.ARMOR_RESNAME_BONI[resname][property] + # No tag, what about property? + elif item.hasstrproperty('resname'): + resname = str( item.getstrproperty( 'resname', '' ) ) + if armorinfo.ARMOR_RESNAME_BONI.has_key(resname): + if armorinfo.ARMOR_RESNAME_BONI[resname].has_key(property): + value += armorinfo.ARMOR_RESNAME_BONI[resname][property] if item.hastag('resname2'): *************** *** 151,154 **** --- 168,177 ---- if armorinfo.ARMOR_RESNAME_BONI[resname].has_key(property): value += armorinfo.ARMOR_RESNAME_BONI[resname][property] + # No tag, what about property? + elif item.hasstrproperty('resname2'): + resname = str( item.getstrproperty( 'resname2', '' ) ) + if armorinfo.ARMOR_RESNAME_BONI.has_key(resname): + if armorinfo.ARMOR_RESNAME_BONI[resname].has_key(property): + value += armorinfo.ARMOR_RESNAME_BONI[resname][property] return value *************** *** 233,240 **** # If the npc has mindamage and maxdamage tags, they # override all other settings ! if char.hastag('mindamage') and char.hastag('maxdamage'): mindamage = int(char.gettag('mindamage')) maxdamage = int(char.gettag('maxdamage')) ! return (mindamage, maxdamage) # Special treatment for fists. --- 256,269 ---- # If the npc has mindamage and maxdamage tags, they # override all other settings ! ! mindamage = char.getintproperty( 'mindamage', 1 ) ! if char.hastag('mindamage'): mindamage = int(char.gettag('mindamage')) + + maxdamage = char.getintproperty( 'maxdamage', 3 ) + if char.hastag('maxdamage'): maxdamage = int(char.gettag('maxdamage')) ! ! return (mindamage, maxdamage) # Special treatment for fists. |