mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-29 23:57:46 +00:00
Merge branch 'master' of https://github.com/SapphireServer/Sapphire into actions-war
This commit is contained in:
commit
a6125168ba
12 changed files with 66 additions and 51 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 );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -34,7 +34,7 @@ public:
|
||||||
action.getActionResultBuilder()->heal( pTarget, pSource, dmg.first, Common::ActionHitSeverityType::NormalHeal,
|
action.getActionResultBuilder()->heal( pTarget, pSource, dmg.first, Common::ActionHitSeverityType::NormalHeal,
|
||||||
Common::ActionResultFlag::EffectOnSource );
|
Common::ActionResultFlag::EffectOnSource );
|
||||||
|
|
||||||
action.applyStatusEffectSelf( InnerBeast, 15000, false, { StatusModifier{ Common::ParamModifier::DamageTakenPercent, -20 } } );
|
action.getActionResultBuilder()->applyStatusEffectSelf( InnerBeast, 15000, 0, { StatusModifier{ Common::ParamModifier::DamageTakenPercent, -20 } } );
|
||||||
|
|
||||||
if( !pPlayer->hasStatusEffect( Unchained ) )
|
if( !pPlayer->hasStatusEffect( Unchained ) )
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,7 +25,7 @@ public:
|
||||||
if( auto status = pPlayer->getStatusEffectById( Defiance ); status )
|
if( auto status = pPlayer->getStatusEffectById( Defiance ); status )
|
||||||
status->setModifier( Common::ParamModifier::DamageDealtPercent, 0 );
|
status->setModifier( Common::ParamModifier::DamageDealtPercent, 0 );
|
||||||
|
|
||||||
action.applyStatusEffectSelf( Unchained, 20000, false );
|
action.getActionResultBuilder()->applyStatusEffectSelf( Unchained, 20000, 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 );
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -500,25 +500,6 @@ 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( StatusEntry& statusEntry, bool shouldOverride, uint8_t param )
|
|
||||||
{
|
|
||||||
if( m_hitActors.size() > 0 )
|
|
||||||
getActionResultBuilder()->applyStatusEffect( m_hitActors[ 0 ], statusEntry.id, statusEntry.duration, param,
|
|
||||||
statusEntry.modifiers, statusEntry.flag, shouldOverride, true );
|
|
||||||
else
|
|
||||||
getActionResultBuilder()->applyStatusEffect( m_pSource, statusEntry.id, statusEntry.duration, param,
|
|
||||||
statusEntry.modifiers, statusEntry.flag, shouldOverride );
|
|
||||||
}
|
|
||||||
|
|
||||||
void Action::Action::applyStatusEffectSelf( uint16_t statusId, int32_t duration, bool shouldOverride,
|
|
||||||
std::vector< StatusModifier > modifiers, uint8_t param )
|
|
||||||
{
|
|
||||||
if( m_hitActors.size() > 0 && m_hitActors[ 0 ]->getObjKind() != m_pSource->getObjKind() )
|
|
||||||
getActionResultBuilder()->applyStatusEffect( m_hitActors[ 0 ], statusId, duration, param, modifiers, shouldOverride, true );
|
|
||||||
else
|
|
||||||
getActionResultBuilder()->applyStatusEffect( m_pSource, statusId, duration, param, modifiers, shouldOverride );
|
|
||||||
}
|
|
||||||
|
|
||||||
void Action::Action::buildActionResults()
|
void Action::Action::buildActionResults()
|
||||||
{
|
{
|
||||||
snapshotAffectedActors( m_hitActors );
|
snapshotAffectedActors( m_hitActors );
|
||||||
|
@ -638,7 +619,7 @@ void Action::Action::handleStatusEffects()
|
||||||
{
|
{
|
||||||
for( auto& status : m_lutEntry.statuses.caster )
|
for( auto& status : m_lutEntry.statuses.caster )
|
||||||
{
|
{
|
||||||
applyStatusEffectSelf( status, true );
|
getActionResultBuilder()->applyStatusEffectSelf( status.id, status.duration, 0, status.modifiers, status.flag, true );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -111,11 +111,6 @@ namespace Sapphire::World::Action
|
||||||
|
|
||||||
ActionResultBuilderPtr getActionResultBuilder();
|
ActionResultBuilderPtr getActionResultBuilder();
|
||||||
|
|
||||||
void applyStatusEffectSelf( StatusEntry& statusEntry, bool shouldOverride, uint8_t param = 0 );
|
|
||||||
|
|
||||||
void applyStatusEffectSelf( uint16_t statusId, int32_t duration, bool shouldOverride,
|
|
||||||
std::vector< StatusModifier > modifiers = {}, uint8_t param = 0 );
|
|
||||||
|
|
||||||
void buildActionResults();
|
void buildActionResults();
|
||||||
|
|
||||||
void handleStatusEffects();
|
void handleStatusEffects();
|
||||||
|
|
|
@ -71,13 +71,11 @@ void ActionResult::comboSucceed()
|
||||||
m_result.Type = Common::ActionEffectType::CALC_RESULT_TYPE_COMBO_HIT;
|
m_result.Type = Common::ActionEffectType::CALC_RESULT_TYPE_COMBO_HIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActionResult::applyStatusEffect( uint32_t id, int32_t duration, Entity::Chara& source, uint8_t param, bool shouldOverride, bool forSelf )
|
void ActionResult::applyStatusEffect( uint32_t id, int32_t duration, Entity::Chara& source, uint8_t param, bool shouldOverride )
|
||||||
{
|
{
|
||||||
m_result.Value = static_cast< int16_t >( id );
|
m_result.Value = static_cast< int16_t >( id );
|
||||||
m_result.Arg2 = param;
|
m_result.Arg2 = param;
|
||||||
if( forSelf )
|
m_result.Type = Common::ActionEffectType::CALC_RESULT_TYPE_SET_STATUS;
|
||||||
m_result.Flag = static_cast< uint8_t >( Common::ActionResultFlag::EffectOnSource );
|
|
||||||
m_result.Type = forSelf ? Common::ActionEffectType::CALC_RESULT_TYPE_SET_STATUS_ME : Common::ActionEffectType::CALC_RESULT_TYPE_SET_STATUS;
|
|
||||||
|
|
||||||
m_bOverrideStatus = shouldOverride;
|
m_bOverrideStatus = shouldOverride;
|
||||||
m_pStatus = Sapphire::StatusEffect::make_StatusEffect( id, source.getAsChara(), m_target, duration, 3000 );
|
m_pStatus = Sapphire::StatusEffect::make_StatusEffect( id, source.getAsChara(), m_target, duration, 3000 );
|
||||||
|
@ -85,19 +83,40 @@ void ActionResult::applyStatusEffect( uint32_t id, int32_t duration, Entity::Cha
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActionResult::applyStatusEffect( uint32_t id, int32_t duration, Entity::Chara& source, uint8_t param,
|
void ActionResult::applyStatusEffect( uint32_t id, int32_t duration, Entity::Chara& source, uint8_t param,
|
||||||
std::vector< StatusModifier > modifiers, uint32_t flag, bool shouldOverride, bool forSelf )
|
std::vector< StatusModifier > modifiers, uint32_t flag, bool shouldOverride )
|
||||||
{
|
{
|
||||||
m_result.Value = static_cast< int16_t >( id );
|
m_result.Value = static_cast< int16_t >( id );
|
||||||
m_result.Arg2 = param;
|
m_result.Arg2 = param;
|
||||||
if( forSelf )
|
m_result.Type = Common::ActionEffectType::CALC_RESULT_TYPE_SET_STATUS;
|
||||||
m_result.Flag = static_cast< uint8_t >( Common::ActionResultFlag::EffectOnSource );
|
|
||||||
m_result.Type = forSelf ? Common::ActionEffectType::CALC_RESULT_TYPE_SET_STATUS_ME : Common::ActionEffectType::CALC_RESULT_TYPE_SET_STATUS;
|
|
||||||
|
|
||||||
m_bOverrideStatus = shouldOverride;
|
m_bOverrideStatus = shouldOverride;
|
||||||
m_pStatus = Sapphire::StatusEffect::make_StatusEffect( id, source.getAsChara(), m_target, duration, modifiers, flag, 3000 );
|
m_pStatus = Sapphire::StatusEffect::make_StatusEffect( id, source.getAsChara(), m_target, duration, modifiers, flag, 3000 );
|
||||||
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 = Sapphire::StatusEffect::make_StatusEffect( id, m_target, m_target, duration, 3000 );
|
||||||
|
m_pStatus->setParam( param );
|
||||||
|
}
|
||||||
|
|
||||||
|
void ActionResult::applyStatusEffectSelf( uint32_t id, int32_t duration, uint8_t param, std::vector< World::Action::StatusModifier > modifiers,
|
||||||
|
uint32_t flag, 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 = Sapphire::StatusEffect::make_StatusEffect( id, m_target, m_target, duration, modifiers, flag, 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 );
|
||||||
|
|
|
@ -20,9 +20,12 @@ namespace Sapphire::World::Action
|
||||||
void restoreMP( uint32_t amount, Common::ActionResultFlag flag = Common::ActionResultFlag::None );
|
void restoreMP( uint32_t amount, Common::ActionResultFlag flag = Common::ActionResultFlag::None );
|
||||||
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, bool forSelf );
|
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,
|
void applyStatusEffect( uint32_t id, int32_t duration, Entity::Chara& source, uint8_t param,
|
||||||
std::vector< World::Action::StatusModifier > modifiers, uint32_t flag, bool shouldOverride, bool forSelf );
|
std::vector< World::Action::StatusModifier > modifiers, uint32_t flag, bool shouldOverride );
|
||||||
|
void applyStatusEffectSelf( uint32_t id, int32_t duration, uint8_t param, bool shouldOverride );
|
||||||
|
void applyStatusEffectSelf( uint32_t id, int32_t duration, uint8_t param, std::vector< World::Action::StatusModifier > modifiers,
|
||||||
|
uint32_t flag, bool shouldOverride );
|
||||||
void mount( uint16_t mountId );
|
void mount( uint16_t mountId );
|
||||||
|
|
||||||
Entity::CharaPtr getTarget() const;
|
Entity::CharaPtr getTarget() const;
|
||||||
|
|
|
@ -81,22 +81,36 @@ void ActionResultBuilder::comboSucceed( Entity::CharaPtr& target )
|
||||||
addResultToActor( target, nextResult );
|
addResultToActor( target, nextResult );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActionResultBuilder::applyStatusEffect( Entity::CharaPtr& target, uint16_t statusId, uint32_t duration, uint8_t param, bool shouldOverride, bool forSelf )
|
void ActionResultBuilder::applyStatusEffect( Entity::CharaPtr& target, uint16_t statusId, uint32_t duration, uint8_t param, bool shouldOverride )
|
||||||
{
|
{
|
||||||
ActionResultPtr nextResult = make_ActionResult( target, 0 );
|
ActionResultPtr nextResult = make_ActionResult( target, 0 );
|
||||||
nextResult->applyStatusEffect( statusId, duration, *m_sourceChara, param, shouldOverride, forSelf );
|
nextResult->applyStatusEffect( statusId, duration, *m_sourceChara, param, shouldOverride );
|
||||||
addResultToActor( target, nextResult );
|
addResultToActor( target, nextResult );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActionResultBuilder::applyStatusEffect( Entity::CharaPtr& target, uint16_t statusId, uint32_t duration, uint8_t param,
|
void ActionResultBuilder::applyStatusEffect( Entity::CharaPtr& target, uint16_t statusId, uint32_t duration, uint8_t param,
|
||||||
std::vector< World::Action::StatusModifier > modifiers, uint32_t flag,
|
std::vector< World::Action::StatusModifier > modifiers, uint32_t flag, bool shouldOverride )
|
||||||
bool shouldOverride, bool forSelf )
|
|
||||||
{
|
{
|
||||||
ActionResultPtr nextResult = make_ActionResult( target, 0 );
|
ActionResultPtr nextResult = make_ActionResult( target, 0 );
|
||||||
nextResult->applyStatusEffect( statusId, duration, *m_sourceChara, param, modifiers, flag, shouldOverride, forSelf );
|
nextResult->applyStatusEffect( statusId, duration, *m_sourceChara, param, modifiers, flag, shouldOverride );
|
||||||
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::applyStatusEffectSelf( uint16_t statusId, uint32_t duration, uint8_t param, std::vector< World::Action::StatusModifier > modifiers,
|
||||||
|
uint32_t flag = 0, bool shouldOverride )
|
||||||
|
{
|
||||||
|
ActionResultPtr nextResult = make_ActionResult( m_sourceChara, 0 );
|
||||||
|
nextResult->applyStatusEffectSelf( statusId, duration, param, modifiers, flag, 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 );
|
||||||
|
@ -175,7 +189,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,10 +26,12 @@ 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 = false, bool forSelf = false );
|
void applyStatusEffect( Entity::CharaPtr& target, uint16_t statusId, uint32_t duration, uint8_t param, bool shouldOverride = false );
|
||||||
|
|
||||||
void applyStatusEffect( Entity::CharaPtr& target, uint16_t statusId, uint32_t duration, uint8_t param,
|
void applyStatusEffect( Entity::CharaPtr& target, uint16_t statusId, uint32_t duration, uint8_t param,
|
||||||
std::vector< World::Action::StatusModifier > modifiers, uint32_t flag = 0, bool shouldOverride = false, bool forSelf = false );
|
std::vector< World::Action::StatusModifier > modifiers, uint32_t flag = 0, bool shouldOverride = false );
|
||||||
|
void applyStatusEffectSelf( uint16_t statusId, uint32_t duration, uint8_t param, bool shouldOverride = false );
|
||||||
|
void applyStatusEffectSelf( uint16_t statusId, uint32_t duration, uint8_t param, std::vector< World::Action::StatusModifier > modifiers,
|
||||||
|
uint32_t flag = 0, bool shouldOverride = false );
|
||||||
|
|
||||||
void mount( Entity::CharaPtr& target, uint16_t mountId );
|
void mount( Entity::CharaPtr& target, uint16_t mountId );
|
||||||
|
|
||||||
|
|
|
@ -60,6 +60,6 @@ void Warrior::handleWrath( Entity::Player& player, Action& action )
|
||||||
|
|
||||||
if( !player.hasStatusEffect( Infuriated ) )
|
if( !player.hasStatusEffect( Infuriated ) )
|
||||||
{
|
{
|
||||||
action.applyStatusEffectSelf( effectToApply, 30000, false, { StatusModifier{ Common::ParamModifier::ParryPercent, parry } } );
|
action.getActionResultBuilder()->applyStatusEffectSelf( effectToApply, 30000, 0, { StatusModifier{ Common::ParamModifier::ParryPercent, parry } }, 0, false );
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -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 || actionResult->getCalcResultParam().Type == Common::CALC_RESULT_TYPE_SET_STATUS_ME )
|
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