Allow item swapping between from accessories and hats to other accessory types.

This commit is contained in:
Ottermandias 2023-03-12 02:27:08 +01:00
parent 19dde3cbc4
commit 1b7360f8be
6 changed files with 243 additions and 38 deletions

View file

@ -35,6 +35,16 @@ public readonly struct EqdpManipulation : IMetaManipulation< EqdpManipulation >
Entry = Eqdp.Mask( Slot ) & entry;
}
public EqdpManipulation Copy( EqdpManipulation entry )
{
if( entry.Slot != Slot )
{
var (bit1, bit2) = entry.Entry.ToBits( entry.Slot );
return new EqdpManipulation(Eqdp.FromSlotAndBits( Slot, bit1, bit2 ), Slot, Gender, Race, SetId);
}
return new EqdpManipulation(entry.Entry, Slot, Gender, Race, SetId);
}
public EqdpManipulation Copy( EqdpEntry entry )
=> new(entry, Slot, Gender, Race, SetId);

View file

@ -209,7 +209,7 @@ public readonly struct MetaManipulation : IEquatable< MetaManipulation >, ICompa
{
Type.Eqp => Eqp.Copy( other.Eqp.Entry ),
Type.Gmp => Gmp.Copy( other.Gmp.Entry ),
Type.Eqdp => Eqdp.Copy( other.Eqdp.Entry ),
Type.Eqdp => Eqdp.Copy( other.Eqdp ),
Type.Est => Est.Copy( other.Est.Entry ),
Type.Rsp => Rsp.Copy( other.Rsp.Entry ),
Type.Imc => Imc.Copy( other.Imc.Entry ),