osb/source/game/items/StarConsumableItem.hpp

36 lines
797 B
C++
Raw Normal View History

#pragma once
2023-06-20 04:33:09 +00:00
#include "StarItem.hpp"
#include "StarGameTypes.hpp"
#include "StarSwingableItem.hpp"
namespace Star {
class ConsumableItem : public Item, public SwingableItem {
public:
ConsumableItem(Json const& config, String const& directory, Json const& data);
ItemPtr clone() const override;
List<Drawable> drawables() const override;
void update(float dt, FireMode fireMode, bool shifting, HashSet<MoveControlType> const& moves) override;
2023-06-20 04:33:09 +00:00
void fire(FireMode mode, bool shifting, bool edgeTriggered) override;
void fireTriggered() override;
void uninit() override;
private:
bool canUse() const;
void triggerEffects();
void maybeConsume();
StringSet m_blockingEffects;
Maybe<float> m_foodValue;
StringSet m_emitters;
String m_emote;
bool m_consuming;
};
}