Adds OnSwitchIn script hook to Angelscript.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
496ebfdfa1
commit
d1ba703f76
|
@ -344,3 +344,6 @@ void AngelScriptScript::BlockWeather(CreatureLib::Battling::Battle* battle, bool
|
||||||
ctx->SetArgAddress(1, blockWeather);
|
ctx->SetArgAddress(1, blockWeather);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
void AngelScriptScript::OnSwitchIn(CreatureLib::Battling::Creature* creature) {
|
||||||
|
CALL_HOOK(OnSwitchIn, { ctx->SetArgObject(0, (void*)creature); })
|
||||||
|
}
|
||||||
|
|
|
@ -137,6 +137,7 @@ public:
|
||||||
|
|
||||||
void OnFaint(CreatureLib::Battling::Creature* creature, CreatureLib::Battling::DamageSource source) override;
|
void OnFaint(CreatureLib::Battling::Creature* creature, CreatureLib::Battling::DamageSource source) override;
|
||||||
void BlockWeather(CreatureLib::Battling::Battle* battle, bool* blockWeather) override;
|
void BlockWeather(CreatureLib::Battling::Battle* battle, bool* blockWeather) override;
|
||||||
|
void OnSwitchIn(CreatureLib::Battling::Creature* creature) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#undef CALL_HOOK
|
#undef CALL_HOOK
|
||||||
|
|
|
@ -167,6 +167,7 @@ public:
|
||||||
SCRIPT_HOOK_FUNCTION(OnEndTurn, "void OnEndTurn()");
|
SCRIPT_HOOK_FUNCTION(OnEndTurn, "void OnEndTurn()");
|
||||||
SCRIPT_HOOK_FUNCTION(OnFaint, "void OnFaint(Pokemon@ pokemon, DamageSource damageSource)");
|
SCRIPT_HOOK_FUNCTION(OnFaint, "void OnFaint(Pokemon@ pokemon, DamageSource damageSource)");
|
||||||
SCRIPT_HOOK_FUNCTION(BlockWeather, "void BlockWeather(Battle@ battle, bool& result)");
|
SCRIPT_HOOK_FUNCTION(BlockWeather, "void BlockWeather(Battle@ battle, bool& result)");
|
||||||
|
SCRIPT_HOOK_FUNCTION(OnSwitchIn, "void OnSwitchIn(Pokemon@ pokemon)");
|
||||||
};
|
};
|
||||||
|
|
||||||
#undef SCRIPT_HOOK_FUNCTION
|
#undef SCRIPT_HOOK_FUNCTION
|
||||||
|
|
|
@ -61,6 +61,7 @@ shared abstract class PkmnScript {
|
||||||
void ModifyExperienceGain(Pokemon@ faintedMon, Pokemon@ winningMon, uint32& critStage){};
|
void ModifyExperienceGain(Pokemon@ faintedMon, Pokemon@ winningMon, uint32& critStage){};
|
||||||
void DoesShareExperience(Pokemon@ faintedMon, Pokemon@ winningMon, bool& shareExperience){};
|
void DoesShareExperience(Pokemon@ faintedMon, Pokemon@ winningMon, bool& shareExperience){};
|
||||||
void BlockWeather(Battle@ battle, bool& blockWeather){};
|
void BlockWeather(Battle@ battle, bool& blockWeather){};
|
||||||
|
void OnSwitchIn(Pokemon@ pokemon){};
|
||||||
}
|
}
|
||||||
)");
|
)");
|
||||||
Ensure(r >= 0);
|
Ensure(r >= 0);
|
||||||
|
|
Loading…
Reference in New Issue