ForgottenNot
Member
- Joined
- Feb 10, 2023
- Messages
- 192
- Reaction score
- 19
Hello
I know that for mana it should be in thsi way
the thing is that for heal the hing is a bit different
i tried something like this:
it wont compile, ideas please?
I know that for mana it should be in thsi way
Lua:
int32_t realManaChange = targetPlayer->getMana();
targetPlayer->changeMana(manaChange);
realManaChange = targetPlayer->getMana() - realManaChange;
if (realManaChange > 0 && !targetPlayer->isInGhostMode()) {
addAnimatedText(fmt::format("+{:d}", realManaChange), targetPlayer->getPosition(), TEXTCOLOR_WHITE);
}
the thing is that for heal the hing is a bit different
Code:
int32_t realHealthChange = target->getHealth();
target->gainHealth(attacker, damage.primary.value);
realHealthChange = target->getHealth() - realHealthChange;
if (realHealthChange > 0 && !target->isInGhostMode()) {
auto damageString = fmt::format("{:d} hitpoint{:s}", realHealthChange, realHealthChange != 1 ? "s" : "");
i tried something like this:
Code:
auto damageString = addAnimatedText(fmt::format("+{:d}", realHealthChange, realHealthChange != 1 ? "s" : ""), targetPlayer->getPosition(), TEXTCOLOR_PASTELRED);
Last edited: