Remove player health, use playermap
This commit is contained in:
1 parent
b932a07cba
commit
be8ee31f03
14 files changed
+27
-39
No files matched your search
+14
-2
@@ -165,11 +165,23 @@ namespace FRG
|
||||
gameServer_.submit(
|
||||
TryCharacterAttackComboCommand{locationId_, character.entityId()});
|
||||
}
|
||||
|
||||
|
||||
void Location::setCharacterHp(Character& character, float hp)
|
||||
{
|
||||
gameServer_.submit(
|
||||
SetCharacterHealthCommand{locationId_, character.entityId(), hp});
|
||||
SetCharacterHealthCommand{ locationId_, character.entityId(), hp });
|
||||
auto state = character.stateSnapshot();
|
||||
if (character.onHpChanged && state)
|
||||
character.onHpChanged(
|
||||
state->hp,
|
||||
state->initialHp,
|
||||
std::string());
|
||||
}
|
||||
|
||||
void Location::refillCharacterHp(Character& character)
|
||||
{
|
||||
gameServer_.submit(
|
||||
SetCharacterHealthCommand{locationId_, character.entityId(), character.stateSnapshot()->initialHp});
|
||||
auto state = character.stateSnapshot();
|
||||
if (character.onHpChanged && state)
|
||||
character.onHpChanged(
|
||||
|
||||
Reference in new issue
Block a user