示例#1
0
文件: Monk.cs 项目: Ethos/mooege
        public override IEnumerable<TickTimer> Main()
        {
            float reachLength;
            float reachThickness;

            switch(ComboIndex)
            {
                case 0:
                    reachLength = 13;
                    reachThickness = 3f;
                    break;
                case 1:
                    reachLength = 14;
                    reachThickness = 4.5f;
                    break;
                case 2:
                    reachLength = 18;
                    reachThickness = 4.5f;
                    break;
                default:
                    yield break;
            }

            bool hitAnything = false;
            AttackPayload attack = new AttackPayload(this);
            attack.Targets = GetEnemiesInBeamDirection(User.Position, TargetPosition, reachLength, reachThickness);
            attack.AddWeaponDamage(1.20f, DamageType.Physical);
            attack.OnHit = hitPayload => { hitAnything = true; };
            attack.Apply();

            if (hitAnything)
                GeneratePrimaryResource(6f);

            yield break;
        }
示例#2
0
        public void ApplyDamage(AttackPayload payload)
        {
            var config = _damageConfigLookUp[payload.AttackType];

            _rigidbody.AddForce(payload.Direction * (payload.Force * config.Force), ForceMode2D.Impulse);
            OnDamage?.Invoke(payload.AttackType);
        }
示例#3
0
            public override bool Update()
            {
                if (Timeout.TimedOut)
                {
                    Target.PlayEffectGroup(RuneSelect(77573, 153727, 154073, 154074, 154072, 154070));

                    if (Rune_D > 0)
                    {
                        if (Rand.NextDouble() < ScriptFormula(31))
                        {
                            GenerateSecondaryResource(ScriptFormula(32));
                        }
                    }

                    AttackPayload attack = new AttackPayload(this);
                    attack.Targets = GetEnemiesInRadius(Target.Position, ScriptFormula(20));
                    attack.AddWeaponDamage(ScriptFormula(6),
                                           RuneSelect(DamageType.Fire, DamageType.Fire, DamageType.Poison,
                                                      DamageType.Lightning, DamageType.Fire, DamageType.Arcane));
                    if (Rune_C > 0)
                    {
                        attack.OnHit = (hitPayload) =>
                        {
                            if (Rand.NextDouble() < ScriptFormula(28))
                            {
                                AddBuff(hitPayload.Target, new DebuffStunned(WaitSeconds(ScriptFormula(29))));
                            }
                        };
                    }
                    attack.Apply();
                }

                return(base.Update());
            }
示例#4
0
        public override IEnumerable <TickTimer> Main()
        {
            //StartCooldown(WaitSeconds(10f));

            var projectile = new Projectile(this, 74636, User.Position);

            projectile.Timeout     = WaitSeconds(0.5f);
            projectile.OnCollision = (hit) =>
            {
                GeneratePrimaryResource(15f);

                _setupReturnProjectile(hit.Position);

                AttackPayload attack = new AttackPayload(this);
                attack.SetSingleTarget(hit);
                attack.AddWeaponDamage(1.00f, DamageType.Physical);
                attack.OnHit = (hitPayload) =>
                {
                    // GET OVER HERE
                    Knockback(hitPayload.Target, -25f, 1f, -0.03f);
                };
                attack.Apply();

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

            projectile.Launch(TargetPosition, 1.9f);
            User.AddRopeEffect(79402, projectile);

            yield break;
        }
示例#5
0
        IEnumerable <TickTimer> _RuneE()
        {
            float    attackRadius   = 8f; // value is not in formulas, just a guess
            Vector3D castedPosition = new Vector3D(User.Position);
            float    castAngle      = MovementHelpers.GetFacingAngle(castedPosition, TargetPosition);
            float    waveOffset     = 0f;

            int flyerCount = (int)ScriptFormula(15);

            for (int n = 0; n < flyerCount; ++n)
            {
                waveOffset += 3.0f;
                var wavePosition  = PowerMath.TranslateDirection2D(castedPosition, TargetPosition, castedPosition, waveOffset);
                var flyerPosition = RandomDirection(wavePosition, 0f, attackRadius);
                var flyer         = SpawnEffect(200561, flyerPosition, castAngle, WaitSeconds(ScriptFormula(20)));
                flyer.OnTimeout = () =>
                {
                    flyer.PlayEffectGroup(200819);
                    AttackPayload attack = new AttackPayload(this);
                    attack.Targets = GetEnemiesInRadius(flyerPosition, attackRadius);
                    attack.AddWeaponDamage(ScriptFormula(11), DamageType.Physical);
                    attack.OnHit = (hitPayload) => { Knockback(hitPayload.Target, 90f); };
                    attack.Apply();
                };

                yield return(WaitSeconds(ScriptFormula(4)));
            }
        }
示例#6
0
        public void WeaponDamage(Actor target, float damageMultiplier, DamageType damageType)
        {
            AttackPayload payload = new AttackPayload(this);

            payload.SetSingleTarget(target);
            payload.AddWeaponDamage(damageMultiplier, damageType);
            payload.Apply();
        }
示例#7
0
        public void Damage(TargetList targets, float minDamage, float damageDelta, DamageType damageType)
        {
            AttackPayload payload = new AttackPayload(this);

            payload.Targets = targets;
            payload.AddDamage(minDamage, damageDelta, damageType);
            payload.Apply();
        }
示例#8
0
        public void Damage(Actor target, float minDamage, float damageDelta, DamageType damageType)
        {
            AttackPayload payload = new AttackPayload(this);

            payload.SetSingleTarget(target);
            payload.AddDamage(minDamage, damageDelta, damageType);
            payload.Apply();
        }
示例#9
0
        public void WeaponDamage(TargetList targets, float damageMultiplier, DamageType damageType)
        {
            AttackPayload payload = new AttackPayload(this);

            payload.Targets = targets;
            payload.AddWeaponDamage(damageMultiplier, damageType);
            payload.Apply();
        }
示例#10
0
        public override IEnumerable<TickTimer> Main()
        {
            bool hitAnything = false;
            var ShockWavePos = PowerMath.TranslateDirection2D(User.Position, TargetPosition,
                                                             User.Position,
                                                            ScriptFormula(23));
            var maxHits = ScriptFormula(1);
            for (int i = 0; i < maxHits; ++i)
            {
                AttackPayload attack = new AttackPayload(this);
                attack.Targets = GetBestMeleeEnemy();

                if (i == 0)
                { attack.AddWeaponDamage(ScriptFormula(3), DamageType.Physical); }
                else
                { attack.AddWeaponDamage(ScriptFormula(12), DamageType.Physical); }

                attack.OnHit = hitPayload =>
                {
                    hitAnything = true;
                    if (Rune_D > 0)
                    {
                        GeneratePrimaryResource(ScriptFormula(10));
                    }
                    if (Rune_B > 0)
                    {
                        AddBuff(User, new AddDamageBuff());
                    }

                    if (Rune_A > 0)
                    {
                    }
                    else if (Rune_C > 0)
                    {
                        if (Rand.NextDouble() < ScriptFormula(14))
                            AddBuff(hitPayload.Target, new DebuffStunned(WaitSeconds(ScriptFormula(15))));
                    }
                    else
                    {
                        if (Rand.NextDouble() < ScriptFormula(0))
                            Knockback(hitPayload.Target, ScriptFormula(5), ScriptFormula(6), ScriptFormula(7));
                    }
                };
                attack.Apply();
                yield return WaitSeconds(ScriptFormula(13));

                if(hitAnything)
                    GeneratePrimaryResource(EvalTag(PowerKeys.ResourceGainedOnFirstHit));
            }
            //Shockwave -> capsule distance, at the moment using beamdirection
            if (Rune_E > 0)
            {
                User.PlayEffectGroup(93867);
                yield return WaitSeconds(0.5f);
                WeaponDamage(GetEnemiesInBeamDirection(ShockWavePos, TargetPosition, 30f, 8f), ScriptFormula(18), DamageType.Physical);
            }
            yield break;
        }
示例#11
0
        // I attacked someone
        private void OnAttackPayload(AttackPayload payload)
        {
            foreach (Combatant target in payload.Targets)
            {
                var hitPayload = new HitPayload(payload, this, payload.Power);

                target.SendMessage(hitPayload);
            }
        }
示例#12
0
        public HitPayload(AttackPayload attackPayload, bool criticalHit, Actor target)
            : base(attackPayload.Context, target)
        {
            this.IsCriticalHit = criticalHit;
            
            // TODO: select these values based on element type?
            float weaponMinDamage = this.Context.User.Attributes[GameAttribute.Damage_Weapon_Min_Total, 0];
            float weaponDamageDelta = this.Context.User.Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0];

            // calculate and add up damage amount for each element type
            this.ElementDamages = new Dictionary<DamageType, float>();

            foreach (var entry in attackPayload.DamageEntries)
            {
                if (!this.ElementDamages.ContainsKey(entry.DamageType))
                    this.ElementDamages[entry.DamageType] = 0f;

                if (entry.IsWeaponBasedDamage)
                    this.ElementDamages[entry.DamageType] += entry.WeaponDamageMultiplier *
                        (weaponMinDamage + (float)PowerContext.Rand.NextDouble() * weaponDamageDelta);
                else
                    this.ElementDamages[entry.DamageType] += entry.MinDamage + (float)PowerContext.Rand.NextDouble() * entry.DamageDelta;

                this.ElementDamages[entry.DamageType] *= 1.0f + this.Target.Attributes[GameAttribute.Amplify_Damage_Percent];
            }

            // apply critical damage boost
            if (criticalHit)
            {
                // TODO: probably will calculate this off of GameAttribute.Crit_Damage_Percent, but right now that attribute is never set
                var damTypes = this.ElementDamages.Keys.ToArray();
                foreach (var type in damTypes)
                    this.ElementDamages[type] *= 1.5f + this.Target.Attributes[GameAttribute.Crit_Percent_Bonus_Capped];
            }



            // TODO: reduce element damage amounts according to target's resistances

            // TODO: reduce total damage by target's armor
            // ~weltmeyer Using WOW Calculation till we find the correct formula :)


            this.TotalDamage = this.ElementDamages.Sum(kv => kv.Value) ;
            var targetArmor = target.Attributes[GameAttribute.Armor_Total];
            var attackerLevel = attackPayload.Context.User.Attributes[GameAttribute.Level];
            var reduction = TotalDamage * (0.1f * targetArmor) /
                               ((8.5f * attackerLevel) + 40);

            reduction /= 1+reduction;
            reduction = Math.Min(0.75f, reduction);
            this.TotalDamage = TotalDamage*(1 - reduction);

            this.DominantDamageType = this.ElementDamages.OrderByDescending(kv => kv.Value).FirstOrDefault().Key;
            if (this.DominantDamageType == null)
                this.DominantDamageType = DamageType.Physical; // default to physical if no other damage type calced
        }
示例#13
0
        public override IEnumerable <TickTimer> Main()
        {
            AttackPayload attack = new AttackPayload(this);

            attack.Targets = GetBestMeleeEnemy();
            attack.AddWeaponDamage(1.00f, DamageType.Physical);
            attack.Apply();

            yield break;
        }
示例#14
0
        private void MeleeStageHit()
        {
            AttackPayload attack = new AttackPayload(this);

            attack.Targets = GetBestMeleeEnemy();
            attack.AddWeaponDamage(1.20f, DamageType.Lightning);
            attack.OnHit = hitPayload =>
            {
                GeneratePrimaryResource(6f);
            };
            attack.Apply();
        }
示例#15
0
        public void ApplyDamage(AttackPayload payload)
        {
            _damageHanalder.ApplyDamage(payload);

            if (!_defenseHandler.IsDefending)
            {
                return;
            }

            var attackType = _defenseHandler.IsReflecting ? AttackType.ReflectHigh : AttackType.ReflectLow;

            _attackHandler.Attack(attackType);
        }
示例#16
0
        public override IEnumerable <TickTimer> Main()
        {
            AttackPayload attack = new AttackPayload(this);

            switch (ComboIndex)
            {
            case 0:
            case 1:
                attack.Targets = GetBestMeleeEnemy();
                attack.AddWeaponDamage(ScriptFormula(0), DamageType.Physical);
                if (Rune_C > 0)
                {
                    attack.AddBuffOnHit <RuneCDebuff>();
                }
                break;

            case 2:
                if (Rune_B > 0)
                {
                    attack.Targets = GetEnemiesInArcDirection(User.Position, TargetPosition, ScriptFormula(19), ScriptFormula(20));
                    int maxTargets = (int)ScriptFormula(18);
                    if (maxTargets < attack.Targets.Actors.Count)
                    {
                        attack.Targets.Actors.RemoveRange(maxTargets, attack.Targets.Actors.Count - maxTargets);
                    }
                }
                else
                {
                    attack.Targets = GetBestMeleeEnemy();
                }

                attack.AutomaticHitEffects = false;
                attack.AddBuffOnHit <MainDebuff>();
                break;

            default:
                yield break;
            }
            bool hitAnything = false;

            attack.OnHit = hitPayload => { hitAnything = true; };
            attack.Apply();

            if (hitAnything)
            {
                GeneratePrimaryResource(6f);
            }
            yield break;
        }
示例#17
0
        public override IEnumerable <TickTimer> Main()
        {
            int effectSNO;

            switch (ComboIndex)
            {
            case 0:
                effectSNO = 18987;
                break;

            case 1:
                effectSNO = 18988;
                break;

            case 2:
                effectSNO = 96519;
                break;

            default:
                yield break;
            }

            User.PlayEffectGroup(effectSNO);

            bool          hitAnything = false;
            AttackPayload attack      = new AttackPayload(this);

            if (ComboIndex != 2)
            {
                attack.Targets = GetEnemiesInArcDirection(User.Position, TargetPosition, ScriptFormula(5), ScriptFormula(6));
            }
            else
            {
                attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(8));
            }

            attack.AddWeaponDamage(1.10f, DamageType.Physical);
            attack.OnHit = hitPayload => { hitAnything = true; };
            attack.Apply();

            if (hitAnything)
            {
                GeneratePrimaryResource(6f);
            }

            yield break;
        }
示例#18
0
        public override IEnumerable<TickTimer> Main()
        {
            AttackPayload attack = new AttackPayload(this);
            attack.Targets = GetBestMeleeEnemy();
            attack.AddWeaponDamage(1.45f, DamageType.Physical);
            attack.OnHit = hitPayload =>
            {
                GeneratePrimaryResource(6f);

                if (Rand.NextDouble() < 0.20)
                    Knockback(hitPayload.Target, ScriptFormula(5), ScriptFormula(6), ScriptFormula(7));
            };

            attack.Apply();

            yield break;
        }
示例#19
0
        public override IEnumerable <TickTimer> Run()
        {
            UsePrimaryResource(25f);
            StartCooldown(WaitSeconds(15f));

            yield return(WaitSeconds(0.350f)); // wait for wizard to land

            User.PlayEffectGroup(19356);

            AttackPayload attack = new AttackPayload(this);

            attack.Targets = GetEnemiesInRadius(User.Position, 20f);
            attack.AddWeaponDamage(2.05f, DamageType.Physical);
            attack.OnHit = hitPayload => { Knockback(hitPayload.Target, ScriptFormula(0), ScriptFormula(4), ScriptFormula(5)); };
            attack.Apply();
            yield break;
        }
示例#20
0
            public override bool Update()
            {
                if (base.Update())
                {
                    return(true);
                }

                if (_damageTimer == null || _damageTimer.TimedOut)
                {
                    _damageTimer = WaitSeconds(_damageRate);

                    AttackPayload attack = new AttackPayload(this);
                    attack.SetSingleTarget(Target);
                    attack.AddWeaponDamage(ScriptFormula(6) * _damageRate, DamageType.Physical);
                    attack.AutomaticHitEffects = false;
                    attack.Apply();
                }
                return(false);
            }
示例#21
0
        public override IEnumerable <TickTimer> Main()
        {
            AttackPayload attack = new AttackPayload(this);

            attack.Targets = GetBestMeleeEnemy();
            attack.AddWeaponDamage(1.45f, DamageType.Physical);
            attack.OnHit = hitPayload =>
            {
                GeneratePrimaryResource(6f);

                if (Rand.NextDouble() < 0.20)
                {
                    Knockback(hitPayload.Target, ScriptFormula(5), ScriptFormula(6), ScriptFormula(7));
                }
            };

            attack.Apply();

            yield break;
        }
示例#22
0
            public override void OnPayload(Payload payload)
            {
                if (payload.Target == Target && payload is DeathPayload)
                {
                    AttackPayload attack = new AttackPayload(this);
                    attack.Targets = GetEnemiesInRadius(Target.Position, ScriptFormula(11));
                    attack.AddDamage(ScriptFormula(9) * Target.Attributes[GameAttribute.Hitpoints_Max_Total],
                                     ScriptFormula(10), DamageType.Physical);
                    if (Rune_D > 0)
                    {
                        attack.OnHit = (hitPayload) =>
                        {
                            GeneratePrimaryResource(ScriptFormula(14));
                        };
                    }
                    attack.Apply();

                    SpawnProxy(Target.Position).PlayEffectGroup(18991);
                }
            }
示例#23
0
        public HitPayload(AttackPayload attackPayload, bool criticalHit, Actor target)
        {
            this.Context = attackPayload.Context;
            this.Target = target;
            this.IsCriticalHit = criticalHit;
            
            // TODO: select these values based on element type?
            float weaponMinDamage = this.Context.User.Attributes[GameAttribute.Damage_Weapon_Min_Total, 0];
            float weaponDamageDelta = this.Context.User.Attributes[GameAttribute.Damage_Weapon_Delta_Total, 0];

            // calculate and add up damage amount for each element type
            this.ElementDamages = new Dictionary<DamageType, float>();

            foreach (var entry in attackPayload.DamageEntries)
            {
                if (!this.ElementDamages.ContainsKey(entry.DamageType))
                    this.ElementDamages[entry.DamageType] = 0f;

                if (entry.IsWeaponBasedDamage)
                    this.ElementDamages[entry.DamageType] += entry.WeaponDamageMultiplier *
                        (weaponMinDamage + (float)PowerContext.Rand.NextDouble() * weaponDamageDelta);
                else
                    this.ElementDamages[entry.DamageType] += entry.MinDamage + (float)PowerContext.Rand.NextDouble() * entry.DamageDelta;
            }

            // apply critical damage boost
            if (criticalHit)
            {
                // TODO: probably will calculate this off of GameAttribute.Crit_Damage_Percent, but right now that attribute is never set
                var damTypes = this.ElementDamages.Keys.ToArray();
                foreach (var type in damTypes)
                    this.ElementDamages[type] *= 1.0f + 0.25f;
            }

            // TODO: reduce element damage amounts according to target's resistances

            // TODO: reduce total damage by target's armor

            this.TotalDamage = this.ElementDamages.Sum(kv => kv.Value);
            this.DominantDamageType = this.ElementDamages.OrderByDescending(kv => kv.Value).FirstOrDefault().Key;
        }
示例#24
0
        public override IEnumerable <TickTimer> Main()
        {
            //StartCooldown(WaitSeconds(10f));

            ActorMover mover = new ActorMover(User);

            mover.MoveArc(TargetPosition, 10, -0.1f, new ACDTranslateArcMessage
            {
                //Field3 = 303110, // used for male barb leap, not needed?
                FlyingAnimationTagID  = AnimationSetKeys.Attack2.ID,
                LandingAnimationTagID = -1,
                Field7 = PowerSNO
            });

            // wait for landing
            while (!mover.Update())
            {
                yield return(WaitTicks(1));
            }

            // extra wait for leap to finish
            yield return(WaitTicks(1));

            // ground smash effect
            User.PlayEffectGroup(162811);

            bool          hitAnything = false;
            AttackPayload attack      = new AttackPayload(this);

            attack.Targets = GetEnemiesInRadius(TargetPosition, 8f);
            attack.AddWeaponDamage(0.70f, DamageType.Physical);
            attack.OnHit = hitPayload => { hitAnything = true; };
            attack.Apply();

            if (hitAnything)
            {
                GeneratePrimaryResource(15f);
            }

            yield break;
        }
示例#25
0
        public override IEnumerable <TickTimer> Main()
        {
            float reachLength;
            float reachThickness;

            switch (ComboIndex)
            {
            case 0:
                reachLength    = 13;
                reachThickness = 3f;
                break;

            case 1:
                reachLength    = 14;
                reachThickness = 4.5f;
                break;

            case 2:
                reachLength    = 18;
                reachThickness = 4.5f;
                break;

            default:
                yield break;
            }

            bool          hitAnything = false;
            AttackPayload attack      = new AttackPayload(this);

            attack.Targets = GetEnemiesInBeamDirection(User.Position, TargetPosition, reachLength, reachThickness);
            attack.AddWeaponDamage(1.20f, DamageType.Physical);
            attack.OnHit = hitPayload => { hitAnything = true; };
            attack.Apply();

            if (hitAnything)
            {
                GeneratePrimaryResource(6f);
            }

            yield break;
        }
示例#26
0
        public override IEnumerable <TickTimer> Run()
        {
            UsePrimaryResource(45f);

            SpawnEffect(Wizard_Blizzard, TargetPosition);

            const int blizzard_duration = 3;

            for (int i = 0; i < blizzard_duration; ++i)
            {
                AttackPayload attack = new AttackPayload(this);
                attack.Targets = GetEnemiesInRadius(TargetPosition, 18f);
                attack.AddWeaponDamage(0.65f, DamageType.Cold);
                attack.OnHit = (hit) =>
                {
                    AddBuff(hit.Target, new DebuffChilled(WaitSeconds(3f)));
                };
                attack.Apply();

                yield return(WaitSeconds(1f));
            }
        }
示例#27
0
        public override IEnumerable <TickTimer> Main()
        {
            StartDefaultCooldown();
            UsePrimaryResource(EvalTag(PowerKeys.ResourceCost));

            AttackPayload attack = new AttackPayload(this);

            attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(1));
            attack.OnHit   = (hit) =>
            {
                TickTimer waitBuffEnd = WaitSeconds(ScriptFormula(0));

                // add main effect buff only if blind debuff took effect
                if (AddBuff(hit.Target, new DebuffBlind(waitBuffEnd)))
                {
                    AddBuff(hit.Target, new MainEffectBuff(waitBuffEnd));
                }
            };

            attack.Apply();

            yield break;
        }
示例#28
0
        IEnumerable <TickTimer> _RuneD()
        {
            int flyerCount = (int)ScriptFormula(14);

            for (int n = 0; n < flyerCount; ++n)
            {
                var flyerPosition = RandomDirection(TargetPosition, 0f, ScriptFormula(7));
                var flyer         = SpawnEffect(200808, flyerPosition, 0f, WaitSeconds(ScriptFormula(5)));
                flyer.OnTimeout = () =>
                {
                    flyer.PlayEffectGroup(200516);
                    AttackPayload attack = new AttackPayload(this);
                    attack.Targets = GetEnemiesInRadius(flyerPosition, ScriptFormula(13));
                    attack.AddWeaponDamage(ScriptFormula(12), DamageType.Fire);
                    attack.OnHit = (hitPayload) =>
                    {
                        AddBuff(hitPayload.Target, new DebuffStunned(WaitSeconds(ScriptFormula(37))));
                    };
                    attack.Apply();
                };

                yield return(WaitSeconds(ScriptFormula(4)));
            }
        }
示例#29
0
文件: Barbarian.cs 项目: n3rus/mooege
        public override IEnumerable<TickTimer> Run()
        {
            yield return WaitSeconds(0.25f); // wait for swing animation

            User.PlayEffectGroup(18662);

            if (CanHitMeleeTarget(Target))
            {
                var payload = new AttackPayload(this);
                payload.AddTarget(Target);
                payload.AddWeaponDamage(1.45f, DamageType.Physical);
                payload.OnHit = (hit) =>
                {
                    GeneratePrimaryResource(6f);

                    if (Rand.NextDouble() < 0.20)
                        Knockback(Target, 4f);
                };

                payload.Apply();
            }

            yield break;
        }
示例#30
0
        public override IEnumerable <TickTimer> Main()
        {
            switch (TargetMessage.Field5)
            {
            case 0:
            case 1:
                MeleeStageHit();
                break;

            case 2:
                //AddBuff(User, new ComboStage3Buff());

                // put target position a little bit in front of the monk. represents the lightning ball
                TargetPosition = PowerMath.TranslateDirection2D(User.Position, TargetPosition,
                                                                User.Position, 8f);

                bool          hitAnything = false;
                AttackPayload attack      = new AttackPayload(this);
                attack.Targets = GetEnemiesInRadius(TargetPosition, 7f);
                attack.AddWeaponDamage(1.20f, DamageType.Lightning);
                attack.OnHit = hitPayload => {
                    hitAnything = true;
                    Knockback(hitPayload.Target, 12f);
                };
                attack.Apply();

                if (hitAnything)
                {
                    GeneratePrimaryResource(6f);
                }

                break;
            }

            yield break;
        }
示例#31
0
        public override IEnumerable<TickTimer> Main()
        {
            UsePrimaryResource(EvalTag(PowerKeys.ResourceCost));

            AttackPayload attack = new AttackPayload(this);
            attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(4));
            attack.OnHit = hitPayload =>
            {
                AddBuff(hitPayload.Target, new RendDebuff());
                if (Rune_D > 0)
                {
                    float healMe = ScriptFormula(8) * hitPayload.TotalDamage;
                    //User.Attributes[GameAttribute.Hitpoints_Granted] = healMe;
                    //User.Attributes.BroadcastChangedIfRevealed();
                }
            };
            //this work? if it dies with rend debuff, infect others.
            attack.OnDeath = DeathPayload =>
            {
                if (AddBuff(Target, new RendDebuff()))
                {
                    AttackPayload BleedAgain = new AttackPayload(this);
                    BleedAgain.Targets = GetEnemiesInRadius(Target.Position, ScriptFormula(19));
                    BleedAgain.OnHit = hitPayload2 =>
                    {
                        AddBuff(hitPayload2.Target, new RendDebuff());
                    };
                    BleedAgain.Apply();
                }
            };
            attack.Apply();
            yield break;
        }
示例#32
0
        public override IEnumerable<TickTimer> Main()
        {
            bool hitAnything = false;
            StartCooldown(EvalTag(PowerKeys.CooldownTime));

            User.PlayEffectGroup(RuneSelect(18685, 99685, 159415, 159416, 159397, 18685));
            //Rune_E -> when stun wears off, use slow.efg

            AttackPayload attack = new AttackPayload(this);
            attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(0));
            attack.AddWeaponDamage(ScriptFormula(6), DamageType.Physical);
            attack.OnHit = hitPayload =>
            {
                hitAnything = true;
                if (Rune_B > 0)
                {
                    //push em away!
                    Knockback(hitPayload.Target, ScriptFormula(13), ScriptFormula(14));
                }
                if (Rune_C > 0)
                {
                    //bring em in!
                    Knockback(hitPayload.Target, ScriptFormula(11), ScriptFormula(12));
                }
                AddBuff(hitPayload.Target, new GroundStompStun());
            };
            attack.Apply();
            if (hitAnything)
                GeneratePrimaryResource(EvalTag(PowerKeys.ResourceGainedOnFirstHit) + ScriptFormula(19));

            yield break;
        }
示例#33
0
        public override IEnumerable<TickTimer> Main()
        {
            //Primary Target
            //WeaponDamage(Target, ScriptFormula(16), DamageType.Physical);
            WeaponDamage(GetBestMeleeEnemy(), ScriptFormula(16), DamageType.Physical);
            //Secondary Targets
            AttackPayload attack = new AttackPayload(this);
            //SF(27) is 120 degrees, SF(26) is range.
            attack.Targets = GetEnemiesInArcDirection(User.Position, TargetPosition, ScriptFormula(27), ScriptFormula(26));
            attack.AddWeaponDamage(ScriptFormula(18), DamageType.Physical);
            attack.OnHit = hitPayload =>
            {
                if (Rune_B > 0)
                {
                    foreach (Actor enemy in GetEnemiesInRadius(User.Position, ScriptFormula(14)).Actors)
                    {
                        Knockback(enemy, ScriptFormula(13));
                    } 
                    foreach (Actor enemy in GetEnemiesInRadius(User.Position, ScriptFormula(21)).Actors)
                    {
                        Knockback(enemy, ScriptFormula(20));
                    }
                }
                if (Rune_C > 0)
                {
                    if (hitPayload.IsCriticalHit)
                    {
                        Knockback(hitPayload.Target, ScriptFormula(2), ScriptFormula(3));

                        //since its a max number of knockback jumps, but its UP TO that number, we will randomize it.
                        int Jumps = Rand.Next((int)ScriptFormula(25));
                        for (int i = 0; i < Jumps; ++i)
                        {
                            WeaponDamage(hitPayload.Target, ScriptFormula(9), DamageType.Physical);
                            Knockback(hitPayload.Target, ScriptFormula(7), ScriptFormula(8));
                        }
                    }
                }
                if (Rune_D > 0)
                {
                    //todo: is this right?
                    int StackCount = 0;
                    if (StackCount < ScriptFormula(23) + 1)
                    {
                        StackCount++;
                    }

                    GeneratePrimaryResource(ScriptFormula(22)* StackCount);
                }
                if (Rune_E > 0)
                {
                    //this doesnt work either.
                    attack.OnDeath = DeathPayload =>
                        {
                            if (Rand.NextDouble() < ScriptFormula(12))
                            {
                                AttackPayload explode = new AttackPayload(this);
                                explode.Targets = GetEnemiesInRadius(DeathPayload.Target.Position, ScriptFormula(6));
                                explode.AddWeaponDamage(ScriptFormula(4), DamageType.Physical);
                                explode.Apply();
                            }
                        };
                }
            };
            attack.Apply();

            yield break;
        }
示例#34
0
        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;
        }
示例#35
0
        public override IEnumerable<TickTimer> Main()
        {
            bool hitAnything = false;
            //StartCooldown(WaitSeconds(10f));
            if (Rune_C > 0)
            {
                AttackPayload launch = new AttackPayload(this);
                launch.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(31));
                launch.AddWeaponDamage(ScriptFormula(30), DamageType.Physical);
                launch.OnHit = hitPayload =>
                {
                    hitAnything = true;
                };
                launch.Apply();
                User.PlayEffectGroup(165924); //Not sure if this is the only effect to be displayed in this case
            }

            ActorMover mover = new ActorMover(User);
            mover.MoveArc(TargetPosition, 10, -0.1f, new ACDTranslateArcMessage
            {
                //Field3 = 303110, // used for male barb leap, not needed?
                FlyingAnimationTagID = AnimationSetKeys.Attack2.ID,
                LandingAnimationTagID = -1,
                Field7 = PowerSNO
            });

            // wait for landing
            while (!mover.Update())
                yield return WaitTicks(1);

            // extra wait for leap to finish
            yield return WaitTicks(1);

            if (Rune_D > 0)
            {
                AddBuff(User, new LeapAttackArmorBuff());
            }

            // ground smash effect
            User.PlayEffectGroup(162811);

            AttackPayload attack = new AttackPayload(this);
            attack.Targets = GetEnemiesInRadius(TargetPosition, ScriptFormula(0));
            //ScriptFormula(1) states "% of willpower Damage", perhaps the damage should be calculated that way instead.
            attack.AddWeaponDamage(0.70f, DamageType.Physical);
            attack.OnHit = hitPayload => 
                { 
                    hitAnything = true;
                    if (Rune_E > 0)
                    {
                        if (Rand.NextDouble() < ScriptFormula(37))
                        {
                            AddBuff(hitPayload.Target, new DebuffStunned(WaitSeconds(ScriptFormula(38))));
                        }
                    }
                };
            attack.Apply();

            if (hitAnything)
                GeneratePrimaryResource(15f);

            //TODO: Eventually att visuals, and check if the current uber-drag is really intended :P
            if (Rune_A > 0)
            {
                TargetList targets = GetEnemiesInRadius(User.Position, ScriptFormula(3));
                Actor curTarget;
                int affectedTargets = 0;
                while (affectedTargets < ScriptFormula(12)) //SF(11) states  "Min number to Knockback", and is 5, what can that mean?
                {
                    curTarget = targets.GetClosestTo(User.Position);
                    if (curTarget != null)
                    {
                        targets.Actors.Remove(curTarget);

                        if (curTarget.World != null)
                        {
                            Knockback(curTarget, ScriptFormula(8), ScriptFormula(9), ScriptFormula(10));
                        }
                        affectedTargets++;
                    }
                    else
                    {
                        break;
                    }
                }
            }

            yield break;
        }
示例#36
0
        //there is a changed walking speed multiplier from 8101 patch.
        public override IEnumerable<TickTimer> Main()
        {
            //if (User.CurrentScene.NavMesh.WalkGrid[(int)((TargetPosition.X - 
            //this.World.QuadTree.Query<Mooege.Core.GS.Map.Scene>(TargetPosition).FirstOrDefault().Bounds.Left) / 2.5f), 
            //(int)((TargetPosition.Y - this.World.QuadTree.Query<Mooege.Core.GS.Map.Scene>(TargetPosition).FirstOrDefault().Bounds.Top) / 2.5f)] == 0)	
               //yield break;
            bool hitAnything = false;
            StartCooldown(EvalTag(PowerKeys.CooldownTime));

            if (Rune_C > 0)
            {
                AttackPayload launch = new AttackPayload(this);
                launch.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(31));
                launch.AddWeaponDamage(ScriptFormula(30), DamageType.Physical);
                launch.OnHit = hitPayload =>
                {
                    hitAnything = true;
                };
                launch.Apply();
                User.PlayEffectGroup(165924); //Not sure if this is the only effect to be displayed in this case
            }

            ActorMover mover = new ActorMover(User);
            mover.MoveArc(TargetPosition, 10, -0.1f, new ACDTranslateArcMessage
            {
                //Field3 = 303110, // used for male barb leap, not needed?
                FlyingAnimationTagID = AnimationSetKeys.Attack2.ID,
                LandingAnimationTagID = -1,
                Field7 = PowerSNO
            });

            // wait for landing
            while (!mover.Update())
                yield return WaitTicks(1);

            // extra wait for leap to finish
            yield return WaitTicks(1);

            if (Rune_D > 0)
            {
                AddBuff(User, new LeapAttackArmorBuff());
            }

            // ground smash effect
            User.PlayEffectGroup(162811);

            AttackPayload attack = new AttackPayload(this);
            attack.Targets = GetEnemiesInRadius(TargetPosition, ScriptFormula(0));
            //ScriptFormula(1) states "% of willpower Damage", perhaps the damage should be calculated that way instead.
            attack.AddWeaponDamage(0.70f, DamageType.Physical);
            attack.OnHit = hitPayload =>
            {
                hitAnything = true;
                if (Rune_E > 0)
                {
                    if (Rand.NextDouble() < ScriptFormula(37))
                    {
                        AddBuff(hitPayload.Target, new DebuffStunned(WaitSeconds(ScriptFormula(38))));
                    }
                }
            };
            attack.Apply();

            if (hitAnything)
                GeneratePrimaryResource(EvalTag(PowerKeys.ResourceGainedOnFirstHit));

            //TODO: Eventually att visuals, and check if the current uber-drag is really intended :P
            if (Rune_A > 0)
            {
                TargetList targets = GetEnemiesInRadius(User.Position, ScriptFormula(3));
                Actor curTarget;
                int affectedTargets = 0;
                while (affectedTargets < ScriptFormula(12)) //SF(11) states  "Min number to Knockback", and is 5, what can that mean?
                {
                    curTarget = targets.GetClosestTo(User.Position);
                    if (curTarget != null)
                    {
                        targets.Actors.Remove(curTarget);

                        if (curTarget.World != null)
                        {
                            Knockback(curTarget, ScriptFormula(8), ScriptFormula(9), ScriptFormula(10));
                        }
                        affectedTargets++;
                    }
                    else
                    {
                        break;
                    }
                }
            }

            if (Rune_B > 0)
            {
                TargetList targets = GetEnemiesInRadius(User.Position, ScriptFormula(3));
                foreach (Actor curTarget in targets.Actors)
                {
                    Knockback(curTarget, ScriptFormula(17), ScriptFormula(18), ScriptFormula(19));
                    var secondKnockBack = GetEnemiesInRadius(curTarget.Position, 1f); // this will hackfully check for collision
                    if (secondKnockBack.Actors.Count > 1)
                    {
                        foreach (Actor secondaryTarget in GetEnemiesInRadius(curTarget.Position, ScriptFormula(23)).Actors)
                        {
                            Knockback(secondaryTarget, ScriptFormula(24), ScriptFormula(25), ScriptFormula(26));
                            var thirdKnockBack = GetEnemiesInRadius(secondaryTarget.Position, 1f); 
                            if (thirdKnockBack.Actors.Count > 1)
                            {
                                foreach (Actor thirdTarget in GetEnemiesInRadius(secondaryTarget.Position, ScriptFormula(23)).Actors)
                                {
                                    Knockback(thirdTarget, ScriptFormula(24), ScriptFormula(25), ScriptFormula(26));
                                }
                            }
                        }
                    }
                }
            }
            yield break;
        }
示例#37
0
文件: Monk.cs 项目: jujuman/mooege
        private void MultiHit()
        {
            if (Rune_D > 0)
            {
                if (Rand.NextDouble() < ScriptFormula(25))
                {
                    GeneratePrimaryResource(ScriptFormula(24));
                }
            }
            //TODO: this needs to be redone when I figure out how to do multiple hits to certain MAX targets..
                bool hitAnything = false;
                AttackPayload attack = new AttackPayload(this);
                attack.Targets = GetEnemiesInArcDirection(User.Position,TargetPosition, ScriptFormula(28), ScriptFormula(29));
                attack.AddWeaponDamage(ScriptFormula(1), DamageType.Physical);
                attack.OnHit = hitPayload =>
                {
                    hitAnything = true;
                    if (Rune_A > 0)
                    {
                        AddBuff(hitPayload.Target, new RuneA_DOT_100Fists());
                    }
                };
                attack.Apply();

                if (hitAnything)
                {
                    GeneratePrimaryResource(EvalTag(PowerKeys.SpiritGained));
                    if (Rune_C > 0)
                    {
                        AddBuff(User, new RuneCbuff());
                    }
                }
        }
示例#38
0
        public override IEnumerable<TickTimer> Main()
        {
            StartCooldown(EvalTag(PowerKeys.CooldownTime));
            UsePrimaryResource(EvalTag(PowerKeys.ResourceCost));

            AddBuff(User, new BerserkerBuff());
            if (Rune_B > 0)
            {
                AttackPayload attack = new AttackPayload(this);
                attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(20));
                attack.AddWeaponDamage(ScriptFormula(17), DamageType.Physical);
                attack.OnHit = HitPayload =>
                {
                    Knockback(User.Position, HitPayload.Target, ScriptFormula(18), ScriptFormula(19));
                };
            }
            if (Rune_E > 0)
            {
                AttackPayload attack = new AttackPayload(this);
                attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(15));
                attack.OnDeath = HitPayload =>
                {
                    User.PlayEffectGroup(210319);
                    WeaponDamage(HitPayload.Target, ScriptFormula(11), DamageType.Physical);
                };
            }

            yield break;
        }
示例#39
0
        public override IEnumerable<TickTimer> Main()
        {
            StartCooldown(EvalTag(PowerKeys.CooldownTime));

            TickTimer Cooldown = WaitSeconds(ScriptFormula(5));

            if (Rune_A > 0)
            {
                AddBuff(User, new DurationBuff());
            }
            if (Rune_E > 0)
            {
                AddBuff(User, new ReflectBuff());
            }
            AttackPayload attack = new AttackPayload(this);
            attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(7));
            attack.AddWeaponDamage(ScriptFormula(7), DamageType.Physical);
            attack.OnHit = HitPayload =>
            {
                if (Rune_C > 0)
                {
                    //TODO: is this the intended way to heal?
                    User.Attributes[GameAttribute.Hitpoints_Cur] =
                        Math.Min(User.Attributes[GameAttribute.Hitpoints_Cur] +
                        ScriptFormula(23) * User.Attributes[GameAttribute.Hitpoints_Max],
                        User.Attributes[GameAttribute.Hitpoints_Max]);

                    User.Attributes.BroadcastChangedIfRevealed();
                }
                if (Rune_D > 0)
                {
                    GeneratePrimaryResource(ScriptFormula(28));
                }
                if (HitPayload.IsCriticalHit)
                {
                    Cooldown = WaitSeconds(0f);
                }
            };
            attack.Apply();

            if (Rune_B > 0)
            {
                //Throw up to SF(18) axes at nearby enemies which inflict SF(14) weapon damage each.
                //search radius SF(15), proj height SF(16), proj speed SF(17), proj delay time SF(19)
            }

            StartCooldown(Cooldown);
            yield break;
        }
示例#40
0
        public override IEnumerable<TickTimer> Main()
        {
            bool hitAnything = false;
            WeaponDamage(GetBestMeleeEnemy(), ScriptFormula(16), DamageType.Physical);
            AttackPayload attack = new AttackPayload(this);
            attack.Targets = GetEnemiesInArcDirection(User.Position, TargetPosition, ScriptFormula(27), ScriptFormula(26));
            attack.AddWeaponDamage(ScriptFormula(16), DamageType.Physical);
            attack.OnHit = hitPayload =>
            {
                hitAnything = true;
                if (Rune_B > 0)
                {
                    foreach (Actor enemy in GetEnemiesInArcDirection(User.Position, TargetPosition, ScriptFormula(27), ScriptFormula(26)).Actors)
                    {
                        //Snare Duration = SF(14)
                        //Snare Magnitude = SF(20)
                    }
                }
                if (Rune_C > 0)
                {
                    if (hitPayload.IsCriticalHit)
                    {
                        Knockback(hitPayload.Target, ScriptFormula(2), ScriptFormula(3));

                        //since its a max number of knockback jumps, but its UP TO that number, we will randomize it.
                        int Jumps = Rand.Next((int)ScriptFormula(25));
                        for (int i = 0; i < Jumps; ++i)
                        {
                            WeaponDamage(hitPayload.Target, ScriptFormula(9), DamageType.Physical);
                            Knockback(hitPayload.Target, ScriptFormula(7), ScriptFormula(8));
                        }
                    }
                }
                if (Rune_D > 0)
                {
                    //todo: is this right?
                    int StackCount = 0;
                    if (StackCount < ScriptFormula(23) + 1)
                    {
                        StackCount++;
                    }

                    GeneratePrimaryResource(ScriptFormula(22) * StackCount);
                }
                if (Rune_E > 0)
                {
                    //this doesnt work either.
                    attack.OnDeath = DeathPayload =>
                    {
                        if (Rand.NextDouble() < ScriptFormula(12))
                        {
                            AttackPayload explode = new AttackPayload(this);
                            explode.Targets = GetEnemiesInRadius(DeathPayload.Target.Position, ScriptFormula(6));
                            explode.AddWeaponDamage(ScriptFormula(4), DamageType.Physical);
                            explode.Apply();
                        }
                    };
                }
            };
            attack.Apply();
            
            if(hitAnything)
                    GeneratePrimaryResource(EvalTag(PowerKeys.ResourceGainedOnFirstHit));

            yield break;
        }
示例#41
0
        public override IEnumerable <TickTimer> Main()
        {
            GeneratePrimaryResource(ScriptFormula(25));

            float targetDistance = PowerMath.Distance2D(User.Position, TargetPosition);

            // create grenade projectiles with shared detonation timer
            TickTimer timeout = WaitSeconds(ScriptFormula(2));

            Projectile[] grenades = new Projectile[Rune_C > 0 ? 1 : 3];
            for (int i = 0; i < grenades.Length; ++i)
            {
                var projectile = new Projectile(this, Rune_C > 0 ? 212547 : 88244, User.Position);
                projectile.Timeout = timeout;
                grenades[i]        = projectile;
            }

            // generate spread positions with distance-scaled spread amount.
            float scaledSpreadOffset = Math.Max(targetDistance - ScriptFormula(14), 0f);

            Vector3D[] projDestinations = PowerMath.GenerateSpreadPositions(User.Position, TargetPosition,
                                                                            ScriptFormula(11) - scaledSpreadOffset, grenades.Length);

            // launch and bounce grenades
            yield return(WaitTicks(1));  // helps make bounce timings more consistent

            float bounceOffset  = 1f;
            float minHeight     = ScriptFormula(21);
            float height        = minHeight + ScriptFormula(22);
            float bouncePercent = 0.7f; // ScriptFormula(23);

            while (!timeout.TimedOut)
            {
                for (int i = 0; i < grenades.Length; ++i)
                {
                    grenades[i].LaunchArc(PowerMath.TranslateDirection2D(projDestinations[i], User.Position, projDestinations[i],
                                                                         targetDistance * 0.3f * bounceOffset),
                                          height, ScriptFormula(20));
                }

                height       *= bouncePercent;
                bounceOffset *= 0.3f;

                yield return(grenades[0].ArrivalTime);

                // play "dink dink" grenade bounce sound
                grenades[0].PlayEffect(Effect.Unknown69);
            }

            // damage effects
            foreach (var grenade in grenades)
            {
                var grenadeN = grenade;

                SpawnEffect(RuneSelect(154027, 154045, 154028, 154044, 154046, 154043), grenade.Position);

                // poison pool effect
                if (Rune_A > 0)
                {
                    var pool = SpawnEffect(154076, grenade.Position, 0, WaitSeconds(ScriptFormula(7)));
                    pool.UpdateDelay = 1f;
                    pool.OnUpdate    = () =>
                    {
                        WeaponDamage(GetEnemiesInRadius(grenadeN.Position, ScriptFormula(5)), ScriptFormula(6), DamageType.Poison);
                    };
                }

                AttackPayload attack = new AttackPayload(this);
                attack.Targets = GetEnemiesInRadius(grenade.Position, ScriptFormula(4));
                attack.AddWeaponDamage(ScriptFormula(0), Rune_A > 0 ? DamageType.Poison : DamageType.Fire);
                attack.OnHit = (hitPayload) =>
                {
                    if (Rune_E > 0)
                    {
                        if (Rand.NextDouble() < ScriptFormula(9))
                        {
                            AddBuff(hitPayload.Target, new DebuffStunned(WaitSeconds(ScriptFormula(10))));
                        }
                    }
                    if (Rune_C > 0)
                    {
                        Knockback(grenadeN.Position, hitPayload.Target, ScriptFormula(8));
                    }
                };
                attack.Apply();
            }

            // clusterbomb hits
            if (Rune_B > 0)
            {
                int damagePulses = (int)ScriptFormula(28);
                for (int pulse = 0; pulse < damagePulses; ++pulse)
                {
                    yield return(WaitSeconds(ScriptFormula(12) / damagePulses));

                    foreach (var grenade in grenades)
                    {
                        WeaponDamage(GetEnemiesInRadius(grenade.Position, ScriptFormula(4)), ScriptFormula(0), DamageType.Fire);
                    }
                }
            }
        }
示例#42
0
        public override IEnumerable<TickTimer> Main()
        {
            bool hitAnything = false;
            AttackPayload attack = new AttackPayload(this);
            attack.Targets = GetBestMeleeEnemy();
            attack.AddWeaponDamage(2f, DamageType.Physical);
            attack.OnHit = hitPayload =>
            {
                hitAnything = true;
                AddBuff(User, new FrenzyBuff());
                if (Rune_C > 0)
                {
                    AddBuff(User, new ObsidianSpeedEffect());
                }
                if (Rune_B > 0)
                {
                    if (Rand.NextDouble() < ScriptFormula(17))
                    {
                        Actor target = GetEnemiesInRadius(User.Position, 15f).GetClosestTo(User.Position);

                        var proj = new Projectile(this, RuneSelect(6515, 130073, 215555, -1, 216040, 75650), User.Position);
                        proj.Position.Z += 5f;  // fix height
                        proj.OnCollision = (hit) =>
                        {
                            WeaponDamage(hit, ScriptFormula(18), DamageType.Physical);
                        };
                        proj.Launch(target.Position, 2f);
                    }
                }
                if (Rune_D > 0)
                {
                    if (Rand.NextDouble() < 1)
                    {
                        hitPayload.Target.PlayEffectGroup(163470);
                        AddBuff(hitPayload.Target, new DebuffStunned(WaitSeconds(ScriptFormula(0))));
                    }
                }
            };
            attack.OnDeath = DeathPayload =>
            {
                if (Rune_E > 0)
                {
                    User.Attributes[GameAttribute.Hitpoints_Granted_Duration] += (int)ScriptFormula(12);
                    User.Attributes[GameAttribute.Hitpoints_Granted] += ScriptFormula(10) * User.Attributes[GameAttribute.Hitpoints_Max_Total];
                    User.Attributes.BroadcastChangedIfRevealed();
                }
            };
            attack.Apply();
            if (hitAnything)
                GeneratePrimaryResource(EvalTag(PowerKeys.ResourceGainedOnFirstHit) + ScriptFormula(19));
            yield break;
        }
示例#43
0
 public override IEnumerable<TickTimer> Main()
 {
     AttackPayload attack = new AttackPayload(this);
     attack.Targets = GetBestMeleeEnemy();
     attack.OnHit = hitPayload =>
     {
         if (Rand.NextDouble() < ScriptFormula(20))
         {
             //Skill_Override? // Skill_Override_Ended //Skill_Override_Ended_Active
             User.Attributes[GameAttribute.Skill_Override_Active] = true;
         }
     };
     yield break;
 }
示例#44
0
        public override IEnumerable<TickTimer> Main()
        {

            AttackPayload attack = new AttackPayload(this);
            attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(4));
            attack.OnHit = hitPayload =>
            {
                AddBuff(hitPayload.Target, new RendDebuff());
            };
            //this work? if it dies with rend debuff, infect others.
            attack.OnDeath = DeathPayload =>
                {
                    if (AddBuff(Target, new RendDebuff()))
                    {
                        AttackPayload BleedAgain = new AttackPayload(this);
                        BleedAgain.Targets = GetEnemiesInRadius(Target.Position, ScriptFormula(19));
                        BleedAgain.OnHit = hitPayload2 =>
                        {
                            AddBuff(hitPayload2.Target, new RendDebuff());
                        };
                        BleedAgain.Apply();
                    }
                };
            attack.Apply();
            yield break;
        }
示例#45
0
            public override bool Update()
            {
                _mover.Update();

                if (base.Update())
                    return true;
                if (_damageTimer == null || _damageTimer.TimedOut)
                {
                    _damageTimer = WaitSeconds(_damageRate);
                    AttackPayload attack = new AttackPayload(this);
                    attack.AddWeaponDamage(ScriptFormula(16), DamageType.Physical);
                    attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(6));
                    attack.OnHit = hit =>
                    {
                        hitAnything = true;
                        Knockback(hit.Target, ScriptFormula(2));
                        if (Rune_B > 0)
                        {
                            User.Attributes[GameAttribute.Hitpoints_Granted] += ScriptFormula(21);
                            User.Attributes.BroadcastChangedIfRevealed();
                        }
                        if (Rune_D > 0)
                        {
                            GeneratePrimaryResource(ScriptFormula(11));
                        }
                        if (Rune_C > 0)
                        {
                            if (hit.IsCriticalHit)
                            {
                                AddBuff(hit.Target, new DebuffStunned(WaitSeconds(ScriptFormula(8))));
                            }
                        }
                        if (Rune_E > 0)
                        {
                            int resourceHit = 0;
                            while (resourceHit < ScriptFormula(10))
                            {
                                //maybe this cannot go here?
                            }
                        }
                    };
                    attack.Apply();
                }
                return false;
            }
示例#46
0
        public override IEnumerable<TickTimer> Main()
        {
            AttackPayload attack = new AttackPayload(this);
            attack.Targets = GetBestMeleeEnemy();
            attack.AddWeaponDamage(2f, DamageType.Physical);
            attack.OnHit = hitPayload =>
            {
                AddBuff(User, new FrenzyBuff());
                if (Rune_C > 0)
                {
                        AddBuff(User, new ObsidianSpeedEffect());
                }
                if (Rune_B > 0)
                {
                    if (Rand.NextDouble() < ScriptFormula(17))
                    {
                        Actor target = GetEnemiesInRadius(User.Position, 15f).GetClosestTo(User.Position);

                        var proj = new Projectile(this, RuneSelect(6515, 130073, 215555, -1, 216040, 75650), User.Position);
                        proj.Position.Z += 5f;  // fix height
                        proj.OnCollision = (hit) =>
                        {
                            WeaponDamage(hit, ScriptFormula(18), DamageType.Physical);
                        };
                        proj.Launch(target.Position, 2f);
                    }
                }
                if (Rune_D > 0)
                {
                    if (Rand.NextDouble() < 1)
                    {
                        hitPayload.Target.PlayEffectGroup(163470);
                        AddBuff(hitPayload.Target, new DebuffStunned(WaitSeconds(ScriptFormula(0))));
                    }
                }
            };
            attack.OnDeath = DeathPayload =>
                {
                    //Rune_E -> heals.
                };
            attack.Apply();

            yield break;
        }
示例#47
0
        public override IEnumerable<TickTimer> Main()
        {
            StartCooldown(EvalTag(PowerKeys.CooldownTime));
            UsePrimaryResource(EvalTag(PowerKeys.ResourceCost));

            User.PlayEffectGroup(55689);
            WeaponDamage(GetEnemiesInRadius(User.Position, ScriptFormula(0)), ScriptFormula(19), DamageType.Physical);
            var Quake = SpawnEffect(168440, User.Position, 0, WaitSeconds(ScriptFormula(1)));
            Quake.UpdateDelay = 0.5f;
            Quake.OnUpdate = () =>
            {
                AttackPayload attack = new AttackPayload(this);
                attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(0));
                attack.AddWeaponDamage(ScriptFormula(17), DamageType.Physical);
                attack.Apply();
            };
            //Secondary Tremor stuff..
            yield break;
        }
示例#48
0
文件: Monk.cs 项目: jujuman/mooege
            public override bool Update()
            {
                if (base.Update())
                    return true;

                if (_damageTimer == null || _damageTimer.TimedOut)
                {
                    _damageTimer = WaitSeconds(_damageRate);

                    AttackPayload attack = new AttackPayload(this);
                    attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(13));
                    attack.AddWeaponDamage(_damagetotal, DamageType.Physical); 
                    //we divide by four because this is by second, and tick-intervals = 0.25
                    attack.AutomaticHitEffects = false;
                    attack.Apply();
                }
                return false;
            }
示例#49
0
        public override IEnumerable<TickTimer> Main()
        {
            StartCooldown(EvalTag(PowerKeys.CooldownTime));
            bool hitAnything = false;

            if (Rune_B > 0)
            {
                Vector3D[] projDestinations = PowerMath.GenerateSpreadPositions(User.Position, TargetPosition, ScriptFormula(9) / 5f, (int)ScriptFormula(11));

                for (int i = 0; i < projDestinations.Length; i++)
                {
                    var proj = new Projectile(this, 161891, User.Position);
                    proj.Scale = 3f;
                    proj.Timeout = WaitSeconds(0.5f);
                    proj.OnCollision = (hit) =>
                    {
                        hitAnything = true;
                        _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_E > 0)
            {
                Vector3D[] projDestinations = PowerMath.GenerateSpreadPositions(User.Position, TargetPosition, ScriptFormula(9) / 5f, (int)ScriptFormula(11));

                for (int i = 0; i < projDestinations.Length; i++)
                {
                    var proj = new Projectile(this, 161894, User.Position);
                    proj.Scale = 3f;
                    proj.Timeout = WaitSeconds(0.5f);
                    proj.OnCollision = (hit) =>
                    {
                        hitAnything = true;

                        _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)
            {
                var projectile = new Projectile(this, 161890, User.Position);
                projectile.Scale = 3f;
                projectile.Timeout = WaitSeconds(0.5f);
                projectile.OnCollision = (hit) =>
                {
                    hitAnything = true;

                    _setupReturnProjectile(hit.Position);

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

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

                projectile.Launch(TargetPosition, ScriptFormula(8));
                User.AddRopeEffect(79402, projectile);
            }
            else
            {
                var projectile = new Projectile(this, RuneSelect(74636, -1, -1, 161892, 161893, -1), User.Position);
                projectile.Scale = 3f;
                projectile.Timeout = WaitSeconds(0.5f);
                projectile.OnCollision = (hit) =>
                {
                    hitAnything = true;

                    _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));
                        if (Rune_C > 0)
                        {
                            float healMe = ScriptFormula(10) * hitPayload.TotalDamage;
                            //User.Attributes[GameAttribute.Hitpoints_Granted] = healMe;
                            //User.Attributes.BroadcastChangedIfRevealed();
                        }
                    };
                    attack.Apply();

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

                projectile.Launch(TargetPosition, ScriptFormula(8));
                User.AddRopeEffect(79402, projectile);
            }

            if (hitAnything)
                GeneratePrimaryResource(EvalTag(PowerKeys.ResourceGainedOnFirstHit));

            yield break;
        }
示例#50
0
文件: Monk.cs 项目: jujuman/mooege
        public override IEnumerable<TickTimer> Main()
        {
            switch (TargetMessage.Field5)
            {
                case 0:
                    if (Rune_A > 0)
                    {
                        //Dash
                    }
                    else
                    {
                        MeleeStageHit();
                    }
                    break;
                case 1:
                    //stage 2 get hit chance bonus
                    MultiHit();
                    break;
                case 2:
                    if (Rune_D > 0)
                    {
                        if(Rand.NextDouble() < ScriptFormula(25))
                        {
                            GeneratePrimaryResource(ScriptFormula(24));
                        }
                    }

                    bool hitAnything = false;
                    AttackPayload attack = new AttackPayload(this);
                    attack.Targets = GetEnemiesInArcDirection(User.Position, TargetPosition, ScriptFormula(30), ScriptFormula(31));
                    attack.AddWeaponDamage(ScriptFormula(2), DamageType.Holy);
                    attack.OnHit = hitPayload =>
                    {
                        hitAnything = true;
                        Knockback(hitPayload.Target, ScriptFormula(5), ScriptFormula(6)); 
                        if (Rune_A > 0)
                        {
                            AddBuff(hitPayload.Target, new RuneA_DOT_100Fists());
                        }
                    };
                    attack.Apply();

                    if (hitAnything)
                    {
                        GeneratePrimaryResource(EvalTag(PowerKeys.SpiritGained));
                        if (Rune_C > 0)
                        {
                            AddBuff(User, new RuneCbuff());
                        }
                    }
                    //TODO: Range should be only 40f ahead.
                    if (Rune_E > 0)
                    {
                        var proj = new Projectile(this, 136022, User.Position);
                        proj.Launch(TargetPosition, ScriptFormula(23));
                        proj.OnCollision = (hit) =>
                        {
                            //proj.Destroy();
                            WeaponDamage(hit, ScriptFormula(11), DamageType.Physical);
                        };
                    }

                    break;
            }

            yield break;
        }
示例#51
0
        public override IEnumerable<TickTimer> Main()
        {
            UsePrimaryResource(EvalTag(PowerKeys.ResourceCost));

            if (Rune_B > 0)
            {

                AttackPayload attack = new AttackPayload(this);
                attack.Targets = GetEnemiesInArcDirection(User.Position, TargetPosition, ScriptFormula(14), ScriptFormula(15));
                attack.AddWeaponDamage(ScriptFormula(23), DamageType.Physical);
                attack.Apply();
                yield break;
            }
            else
            {
                TargetPosition = PowerMath.TranslateDirection2D(User.Position, TargetPosition, User.Position, ScriptFormula(11));

                AttackPayload attack = new AttackPayload(this);
                attack.Targets = GetEnemiesInRadius(TargetPosition, ScriptFormula(11));
                attack.AddWeaponDamage(ScriptFormula(4), DamageType.Physical);
                attack.OnHit = hitPayload =>
                {
                    if (Rune_D > 0)
                    {
                        if (hitPayload.IsCriticalHit)
                        {
                            if (Rand.NextDouble() < ScriptFormula(5))
                            {
                                //drop treasure or health globes.
                            }
                        }
                    }
                    if (Rune_C > 0)
                    {
                        AddBuff(hitPayload.Target, new DebuffSlowed(ScriptFormula(8), WaitSeconds(ScriptFormula(10))));
                    }
                };
                attack.OnDeath = DeathPayload =>
                {
                    if (Rune_E > 0)
                    {
                        //if (DeathPayload.Target)? Doesn't above handle this?
                        {
                            if (Rand.NextDouble() < ScriptFormula(16))
                            {
                                AttackPayload Stunattack = new AttackPayload(this);
                                Stunattack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(18));
                                Stunattack.OnHit = stun =>
                                {
                                    AddBuff(stun.Target, new DebuffStunned(WaitSeconds(ScriptFormula(17))));
                                };
                                Stunattack.Apply();
                            }
                        }
                    }
                };
                attack.Apply();

                if (Rune_C > 0)
                {
                    var QuakeHammer = SpawnEffect(159030, User.Position, 0, WaitSeconds(ScriptFormula(10)));
                    QuakeHammer.UpdateDelay = 1f;
                    QuakeHammer.OnUpdate = () =>
                    {
                        AttackPayload TremorAttack = new AttackPayload(this);
                        TremorAttack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(7));
                        TremorAttack.AddWeaponDamage(ScriptFormula(9), DamageType.Physical);
                        TremorAttack.Apply();
                    };
                }
            }
            yield break;
        }
示例#52
0
文件: Monk.cs 项目: jujuman/mooege
        private void MeleeStageHit()
        {
            if (Rune_D > 0)
            {
                if (Rand.NextDouble() < ScriptFormula(25))
                {
                    GeneratePrimaryResource(ScriptFormula(24));
                }
            }
            bool hitAnything = false;
            AttackPayload attack = new AttackPayload(this);
            attack.Targets = GetBestMeleeEnemy();
            attack.AddWeaponDamage(ScriptFormula(0), DamageType.Physical);
            attack.OnHit = hitPayload =>
            {
                hitAnything = true;
            };
            attack.Apply();

            if (hitAnything)
            {
                GeneratePrimaryResource(EvalTag(PowerKeys.SpiritGained));
                if (Rune_C > 0)
                {
                    AddBuff(User, new RuneCbuff());
                }
            }
        }
示例#53
0
 public override bool Apply()
 {
     if (!base.Apply())
         return false;
     User.Attributes[GameAttribute.Damage_Percent_Reduction_From_Melee] += ScriptFormula(10);
     User.Attributes[GameAttribute.Damage_Percent_Reduction_From_Ranged] += ScriptFormula(10);
     Target.Attributes.BroadcastChangedIfRevealed();
     if (Rune_D > 0)
     {
         AttackPayload attack = new AttackPayload(this);
         attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(8));
         attack.AddWeaponDamage(ScriptFormula(11), DamageType.Physical);
         attack.OnHit = hitPayload =>
         {
             Knockback(hitPayload.Target, ScriptFormula(6), ScriptFormula(7));
         };
         attack.Apply();
     }
     return true;
 }
示例#54
0
文件: Monk.cs 项目: jujuman/mooege
 private void MeleeStageHit()
 {
     AttackPayload attack = new AttackPayload(this);
     attack.Targets = GetEnemiesInRadius(User.Position, ScriptFormula(1));
     attack.AddWeaponDamage(ScriptFormula(4), DamageType.Physical);
     attack.Apply();
 }