1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-25 19:17:45 +00:00

prep for gnb implementation

This commit is contained in:
collett 2020-04-09 04:44:29 +09:00
parent 8a6651d4cb
commit a2fd6eda58
4 changed files with 36 additions and 1 deletions

View file

@ -587,6 +587,7 @@ namespace Sapphire::Common
// AetherflowStack = 30, // AetherflowStack = 30,
// Status = 32, // Status = 32,
PLDGauge = 41, PLDGauge = 41,
GNBAmmo = 55,
WHMBloodLily = 56, WHMBloodLily = 56,
WHMLily = 57, WHMLily = 57,
// RDMGaugeBoth = 74, // RDMGaugeBoth = 74,

View file

@ -947,6 +947,23 @@ bool Action::Action::primaryCostCheck( bool subtractCosts )
return false; return false;
} }
case Common::ActionPrimaryCostType::GNBAmmo:
{
auto pPlayer = m_pSource->getAsPlayer();
if( pPlayer )
{
auto ammo = pPlayer->gaugeGnbGetAmmo();
if( ammo >= m_primaryCost )
{
if( subtractCosts )
pPlayer->gaugeGnbSetAmmo( ammo - m_primaryCost );
return true;
}
}
return false;
}
// free casts, likely just pure ogcds // free casts, likely just pure ogcds
case Common::ActionPrimaryCostType::None: case Common::ActionPrimaryCostType::None:
{ {

View file

@ -2419,4 +2419,18 @@ void Sapphire::Entity::Player::gaugeDrkSetShadowTimer( uint16_t value, bool send
uint16_t Sapphire::Entity::Player::gaugeDrkGetShadowTimer() uint16_t Sapphire::Entity::Player::gaugeDrkGetShadowTimer()
{ {
return m_gauge.drk.shadowTimer; return m_gauge.drk.shadowTimer;
} }
void Sapphire::Entity::Player::gaugeGnbSetAmmo( uint8_t value )
{
assert( value >= 0 && value <= 2 );
auto oldValue = gaugeGnbGetAmmo();
m_gauge.gnb.ammo = value;
if( oldValue != value )
sendActorGauge();
}
uint8_t Sapphire::Entity::Player::gaugeGnbGetAmmo()
{
return m_gauge.gnb.ammo;
}

View file

@ -1001,6 +1001,9 @@ namespace Sapphire::Entity
void gaugeDrkSetShadowTimer( uint16_t value, bool sendPacket = false ); void gaugeDrkSetShadowTimer( uint16_t value, bool sendPacket = false );
uint16_t gaugeDrkGetShadowTimer(); uint16_t gaugeDrkGetShadowTimer();
void gaugeGnbSetAmmo( uint8_t value );
uint8_t gaugeGnbGetAmmo();
////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////
Common::HuntingLogEntry& getHuntingLogEntry( uint8_t index ); Common::HuntingLogEntry& getHuntingLogEntry( uint8_t index );