2017-11-21 03:19:08 -02:00
|
|
|
#ifndef _CALCSTATS_H
|
|
|
|
#define _CALCSTATS_H
|
2017-08-20 02:46:06 -03:00
|
|
|
|
2018-03-06 22:22:19 +01:00
|
|
|
#include <Common.h>
|
2018-02-28 11:14:25 +01:00
|
|
|
#include "Forwards.h"
|
2017-08-20 02:46:06 -03:00
|
|
|
|
2018-11-29 16:55:48 +01:00
|
|
|
namespace Sapphire::Math
|
2018-08-29 21:40:59 +02:00
|
|
|
{
|
2017-08-20 02:46:06 -03:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
class CalcStats
|
|
|
|
{
|
|
|
|
public:
|
2018-11-29 16:55:48 +01:00
|
|
|
static float calculateBaseStat( Sapphire::Entity::PlayerPtr pPlayer );
|
2018-08-29 21:40:59 +02:00
|
|
|
|
2018-12-29 00:53:52 +01:00
|
|
|
static uint32_t calculateMaxMp( Sapphire::Entity::PlayerPtr pPlayer, FrameworkPtr pFw );
|
2018-08-29 21:40:59 +02:00
|
|
|
|
2018-12-29 00:53:52 +01:00
|
|
|
static uint32_t calculateMaxHp( Sapphire::Entity::PlayerPtr pPlayer, FrameworkPtr pFw );
|
2018-08-29 21:40:59 +02:00
|
|
|
|
2019-03-23 11:53:21 +11:00
|
|
|
/*!
|
|
|
|
* @brief Calculates the MP cost of a spell given its base cost
|
|
|
|
* @param chara The Chara that is casting the action
|
|
|
|
* @param baseCost The action cost
|
|
|
|
* @return The total MP to be consumed by a successful cast
|
|
|
|
*/
|
2019-03-23 11:48:49 +11:00
|
|
|
static uint16_t calculateMpCost( const Sapphire::Entity::Chara& chara, uint16_t baseCost );
|
|
|
|
|
2019-03-23 11:53:21 +11:00
|
|
|
/*!
|
|
|
|
* @brief Calculates the probability of a block happening
|
|
|
|
* @return
|
|
|
|
*/
|
2019-03-22 13:26:34 +01:00
|
|
|
static float pBlk( const Sapphire::Entity::Chara& );
|
2019-03-23 11:53:21 +11:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* @brief Calculates the probability of a direct hit happening
|
|
|
|
* @return
|
|
|
|
*/
|
2019-03-22 13:26:34 +01:00
|
|
|
static float pDhr( const Sapphire::Entity::Chara& );
|
2019-03-23 11:53:21 +11:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* @brief Calculates the probability of a critical hit happening
|
|
|
|
* @return
|
|
|
|
*/
|
2019-03-22 13:26:34 +01:00
|
|
|
static float pChr( const Sapphire::Entity::Chara& );
|
2019-03-23 11:48:49 +11:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
private:
|
|
|
|
|
|
|
|
};
|
2017-08-20 02:46:06 -03:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2017-12-08 15:38:25 +01:00
|
|
|
#endif
|