Update of /cvsroot/wpdev/xmlscripts/scripts/wolfpack
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10986/wolfpack
Modified Files:
consts.py properties.py
Log Message:
fixes
Index: consts.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/consts.py,v
retrieving revision 1.82
retrieving revision 1.83
diff -C2 -d -r1.82 -r1.83
*** consts.py 27 Sep 2004 00:31:49 -0000 1.82
--- consts.py 27 Sep 2004 09:58:34 -0000 1.83
***************
*** 83,86 ****
--- 83,87 ----
LOWERMANACOST = 51
LOWERREAGENTCOST = 52
+ SELFREPAIR = 53
# Checks for certain item types
Index: properties.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/properties.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** properties.py 27 Sep 2004 00:31:49 -0000 1.14
--- properties.py 27 Sep 2004 09:58:34 -0000 1.15
***************
*** 78,81 ****
--- 78,82 ----
# Misc
LUCK: ['luck', 0, 1],
+ SELFREPAIR: ['selfrepair', 0, 0],
# Requirements
***************
*** 388,392 ****
# PROPERT KEY, min value, max value, factor, accumulate
LOWERREQS: [10, 100, 10, True],
! #[SELFREPAIR, 1, 5, 1, False],
DURABILITYBONUS: [10, 100, 10, True],
MAGEARMOR: [1, 1, 1, False],
--- 389,393 ----
# PROPERT KEY, min value, max value, factor, accumulate
LOWERREQS: [10, 100, 10, True],
! SELFREPAIR: [1, 5, 1, False],
DURABILITYBONUS: [10, 100, 10, True],
MAGEARMOR: [1, 1, 1, False],
***************
*** 445,448 ****
--- 446,497 ----
item.resendtooltip()
+ # List of allowed properties
+ SHIELD_PROPERTIES = {
+ # PROPERT KEY, min value, max value, factor, accumulate
+ SPELLCHANNELING: [1, 1, 1, False],
+ DEFENSEBONUS: [1, 15, 1, True],
+ HITBONUS: [1, 15, 1, True],
+ CASTSPEEDBONUS: [1, 1, True],
+ LOWERREQS: [10, 100, 10, True],
+ SELFREPAIR: [1, 5, 1, False],
+ DURABILITYBONUS: [10, 100, 10, True],
+ }
+
+ #
+ # Apply a random shield property
+ #
+ def applyShieldRandom(item, props, minintensity, maxintensity, luckchance):
+ properties = SHIELD_PROPERTIES.keys()
+
+ # Select unique properties
+ for i in range(0, props):
+ property = random.choice(properties)
+ properties.remove(property)
+
+ if not PROPERTIES.has_key(property):
+ continue
+
+ # Scale the value for the property
+ info = SHIELD_PROPERTIES[property]
+ value = scaleValue(minintensity, maxintensity, info[0], info[1], info[2], luckchance)
+
+ # Some special handling for special boni
+ if property == DURABILITYBONUS:
+ bonus = int(ceil(item.maxhealth * (value / 100.0)))
+ item.maxhealth = max(1, item.maxhealth + bonus)
+ item.health = item.maxhealth
+
+ # Set cast speed to -1
+ elif property == SPELLCHANNELING:
+ item.settag(PROPERTIES[CASTSPEEDBONUS][0], -1)
+
+ # Resistances are cummulative
+ if info[3]:
+ value += fromitem(item, property)
+
+ item.settag(PROPERTIES[property][0], value)
+
+ item.resendtooltip()
+
#
# Apply random properties to the given items.
***************
*** 472,476 ****
# List of random armors for magic
# item generation
-
def testarmor(container):
DEF_ARMOR = DEF_LEATHER + DEF_STUDDED + DEF_CHAINMAIL + DEF_RINGMAIL + DEF_BONEMAIL + DEF_PLATEMAIL + DEF_HELMS + DEF_SHIELDS
--- 521,524 ----
|