Ejemplo n.º 1
0
 internal void Execute()
 {
     if (ITs.ChoiceItem(Owner.Item))
     {
         Owner.OnboardPokemon.AddCondition(Cs.ChoiceItem, MoveE);
     }
     Owner.ShowLogPm("UseMove", MoveE.Id);
     Owner.BuildAtkContext(this);
     Owner.AtkContext.StartExecute(MoveE, Owner.SelectedTarget, null);
     HasUsed = true;
 }
Ejemplo n.º 2
0
        internal bool CheckNeedInput()
        {
            if (Action == PokemonAction.Done || State == PokemonState.SLP && Action == PokemonAction.Moving && AtkContext.Move.SkipSleepMTA)
            {
                {
                    var o = OnboardPokemon.GetCondition(Cs.Encore);
                    if (o != null)
                    {
                        foreach (var m in Moves)
                        {
                            if (m.MoveE == o.Move)
                            {
                                if (m.PP == 0)
                                {
                                    break;
                                }
                                else
                                {
                                    goto DONE1;
                                }
                            }
                        }
                        OnboardPokemon.RemoveCondition(Cs.Encore);
                    }
                }
DONE1:
                if (ITs.ChoiceItem(Item))
                {
                    var o = OnboardPokemon.GetCondition <MoveTypeE>(Cs.ChoiceItem);
                    if (o != null)
                    {
                        foreach (var m in Moves)
                        {
                            if (m.MoveE == o)
                            {
                                goto DONE2;
                            }
                        }
                        OnboardPokemon.RemoveCondition(Cs.ChoiceItem);
                    }
                }
DONE2:
                Action = PokemonAction.WaitingForInput;
                return(true);
            }
            return(false);
        }
Ejemplo n.º 3
0
 internal void Execute()
 {
     if (ITs.ChoiceItem(Owner.Item))
     {
         Owner.OnboardPokemon.AddCondition(Cs.ChoiceItem, MoveE);
     }
     if (Owner.SelectZmove)
     {
         Owner.ShowLogPm("Zmove");
     }
     Owner.ShowLogPm("UseMove", MoveE.Id);
     if (Owner.SelectZmove && MoveE.Move.Category == MoveCategory.Status)
     {
         StatusZmove(Owner, MoveE);
     }
     Owner.BuildAtkContext(this);
     Owner.AtkContext.StartExecute(MoveE, Owner.SelectedTarget, null);
     HasUsed = true;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// CanSelect不代表技能一定能用,http://www.smogon.com/dp/articles/move_restrictions#disable
 /// </summary>
 /// <returns>key, null if no problem</returns>
 internal SelectMoveFail IfSelected()
 {
     if (MoveE.Id != Ms.STRUGGLE)
     {
         var op = Owner.OnboardPokemon;
         //专爱
         {
             var o = op.GetCondition <MoveTypeE>(Cs.ChoiceItem);
             if (o != null && o != MoveE && ITs.ChoiceItem(Owner.Item))
             {
                 return(new SelectMoveFail("ChoiceItem", o.Id));
             }
         }
         //寻衅
         if (op.HasCondition(Cs.Torment) && Owner.LastMove == MoveE)
         {
             return(new SelectMoveFail("Torment", Owner.AtkContext.MoveProxy.MoveE.Id));
         }
         //鼓掌
         {
             var o = op.GetCondition(Cs.Encore);
             if (o != null && o.Move != MoveE)
             {
                 return(new SelectMoveFail("Encore", Owner.AtkContext.MoveProxy.MoveE.Id));
             }
         }
         //封印
         foreach (var pm in Owner.Controller.Board[1 - Owner.Pokemon.TeamId].GetAdjacentPokemonsByOppositeX(Owner.OnboardPokemon.X))
         {
             if (pm.OnboardPokemon.HasCondition(Cs.Imprison))
             {
                 foreach (var m in pm.Moves)
                 {
                     if (m.MoveE == MoveE)
                     {
                         return(new SelectMoveFail("Imprison", MoveE.Id));
                     }
                 }
             }
         }
         //残废
         {
             var o = op.GetCondition(Cs.Disable);
             if (o != null && o.Move == MoveE)
             {
                 return(new SelectMoveFail("Disable", MoveE.Id));
             }
         }
         //重力
         if (MoveE.UnavailableWithGravity && Owner.Controller.Board.HasCondition(Cs.Gravity))
         {
             return(new SelectMoveFail("GravityCantUseMove", MoveE.Id));
         }
         //回复封印
         if (MoveE.Heal && op.HasCondition(Cs.HealBlock))
         {
             return(new SelectMoveFail("HealBlockCantUseMove", MoveE.Id));
         }
         //地狱突刺
         if (MoveE.Sound && op.HasCondition(Cs.SoundBlock))
         {
             return(new SelectMoveFail("SoundBlockCantUseMove", MoveE.Id));
         }
         //挑拨
         if (MoveE.Move.Category == MoveCategory.Status && op.HasCondition(Cs.Taunt))
         {
             return(new SelectMoveFail("Taunt", MoveE.Id));
         }
         //突击背心
         if (MoveE.Move.Category == MoveCategory.Status && Owner.ItemE(Is.ASSAULT_VEST))
         {
             return(new SelectMoveFail("AssaultVest", MoveE.Id));
         }
     }
     return(null);
 }