mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 22:57:45 +00:00
Add method to simplify applying statuses to self
This commit is contained in:
parent
6fce046225
commit
6cbf94d9c2
2 changed files with 11 additions and 4 deletions
|
@ -501,6 +501,14 @@ std::pair< uint32_t, Common::ActionHitSeverityType > Action::Action::calcHealing
|
||||||
return Math::CalcStats::calcActionHealing( *m_pSource, potency, wepDmg );
|
return Math::CalcStats::calcActionHealing( *m_pSource, potency, wepDmg );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Action::Action::applyStatusEffectSelf( uint16_t statusId, uint8_t param )
|
||||||
|
{
|
||||||
|
if( m_hitActors.size() > 0 )
|
||||||
|
getEffectbuilder()->applyStatusEffect( m_hitActors[ 0 ], statusId, param, true );
|
||||||
|
else
|
||||||
|
getEffectbuilder()->applyStatusEffect( m_pSource, statusId, param );
|
||||||
|
}
|
||||||
|
|
||||||
void Action::Action::handleAction()
|
void Action::Action::handleAction()
|
||||||
{
|
{
|
||||||
snapshotAffectedActors( m_hitActors );
|
snapshotAffectedActors( m_hitActors );
|
||||||
|
@ -613,10 +621,7 @@ void Action::Action::handleStatusEffects()
|
||||||
{
|
{
|
||||||
for( auto& status : m_lutEntry.statuses.caster )
|
for( auto& status : m_lutEntry.statuses.caster )
|
||||||
{
|
{
|
||||||
if( m_hitActors.size() > 0 )
|
applyStatusEffectSelf( status.id );
|
||||||
getEffectbuilder()->applyStatusEffect( m_hitActors[ 0 ], status.id, 0, true );
|
|
||||||
else
|
|
||||||
getEffectbuilder()->applyStatusEffect( m_pSource, status.id, 0 );
|
|
||||||
m_pSource->addStatusEffectByIdIfNotExist( status.id, status.duration, *m_pSource, status.modifiers );
|
m_pSource->addStatusEffectByIdIfNotExist( status.id, status.duration, *m_pSource, status.modifiers );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,6 +105,8 @@ namespace Sapphire::World::Action
|
||||||
|
|
||||||
EffectBuilderPtr getEffectbuilder();
|
EffectBuilderPtr getEffectbuilder();
|
||||||
|
|
||||||
|
void applyStatusEffectSelf( uint16_t statusId, uint8_t param = 0 );
|
||||||
|
|
||||||
void handleAction();
|
void handleAction();
|
||||||
|
|
||||||
void handleStatusEffects();
|
void handleStatusEffects();
|
||||||
|
|
Loading…
Add table
Reference in a new issue