feat: Adds Mobile.Murderer virtual property, consolidates kill-threshold checks (#2355)
## Summary - Adds `public virtual bool Murderer => Kills >= 5` property to `Mobile`, replacing ~30 scattered `Kills >= 5` / `Kills < 5` magic-number checks across the codebase - `BaseCreature` overrides `Murderer` to also return `true` when `AlwaysMurderer` is set - Updates `Corpse` serialization to v15, storing `_murderer` as a `bool` field (migrated from `int Kills >= 5` in earlier versions)
This commit is contained in:
parent
192f092ee7
commit
6745cf2075
31 changed files with 200 additions and 43 deletions
|
|
@ -2192,7 +2192,7 @@ public partial class Item : IHued, IComparable<Item>, ISpawnable, IObjectPropert
|
|||
return DeathMoveResult.MoveToBackpack;
|
||||
}
|
||||
|
||||
if (CheckNewbied() && parent.Kills < 5)
|
||||
if (CheckNewbied() && !parent.Murderer)
|
||||
{
|
||||
return DeathMoveResult.MoveToBackpack;
|
||||
}
|
||||
|
|
@ -2222,7 +2222,7 @@ public partial class Item : IHued, IComparable<Item>, ISpawnable, IObjectPropert
|
|||
return DeathMoveResult.MoveToBackpack;
|
||||
}
|
||||
|
||||
if (CheckNewbied() && parent.Kills < 5)
|
||||
if (CheckNewbied() && !parent.Murderer)
|
||||
{
|
||||
return DeathMoveResult.MoveToBackpack;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1642,7 +1642,7 @@ public partial class Mobile : IHued, IComparable<Mobile>, ISpawnable, IObjectPro
|
|||
{
|
||||
m_Kills = Math.Max(value, 0);
|
||||
|
||||
if (oldValue >= 5 != m_Kills >= 5)
|
||||
if (oldValue >= 5 != Murderer)
|
||||
{
|
||||
Delta(MobileDelta.Noto);
|
||||
InvalidateProperties();
|
||||
|
|
@ -1653,6 +1653,8 @@ public partial class Mobile : IHued, IComparable<Mobile>, ISpawnable, IObjectPro
|
|||
}
|
||||
}
|
||||
|
||||
public virtual bool Murderer => Kills >= 5;
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor, AccessLevel.GameMaster)]
|
||||
public virtual bool Criminal
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue