init
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
using VOID.Generic.Objects.Unit;
|
||||
|
||||
namespace VOID.Generic.Requirement
|
||||
{
|
||||
public interface IUnitRequirement
|
||||
{
|
||||
public bool Check(UnitObject unit);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6b23a9d324367d445aa59faddcecac78
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
using VOID.Generic.Dict;
|
||||
using VOID.Generic.Objects.Unit;
|
||||
|
||||
namespace VOID.Generic.Requirement
|
||||
{
|
||||
[TypeRegistryItem("Basic Resource")]
|
||||
[Serializable]
|
||||
public class RequirementCurrentBasicResource : IUnitRequirement
|
||||
{
|
||||
[SerializeField]
|
||||
[Required]
|
||||
private BasicResourceType _resourceType;
|
||||
|
||||
[SerializeField]
|
||||
[MinValue(1)]
|
||||
private float _resourceValue;
|
||||
|
||||
public bool Check(UnitObject unit)
|
||||
{
|
||||
return unit.basicData.currentResources.Get(_resourceType) >= _resourceValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8b44788904564e118895cc4c6ed41a00
|
||||
timeCreated: 1694711421
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
using VOID.Generic.Dict;
|
||||
using VOID.Generic.Objects.Unit;
|
||||
|
||||
namespace VOID.Generic.Requirement
|
||||
{
|
||||
[TypeRegistryItem("Unit Resource")]
|
||||
[Serializable]
|
||||
public class RequirementCurrentUnitResource : IUnitRequirement
|
||||
{
|
||||
[SerializeField]
|
||||
[Required]
|
||||
private UnitResourceType _resourceType;
|
||||
|
||||
[SerializeField]
|
||||
[MinValue(1)]
|
||||
private float _resourceValue;
|
||||
|
||||
public bool Check(UnitObject unit)
|
||||
{
|
||||
return unit.unitData.currentResources.Get(_resourceType) >= _resourceValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: af237553f3214cbfb1fc319d755ad901
|
||||
timeCreated: 1694711421
|
||||
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
using VOID.Generic.Objects.Unit;
|
||||
using VOID.ScriptableObjects.Affiliation;
|
||||
|
||||
namespace VOID.Generic.Requirement
|
||||
{
|
||||
[TypeRegistryItem("Faction")]
|
||||
[Serializable]
|
||||
public class RequirementFaction : IUnitRequirement
|
||||
{
|
||||
[SerializeField]
|
||||
[Required]
|
||||
private Faction _faction;
|
||||
|
||||
public bool Check(UnitObject unit)
|
||||
{
|
||||
return unit.unitAttitude.faction == _faction;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ded261e6884d546469e68297e191c1e1
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
using VOID.Generic.Objects.Unit;
|
||||
|
||||
namespace VOID.Generic.Requirement
|
||||
{
|
||||
[TypeRegistryItem("Level")]
|
||||
[Serializable]
|
||||
public class RequirementLevel : IUnitRequirement
|
||||
{
|
||||
[SerializeField]
|
||||
[MinValue(1)]
|
||||
private int _value;
|
||||
|
||||
public bool Check(UnitObject unit)
|
||||
{
|
||||
return unit.unitLevel.level >= _value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d77d5f6f0e704f269634af57bab339cd
|
||||
timeCreated: 1694711421
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
using VOID.Generic.Dict;
|
||||
using VOID.Generic.Objects.Unit;
|
||||
|
||||
namespace VOID.Generic.Requirement
|
||||
{
|
||||
[TypeRegistryItem("Main Attribute")]
|
||||
[Serializable]
|
||||
public class RequirementMainAttribute : IUnitRequirement
|
||||
{
|
||||
[SerializeField]
|
||||
[Required]
|
||||
private MainAttributeType _attributeType;
|
||||
|
||||
[SerializeField]
|
||||
[MinValue(1)]
|
||||
private int _attributeValue;
|
||||
|
||||
public bool Check(UnitObject unit)
|
||||
{
|
||||
return unit.unitData.mainAttributes.Get(_attributeType) >= _attributeValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7896e0914af64e47904f0140f4c6e713
|
||||
timeCreated: 1694711421
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
using VOID.Generic.Dict;
|
||||
using VOID.Generic.Objects.Unit;
|
||||
|
||||
namespace VOID.Generic.Requirement
|
||||
{
|
||||
[TypeRegistryItem("MAX Basic Resource")]
|
||||
[Serializable]
|
||||
public class RequirementMaxBasicResource : IUnitRequirement
|
||||
{
|
||||
[SerializeField]
|
||||
[Required]
|
||||
private BasicResourceType _resourceType;
|
||||
|
||||
[SerializeField]
|
||||
[MinValue(1)]
|
||||
private float _resourceValue;
|
||||
|
||||
public bool Check(UnitObject unit)
|
||||
{
|
||||
return unit.basicData.maxResources.Get(_resourceType) >= _resourceValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 38e59b34819840ad8045e2baf08bfe49
|
||||
timeCreated: 1694711421
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
using VOID.Generic.Dict;
|
||||
using VOID.Generic.Objects.Unit;
|
||||
|
||||
namespace VOID.Generic.Requirement
|
||||
{
|
||||
[TypeRegistryItem("Max Unit Resource")]
|
||||
[Serializable]
|
||||
public class RequirementMaxUnitResource : IUnitRequirement
|
||||
{
|
||||
[SerializeField]
|
||||
[Required]
|
||||
private UnitResourceType _resourceType;
|
||||
|
||||
[SerializeField]
|
||||
[MinValue(1)]
|
||||
private float _resourceValue;
|
||||
|
||||
public bool Check(UnitObject unit)
|
||||
{
|
||||
return unit.unitData.maxResources.Get(_resourceType) >= _resourceValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b780411bba9943d1bd9e049039e0952a
|
||||
timeCreated: 1694711421
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
using VOID.Generic.Dict;
|
||||
using VOID.Generic.Objects.Unit;
|
||||
|
||||
namespace VOID.Generic.Requirement
|
||||
{
|
||||
[TypeRegistryItem("Sub Attribute")]
|
||||
[Serializable]
|
||||
public class RequirementSubAttribute : IUnitRequirement
|
||||
{
|
||||
[SerializeField]
|
||||
[Required]
|
||||
private SubAttributeType _attributeType;
|
||||
|
||||
[SerializeField]
|
||||
[MinValue(1)]
|
||||
private int _attributeValue;
|
||||
|
||||
public bool Check(UnitObject unit)
|
||||
{
|
||||
return unit.unitData.subAttributes.Get(_attributeType) >= _attributeValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2cb6e31a79594fb8b51b170b5de71c59
|
||||
timeCreated: 1694711421
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
using VOID.Generic.Objects.Unit;
|
||||
|
||||
namespace VOID.Generic.Requirement
|
||||
{
|
||||
[TypeRegistryItem("State")]
|
||||
[Serializable]
|
||||
public class RequirementUnitState : IUnitRequirement
|
||||
{
|
||||
[SerializeField]
|
||||
[Required]
|
||||
private UnitObjectState _unitState;
|
||||
|
||||
public bool Check(UnitObject unit)
|
||||
{
|
||||
return unit.unitState == _unitState;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 526e0e8095bbf6d4ba7666557216ce74
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
using VOID.Generic.Dict;
|
||||
using VOID.Generic.Objects.Unit;
|
||||
using VOID.Generic.Objects.Weapon;
|
||||
|
||||
namespace VOID.Generic.Requirement
|
||||
{
|
||||
[TypeRegistryItem("Equipped Weapon Carry Type")]
|
||||
[Serializable]
|
||||
public class RequirementWeaponCarryType : IUnitRequirement
|
||||
{
|
||||
[SerializeField]
|
||||
[Required]
|
||||
private WeaponCarryType _weaponCarryType;
|
||||
|
||||
public bool Check(UnitObject unit)
|
||||
{
|
||||
return ((WeaponObject)unit.unitEquipment.GetEquipped(EquipmentSlotType.MainHand))?.weaponData.weaponCarryType == _weaponCarryType
|
||||
|| ((WeaponObject)unit.unitEquipment.GetEquipped(EquipmentSlotType.OffHand))?.weaponData.weaponCarryType == _weaponCarryType;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c28b2c3c313014d4aa395f36cb974661
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
using VOID.Generic.Dict;
|
||||
using VOID.Generic.Objects.Unit;
|
||||
using VOID.Generic.Objects.Weapon;
|
||||
|
||||
namespace VOID.Generic.Requirement
|
||||
{
|
||||
[TypeRegistryItem("Equipped Weapon Type")]
|
||||
[Serializable]
|
||||
public class RequirementWeaponType : IUnitRequirement
|
||||
{
|
||||
[SerializeField]
|
||||
[Required]
|
||||
private WeaponType _weaponType;
|
||||
|
||||
public bool Check(UnitObject unit)
|
||||
{
|
||||
if (_weaponType == WeaponType.None)
|
||||
return !(unit.unitEquipment.GetEquipped(EquipmentSlotType.MainHand)
|
||||
|| unit.unitEquipment.GetEquipped(EquipmentSlotType.OffHand));
|
||||
|
||||
return ((WeaponObject)unit.unitEquipment.GetEquipped(EquipmentSlotType.MainHand))?.weaponData.weaponType == _weaponType
|
||||
|| ((WeaponObject)unit.unitEquipment.GetEquipped(EquipmentSlotType.OffHand))?.weaponData.weaponType == _weaponType;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3bef72f21e27aeb41b90ed7ca70a1f5c
|
||||
Reference in New Issue
Block a user