Пример #1
0
 public override void execute(TouhouCardEngine.CardEngine engine)
 {
     engine.setGem(player, player.getProp <int>("gem") - card.define.getProp <int>("cost"));
     if (card.define is ServantCardDefine || (card.define is GeneratedCardDefine && (card.define as GeneratedCardDefine).type == CardDefineType.servant))
     {
         //随从卡,将卡置入战场
         engine.summon(player, card, targetPosition);
         if (card.define.effects != null && card.define.effects.Length > 0)
         {
             Effect effect = card.define.effects.FirstOrDefault(e => { return(card.pile.name == e.pile && e.trigger == "onUse"); });
             if (effect != null)
             {
                 effect.execute(engine, player, card, targetCards);
             }
         }
     }
     else if (card.define is SpellCardDefine || (card.define is GeneratedCardDefine && (card.define as GeneratedCardDefine).type == CardDefineType.spell))
     {
         //法术卡,释放效果然后丢进墓地
         player["Hand"].moveTo(card, player["Warp"], player["Warp"].count);
         if (card.define.effects != null && card.define.effects.Length > 0)
         {
             Effect effect = card.define.effects.FirstOrDefault(e => { return(card.pile.name == e.pile && e.trigger == "onUse"); });
             if (effect != null)
             {
                 effect.execute(engine, player, card, targetCards);
             }
         }
         player["Warp"].moveTo(card, player["Grave"], player["Grave"].count);
     }
 }