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-b93c2d0d6712master
parent
a9ce8b82df
commit
647022710c
|
@ -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
|
2020-08-25 Rick Tanner
|
||||||
* planes/astral-vault: Numerous cosmetic, design and functional changes to
|
* planes/astral-vault: Numerous cosmetic, design and functional changes to
|
||||||
Astral Vault (planes/astral-vault)
|
Astral Vault (planes/astral-vault)
|
||||||
|
|
|
@ -20,13 +20,13 @@ if killer.Owner is None and killer.Type == Crossfire.Type.PLAYER:
|
||||||
victim = Crossfire.WhoAmI()
|
victim = Crossfire.WhoAmI()
|
||||||
if victim is not None:
|
if victim is not None:
|
||||||
old_level = weap.ItemPower
|
old_level = weap.ItemPower
|
||||||
old_xp = weap.PermExp
|
old_xp = weap.TotalExp
|
||||||
# Add experience to the weapon (though we only care about the perm_exp field)
|
# 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
|
# As the weapon gets stronger, it takes a larger share of the exp
|
||||||
weap.AddExp((victim.Exp * (1.0 + weap.ItemPower / 115.0)) // 1)
|
weap.AddExp((victim.Exp * (1.0 + weap.ItemPower / 115.0)) // 1)
|
||||||
|
|
||||||
# Determine the change in XP
|
# Determine the change in XP
|
||||||
delta_exp = weap.PermExp - old_xp
|
delta_exp = weap.TotalExp - old_xp
|
||||||
|
|
||||||
# DEBUGGING INFO:
|
# DEBUGGING INFO:
|
||||||
# Crossfire.Log(Crossfire.LogInfo, str(victim.Exp) + " -> " + str(delta_exp) + " & " + str(victim.Exp - delta_exp))
|
# Crossfire.Log(Crossfire.LogInfo, str(victim.Exp) + " -> " + str(delta_exp) + " & " + str(victim.Exp - delta_exp))
|
||||||
|
|
|
@ -23,6 +23,6 @@ if me.PermExp > 0:
|
||||||
me.AttackType = me.Archetype.Clone.AttackType
|
me.AttackType = me.Archetype.Clone.AttackType
|
||||||
me.Food = me.Archetype.Clone.Food
|
me.Food = me.Archetype.Clone.Food
|
||||||
# Experience should be affected before Item Power, since it affects that field
|
# 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
|
me.ItemPower = me.Archetype.Clone.ItemPower
|
||||||
ac.Write("The "+me.Name+" shudders and looks almost like a normal weapon again.")
|
ac.Write("The "+me.Name+" shudders and looks almost like a normal weapon again.")
|
||||||
|
|
Loading…
Reference in New Issue