Esempio n. 1
0
 public void ContinueExecute(Tile selectTile)
 {
     TotalDamage = 0;
     if (Move.Id != Ms.SKY_DROP)
     {
         MoveE.BuildDefContext(this, selectTile);                         //如果被带入空中的精灵被打死
     }
     MoveExecute.Execute(this);
 }
Esempio n. 2
0
        public static void AttackPostEffect(AtkContext atk)
        {
            var aer = atk.Attacker;
            var c   = aer.Controller;

            if (!atk.IgnoreSwitchItem)
            {
                bool e = true, r = aer.Hp != 0 && aer.Controller.CanWithdraw(aer);
                foreach (var d in atk.Targets)
                {
                    if (!d.HitSubstitute && d.Defender.Tile != null)
                    {
                        var der = d.Defender;
                        var i   = der.Item;
                        if (e && i == Is.EJECT_BUTTON)
                        {
                            atk.SetCondition(Cs.EjectButton, der.Tile);
                            der.ConsumeItem();
                            c.Withdraw(der, "EjectButton", 0, true);
                            if (r == false)
                            {
                                break;
                            }
                            e = false;
                        }
                        else if (r && i == Is.RED_CARD)
                        {
                            der.ConsumeItem();
                            der.ShowLogPm("RedCard", aer.Id);
                            r = !MoveE.ForceSwitchImplement(aer, true);
                            if (e == false)
                            {
                                return;
                            }
                        }
                    }
                }
            }
            if (aer.ItemE(Is.SHELL_BELL))
            {
                if (atk.TotalDamage != 0)
                {
                    aer.HpRecoverByOneNth(atk.TotalDamage >> 3, false, Ls.ItemHpRecover, Is.SHELL_BELL);
                }
            }
            else if (aer.ItemE(Is.LIFE_ORB) && aer.EffectHurtByOneNth(10, Ls.LifeOrb))
            {
                aer.CheckFaint();
            }
        }
 public void StartExecute(MoveTypeE move, Tile selectTile = null, string log = "UseMove")
 {
     Move = move;
     if (STs.CanExecuteMove(Attacker, Move))
     {
         if (log != null)
         {
             Attacker.ShowLogPm(log, Move.Id);
         }
         InitAtkContext.Execute(this);
         MoveE.BuildDefContext(this, selectTile); //蓄力技如果选择的是压力特性的精灵,在第一回合就会扣取2点PP,即使最后攻击到的不是压力特性的精灵。
         if (MoveProxy != null)
         {
             ATs.Pressure(this, Move.GetRange(Attacker));
         }
         MoveExecute.Execute(this);
     }
     else
     {
         FailAll(null);
     }
 }
Esempio n. 4
0
 public void StartExecute(MoveTypeE move, Tile selectTile = null, string log = "UseMove", bool canChangeZmove = true)
 {
     Move = move;
     if (Attacker.SelectZmove && canChangeZmove && !move.Zmove && move.Move.Category != MoveCategory.Status)
     {
         Move      = MoveTypeE.Get(GameHelper.CommonZmove(Move.Move));
         trans     = true;
         transmove = move;
     }
     else
     {
         trans = false;
     }
     if (STs.CanExecuteMove(Attacker, Move))
     {
         InitAtkContext.Execute(this);
         MoveE.BuildDefContext(this, selectTile); //蓄力技如果选择的是压力特性的精灵,在第一回合就会扣取2点PP,即使最后攻击到的不是压力特性的精灵。
         if (MoveProxy != null)
         {
             ATs.Pressure(this, Move.GetRange(Attacker));
         }
         if (log == "FSDD")
         {
             Target.Defender.ShowLogPm(log, Move.Id);
         }
         else if (log != null)
         {
             Attacker.ShowLogPm(log, Move.Id);
         }
         MoveExecute.Execute(this, selectTile);
     }
     else
     {
         FailAll(null);
     }
 }
Esempio n. 5
0
        public static void AttackPostEffect(AtkContext atk)
        {
            var  aer = atk.Attacker;
            var  c   = aer.Controller;
            bool e   = true;

            if (!atk.IgnoreSwitchItem)
            {
                bool r = aer.Hp != 0 && aer.Controller.CanWithdraw(aer);
                foreach (var d in atk.Targets)
                {
                    if (!d.HitSubstitute && d.Defender.Tile != null)
                    {
                        var der = d.Defender;
                        var i   = der.Item;
                        if (e && i == Is.EJECT_BUTTON)
                        {
                            atk.SetCondition(Cs.EjectButton, der.Tile);
                            der.ConsumeItem();
                            c.Withdraw(der, "EjectButton", 0, true);
                            if (r == false)
                            {
                                break;
                            }
                            e = false;
                        }
                        else if (r && i == Is.RED_CARD)
                        {
                            der.ConsumeItem();
                            der.ShowLogPm("RedCard", aer.Id);
                            r = !MoveE.ForceSwitchImplement(aer, true);
                            if (e == false)
                            {
                                return;
                            }
                        }
                        else if (e && (der.Ability == As.Emergency_Exit || der.Ability == As.Wimp_Out) && der.Hp <= der.Pokemon.MaxHp / 2 && atk.TotalDamage + der.Hp > der.Pokemon.MaxHp / 2)
                        {
                            atk.SetCondition(Cs.EjectButton, der.Tile);
                            if (der.Ability == As.Emergency_Exit)
                            {
                                c.Withdraw(der, "EmergencyExit", 0, true);
                            }
                            else if (der.Ability == As.Wimp_Out)
                            {
                                c.Withdraw(der, "WimpOut", 0, true);
                            }
                            if (r == false)
                            {
                                break;
                            }
                            e = false;
                        }
                    }
                }
            }
            bool moreThanHalf = aer.Hp > aer.Pokemon.MaxHp / 2;

            if (aer.ItemE(Is.SHELL_BELL))
            {
                if (atk.TotalDamage != 0)
                {
                    aer.HpRecoverByOneNth(atk.TotalDamage, false, Ls.ItemHpRecover, Is.SHELL_BELL, false, true);
                }
            }
            else if (aer.ItemE(Is.LIFE_ORB) && aer.EffectHurtByOneNth(10, Ls.LifeOrb))
            {
                aer.CheckFaint();
            }
        }