Фикс логики системы отражения (#682)

* Fixed ReflectSystem + Added logic for reflective items positioning

* Total oppsie fix

* Born to shitcode
This commit is contained in:
BIGZi0348
2024-09-03 21:14:42 +03:00
committed by GitHub
parent 6853e5b44f
commit 79acb6f9ee
7 changed files with 95 additions and 12 deletions

View File

@@ -39,6 +39,22 @@ public sealed partial class ReflectComponent : Component
[DataField]
public bool Innate = false;
// WD START
/// <summary>
/// If the item for reflection needed in inventory slots only - select Body.
/// If the item for reflection needed in hands only - select Hands.
/// Otherwise it will reflect in any inventory position.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField]
public Placement Placement = Placement.Hands | Placement.Body;
/// <summary>
/// Can only reflect when placed correctly.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
public bool InRightPlace = true;
// WD END
/// <summary>
/// Maximum probability for a projectile to be reflected.
/// </summary>
@@ -71,3 +87,11 @@ public enum ReflectType : byte
NonEnergy = 1 << 0,
Energy = 1 << 1,
}
[Flags]
public enum Placement : byte
{
None = 0,
Hands = 1 << 0,
Body = 1 << 1,
}