MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / giveInterruptChanceToUnits

Method giveInterruptChanceToUnits

game/state/battle/battle.cpp:2378–2392  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2376}
2377
2378void Battle::giveInterruptChanceToUnits(GameState &state, StateRef<BattleUnit> giver,
2379 int reactionValue)
2380{
2381 if (mode != Mode::TurnBased)
2382 {
2383 return;
2384 }
2385 for (auto &u : units)
2386 {
2387 if (u.second->visibleEnemies.find(giver) != u.second->visibleEnemies.end())
2388 {
2389 giveInterruptChanceToUnit(state, giver, {&state, u.second->id}, reactionValue);
2390 }
2391 }
2392}
2393
2394void Battle::giveInterruptChanceToUnit(GameState &state, StateRef<BattleUnit> giver,
2395 StateRef<BattleUnit> receiver, int reactionValue)

Callers 2

spendTUMethod · 0.80
spendRemainingTUMethod · 0.80

Calls 1

endMethod · 0.80

Tested by

no test coverage detected