Esempio n. 1
0
        public override bool HandleEvent(Event e)
        {
            if (e is CollisionStartedEvent cse)
            {
                if (cse.Entity is Creature c && !c.IsFriendly())
                {
                    if (c.GetComponent <HealthComponent>().ModifyHealth(-10, this, DamageType.Custom))
                    {
                        AnimationUtil.Ash(Center);
                        Done = true;
                        Camera.Instance.Shake(5);
                    }
                }
            }

            return(base.HandleEvent(e));
        }
Esempio n. 2
0
        public override void Update(Entity entity, Item item, float dt)
        {
            base.Update(entity, item, dt);

            var r = entity.GetComponent <RoomComponent>().Room;

            if (r == null || r.Tagged[Tags.MustBeKilled].Count == 0)
            {
                t = 0;
                return;
            }

            t += dt;

            if (t >= 5f)
            {
                t = 0;
                var lego = new Lego();
                entity.Area.Add(lego);
                lego.BottomCenter = entity.BottomCenter;
                AnimationUtil.Ash(lego.Center);
            }
        }
Esempio n. 3
0
            public override void Update(float dt)
            {
                base.Update(dt);

                if (Self.Target != null)
                {
                    if (T >= 10f)
                    {
                        T = 0;

                        var bee = GenerateBee();
                        Self.GetComponent <MobAnimationComponent>().Animate();
                        Self.Area.Add(bee);
                        bee.BottomCenter = Self.BottomCenter;
                        AnimationUtil.Ash(bee.Center);

                        Self.GetComponent <AudioEmitterComponent>().Emit("mob_hive_pop");
                    }
                }
                else
                {
                    T = 0;
                }
            }