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());
}
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) {
Ensure(engine->RegisterObjectType("Pokemon", 0, asOBJ_REF | asOBJ_NOCOUNT) >= 0);
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)",
asMETHOD(PkmnLib::Battling::Pokemon, ChangeStatBoost), asCALL_THISCALL);
Ensure(r >= 0);
r = engine->RegisterObjectMethod("Pokemon", "uint32 GetFlatStat(Statistic stat) const",
asMETHOD(PkmnLib::Battling::Pokemon, GetFlatStat), asCALL_THISCALL);
r = engine->RegisterObjectMethod("Pokemon", "uint32 GetFlatStat(Statistic stat) const", asFUNCTION(GetFlatStat),
asCALL_CDECL_OBJFIRST);
Ensure(r >= 0);
r = engine->RegisterObjectMethod("Pokemon", "uint32 GetBoostedStat(Statistic stat) const",
asMETHOD(PkmnLib::Battling::Pokemon, GetBoostedStat), asCALL_THISCALL);
asFUNCTION(GetBoostedStat), asCALL_CDECL_OBJFIRST);
Ensure(r >= 0);
r = engine->RegisterObjectMethod("Pokemon", "uint32 GetBaseStat(Statistic stat) const",
asMETHOD(PkmnLib::Battling::Pokemon, GetBaseStat), asCALL_THISCALL);
r = engine->RegisterObjectMethod("Pokemon", "uint32 GetBaseStat(Statistic stat) const", asFUNCTION(GetBaseStat),
asCALL_CDECL_OBJFIRST);
Ensure(r >= 0);
r = engine->RegisterObjectMethod("Pokemon", "int8 GetStatBoost(Statistic stat) const",
asMETHOD(PkmnLib::Battling::Pokemon, GetStatBoost), asCALL_THISCALL);
r = engine->RegisterObjectMethod("Pokemon", "int8 GetStatBoost(Statistic stat) const", asFUNCTION(GetStatBoost),
asCALL_CDECL_OBJFIRST);
Ensure(r >= 0);
r = engine->RegisterObjectMethod("Pokemon", "bool HasVolatile(const constString &in name) const",
asMETHOD(PkmnLib::Battling::Pokemon, HasVolatileScript), asCALL_THISCALL);