Exemple #1
0
        public override void AddComponents()
        {
            base.AddComponents();

            Width  = 14;
            Height = 17;

            AddComponent(new SensorBodyComponent(1, 1, 12, 16));

            var body = new RectBodyComponent(1, 16, 12, 1);

            AddComponent(body);

            body.KnockbackModifier  = 0.5f;
            body.Body.LinearDamping = 3;

            AddComponent(new ZComponent());
            AddComponent(new ZAnimationComponent("dark_mage"));

            SetMaxHp(Hp);

            Flying = true;

            var b = GetComponent <BuffsComponent>();

            b.AddImmunity <BurningBuff>();
            b.AddImmunity <PoisonBuff>();
            b.AddImmunity <FrozenBuff>();
            b.AddImmunity <BrokenArmorBuff>();
        }
        protected override void SetStats()
        {
            base.SetStats();

            Width  = 24;
            Height = 15;

            SetMaxHp(20);

            var body = new RectBodyComponent(4, 14, 17, 1);

            AddComponent(body);
            body.Body.LinearDamping = 10;
            body.KnockbackModifier  = 0.1f;

            AddComponent(new SensorBodyComponent(5, 2, 15, 12));
            AddComponent(new MobAnimationComponent("snowman_body")
            {
                ShadowOffset = 3
            });

            GetComponent <AudioEmitterComponent>().PitchMod = -0.2f;

            Become <IdleState>();

            TouchDamage = 0;
        }
Exemple #3
0
        protected override void SetStats()
        {
            base.SetStats();

            Width  = 24;
            Height = 22;

            t = Rnd.Float(4);

            SetMaxHp(30);

            var body = new RectBodyComponent(5, 21, 15, 1);

            AddComponent(body);
            body.Body.LinearDamping = 10;
            body.KnockbackModifier  = 0.1f;

            AddComponent(new SensorBodyComponent(6, 2, 13, 19));
            AddComponent(new MobAnimationComponent("snowman")
            {
                ShadowOffset = 3
            });

            Become <IdleState>();

            TouchDamage = 0;
        }
Exemple #4
0
        protected override void SetStats()
        {
            base.SetStats();

            Width  = 20;
            Height = 20;

            SetMaxHp(10);
            AddDrops(new SingleDrop("bk:ice_skates", 0.01f));

            var body = new RectBodyComponent(3, 19, 10, 5);

            AddComponent(body);

            body.Body.LinearDamping = 1f;
            body.KnockbackModifier  = 2f;
            body.Body.Restitution   = 1;
            body.Body.Friction      = 0;

            AddComponent(new SensorBodyComponent(2, 3, 16, 16));
            AddComponent(new MobAnimationComponent("big_snowball")
            {
                ShadowOffset = 3
            });

            Become <IdleState>();
        }
Exemple #5
0
        public override void AddComponents()
        {
            base.AddComponents();

            var g = new SliceComponent("props", GetSprite());

            AddComponent(g);
            g.SetOwnerSize();

            AddTag(Tags.Item);

            var body = new RectBodyComponent(0, 4, 14, 10);

            AddComponent(body);
            body.Body.Mass = 100000000f;

            AddComponent(new SensorBodyComponent(-2, -2, Width + 4, Height + 4, BodyType.Static));

            AddComponent(new InteractableComponent(Interact)
            {
                CanInteract = CanInteract,
                OnStart     = OnInteractionStart
            });

            AddComponent(new ShadowComponent(RenderShadow));
            AddComponent(new RoomComponent());
        }
        protected override void SetStats()
        {
            base.SetStats();

            Width  = 17;
            Height = 15;

            AddAnimation("emerald_gunner");
            SetMaxHp(4);

            AddDrops(new SingleDrop("bk:emerald", 0.001f));

            Become <IdleState>();

            var body = new RectBodyComponent(1, 13, 15, 1);

            AddComponent(body);

            body.Body.LinearDamping = 6;

            AddComponent(new SensorBodyComponent(1, 2, 15, 12));

            moveId = Rnd.Int(3);
            GetComponent <AudioEmitterComponent>().PitchMod = -0.4f;
            AddComponent(new LightComponent(this, 32, new Color(0.5f, 1f, 0.4f)));
        }
        public override void AddComponents()
        {
            base.AddComponents();

            Width  = tw * 16;
            Height = th * 16 + 6;
            On     = true;

            AddComponent(new StateComponent());
            AddComponent(new AnimationComponent(GetAnimation()));

            var w = tw * 16;
            var h = th * 16;
            var b = new RectBodyComponent(0.5f, 0.5f - 1, w - 1, h + 3);

            AddComponent(b);

            b.Body.Friction = 0;

            Area.Add(left = new PlatformBorder());
            left.Setup(this, -12, 0, 8, th * 16);

            Area.Add(right = new PlatformBorder());
            right.Setup(this, tw * 16 + 4, 0, 8, th * 16);

            Area.Add(up = new PlatformBorder());
            up.Setup(this, 0, -8, tw * 16, 8);

            Area.Add(down = new PlatformBorder());
            down.Setup(this, 0, th * 16 + 1, tw * 16, 8);
        }
Exemple #8
0
        public override void AddComponents()
        {
            base.AddComponents();

            AlwaysActive = true;
            Width        = 12;
            Height       = 10;

            AddComponent(new AnimationComponent("duck"));

            var b = new RectBodyComponent(0, 0, Width, Height);

            AddComponent(b);
            b.KnockbackModifier = 0;

            quantom = Rnd.Chance(1);

            if (Run.Depth == -2)
            {
                AddComponent(new CloseDialogComponent("control_4"));
            }
            else
            {
                AddComponent(new CloseDialogComponent($"duck_{(quantom ? 20 : 19)}"));
            }

            Become <IdleState>();
            GetComponent <DialogComponent>().Dialog.Voice = 4;
        }
        private void LockToWall()
        {
            var dirs = new List <Direction>();

            var x     = (int)Math.Round(X / 16f);
            var y     = (int)Math.Round((Y + 8) / 16f);
            var level = Run.Level;

            if (level.Get(x + 1, y).IsWall())
            {
                dirs.Add(Direction.Left);
            }

            if (level.Get(x - 1, y).IsWall())
            {
                dirs.Add(Direction.Right);
            }

            if (level.Get(x, y + 1).IsWall())
            {
                dirs.Add(Direction.Up);
            }

            if (level.Get(x, y - 1).IsWall())
            {
                dirs.Add(Direction.Down);
            }

            if (dirs.Count == 0)
            {
                Log.Error("No walls to lock to!");

                Timer.Add(() => {
                    Done = true;
                }, 0.1f);

                return;
            }

            CenterX = x * 16 + 8;
            CenterY = y * 16;

            Direction = dirs[Rnd.Int(dirs.Count)];
            var angle = Direction.ToAngle();

            var v    = Direction == Direction.Up || Direction == Direction.Down;
            var body = new RectBodyComponent(Direction == Direction.Left ? 8 : 0, Direction == Direction.Up ? 8 : 0, v ? 16 : 8, v ? 8 : 16, BodyType.Dynamic, true);

            AddComponent(body);
            body.KnockbackModifier = 0;

            GetComponent <WallAnimationComponent>().WallAngle = angle;
            GetComponent <StateComponent>().State             = GetIdleState();
        }
Exemple #10
0
        protected override BodyComponent CreateBody()
        {
            var collider = GetCollider();
            var body     = new RectBodyComponent(collider.X, collider.Y, collider.Width, collider.Height, BodyType.Static);

            //body.Body.LinearDamping = 6f;
            //body.KnockbackModifier = 0.1f;
            //body.Body.Mass = 0.1f;

            return(body);
        }
Exemple #11
0
        public override void AddComponents()
        {
            base.AddComponents();

            AlwaysActive = true;
            Width        = 12;
            Height       = 15;

            AddComponent(new AnimationComponent("accessory_trader"));

            var b = new RectBodyComponent(2, 6, Width - 4, Height - 6);

            AddComponent(b);
            b.KnockbackModifier = 0;
        }
Exemple #12
0
        protected override void SetStats()
        {
            base.SetStats();

            AddAnimation("king");
            SetMaxHp(3);

            Become <IdleState>();

            var body = new RectBodyComponent(2, 2, 12, 12);

            AddComponent(body);

            body.Body.LinearDamping = 4;
        }
Exemple #13
0
        protected override void SetStats()
        {
            base.SetStats();

            AddAnimation("sniper");
            SetMaxHp(4);

            Become <IdleState>();

            var body = new RectBodyComponent(3, 13, 10, 1);

            AddComponent(body);
            body.Body.LinearDamping = 10;

            AddComponent(new SensorBodyComponent(2, 2, 12, 12));
        }
        protected override void SetStats()
        {
            base.SetStats();

            AddComponent(new ZAnimationComponent("desert_slime"));
            SetMaxHp(1 + (int)Math.Round(Run.Depth * 1.5f));

            var body = new RectBodyComponent(2, 12, 12, 1);

            AddComponent(body);

            body.Body.LinearDamping = 2;
            body.KnockbackModifier  = 0.5f;

            AddComponent(new SensorBodyComponent(2, 7, 12, 9));
        }
        protected override void SetStats()
        {
            base.SetStats();

            AddComponent(new ZAnimationComponent(GetSprite()));
            SetMaxHp(1);

            var body = new RectBodyComponent(1, 15, 14, 1);

            AddComponent(body);

            body.Body.LinearDamping = 2;
            body.KnockbackModifier  = 0.5f;

            AddComponent(new SensorBodyComponent(2, 7, 12, 9));
        }
Exemple #16
0
        public override void AddComponents()
        {
            base.AddComponents();

            AlwaysActive = true;
            Width        = 13;
            Height       = 20;

            AddComponent(new AnimationComponent("hat_trader"));

            var b = new RectBodyComponent(2, 6, Width - 4, Height - 6);

            AddComponent(b);
            b.KnockbackModifier = 0;
            GetComponent <DialogComponent>().Dialog.Voice = 6;
        }
Exemple #17
0
        protected override void SetStats()
        {
            base.SetStats();

            SetMaxHp(1);
            AddAnimation("worm");

            GetComponent <MobAnimationComponent>().ShadowOffset = 1;

            var body = new RectBodyComponent(3, 3, 4, 10);

            AddComponent(body);
            body.KnockbackModifier = 0;

            Become <IdleState>();
        }
Exemple #18
0
        protected override void SetStats()
        {
            base.SetStats();

            var body = new RectBodyComponent(4, 2, 8, 14, BodyType.Static, true);

            AddComponent(body);

            body.KnockbackModifier = 0;
            SetMaxHp(10);

            AddAnimation("cactus");

            Become <IdleState>();

            counter = Rnd.Int(4);
        }
Exemple #19
0
        protected override void SetStats()
        {
            base.SetStats();

            SetMaxHp(7);
            AddAnimation("spelunker");

            var body = new RectBodyComponent(3, 15, 10, 1);

            AddComponent(body);

            body.KnockbackModifier  = 2;
            body.Body.LinearDamping = 6;

            AddComponent(new SensorBodyComponent(5, 4, 7, 11));

            Become <IdleState>();
        }
Exemple #20
0
        protected override void SetStats()
        {
            base.SetStats();

            AddAnimation("bandit");
            SetMaxHp(Run.Depth);

            Become <IdleState>();

            var body = new RectBodyComponent(3, 13, 10, 1);

            AddComponent(body);
            body.Body.LinearDamping = 10;

            AddComponent(new SensorBodyComponent(2, 2, 12, 12));

            moveId = Rnd.Int(0, 2);
        }
Exemple #21
0
        protected override void SetStats()
        {
            base.SetStats();

            AddComponent(new ZAnimationComponent("baby_slime"));
            SetMaxHp(1);

            var body = new RectBodyComponent(4, 9, 8, 7);

            AddComponent(body);

            body.Body.LinearDamping = 2;
            body.KnockbackModifier  = 0.5f;

            AddComponent(new SensorBodyComponent(4, 15, 8, 1));

            AddComponent(new LightComponent(this, 32, MotherSlime.LightColor));
        }
Exemple #22
0
        protected override void SetStats()
        {
            base.SetStats();

            Width  = 14;
            Height = 15;

            AddAnimation("rat");
            SetMaxHp(2);

            Become <IdleState>();

            var body = new RectBodyComponent(2, 14, 10, 1);

            AddComponent(body);
            body.Body.LinearDamping = 10;

            AddComponent(new SensorBodyComponent(2, 1, 10, 14));
        }
Exemple #23
0
        protected override void SetStats()
        {
            base.SetStats();

            SetMaxHp(4);
            AddAnimation("mummy");

            var body = new RectBodyComponent(2, 15, 10, 1);

            AddComponent(body);

            body.KnockbackModifier  = 3;
            body.Body.LinearDamping = 6;

            AddComponent(new SensorBodyComponent(3, 3, 7, 13));

            Become <IdleState>();
            TouchDamage = 2;
        }
Exemple #24
0
        public override void AddComponents()
        {
            base.AddComponents();

            Width  = 15;
            Height = 18;

            AddComponent(new SensorBodyComponent(1, 1, 13, 17));

            var body = new RectBodyComponent(2, 17, 11, 1);

            AddComponent(body);

            body.KnockbackModifier  = 0.1f;
            body.Body.LinearDamping = 4;

            AddAnimation("pharaoh");
            SetMaxHp(300);
        }
Exemple #25
0
        public override void AddComponents()
        {
            base.AddComponents();

            Width  = 10;
            Height = 19;

            AddComponent(new SensorBodyComponent(1, 2, 8, 17));

            var body = new RectBodyComponent(1, 18, 8, 1);

            AddComponent(body);

            body.KnockbackModifier  = 0.5f;
            body.Body.LinearDamping = 3;

            AddAnimation("ice_queen");
            SetMaxHp(500);
        }
Exemple #26
0
        public override void AddComponents()
        {
            base.AddComponents();

            AlwaysActive = true;
            Width        = 15;

            AddComponent(new AnimationComponent("grandma"));

            var b = new RectBodyComponent(2, 6, Width - 4, Height - 6);

            AddComponent(b);
            b.KnockbackModifier = 0;

            Subscribe <Dialog.EndedEvent>();
            Subscribe <RoomChangedEvent>();
            Subscribe <ItemTakenEvent>();

            GetComponent <DialogComponent>().Dialog.Voice = 19;
        }
Exemple #27
0
        public override void AddComponents()
        {
            base.AddComponents();

            Width  = 6;
            Height = 8;

            AddComponent(new BooGraphicsComponent("ghost_pet"));

            var b = new RectBodyComponent(0, 0, Width, Height)
            {
                KnockbackModifier = 0.2f
            };

            AddComponent(b);
            b.Body.LinearDamping = 3;


            Become <IdleState>();
        }
Exemple #28
0
        protected override void SetStats()
        {
            base.SetStats();

            Width  = 15;
            Height = 21;

            SetMaxHp(40);

            var body = new RectBodyComponent(2, 20, 11, 1);

            AddComponent(body);

            body.Body.LinearDamping = 4f;

            AddComponent(new SensorBodyComponent(3, 3, 9, 18));
            AddComponent(new MobAnimationComponent("skeleton"));

            Become <SummonState>();
        }
Exemple #29
0
        protected override void SetStats()
        {
            base.SetStats();

            AddAnimation("caster");
            SetMaxHp(4);

            Become <IdleState>();

            var body = new RectBodyComponent(8, 3, 8, 13);

            AddComponent(body);

            body.KnockbackModifier  = 0.5f;
            body.Body.LinearDamping = 0;

            Width = 22;

            AddComponent(new LightComponent(this, 50f, new Color(1f, 1f, 0.7f, 1f)));
        }
Exemple #30
0
        protected override void SetStats()
        {
            base.SetStats();

            AddAnimation("gunner");
            SetMaxHp(5);

            Become <IdleState>();

            var body = new RectBodyComponent(1, 15, 15, 1);

            AddComponent(body);

            body.Body.LinearDamping = 6;

            AddComponent(new SensorBodyComponent(2, 2, 12, 12));

            moveId = Rnd.Int(3);
            GetComponent <AudioEmitterComponent>().PitchMod = -0.3f;
        }