Fixes for new CreatureLib.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
ca53676b6d
commit
77eae12326
|
@ -150,7 +150,7 @@ namespace PkmnLib::Battling {
|
|||
if (!_library->GetMoveLibrary()->TryGet(moveName, move)) {
|
||||
THROW_CREATURE("Invalid Move given: " << moveName.std_str());
|
||||
}
|
||||
if (_currentMove >= _library->GetSettings()->GetMaximalMoves()) {
|
||||
if (_currentMove >= _library->GetSettings()->GetMaximalAttacks()) {
|
||||
throw CreatureException("This pokemon already has the maximal allowed moves.");
|
||||
}
|
||||
Assert(move != nullptr);
|
||||
|
|
|
@ -49,7 +49,7 @@ namespace PkmnLib::Battling {
|
|||
|
||||
public:
|
||||
CreatePokemon(const BattleLibrary* library, const ArbUt::StringView& species, uint8_t level)
|
||||
: _library(library), _species(species), _level(level), _attacks(library->GetSettings()->GetMaximalMoves()) {
|
||||
: _library(library), _species(species), _level(level), _attacks(library->GetSettings()->GetMaximalAttacks()) {
|
||||
}
|
||||
|
||||
CreatePokemon& WithForme(const ArbUt::StringView& forme);
|
||||
|
|
|
@ -14,7 +14,7 @@ void RegisterStaticLibraryTypes::RegisterLibrarySettingsType(asIScriptEngine* en
|
|||
asMETHOD(PkmnLib::Library::LibrarySettings, GetMaximalLevel), asCALL_THISCALL);
|
||||
assert(r >= 0);
|
||||
r = engine->RegisterObjectMethod("LibrarySettings", "uint8 get_MaximalMoves() const property",
|
||||
asMETHOD(PkmnLib::Library::LibrarySettings, GetMaximalMoves), asCALL_THISCALL);
|
||||
asMETHOD(PkmnLib::Library::LibrarySettings, GetMaximalAttacks), asCALL_THISCALL);
|
||||
assert(r >= 0);
|
||||
r = engine->RegisterObjectMethod("LibrarySettings", "uint16 get_ShinyRate() const property",
|
||||
asMETHOD(PkmnLib::Library::LibrarySettings, GetShinyRate), asCALL_THISCALL);
|
||||
|
|
|
@ -74,7 +74,7 @@ TEST_CASE("Validate StaticLibrary Maximum Moves in Script") {
|
|||
auto data = GetScript(mainLib, "testMaximumMoves"_cnc);
|
||||
|
||||
data.Context->SetArgObject(0, (void*)mainLib->GetStaticLib().get());
|
||||
data.Context->SetArgByte(1, mainLib->GetStaticLib()->GetSettings()->GetMaximalMoves());
|
||||
data.Context->SetArgByte(1, mainLib->GetStaticLib()->GetSettings()->GetMaximalAttacks());
|
||||
|
||||
auto result = data.Context->Execute();
|
||||
REQUIRE(result == asEXECUTION_FINISHED);
|
||||
|
|
Loading…
Reference in New Issue