
#ifndef mosaic_mob_hostile_hh
#define mosaic_mob_hostile_hh

#include "mob_main.hh"

struct Mob_thorns : public Mob {
 public:
        Mob_thorns(Mobs& mobs, const itty::Box& box, Place*);
        bool update(Scene& sc);
        void render(Mobs& mobs);
};

struct Mob_rotten : public Mob {
 private:
        size_t brush;
        MIX_Audio* sound_kill;

 public:
        Mob_rotten(Mobs& mobs, const itty::Box& box, Place*);
        bool update(Scene& sc);
        void render(Mobs& mobs);
};

struct Mob_bones : public Mob {
 private:
        enum State {
                IDLE, IDLE_END = IDLE + 7,
                WALK, WALK_END = WALK + 23,
                FIRE, FIRE_END = FIRE + 15,
        };

        size_t brush;
        MIX_Audio* sound_kill;
        uint8_t state{IDLE};

 public:
        Mob_bones(Mobs& mobs, const itty::Box& box, Place*);
        bool update(Scene& sc);
        void render(Mobs& mobs);
};

struct Mob_bone : public Mob {
 private:
        size_t brush;
        MIX_Audio* sound_kill;
        uint8_t state{0};

 public:
        Mob_bone(Mobs& mobs, const itty::Box& box, Place*);
        bool update(Scene& sc);
        void render(Mobs& mobs);
};

struct Mob_peeper : public Mob {
 private:
        enum State {
                HANG,
                GLIDE,
                FLY, FLY_END = FLY + 7,
                TURN, TURN_END = TURN + 7,
        };

        size_t brush;
        MIX_Audio* sound_kill;
        uint8_t state{HANG};

 public:
        Mob_peeper(Mobs& mobs, const itty::Box& box, Place*);
        bool update(Scene& sc);
        void render(Mobs& mobs);
};

struct Mob_crawler : public Mob {
 private:
        static constexpr itty::Vec normals[] = {{0, -1}, {1, 0}, {0, 1}, {-1, 0}};
        static constexpr itty::Vec tangents[] = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};

        size_t brush;
        MIX_Audio* sound_kill;
        uint8_t state{255};

 public:
        Mob_crawler(Mobs& mobs, const itty::Box& box, Place*);
        bool update(Scene& sc);
        void render(Mobs& mobs);
};

#endif // mosaic_mob_hostile_hh
