mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 06:47:45 +00:00
move effectentry to common, minor refactoring
This commit is contained in:
parent
84073363a8
commit
d151caef85
7 changed files with 21 additions and 19 deletions
|
@ -591,6 +591,17 @@ namespace Sapphire::Common
|
|||
ShowItemName = 2,
|
||||
};
|
||||
|
||||
struct EffectEntry
|
||||
{
|
||||
Common::ActionEffectType effectType;
|
||||
Common::ActionHitSeverityType hitSeverity;
|
||||
uint8_t param;
|
||||
int8_t bonusPercent; // shows an additional percentage in the battle log, will not change the damage number sent & shown
|
||||
uint8_t valueMultiplier; // This multiplies whatever value is in the 'value' param by 10. Possibly a workaround for big numbers
|
||||
uint8_t flags;
|
||||
int16_t value;
|
||||
};
|
||||
|
||||
enum class ActionCollisionType : uint8_t
|
||||
{
|
||||
None,
|
||||
|
|
|
@ -388,17 +388,6 @@ struct FFXIVIpcUpdateHpMpTp :
|
|||
* Structural representation of the packet sent by the server
|
||||
* for battle actions
|
||||
*/
|
||||
struct EffectEntry
|
||||
{
|
||||
Common::ActionEffectType effectType;
|
||||
Common::ActionHitSeverityType hitSeverity;
|
||||
uint8_t param;
|
||||
int8_t bonusPercent; // shows an additional percentage in the battle log, will not change the damage number sent & shown
|
||||
uint8_t valueMultiplier; // This multiplies whatever value is in the 'value' param by 10. Possibly a workaround for big numbers
|
||||
uint8_t flags;
|
||||
int16_t value;
|
||||
};
|
||||
|
||||
struct EffectHeader
|
||||
{
|
||||
uint64_t animationTargetId; // who the animation targets
|
||||
|
@ -458,7 +447,7 @@ struct FFXIVIpcAoeEffect
|
|||
{
|
||||
EffectHeader header;
|
||||
|
||||
EffectEntry effects[size];
|
||||
Common::EffectEntry effects[size];
|
||||
|
||||
uint16_t padding_6A[3];
|
||||
|
||||
|
|
|
@ -68,6 +68,8 @@ namespace Sapphire::Action
|
|||
|
||||
FrameworkPtr m_pFw;
|
||||
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -417,7 +417,7 @@ void Sapphire::Entity::Chara::autoAttack( CharaPtr pTarget )
|
|||
|
||||
auto effectPacket = std::make_shared< Server::EffectPacket >( getId(), pTarget->getId(), 7 );
|
||||
effectPacket->setRotation( Util::floatToUInt16Rot( getRot() ) );
|
||||
Server::EffectEntry effectEntry{};
|
||||
Common::EffectEntry effectEntry{};
|
||||
effectEntry.value = damage;
|
||||
effectEntry.effectType = ActionEffectType::Damage;
|
||||
effectEntry.hitSeverity = ActionHitSeverityType::NormalDamage;
|
||||
|
|
|
@ -1550,7 +1550,7 @@ void Sapphire::Entity::Player::autoAttack( CharaPtr pTarget )
|
|||
auto effectPacket = std::make_shared< Server::EffectPacket >( getId(), pTarget->getId(), 8 );
|
||||
effectPacket->setRotation( Util::floatToUInt16Rot( getRot() ) );
|
||||
|
||||
Server::EffectEntry entry{};
|
||||
Common::EffectEntry entry{};
|
||||
entry.value = damage;
|
||||
entry.effectType = Common::ActionEffectType::Damage;
|
||||
entry.hitSeverity = Common::ActionHitSeverityType::NormalDamage;
|
||||
|
@ -1564,7 +1564,7 @@ void Sapphire::Entity::Player::autoAttack( CharaPtr pTarget )
|
|||
auto effectPacket = std::make_shared< Server::EffectPacket >( getId(), pTarget->getId(), 7 );
|
||||
effectPacket->setRotation( Util::floatToUInt16Rot( getRot() ) );
|
||||
|
||||
Server::EffectEntry entry{};
|
||||
Common::EffectEntry entry{};
|
||||
entry.value = damage;
|
||||
entry.effectType = Common::ActionEffectType::Damage;
|
||||
entry.hitSeverity = Common::ActionHitSeverityType::NormalDamage;
|
||||
|
|
|
@ -28,7 +28,7 @@ void World::Manager::ActionMgr::handleTargetedPlayerAction( Entity::Player& play
|
|||
player.sendDebug( "got act: {0}", actionData->name );
|
||||
|
||||
auto action = Action::make_Action( player.getAsPlayer(), actionId, actionData, framework() );
|
||||
action->setType( static_cast< Common::ActionType >( type ) );
|
||||
action->setType( static_cast< Common::HandleActionType >( type ) );
|
||||
|
||||
bootstrapAction( player, action, *actionData );
|
||||
}
|
||||
|
|
|
@ -27,12 +27,12 @@ namespace Sapphire::Network::Packets::Server
|
|||
m_data.effectDisplayType = Common::ActionEffectDisplayType::ShowActionName;
|
||||
}
|
||||
|
||||
void addEffect( const Server::EffectEntry& effect )
|
||||
void addEffect( const Common::EffectEntry& effect )
|
||||
{
|
||||
assert( m_data.effectCount <= 8 );
|
||||
|
||||
std::memset( m_data.effects, 0, sizeof( Server::EffectEntry ) * 8 );
|
||||
std::memcpy( &m_data.effects[ m_data.effectCount * 8 ], &effect, sizeof( Server::EffectEntry ) );
|
||||
std::memset( m_data.effects, 0, sizeof( Common::EffectEntry ) * 8 );
|
||||
std::memcpy( &m_data.effects[ m_data.effectCount * 8 ], &effect, sizeof( Common::EffectEntry ) );
|
||||
m_data.effectCount++;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue