Fields of Mistria — Vanilla GML Reference FoM v1.0.8

obj_animal_small_booth.gml

object_create(
    "obj_animal_small_booth",
    object_reserve("par_ledger"),
    {
        sprite_index: spr_town_animal_festival_booth_ledger_spring,
        create: function() {
            self.depth = get_instance_depth(y, -10);
            event_inherit(ObjectEvent.Create);

            self.set_darkness_animation(spr_town_animal_festival_booth_ledger_darkness);
            self.setup_offsets("small_animal_booth");

            self.bubble_icon_small = spr_ui_bark_icon_chicken_small;
            self.bubble_icon_big = spr_ui_bark_icon_chicken;

            if !FESTIVALS[FestivalId.Animal].is_today() {
                instance_destroy();
                return;
            }

            self.register_interaction(
                InputId.Interact,
                "misc_local/select_animal",
                function() {
                    animal_festival_selection_popup(AnimalSize.Small);
                },
                function() {
                    return QUEST_LOG.active.contains_key("the_animal_festival");
                }
            );
        },
    }
);