当前位置: 首页>>代码示例>>C#>>正文


C# Projectile.LaunchArc方法代码示例

本文整理汇总了C#中Projectile.LaunchArc方法的典型用法代码示例。如果您正苦于以下问题:C# Projectile.LaunchArc方法的具体用法?C# Projectile.LaunchArc怎么用?C# Projectile.LaunchArc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Projectile的用法示例。


在下文中一共展示了Projectile.LaunchArc方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: _setupReturnProjectile

        private void _setupReturnProjectile(Vector3D spawnPosition)
        {
            Vector3D inFrontOfUser = PowerMath.TranslateDirection2D(User.Position, spawnPosition, User.Position, 5f);

            var return_proj = new Projectile(this, 79400, new Vector3D(spawnPosition.X, spawnPosition.Y, User.Position.Z));
            return_proj.Scale = 3f;
            return_proj.DestroyOnArrival = true;
            return_proj.LaunchArc(inFrontOfUser, 1f, -0.03f);
            User.AddRopeEffect(79402, return_proj);
        }
开发者ID:tovipoussin,项目名称:mooege,代码行数:10,代码来源:Barbarian.cs

示例2: Run

        public override IEnumerable<TickTimer> Run()
        {
            StartCooldown(EvalTag(PowerKeys.CooldownTime));
            UsePrimaryResource(EvalTag(PowerKeys.ResourceCost));

            if (Rune_C > 0)
            {
                // NOTE: not normal plague of toads right now but Obsidian runed "Toad of Hugeness"
                Vector3D userCastPosition = new Vector3D(User.Position);
                Vector3D inFrontOfUser = PowerMath.TranslateDirection2D(User.Position, TargetPosition, User.Position, 7f);
                var bigtoad = SpawnEffect(109906, inFrontOfUser, TargetPosition, WaitInfinite());

                // HACK: holy hell there is alot of hardcoded animation timings here

                bigtoad.PlayActionAnimation(110766); // spawn ani
                yield return WaitSeconds(1f);

                bigtoad.PlayActionAnimation(110520); // attack ani
                TickTimer waitAttackEnd = WaitSeconds(1.5f);
                yield return WaitSeconds(0.3f); // wait for attack ani to play a bit

                var tongueEnd = SpawnProxy(TargetPosition, WaitInfinite());
                bigtoad.AddRopeEffect(107892, tongueEnd);

                yield return WaitSeconds(0.3f); // have tongue hang there for a bit

                var tongueMover = new Implementations.KnockbackBuff(-0.01f, 3f, -0.1f);
                this.World.BuffManager.AddBuff(bigtoad, tongueEnd, tongueMover);
                if (ValidTarget())
                    this.World.BuffManager.AddBuff(bigtoad, Target, new Implementations.KnockbackBuff(-0.01f, 3f, -0.1f));

                yield return tongueMover.ArrivalTime;
                tongueEnd.Destroy();

                if (ValidTarget())
                {
                    _SetHiddenAttribute(Target, true);

                    if (!waitAttackEnd.TimedOut)
                        yield return waitAttackEnd;

                    bigtoad.PlayActionAnimation(110636); // disgest ani, 5 seconds
                    for (int n = 0; n < 5 && ValidTarget(); ++n)
                    {
                        WeaponDamage(Target, 0.039f, DamageType.Poison);
                        yield return WaitSeconds(1f);
                    }

                    if (ValidTarget())
                    {
                        _SetHiddenAttribute(Target, false);

                        bigtoad.PlayActionAnimation(110637); // regurgitate ani
                        this.World.BuffManager.AddBuff(bigtoad, Target, new Implementations.KnockbackBuff(36f));
                        Target.PlayEffectGroup(18281); // actual regurgitate efg isn't working so use generic acid effect
                        yield return WaitSeconds(0.9f);
                    }
                }

                bigtoad.PlayActionAnimation(110764); // despawn ani
                yield return WaitSeconds(0.7f);
                bigtoad.Destroy();
            }
            TickTimer frog = WaitSeconds(ScriptFormula(5));
            Vector3D inFrontOfminiToads = PowerMath.TranslateDirection2D(User.Position, TargetPosition, User.Position, 7f);
            var projectile = new Projectile(this, 105792, User.Position);
            projectile.LaunchArc(inFrontOfminiToads, 3f, -0.03f);
            projectile.OnCollision = (hit) =>
            {
                //destroying it while in Launcharc causes an exception.
                //projectile.Destroy();
            };
            projectile.OnArrival = () => { };
            yield return WaitSeconds(1.2f);
            projectile.LaunchArc(new Vector3D(RandomDirection(projectile.Position, 4f, 7f)), 3f, -0.03f);
            projectile.OnArrival = () => { };
            yield return WaitSeconds(1.2f);

            /*
             * for regular toads, there is a max of 3 frogs per cast, they are classifyed as projectile with a lifetime of 3.
             */
        }
开发者ID:vrobel,项目名称:mooege,代码行数:82,代码来源:WitchDoctor.cs

示例3: Main

        //NoRune:blank, A: radius, B: Bounce, C: Pool, D: Turret, E: chainLightning
        //TODO:Rune_B,D,E
        //Rune_B -> Allows skull to bounce up to two times, reduce damage by 15%
        //Rune_E -> Instead of firebomb doing AoE, each does direct damage to enemy then bounces to up to nearby enemies, reduce damage by 20%
        public override IEnumerable<TickTimer> Main()
        {
            UsePrimaryResource(EvalTag(PowerKeys.ResourceCost));

            Projectile[] grenades = new Projectile[1];
            for (int i = 0; i < grenades.Length; ++i)
            {
                var projectile = new Projectile(this, 6453, User.Position);
                grenades[i] = projectile;
            }

            float height = ScriptFormula(3);

            for (int i = 0; i < grenades.Length; ++i)
            {
                grenades[i].LaunchArc(PowerMath.TranslateDirection2D(TargetPosition, User.Position, TargetPosition,
                                                                      0f), height, ScriptFormula(2));
            }
            yield return grenades[0].ArrivalTime;

            if (Rune_D > 0)
            {
                //TODO:figure out the column animation.
                var FireColumn = new EffectActor(this, -1, TargetPosition);
                FireColumn.Timeout = WaitSeconds(ScriptFormula(14));
                FireColumn.Scale = 2f;
                FireColumn.Spawn();
                FireColumn.UpdateDelay = 0.33f; // attack every half-second
                FireColumn.OnUpdate = () =>
                {
                    var targets = GetEnemiesInRadius(FireColumn.Position, ScriptFormula(26));
                    if (targets.Actors.Count > 0 && targets != null)
                    {
                        targets.SortByDistanceFrom(FireColumn.Position);
                        var proj = new Projectile(this, 193969, FireColumn.Position);
                        proj.Position.Z += 5f;  // unknown if this is needed
                        proj.OnCollision = (hit) =>
                        {
                            WeaponDamage(hit, ScriptFormula(13), DamageType.Fire);

                            proj.Destroy();
                        };
                        FireColumn.TranslateFacing(targets.Actors[0].Position, true);
                        proj.LaunchArc(targets.Actors[0].Position, ScriptFormula(29), ScriptFormula(28));
                    }

                };
            }
            else
            {
                foreach (var grenade in grenades)
                {
                    var grenadeN = grenade;

                    SpawnEffect(6451, TargetPosition);

                    if (Rune_C > 0)
                    {
                        var pool = SpawnEffect(6483, grenade.Position, 0, WaitSeconds(ScriptFormula(12)));
                        pool.UpdateDelay = 1f;
                        pool.OnUpdate = () =>
                        {
                            WeaponDamage(GetEnemiesInRadius(grenadeN.Position, ScriptFormula(11)), ScriptFormula(10), DamageType.Fire);
                        };
                    }

                    AttackPayload attack = new AttackPayload(this);
                    attack.Targets = GetEnemiesInRadius(grenade.Position, ScriptFormula(4));
                    attack.AddWeaponDamage(ScriptFormula(0), DamageType.Fire);
                    attack.OnHit = (hitPayload) =>
                    {
                        if (Rune_A > 0)
                        {
                            SpawnEffect(193964, grenade.Position);
                            WeaponDamage(GetEnemiesInRadius(grenadeN.Position, ScriptFormula(5)), ScriptFormula(6), DamageType.Fire);
                        }
                    };
                    attack.Apply();
                }
            }
        }
开发者ID:vrobel,项目名称:mooege,代码行数:85,代码来源:WitchDoctor.cs

示例4: _RuneC

        IEnumerable<TickTimer> _RuneC()
        {
            var demon = new Projectile(this, 155276, TargetPosition);
            demon.Timeout = WaitSeconds(ScriptFormula(30));

            TickTimer grenadeTimer = null;
            demon.OnUpdate = () =>
            {
                if (grenadeTimer == null || grenadeTimer.TimedOut)
                {
                    grenadeTimer = WaitSeconds(ScriptFormula(31));

                    demon.PlayEffect(Effect.Sound, 215621);

                    var grenade = new Projectile(this, 152589, demon.Position);
                    grenade.Position.Z += 18f;  // make it spawn near demon's cannon
                    grenade.Timeout = WaitSeconds(ScriptFormula(33));
                    grenade.OnTimeout = () =>
                    {
                        grenade.PlayEffectGroup(154020);
                        WeaponDamage(GetEnemiesInRadius(grenade.Position, ScriptFormula(32)), ScriptFormula(0), DamageType.Fire);
                    };
                    grenade.LaunchArc(demon.Position, 0.1f, -0.1f, 0.6f);  // parameters not based on anything, just picked to look good
                }
            };

            bool firstLaunch = true;
            while (!demon.Timeout.TimedOut)
            {
                demon.Launch(RandomDirection(TargetPosition, 0f, ScriptFormula(7)), 0.2f);
                if (firstLaunch)
                {
                    demon.PlayEffectGroup(165237);
                    firstLaunch = false;
                }
                yield return demon.ArrivalTime;
            }
        }
开发者ID:loonbg,项目名称:mooege,代码行数:38,代码来源:DemonHunter.cs

示例5: Main

        public override IEnumerable<TickTimer> Main()
        {
            var proj = new Projectile(this, RuneSelect(106504, 215811, 215815, 215816, 215814, 215813), User.Position);
            proj.Position.Z += 5f;
            proj.LaunchArc(TargetPosition, 5f, -0.07f);
            yield return WaitSeconds(0.4f);
            proj.OnArrival = () =>
                {
                    proj.Destroy();
                };
            SpawnEffect(110714, TargetPosition);

            //the rest of this is spiders, which are pets i presume?
            yield return WaitSeconds(0.05f);
            SpawnEffect(107031, TargetPosition);

            yield break;
        }
开发者ID:Vallenhael,项目名称:mooege,代码行数:18,代码来源:WitchDoctor.cs


注:本文中的Projectile.LaunchArc方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。