1 #ifndef CORE_BATTLES_VIEW_PEOPLEMONANIMATION_HPP
2 #define CORE_BATTLES_VIEW_PEOPLEMONANIMATION_HPP
4 #include <BLIB/Graphics.hpp>
5 #include <BLIB/Particles/System.hpp>
6 #include <BLIB/Render/Scenes/CodeScene.hpp>
7 #include <BLIB/Resources.hpp>
48 void init(bl::rc::scene::CodeScene* scene);
88 void render(bl::rc::scene::CodeScene::RenderContext& ctx);
91 enum struct State { Hidden, Static, Playing };
93 bl::engine::Engine& engine;
94 bl::rc::scene::CodeScene* scene;
96 const VkViewport viewport;
97 const VkRect2D scissor;
111 bl::rc::res::TextureRef ballTxtr;
112 bl::rc::res::TextureRef ballOpenTxtr;
113 bl::gfx::Sprite ball;
114 bl::gfx::Circle ballFlash;
116 bl::pcl::ParticleManager<PeoplemonSpark>* sparks;
118 bl::pcl::ParticleManager<PeoplemonSpark>* implosion;
120 bl::gfx::Rectangle screenFlash;
122 bl::rc::res::TextureRef statTxtr;
123 bl::gfx::Sprite statArrow;
127 enum struct BallThrowState { Arcing, Eating, Bouncing, CloneFading } throwState;
128 bl::rc::res::TextureRef throwBallTxtr;
129 bl::gfx::Sprite throwBall;
130 bl::gfx::Sprite clone;
131 bl::gfx::Sprite* toEat;
133 void setBallTexture(bl::rc::res::TextureRef& t);
134 void setThrowBallTxtr(bl::rc::res::TextureRef& t);
136 bl::resource::Ref<bl::gfx::a2d::AnimationData> annoySrc;
137 bl::resource::Ref<bl::gfx::a2d::AnimationData> confuseSrc;
138 bl::resource::Ref<bl::gfx::a2d::AnimationData> frozenSrc;
139 bl::resource::Ref<bl::gfx::a2d::AnimationData> frustrationSrc;
140 bl::resource::Ref<bl::gfx::a2d::AnimationData> sleepSrc;
141 bl::resource::Ref<bl::gfx::a2d::AnimationData> stickySrc;
142 bl::resource::Ref<bl::gfx::a2d::AnimationData> trappedSrc;
143 bl::resource::Ref<bl::gfx::a2d::AnimationData> jumpedSrc;
144 bl::gfx::Animation2D ailmentAnim;
148 void recreateAilmentAnimation(bl::resource::Ref<bl::gfx::a2d::AnimationData>& src);
150 bl::rc::res::TextureRef txtr;
151 bl::gfx::Sprite peoplemon;
PassiveAilment
Represents a passive ailment a Peoplemon can have.
Ailment
Represents an ailment that a Peoplemon can have.
Core classes and functionality for both the editor and game.
Represents a type of animation that can be played in battle.
Type
The type of animation to play.
Helper for rendering peoplemon in battle and animating them.
void init(bl::rc::scene::CodeScene *scene)
Initializes rendering resources.
Position
Which position the peoplemon is in.
~PeoplemonAnimation()
Frees resources.
PeoplemonAnimation(bl::engine::Engine &engine, Position position)
Construct a new Peoplemon Animation utility.
void triggerAnimation(cmd::Animation::Type type)
Begins playing the given animation by type only.
void render(bl::rc::scene::CodeScene::RenderContext &ctx)
Renders the peoplemon animation.
void triggerAnimation(const cmd::Animation &anim)
Begins playing the given animation.
bool completed() const
Returns true if the animation has completed, false if in progress.
void update(float dt)
Updates the playing animation.
void setPeoplemon(pplmn::Id ppl)
Sets the specific peoplemon graphic and resets to hidden state.
Particle system spark emitter for explosions.
Particle system spark emitter for implosions.