Renamed Script --> BattleScript, some cleanup on it.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
@@ -12,7 +12,7 @@ namespace CreatureLib::Battling {
|
||||
class AttackTurnChoice : public BaseTurnChoice {
|
||||
ArbUt::BorrowedPtr<LearnedAttack> _attack;
|
||||
CreatureIndex _target;
|
||||
std::unique_ptr<Script> _attackScript = nullptr;
|
||||
std::unique_ptr<BattleScript> _attackScript = nullptr;
|
||||
int8_t _priority = 0;
|
||||
|
||||
void ResolveScript() {
|
||||
@@ -24,8 +24,8 @@ namespace CreatureLib::Battling {
|
||||
if (_attack->GetAttack()->HasSecondaryEffect()) {
|
||||
auto library = battle.GetValue()->GetLibrary();
|
||||
auto& effect = _attack->GetAttack()->GetSecondaryEffect();
|
||||
_attackScript =
|
||||
std::unique_ptr<Script>(library->LoadScript(ScriptCategory::Attack, effect->GetEffectName()));
|
||||
_attackScript = std::unique_ptr<BattleScript>(
|
||||
library->LoadScript(ScriptCategory::Attack, effect->GetEffectName()));
|
||||
if (_attackScript != nullptr) {
|
||||
_attackScript->OnInitialize(effect->GetParameters());
|
||||
}
|
||||
@@ -41,7 +41,7 @@ namespace CreatureLib::Battling {
|
||||
_priority = _attack->GetAttack()->GetPriority();
|
||||
}
|
||||
AttackTurnChoice(Creature* user, const ArbUt::BorrowedPtr<LearnedAttack>& attack, const CreatureIndex& target,
|
||||
Script* script)
|
||||
BattleScript* script)
|
||||
: BaseTurnChoice(user), _attack(attack), _target(target), _attackScript(script) {
|
||||
_priority = _attack->GetAttack()->GetPriority();
|
||||
}
|
||||
@@ -57,7 +57,7 @@ namespace CreatureLib::Battling {
|
||||
|
||||
const CreatureIndex& GetTarget() const noexcept { return _target; }
|
||||
|
||||
const std::unique_ptr<Script>& GetAttackScript() const noexcept { return _attackScript; }
|
||||
const std::unique_ptr<BattleScript>& GetAttackScript() const noexcept { return _attackScript; }
|
||||
size_t ScriptCount() const override { return 1 + GetUser()->ScriptCount(); }
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user