예제 #1
0
        public override void Init()
        {
            base.Init();

            cardAbility[TriggerTime.When][TriggerType.Play] = new List <Func <TriggerInfo, Task> >()
            {
                async(triggerInfo) =>
                {
                    await GameSystem.SelectSystem.SelectLocation(this);

                    await GameSystem.TransSystem.DeployCard(TriggerInfo.Build(this, this));
                }
            };
            cardAbility[TriggerTime.When][TriggerType.Deploy] = new List <Func <TriggerInfo, Task> >()
            {
                async(triggerInfo) =>
                {
                    for (int i = 0; i < twoSideVitality + 1; i++)
                    {
                        await GameSystem.SelectSystem.SelectUnite(this, cardSet[Orientation.Op][RegionTypes.Battle][CardRank.Copper, CardRank.Silver][CardFeature.Largest].CardList, 1, true);

                        await GameSystem.PointSystem.Hurt(new TriggerInfo(this, SelectUnits, 1));
                    }
                }
            };
        }
예제 #2
0
        public override void Init()
        {
            base.Init();

            cardAbility[TriggerTime.When][TriggerType.Play] = new List <Func <TriggerInfo, Task> >()
            {
                async(triggerInfo) =>
                {
                    await GameSystem.SelectSystem.SelectLocation(this);

                    await GameSystem.TransSystem.DeployCard(TriggerInfo.Build(this, this));
                }
            };
            cardAbility[TriggerTime.When][TriggerType.Deploy] = new List <Func <TriggerInfo, Task> >()
            {
                async(triggerInfo) =>
                {
                    await GameSystem.SelectSystem.SelectRegion(RegionTypes.Battle, Territory.Op);

                    List <Card> targetCardList = SelectRegion.ThisRowCards;
                    int         hurtMaxValue   = twoSideVitality + 1;
                    for (int i = 0; i < Math.Min(targetCardList.Count, hurtMaxValue); i++)
                    {
                        await GameSystem.PointSystem.Hurt(new TriggerInfo(this, targetCardList[i], hurtMaxValue - i));
                    }
                }
            };
        }
        public override void Init()
        {
            base.Init();

            cardAbility[TriggerTime.When][TriggerType.Play] = new List <Func <TriggerInfo, Task> >()
            {
                async(triggerInfo) =>
                {
                    await GameSystem.SelectSystem.SelectLocation(this);

                    await GameSystem.TransSystem.DeployCard(TriggerInfo.Build(this, this));
                }
            };
            cardAbility[TriggerTime.When][TriggerType.Deploy] = new List <Func <TriggerInfo, Task> >()
            {
                async(triggerInfo) =>
                {
                    await GameSystem.SelectSystem.SelectUnite(this, cardSet[Orientation.My][RegionTypes.Battle][CardField.Vitality].CardList, 2, false);

                    foreach (var unite in SelectUnits)
                    {
                        await GameSystem.FieldSystem.Change(new TriggerInfo(this, unite, unite[CardField.Vitality] * 2));
                    }
                }
            };
        }
예제 #4
0
 private void OnMouseUp()
 {
     if (PlayerPlayCard != null)
     {
         //if (PlayerFocusRegion != null)
         //{
         if (PlayerFocusRegion != null && PlayerFocusRegion.name == "下方_墓地")
         {
             //print(name + "进入墓地");
             _ = Command.CardCommand.DisCard(thisCard);
         }
         else if (PlayerFocusRegion != null && (PlayerFocusRegion.name == "下方_领袖" || PlayerFocusRegion.name == "下方_手牌"))
         {
             PlayerPlayCard = null;
         }
         else
         {
             Debug.Log("1打出一张牌" + PlayerPlayCard);
             Task.Run(async() =>
             {
                 await GameSystem.TransSystem.PlayCard(TriggerInfo.Build(PlayerPlayCard, PlayerPlayCard));
                 Debug.LogError("我的回合结束啦!");
                 IsCardEffectCompleted = true;
             });
         }
     }
 }
        public override void Init()
        {
            base.Init();

            this[CardField.Vitality] = 1;
            replaceDescribeValue     = this[CardField.Vitality];

            cardAbility[TriggerTime.When][TriggerType.Play] = new List <Func <TriggerInfo, Task> >()
            {
                async(triggerInfo) =>
                {
                    await GameSystem.SelectSystem.SelectLocation(this);

                    await GameSystem.TransSystem.DeployCard(TriggerInfo.Build(this, this));
                }
            };
            cardAbility[TriggerTime.When][TriggerType.Deploy] = new List <Func <TriggerInfo, Task> >()
            {
                async(triggerInfo) =>
                {
                    await GameSystem.SelectSystem.SelectUnite(this, cardSet[Orientation.My][RegionTypes.Battle][CardRank.Copper].CardList, 1);

                    await GameSystem.PointSystem.Cure(TriggerInfo.Build(this, SelectUnits));
                }
            };
        }
        public override void Init()
        {
            base.Init();

            cardAbility[TriggerTime.When][TriggerType.Play] = new List <Func <TriggerInfo, Task> >()
            {
                async(triggerInfo) =>
                {
                    await GameSystem.SelectSystem.SelectLocation(this);

                    await GameSystem.TransSystem.DeployCard(TriggerInfo.Build(this, this));
                }
            };
            cardAbility[TriggerTime.When][TriggerType.Deploy] = new List <Func <TriggerInfo, Task> >()
            {
                async(triggerInfo) =>
                {
                    for (int i = 0; i < 1 + twoSideVitality; i++)
                    {
                        await GameSystem.SelectSystem.SelectUnite(this, cardSet[RegionTypes.Battle].CardList, 1, false);

                        await GameSystem.StateSystem.SealCard(new TriggerInfo(this, SelectUnits, 1));
                    }
                }
            };
        }
        public override void Init()
        {
            base.Init();

            cardAbility[TriggerTime.When][TriggerType.Play] = new List <Func <TriggerInfo, Task> >()
            {
                async(triggerInfo) =>
                {
                    await GameSystem.SelectSystem.SelectLocation(this);

                    await GameSystem.TransSystem.DeployCard(TriggerInfo.Build(this, this));
                }
            };
            cardAbility[TriggerTime.When][TriggerType.Deploy] = new List <Func <TriggerInfo, Task> >()
            {
                async(triggerInfo) =>
                {
                    int targetCount = cardSet[Orientation.My][RegionTypes.Battle][CardTag.Fairy].count;
                    Debug.Log("场上妖精数量为" + targetCount);
                    for (int i = 0; i < targetCount; i++)
                    {
                        if (basePoint > 1)
                        {
                            await GameSystem.SelectSystem.SelectUnite(this, cardSet[Orientation.Op][RegionTypes.Battle][CardRank.Silver, CardRank.Copper].CardList, 1, isAuto : true);

                            await GameSystem.PointSystem.Hurt(TriggerInfo.Build(this, SelectUnits, 1));

                            await GameSystem.PointSystem.Weak(TriggerInfo.Build(this, this, 1));
                        }
                    }
                }
            };
        }
예제 #8
0
        public override void Init()
        {
            base.Init();

            cardAbility[TriggerTime.When][TriggerType.Play] = new List <Func <TriggerInfo, Task> >()
            {
                async(triggerInfo) =>
                {
                    await GameSystem.SelectSystem.SelectLocation(this);

                    await GameSystem.TransSystem.DeployCard(TriggerInfo.Build(this, this));
                }
            };
        }
        public static async Task TempOperationPlayCard()
        {
            if ((Info.AgainstInfo.isDownPass && Info.PointInfo.TotalDownPoint < Info.PointInfo.TotalUpPoint) ||
                Info.AgainstInfo.cardSet[Orientation.My][RegionTypes.Hand].CardList.Count == 0)
            {
                GameUI.UiCommand.SetCurrentPass();
            }
            else
            {
                Card targetCard = Info.AgainstInfo.cardSet[Orientation.My][RegionTypes.Hand].CardList[0];
                await GameSystem.TransSystem.PlayCard(TriggerInfo.Build(targetCard, targetCard));

                Info.AgainstInfo.IsCardEffectCompleted = true;
                //await CardCommand.PlayCard(targetCard);
            }
        }
        public override void Init()
        {
            base.Init();

            cardAbility[TriggerTime.When][TriggerType.Play] = new List <Func <TriggerInfo, Task> >()
            {
                async(triggerInfo) =>
                {
                    await GameSystem.SelectSystem.SelectLocation(this);

                    await GameSystem.TransSystem.DeployCard(TriggerInfo.Build(this, this));
                }
            };
            cardAbility[TriggerTime.When][TriggerType.Deploy] = new List <Func <TriggerInfo, Task> >()
            {
                async(triggerInfo) =>
                {
                    await GameSystem.SelectSystem.SelectUnite(this, cardSet[Orientation.My][RegionTypes.Battle][CardRank.Copper, CardRank.Silver][CardTag.Fairy].CardList, 1);

                    await GameSystem.PointSystem.Cure(TriggerInfo.Build(this, SelectUnits));

                    if (SelectUnits.Any())
                    {
                        SelectRegion   = Info.RowsInfo.GetSingleRowInfoById(SelectUnits[0].location.x);
                        SelectLocation = SelectUnits[0].location.y;
                    }
                    await GameSystem.TransSystem.DeployCard(TriggerInfo.Build(this, SelectUnits));
                },
                //async (triggerInfo) =>
                //{
                //    Debug.Log("10002卡牌效果:重新部署单位"+SelectUnits.Count);
                //    if (SelectUnits.Any())
                //    {
                //        SelectRegion=Info.RowsInfo.GetSingleRowInfoById(SelectUnits[0].location.x);
                //        SelectLocation=SelectUnits[0].location.y;
                //    }
                //    Debug.LogError("10002选择完毕");
                //    await GameSystem.TransSystem.DeployCard(TriggerInfo.Build(this,SelectUnits));
                //    Debug.LogError("10002部署效果触发完毕!");
                //}
            };
        }
예제 #11
0
        public override void Init()
        {
            base.Init();

            this[CardField.Vitality] = 2;
            replaceDescribeValue     = this[CardField.Vitality];

            cardAbility[TriggerTime.When][TriggerType.Play] = new List <Func <TriggerInfo, Task> >()
            {
                async(triggerInfo) =>
                {
                    await GameSystem.SelectSystem.SelectLocation(this);

                    await GameSystem.TransSystem.DeployCard(TriggerInfo.Build(this, this));
                }
            };
            cardAbility[TriggerTime.When][TriggerType.Deploy] = new List <Func <TriggerInfo, Task> >()
            {
                async(triggerInfo) =>
                {
                    if (!this[CardState.Seal])
                    {
                        List <Card> targetCardList = cardSet[Orientation.My][RegionTypes.Deck].CardList.Where(card => card.CardId == 10007 || card.CardId == 10008).ToList();
                        await GameSystem.TransSystem.SummonCard(new TriggerInfo(this, targetCardList));
                    }
                }
            };
            cardAbility[TriggerTime.When][TriggerType.FieldChange] = new List <Func <TriggerInfo, Task> >()
            {
#pragma warning disable CS1998 // 此异步方法缺少 "await" 运算符,将以同步方式运行。请考虑使用 "await" 运算符等待非阻止的 API 调用,或者使用 "await Task.Run(...)" 在后台线程上执行占用大量 CPU 的工作。
                async(triggerInfo) =>
#pragma warning restore CS1998 // 此异步方法缺少 "await" 运算符,将以同步方式运行。请考虑使用 "await" 运算符等待非阻止的 API 调用,或者使用 "await Task.Run(...)" 在后台线程上执行占用大量 CPU 的工作。
                {
                    EffectCommand.Bullet_Gain(triggerInfo);
                    EffectCommand.AudioEffectPlay(1);
                    //await Task.Delay(1000);
                    this[CardField.Vitality] = triggerInfo.point;
                    replaceDescribeValue     = this[CardField.Vitality];
                }
            };
        }
        public override void Init()
        {
            base.Init();

            cardAbility[TriggerTime.When][TriggerType.Play] = new List <Func <TriggerInfo, Task> >()
            {
                async(triggerInfo) =>
                {
                    await GameSystem.SelectSystem.SelectLocation(this);

                    await GameSystem.TransSystem.DeployCard(TriggerInfo.Build(this, this));
                }
            };
            cardAbility[TriggerTime.When][TriggerType.Deploy] = new List <Func <TriggerInfo, Task> >()
            {
                async(triggerInfo) =>
                {
                    SelectUnits = cardSet[RegionTypes.Battle][CardRank.Copper, CardRank.Silver][CardFeature.Largest].CardList;
                    await GameSystem.PointSystem.Destory(TriggerInfo.Build(this, SelectUnits));
                },
            };
        }
예제 #13
0
        public override void Init()
        {
            base.Init();

            this[CardField.Vitality] = 2;
            replaceDescribeValue     = this[CardField.Vitality];

            cardAbility[TriggerTime.When][TriggerType.Play] = new List <Func <TriggerInfo, Task> >()
            {
                async(triggerInfo) =>
                {
                    await GameSystem.SelectSystem.SelectLocation(this);

                    await GameSystem.TransSystem.DeployCard(TriggerInfo.Build(this, this));
                }
            };
            cardAbility[TriggerTime.When][TriggerType.Deploy] = new List <Func <TriggerInfo, Task> >()
            {
                async(triggerInfo) =>
                {
                    List <Card> targetCardList = cardSet[Orientation.My][RegionTypes.Deck].CardList.Where(card => card.CardId == 10006 || card.CardId == 10007).ToList();
                    await GameSystem.TransSystem.SummonCard(new TriggerInfo(this, targetCardList));
                }
            };
            cardAbility[TriggerTime.When][TriggerType.FieldChange] = new List <Func <TriggerInfo, Task> >()
            {
                async(triggerInfo) =>
                {
                    EffectCommand.Bullet_Gain(triggerInfo);
                    EffectCommand.AudioEffectPlay(1);
                    await Task.Delay(1000);

                    this[CardField.Vitality] = triggerInfo.point;
                    replaceDescribeValue     = this[CardField.Vitality];
                }
            };
        }
 public static async Task WhenRoundStart() => await TriggerLogic(TriggerInfo.Build(null, cardSet[RegionTypes.Battle].CardList)[TriggerType.RoundStart]);
 public static async Task WhenTurnStart() => await TriggerLogic(TriggerInfo.Build(null, targetCard: null)[TriggerType.TurnStart]);