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

Function SetStateRestrictedAction

src/enemyai.cpp:359–381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

357}
358
359bool SetStateRestrictedAction(Game_Enemy& source) {
360 if (!source.CanAct()) {
361 source.SetBattleAlgorithm(std::make_shared<Game_BattleAlgorithm::None>(&source));
362 return true;
363 }
364
365 if (source.GetSignificantRestriction() == lcf::rpg::State::Restriction_attack_ally) {
366 source.SetBattleAlgorithm(MakeAttackAllies(source, 1));
367 return true;
368 }
369
370 if (source.GetSignificantRestriction() == lcf::rpg::State::Restriction_attack_enemy) {
371 source.SetBattleAlgorithm(MakeAttack(source, 1));
372 return true;
373 }
374
375 if (source.IsCharged()) {
376 source.SetBattleAlgorithm(MakeAttack(source, 1));
377 return true;
378 }
379
380 return false;
381}
382
383} // namespace EnemyAi

Callers 3

CreateEnemyActionsMethod · 0.85
CreateEnemyActionsMethod · 0.85
enemyai.cppFile · 0.85

Calls 6

MakeAttackAlliesFunction · 0.85
MakeAttackFunction · 0.85
CanActMethod · 0.80
SetBattleAlgorithmMethod · 0.80
IsChargedMethod · 0.80

Tested by

no test coverage detected