feat: Adds OnThirstChanged (#2313)

This commit is contained in:
Arutosio 2026-01-14 02:04:41 +01:00 committed by GitHub
parent e8c129b39d
commit 8133983b64
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -293,6 +293,7 @@ public partial class Mobile : IHued, IComparable<Mobile>, ISpawnable, IObjectPro
private int m_HueMod = -1;
private int m_Hunger;
private int _thirst;
private bool m_InDeltaQueue;
private int m_Kills;
@ -513,7 +514,20 @@ public partial class Mobile : IHued, IComparable<Mobile>, ISpawnable, IObjectPro
}
[CommandProperty(AccessLevel.GameMaster)]
public int Thirst { get; set; }
public int Thirst
{
get => _thirst;
set
{
var oldValue = _thirst;
if (oldValue != value)
{
_thirst = value;
OnThirstChanged(oldValue);
}
}
}
[CommandProperty(AccessLevel.GameMaster)]
public int BAC { get; set; }
@ -3725,6 +3739,14 @@ public partial class Mobile : IHued, IComparable<Mobile>, ISpawnable, IObjectPro
{
}
/// <summary>
/// Overridable. Virtual event invoked after the <see cref="Thirst" /> property has changed.
/// <seealso cref="Thirst" />
/// </summary>
public virtual void OnThirstChanged(int oldValue)
{
}
public virtual void AggressiveAction(Mobile aggressor) => AggressiveAction(aggressor, false);
public virtual void AggressiveAction(Mobile aggressor, bool criminal)