|
CardGame
Rogue-like card videogame
|
Execution context for resolving combat effects. More...
#include <combatContext.h>
Classes | |
| class | EffectMessageScope |
Public Member Functions | |
| CombatContext (CombatSystem &combatSystem, Entity &actor, Entity &opponent, DeckCombat &deckCombat, TurnData &turnData) | |
| Constructs a context for effect resolution. | |
| void | setEffectMessage (std::vector< std::string > *effectMessage) |
| void | resetEffectMessage () |
| void | gainArmor (Target target, int amount) |
| Grants armor to the selected logical target. | |
| void | gainAttack (Target target, int amount) |
| Grants attack to the selected logical target. | |
| DamageResult | dealDamage (Target target, int amount, bool ignoreArmor=false) |
| void | drawMultipleCardFromEffect (int amount) |
| std::optional< DrawData > | getDrawData () |
| void | gainActions (int amount) |
| void | limitCardToPlay (int amount) |
| void | takeCardHostage () |
Execution context for resolving combat effects.
CombatContext binds an actor/opponent relationship for the current action and provides a narrow set of combat operations that effects may invoke.
Effects target using logical selectors (Target::Self / Target::Opponent). CombatContext resolves these selectors to Entity references and forwards requests to CombatSystem, which owns the combat rules.
CombatContext does not own any objects; it stores references that must outlive it.
| CombatContext::CombatContext | ( | CombatSystem & | combatSystem, |
| Entity & | actor, | ||
| Entity & | opponent, | ||
| DeckCombat & | deckCombat, | ||
| TurnData & | turnData | ||
| ) |
| DamageResult CombatContext::dealDamage | ( | Target | target, |
| int | amount, | ||
| bool | ignoreArmor = false |
||
| ) |
| void CombatContext::drawMultipleCardFromEffect | ( | int | amount | ) |
| void CombatContext::gainActions | ( | int | amount | ) |
| void CombatContext::gainArmor | ( | Target | target, |
| int | amount | ||
| ) |
Grants armor to the selected logical target.
Resolves the target (self/opponent) and forwards the operation to CombatSystem.
| target | Logical target selector. |
| amount | Armor amount to add. |
| void CombatContext::gainAttack | ( | Target | target, |
| int | amount | ||
| ) |
Grants attack to the selected logical target.
Resolves the target (self/opponent) and forwards the operation to CombatSystem.
| target | Logical target selector. |
| amount | Attack amount to add. |
| std::optional< DrawData > CombatContext::getDrawData | ( | ) |
| void CombatContext::limitCardToPlay | ( | int | amount | ) |
| void CombatContext::resetEffectMessage | ( | ) |
| void CombatContext::setEffectMessage | ( | std::vector< std::string > * | effectMessage | ) |
| void CombatContext::takeCardHostage | ( | ) |