Fixes for party initialization
This commit is contained in:
parent
56055641c1
commit
6f769757f3
|
@ -5,6 +5,7 @@
|
|||
#include <CreatureLib/Battling/TurnChoices/PassTurnChoice.hpp>
|
||||
#include <PkmnLib/Battling/Battle/Battle.hpp>
|
||||
#include <PkmnLib/Battling/Pokemon/CreatePokemon.hpp>
|
||||
#include <PkmnLib/Battling/Pokemon/PokemonParty.hpp>
|
||||
#include <angelscript.h>
|
||||
#include "../TestEnvironment.hpp"
|
||||
|
||||
|
@ -14,7 +15,7 @@ class BattleFunctions {
|
|||
TestEnvironment* env = static_cast<TestEnvironment*>(ctx->GetUserData());
|
||||
|
||||
auto lib = Globals::Library.GetValue();
|
||||
auto p1 = new CreatureLib::Battling::CreatureParty(species->GetSize());
|
||||
auto p1 = new PkmnLib::Battling::PokemonParty(species->GetSize());
|
||||
for (u32 i = 0; i < species->GetSize(); ++i) {
|
||||
auto s = reinterpret_cast<const ArbUt::StringView*>(species->At(i));
|
||||
auto mon1 = PkmnLib::Battling::CreatePokemon(lib, *s, level)
|
||||
|
@ -43,7 +44,7 @@ class BattleFunctions {
|
|||
.WithGender(CreatureLib::Library::Gender::Male)
|
||||
.IsAllowedExperienceGain(false)
|
||||
.Build();
|
||||
auto p1 = new CreatureLib::Battling::CreatureParty(1);
|
||||
auto p1 = new PkmnLib::Battling::PokemonParty(1);
|
||||
p1->SwapInto(0, mon1);
|
||||
|
||||
auto mon2 = PkmnLib::Battling::CreatePokemon(lib, species2, level)
|
||||
|
@ -53,7 +54,7 @@ class BattleFunctions {
|
|||
.WithGender(CreatureLib::Library::Gender::Male)
|
||||
.IsAllowedExperienceGain(false)
|
||||
.Build();
|
||||
auto p2 = new CreatureLib::Battling::CreatureParty(1);
|
||||
auto p2 = new PkmnLib::Battling::PokemonParty(1);
|
||||
p2->SwapInto(0, mon2);
|
||||
|
||||
auto battle = new PkmnLib::Battling::Battle(
|
||||
|
@ -75,8 +76,8 @@ class BattleFunctions {
|
|||
return battle;
|
||||
}
|
||||
|
||||
static PkmnLib::Battling::Battle* CreateSimpleBattleFromParties(u32 seed, CreatureLib::Battling::CreatureParty* p1,
|
||||
CreatureLib::Battling::CreatureParty* p2) {
|
||||
static PkmnLib::Battling::Battle* CreateSimpleBattleFromParties(u32 seed, PkmnLib::Battling::PokemonParty* p1,
|
||||
PkmnLib::Battling::PokemonParty* p2) {
|
||||
auto* ctx = asGetActiveContext();
|
||||
TestEnvironment* env = static_cast<TestEnvironment*>(ctx->GetUserData());
|
||||
auto lib = Globals::Library.GetValue();
|
||||
|
@ -91,7 +92,7 @@ class BattleFunctions {
|
|||
seed // with seed
|
||||
);
|
||||
battle->SwitchCreature(0, 0, p1->GetAtIndex(0));
|
||||
battle->SwitchCreature(1, 0, p2->GetAtIndex(1));
|
||||
battle->SwitchCreature(1, 0, p2->GetAtIndex(0));
|
||||
|
||||
env->AddGarbage(battle);
|
||||
return battle;
|
||||
|
|
Loading…
Reference in New Issue