Beispiel #1
0
        private void FireDoubleInternal(float x, float y, float angle) // :)
        {
            Sound.Play("thump");
            var rpg = new TimedMine(TimeSpan.FromSeconds(2))
            {
                Silent = true
            };

            rpg.MoveTo(x, y);
            var rpgSpeed = new SpeedTracker(rpg);

            rpgSpeed.HitDetectionTypes.Add(typeof(Wall));
            rpgSpeed.HitDetectionTypes.Add(typeof(Character));
            rpgSpeed.HitDetectionExclusions.Add(Holder);
            rpgSpeed.ImpactOccurred.SubscribeForLifetime((impact) =>
            {
                if (impact.ElementHit is IDestructible)
                {
                    var destructible = impact.ElementHit as IDestructible;
                    destructible.TakeDamage(5 * rpg.HealthPointsPerShrapnel);
                }

                rpg.Explode();
            }, rpg.Lifetime);

            new Force(rpgSpeed, SpaceExtensions.NormalizeQuantity(25, angle), angle);
            SpaceTime.CurrentSpaceTime.Add(rpg);
        }
Beispiel #2
0
        public override void FireInternal()
        {
            var mine = new TimedMine(this, Delay);

            ProximityMineDropper.PlaceMineSafe(mine, Holder);
            SpaceTime.CurrentSpaceTime.Add(mine);
            mine.Exploded.SubscribeOnce(this.Exploded.Fire);
        }
Beispiel #3
0
        public override void FireInternal()
        {
            var mine = new TimedMine(Delay);

            mine.MoveTo(Holder.Left, Holder.Top);
            SpaceTime.CurrentSpaceTime.Add(mine);
            mine.Exploded.SubscribeOnce(this.Exploded.Fire);
        }
Beispiel #4
0
        private void FireDoubleInternal(float x, float y, float angle) // :)
        {
            var rpg = new TimedMine(this, TimeSpan.FromSeconds(2))
            {
                Silent = true, ProjectilePen = ProjectilePen
            };

            rpg.MoveTo(x, y, Holder.ZIndex);
            var rpgSpeed = new SpeedTracker(rpg);

            rpgSpeed.HitDetectionExclusions.Add(Holder);
            Holder.Speed.HitDetectionExclusions.Add(rpg);
            rpgSpeed.ImpactOccurred.SubscribeForLifetime((impact) =>
            {
                DamageBroker.Instance.ReportImpact(impact);
                rpg.Explode();
            }, rpg.Lifetime);

            new Force(rpgSpeed, 45.NormalizeQuantity(angle), angle);
            SpaceTime.CurrentSpaceTime.Add(rpg);
        }