コード例 #1
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;
        }
コード例 #2
0
ファイル: Monk.cs プロジェクト: jujuman/mooege
        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(EvalTag(PowerKeys.SpiritGained));
            yield break;
        }