Namespace: SimpleForgeFramework
SimpleAttributeModifierGroup
Main modifier container class.
// Identity Properties
string name
string description
string tag
// Timing Properties
float duration // 0 or negative = permanent
int priority // Higher priority applies first
bool stackable
int maxStacks
// Behavior Flags
bool isDebuff // Mark as negative effect
bool isHidden // Hide from UI
bool canBeDispelled // Can be removed by dispel effects
bool persistsThroughDeath // Survives death/respawn
bool refreshOnReapply // Reset duration on reapplication
// Requirements
int requiredLevel
string category
List<string> incompatibleModifiers
List<string> requiredModifiers
// Modifications
List<AttributeModification> modifications
// Regeneration Modification (ARPG)
bool modifyRegenRate
ModifierType regenRateType
float regenRateValue
bool modifyRegenDelay
ModifierType regenDelayType
float regenDelayValue
bool disableRegeneration
// Runtime Properties (non-serialized)
string id // Unique instance ID
float timeRemaining
int currentStacks
bool isActive
object source // Optional reference to modifier source
// Events
UnityEvent onApply // Fired when modifier is applied
UnityEvent onRemove // Fired when modifier is removed
UnityEvent onExpire // Fired when modifier expires (duration ends)
UnityEvent<float> onTick // Fired each tick (for DoT/HoT effects)
// Methods
bool ApplyTo(ISimpleAttributeDataSource target)
bool RemoveFrom(ISimpleAttributeDataSource target)
bool UpdateTime(float deltaTime) // Returns true if expired
bool IsPermanent() // Returns true if duration <= 0
bool IsExpired() // Returns true if timeRemaining <= 0
// Nested Enum (access as SimpleAttributeModifierGroup.ModifierType)
enum ModifierType { Flat, Percentage, Multiply }
AttributeModification
Individual attribute change within a modifier group.
// Constructors
AttributeModification()
AttributeModification(string target, ModifierType modType, float modValue)
// Properties
string targetAttribute
ModifierType type // Flat, Percentage, or Multiply
float value
// Value Targeting (reserved for future use)
bool modifyBaseValue
bool modifyCurrentValue
bool modifyMinValue
bool modifyMaxValue
// Over-Time Settings
bool isPermanent
bool applyOverTime
float tickInterval
bool removeWhenConditionsMet
// Conditions
bool enableConditions
List<AttributeCondition> conditions
List<ModifierCondition> modifierConditions
// Methods
bool IsValidForProgression()
bool ValidateConfiguration(string[] attrs, out List<string> errors)
string GetDisplayDescription()
override string ToString() // Returns GetDisplayDescription()
Note: Currently all modifications affect the modifierBonus property of the target attribute. The value targeting flags (modifyBaseValue, etc.) are defined but reserved for future implementation.
AttributeCondition
Attribute-based condition for modifier activation.
// Constructors
AttributeCondition()
AttributeCondition(string attribute, ComparisonType comp, float thresh, LogicOperator logic)
// Properties
string attributeName
ComparisonType comparison
float threshold // For percentage comparisons: 0-100 (not 0-1)
LogicOperator logicOperator
// Nested Enums (access as AttributeCondition.ComparisonType)
enum ComparisonType {
// Absolute comparisons (compare against currentValue)
GreaterThan, LessThan, EqualTo,
GreaterOrEqual, LessOrEqual, NotEqual,
// Percentage comparisons (compare against currentValue/maxValue * 100)
GreaterThanPercent, LessThanPercent, EqualToPercent,
GreaterOrEqualPercent, LessOrEqualPercent, NotEqualPercent
}
enum LogicOperator { And, Or, Not }
// Methods
bool IsPercentageComparison() // Returns true for *Percent comparison types
string GetDescription() // Human-readable condition description
string GetFieldName() // Clean identifier for code generation
bool ValidateConfiguration(string[] attrs, out string error)
override string ToString() // Returns GetDescription()
ModifierCondition
Modifier presence condition - checks if target has/doesn't have specific modifiers.
// Constructors
ModifierCondition()
ModifierCondition(ModifierConditionType type, string name = "", string tag = "",
AttributeCondition.LogicOperator logic = LogicOperator.And)
// Properties
ModifierConditionType conditionType
string targetModifierName // For HasModifier/DoesNotHaveModifier
string targetModifierTag // For HasModifierTag/DoesNotHaveModifierTag
LogicOperator logicOperator // Uses AttributeCondition.LogicOperator
// Nested Enum (access as ModifierCondition.ModifierConditionType)
enum ModifierConditionType {
HasModifier, // Target has modifier with exact name
DoesNotHaveModifier, // Target does NOT have modifier with exact name
HasModifierTag, // Target has any modifier with this tag
DoesNotHaveModifierTag // Target does NOT have any modifier with this tag
}
// Methods
string GetDescription() // Human-readable condition description
bool ValidateConfiguration(out string error)
override string ToString() // Returns GetDescription()
SimpleModifierTracker (static)
Static utility for tracking active modifiers.
// Methods
static void RegisterModifier(ISimpleAttributeDataSource target, SimpleAttributeModifierGroup modifier)
static void UnregisterModifier(ISimpleAttributeDataSource target, SimpleAttributeModifierGroup modifier)
static bool HasModifierByName(ISimpleAttributeDataSource target, string name)
static bool HasModifierByTag(ISimpleAttributeDataSource target, string tag)
static List<SimpleAttributeModifierGroup> GetActiveModifiers(ISimpleAttributeDataSource target)
static List<SimpleAttributeModifierGroup> GetModifiersByName(ISimpleAttributeDataSource target, string name)
static List<SimpleAttributeModifierGroup> GetModifiersByTag(ISimpleAttributeDataSource target, string tag)
static int RemoveModifiersByName(ISimpleAttributeDataSource target, string name)
static int RemoveModifiersByTag(ISimpleAttributeDataSource target, string tag)
static void RemoveAllModifiers(ISimpleAttributeDataSource target)
static void ClearAll()
static int GetActiveModifierCount(ISimpleAttributeDataSource target)
Namespace: SimpleAttributeForge.CharacterTemplate
SimpleCharacterTemplateData
ScriptableObject for character template configuration.
// Properties
string systemName
string templateName
string description
Sprite templateIcon
List<AttributeValueOverride> baseAttributeOverrides
// Methods
bool IsValid(out List<string> errors)
SimpleCharacterClass
Individual character class configuration.
// Properties
string ClassName
string Description
Sprite ClassIcon
List<AttributeValueOverride> BaseAttributeOverrides
// Methods
bool IsValid(List<string> attrs, out List<string> errors)
AttributeValueOverride
Per-attribute override for templates.
// Constructors
AttributeValueOverride()
AttributeValueOverride(string attributeName, float value, bool useOverride = true)
// Properties
string AttributeName
float OverrideValue
bool UseOverride
Generated Classes (per system)
These classes are generated by the wizards and named based on your system name (e.g., "Soulslike").
[SystemName]CharacterTemplatesHelper (static)
Static utility class for template operations. Generated by Character Template Wizard.
// Template Discovery
static List<SimpleCharacterTemplateData> GetAllTemplates()
static SimpleCharacterTemplateData FindTemplateByName(string templateName)
// Template Application
static bool ApplyTemplateToGameObject(GameObject target, SimpleCharacterTemplateData template)
static int ApplyTemplateToGameObjects(GameObject[] targets, SimpleCharacterTemplateData template)
static int ApplyTemplates(GameObject[] targets, SimpleCharacterTemplateData[] templates)
// Validation
static bool IsTemplateCompatible(SimpleCharacterTemplateData template, ISimpleAttributeDataSource source)
static List<string> GetMissingAttributes(SimpleCharacterTemplateData template, ISimpleAttributeDataSource source)
// Template Analysis
static float GetAttributeValue(SimpleCharacterTemplateData template, string attributeName)
static float GetTotalAttributePoints(SimpleCharacterTemplateData template)
static bool HasCustomAttributes(SimpleCharacterTemplateData template)
static Dictionary<string, float> GetAttributeDifferences(SimpleCharacterTemplateData a, SimpleCharacterTemplateData b)
// Runtime Switching
static SimpleCharacterTemplateData GetCurrentTemplate(GameObject target, List<SimpleCharacterTemplateData> templates)
static bool SwitchTemplate(GameObject target, SimpleCharacterTemplateData newTemplate, bool preserveValues = true)
[SystemName]CharacterTemplateManager : MonoBehaviour
Optional component for Inspector-based template management. Attach to a GameObject.
// Inspector Properties
List<SimpleCharacterTemplateData> availableTemplates
SimpleCharacterTemplateData defaultTemplate
bool autoApplyDefaultOnStart
bool allowRuntimeTemplateChange
bool autoDiscoverTemplates
// Read-only Properties
List<SimpleCharacterTemplateData> AvailableTemplates { get; }
SimpleCharacterTemplateData DefaultTemplate { get; }
bool AllowRuntimeTemplateChange { get; }
// Methods
bool ApplyTemplate(SimpleCharacterTemplateData template)
bool ApplyTemplate(string templateName)
SimpleCharacterTemplateData GetTemplateByName(string templateName)
SimpleCharacterTemplateData GetCurrentTemplate()
bool SwitchTemplate(SimpleCharacterTemplateData newTemplate, bool preserveCurrentValues = true)
bool ValidateTemplate(SimpleCharacterTemplateData template)
void AutoDiscoverTemplates()
void RefreshTemplateList()
[SystemName]CharacterTemplatesValidator (static)
Static validation utilities for templates.
// Methods
static bool ValidateTemplate(SimpleCharacterTemplateData template,
ISimpleAttributeDataSource attributeSource,
out List<string> errors)
static bool ValidateAllTemplates(List<SimpleCharacterTemplateData> templates,
ISimpleAttributeDataSource attributeSource)
[SystemName]CharacterTemplateEnum
Type-safe enum for character template identifiers.
// Example for Soulslike system
enum SoulslikeCharacterTemplateEnum {
AshKnight,
BlightRogue,
BloodHerald,
// ... etc
}