MCPcopy Create free account
hub / github.com/EasyRPG/Player / testAgi

Function testAgi

tests/algo.cpp:206–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204}
205
206static void testAgi(int src, int tgt, int res) {
207 auto& source = *MakeAgiActor(0, src);
208 auto& target = *MakeAgiEnemy(0, tgt);
209
210 REQUIRE_EQ(res, Algo::CalcNormalAttackToHit(source, target, Game_Battler::WeaponAll, lcf::rpg::System::BattleCondition_none, true));
211 REQUIRE_EQ(res, Algo::CalcSkillToHit(source, target, lcf::Data::skills[0], lcf::rpg::System::BattleCondition_none, false));
212 REQUIRE_EQ(res, Algo::CalcSkillToHit(source, target, lcf::Data::skills[1], lcf::rpg::System::BattleCondition_none, false));
213 for (int i = 2; i < 6; ++i) {
214 CAPTURE(i);
215 REQUIRE_EQ(90, Algo::CalcSkillToHit(source, target, lcf::Data::skills[i], lcf::rpg::System::BattleCondition_none, false));
216
217 }
218}
219
220TEST_CASE("HitRateAgi") {
221 const MockBattle mb;

Callers 1

algo.cppFile · 0.85

Calls 4

MakeAgiActorFunction · 0.85
MakeAgiEnemyFunction · 0.85
CalcNormalAttackToHitFunction · 0.85
CalcSkillToHitFunction · 0.85

Tested by

no test coverage detected