CreatureLib/src/Battling/ScriptHandling/BattleScript.hpp

97 lines
6.0 KiB
C++

#ifndef CREATURELIB_SCRIPT_HPP
#define CREATURELIB_SCRIPT_HPP
#include "../../Library/EffectParameter.hpp"
namespace CreatureLib::Battling {
class BaseTurnChoice;
class AttackTurnChoice;
class SwitchTurnChoice;
class FleeTurnChoice;
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;
virtual void
OnInitialize([[maybe_unused]] const ArbUt::List<CreatureLib::Library::EffectParameter*>& parameters){};
virtual void OnBeforeTurn([[maybe_unused]] const BaseTurnChoice* choice){};
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){};
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){};
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){};
virtual void ChangeEffectiveness([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target,
[[maybe_unused]] u8 hitNumber, [[maybe_unused]] float* effectiveness){};
virtual void OverrideBasePower([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target,
[[maybe_unused]] u8 hitIndex, [[maybe_unused]] u8* basePower){};
virtual void ChangeDamageStatsUser([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target,
[[maybe_unused]] u8 hitIndex, [[maybe_unused]] Creature** statsUser){};
virtual void BypassDefensiveStat([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target,
[[maybe_unused]] u8 hitIndex, [[maybe_unused]] bool* bypass){};
virtual void BypassOffensiveStat([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target,
[[maybe_unused]] u8 hitIndex, [[maybe_unused]] bool* bypass){};
virtual void ModifyStatModifier([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target,
[[maybe_unused]] u8 hitIndex, [[maybe_unused]] float* modifier){};
virtual void ModifyDamageModifier([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target,
[[maybe_unused]] u8 hitIndex, [[maybe_unused]] float* modifier){};
virtual void OverrideDamage([[maybe_unused]] ExecutingAttack* attack, [[maybe_unused]] Creature* target,
[[maybe_unused]] u8 hitIndex, [[maybe_unused]] u32* damage){};
virtual void PreventSecondaryEffects([[maybe_unused]] const ExecutingAttack* attack,
[[maybe_unused]] Creature* target, [[maybe_unused]] u8 hitNumber,
[[maybe_unused]] bool* outResult){};
virtual void OnSecondaryEffect([[maybe_unused]] const ExecutingAttack* attack,
[[maybe_unused]] Creature* target, [[maybe_unused]] u8 hitNumber){};
virtual void OnAfterHits([[maybe_unused]] const ExecutingAttack* attack, [[maybe_unused]] Creature* target){};
virtual void PreventSelfSwitch([[maybe_unused]] const SwitchTurnChoice* choice,
[[maybe_unused]] bool* outResult){};
virtual void PreventOpponentSwitch([[maybe_unused]] const SwitchTurnChoice* choice,
[[maybe_unused]] bool* outResult){};
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