MCPcopy Create free account
hub / github.com/EasyRPG/Player / MakeAction

Function MakeAction

src/enemyai.cpp:140–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140static std::shared_ptr<Game_BattleAlgorithm::AlgorithmBase> MakeAction(Game_Enemy& enemy, const lcf::rpg::EnemyAction& action, bool emulate_bugs) {
141 switch (action.kind) {
142 case lcf::rpg::EnemyAction::Kind_basic:
143 return MakeBasicAction(enemy, action);
144 case lcf::rpg::EnemyAction::Kind_skill:
145 return MakeSkillAction(enemy, action, emulate_bugs);
146 case lcf::rpg::EnemyAction::Kind_transformation:
147 return std::make_shared<Game_BattleAlgorithm::Transform>(&enemy, action.enemy_id);
148 }
149 return nullptr;
150}
151
152void SetEnemyAction(Game_Enemy& enemy, const lcf::rpg::EnemyAction& action, bool emulate_bugs) {
153 auto algo = MakeAction(enemy, action, emulate_bugs);

Callers 1

SetEnemyActionFunction · 0.85

Calls 2

MakeBasicActionFunction · 0.85
MakeSkillActionFunction · 0.85

Tested by

no test coverage detected