/* * Weapon.h * * Created on: Dec 2, 2016 * Author: tibi */ #ifndef CONTROLLER_ITEMS_WEAPON_H_ #define CONTROLLER_ITEMS_WEAPON_H_ #include #include #include #include namespace farmlands { namespace components { namespace items { class Weapon: public model::Component, public IPlayerAction { public: Weapon(); virtual ~Weapon(); virtual model::Component* clone() override; virtual void dump(unsigned level) override; virtual void onInitialize() override; virtual void onUpdateLogic() override; virtual void onPreRender() override; /** * Performs everything required to attacking an enemy with a weapon. To be called from player controller. */ virtual void performAction(float x, float y, model::Direction d); // Properties float damage; float critProbability; float critDamage; float attackDuration; // In seconds float attackTimeLeft; private: basic::Sprite* m_sprite; }; } } /* namespace components */ } /* namespace farmlands */ #endif /* CONTROLLER_ITEMS_WEAPON_H_ */