[Fix] Name & add meta
This commit is contained in:
+1
-1
@@ -4,7 +4,7 @@ using YachtDice.Modifiers.Runtime;
|
||||
|
||||
namespace YachtDice.Modifiers.Definition
|
||||
{
|
||||
public abstract class ConditionSO : ScriptableObject, ICondition
|
||||
public abstract class Condition : ScriptableObject, ICondition
|
||||
{
|
||||
public abstract bool Evaluate(ModifierContext context, ModifierInstance instance);
|
||||
}
|
||||
+1
-1
@@ -5,7 +5,7 @@ using YachtDice.Modifiers.Runtime;
|
||||
|
||||
namespace YachtDice.Modifiers.Definition
|
||||
{
|
||||
public abstract class EffectSO : ScriptableObject, IEffect
|
||||
public abstract class Effect : ScriptableObject, IEffect
|
||||
{
|
||||
[SerializeField] private ModifierPhase phase = ModifierPhase.Additive;
|
||||
[SerializeField] private int priority;
|
||||
+11
-11
@@ -6,15 +6,15 @@ using YachtDice.Modifiers.Runtime;
|
||||
namespace YachtDice.Modifiers.Definition
|
||||
{
|
||||
[CreateAssetMenu(fileName = "NewBehavior", menuName = "YachtDice/Modifiers/Behavior")]
|
||||
public class ModifierBehaviorSO : ScriptableObject
|
||||
public class ModifierBehavior : ScriptableObject
|
||||
{
|
||||
[SerializeField] private TriggerType trigger;
|
||||
[SerializeField] private List<ConditionSO> conditions = new();
|
||||
[SerializeField] private List<EffectSO> effects = new();
|
||||
[SerializeField] private List<Condition> conditions = new();
|
||||
[SerializeField] private List<Effect> effects = new();
|
||||
|
||||
public TriggerType Trigger => trigger;
|
||||
public IReadOnlyList<ConditionSO> Conditions => conditions;
|
||||
public IReadOnlyList<EffectSO> Effects => effects;
|
||||
public IReadOnlyList<Condition> Conditions => conditions;
|
||||
public IReadOnlyList<Effect> Effects => effects;
|
||||
|
||||
public bool EvaluateConditions(ModifierContext context, ModifierInstance instance)
|
||||
{
|
||||
@@ -27,15 +27,15 @@ namespace YachtDice.Modifiers.Definition
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
public static ModifierBehaviorSO CreateForTest(
|
||||
public static ModifierBehavior CreateForTest(
|
||||
TriggerType trigger,
|
||||
List<ConditionSO> conditions,
|
||||
List<EffectSO> effects)
|
||||
List<Condition> conditions,
|
||||
List<Effect> effects)
|
||||
{
|
||||
var so = CreateInstance<ModifierBehaviorSO>();
|
||||
var so = CreateInstance<ModifierBehavior>();
|
||||
so.trigger = trigger;
|
||||
so.conditions = conditions ?? new List<ConditionSO>();
|
||||
so.effects = effects ?? new List<EffectSO>();
|
||||
so.conditions = conditions ?? new List<Condition>();
|
||||
so.effects = effects ?? new List<Effect>();
|
||||
return so;
|
||||
}
|
||||
#endif
|
||||
+4
-4
@@ -4,13 +4,13 @@ using UnityEngine;
|
||||
namespace YachtDice.Modifiers.Definition
|
||||
{
|
||||
[CreateAssetMenu(fileName = "ModifierCatalog", menuName = "YachtDice/Modifiers/Catalog")]
|
||||
public class ModifierCatalogSO : ScriptableObject
|
||||
public class ModifierCatalog : ScriptableObject
|
||||
{
|
||||
[SerializeField] private List<ModifierDefinitionSO> modifiers = new();
|
||||
[SerializeField] private List<ModifierDefinition> modifiers = new();
|
||||
|
||||
public IReadOnlyList<ModifierDefinitionSO> All => modifiers;
|
||||
public IReadOnlyList<ModifierDefinition> All => modifiers;
|
||||
|
||||
public ModifierDefinitionSO FindById(string id)
|
||||
public ModifierDefinition FindById(string id)
|
||||
{
|
||||
for (int i = 0; i < modifiers.Count; i++)
|
||||
{
|
||||
+7
-7
@@ -5,7 +5,7 @@ using YachtDice.Modifiers.Core;
|
||||
namespace YachtDice.Modifiers.Definition
|
||||
{
|
||||
[CreateAssetMenu(fileName = "NewModifier", menuName = "YachtDice/Modifiers/Definition")]
|
||||
public class ModifierDefinitionSO : ScriptableObject
|
||||
public class ModifierDefinition : ScriptableObject
|
||||
{
|
||||
[Header("Identity")]
|
||||
[SerializeField] private string id;
|
||||
@@ -24,7 +24,7 @@ namespace YachtDice.Modifiers.Definition
|
||||
[SerializeField] private int maxStacks = 1;
|
||||
|
||||
[Header("Behaviors")]
|
||||
[SerializeField] private List<ModifierBehaviorSO> behaviors = new();
|
||||
[SerializeField] private List<ModifierBehavior> behaviors = new();
|
||||
|
||||
public string Id => id;
|
||||
public string DisplayName => displayName;
|
||||
@@ -36,19 +36,19 @@ namespace YachtDice.Modifiers.Definition
|
||||
public bool HasLimitedUses => hasLimitedUses;
|
||||
public int MaxUses => maxUses;
|
||||
public int MaxStacks => maxStacks;
|
||||
public IReadOnlyList<ModifierBehaviorSO> Behaviors => behaviors;
|
||||
public IReadOnlyList<ModifierBehavior> Behaviors => behaviors;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
public static ModifierDefinitionSO CreateForTest(
|
||||
public static ModifierDefinition CreateForTest(
|
||||
string id,
|
||||
List<ModifierBehaviorSO> behaviors,
|
||||
List<ModifierBehavior> behaviors,
|
||||
bool hasLimitedUses = false,
|
||||
int maxUses = 0,
|
||||
int shopPrice = 100,
|
||||
int sellPrice = 50,
|
||||
ModifierRarity rarity = ModifierRarity.Common)
|
||||
{
|
||||
var so = CreateInstance<ModifierDefinitionSO>();
|
||||
var so = CreateInstance<ModifierDefinition>();
|
||||
so.id = id;
|
||||
so.displayName = id;
|
||||
so.description = id;
|
||||
@@ -57,7 +57,7 @@ namespace YachtDice.Modifiers.Definition
|
||||
so.sellPrice = sellPrice;
|
||||
so.hasLimitedUses = hasLimitedUses;
|
||||
so.maxUses = maxUses;
|
||||
so.behaviors = behaviors ?? new List<ModifierBehaviorSO>();
|
||||
so.behaviors = behaviors ?? new List<ModifierBehavior>();
|
||||
return so;
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user