mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 22:57:45 +00:00
Minor style fixes
This commit is contained in:
parent
5c13f51042
commit
04e7f1c9cb
1 changed files with 18 additions and 19 deletions
|
@ -664,7 +664,7 @@ void Core::Entity::Actor::handleScriptSkill( uint32_t type, uint16_t actionId, u
|
||||||
uint64_t param2, Entity::Actor& pTarget )
|
uint64_t param2, Entity::Actor& pTarget )
|
||||||
{
|
{
|
||||||
|
|
||||||
if ( isPlayer() )
|
if( isPlayer() )
|
||||||
{
|
{
|
||||||
getAsPlayer()->sendDebug( std::to_string( pTarget.getId() ) );
|
getAsPlayer()->sendDebug( std::to_string( pTarget.getId() ) );
|
||||||
getAsPlayer()->sendDebug( "Handle script skill type: " + std::to_string( type ) );
|
getAsPlayer()->sendDebug( "Handle script skill type: " + std::to_string( type ) );
|
||||||
|
@ -686,7 +686,7 @@ void Core::Entity::Actor::handleScriptSkill( uint32_t type, uint16_t actionId, u
|
||||||
effectPacket.data().effectTarget = pTarget.getId();
|
effectPacket.data().effectTarget = pTarget.getId();
|
||||||
|
|
||||||
// Todo: for each actor, calculate how much damage the calculated value should deal to them - 2-step damage calc. we only have 1-step
|
// Todo: for each actor, calculate how much damage the calculated value should deal to them - 2-step damage calc. we only have 1-step
|
||||||
switch ( type )
|
switch( type )
|
||||||
{
|
{
|
||||||
|
|
||||||
case ActionEffectType::Damage:
|
case ActionEffectType::Damage:
|
||||||
|
@ -696,7 +696,7 @@ void Core::Entity::Actor::handleScriptSkill( uint32_t type, uint16_t actionId, u
|
||||||
effectPacket.data().effects[0].hitSeverity = ActionHitSeverityType::NormalDamage;
|
effectPacket.data().effects[0].hitSeverity = ActionHitSeverityType::NormalDamage;
|
||||||
effectPacket.data().effects[0].unknown_3 = 7;
|
effectPacket.data().effects[0].unknown_3 = 7;
|
||||||
|
|
||||||
if ( !actionInfoPtr->is_aoe )
|
if( !actionInfoPtr->is_aoe )
|
||||||
{
|
{
|
||||||
// If action on this specific target is valid...
|
// If action on this specific target is valid...
|
||||||
if ( isPlayer() && !ActionCollision::isActorApplicable( pTarget.shared_from_this(), TargetFilter::Enemies ) )
|
if ( isPlayer() && !ActionCollision::isActorApplicable( pTarget.shared_from_this(), TargetFilter::Enemies ) )
|
||||||
|
@ -716,7 +716,7 @@ void Core::Entity::Actor::handleScriptSkill( uint32_t type, uint16_t actionId, u
|
||||||
auto actorsCollided = ActionCollision::getActorsHitFromAction( pTarget.getPos(), getInRangeActors( true ),
|
auto actorsCollided = ActionCollision::getActorsHitFromAction( pTarget.getPos(), getInRangeActors( true ),
|
||||||
actionInfoPtr, TargetFilter::Enemies );
|
actionInfoPtr, TargetFilter::Enemies );
|
||||||
|
|
||||||
for ( const auto& pHitActor : actorsCollided )
|
for( const auto& pHitActor : actorsCollided )
|
||||||
{
|
{
|
||||||
effectPacket.data().targetId = pHitActor->getId();
|
effectPacket.data().targetId = pHitActor->getId();
|
||||||
effectPacket.data().effectTarget = pHitActor->getId();
|
effectPacket.data().effectTarget = pHitActor->getId();
|
||||||
|
@ -733,9 +733,8 @@ void Core::Entity::Actor::handleScriptSkill( uint32_t type, uint16_t actionId, u
|
||||||
// Debug
|
// Debug
|
||||||
if ( isPlayer() )
|
if ( isPlayer() )
|
||||||
{
|
{
|
||||||
if ( pHitActor->isPlayer() ) {
|
if ( pHitActor->isPlayer() )
|
||||||
getAsPlayer()->sendDebug( "AoE hit actor " + std::to_string( pHitActor->getId() ) + " (" + pHitActor->getName() + ")" );
|
getAsPlayer()->sendDebug( "AoE hit actor " + std::to_string( pHitActor->getId() ) + " (" + pHitActor->getName() + ")" );
|
||||||
}
|
|
||||||
else
|
else
|
||||||
getAsPlayer()->sendDebug( "AoE hit actor " + std::to_string( pHitActor->getId() ) );
|
getAsPlayer()->sendDebug( "AoE hit actor " + std::to_string( pHitActor->getId() ) );
|
||||||
}
|
}
|
||||||
|
@ -753,9 +752,9 @@ void Core::Entity::Actor::handleScriptSkill( uint32_t type, uint16_t actionId, u
|
||||||
effectPacket.data().effects[0].effectType = ActionEffectType::Heal;
|
effectPacket.data().effects[0].effectType = ActionEffectType::Heal;
|
||||||
effectPacket.data().effects[0].hitSeverity = ActionHitSeverityType::NormalHeal;
|
effectPacket.data().effects[0].hitSeverity = ActionHitSeverityType::NormalHeal;
|
||||||
|
|
||||||
if ( !actionInfoPtr->is_aoe )
|
if( !actionInfoPtr->is_aoe )
|
||||||
{
|
{
|
||||||
if ( isPlayer() && !ActionCollision::isActorApplicable( pTarget.shared_from_this(), TargetFilter::Allies ) )
|
if( isPlayer() && !ActionCollision::isActorApplicable( pTarget.shared_from_this(), TargetFilter::Allies ) )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
sendToInRangeSet( effectPacket, true );
|
sendToInRangeSet( effectPacket, true );
|
||||||
|
@ -769,7 +768,7 @@ void Core::Entity::Actor::handleScriptSkill( uint32_t type, uint16_t actionId, u
|
||||||
auto actorsCollided = ActionCollision::getActorsHitFromAction( pTarget.getPos(), getInRangeActors( true ),
|
auto actorsCollided = ActionCollision::getActorsHitFromAction( pTarget.getPos(), getInRangeActors( true ),
|
||||||
actionInfoPtr, TargetFilter::Allies );
|
actionInfoPtr, TargetFilter::Allies );
|
||||||
|
|
||||||
for ( auto pHitActor : actorsCollided )
|
for( auto pHitActor : actorsCollided )
|
||||||
{
|
{
|
||||||
effectPacket.data().targetId = pTarget.getId();
|
effectPacket.data().targetId = pTarget.getId();
|
||||||
effectPacket.data().effectTarget = pHitActor->getId();
|
effectPacket.data().effectTarget = pHitActor->getId();
|
||||||
|
@ -778,11 +777,10 @@ void Core::Entity::Actor::handleScriptSkill( uint32_t type, uint16_t actionId, u
|
||||||
pHitActor->heal( calculatedHeal );
|
pHitActor->heal( calculatedHeal );
|
||||||
|
|
||||||
// Debug
|
// Debug
|
||||||
if ( isPlayer() )
|
if( isPlayer() )
|
||||||
{
|
{
|
||||||
if ( pHitActor->isPlayer() ) {
|
if( pHitActor->isPlayer() )
|
||||||
getAsPlayer()->sendDebug( "AoE hit actor " + std::to_string( pHitActor->getId() ) + " (" + pHitActor->getName() + ")" );
|
getAsPlayer()->sendDebug( "AoE hit actor " + std::to_string( pHitActor->getId() ) + " (" + pHitActor->getName() + ")" );
|
||||||
}
|
|
||||||
else
|
else
|
||||||
getAsPlayer()->sendDebug( "AoE hit actor " + std::to_string( pHitActor->getId() ) );
|
getAsPlayer()->sendDebug( "AoE hit actor " + std::to_string( pHitActor->getId() ) );
|
||||||
}
|
}
|
||||||
|
@ -837,13 +835,14 @@ void Core::Entity::Actor::addStatusEffectById( uint32_t id, int32_t duration, En
|
||||||
/*! \param StatusEffectPtr to be applied to the actor */
|
/*! \param StatusEffectPtr to be applied to the actor */
|
||||||
void Core::Entity::Actor::addStatusEffectByIdIfNotExist( uint32_t id, int32_t duration, Entity::Actor& pSource, uint16_t param )
|
void Core::Entity::Actor::addStatusEffectByIdIfNotExist( uint32_t id, int32_t duration, Entity::Actor& pSource, uint16_t param )
|
||||||
{
|
{
|
||||||
if( !hasStatusEffect( id ) )
|
if( hasStatusEffect( id ) )
|
||||||
{
|
return;
|
||||||
StatusEffect::StatusEffectPtr effect( new StatusEffect::StatusEffect( id, pSource.shared_from_this(),
|
|
||||||
shared_from_this(), duration, 3000 ) );
|
StatusEffect::StatusEffectPtr effect( new StatusEffect::StatusEffect( id, pSource.shared_from_this(),
|
||||||
effect->setParam( param );
|
shared_from_this(), duration, 3000 ) );
|
||||||
addStatusEffect( effect );
|
effect->setParam( param );
|
||||||
}
|
addStatusEffect( effect );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float Core::Entity::Actor::getRotation() const
|
float Core::Entity::Actor::getRotation() const
|
||||||
|
|
Loading…
Add table
Reference in a new issue