mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-28 15:17:46 +00:00
Update HP on tick effects
This commit is contained in:
parent
51b7740a6f
commit
78acb58d8f
1 changed files with 10 additions and 0 deletions
|
@ -865,12 +865,18 @@ void Sapphire::Entity::Chara::onTick()
|
|||
}
|
||||
}
|
||||
|
||||
// TODO: don't really like how this is handled
|
||||
// TODO: calculate actual damage from potency
|
||||
if( thisTickDmg != 0 )
|
||||
{
|
||||
takeDamage( thisTickDmg );
|
||||
server().queueForPlayers( getInRangePlayerIds( isPlayer() ), makeActorControl( getId(), HPFloatingText, 0,
|
||||
static_cast< uint8_t >( ActionEffectType::CALC_RESULT_TYPE_DAMAGE_HP ),
|
||||
thisTickDmg ) );
|
||||
if( isPlayer() )
|
||||
server().queueForPlayers( getInRangePlayerIds( isPlayer() ), makeHudParam( *getAsPlayer() ) );
|
||||
else if( isBattleNpc() )
|
||||
server().queueForPlayers( getInRangePlayerIds( isPlayer() ), makeHudParam( *getAsBNpc() ) );
|
||||
}
|
||||
|
||||
if( thisTickHeal != 0 )
|
||||
|
@ -879,5 +885,9 @@ void Sapphire::Entity::Chara::onTick()
|
|||
server().queueForPlayers( getInRangePlayerIds( isPlayer() ), makeActorControl( getId(), HPFloatingText, 0,
|
||||
static_cast< uint8_t >( ActionEffectType::CALC_RESULT_TYPE_RECOVER_HP ),
|
||||
thisTickHeal ) );
|
||||
if( isPlayer() )
|
||||
server().queueForPlayers( getInRangePlayerIds( isPlayer() ), makeHudParam( *getAsPlayer() ) );
|
||||
else if( isBattleNpc() )
|
||||
server().queueForPlayers( getInRangePlayerIds( isPlayer() ), makeHudParam( *getAsBNpc() ) );
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue