|
|
|
@@ -157,7 +157,7 @@ TEST_F(MeleeActionTests, Execute_givesDamageBasedOnBattalionTypeInfo) {
|
|
|
|
|
|
|
|
|
|
PercentileRollOdds ambushOdds = MakeOdds(0);
|
|
|
|
|
|
|
|
|
|
std::vector<double> rolls{ambushRoll, attackerRoll, defenderRoll};
|
|
|
|
|
auto rolls = std::vector<double>{ambushRoll, attackerRoll, defenderRoll};
|
|
|
|
|
auto generator = SequenceRandomGenerator::WithSequence(rolls);
|
|
|
|
|
|
|
|
|
|
for (int size = 0; size <= 1000; size += 100) {
|
|
|
|
@@ -205,7 +205,7 @@ TEST_F(MeleeActionTests, Execute_givesDamageBasedOnBattalionTypeInfo) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(MeleeActionTests, Execute_normalPlayers_increasesOpponentKnowledge) {
|
|
|
|
|
const std::vector<double> rolls{0, 50, 50};
|
|
|
|
|
const auto rolls = std::vector<double>{0, 50, 50};
|
|
|
|
|
const auto generator = SequenceRandomGenerator::WithSequence(rolls);
|
|
|
|
|
|
|
|
|
|
attacker->mutable_opponent_knowledge()->Mutate(1, 51);
|
|
|
|
@@ -238,7 +238,7 @@ TEST_F(MeleeActionTests, Execute_normalPlayers_increasesOpponentKnowledge) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(MeleeActionTests, Execute_lledUnit_increasesOpponentKnowledge) {
|
|
|
|
|
const std::vector<double> rolls{0.0, 0.50, 0.50};
|
|
|
|
|
const auto rolls = std::vector<double>{0.0, 0.50, 0.50};
|
|
|
|
|
const auto generator = SequenceRandomGenerator::WithSequence(rolls);
|
|
|
|
|
|
|
|
|
|
attacker->mutable_opponent_knowledge()->Mutate(1, 51);
|
|
|
|
@@ -272,7 +272,7 @@ TEST_F(MeleeActionTests, Execute_lledUnit_increasesOpponentKnowledge) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(MeleeActionTests, Execute_givesAttackerStrengthXp) {
|
|
|
|
|
const std::vector<double> rolls{0.0, 0.50, 0.50};
|
|
|
|
|
const auto rolls = std::vector<double>{0.0, 0.50, 0.50};
|
|
|
|
|
const auto generator = SequenceRandomGenerator::WithSequence(rolls);
|
|
|
|
|
|
|
|
|
|
attackerWithHero->mutable_attached_hero().mutate_strength_xp(57);
|
|
|
|
@@ -297,7 +297,7 @@ TEST_F(MeleeActionTests, Execute_givesAttackerStrengthXp) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(MeleeActionTests, Execute_givesDefenderStrengthXp) {
|
|
|
|
|
const std::vector<double> rolls{0.0, 0.50, 0.50};
|
|
|
|
|
const auto rolls = std::vector<double>{0.0, 0.50, 0.50};
|
|
|
|
|
const auto generator = SequenceRandomGenerator::WithSequence(rolls);
|
|
|
|
|
|
|
|
|
|
defenderWithHero->mutable_attached_hero().mutate_strength_xp(12);
|
|
|
|
@@ -322,7 +322,7 @@ TEST_F(MeleeActionTests, Execute_givesDefenderStrengthXp) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(MeleeActionTests, ExecuteWithOutAmbush_givesNoAttackerAgilityXp) {
|
|
|
|
|
const std::vector<double> rolls{0.0, 0.50, 0.50};
|
|
|
|
|
const auto rolls = std::vector<double>{0.0, 0.50, 0.50};
|
|
|
|
|
const auto generator = SequenceRandomGenerator::WithSequence(rolls);
|
|
|
|
|
|
|
|
|
|
attackerWithHero->mutable_attached_hero().mutate_agility_xp(88);
|
|
|
|
@@ -347,7 +347,7 @@ TEST_F(MeleeActionTests, ExecuteWithOutAmbush_givesNoAttackerAgilityXp) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(MeleeActionTests, ExecuteWithAmbush_givesAttackerAgilityXp) {
|
|
|
|
|
const std::vector<double> rolls{0.0, 0.50, 0.50};
|
|
|
|
|
const auto rolls = std::vector<double>{0.0, 0.50, 0.50};
|
|
|
|
|
const auto generator = SequenceRandomGenerator::WithSequence(rolls);
|
|
|
|
|
|
|
|
|
|
attackerWithHero->mutate_hidden(true);
|
|
|
|
@@ -373,7 +373,7 @@ TEST_F(MeleeActionTests, ExecuteWithAmbush_givesAttackerAgilityXp) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(MeleeActionTests, Execute_hiddenAttacker_unhides) {
|
|
|
|
|
const std::vector<double> rolls{0.0, 0.50, 0.50};
|
|
|
|
|
const auto rolls = std::vector<double>{0.0, 0.50, 0.50};
|
|
|
|
|
const auto generator = SequenceRandomGenerator::WithSequence(rolls);
|
|
|
|
|
|
|
|
|
|
attackerWithHero->mutate_hidden(true);
|
|
|
|
@@ -398,7 +398,7 @@ TEST_F(MeleeActionTests, Execute_hiddenAttacker_unhides) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(MeleeActionTests, Execute_hiddenAttackerLowRoll_ambushes) {
|
|
|
|
|
const std::vector<double> rolls{0.25, 0.50, 0.50};
|
|
|
|
|
const auto rolls = std::vector<double>{0.25, 0.50, 0.50};
|
|
|
|
|
const auto generator = SequenceRandomGenerator::WithSequence(rolls);
|
|
|
|
|
|
|
|
|
|
attackerWithHero->mutate_hidden(true);
|
|
|
|
@@ -419,7 +419,7 @@ TEST_F(MeleeActionTests, Execute_hiddenAttackerLowRoll_ambushes) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(MeleeActionTests, Execute_hiddenAttackerLowRoll_intoCastle_noAmbush) {
|
|
|
|
|
const std::vector<double> rolls{0.25, 0.50, 0.50};
|
|
|
|
|
const auto rolls = std::vector<double>{0.25, 0.50, 0.50};
|
|
|
|
|
const auto generator = SequenceRandomGenerator::WithSequence(rolls);
|
|
|
|
|
|
|
|
|
|
attacker->mutate_hidden(true);
|
|
|
|
@@ -444,7 +444,7 @@ TEST_F(MeleeActionTests, Execute_hiddenAttackerLowRoll_intoCastle_noAmbush) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(MeleeActionTests, Execute_hiddenAttackerLowRoll_stunsDefender) {
|
|
|
|
|
const std::vector<double> rolls{0.25, 0.50, 0.50};
|
|
|
|
|
const auto rolls = std::vector<double>{0.25, 0.50, 0.50};
|
|
|
|
|
const auto generator = SequenceRandomGenerator::WithSequence(rolls);
|
|
|
|
|
|
|
|
|
|
attacker->mutate_hidden(true);
|
|
|
|
@@ -467,7 +467,7 @@ TEST_F(MeleeActionTests, Execute_hiddenAttackerLowRoll_stunsDefender) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(MeleeActionTests, Execute_hiddenAttackerHighRoll_noAmbush) {
|
|
|
|
|
const std::vector<double> rolls{0.75, 0.50, 0.50};
|
|
|
|
|
const auto rolls = std::vector<double>{0.75, 0.50, 0.50};
|
|
|
|
|
const auto generator = SequenceRandomGenerator::WithSequence(rolls);
|
|
|
|
|
|
|
|
|
|
attacker->mutate_hidden(true);
|
|
|
|
@@ -491,7 +491,7 @@ TEST_F(MeleeActionTests, Execute_hiddenAttackerHighRoll_noAmbush) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(MeleeActionTests, Execute_onStunnedDefender_doesMoreDamage) {
|
|
|
|
|
std::vector<double> rolls{0.75, 0.50, 0.50};
|
|
|
|
|
auto rolls = std::vector<double>{0.75, 0.50, 0.50};
|
|
|
|
|
auto generator = SequenceRandomGenerator::WithSequence(rolls);
|
|
|
|
|
|
|
|
|
|
GetGameSettingsSetter().SetDouble(kSettingsKeys.damageReceivedMultiplierFromStun, 1.25);
|
|
|
|
@@ -533,7 +533,7 @@ TEST_F(MeleeActionTests, Execute_onStunnedDefender_doesMoreDamage) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TEST_F(MeleeActionTests, Execute_onFortifiedDefender_doesLessDamage) {
|
|
|
|
|
std::vector<double> rolls{0.75, 0.50, 0.50};
|
|
|
|
|
auto rolls = std::vector<double>{0.75, 0.50, 0.50};
|
|
|
|
|
auto generator = SequenceRandomGenerator::WithSequence(rolls);
|
|
|
|
|
|
|
|
|
|
GetGameSettingsSetter().SetDouble(kSettingsKeys.fortifyDamageTakenMultiplier, 0.9);
|
|
|
|
|