mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-01 08:27:46 +00:00
Some calculation work
This commit is contained in:
parent
9b3e793a5c
commit
83590fc5cf
1 changed files with 9 additions and 2 deletions
|
@ -144,12 +144,15 @@ uint32_t CalcStats::calculateMaxHp( Player& player )
|
|||
uint16_t hpMod = paramGrowthInfo->data().ParamBase;
|
||||
uint16_t jobModHp = classInfo->data().Hp;
|
||||
float approxBaseHp = 0.0f; // Read above
|
||||
float hpModPercent = player.getModifier( Common::ParamModifier::HPPercent );
|
||||
|
||||
approxBaseHp = static_cast< float >( levelTable[ level ][ Common::LevelTableEntry::HP ] );
|
||||
|
||||
auto result = static_cast< uint32_t >( floor( jobModHp * ( approxBaseHp / 100.0f ) ) +
|
||||
floor( hpMod / 100.0f * ( vitStat - baseStat ) ) );
|
||||
|
||||
result *= hpModPercent;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -624,6 +627,7 @@ std::pair< float, Sapphire::Common::ActionHitSeverityType > CalcStats::calcActio
|
|||
auto wd = weaponDamage( chara, wepDmg );
|
||||
auto ap = getPrimaryAttackPower( chara );
|
||||
auto det = determination( chara );
|
||||
auto damageDealtMod = chara.getModifier( Common::ParamModifier::DamageDealtPercent );
|
||||
|
||||
auto factor = Common::Util::trunc( pot * wd * ap * det, 0 );
|
||||
Sapphire::Common::ActionHitSeverityType hitType = Sapphire::Common::ActionHitSeverityType::NormalDamage;
|
||||
|
@ -646,11 +650,14 @@ std::pair< float, Sapphire::Common::ActionHitSeverityType > CalcStats::calcActio
|
|||
|
||||
// todo: buffs
|
||||
|
||||
factor *= damageDealtMod;
|
||||
|
||||
constexpr auto format = "dmg: pot: {} ({}) wd: {} ({}) ap: {} det: {} = {}";
|
||||
|
||||
if( auto player = const_cast< Entity::Chara& >( chara ).getAsPlayer() )
|
||||
{
|
||||
PlayerMgr::sendDebug( *player, format, pot, ptc, wd, wepDmg, ap, det, factor );
|
||||
PlayerMgr::sendDebug( *player, "DamageDealtPercent: {}", damageDealtMod );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue