Combat in Warman revolves around two systems: skills and modifiers. Skills are things you do: swing a sword, shoot a fireball, dodge roll. Modifiers are things that happen to you: a damage buff, a slow debuff, a regeneration effect. They interact heavily: a skill can apply a modifier, a modifier can trigger a skill, and both can change the unit's stats in real time.
Skills as ScriptableObjects
Every skill in Warman is a Unity ScriptableObject, a data asset that lives outside of any scene. This means skills are defined once and referenced everywhere. The base Skill class carries category, name, icon, stamina cost, cooldown, charges, and a cast behaviour enum that determines how the skill targets (self-cast, cursor position, directional, point area).
Skill variants inherit from the base. Skill_FireProjectileGroup creates a burst of projectiles. Skill_BlinkSlam teleports the caster to the target and deals area damage. Skill_Heal restores health. Skill_Summon creates an entity. Each template overrides the execution logic while keeping the shared infrastructure (cooldowns, charges, stamina, targeting) identical.
Charges and Cooldowns
Skills have two timers: a skill cooldown (how long after casting before you can cast again) and a charge cooldown (how long to restore one charge). A skill with 3 charges and a 5-second charge cooldown can be fired 3 times in rapid succession, then each charge refills independently over 5 seconds. If the charges field is 0, the skill has infinite charges and is only gated by the skill cooldown.
The cooldown system respects the unit's stats. Primary attack skills (basic weapon swings) scale their cooldown with the attack speed stat. Other skills scale with a general cooldown multiplier. Potion skills have their own separate multiplier. This means a fast-attacking character swings faster without their heal cooldown changing.
Modifiers
A modifier is a ScriptableObject with a duration, a set of stat effects, flags, and a list of modules. When applied to a unit, the modifier wrapper tracks remaining duration, current stacks, and the owning unit. Modifiers can stack (each application refreshes the duration and increments the stack count up to a cap) or replace.
The stat effects are the same ItemEffect system used by items. A modifier might grant +20% attack speed or -30% movement speed, using the same code path that item bonuses use. Modifiers and items compose naturally. A "50% increased fire damage" modifier stacks additively with a "30% increased fire damage" item roll.
Modules
Here modifiers get interesting. Each modifier can carry an array of modules, event-driven components that fire when something happens to the unit. The module types include: DamageModule (triggers on dealing damage), DamageTakenEventModule (triggers on receiving damage), EnemyDiedEventModule (triggers when the unit kills something), UnitCastedSkillModule (triggers on skill cast), RollEventModule (triggers on dodge roll), and AuraModule (applies effects to nearby units).
Each module has a chance to trigger and can fire its own skill actions: creating projectiles, applying more modifiers, healing, or refreshing cooldowns.
Matchers
Modules don't fire on every event. They have matchers, filter conditions that check things like damage type, whether the damage came from a projectile, which skill caused it, and whether the target is a specific kind of unit. A Matcher_EventOrigin can restrict a module to only trigger from melee attacks, or only from fire-type projectiles. This allows very specific item effects like "10% chance on melee hit to create a lightning bolt" without generic triggers polluting unrelated combat events.
Immunity and Interaction
Modifiers can grant immunity to other specific modifiers. When a modifier is applied, the system checks if the target has any active immunity against it. If so, the application is silently blocked. Modifiers can also specify a list of other modifiers to remove on application, creating natural counter-play: applying a fire shield removes the frozen debuff, for example.
Flags control lifecycle: RemoveOnAttack, RemoveOnCast, RemoveOnDeath, RemoveOnWeaponChange. A stealth modifier might have RemoveOnAttack set so attacking breaks stealth. A weapon enchant modifier has RemoveOnWeaponChange so swapping weapons clears the buff.