fix: Adds name support for all mods (#1128)
This commit is contained in:
parent
b1cf95f810
commit
ffdc08259f
33 changed files with 404 additions and 343 deletions
|
|
@ -24,7 +24,7 @@ public partial class DefaultSkillMod : SkillMod
|
|||
{
|
||||
}
|
||||
|
||||
public DefaultSkillMod(SkillName skill, bool relative, double value) : base(skill, relative, value)
|
||||
public DefaultSkillMod(SkillName skill, string name, bool relative, double value) : base(skill, name, relative, value)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@ public partial class EquippedSkillMod : SkillMod
|
|||
{
|
||||
}
|
||||
|
||||
public EquippedSkillMod(SkillName skill, bool relative, double value, Item item, Mobile mobile)
|
||||
: base(skill, relative, value, mobile) => _item = item;
|
||||
public EquippedSkillMod(SkillName skill, string name, bool relative, double value, Item item, Mobile owner)
|
||||
: base(skill, name, relative, value, owner) => _item = item;
|
||||
|
||||
public override bool CheckCondition() => !_item.Deleted && Owner?.Deleted == false && _item.Parent == Owner;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,5 +23,14 @@ public partial class MobileMod
|
|||
[DirtyTrackingEntity]
|
||||
public Mobile Owner { get; set; }
|
||||
|
||||
[SerializableField(0)]
|
||||
private string _name;
|
||||
|
||||
public MobileMod(Mobile owner) => Owner = owner;
|
||||
|
||||
public MobileMod(Mobile owner, string name)
|
||||
{
|
||||
Owner = owner;
|
||||
Name = name;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ public partial class ResistanceMod : MobileMod
|
|||
{
|
||||
}
|
||||
|
||||
public ResistanceMod(ResistanceType type, int offset, Mobile owner = null) : base(owner)
|
||||
public ResistanceMod(ResistanceType type, string name, int offset, Mobile owner = null) : base(owner, name)
|
||||
{
|
||||
_type = type;
|
||||
_offset = offset;
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ public abstract partial class SkillMod : MobileMod
|
|||
{
|
||||
}
|
||||
|
||||
public SkillMod(SkillName skill, bool relative, double value, Mobile owner = null) : base(owner)
|
||||
public SkillMod(SkillName skill, string name, bool relative, double value, Mobile owner = null) : base(owner, name)
|
||||
{
|
||||
_skill = skill;
|
||||
_relative = relative;
|
||||
|
|
|
|||
|
|
@ -31,19 +31,15 @@ public partial class StatMod : MobileMod
|
|||
private StatType _type;
|
||||
|
||||
[SerializableField(3, setter: "private")]
|
||||
private string _name;
|
||||
|
||||
[SerializableField(4, setter: "private")]
|
||||
private int _offset;
|
||||
|
||||
public StatMod(Mobile owner) : base(owner)
|
||||
{
|
||||
}
|
||||
|
||||
public StatMod(StatType type, string name, int offset, TimeSpan duration, Mobile owner = null) : base(owner)
|
||||
public StatMod(StatType type, string name, int offset, TimeSpan duration, Mobile owner = null) : base(owner, name)
|
||||
{
|
||||
_type = type;
|
||||
_name = name;
|
||||
_offset = offset;
|
||||
_duration = duration;
|
||||
_added = Core.Now;
|
||||
|
|
|
|||
|
|
@ -28,13 +28,13 @@ public partial class TimedSkillMod : SkillMod
|
|||
{
|
||||
}
|
||||
|
||||
public TimedSkillMod(SkillName skill, bool relative, double value, TimeSpan delay)
|
||||
: this(skill, relative, value, Core.Now + delay)
|
||||
public TimedSkillMod(SkillName skill, string name, bool relative, double value, TimeSpan delay)
|
||||
: this(skill, name, relative, value, Core.Now + delay)
|
||||
{
|
||||
}
|
||||
|
||||
public TimedSkillMod(SkillName skill, bool relative, double value, DateTime expire)
|
||||
: base(skill, relative, value) => _expire = expire;
|
||||
public TimedSkillMod(SkillName skill, string name, bool relative, double value, DateTime expire)
|
||||
: base(skill, name, relative, value) => _expire = expire;
|
||||
|
||||
public override bool CheckCondition() => Core.Now < _expire;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue