1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-27 14:57:44 +00:00

Minor style fixes

This commit is contained in:
Mordred 2017-12-08 23:09:34 +01:00
parent 5c13f51042
commit 04e7f1c9cb

View file

@ -664,7 +664,7 @@ void Core::Entity::Actor::handleScriptSkill( uint32_t type, uint16_t actionId, u
uint64_t param2, Entity::Actor& pTarget )
{
if ( isPlayer() )
if( isPlayer() )
{
getAsPlayer()->sendDebug( std::to_string( pTarget.getId() ) );
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();
// 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:
@ -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].unknown_3 = 7;
if ( !actionInfoPtr->is_aoe )
if( !actionInfoPtr->is_aoe )
{
// If action on this specific target is valid...
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 ),
actionInfoPtr, TargetFilter::Enemies );
for ( const auto& pHitActor : actorsCollided )
for( const auto& pHitActor : actorsCollided )
{
effectPacket.data().targetId = pHitActor->getId();
effectPacket.data().effectTarget = pHitActor->getId();
@ -733,9 +733,8 @@ void Core::Entity::Actor::handleScriptSkill( uint32_t type, uint16_t actionId, u
// Debug
if ( isPlayer() )
{
if ( pHitActor->isPlayer() ) {
if ( pHitActor->isPlayer() )
getAsPlayer()->sendDebug( "AoE hit actor " + std::to_string( pHitActor->getId() ) + " (" + pHitActor->getName() + ")" );
}
else
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].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;
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 ),
actionInfoPtr, TargetFilter::Allies );
for ( auto pHitActor : actorsCollided )
for( auto pHitActor : actorsCollided )
{
effectPacket.data().targetId = pTarget.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 );
// Debug
if ( isPlayer() )
if( isPlayer() )
{
if ( pHitActor->isPlayer() ) {
if( pHitActor->isPlayer() )
getAsPlayer()->sendDebug( "AoE hit actor " + std::to_string( pHitActor->getId() ) + " (" + pHitActor->getName() + ")" );
}
else
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 */
void Core::Entity::Actor::addStatusEffectByIdIfNotExist( uint32_t id, int32_t duration, Entity::Actor& pSource, uint16_t param )
{
if( !hasStatusEffect( id ) )
{
StatusEffect::StatusEffectPtr effect( new StatusEffect::StatusEffect( id, pSource.shared_from_this(),
shared_from_this(), duration, 3000 ) );
effect->setParam( param );
addStatusEffect( effect );
}
if( hasStatusEffect( id ) )
return;
StatusEffect::StatusEffectPtr effect( new StatusEffect::StatusEffect( id, pSource.shared_from_this(),
shared_from_this(), duration, 3000 ) );
effect->setParam( param );
addStatusEffect( effect );
}
float Core::Entity::Actor::getRotation() const