Adjust weapon of Souls python code to use TotalExp field instead of PermExp

Requires server r21321, recommended to use server r21326 with this change. Some builds produce a barfing cfpython plugin in r21321, while some don't. All should work in r21326.

git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@21327 282e977c-c81d-0410-88c4-b93c2d0d6712
master
silvernexus 2020-09-02 01:32:14 +00:00
parent a9ce8b82df
commit 647022710c
3 changed files with 9 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2020-09-01 Daniel Hawkins
* python/items/lose_buffs_on_drop.py,
python/events/gkill/sword_of_souls.py: Update to use TotalExp field over PermExp.
Requires server r21326 to properly function.
2020-08-25 Rick Tanner
* planes/astral-vault: Numerous cosmetic, design and functional changes to
Astral Vault (planes/astral-vault)

View File

@ -20,13 +20,13 @@ if killer.Owner is None and killer.Type == Crossfire.Type.PLAYER:
victim = Crossfire.WhoAmI()
if victim is not None:
old_level = weap.ItemPower
old_xp = weap.PermExp
# Add experience to the weapon (though we only care about the perm_exp field)
old_xp = weap.TotalExp
# Add experience to the weapon (though we only care about the total_exp field)
# As the weapon gets stronger, it takes a larger share of the exp
weap.AddExp((victim.Exp * (1.0 + weap.ItemPower / 115.0)) // 1)
# Determine the change in XP
delta_exp = weap.PermExp - old_xp
delta_exp = weap.TotalExp - old_xp
# DEBUGGING INFO:
# Crossfire.Log(Crossfire.LogInfo, str(victim.Exp) + " -> " + str(delta_exp) + " & " + str(victim.Exp - delta_exp))

View File

@ -23,6 +23,6 @@ if me.PermExp > 0:
me.AttackType = me.Archetype.Clone.AttackType
me.Food = me.Archetype.Clone.Food
# Experience should be affected before Item Power, since it affects that field
me.AddExp(-me.PermExp)
me.AddExp(-me.TotalExp)
me.ItemPower = me.Archetype.Clone.ItemPower
ac.Write("The "+me.Name+" shudders and looks almost like a normal weapon again.")