Пример #1
0
        protected override void OnItemBought(ItemBoughtEvent ibe)
        {
            foreach (var s in GetComponent <RoomComponent>().Room.Tagged[Tags.Item])
            {
                if (s is SnekStand st && st != ibe.Stand && st.Item != null)
                {
                    return;
                }
            }

            var d = GetComponent <DialogComponent>();

            d.StartAndClose("snek_6", 3);

            Timer.Add(() => {
                d.StartAndClose("snek_7", 3);

                Timer.Add(() => {
                    AnimationUtil.Poof(Center);
                    Done = true;

                    var stand = new SnekStand();
                    Area.Add(stand);
                    stand.Center = Center;
                    stand.SetItem(Items.CreateAndAdd("bk:snek", Area), this);
                }, 4f);
            }, 4f);
        }
Пример #2
0
        public static void Place(Vector2 where, Area area)
        {
            var snek = new Snek();

            area.Add(snek);
            snek.BottomCenter = where;

            var pool = Items.GeneratePool(Items.GetPool(ItemPool.Snek));

            for (var i = -1; i < 2; i++)
            {
                var stand = new SnekStand();
                area.Add(stand);
                stand.Center = where + new Vector2((stand.Width + 4) * i, 4 + stand.Height);

                var id = Items.GenerateAndRemove(pool, null, true);
                stand.SetItem(Items.CreateAndAdd(id, area, false), null);
            }
        }