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

Method ApplyDefEffect

src/game_battlealgorithm.cpp:235–256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233}
234
235int Game_BattleAlgorithm::AlgorithmBase::ApplyDefEffect() {
236 auto* target = GetTarget();
237 assert(target);
238 auto def = GetAffectedDef();
239 if (def != 0) {
240 def = target->ChangeDefModifier(def);
241 if (IsAbsorbDef()) {
242 source->ChangeDefModifier(-def);
243 }
244
245 Game_Battle::ManiacBattleHook(
246 Game_Interpreter_Battle::ManiacBattleHookType::StatChange,
247 target->GetType() == Game_Battler::Type_Enemy,
248 target->GetPartyIndex(),
249 target->GetDisplayX(),
250 target->GetDisplayY(),
251 5,
252 def
253 );
254 }
255 return def;
256}
257
258int Game_BattleAlgorithm::AlgorithmBase::ApplySpiEffect() {
259 auto* target = GetTarget();

Calls 5

ChangeDefModifierMethod · 0.80
GetPartyIndexMethod · 0.80
GetTypeMethod · 0.45
GetDisplayXMethod · 0.45
GetDisplayYMethod · 0.45

Tested by

no test coverage detected