2017-11-21 03:19:08 -02:00
|
|
|
#include <cmath>
|
|
|
|
|
2018-03-06 22:22:19 +01:00
|
|
|
#include <Exd/ExdDataGenerated.h>
|
|
|
|
#include <Common.h>
|
2018-03-02 07:22:25 -03:00
|
|
|
|
2018-02-20 22:46:44 +01:00
|
|
|
#include "Actor/Chara.h"
|
2018-03-06 00:10:36 +01:00
|
|
|
|
2017-12-08 15:38:25 +01:00
|
|
|
#include "Actor/Player.h"
|
2018-03-02 07:22:25 -03:00
|
|
|
|
2017-11-21 03:19:08 -02:00
|
|
|
#include "CalcBattle.h"
|
2018-03-02 07:22:25 -03:00
|
|
|
#include "Framework.h"
|
2017-11-21 03:19:08 -02:00
|
|
|
|
2018-03-09 00:06:44 +01:00
|
|
|
extern Core::Framework g_fw;
|
2017-11-21 03:19:08 -02:00
|
|
|
|
|
|
|
using namespace Core::Math;
|
|
|
|
using namespace Core::Entity;
|
|
|
|
|
|
|
|
/*
|
|
|
|
Class used for battle-related formulas and calculations.
|
|
|
|
Big thanks to the Theoryjerks group!
|
|
|
|
|
|
|
|
NOTE:
|
|
|
|
Formulas here shouldn't be considered final. It's possible that the formula it was based on is correct but
|
|
|
|
wasn't implemented correctly here, or approximated things due to limited knowledge of how things work in retail.
|
|
|
|
It's also possible that we're using formulas that were correct for previous patches, but not the current version.
|
|
|
|
|
|
|
|
TODO:
|
|
|
|
|
|
|
|
Damage outgoing calculations. This includes auto-attacks, etc.
|
|
|
|
More formulas in general. Most of it was moved to another class, but work can be done in this area as well already.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
uint32_t CalcBattle::calculateHealValue( PlayerPtr pPlayer, uint32_t potency )
|
|
|
|
{
|
2018-08-29 21:40:59 +02:00
|
|
|
auto pExdData = g_fw.get< Data::ExdDataGenerated >();
|
|
|
|
auto classInfo = pExdData->get< Core::Data::ClassJob >( static_cast< uint8_t >( pPlayer->getClass() ) );
|
|
|
|
auto paramGrowthInfo = pExdData->get< Core::Data::ParamGrow >( pPlayer->getLevel() );
|
2017-11-21 03:19:08 -02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
if( !classInfo || !paramGrowthInfo )
|
|
|
|
return 0;
|
2017-11-21 03:19:08 -02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
//auto jobModVal = classInfoIt->second;
|
2017-11-21 03:19:08 -02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
// consider 3% variation
|
|
|
|
return potency / 10;
|
2017-12-08 15:38:25 +01:00
|
|
|
}
|