X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmain.cpp;h=2611a722aeba9b20ebf2431e33606e846be645e8;hb=60e0fe29ce6cd033edc78b181d9d07fa72c11172;hp=53301ce5f5c785fa7c97d6d49f047936fa35e91c;hpb=2255d436a0c2acc10b015827366a72b2ece86094;p=l2e.git diff --git a/src/main.cpp b/src/main.cpp index 53301ce..2611a72 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -7,6 +7,7 @@ #include "battle/Monster.h" #include "battle/PartyLayout.h" #include "battle/Resources.h" +#include "common/Capsule.h" #include "common/GameConfig.h" #include "common/GameState.h" #include "common/Hero.h" @@ -54,9 +55,9 @@ using app::Application; using app::Arguments; using app::Input; using battle::BattleState; -using battle::Capsule; using battle::Monster; using battle::PartyLayout; +using common::Capsule; using common::GameConfig; using common::GameState; using common::Hero; @@ -101,6 +102,7 @@ int main(int argc, char **argv) { battle::Monster::CreateTypeDescription(); battle::PartyLayout::CreateTypeDescription(); + common::Capsule::CreateTypeDescription(); common::Hero::CreateTypeDescription(); common::Ikari::CreateTypeDescription(); common::Item::CreateTypeDescription(); @@ -192,6 +194,9 @@ int main(int argc, char **argv) { gameState.party[3] = &gameState.heroes[3]; gameState.partySize = 4; + gameState.capsules[0] = *caster.GetCapsule("flash"); + gameState.capsule = gameState.capsules; + GameConfig gameConfig; gameConfig.state = &gameState; gameConfig.heroesLayout = caster.GetPartyLayout("heroesLayout"); @@ -279,29 +284,6 @@ int main(int argc, char **argv) { gameState.heroes[3].MapEntity().SetFlags(Entity::FLAG_NONBLOCKING); gameState.heroes[2].MapEntity().AddFollower(&gameState.heroes[3].MapEntity()); - graphics::Sprite flashSprite(IMG_Load("test-data/flash.png"), 96, 96); - graphics::ComplexAnimation flashAttackAnimation(&flashSprite, 132); - graphics::ComplexAnimation::FrameProp flashAttackFrames[4]; - flashAttackFrames[0] = graphics::ComplexAnimation::FrameProp(0, 1, Vector(0, -16)); - flashAttackFrames[1] = graphics::ComplexAnimation::FrameProp(0, 0, Vector(0, -16)); - flashAttackFrames[2] = graphics::ComplexAnimation::FrameProp(0, 1, Vector(0, -16)); - flashAttackFrames[3] = graphics::ComplexAnimation::FrameProp(0, 0, Vector(0, -16)); - flashAttackAnimation.SetFrames(flashAttackFrames, 4); - Capsule capsule; - capsule.SetName("Flash"); - capsule.SetHealth(5, 5); - capsule.SetLevel(1); - capsule.GetStats().SetAttack(12); - capsule.GetStats().SetDefense(18); - capsule.GetStats().SetStrength(2); - capsule.GetStats().SetAgility(11); - capsule.GetStats().SetIntelligence(16); - capsule.GetStats().SetGut(23); - capsule.GetStats().SetMagicResistance(11); - capsule.SetBattleSprite(&flashSprite); - capsule.SetAttackAnimation(&flashAttackAnimation); - capsule.SetMeleeAnimation(gameState.heroes[0].MeleeAnimation()); - InitScreen screen(width, height); app::State *state(0); @@ -312,7 +294,7 @@ int main(int argc, char **argv) { battleState->AddMonster(monster); battleState->AddMonster(monster); battleState->AddMonster(monster); - battleState->SetCapsule(capsule); + battleState->SetCapsule(caster.GetCapsule("flash")); battleState->AddHero(gameState.heroes[0]); battleState->AddHero(gameState.heroes[1]); battleState->AddHero(gameState.heroes[2]);