CreatureLib/src/Battling/ScriptHandling/BattleScript.hpp

97 lines
6.0 KiB
C++
Raw Normal View History

#ifndef CREATURELIB_SCRIPT_HPP
#define CREATURELIB_SCRIPT_HPP
#include "../../Library/EffectParameter.hpp"
2020-04-09 16:19:21 +00:00
namespace CreatureLib::Battling {
class BaseTurnChoice;
2019-11-23 10:53:00 +00:00
class AttackTurnChoice;
class SwitchTurnChoice;
class FleeTurnChoice;
2019-11-09 11:15:45 +00:00
class ExecutingAttack;
class Creature;
class BattleScript {
public:
BattleScript() = default;
NO_COPY_OR_MOVE(BattleScript);
virtual ~BattleScript() = default;
virtual BattleScript* Clone() = 0;
virtual void Stack(){};
virtual void OnRemove(){};
[[nodiscard]] virtual const ArbUt::StringView& GetName() const noexcept = 0;
2019-11-09 11:15:45 +00:00
2020-07-17 11:12:21 +00:00
virtual void
OnInitialize([[maybe_unused]] const ArbUt::List<CreatureLib::Library::EffectParameter*>& parameters){};
virtual void OnBeforeTurn([[maybe_unused]] const BaseTurnChoice* choice){};
2019-11-23 10:53:00 +00:00
2020-07-17 11:12:21 +00:00
virtual void ChangePriority([[maybe_unused]] AttackTurnChoice* choice, [[maybe_unused]] int8_t* priority){};
virtual void ChangeAttack([[maybe_unused]] AttackTurnChoice* choice,
[[maybe_unused]] ArbUt::StringView* outAttack){};
virtual void ModifyNumberOfHits([[maybe_unused]] AttackTurnChoice* choice, [[maybe_unused]] u8* numberOfHits){};
2020-07-17 11:12:21 +00:00
virtual void PreventAttack([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] bool* outResult){};
virtual void FailAttack([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] bool* outFailed){};
virtual void StopBeforeAttack([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] bool* outResult){};
virtual void OnBeforeAttack([[maybe_unused]] ExecutingAttack* attack){};
2019-11-23 10:53:00 +00:00
2020-07-17 11:12:21 +00:00
virtual void FailIncomingAttack([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target,
[[maybe_unused]] bool* outResult){};
virtual void IsInvulnerable([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target,
[[maybe_unused]] bool* outResult){};
virtual void OnAttackMiss([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target){};
virtual void ChangeAttackType([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target,
[[maybe_unused]] u8 hitNumber, [[maybe_unused]] u8* outType){};
2020-07-17 11:12:21 +00:00
virtual void ChangeEffectiveness([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target,
[[maybe_unused]] u8 hitNumber, [[maybe_unused]] float* effectiveness){};
2020-02-19 09:12:36 +00:00
2020-07-17 11:12:21 +00:00
virtual void OverrideBasePower([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target,
[[maybe_unused]] u8 hitIndex, [[maybe_unused]] u8* basePower){};
2020-07-17 11:12:21 +00:00
virtual void ChangeDamageStatsUser([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target,
[[maybe_unused]] u8 hitIndex, [[maybe_unused]] Creature** statsUser){};
2020-02-19 09:12:36 +00:00
2020-07-17 11:12:21 +00:00
virtual void BypassDefensiveStat([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target,
[[maybe_unused]] u8 hitIndex, [[maybe_unused]] bool* bypass){};
2020-07-17 11:12:21 +00:00
virtual void BypassOffensiveStat([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target,
[[maybe_unused]] u8 hitIndex, [[maybe_unused]] bool* bypass){};
2020-07-17 11:12:21 +00:00
virtual void ModifyStatModifier([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target,
[[maybe_unused]] u8 hitIndex, [[maybe_unused]] float* modifier){};
2020-07-17 11:12:21 +00:00
virtual void ModifyDamageModifier([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target,
[[maybe_unused]] u8 hitIndex, [[maybe_unused]] float* modifier){};
2020-07-17 11:12:21 +00:00
virtual void OverrideDamage([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target,
[[maybe_unused]] u8 hitIndex, [[maybe_unused]] u32* damage){};
2020-02-19 09:12:36 +00:00
2020-07-17 11:12:21 +00:00
virtual void PreventSecondaryEffects([[maybe_unused]] const ExecutingAttack* attack,
[[maybe_unused]] Creature* target, [[maybe_unused]] u8 hitNumber,
2020-07-17 11:12:21 +00:00
[[maybe_unused]] bool* outResult){};
virtual void OnSecondaryEffect([[maybe_unused]] const ExecutingAttack* attack,
[[maybe_unused]] Creature* target, [[maybe_unused]] u8 hitNumber){};
2019-11-09 11:55:48 +00:00
2020-07-17 11:12:21 +00:00
virtual void OnAfterHits([[maybe_unused]] const ExecutingAttack* attack, [[maybe_unused]] Creature* target){};
2020-07-17 11:12:21 +00:00
virtual void PreventSelfSwitch([[maybe_unused]] const SwitchTurnChoice* choice,
[[maybe_unused]] bool* outResult){};
virtual void PreventOpponentSwitch([[maybe_unused]] const SwitchTurnChoice* choice,
[[maybe_unused]] bool* outResult){};
2020-07-17 11:12:21 +00:00
virtual void ModifyEffectChance([[maybe_unused]] const ExecutingAttack* attack,
[[maybe_unused]] Creature* target, [[maybe_unused]] float* chance){};
virtual void ModifyIncomingEffectChance([[maybe_unused]] const ExecutingAttack* attack,
[[maybe_unused]] Creature* target, [[maybe_unused]] float* chance){};
virtual void OnFail([[maybe_unused]] Creature* target){};
virtual void OnOpponentFail([[maybe_unused]] Creature* target){};
virtual void PreventRunAway([[maybe_unused]] const FleeTurnChoice* choice, [[maybe_unused]] bool* result){};
virtual void PreventOpponentRunAway([[maybe_unused]] const FleeTurnChoice* choice,
[[maybe_unused]] bool* result){};
virtual void OnEndTurn([[maybe_unused]] Creature* creature){};
};
}
#endif // CREATURELIB_SCRIPT_HPP