From 647022710cdad02c457a01fdb5435d3b5ef04763 Mon Sep 17 00:00:00 2001 From: silvernexus Date: Wed, 2 Sep 2020 01:32:14 +0000 Subject: [PATCH] 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 --- ChangeLog | 5 +++++ python/events/gkill/sword_of_souls.py | 6 +++--- python/items/lose_buffs_on_drop.py | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 89af19958..97736274d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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) diff --git a/python/events/gkill/sword_of_souls.py b/python/events/gkill/sword_of_souls.py index a72f1630d..7e3fe55c8 100644 --- a/python/events/gkill/sword_of_souls.py +++ b/python/events/gkill/sword_of_souls.py @@ -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)) diff --git a/python/items/lose_buffs_on_drop.py b/python/items/lose_buffs_on_drop.py index f412336c3..fcdade809 100644 --- a/python/items/lose_buffs_on_drop.py +++ b/python/items/lose_buffs_on_drop.py @@ -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.")