Implements marking opponents as seen.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -185,4 +185,40 @@ TEST_CASE("Switch Creature in, but have attack aimed at it. Attack should hit ne
|
||||
REQUIRE(c1->GetCurrentHealth() == c1->GetBoostedStat(Core::Statistic::Health));
|
||||
}
|
||||
|
||||
TEST_CASE("Switch Creature in, mark as seen opponent for opponent", "[Integrations]") {
|
||||
auto library = TestLibrary::Get();
|
||||
auto c1 = CreateCreature(library, "testSpecies1", 100).WithAttack("standard", AttackLearnMethod::Unknown)->Create();
|
||||
auto c2 = CreateCreature(library, "testSpecies1", 1).WithAttack("standard", AttackLearnMethod::Unknown)->Create();
|
||||
CreatureParty party1{c1, c2};
|
||||
auto battleParty1 = BattleParty(&party1, {CreatureIndex(0, 0)});
|
||||
auto c3 = CreateCreature(library, "testSpecies1", 1).WithAttack("standard", AttackLearnMethod::Unknown)->Create();
|
||||
CreatureParty party2{c3};
|
||||
auto battleParty2 = BattleParty(&party2, {CreatureIndex(1, 0)});
|
||||
|
||||
auto battle = Battle(library, {battleParty1, battleParty2});
|
||||
|
||||
battle.SwitchCreature(0, 0, c1);
|
||||
battle.SwitchCreature(1, 0, c3);
|
||||
|
||||
auto seen = c3->GetSeenOpponents();
|
||||
REQUIRE(seen.size() == 1);
|
||||
REQUIRE(seen.find(c1) != seen.end());
|
||||
|
||||
battle.TrySetChoice(new SwitchTurnChoice(c1, c2));
|
||||
battle.TrySetChoice(new PassTurnChoice(c3));
|
||||
|
||||
seen = c3->GetSeenOpponents();
|
||||
REQUIRE(seen.size() == 2);
|
||||
REQUIRE(seen.find(c1) != seen.end());
|
||||
REQUIRE(seen.find(c2) != seen.end());
|
||||
|
||||
battle.TrySetChoice(new SwitchTurnChoice(c2, c1));
|
||||
battle.TrySetChoice(new PassTurnChoice(c3));
|
||||
|
||||
seen = c3->GetSeenOpponents();
|
||||
REQUIRE(seen.size() == 2);
|
||||
REQUIRE(seen.find(c1) != seen.end());
|
||||
REQUIRE(seen.find(c2) != seen.end());
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user