com.cupkekgames.combat — turn-based combat framework. Provides CombatUnit (with Health / Mana / Buffs / Shield / StatusEffects / AI sub-systems), CombatActionSO action behaviour-trees, target selection, projectiles, threat tables, and the role-keyed attribute pipeline. Designed to be content-driven: most authoring happens in catalogs and ScriptableObject assets, not code.
All combat content is referenced by CatalogKey (see Data Package), so saved state and authored data live in catalog assets rather than direct SO references. Six framework catalog ids are reserved in CombatConstants:
| Catalog id | Holds | Used for |
|---|---|---|
Factions | FactionSO | Team membership, target filtering |
StatusEffects | StatusEffectSO | Buffs, debuffs, DoTs, disables |
CombatStages | stage assets | Encounter location / arena setup |
CombatTiers | CombatUnitTierSO | Power-level brackets |
CombatActions | CombatActionSO | Skills / attacks / abilities |
CombatWaves | wave assets | Enemy groupings per encounter |
Domain games can add their own catalogs alongside these; framework code only reads the reserved ids.
Combat stats are keyed by role (string), not positional index. The reserved roles live in CombatRoles:
| Role | Required? | Meaning |
|---|---|---|
HP | Required | Health pool |
MP | Optional | Mana / resource pool |
ATK / MATK | Optional | Physical / magical attack |
DEF / MDEF | Optional | Physical / magical defense |
SPEED | Required | Turn / action speed |
CritChance | Optional | Critical-hit roll chance (0–1) |
CritDmg | Optional | Critical-hit damage multiplier |
CombatAttributeRegistrySO maps each role to the game-specific CupkekGames.RPGStats.AttributeDefinitionSO so domain games choose their own underlying stat schema while combat code stays role-generic. Add custom roles (e.g. Stamina) by registering new entries on the registry.
CombatUnit wraps a Unit (identity + IUnitFeature composition from CupkekGames.Units) and adds combat-specific sub-systems:
CombatUnitHealth — HP pool with damage applicationCombatUnitMana — MP pool with action cost gatingCombatUnitBuffSystem — stat modifiersCombatUnitStatusSystem — status effects + tick lifecycleCombatUnitShield / CombatUnitShieldNode — layered shieldsCombatUnitAI — turn decision-makingCombatUnitThreatTable — aggro trackingCombatUnitView (MonoBehaviour) — visual side: highlight, hit reaction, AI hookupCombat-specific data lives on the unit's UnitDefinitionSO as IUnitFeatureDefinition entries (CombatAttributesDefinition, CharacterDefinition).
CombatActionSO extends CupkekGames.BehaviourTrees.BehaviourTree. Authored action graphs compose damage / heal / shield / status-effect / projectile / indicator nodes; placeholders like {node3}, {skillLevel}, {range} are substituted at runtime so a single tree powers level-up scaling.
CombatTargetSelection is a [SerializeReference] field on each action — drop in a target-selection strategy (single, line, area, all enemies, …) without subclassing.
StatusEffectSO references behavior via the IStatusEffectBehaviorFeature interface composed as [SerializeReference] entries. Multiple behaviors run concurrently with their own OnStart / OnTick / OnEnd hooks. Built-ins:
DamageOverTimeBehavior — periodic damage tickDisableBehavior — block actions for the durationAdd new behaviors by implementing IStatusEffectBehaviorFeature — no SO subclassing.
The package never reaches into game-specific systems directly. Bring-your-own:
ICombatSettings — global combat config (attribute registry, defaults)ICombatRules — game-specific rule hooks (turn order, victory conditions)ICombatVisualSettings — VFX/SFX bindingsIAutobattlerSettings — AI heuristicsICombatManager — orchestrator (provides IPopupManager, CinemachineManager, IIndicatorPool, etc.)ICombatUnitManager — spawning + lifecycleIUnitSOProvider — resolves CombatUnitReference → UnitDefinitionSOIPowerLevelCalculator — game-specific power scoringIDamageModifier / IAttributeModifier — pluggable buff/debuff mathCombatUnit, CombatUnitView, CombatUnitPool, CombatUnitPoolManager, CombatUnitHighlightControllerCombatUnitHealth, CombatUnitMana, CombatUnitBuffSystem, CombatUnitStatusSystem, CombatUnitShield, CombatUnitAI, CombatUnitThreatTableCombatActionSO, CombatActionRunner, CombatActionContext, CombatActionCatalog, action Nodes/CombatTargetSelection (+ strategies under TargetSelection/)Projectile + ProjectileCollisionHandlerCombatRoles, CombatAttributeRegistrySO, CombatAttributeDataEffectRuntime, CombatAttributeDataEffectVisualStatusEffectSO + IStatusEffectBehaviorFeature (DamageOverTimeBehavior, DisableBehavior)FactionSO, FactionCatalog, CombatUnitTierSO, CombatUnitTierCatalogCombatConstants (catalog id strings)CombatUltimateManager (under Ultimate/), level/rewards under Level/ and Rewards/CupkekGames.Combat (runtime).
com.cupkekgames.units, com.cupkekgames.character, com.cupkekgames.rpgstatscom.cupkekgames.behaviourtrees, com.cupkekgames.data, com.cupkekgames.servicescom.cupkekgames.timesystem, com.cupkekgames.cameras, com.cupkekgames.shapedrawing, com.cupkekgames.textpopup, com.cupkekgames.vfx, com.cupkekgames.inventorySettings
Theme
Light
Contrast
Material
Dark
Dim
Material Dark
System
Sidebar(Light & Contrast only)
Font Family
DM Sans
Wix
Inclusive Sans
AR One Sans
Direction