Fixes angelscript build with new stat getter changes on Pokemon class.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2022-06-07 23:12:55 +02:00
parent fd4eb77dc9
commit e4b818c799
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 20 additions and 7 deletions

View File

@ -96,6 +96,19 @@ static float GetEffectivenessHelper(CreatureLib::Library::TypeLibrary* typeLib,
return typeLib->GetEffectiveness(attackingType, pokemon->GetTypes()); return typeLib->GetEffectiveness(attackingType, pokemon->GetTypes());
} }
static u32 GetFlatStat(PkmnLib::Battling::Pokemon* obj, CreatureLib::Library::Statistic stat) {
return obj->GetFlatStat(stat);
}
static u32 GetBoostedStat(PkmnLib::Battling::Pokemon* obj, CreatureLib::Library::Statistic stat) {
return obj->GetBoostedStat(stat);
}
static u32 GetBaseStat(PkmnLib::Battling::Pokemon* obj, CreatureLib::Library::Statistic stat) {
return obj->GetBaseStat(stat);
}
static i8 GetStatBoost(PkmnLib::Battling::Pokemon* obj, CreatureLib::Library::Statistic stat) {
return obj->GetStatBoost(stat);
}
void RegisterPokemonClass::RegisterPokemonType(asIScriptEngine* engine) { void RegisterPokemonClass::RegisterPokemonType(asIScriptEngine* engine) {
Ensure(engine->RegisterObjectType("Pokemon", 0, asOBJ_REF | asOBJ_NOCOUNT) >= 0); Ensure(engine->RegisterObjectType("Pokemon", 0, asOBJ_REF | asOBJ_NOCOUNT) >= 0);
REGISTER_GETTER("Pokemon", "const Species@ get_Species() const property", CreatureLib::Battling::Creature, REGISTER_GETTER("Pokemon", "const Species@ get_Species() const property", CreatureLib::Battling::Creature,
@ -180,17 +193,17 @@ void RegisterPokemonClass::RegisterPokemonType(asIScriptEngine* engine) {
r = engine->RegisterObjectMethod("Pokemon", "void ChangeStatBoost(Statistic stat, int8 amount, bool selfInflicted)", r = engine->RegisterObjectMethod("Pokemon", "void ChangeStatBoost(Statistic stat, int8 amount, bool selfInflicted)",
asMETHOD(PkmnLib::Battling::Pokemon, ChangeStatBoost), asCALL_THISCALL); asMETHOD(PkmnLib::Battling::Pokemon, ChangeStatBoost), asCALL_THISCALL);
Ensure(r >= 0); Ensure(r >= 0);
r = engine->RegisterObjectMethod("Pokemon", "uint32 GetFlatStat(Statistic stat) const", r = engine->RegisterObjectMethod("Pokemon", "uint32 GetFlatStat(Statistic stat) const", asFUNCTION(GetFlatStat),
asMETHOD(PkmnLib::Battling::Pokemon, GetFlatStat), asCALL_THISCALL); asCALL_CDECL_OBJFIRST);
Ensure(r >= 0); Ensure(r >= 0);
r = engine->RegisterObjectMethod("Pokemon", "uint32 GetBoostedStat(Statistic stat) const", r = engine->RegisterObjectMethod("Pokemon", "uint32 GetBoostedStat(Statistic stat) const",
asMETHOD(PkmnLib::Battling::Pokemon, GetBoostedStat), asCALL_THISCALL); asFUNCTION(GetBoostedStat), asCALL_CDECL_OBJFIRST);
Ensure(r >= 0); Ensure(r >= 0);
r = engine->RegisterObjectMethod("Pokemon", "uint32 GetBaseStat(Statistic stat) const", r = engine->RegisterObjectMethod("Pokemon", "uint32 GetBaseStat(Statistic stat) const", asFUNCTION(GetBaseStat),
asMETHOD(PkmnLib::Battling::Pokemon, GetBaseStat), asCALL_THISCALL); asCALL_CDECL_OBJFIRST);
Ensure(r >= 0); Ensure(r >= 0);
r = engine->RegisterObjectMethod("Pokemon", "int8 GetStatBoost(Statistic stat) const", r = engine->RegisterObjectMethod("Pokemon", "int8 GetStatBoost(Statistic stat) const", asFUNCTION(GetStatBoost),
asMETHOD(PkmnLib::Battling::Pokemon, GetStatBoost), asCALL_THISCALL); asCALL_CDECL_OBJFIRST);
Ensure(r >= 0); Ensure(r >= 0);
r = engine->RegisterObjectMethod("Pokemon", "bool HasVolatile(const constString &in name) const", r = engine->RegisterObjectMethod("Pokemon", "bool HasVolatile(const constString &in name) const",
asMETHOD(PkmnLib::Battling::Pokemon, HasVolatileScript), asCALL_THISCALL); asMETHOD(PkmnLib::Battling::Pokemon, HasVolatileScript), asCALL_THISCALL);