mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 14:57:44 +00:00
There is now an applyStatusEffectSelf for status effects which same source and target.
This commit is contained in:
parent
b98f63eb75
commit
09db0ee7d2
7 changed files with 27 additions and 4 deletions
|
@ -17,7 +17,7 @@ public:
|
||||||
return;
|
return;
|
||||||
|
|
||||||
uint32_t duration = ( sourceChara->getAsPlayer()->getTp() / 50 ) * 1000;
|
uint32_t duration = ( sourceChara->getAsPlayer()->getTp() / 50 ) * 1000;
|
||||||
action.getActionResultBuilder()->applyStatusEffect( sourceChara, 50, duration, 30, false );
|
action.getActionResultBuilder()->applyStatusEffectSelf( 50, duration, 30, false );
|
||||||
sourceChara->getAsPlayer()->setTp( 0 );
|
sourceChara->getAsPlayer()->setTp( 0 );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -295,7 +295,7 @@ private:
|
||||||
|
|
||||||
void Scene00010Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
void Scene00010Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result )
|
||||||
{
|
{
|
||||||
player.addStatusEffectById( Status0, 0, player, Transformation0 );
|
// player.addStatusEffectById( Status0, 0, player, Transformation0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -82,6 +82,17 @@ void ActionResult::applyStatusEffect( uint32_t id, int32_t duration, Entity::Cha
|
||||||
m_pStatus->setParam( param );
|
m_pStatus->setParam( param );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ActionResult::applyStatusEffectSelf( uint32_t id, int32_t duration, uint8_t param, bool shouldOverride )
|
||||||
|
{
|
||||||
|
m_result.Value = static_cast< int16_t >( id );
|
||||||
|
m_result.Arg2 = param;
|
||||||
|
m_result.Type = Common::ActionEffectType::CALC_RESULT_TYPE_SET_STATUS_ME;
|
||||||
|
|
||||||
|
m_bOverrideStatus = shouldOverride;
|
||||||
|
m_pStatus = StatusEffect::make_StatusEffect( id, m_target, m_target, duration, 3000 );
|
||||||
|
m_pStatus->setParam( param );
|
||||||
|
}
|
||||||
|
|
||||||
void ActionResult::mount( uint16_t mountId )
|
void ActionResult::mount( uint16_t mountId )
|
||||||
{
|
{
|
||||||
m_result.Value = static_cast< int16_t >( mountId );
|
m_result.Value = static_cast< int16_t >( mountId );
|
||||||
|
@ -125,6 +136,7 @@ void ActionResult::execute()
|
||||||
}
|
}
|
||||||
|
|
||||||
case Common::ActionEffectType::CALC_RESULT_TYPE_SET_STATUS:
|
case Common::ActionEffectType::CALC_RESULT_TYPE_SET_STATUS:
|
||||||
|
case Common::ActionEffectType::CALC_RESULT_TYPE_SET_STATUS_ME:
|
||||||
{
|
{
|
||||||
if( !m_bOverrideStatus )
|
if( !m_bOverrideStatus )
|
||||||
m_target->addStatusEffectByIdIfNotExist( m_pStatus );
|
m_target->addStatusEffectByIdIfNotExist( m_pStatus );
|
||||||
|
|
|
@ -20,6 +20,7 @@ namespace Sapphire::World::Action
|
||||||
void startCombo( uint16_t actionId );
|
void startCombo( uint16_t actionId );
|
||||||
void comboSucceed();
|
void comboSucceed();
|
||||||
void applyStatusEffect( uint32_t id, int32_t duration, Entity::Chara& source, uint8_t param, bool shouldOverride );
|
void applyStatusEffect( uint32_t id, int32_t duration, Entity::Chara& source, uint8_t param, bool shouldOverride );
|
||||||
|
void applyStatusEffectSelf( uint32_t id, int32_t duration, uint8_t param, bool shouldOverride );
|
||||||
void mount( uint16_t mountId );
|
void mount( uint16_t mountId );
|
||||||
|
|
||||||
Entity::CharaPtr getTarget() const;
|
Entity::CharaPtr getTarget() const;
|
||||||
|
|
|
@ -88,6 +88,14 @@ void ActionResultBuilder::applyStatusEffect( Entity::CharaPtr& target, uint16_t
|
||||||
addResultToActor( target, nextResult );
|
addResultToActor( target, nextResult );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ActionResultBuilder::applyStatusEffectSelf( uint16_t statusId, uint32_t duration, uint8_t param, bool shouldOverride )
|
||||||
|
{
|
||||||
|
ActionResultPtr nextResult = make_ActionResult( m_sourceChara, 0 );
|
||||||
|
nextResult->applyStatusEffectSelf( statusId, duration, param, shouldOverride );
|
||||||
|
addResultToActor( m_sourceChara, nextResult );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void ActionResultBuilder::mount( Entity::CharaPtr& target, uint16_t mountId )
|
void ActionResultBuilder::mount( Entity::CharaPtr& target, uint16_t mountId )
|
||||||
{
|
{
|
||||||
ActionResultPtr nextResult = make_ActionResult( target, 0 );
|
ActionResultPtr nextResult = make_ActionResult( target, 0 );
|
||||||
|
@ -166,7 +174,7 @@ std::shared_ptr< FFXIVPacketBase > ActionResultBuilder::createActionResultPacket
|
||||||
for( auto& result : actorResultList )
|
for( auto& result : actorResultList )
|
||||||
{
|
{
|
||||||
auto effect = result->getCalcResultParam();
|
auto effect = result->getCalcResultParam();
|
||||||
if( result->getTarget() == m_sourceChara )
|
if( result->getTarget() == m_sourceChara && result->getCalcResultParam().Type != Common::ActionEffectType::CALC_RESULT_TYPE_SET_STATUS_ME )
|
||||||
actionResult->addSourceEffect( effect );
|
actionResult->addSourceEffect( effect );
|
||||||
else
|
else
|
||||||
actionResult->addTargetEffect( effect );
|
actionResult->addTargetEffect( effect );
|
||||||
|
|
|
@ -26,6 +26,7 @@ namespace Sapphire::World::Action
|
||||||
void comboSucceed( Entity::CharaPtr& target );
|
void comboSucceed( Entity::CharaPtr& target );
|
||||||
|
|
||||||
void applyStatusEffect( Entity::CharaPtr& target, uint16_t statusId, uint32_t duration, uint8_t param, bool shouldOverride );
|
void applyStatusEffect( Entity::CharaPtr& target, uint16_t statusId, uint32_t duration, uint8_t param, bool shouldOverride );
|
||||||
|
void applyStatusEffectSelf( uint16_t statusId, uint32_t duration, uint8_t param, bool shouldOverride );
|
||||||
|
|
||||||
void mount( Entity::CharaPtr& target, uint16_t mountId );
|
void mount( Entity::CharaPtr& target, uint16_t mountId );
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,8 @@ void ActionIntegrityTask::execute()
|
||||||
if( actionResult && actionResult->getTarget() )
|
if( actionResult && actionResult->getTarget() )
|
||||||
actionResult->execute();
|
actionResult->execute();
|
||||||
|
|
||||||
if( actionResult->getCalcResultParam().Type == Common::CALC_RESULT_TYPE_SET_STATUS )
|
if( ( actionResult->getCalcResultParam().Type == Common::CALC_RESULT_TYPE_SET_STATUS ) ||
|
||||||
|
( actionResult->getCalcResultParam().Type == Common::CALC_RESULT_TYPE_SET_STATUS_ME ) )
|
||||||
{
|
{
|
||||||
auto& status = data.Status[ statusIdx++ ];
|
auto& status = data.Status[ statusIdx++ ];
|
||||||
auto pEffect = actionResult->getStatusEffect();
|
auto pEffect = actionResult->getStatusEffect();
|
||||||
|
|
Loading…
Add table
Reference in a new issue