| 1818 | } |
| 1819 | |
| 1820 | void BattleUnit::applyMoraleDamage(int moraleDamage, int psiAttackPower, GameState &state) |
| 1821 | { |
| 1822 | LogWarning("Psionic damageType"); |
| 1823 | const int random = randBoundsExclusive(state.rng, 0, 100); |
| 1824 | const int chance = |
| 1825 | getPsiAttackChance(psiAttackPower, agent->modified_stats.psi_defence, PsiStatus::Panic); |
| 1826 | |
| 1827 | LogWarning("Chance: %i Random: %i", chance, random); |
| 1828 | |
| 1829 | if (random < chance) |
| 1830 | { |
| 1831 | LogWarning("Psionic damage passed the defence of %s", agent->name); |
| 1832 | agent->modified_stats.loseMorale(moraleDamage); |
| 1833 | LogWarning("morale: %d", agent->modified_stats.bravery); |
| 1834 | } |
| 1835 | } |
| 1836 | |
| 1837 | BodyPart BattleUnit::determineBodyPartHit(StateRef<DamageType> damageType, Vec3<float> cposition, |
| 1838 | Vec3<float> direction) |
nothing calls this directly
no test coverage detected