3 #include "../common/Capsule.h"
7 using graphics::Animation;
8 using graphics::Sprite;
12 Capsule::Capsule(common::Capsule *master)
14 , health(master ? master->MaxHealth() : 0) {
16 stats = master->GetStats();
21 const char *Capsule::Name() const {
23 return master->Name();
26 Uint8 Capsule::Level() const {
28 return master->Level();
31 const Sprite *Capsule::Sprite() {
33 return master->BattleSprite();
36 const Animation *Capsule::MeleeAnimation() const {
38 return master->MeleeAnimation();
41 const Animation *Capsule::AttackAnimation() const {
43 return master->AttackAnimation();
46 const Animation *Capsule::SpellAnimation() const {
48 return master->SpellAnimation();
52 Uint16 Capsule::MaxHealth() const {
54 return master->MaxHealth();
57 Uint16 Capsule::Health() const {
61 int Capsule::RelativeHealth(int max) const {
62 return Health() * max / MaxHealth();
65 void Capsule::SubtractHealth(int amount) {
66 if (amount > health) {