| 80 | }; |
| 81 | |
| 82 | class AlgorithmBase { |
| 83 | public: |
| 84 | virtual ~AlgorithmBase() {} |
| 85 | |
| 86 | /** @return the category associated with this action */ |
| 87 | virtual int GetActionType(); |
| 88 | |
| 89 | /** @return the unique identifier associated with this specific action */ |
| 90 | virtual int GetActionId(); |
| 91 | |
| 92 | /** @return the source of the battle action. */ |
| 93 | Game_Battler* GetSource() const; |
| 94 | |
| 95 | /** @return current target battler */ |
| 96 | Game_Battler* GetTarget() const; |
| 97 | |
| 98 | /** @return If the action was reflected, returns the target which triggered the reflect */ |
| 99 | Game_Battler* GetReflectTarget() const; |
| 100 | |
| 101 | /** @return true if this algorithm targets a party */ |
| 102 | Game_Party_Base* GetOriginalPartyTarget() const; |
| 103 | |
| 104 | /** @return the original targets of the action before reflect or other modifications */ |
| 105 | Span<Game_Battler* const> GetOriginalTargets() const; |
| 106 | |
| 107 | /** @return If the action originally had a single target, return that target. Otherwise return nullptr */ |
| 108 | Game_Battler* GetOriginalSingleTarget() const; |
| 109 | |
| 110 | /** @return the current repetition of the algorithm */ |
| 111 | int GetCurrentRepeat() const; |
| 112 | |
| 113 | /** @return the total number of times this algo will repeat */ |
| 114 | int GetTotalRepetitions() const; |
| 115 | |
| 116 | /** Initializes targetting and performs any initial actions such as sp cost reduction for the user. */ |
| 117 | void Start(); |
| 118 | |
| 119 | /** |
| 120 | * If IsReflected(target) true on any target, will reflect the action back on the source or the source's party. |
| 121 | * |
| 122 | * @return true if this algo was reflected. |
| 123 | */ |
| 124 | bool ReflectTargets(); |
| 125 | |
| 126 | /** |
| 127 | * Add a new target to the algo. |
| 128 | * |
| 129 | * @param target the target to add |
| 130 | * @param set_current Whether or not to reset the current target to this one |
| 131 | */ |
| 132 | void AddTarget(Game_Battler* target, bool set_current); |
| 133 | |
| 134 | /** |
| 135 | * Add all party targets to the algo. |
| 136 | * |
| 137 | * @param targets the party to add |
| 138 | * @param set_current Whether or not to reset the current target to the first member of the party |
| 139 | */ |
nothing calls this directly
no outgoing calls
no test coverage detected