|
CardGame
Rogue-like card videogame
|
Central authority for combat rules and state mutation. More...
#include <combatSystem.h>
Public Member Functions | |
| void | gainArmor (Entity &target, int amount) |
| Grants armor to the target entity. | |
| void | gainAttack (Entity &target, int amount) |
| Grants attack to the target entity. | |
| void | endTurnReset (Entity &player, Entity &enemy) |
| DamageResult | dealDamage (Entity &target, int amount, bool ignoreArmor=false) |
| Resolves damage against a target according to combat rules. | |
| void | heal (Entity &target, int amount) |
| Heals the target entity by the specified amount. | |
| void | resetArmor (Entity &target) |
| Resets the target entity's armor to zero. | |
| bool | isDead (const Entity &target) |
| Checks whether the target entity is dead. | |
Central authority for combat rules and state mutation.
CombatSystem implements all rule-driven combat operations such as damage, armor handling, healing, and death checks.
Gameplay logic (effects, match orchestration) must not mutate Entity state directly. All combat-related mutations should be performed through this class.
| DamageResult CombatSystem::dealDamage | ( | Entity & | target, |
| int | amount, | ||
| bool | ignoreArmor = false |
||
| ) |
Resolves damage against a target according to combat rules.
Applies armor interaction based on the specified damage resolution mode and returns a detailed result describing the outcome.
| damageInfo | Damage request (amount, target, resolution mode). |
| void CombatSystem::gainArmor | ( | Entity & | target, |
| int | amount | ||
| ) |
Grants armor to the target entity.
| target | Entity receiving the armor. |
| amount | Armor amount to add. |
| void CombatSystem::gainAttack | ( | Entity & | target, |
| int | amount | ||
| ) |
Grants attack to the target entity.
| target | Entity receiving the armor. |
| amount | Attack amount to add. |
| void CombatSystem::heal | ( | Entity & | target, |
| int | amount | ||
| ) |
Heals the target entity by the specified amount.
| target | Entity to heal. |
| amount | HP amount to restore. |
| bool CombatSystem::isDead | ( | const Entity & | target | ) |
Checks whether the target entity is dead.
| target | Entity to check. |
| void CombatSystem::resetArmor | ( | Entity & | target | ) |
Resets the target entity's armor to zero.
| target | Entity whose armor is reset. |