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

Method ApplySpEffect

src/game_battlealgorithm.cpp:187–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185}
186
187int Game_BattleAlgorithm::AlgorithmBase::ApplySpEffect() {
188 auto* target = GetTarget();
189 assert(target);
190 auto sp = GetAffectedSp();
191 if (sp != 0) {
192 sp = target->ChangeSp(sp);
193 if (IsAbsorbSp()) {
194 // Only absorb the sp that were left
195 source->ChangeSp(-sp);
196 }
197
198 Game_Battle::ManiacBattleHook(
199 Game_Interpreter_Battle::ManiacBattleHookType::StatChange,
200 target->GetType() == Game_Battler::Type_Enemy,
201 target->GetPartyIndex(),
202 target->GetDisplayX(),
203 target->GetDisplayY(),
204 3,
205 sp
206 );
207 }
208
209 return sp;
210}
211
212int Game_BattleAlgorithm::AlgorithmBase::ApplyAtkEffect() {
213 auto* target = GetTarget();

Calls 5

ChangeSpMethod · 0.80
GetPartyIndexMethod · 0.80
GetTypeMethod · 0.45
GetDisplayXMethod · 0.45
GetDisplayYMethod · 0.45

Tested by

no test coverage detected