fix: Optimizes items to use default weights. (Part 4) (#2243)
This commit is contained in:
parent
40ba85d7b8
commit
fa0b67ec29
109 changed files with 250 additions and 391 deletions
|
|
@ -9,10 +9,11 @@ public partial class BlankScroll : Item, ICommodity
|
|||
public BlankScroll(int amount = 1) : base(0xEF3)
|
||||
{
|
||||
Stackable = true;
|
||||
Weight = 1.0;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public override double DefaultWeight => 1.0;
|
||||
|
||||
int ICommodity.DescriptionNumber => LabelNumber;
|
||||
bool ICommodity.IsDeedable => Core.ML;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,10 +9,11 @@ public partial class Bottle : Item, ICommodity
|
|||
public Bottle(int amount = 1) : base(0xF0E)
|
||||
{
|
||||
Stackable = true;
|
||||
Weight = 1.0;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public override double DefaultWeight => 1.0;
|
||||
|
||||
int ICommodity.DescriptionNumber => LabelNumber;
|
||||
bool ICommodity.IsDeedable => Core.ML;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,11 @@ public partial class PotionKeg : Item
|
|||
private PotionEffect _type;
|
||||
|
||||
[Constructible]
|
||||
public PotionKeg() : base(0x1940) => UpdateWeight();
|
||||
public PotionKeg() : base(0x1940)
|
||||
{
|
||||
}
|
||||
|
||||
public override double DefaultWeight => 20 + Math.Clamp(_held, 0, 100) * 0.8;
|
||||
|
||||
[SerializableProperty(1)]
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
|
|
@ -28,7 +32,6 @@ public partial class PotionKeg : Item
|
|||
if (_held != value)
|
||||
{
|
||||
_held = value;
|
||||
UpdateWeight();
|
||||
InvalidateProperties();
|
||||
this.MarkDirty();
|
||||
}
|
||||
|
|
@ -48,13 +51,6 @@ public partial class PotionKeg : Item
|
|||
}
|
||||
}
|
||||
|
||||
public virtual void UpdateWeight()
|
||||
{
|
||||
var held = Math.Max(0, Math.Min(_held, 100));
|
||||
|
||||
Weight = 20 + held * 80 / 100;
|
||||
}
|
||||
|
||||
private void Deserialize(IGenericReader reader, int version)
|
||||
{
|
||||
_type = (PotionEffect)reader.ReadInt();
|
||||
|
|
|
|||
|
|
@ -21,10 +21,11 @@ public partial class RecallRune : Item
|
|||
[Constructible]
|
||||
public RecallRune() : base(0x1F14)
|
||||
{
|
||||
Weight = 1.0;
|
||||
CalculateHue();
|
||||
}
|
||||
|
||||
public override double DefaultWeight => 1.0;
|
||||
|
||||
[SerializableProperty(0)]
|
||||
[CommandProperty(AccessLevel.Counselor, AccessLevel.GameMaster)]
|
||||
public BaseHouse House
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue