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

Function testNormalSkill

tests/enemyai.cpp:44–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44static void testNormalSkill(bool expect_enemy, bool expect_ally, lcf::rpg::Skill& skill, const Game_Battler& target, bool bugs) {
45 CAPTURE(bugs);
46 CAPTURE(target.IsDead());
47 CAPTURE(target.IsHidden());
48 CAPTURE(target.HasState(2));
49 CAPTURE(skill.scope);
50
51 skill.scope = lcf::rpg::Skill::Scope_enemy;
52 REQUIRE_EQ(expect_enemy, EnemyAi::IsSkillEffectiveOn(skill, target, bugs));
53
54 skill.scope = lcf::rpg::Skill::Scope_enemies;
55 REQUIRE_EQ(expect_enemy, EnemyAi::IsSkillEffectiveOn(skill, target, bugs));
56
57 skill.scope = lcf::rpg::Skill::Scope_self;
58 REQUIRE_EQ(expect_ally, EnemyAi::IsSkillEffectiveOn(skill, target, bugs));
59
60 skill.scope = lcf::rpg::Skill::Scope_ally;
61 REQUIRE_EQ(expect_ally, EnemyAi::IsSkillEffectiveOn(skill, target, bugs));
62
63 skill.scope = lcf::rpg::Skill::Scope_party;
64 REQUIRE_EQ(expect_ally, EnemyAi::IsSkillEffectiveOn(skill, target, bugs));
65}
66
67TEST_CASE("IsSkillEffectiveOn") {
68 const MockActor m;

Callers 1

enemyai.cppFile · 0.85

Calls 4

IsSkillEffectiveOnFunction · 0.85
IsDeadMethod · 0.80
IsHiddenMethod · 0.80
HasStateMethod · 0.80

Tested by

no test coverage detected