From: Daniel Karbach Date: Sat, 11 Aug 2012 19:24:45 +0000 (+0200) Subject: added information about animation frames X-Git-Url: http://git.localhorst.tv/?a=commitdiff_plain;h=3f2e68e7a2377db6d1738934150f34b80bdbd0e0;hp=c484a03fda545a6803be63aa0a35f23c26cc8e2f;p=l2e.git added information about animation frames --- diff --git a/src/battle/Hero.h b/src/battle/Hero.h index 499239d..3274fe2 100644 --- a/src/battle/Hero.h +++ b/src/battle/Hero.h @@ -66,6 +66,9 @@ public: bool HasRing() const { return ring; } bool HasJewel() const { return jewel; } + int AttackFrames() const { return attackFrames; } + int SpellFrames() const { return spellFrames; } + // temporary setters until loader is implemented public: void SetName(const char *n) { name = n; } @@ -87,6 +90,9 @@ public: void AddSpell(const common::Spell *s) { spells.push_back(s); } + void SetAttackFrames(int num) { attackFrames = num; } + void SetSpellFrames(int num) { spellFrames = num; } + private: const char *name; graphics::Sprite *sprite; @@ -100,7 +106,9 @@ private: // TODO: vector does not seem to be a good choice std::vector spells; - // TODO: equipment list + + int attackFrames; + int spellFrames; Uint16 maxHealth, health; Uint16 maxMana, mana; diff --git a/src/main.cpp b/src/main.cpp index b4be5be..dfe9618 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -97,6 +97,8 @@ int main(int argc, char **argv) { maxim.SetMaxMana(20); maxim.SetMana(20); maxim.SetIP(0); + maxim.SetAttackFrames(3); + maxim.SetSpellFrames(2); SDL_Surface *selanImg(IMG_Load("test-data/selan.png")); Sprite selanSprite(selanImg, 64, 64); @@ -109,6 +111,8 @@ int main(int argc, char **argv) { selan.SetMaxMana(23); selan.SetMana(23); selan.SetIP(1); + selan.SetAttackFrames(3); + selan.SetSpellFrames(4); SDL_Surface *guyImg(IMG_Load("test-data/guy.png")); Sprite guySprite(guyImg, 64, 64); @@ -121,6 +125,8 @@ int main(int argc, char **argv) { guy.SetMaxMana(0); guy.SetMana(0); guy.SetIP(254); + guy.SetAttackFrames(3); + guy.SetSpellFrames(0); SDL_Surface *dekarImg(IMG_Load("test-data/dekar.png")); Sprite dekarSprite(dekarImg, 64, 64); @@ -133,6 +139,8 @@ int main(int argc, char **argv) { dekar.SetMaxMana(0); dekar.SetMana(0); dekar.SetIP(255); + dekar.SetAttackFrames(3); + dekar.SetSpellFrames(3); battle::Resources battleRes;