Fix type error by converting explicitely to int.
Display message only if the wielder is a player. git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@22059 282e977c-c81d-0410-88c4-b93c2d0d6712master
parent
faf3b3b81e
commit
f07e438d1b
|
@ -1,3 +1,8 @@
|
|||
2021-04-07 Nicolas Weeger
|
||||
* python/events/gkill/sword_of_souls.py: Fix type error by converting explicitely to int.
|
||||
* python/items/curse_on_apply.py,
|
||||
* python/items/lose_buffs_on_drop.py: Display message only if the wielder is a player.
|
||||
|
||||
2021-03-17 Nicolas Weeger
|
||||
* quests/peterm/DragonQuest/ElectricHatchery,
|
||||
* quests/peterm/DragonQuest/FireHatchery,
|
||||
|
|
|
@ -24,7 +24,7 @@ if killer.Owner is None and killer.Type == Crossfire.Type.PLAYER:
|
|||
# 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,
|
||||
# with a baseline of half at level 0, and taking all of it at level 115.
|
||||
weap.AddExp((victim.Exp * (1.0 + weap.ItemPower / 115.0)) // 2)
|
||||
weap.AddExp(int(victim.Exp * (1.0 + weap.ItemPower / 115.0)) // 2)
|
||||
|
||||
# Determine the change in XP
|
||||
delta_exp = weap.TotalExp - old_xp
|
||||
|
|
|
@ -4,7 +4,7 @@ me = Crossfire.WhoAmI()
|
|||
ac = Crossfire.WhoIsActivator()
|
||||
|
||||
# Since this checks before equipping actually occurs, Applied will be 0 when we apply
|
||||
if me.Applied == 0:
|
||||
if me.Applied == 0 and ac.Type == Crossfire.Type.PLAYER:
|
||||
ac.Write("You feel the "+me.Name+" bind to you.")
|
||||
me.Cursed = 1
|
||||
me.KnownCursed = 1
|
||||
|
|
|
@ -4,7 +4,7 @@ me = Crossfire.WhoAmI()
|
|||
ac = Crossfire.WhoIsActivator()
|
||||
|
||||
# It is assumed that this buffed weapon uses PermExp to denote how much it has been used.
|
||||
if me.PermExp > 0:
|
||||
if me.PermExp() > 0:
|
||||
me.Str = me.Archetype.Clone.Str
|
||||
me.Dex = me.Archetype.Clone.Dex
|
||||
me.Con = me.Archetype.Clone.Con
|
||||
|
@ -25,4 +25,5 @@ if me.PermExp > 0:
|
|||
# Experience should be affected before Item Power, since it affects that field
|
||||
me.AddExp(-me.TotalExp)
|
||||
me.ItemPower = me.Archetype.Clone.ItemPower
|
||||
ac.Write("The "+me.Name+" shudders and looks almost like a normal weapon again.")
|
||||
if ac.Type == Crossfire.Type.PLAYER:
|
||||
ac.Write("The "+me.Name+" shudders and looks almost like a normal weapon again.")
|
||||
|
|
Loading…
Reference in New Issue