mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-26 06:27:45 +00:00
fix actions being interrupted incorrectly
This commit is contained in:
parent
0ceb18a8e1
commit
6a88a6e694
3 changed files with 34 additions and 1 deletions
|
@ -27,7 +27,8 @@ Sapphire::Action::Action::Action( Entity::CharaPtr caster, uint32_t actionId,
|
||||||
m_pSource( std::move( caster ) ),
|
m_pSource( std::move( caster ) ),
|
||||||
m_pFw( std::move( fw ) ),
|
m_pFw( std::move( fw ) ),
|
||||||
m_id( actionId ),
|
m_id( actionId ),
|
||||||
m_startTime( 0 )
|
m_startTime( 0 ),
|
||||||
|
m_bInterrupt( false )
|
||||||
{
|
{
|
||||||
m_castTime = static_cast< uint32_t >( action->cast100ms ) * 100;
|
m_castTime = static_cast< uint32_t >( action->cast100ms ) * 100;
|
||||||
|
|
||||||
|
@ -50,6 +51,16 @@ void Sapphire::Action::Action::setType( Sapphire::Common::HandleActionType type
|
||||||
m_type = type;
|
m_type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Sapphire::Action::Action::setPos( Sapphire::Common::FFXIVARR_POSITION3 pos )
|
||||||
|
{
|
||||||
|
m_pos = pos;
|
||||||
|
}
|
||||||
|
|
||||||
|
Sapphire::Common::FFXIVARR_POSITION3 Sapphire::Action::Action::getPos() const
|
||||||
|
{
|
||||||
|
return m_pos;
|
||||||
|
}
|
||||||
|
|
||||||
void Sapphire::Action::Action::setTargetChara( Sapphire::Entity::CharaPtr chara )
|
void Sapphire::Action::Action::setTargetChara( Sapphire::Entity::CharaPtr chara )
|
||||||
{
|
{
|
||||||
assert( chara );
|
assert( chara );
|
||||||
|
|
|
@ -27,6 +27,9 @@ namespace Sapphire::Action
|
||||||
Common::HandleActionType getType() const;
|
Common::HandleActionType getType() const;
|
||||||
void setType( Common::HandleActionType type );
|
void setType( Common::HandleActionType type );
|
||||||
|
|
||||||
|
void setPos( Common::FFXIVARR_POSITION3 pos );
|
||||||
|
Common::FFXIVARR_POSITION3 getPos() const;
|
||||||
|
|
||||||
void setTargetChara( Entity::CharaPtr chara );
|
void setTargetChara( Entity::CharaPtr chara );
|
||||||
Entity::CharaPtr getTargetChara() const;
|
Entity::CharaPtr getTargetChara() const;
|
||||||
Entity::CharaPtr getActionSource() const;
|
Entity::CharaPtr getActionSource() const;
|
||||||
|
@ -43,11 +46,25 @@ namespace Sapphire::Action
|
||||||
*/
|
*/
|
||||||
bool isCastedAction() const;
|
bool isCastedAction() const;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Starts the cast. Finishes it immediately if there is no cast time (weaponskills).
|
||||||
|
*/
|
||||||
void start();
|
void start();
|
||||||
|
|
||||||
void buildEffectPacket();
|
void buildEffectPacket();
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Damages a target and adds the effect entry
|
||||||
|
* @param amount The amount of damage the target takes
|
||||||
|
* @param chara The chara to inflict damage upon
|
||||||
|
* @param aspect The aspect of the damage
|
||||||
|
*/
|
||||||
void damageTarget( uint32_t amount, Entity::Chara& chara, Common::ActionAspect aspect = Common::ActionAspect::Unaspected );
|
void damageTarget( uint32_t amount, Entity::Chara& chara, Common::ActionAspect aspect = Common::ActionAspect::Unaspected );
|
||||||
|
/*!
|
||||||
|
* @brief Heals a target and adds the effect entry
|
||||||
|
* @param amount Amount of healing to apply
|
||||||
|
* @param chara Chara to receive healing
|
||||||
|
*/
|
||||||
void healTarget( uint32_t amount, Entity::Chara& chara );
|
void healTarget( uint32_t amount, Entity::Chara& chara );
|
||||||
|
|
||||||
virtual void onStart();
|
virtual void onStart();
|
||||||
|
@ -93,6 +110,8 @@ namespace Sapphire::Action
|
||||||
|
|
||||||
FrameworkPtr m_pFw;
|
FrameworkPtr m_pFw;
|
||||||
|
|
||||||
|
Common::FFXIVARR_POSITION3 m_pos;
|
||||||
|
|
||||||
std::array< EffectPacketData, MAX_ACTION_EFFECT_PACKET_IDENT > m_effects;
|
std::array< EffectPacketData, MAX_ACTION_EFFECT_PACKET_IDENT > m_effects;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,9 @@ void World::Manager::ActionMgr::handleAoEPlayerAction( Entity::Player& player, u
|
||||||
|
|
||||||
auto action = Action::make_Action( player.getAsPlayer(), actionId, actionData, framework() );
|
auto action = Action::make_Action( player.getAsPlayer(), actionId, actionData, framework() );
|
||||||
action->setType( static_cast< Common::HandleActionType >( type ) );
|
action->setType( static_cast< Common::HandleActionType >( type ) );
|
||||||
|
action->setPos( pos );
|
||||||
|
|
||||||
|
bootstrapAction( player, action, *actionData );
|
||||||
}
|
}
|
||||||
|
|
||||||
void World::Manager::ActionMgr::handleTargetedPlayerAction( Entity::Player& player, uint8_t type,
|
void World::Manager::ActionMgr::handleTargetedPlayerAction( Entity::Player& player, uint8_t type,
|
||||||
|
|
Loading…
Add table
Reference in a new issue