[wpdev-commits] xmlscripts/scripts equipment.py,1.40,1.41
Brought to you by:
rip,
thiagocorrea
From: Sebastian H. <dar...@us...> - 2004-09-27 14:37:45
|
Update of /cvsroot/wpdev/xmlscripts/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18250 Modified Files: equipment.py Log Message: random magic item loot and additional properties Index: equipment.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/equipment.py,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** equipment.py 27 Sep 2004 09:58:34 -0000 1.40 --- equipment.py 27 Sep 2004 14:37:26 -0000 1.41 *************** *** 21,24 **** --- 21,41 ---- if object.hastag(tag): tooltip.add(cliloc, str(object.gettag(tag))) + + speedbonus = properties.fromitem(object, SPEEDBONUS) + if speedbonus != 0: + tooltip.add(1060486, str(speedbonus)) + + + hitbonus = properties.fromitem(object, HITBONUS) + if hitbonus != 0: + tooltip.add(1060415, str(hitbonus)) + + defensebonus = properties.fromitem(object, DEFENSEBONUS) + if defensebonus != 0: + tooltip.add(1060408, str(defensebonus)) + + enhancepotions = properties.fromitem(object, ENHANCEPOTIONS) + if enhancepotions != 0: + tooltip.add(1060411, str(enhancepotions)) reflectphysical = properties.fromitem(object, REFLECTPHYSICAL) *************** *** 42,45 **** --- 59,66 ---- tooltip.add(1060483, str(spelldamagebonus)) + luck = properties.fromitem(object, LUCK) + if luck != 0: + tooltip.add(1060436, str(luck)) + bonus = properties.fromitem(object, BONUSSTRENGTH) if bonus != 0: *************** *** 78,83 **** tooltip.add(1060440, str(regenmana)) ! if object.hastag("bestskill"): tooltip.add(1060400, "") if properties.fromitem(object, MAGEARMOR): --- 99,108 ---- tooltip.add(1060440, str(regenmana)) ! if properties.fromitem(object, BESTSKILL): tooltip.add(1060400, "") + + mageweapon = properties.fromitem(object, MAGEWEAPON) + if mageweapon != 0: + tooltip.add(1060438, str(mageweapon)) if properties.fromitem(object, MAGEARMOR): *************** *** 369,393 **** # Bonus Str bonus = properties.fromitem(item, BONUSSTRENGTH) ! value = max(0, char.strength + bonus) ! if value != char.strength: ! char.strength = value ! char.strength2 = max(0, char.strength2 + bonus) changed = True # Bonus Dex bonus = properties.fromitem(item, BONUSDEXTERITY) ! value = max(0, char.dexterity + bonus) ! if value != char.dexterity: ! char.dexterity = value ! char.dexterity2 = max(0, char.dexterity2 + bonus) changed = True # Bonus Int bonus = properties.fromitem(item, BONUSINTELLIGENCE) ! value = max(0, char.intelligence + bonus) ! if value != char.intelligence: ! char.intelligence = value ! char.intelligence2 = max(0, char.intelligence2 + bonus) changed = True # Bonus Hitpoints --- 394,436 ---- # Bonus Str bonus = properties.fromitem(item, BONUSSTRENGTH) ! if char.strength + bonus < 1: ! bonus = 1 - char.strength ! if char.strength + bonus > char.strengthcap: ! bonus = max(0, char.strengthcap - char.strength) ! if bonus != 0: ! char.strength += bonus ! char.strength2 += bonus ! item.settag('real_strength_bonus', bonus) changed = True + else: + item.deltag('real_strength_bonus') # Bonus Dex bonus = properties.fromitem(item, BONUSDEXTERITY) ! if char.dexterity + bonus < 1: ! bonus = 1 - char.dexterity ! if char.dexterity + bonus > char.dexteritycap: ! bonus = max(0, char.dexteritycap - char.dexterity) ! if bonus != 0: ! char.dexterity += bonus ! char.dexterity2 += bonus ! item.settag('real_dexterity_bonus', bonus) changed = True + else: + item.deltag('real_dexterity_bonus') # Bonus Int bonus = properties.fromitem(item, BONUSINTELLIGENCE) ! if char.intelligence + bonus < 1: ! bonus = 1 - char.intelligence ! if char.intelligence + bonus > char.intelligencecap: ! bonus = max(0, char.intelligencecap - char.intelligence) ! if bonus != 0: ! char.intelligence += bonus ! char.intelligence2 += bonus ! item.settag('real_intelligence_bonus', bonus) changed = True + else: + item.deltag('real_intelligence_bonus') # Bonus Hitpoints *************** *** 444,469 **** # Bonus Str ! bonus = properties.fromitem(item, BONUSSTRENGTH) ! value = max(0, char.strength - bonus) ! if value != char.strength: ! char.strength = value ! char.strength2 = max(0, char.strength2 - bonus) changed = True # Bonus Dex ! bonus = properties.fromitem(item, BONUSDEXTERITY) ! value = max(0, char.dexterity - bonus) ! if value != char.dexterity: ! char.dexterity = value ! char.dexterity2 = max(0, char.dexterity2 - bonus) changed = True # Bonus Int ! bonus = properties.fromitem(item, BONUSINTELLIGENCE) ! value = max(0, char.intelligence - bonus) ! if value != char.intelligence: ! char.intelligence = value ! char.intelligence2 = max(0, char.intelligence2 - bonus) changed = True # Bonus Hitpoints --- 487,512 ---- # Bonus Str ! if item.hastag('real_strength_bonus'): ! value = int(item.gettag('real_strength_bonus')) ! char.strength = max(1, char.strength - value) ! char.strength2 -= value changed = True + item.deltag('real_strength_bonus') # Bonus Dex ! if item.hastag('real_dexterity_bonus'): ! value = int(item.gettag('real_dexterity_bonus')) ! char.dexterity = max(1, char.dexterity - value) ! char.dexterity2 -= value changed = True + item.deltag('real_dexterity_bonus') # Bonus Int ! if item.hastag('real_intelligence_bonus'): ! value = int(item.gettag('real_intelligence_bonus')) ! char.intelligence = max(1, char.intelligence - value) ! char.intelligence2 -= value changed = True + item.deltag('real_intelligence_bonus') # Bonus Hitpoints *************** *** 523,527 **** # def onDelete(item): ! char = item.container onUnequip(char, item, item.layer) --- 566,573 ---- # def onDelete(item): ! if not item.container or not item.container.ischar(): ! return ! ! char = item.container onUnequip(char, item, item.layer) |