mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-25 19:17:45 +00:00
pld oath gauge
This commit is contained in:
parent
93479a9c75
commit
0903f0d2f1
4 changed files with 45 additions and 1 deletions
|
@ -586,7 +586,7 @@ namespace Sapphire::Common
|
|||
// DRKGauge = 25,
|
||||
// AetherflowStack = 30,
|
||||
// Status = 32,
|
||||
// PLDGauge = 41,
|
||||
PLDGauge = 41,
|
||||
// RDMGaugeBoth = 74,
|
||||
//// RDMGaugeBlack = 75, // not right?
|
||||
// DRGGauge3Eyes = 76,
|
||||
|
|
|
@ -483,6 +483,17 @@ void Action::Action::buildEffects()
|
|||
actor->onActionHostile( m_pSource );
|
||||
dmg.first = actor->applyShieldProtection( dmg.first );
|
||||
m_effectBuilder->damage( actor, actor, dmg.first, dmg.second, dmg.first == 0 ? Common::ActionEffectResultFlag::Absorbed : Common::ActionEffectResultFlag::None );
|
||||
|
||||
if( m_isAutoAttack && m_pSource->isPlayer() )
|
||||
{
|
||||
if( auto player = m_pSource->getAsPlayer() )
|
||||
{
|
||||
if( player->getClass() == Common::ClassJob::Paladin )
|
||||
{
|
||||
player->gaugePldSetOath( std::min( 100, player->gaugePldGetOath() + 5 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto reflectDmg = Math::CalcStats::calcDamageReflect( m_pSource, actor, dmg.first,
|
||||
|
@ -737,6 +748,23 @@ bool Action::Action::primaryCostCheck( bool subtractCosts )
|
|||
return false;
|
||||
}
|
||||
|
||||
case Common::ActionPrimaryCostType::PLDGauge:
|
||||
{
|
||||
auto pPlayer = m_pSource->getAsPlayer();
|
||||
if( pPlayer )
|
||||
{
|
||||
auto oath = pPlayer->gaugePldGetOath();
|
||||
if( oath >= m_primaryCost )
|
||||
{
|
||||
if( subtractCosts )
|
||||
pPlayer->gaugePldSetOath( oath - m_primaryCost );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// free casts, likely just pure ogcds
|
||||
case Common::ActionPrimaryCostType::None:
|
||||
{
|
||||
|
|
|
@ -2203,6 +2203,19 @@ void Sapphire::Entity::Player::gaugeWarSetIb( uint8_t value )
|
|||
}
|
||||
|
||||
uint8_t Sapphire::Entity::Player::gaugeWarGetIb()
|
||||
{
|
||||
return gaugeGet( 0 );
|
||||
}
|
||||
|
||||
void Sapphire::Entity::Player::gaugePldSetOath( uint8_t value )
|
||||
{
|
||||
auto oldValue = gaugePldGetOath();
|
||||
gaugeSet( 0, value );
|
||||
if( oldValue != value )
|
||||
sendActorGauge();
|
||||
}
|
||||
|
||||
uint8_t Sapphire::Entity::Player::gaugePldGetOath()
|
||||
{
|
||||
return gaugeGet( 0 );
|
||||
}
|
|
@ -983,6 +983,9 @@ namespace Sapphire::Entity
|
|||
void gaugeWarSetIb( uint8_t value );
|
||||
uint8_t gaugeWarGetIb();
|
||||
|
||||
void gaugePldSetOath( uint8_t value );
|
||||
uint8_t gaugePldGetOath();
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Common::HuntingLogEntry& getHuntingLogEntry( uint8_t index );
|
||||
|
|
Loading…
Add table
Reference in a new issue