-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPlayerCharacter.cpp
More file actions
31 lines (25 loc) · 1.11 KB
/
Copy pathPlayerCharacter.cpp
File metadata and controls
31 lines (25 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "PlayerCharacter.hpp"
#include "Battle.hpp"
#include "BattleLog.hpp"
#include "OverencumberedStatus.hpp"
#include "TickTiming.hpp"
PlayerCharacter::PlayerCharacter(std::string name, int level, StatBlock stats,
int startWeight, int weightLimit)
: Character(std::move(name), level, stats, startWeight, weightLimit) {}
void PlayerCharacter::onTurnStart(Battle& battle) {
tickStatuses(battle, TickTiming::TurnStart); // Append the battle log after status has expired/duration is over
tickCooldowns(); // How many turns remain to use the Skill again
if (isOverencumbered()) {
battle.getLog()->add(" " + getName() + " is overencumbered! Movement hindered.");
// Apply temporary speed reduction for this turn
auto overencumberStatus = std::make_shared<OverencumberedStatus>(1, 5); // Duration, speedPenalty
applyStatus(battle, overencumberStatus);
}
}
void PlayerCharacter::onTurnEnd(Battle& battle) {
tickStatuses(battle, TickTiming::TurnEnd);
tickBuffs(battle);
}
bool PlayerCharacter::isPlayerControlled() const {
return true;
}