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


C# Projectile.Destroy方法代码示例

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


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

示例1: Main

        public override IEnumerable<TickTimer> Main()
        {
            StartCooldown(EvalTag(PowerKeys.CooldownTime));
            UsePrimaryResource(EvalTag(PowerKeys.ResourceCost));
            int numProjectiles = Rune_B > 0 ? (int)ScriptFormula(4) : 1;
            for (int n = 0; n < numProjectiles; ++n)
            {
                if (Rune_B > 0)
                    yield return WaitSeconds(ScriptFormula(17));

                var proj = new Projectile(this,
                                          RuneSelect(107011, 107030, 107035, 107223, 107265, 107114),
                                          User.Position);
                proj.Position.Z += 3f;
                proj.OnCollision = (hit) =>
                {
                    // TODO: fix positioning of hit actors. possibly increase model scale? 
                    SpawnEffect(RuneSelect(112327, 112338, 112327, 112345, 112347, 112311), proj.Position);

                    proj.Destroy();

                    if (Rune_E > 0 && Rand.NextDouble() < ScriptFormula(11))
                        hit.PlayEffectGroup(107163);

                    if (Rune_A > 0)
                        WeaponDamage(hit, ScriptFormula(2), DamageType.Fire);
                    else
                        WeaponDamage(hit, ScriptFormula(0), DamageType.Poison);
                };
                proj.Launch(TargetPosition, 1f);
            }
        }
开发者ID:vrobel,项目名称:mooege,代码行数:32,代码来源:WitchDoctor.cs

示例2: Main

        public override IEnumerable<TickTimer> Main()
        {
            GeneratePrimaryResource(ScriptFormula(17));

            // fire projectile normally, or find targets in arc if RuneB
            Vector3D[] targetDirs;
            if (Rune_B > 0)
            {
                targetDirs = new Vector3D[(int)ScriptFormula(24)];

                int takenPos = 0;
                foreach (Actor actor in GetEnemiesInArcDirection(User.Position, TargetPosition, 75f, ScriptFormula(12)).Actors)
                {
                    targetDirs[takenPos] = actor.Position;
                    ++takenPos;
                    if (takenPos >= targetDirs.Length)
                        break;
                }

                // generate any extra positions using generic spread
                if (takenPos < targetDirs.Length)
                {
                    PowerMath.GenerateSpreadPositions(User.Position, TargetPosition, 10f, targetDirs.Length - takenPos)
                             .CopyTo(targetDirs, takenPos);
                }
            }
            else
            {
                targetDirs = new Vector3D[] { TargetPosition };
            }

            foreach (Vector3D position in targetDirs)
            {
                var proj = new Projectile(this, RuneSelect(77569, 153864, 153865, 153866, 153867, 153868), User.Position);
                proj.Position.Z += 5f;  // fix height
                proj.OnCollision = (hit) =>
                {
                    // hit effect
                    hit.PlayEffectGroup(RuneSelect(77577, 153870, 153872, 153873, 153871, 153869));

                    if (Rune_B > 0)
                        WeaponDamage(hit, ScriptFormula(9), DamageType.Poison);
                    else
                        AddBuff(hit, new ExplosionBuff());

                    proj.Destroy();
                };
                proj.Launch(position, ScriptFormula(2));

                if (Rune_B > 0)
                    yield return WaitSeconds(ScriptFormula(13));
            }
        }
开发者ID:rinoa,项目名称:mooege-1,代码行数:53,代码来源:DemonHunter.cs

示例3: Main

        public override IEnumerable<TickTimer> Main()
        {
            if (Rune_D > 0)
            {
                //SpawnEffect(222156, User.Position);
                WeaponDamage(GetEnemiesInRadius(User.Position, ScriptFormula(11)), ScriptFormula(12), DamageType.Physical);
            }
            else
            {
                var proj = new Projectile(this, RuneSelect(220527, 222102, 222115, 222128, -1, 222141), User.Position);
                proj.Position.Z += 5f;  // fix height
                proj.OnCollision = (hit) =>
                {
                    hit.PlayEffectGroup(RuneSelect(221164, 222107, 222120, 222133, -1, 222146));
                    WeaponDamage(hit, ScriptFormula(0), DamageType.Physical);

                    if (Rune_E > 0)
                    {
                        //if critical hit, do weapondamage (SF(13)) as well as damage below.
                    }

                    if (Rune_A > 0)
                    {
                        //Nothing goes here.
                    }
                    else
                    {
                        if (Rune_B > 0)
                        {
                            Knockback(User.Position, hit, ScriptFormula(4));
                            AddBuff(hit, new DebuffStunned(WaitSeconds(ScriptFormula(6))));
                        }
                        if (Rune_C > 0)
                        {
                            AddBuff(hit, new ActiveCalTrops());
                        }
                        proj.Destroy();

                    }
                };
                proj.Launch(TargetPosition, ScriptFormula(2));
            }
            yield return WaitSeconds(1f);
        }
开发者ID:SvenEvert,项目名称:mooege,代码行数:44,代码来源:DemonHunter.cs

示例4: Main

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

            if (Rune_B > 0)
            {
                //throw projectile -> once collision with target, RopeEffect up to ScriptFromula(5) times.
            }
            else
            {
                var proj = new Projectile(this, RuneSelect(100800, 100839, 166438, 100832, 101057, 100934), User.Position);
                proj.Position.Z += 5f;  // fix height
                proj.OnCollision = (hit) =>
                {
                    hit.PlayEffectGroup(RuneSelect(18707, 166333, 16634, 166335, -1, 166339));
                    WeaponDamage(hit, ScriptFormula(15), DamageType.Physical);
                    if (Rune_C > 0)
                    {
                        if (Rand.NextDouble() < ScriptFormula(0))
                        {
                            AddBuff(hit, new DebuffStunned(WaitSeconds(ScriptFormula(7))));
                        }
                    }
                    if (Rune_D > 0)
                    {
                        float CurrentResource = User.Attributes[GameAttribute.Resource_Cur];
                        //Use remaining Fury points. Get Remaining Fury Points, use that to multiply against SF(18), and add that to total damage.
                        float DamageTotal = ScriptFormula(15) + (ScriptFormula(18) * CurrentResource);

                        WeaponDamage(GetEnemiesInRadius(hit.Position, ScriptFormula(19)), DamageTotal, DamageType.Physical);
                    }
                    if (Rune_E > 0)
                    {
                        if (Rand.NextDouble() < 1)
                        {
                            AddBuff(hit, new ConfuseDebuff());
                            //This will cause a buff on the target hit, changing their attack from the User, to other Mobs.
                        }
                    }
                    proj.Destroy();
                };
                proj.Launch(TargetPosition, 1.5f);
            }
            yield break;
        }
开发者ID:tovipoussin,项目名称:mooege,代码行数:46,代码来源:Barbarian.cs

示例5: Main

        public override IEnumerable<TickTimer> Main()
        {
            //StartCooldown(WaitSeconds(10f));
            if (Rune_B > 0)
            {
                Vector3D[] projDestinations = PowerMath.GenerateSpreadPositions(User.Position, TargetPosition, ScriptFormula(9), (int)ScriptFormula(11));

                for (int i = 0; i < projDestinations.Length; i++)
                {
                    var proj = new Projectile(this, 74636, User.Position);
                    proj.Timeout = WaitSeconds(0.5f);
                    proj.OnCollision = (hit) =>
                    {
                        GeneratePrimaryResource(15f);

                        _setupReturnProjectile(hit.Position);

                        AttackPayload attack = new AttackPayload(this);
                        attack.SetSingleTarget(hit);
                        attack.AddWeaponDamage(ScriptFormula(0), DamageType.Physical);
                        attack.OnHit = (hitPayload) =>
                        {
                            hitPayload.Target.PlayEffectGroup(79420);
                            Knockback(hitPayload.Target, -25f, ScriptFormula(3), ScriptFormula(4));
                        };
                        attack.Apply();

                        proj.Destroy();
                    };
                    proj.OnTimeout = () =>
                    {
                        _setupReturnProjectile(proj.Position);
                    };

                    proj.Launch(projDestinations[i], ScriptFormula(8));
                    User.AddRopeEffect(79402, proj);
                }
            }
            else if (Rune_A > 0)
            {
                //Straight line but brings all the zombies in that line back to you.
            }
            else
            {
                var projectile = new Projectile(this, 74636, User.Position);
                projectile.Timeout = WaitSeconds(0.5f);
                projectile.OnCollision = (hit) =>
                {
                    GeneratePrimaryResource(ScriptFormula(12) + ScriptFormula(13));

                    _setupReturnProjectile(hit.Position);

                    AttackPayload attack = new AttackPayload(this);
                    attack.SetSingleTarget(hit);
                    attack.AddWeaponDamage(ScriptFormula(0), DamageType.Physical);
                    attack.OnHit = (hitPayload) =>
                    {
                        // GET OVER HERE
                        //unknown on magnitude/knockback offset?
                        hitPayload.Target.PlayEffectGroup(79420);
                        Knockback(hitPayload.Target, -25f, ScriptFormula(3), ScriptFormula(4));
                    };
                    attack.Apply();

                    projectile.Destroy();
                };
                projectile.OnTimeout = () =>
                {
                    _setupReturnProjectile(projectile.Position);
                };

                projectile.Launch(TargetPosition, ScriptFormula(8));
                User.AddRopeEffect(79402, projectile);
            }
            yield break;
        }
开发者ID:Vallenhael,项目名称:mooege,代码行数:76,代码来源:Barbarian.cs

示例6: Main


//.........这里部分代码省略.........
                hydra1.UpdateDelay = 3f;
                hydra1.OnUpdate = () =>
                {
                    var target = GetEnemiesInRadius(hydra1.Position, 50f).GetClosestTo(hydra1.Position);
                    float castAngle = MovementHelpers.GetFacingAngle(hydra1.Position, target.Position);
                    hydra1.TranslateFacing(target.Position, true);
                    //timeout is set to 3, but starts while casting firewall, when it should start after firewall has spawned (1.8seconds)
                    var firewall = SpawnEffect(86082, hydra1.Position, castAngle, WaitSeconds(3f));
                    firewall.UpdateDelay = 1f;
                    firewall.OnUpdate = () =>
                    {
                        WeaponDamage(GetEnemiesInBeamDirection(hydra1.Position, target.Position, 50f, 5f), 1.00f, DamageType.Fire);
                    };

                };
            }
            else if (Rune_A > 0)
            {

                var hydra1 = SpawnEffect(actorSNOs[0], spawnPoints[0], 0, timeout);
                hydra1.UpdateDelay = 1.5f; // attack every half-second
                hydra1.OnUpdate = () =>
                {
                    var target = GetEnemiesInRadius(hydra1.Position, 15f).GetClosestTo(hydra1.Position);
                    float castAngle = MovementHelpers.GetFacingAngle(hydra1.Position, target.Position);
                    hydra1.TranslateFacing(target.Position, true);
                    var ConeOfCold = SpawnEffect(83043, hydra1.Position, castAngle, WaitSeconds(ScriptFormula(7)));
                    ConeOfCold.UpdateDelay = ScriptFormula(6);
                    ConeOfCold.OnUpdate = () =>
                    {
                        WeaponDamage(GetEnemiesInArcDirection(hydra1.Position, Target.Position, ScriptFormula(3), ScriptFormula(2)), 1.00f, DamageType.Cold);
                    };

                };
            }
            else if (Rune_B > 0)
            {
                var hydra1 = SpawnEffect(actorSNOs[0], spawnPoints[0], 0, timeout);
                hydra1.UpdateDelay = 1.5f; // attack every half-second
                hydra1.OnUpdate = () =>
                {
                    var targets = GetEnemiesInRadius(hydra1.Position, 50f);
                    if (targets.Actors.Count > 0 && targets != null)
                    {
                        //capsule width TODO
                        targets.SortByDistanceFrom(hydra1.Position);
                        hydra1.TranslateFacing(targets.Actors[0].Position, true);
                        hydra1.AddRopeEffect(83875, targets.Actors[0]);
                        WeaponDamage(targets.Actors[0], 1.00f, DamageType.Lightning);
                    }
                };
            }
            else
            {
                var hydra1 = SpawnEffect(actorSNOs[0], spawnPoints[0], 0, timeout);
                hydra1.UpdateDelay = 1.5f; // attack every half-second
                hydra1.OnUpdate = () =>
                {
                    var targets = GetEnemiesInRadius(hydra1.Position, 60f);
                    if (targets.Actors.Count > 0 && targets != null)
                    {
                        targets.SortByDistanceFrom(hydra1.Position);
                        var proj = new Projectile(this, RuneSelect(77116, 83043, -1, 77109, 86082, 77097), hydra1.Position);
                        proj.Position.Z += 5f;  // fix height
                        proj.OnCollision = (hit) =>
                        {
                            if (Rune_C > 0)
                            {
                                hit.PlayEffectGroup(RuneSelect(219760, 219770, 219776, 219789, -1, 81739));
                                hit.PlayEffectGroup(215394);
                                var PoisonCloud = SpawnProxy(hit.Position, WaitSeconds(ScriptFormula(5)));
                                PoisonCloud.UpdateDelay = ScriptFormula(4); // attack every half-second
                                PoisonCloud.OnUpdate = () =>
                                {
                                    WeaponDamage(GetEnemiesInRadius(hit.Position, ScriptFormula(6)), 1.00f, DamageType.Poison);
                                };
                            }
                            else if (Rune_E > 0)
                            {
                                hit.PlayEffectGroup(81874);
                                WeaponDamage(GetEnemiesInRadius(hit.Position, ScriptFormula(0)), 1.00f, DamageType.Arcane);
                            }
                            else
                            {
                                hit.PlayEffectGroup(RuneSelect(219760, 219770, 219776, 219789, -1, 81739));
                                WeaponDamage(hit, 1.00f, DamageType.Fire);
                            }

                            proj.Destroy();
                        };
                        hydra1.TranslateFacing(targets.Actors[0].Position, true);
                        //need to fix how fast it fires -> its firing before head turns.
                        proj.Launch(targets.Actors[0].Position, ScriptFormula(2));
                    }

                };
            }
            // wait for duration of skill
            yield return timeout;
        }
开发者ID:n4v,项目名称:mooege,代码行数:101,代码来源:Wizard.cs

示例7: Main

        public override IEnumerable<TickTimer> Main()
        {
            //http://www.youtube.com/watch?v=9xKCTla3sQU

            //swirling motion with projectile is NoRune.

            //Rune_A has two chakrams, both same direction just flipped paths

            //Rune_B makes a boomerrang, travelling away from then back to User

            //Rune_C makes a slow curve
            //projectile speed = 0.2 while the rest is done by attack speed

            //Rune_D spirals out to target, actor calls it a straight projectile.

            //Rune_E is just a buff shield
            if (Rune_E > 0)
            {
                AddBuff(User, new ChakramBuff());
            }
            else
            {
                var proj = new Projectile(this, RuneSelect(129228, 129228, 148845, 148846, 148847, -1), User.Position);
                proj.Position.Z += 3f;  // fix height //might be a better height at 3?
                proj.Launch(TargetPosition, 0.2f);
                proj.OnCollision = (hit) =>
                {
                    WeaponDamage(hit, ScriptFormula(0), RuneSelect(DamageType.Physical, DamageType.Physical, DamageType.Lightning, DamageType.Poison, DamageType.Arcane, DamageType.Physical));
                    proj.Destroy();
                };
            }
            yield break;
        }
开发者ID:loonbg,项目名称:mooege,代码行数:33,代码来源:DemonHunter.cs

示例8: 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

示例9: Main

        //From videos: it seems you proxy the Proxy actor first, the "hit" looks like it goes with the projectile...
        public override IEnumerable<TickTimer> Main()
        {
            StartCooldown(EvalTag(PowerKeys.CooldownTime));
            //UsePrimaryResource(EvalTag(PowerKeys.ResourceCost));

            //projectile distance (50)
            if (Rune_B > 0)
            {
                Vector3D[] projDestinations = PowerMath.GenerateSpreadPositions(User.Position, TargetPosition, 45f, (int)ScriptFormula(25));

                yield return WaitSeconds(0.35f);

                for (int i = 0; i < projDestinations.Length; i++)
                {
                    var proj = new Projectile(this, 172310, User.Position);
                    proj.Launch(projDestinations[i], ScriptFormula(22));
                    proj.OnCollision = (hit) =>
                    {
                        hit.PlayEffectGroup(145443);
                        proj.Destroy();
                        WeaponDamage(hit, ScriptFormula(23), DamageType.Holy);
                    };
                }
            }
            else if (Rune_C > 0)
            {
                //add in pillar [temple.efg and hit_hp.acr and pillar_a.acr?]
                Vector3D inFrontOfUser = PowerMath.TranslateDirection2D(User.Position, TargetPosition, User.Position, ScriptFormula(8));
                
                yield return WaitSeconds(0.35f);
                
                AttackPayload attack = new AttackPayload(this);
                attack.Targets = GetEnemiesInRadius(inFrontOfUser, 20f);
                attack.AddWeaponDamage(ScriptFormula(17), DamageType.Holy);
                attack.OnHit = hit =>
                    {
                        Knockback(hit.Target, ScriptFormula(5), ScriptFormula(6), ScriptFormula(7));
                            AddBuff(hit.Target, new DOTbuff(WaitSeconds(ScriptFormula(9))));
                    };

            }
            else
            {
                Vector3D inFrontOfUser = PowerMath.TranslateDirection2D(User.Position, TargetPosition, User.Position, ScriptFormula(8));
                AttackPayload attack = new AttackPayload(this);
                attack.Targets = GetEnemiesInRadius(inFrontOfUser, 10f);
                attack.AddWeaponDamage(ScriptFormula(14), DamageType.Holy);
                attack.OnHit = hit =>
                {
                    if (hit.IsCriticalHit)
                    {
                        AddBuff(hit.Target, new DebuffStunned(WaitSeconds(ScriptFormula(39))));
                    }
                };

                yield return WaitSeconds(0.35f);
                var proj = new Projectile(this, 6441, User.Position);
                proj.Position.Z += 5f;  // fix height
                proj.OnCollision = (hit) =>
                {
                    hit.PlayEffectGroup(144079);
                    WeaponDamage(hit, ScriptFormula(3), DamageType.Holy);
                    Knockback(User, ScriptFormula(15), ScriptFormula(18), ScriptFormula(20));
                };
                proj.Launch(TargetPosition, ScriptFormula(2));
            }
            yield break;
        }
开发者ID:jujuman,项目名称:mooege,代码行数:69,代码来源:Monk.cs

示例10: Run

        public override IEnumerable<TickTimer> Run()
        {
            UsePrimaryResource(20f);

            User.PlayEffectGroup(19305); // cast effect
            
            var projectile = new Projectile(this, 99567, User.Position);
            projectile.OnCollision = (hit) =>
            {
                SpawnEffect(99572, new Vector3D(hit.Position.X, hit.Position.Y, hit.Position.Z + 5f)); // impact effect (fix height)
                projectile.Destroy();
                WeaponDamage(hit, 1.10f, DamageType.Arcane);
            };
            projectile.Launch(TargetPosition, 1f);

            yield break;
        }
开发者ID:rinoa,项目名称:mooege-1,代码行数:17,代码来源:Wizard.cs


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