[wpdev-commits] xmlscripts/scripts equipment.py,1.38,1.39
Brought to you by:
rip,
thiagocorrea
From: Sebastian H. <dar...@us...> - 2004-09-27 00:31:58
|
Update of /cvsroot/wpdev/xmlscripts/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24292 Modified Files: equipment.py Log Message: fixes Index: equipment.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/equipment.py,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** equipment.py 13 Sep 2004 19:14:46 -0000 1.38 --- equipment.py 27 Sep 2004 00:31:48 -0000 1.39 *************** *** 14,25 **** def modifiers(object, tooltip): modifiers = { - "boni_dex": 1060409, - "boni_int": 1060432, - "boni_str": 1060485, "remaining_uses": 1060584, "aos_boni_damage": 1060401, - "regenhitpoints": 1060444, - "regenstamina": 1060443, - "regenmana": 1060440, } --- 14,19 ---- *************** *** 44,55 **** spelldamagebonus = properties.fromitem(object, SPELLDAMAGEBONUS) ! if spelldamagebonus: tooltip.add(1060483, str(spelldamagebonus)) if object.hastag("bestskill"): tooltip.add(1060400, "") ! if object.hastag('magearmor'): tooltip.add(1060437, "") --- 38,85 ---- spelldamagebonus = properties.fromitem(object, SPELLDAMAGEBONUS) ! if spelldamagebonus: tooltip.add(1060483, str(spelldamagebonus)) + bonus = properties.fromitem(object, BONUSSTRENGTH) + if bonus != 0: + tooltip.add(1060485, str(bonus)) + + bonus = properties.fromitem(object, BONUSDEXTERITY) + if bonus != 0: + tooltip.add(1060409, str(bonus)) + + bonus = properties.fromitem(object, BONUSINTELLIGENCE) + if bonus != 0: + tooltip.add(1060432, str(bonus)) + + bonus = properties.fromitem(object, BONUSHITPOINTS) + if bonus != 0: + tooltip.add(1060431, str(bonus)) + + bonus = properties.fromitem(object, BONUSSTAMINA) + if bonus != 0: + tooltip.add(1060484, str(bonus)) + + bonus = properties.fromitem(object, BONUSMANA) + if bonus != 0: + tooltip.add(1060439, str(bonus)) + + regenhitpoints = properties.fromitem(object, REGENHITPOINTS) + if regenhitpoints: + tooltip.add(1060444, str(regenhitpoints)) + + regenstamina = properties.fromitem(object, REGENSTAMINA) + if regenstamina: + tooltip.add(1060443, str(regenstamina)) + + regenmana = properties.fromitem(object, REGENMANA) + if regenmana: + tooltip.add(1060440, str(regenmana)) + if object.hastag("bestskill"): tooltip.add(1060400, "") ! if properties.fromitem(object, MAGEARMOR): tooltip.add(1060437, "") *************** *** 179,183 **** maxdamage = object.getintproperty( 'maxdamage', 2 ) if object.hastag( 'maxdamage' ): ! mindamage = int( object.gettag( 'maxdamage' ) ) tooltip.add( 1061168, "%u\t%u" % ( mindamage, maxdamage ) ) --- 209,213 ---- maxdamage = object.getintproperty( 'maxdamage', 2 ) if object.hastag( 'maxdamage' ): ! maxdamage = int( object.gettag( 'maxdamage' ) ) tooltip.add( 1061168, "%u\t%u" % ( mindamage, maxdamage ) ) *************** *** 246,249 **** --- 276,287 ---- modifiers(object, tooltip) + lowermana = properties.fromitem(object, LOWERMANACOST) + if lowermana: + tooltip.add(1060433, str(lowermana)) + + lowerreags = properties.fromitem(object, LOWERREAGENTCOST) + if lowerreags: + tooltip.add(1060434, str(lowerreags)) + lower = properties.fromitem(object, LOWERREQS) if lower: *************** *** 324,359 **** changed = 0 ! # Bonus Strength ! if item.hastag('boni_str'): ! char.strength = char.strength + int(item.gettag('boni_str')) ! changed = 1 # Bonus Dex ! if item.hastag('boni_dex'): ! char.dexterity = char.dexterity + int(item.gettag('boni_dex')) ! changed = 1 # Bonus Int ! if item.hastag('boni_int'): ! char.intelligence = char.intelligence + int(item.gettag('boni_int')) ! changed = 1 # Add hitpoint regeneration rate bonus ! if item.hastag('regenhitpoints'): if char.hastag('regenhitpoints'): ! regenhitpoints = int(char.gettag('regenhitpoints')) + int(item.gettag('regenhitpoints')) ! else: ! regenhitpoints = int(item.gettag('regenhitpoints')) ! char.settag('regenhitpoints', regenhitpoints) # Add stamina regeneration rate bonus ! if item.hastag('regenstamina'): if char.hastag('regenstamina'): ! regenstamina = int(char.gettag('regenstamina')) + int(item.gettag('regenstamina')) ! else: ! regenstamina = int(item.gettag('regenstamina')) ! char.settag('regenstamina', regenstamina) # Update Stats --- 362,430 ---- changed = 0 ! # 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 ! bonushitpoints = properties.fromitem(item, BONUSHITPOINTS) ! if bonushitpoints != 0: ! char.hitpointsbonus += bonushitpoints ! changed = True ! ! # Bonus Stamina ! bonusstamina = properties.fromitem(item, BONUSSTAMINA) ! if bonusstamina != 0: ! char.staminabonus += bonusstamina ! changed = True ! ! # Bonus Mana ! bonusmana = properties.fromitem(item, BONUSMANA) ! if bonusmana != 0: ! char.manabonus += bonusmana ! changed = True # Add hitpoint regeneration rate bonus ! regenhitpoints = properties.fromitem(item, REGENHITPOINTS) ! if regenhitpoints: if char.hastag('regenhitpoints'): ! regenhitpoints += int(char.gettag('regenhitpoints')) ! char.settag('regenhitpoints', regenhitpoints) # Add stamina regeneration rate bonus ! regenstamina = properties.fromitem(item, REGENSTAMINA) ! if regenstamina: if char.hastag('regenstamina'): ! regenstamina += int(char.gettag('regenstamina')) ! char.settag('regenstamina', regenstamina) + + # Add mana regeneration rate bonus + regenmana = properties.fromitem(item, REGENMANA) + if regenmana: + if char.hastag('regenmana'): + regenmana += int(char.gettag('regenmana')) + + char.settag('regenmana', regenmana) # Update Stats *************** *** 366,402 **** def onUnequip(char, item, layer): changed = 0 ! # Bonus Str ! if item.hastag('boni_str'): ! char.strength = char.strength - int(item.gettag('boni_str')) ! changed = 1 # Bonus Dex ! if item.hastag('boni_dex'): ! char.dexterity = char.dexterity - int(item.gettag('boni_dex')) ! changed = 1 # Bonus Int ! if item.hastag('boni_int'): ! char.intelligence = char.intelligence - int(item.gettag('boni_int')) ! changed = 1 ! # Remove the hitpoint regeneration rate bonus ! if item.hastag('regenhitpoints') and char.hastag('regenhitpoints'): ! regenhitpoints = int(char.gettag('regenhitpoints')) ! regenhitpoints -= int(item.gettag('regenhitpoints')) ! if regenhitpoints <= 0: char.deltag('regenhitpoints') else: ! char.settag('regenhitpoints', regenhitpoints) ! # Remove the stamina regeneration rate bonus ! if item.hastag('regenstamina') and char.hastag('regenstamina'): ! regenstamina = int(char.gettag('regenstamina')) ! regenstamina -= int(item.gettag('regenstamina')) ! if regenstamina <= 0: char.deltag('regenstamina') else: ! char.settag('regenstamina', regenstamina) # Update Stats --- 437,512 ---- def onUnequip(char, item, layer): changed = 0 ! # 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 ! bonushitpoints = properties.fromitem(item, BONUSHITPOINTS) ! if bonushitpoints != 0: ! char.hitpointsbonus -= bonushitpoints ! changed = True ! ! # Bonus Stamina ! bonusstamina = properties.fromitem(item, BONUSSTAMINA) ! if bonusstamina != 0: ! char.staminabonus -= bonusstamina ! changed = True ! ! # Bonus Mana ! bonusmana = properties.fromitem(item, BONUSMANA) ! if bonusmana != 0: ! char.manabonus -= bonusmana ! changed = True ! ! # Remove hitpoint regeneration rate bonus ! regenhitpoints = properties.fromitem(item, REGENHITPOINTS) ! if regenhitpoints and char.hastag('regenhitpoints'): ! value = int(char.gettag('regenhitpoints')) - regenhitpoints ! ! if value <= 0: char.deltag('regenhitpoints') else: ! char.settag('regenhitpoints', value) ! # Remove stamina regeneration rate bonus ! regenstamina = properties.fromitem(item, REGENSTAMINA) ! if regenstamina and char.hastag('regenstamina'): ! value = int(char.gettag('regenstamina')) - regenstamina ! ! if value <= 0: char.deltag('regenstamina') else: ! char.settag('regenstamina', value) ! ! # Remove mana regeneration rate bonus ! regenmana = properties.fromitem(item, REGENMANA) ! if regenmana and char.hastag('regenmana'): ! value = int(char.gettag('regenmana')) - regenmana ! ! if value <= 0: ! char.deltag('regenmana') ! else: ! char.settag('regenmana', value) # Update Stats *************** *** 404,407 **** --- 514,524 ---- char.updatestats() + # + # Remove boni + # + def onDelete(item): + char = item.container + onUnequip(char, item, item.layer) + # Try to equip an item after calling onWearItem for it def onUse(player, item): |