| 230 | } |
| 231 | |
| 232 | static void testStates(Game_Battler& source, Game_Battler& target, int base) { |
| 233 | SUBCASE("Cannot act") { |
| 234 | target.AddState(2, true); |
| 235 | REQUIRE_EQ(100, Algo::CalcNormalAttackToHit(source, target, Game_Battler::WeaponAll, lcf::rpg::System::BattleCondition_none, true)); |
| 236 | REQUIRE_EQ(100, Algo::CalcSkillToHit(source, target, lcf::Data::skills[0], lcf::rpg::System::BattleCondition_none, false)); |
| 237 | } |
| 238 | |
| 239 | SUBCASE("Avoid attacks") { |
| 240 | target.AddState(3, true); |
| 241 | REQUIRE_EQ(0, Algo::CalcNormalAttackToHit(source, target, Game_Battler::WeaponAll, lcf::rpg::System::BattleCondition_none, true)); |
| 242 | // RPG_RT bug |
| 243 | REQUIRE_EQ(base, Algo::CalcSkillToHit(source, target, lcf::Data::skills[0], lcf::rpg::System::BattleCondition_none, false)); |
| 244 | } |
| 245 | |
| 246 | SUBCASE("Avoid attacks and cannot act") { |
| 247 | target.AddState(2, true); |
| 248 | target.AddState(3, true); |
| 249 | REQUIRE_EQ(0, Algo::CalcNormalAttackToHit(source, target, Game_Battler::WeaponAll, lcf::rpg::System::BattleCondition_none, true)); |
| 250 | // RPG_RT bug |
| 251 | REQUIRE_EQ(100, Algo::CalcSkillToHit(source, target, lcf::Data::skills[0], lcf::rpg::System::BattleCondition_none, false)); |
| 252 | } |
| 253 | } |
| 254 | |
| 255 | TEST_CASE("HitRateStates") { |
| 256 | const MockBattle mb; |
no test coverage detected