persona-3-dual
A DS demake of Persona 3
Loading...
Searching...
No Matches
BattleCalcs.hpp
Go to the documentation of this file.
1#pragma once
3#include "../BattleStats.hpp"
5#include "../party/Player.hpp"
6#include "../shoes/Shoe.hpp"
8#include "Skill.hpp"
9#include <algorithm>
10#include <cmath>
11#include <nds.h>
12#include <string>
13
28
30{
39 static u32 attack(BattleParticipant& attacker, BattleParticipant& defender, Skill& skill);
40
49 static bool hit(BattleParticipant& attacker, BattleParticipant& defender, Skill& skill);
50
58 static u32 healing(BattleParticipant& user, Skill& skill);
59
70 static u32 allOutAttack(Player& attacker, BattleParticipant& defender, u32 participantCount);
71
79 static u32 getAtk(BattleStats& attackerStats, Skill& skill);
80
88 static ae::q20_12_t getLevelDifference(u32 attackerLevel, u32 defenderLevel);
89
91 * @brief Calculate damage multiplier based on resistance & skill affinity.
92 *
93 * @param battleStats Stats to check resistance to the skills affinity.
94 * @param skill Skil to get affinity from.
95 * @return Multiplier for damage.
96 */
97 static ae::q20_12_t getAffinityMtp(BattleStats& battleStats, Skill& skill);
99 private:
106 static uint8_t getMagicBoostHeal(uint8_t& magic);
107
108 //Attack
109 static const ae::q20_12_t levelMultipliers[24];
110
111 //Heal
112 static const uint8_t magicBoostTableHeal[20];
113};
various calculations used in Battle
static ae::q20_12_t getLevelDifference(u32 attackerLevel, u32 defenderLevel)
Gets a multiplier used for damage calcs based on an arbitrary hardcoded table.
static uint8_t getMagicBoostHeal(uint8_t &magic)
Calculate healing bonus based on an arbitrary hardcoded table.
static u32 healing(BattleParticipant &user, Skill &skill)
Calculates heal of a skill.
static u32 allOutAttack(Player &attacker, BattleParticipant &defender, u32 participantCount)
Calculates damage of an All out attack.
static const ae::q20_12_t levelMultipliers[24]
static ae::q20_12_t getAffinityMtp(BattleStats &battleStats, Skill &skill)
Calculate damage multiplier based on resistance & skill affinity.
static bool hit(BattleParticipant &attacker, BattleParticipant &defender, Skill &skill)
Calculates if a skill hit the target.
static const uint8_t magicBoostTableHeal[20]
static u32 attack(BattleParticipant &attacker, BattleParticipant &defender, Skill &skill)
Calculates damage of an attack.
static u32 getAtk(BattleStats &attackerStats, Skill &skill)
Gets correct stat for damage calculations based on skill type.
Participant of battle.
Basic stats / affinities. Used by Personas or directly by Enemies.