コード例 #1
0
        public static void MoveEnding(AtkContext atk)
        {
            var aer = atk.Attacker;

            if (atk.Move.Id == Ms.SPIT_UP || atk.Move.Id == Ms.SWALLOW)
            {
                int i = aer.OnboardPokemon.GetCondition <int>(Cs.Stockpile);
                aer.ChangeLv7D(atk.Attacker, false, false, 0, -i, 0, -i);
                aer.OnboardPokemon.RemoveCondition(Cs.Stockpile);
                aer.ShowLogPm("DeStockpile");
            }

            MagicCoat(atk);

            atk.SetAttackerAction(atk.Move.StiffOneTurn ? PokemonAction.Stiff : PokemonAction.Done);
            if (atk.Targets != null)
            {
                foreach (var d in atk.Targets)
                {
                    ITs.Attach(d.Defender);
                    ATs.RecoverAfterMoldBreaker(d.Defender);
                }
            }
            ITs.Attach(atk.Attacker); //先树果汁后PP果

            var c = aer.Controller;
            {
                var o = atk.GetCondition(Cs.MultiTurn);
                if (o != null)
                {
                    o.Turn--;
                    if (o.Turn != 0)
                    {
                        atk.SetAttackerAction(PokemonAction.Moving);
                    }
                    else if (o.Bool)
                    {
                        aer.AddState(aer, AttachedState.Confuse, false, 0, "EnConfuse2");
                    }
                }
            }
            {
                var o = atk.GetCondition <Tile>(Cs.EjectButton);
                if (o != null)
                {
                    c.PauseForSendOutInput(o);
                    return;
                }
            }
            {
                var tile = aer.Tile;
                if (atk.Move.Switch && tile != null)
                {
                    c.Withdraw(aer, "SelfWithdraw", 0, true);
                    c.PauseForSendOutInput(tile);
                }
            }
        }
コード例 #2
0
        public static void BuildDefContext(AtkContext atk, Tile select)
        {
            switch (atk.Move.Id)
            {
            case Ms.COUNTER:     //68
                Counter(atk, Cs.PhysicalDamage);
                break;

            case Ms.MIRROR_COAT:     //243
                Counter(atk, Cs.SpecialDamage);
                break;

            case Ms.METAL_BURST:     //368
                Counter(atk, Cs.Damage);
                break;

            case Ms.BIDE:
                if (atk.GetCondition(Cs.MultiTurn).Turn == 1)
                {
                    var o       = atk.GetCondition(Cs.Bide);
                    var targets = new List <DefContext>();
                    if (o.By != null)
                    {
                        var t = GetRangeTiles(atk, MoveRange.SelectedTarget, o.By.Tile).FirstOrDefault();
                        if (t != null && t.Pokemon != null)
                        {
                            targets.Add(new DefContext(atk, t.Pokemon));
                        }
                    }
                    if (!targets.Any())
                    {
                        atk.Attacker.ShowLogPm("UseMove", Ms.BIDE);                     //奇葩的战报
                    }
                    atk.SetTargets(targets);
                }
                break;

            default:
                IEnumerable <Tile> ts = GetRangeTiles(atk, atk.Move.GetRange(atk.Attacker), select);
                if (ts != null)
                {
                    var targets = new List <DefContext>();
                    foreach (Tile t in ts)
                    {
                        if (t.Pokemon != null)
                        {
                            targets.Add(new DefContext(atk, t.Pokemon));
                        }
                    }
                    atk.SetTargets(targets);
                }
                break;
            }
        }
コード例 #3
0
        public static void MagicCoat(AtkContext atk)
        {
            var list = atk.GetCondition <List <PokemonProxy> >(Cs.MagicCoat);

            if (list != null)
            {
                atk.RemoveCondition(Cs.MagicCoat);
                foreach (var d in list)
                {
                    var a = new AtkContext(d);
                    a.SetCondition(Cs.IgnoreMagicCoat);
                    a.StartExecute(atk.Move, atk.Attacker.Tile, d.RaiseAbility(As.MAGIC_BOUNCE) ? "MagicBounce" : "MagicCoat");
                    if (atk.Target == null)
                    {
                        break;
                    }
                }
            }
        }