Exemplo n.º 1
0
 private void WriteName(ISymbol symbol, string text)
 {
     if (TypeSymbols != null &&
         symbol is INamedTypeSymbol typeSymbol &&
         TypeSymbols.Contains(typeSymbol))
     {
         _writer.WriteLink(
             text,
             "#" + DocumentationUtility.CreateLocalLink(symbol, LocalLinkPrefix),
             symbol.ToDisplayString(TypeSymbolDisplayFormats.Name_ContainingTypes_TypeParameters));
     }
Exemplo n.º 2
0
 public override void Read(Message message)
 {
     if (!Available)
     {
         DetachAll();
         return;
     }
     if (!TypeSymbols.Contains(SkillTypeSymbol.Special) && !Owner.IsOnField)
     {
         DetachAll();
         return;
     }
     if (Keyword == SkillKeyword.CCS && (!Owner.IsClassChanged))
     {
         DetachAll();
         return;
     }
     foreach (Card card in Game.AllCards)
     {
         if (CanTarget(card) && !Targets.Contains(card))
         {
             ItemsToApply.Clear();
             SetItemToApply();
             CleanItemsToApply();
             if (ItemsToApply.Count > 0)
             {
                 Attach(card, ItemsToApply);
             }
         }
         else if (!CanTarget(card) && Targets.Contains(card))
         {
             Detach(card);
         }
         else if (CanTarget(card) && Targets.Contains(card))
         {
             ItemsToApply.Clear();
             SetItemToApply();
             CleanItemsToApply();
             if (CheckItemUpdated(card))
             {
                 Detach(card);
                 Attach(card, ItemsToApply);
             }
         }
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// 判断该能力是否可以发动
 /// </summary>
 /// <returns>若可以发动,返回true</returns>
 public bool Check()
 {
     foreach (var card in Controller.AllCards)
     {
         foreach (var item in card.SubSkillList)
         {
             if (item is IUserForbidActionSkill)
             {
                 if (((IUserForbidActionSkill)item).ForbiddenSkillName == Name)
                 {
                     return(false);
                 }
             }
         }
     }
     if (!Available)
     {
         return(false);
     }
     if (UsedInThisTurn)
     {
         return(false);
     }
     if (!Owner.IsOnField)
     {
         if (
             !(Controller.Bond.Contains(Owner) && Owner.FrontShown && TypeSymbols.Contains(SkillTypeSymbol.Bond)) &&
             !(TypeSymbols.Contains(SkillTypeSymbol.Special))
             )
         {
             return(false);
         }
     }
     if (Keyword == SkillKeyword.CCS && (!Owner.IsClassChanged))
     {
         return(false);
     }
     if (!CheckConditions())
     {
         return(false);
     }
     Cost = DefineCost();
     return(Cost.Check());
 }
Exemplo n.º 4
0
    public override void Read(Message message)
    {
        if (!Available || UsedInThisTurn)
        {
            return;
        }
        if (!TypeSymbols.Contains(SkillTypeSymbol.Special) && !Owner.IsOnField)
        {
            return;
        }
        if (Keyword == SkillKeyword.CCS && (!Owner.IsClassChanged))
        {
            return;
        }
        base.Read(message);
        var induction = CheckInduceConditions(message);

        if (induction != null)
        {
            induction.Message = message;
            induction.Skill   = this;
            Induce(induction);
        }
    }