mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-25 19:17:45 +00:00
some sam stuff
This commit is contained in:
parent
e265ce98e9
commit
b55e44c0db
8 changed files with 91 additions and 4 deletions
|
@ -586,6 +586,7 @@ namespace Sapphire::Common
|
||||||
DRKGauge = 25,
|
DRKGauge = 25,
|
||||||
// AetherflowStack = 30,
|
// AetherflowStack = 30,
|
||||||
// Status = 32,
|
// Status = 32,
|
||||||
|
SAMKenki = 39,
|
||||||
PLDGauge = 41,
|
PLDGauge = 41,
|
||||||
GNBAmmo = 55,
|
GNBAmmo = 55,
|
||||||
WHMBloodLily = 56,
|
WHMBloodLily = 56,
|
||||||
|
@ -1049,6 +1050,7 @@ namespace Sapphire::Common
|
||||||
InstantCast = 13,
|
InstantCast = 13,
|
||||||
BlockParryRateBonus = 14,
|
BlockParryRateBonus = 14,
|
||||||
MPRestorePerGCD = 15,
|
MPRestorePerGCD = 15,
|
||||||
|
AlwaysCombo = 16,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class ActionTypeFilter : int32_t
|
enum class ActionTypeFilter : int32_t
|
||||||
|
|
|
@ -54,7 +54,8 @@ Action::Action::Action( Entity::CharaPtr caster, uint32_t actionId, uint16_t seq
|
||||||
m_sequence( sequence ),
|
m_sequence( sequence ),
|
||||||
m_isAutoAttack( false ),
|
m_isAutoAttack( false ),
|
||||||
m_disableGenericHandler( false ),
|
m_disableGenericHandler( false ),
|
||||||
m_started( false )
|
m_started( false ),
|
||||||
|
m_shouldAlwaysCombo( false )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -799,6 +800,9 @@ void Action::Action::setAdditionalData( uint32_t data )
|
||||||
|
|
||||||
bool Action::Action::isCorrectCombo() const
|
bool Action::Action::isCorrectCombo() const
|
||||||
{
|
{
|
||||||
|
if( m_shouldAlwaysCombo )
|
||||||
|
return true;
|
||||||
|
|
||||||
auto lastActionId = m_pSource->getLastComboActionId();
|
auto lastActionId = m_pSource->getLastComboActionId();
|
||||||
|
|
||||||
if( lastActionId == 0 )
|
if( lastActionId == 0 )
|
||||||
|
@ -814,6 +818,11 @@ bool Action::Action::isComboAction() const
|
||||||
return m_actionData->actionCombo != 0;
|
return m_actionData->actionCombo != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Sapphire::World::Action::Action::setAlwaysCombo()
|
||||||
|
{
|
||||||
|
m_shouldAlwaysCombo = true;
|
||||||
|
}
|
||||||
|
|
||||||
bool Action::Action::primaryCostCheck( bool subtractCosts )
|
bool Action::Action::primaryCostCheck( bool subtractCosts )
|
||||||
{
|
{
|
||||||
switch( m_primaryCostType )
|
switch( m_primaryCostType )
|
||||||
|
@ -969,6 +978,23 @@ bool Action::Action::primaryCostCheck( bool subtractCosts )
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case Common::ActionPrimaryCostType::SAMKenki:
|
||||||
|
{
|
||||||
|
auto pPlayer = m_pSource->getAsPlayer();
|
||||||
|
if( pPlayer )
|
||||||
|
{
|
||||||
|
auto kenki = pPlayer->gaugeSamGetKenki();
|
||||||
|
if( kenki >= m_primaryCost )
|
||||||
|
{
|
||||||
|
if( subtractCosts )
|
||||||
|
pPlayer->gaugeSamSetKenki( kenki - 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:
|
||||||
{
|
{
|
||||||
|
|
|
@ -52,6 +52,8 @@ namespace Sapphire::World::Action
|
||||||
|
|
||||||
bool isComboAction() const;
|
bool isComboAction() const;
|
||||||
|
|
||||||
|
void setAlwaysCombo();
|
||||||
|
|
||||||
void setAutoAttack();
|
void setAutoAttack();
|
||||||
|
|
||||||
void disableGenericHandler();
|
void disableGenericHandler();
|
||||||
|
@ -202,6 +204,7 @@ namespace Sapphire::World::Action
|
||||||
bool m_isAutoAttack;
|
bool m_isAutoAttack;
|
||||||
bool m_disableGenericHandler;
|
bool m_disableGenericHandler;
|
||||||
bool m_started;
|
bool m_started;
|
||||||
|
bool m_shouldAlwaysCombo;
|
||||||
|
|
||||||
Common::ActionInterruptType m_interruptType;
|
Common::ActionInterruptType m_interruptType;
|
||||||
|
|
||||||
|
|
|
@ -878,8 +878,8 @@ ActionLut::Lut ActionLut::m_actionLut =
|
||||||
{ 7480, { 100, 360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
|
{ 7480, { 100, 360, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
|
||||||
|
|
||||||
//Meikyo Shisui, 明鏡止水
|
//Meikyo Shisui, 明鏡止水
|
||||||
//applies to self: Meikyo Shisui, 明鏡止水, duration 15000, param 0
|
//applies to self: Meikyo Shisui, 明鏡止水, duration 15000, param 3
|
||||||
{ 7499, { 0, 0, 0, 0, 1233, 15000, 0, 0, 0, 0, 0, 0, 0 } },
|
{ 7499, { 0, 0, 0, 0, 1233, 15000, 3, 0, 0, 0, 0, 0, 0 } },
|
||||||
|
|
||||||
//Hissatsu: Kaiten, 必殺剣・回天
|
//Hissatsu: Kaiten, 必殺剣・回天
|
||||||
//applies to self: Kaiten, 必殺剣・回天, duration 10000, param 0
|
//applies to self: Kaiten, 必殺剣・回天, duration 10000, param 0
|
||||||
|
@ -3538,4 +3538,6 @@ ActionLut::StatusEffectTable ActionLut::m_statusEffectTable =
|
||||||
|
|
||||||
{ 1972, { 15, 2, 7392, 7391, 0 } },
|
{ 1972, { 15, 2, 7392, 7391, 0 } },
|
||||||
|
|
||||||
|
{ 1233, { 16, 3, 0, 0, 0 } },
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -2448,3 +2448,17 @@ uint8_t Sapphire::Entity::Player::gaugeGnbGetComboStep()
|
||||||
{
|
{
|
||||||
return m_gauge.gnb.ammoComboStep;
|
return m_gauge.gnb.ammoComboStep;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Sapphire::Entity::Player::gaugeSamSetKenki( uint8_t value )
|
||||||
|
{
|
||||||
|
assert( value >= 0 && value <= 100 );
|
||||||
|
auto oldValue = gaugeSamGetKenki();
|
||||||
|
m_gauge.sam.kenki = value;
|
||||||
|
if( oldValue != value )
|
||||||
|
sendActorGauge();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t Sapphire::Entity::Player::gaugeSamGetKenki()
|
||||||
|
{
|
||||||
|
return m_gauge.sam.kenki;
|
||||||
|
}
|
||||||
|
|
|
@ -1006,6 +1006,9 @@ namespace Sapphire::Entity
|
||||||
void gaugeGnbSetComboStep( uint8_t value );
|
void gaugeGnbSetComboStep( uint8_t value );
|
||||||
uint8_t gaugeGnbGetComboStep();
|
uint8_t gaugeGnbGetComboStep();
|
||||||
|
|
||||||
|
void gaugeSamSetKenki( uint8_t value );
|
||||||
|
uint8_t gaugeSamGetKenki();
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
Common::HuntingLogEntry& getHuntingLogEntry( uint8_t index );
|
Common::HuntingLogEntry& getHuntingLogEntry( uint8_t index );
|
||||||
|
|
|
@ -525,7 +525,7 @@ float CalcStats::autoAttack( const Sapphire::Entity::Chara& chara )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
weaponDamage = chara.getLevel() * 10;
|
weaponDamage = chara.getLevel() * 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto level = chara.getLevel();
|
auto level = chara.getLevel();
|
||||||
|
|
|
@ -299,6 +299,12 @@ void Sapphire::StatusEffect::StatusEffect::onBeforeActionStart( Sapphire::World:
|
||||||
}
|
}
|
||||||
if( m_effectEntry.effectValue1 > 0 )
|
if( m_effectEntry.effectValue1 > 0 )
|
||||||
{
|
{
|
||||||
|
// if stacks equal to remaining uses, assume it is synced
|
||||||
|
if( m_effectEntry.effectValue1 == m_param )
|
||||||
|
{
|
||||||
|
m_param--;
|
||||||
|
m_targetActor->sendStatusEffectUpdate();
|
||||||
|
}
|
||||||
m_effectEntry.effectValue1--;
|
m_effectEntry.effectValue1--;
|
||||||
if( m_effectEntry.effectValue1 == 0 )
|
if( m_effectEntry.effectValue1 == 0 )
|
||||||
{
|
{
|
||||||
|
@ -308,6 +314,37 @@ void Sapphire::StatusEffect::StatusEffect::onBeforeActionStart( Sapphire::World:
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case Common::StatusEffectType::AlwaysCombo:
|
||||||
|
{
|
||||||
|
if( action->isGCD() )
|
||||||
|
{
|
||||||
|
// value1: remaining uses
|
||||||
|
// value2-4: affected action ids, or all actions if value2 is 0
|
||||||
|
if( m_effectEntry.effectValue2 != 0 )
|
||||||
|
{
|
||||||
|
if( action->getId() != m_effectEntry.effectValue2 &&
|
||||||
|
action->getId() != m_effectEntry.effectValue3 &&
|
||||||
|
action->getId() != m_effectEntry.effectValue4 )
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if( m_effectEntry.effectValue1 > 0 )
|
||||||
|
{
|
||||||
|
// if stacks equal to remaining uses, assume it is synced
|
||||||
|
if( m_effectEntry.effectValue1 == m_param )
|
||||||
|
{
|
||||||
|
m_param--;
|
||||||
|
m_targetActor->sendStatusEffectUpdate();
|
||||||
|
}
|
||||||
|
m_effectEntry.effectValue1--;
|
||||||
|
if( m_effectEntry.effectValue1 == 0 )
|
||||||
|
{
|
||||||
|
markToRemove();
|
||||||
|
}
|
||||||
|
action->setAlwaysCombo();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue