Beispiel #1
0
        public void ShowUserSelectListByCardEntry(CardEntry cardEntry, SendNotificationAddCardEntry sendNotificationAddCard)
        {
            //获取需要展示的效果
            EffectInfo needShowEffectInfo = cardEntry.needShowEffectInfo;
            //获取需要用户进行判断的效果
            EffectInfo needChoosePreEffect = needShowEffectInfo.needChoosePreEffect;
            List <OneUserSelectionItem> oneUserSelections = new List <OneUserSelectionItem>();
            //制作第一个选项,用户选择生效
            OneUserSelectionItem oneUserSelectionForYes = new OneUserSelectionItem();

            oneUserSelectionForYes.defaultAvailab = needChoosePreEffect.checkCanExecution;
            oneUserSelectionForYes.selectionText  = needChoosePreEffect.description;
            oneUserSelectionForYes.isExecute      = true;
            oneUserSelectionForYes.cardEntry      = cardEntry;
            //制作第二个选项,用户选择不生效
            OneUserSelectionItem oneUserSelectionForNo = new OneUserSelectionItem();

            oneUserSelectionForNo.defaultAvailab = true;
            oneUserSelectionForNo.selectionText  = "不执行";
            oneUserSelectionForNo.isExecute      = false;
            oneUserSelectionForNo.cardEntry      = cardEntry;
            oneUserSelections.Add(oneUserSelectionForYes);
            oneUserSelections.Add(oneUserSelectionForNo);
            //关闭窗口时执行的操作
            UnityAction choseThisView = () =>
            {
                cardIntactView.gameObject.SetActive(false);
            };

            userSelectionList.LoadingUserSelectionListToCreate(oneUserSelections, sendNotificationAddCard, choseThisView);
        }
        /// <summary>
        /// Translates card track data into information.
        /// </summary>
        /// <param name="rawResponse">Raw response from pinpad GCR command.</param>
        /// <returns>Card information.</returns>
        /// <exception cref="System.InvalidOperationException">Thrown when womething went wrong internally.</exception>
        public CardEntry Read(GcrResponse rawResponse)
        {
            CardEntry mappedCard = new CardEntry();

            // Save all tracks:
            if (rawResponse.GCR_TRK1.HasValue == true)
            {
                mappedCard.Track1 = rawResponse.GCR_TRK1.Value;
            }
            if (rawResponse.GCR_TRK2.HasValue == true)
            {
                mappedCard.Track2 = rawResponse.GCR_TRK2.Value;
            }

            // Selecting existing track:
            string selectedTrack = this.MapValidTrack(rawResponse);

            // Selecting corresponding track field separator:
            char fieldSeparator = this.GetFieldSeparator(selectedTrack);

            // Get Service code:
            ServiceCode sc = this.MapServiceCode(selectedTrack, fieldSeparator);

            // Values that don't need to be mapped:
            mappedCard.BrandId = rawResponse.GCR_RECIDX.Value.Value;

            // Mapping PAN, cardholder name, card expiration date and Service Code:
            mappedCard.PrimaryAccountNumber = this.MapPan(selectedTrack, fieldSeparator);
            mappedCard.CardholderName       = this.MapCardholderName(selectedTrack, fieldSeparator);
            mappedCard.ExpirationDate       = this.MapExpirationDate(selectedTrack, fieldSeparator);
            mappedCard.NeedsPassword        = sc.IsPinRequired;
            mappedCard.Type = (sc.IsEmv == true) ? CardType.Emv : CardType.MagneticStripe;

            return(mappedCard);
        }
Beispiel #3
0
    public void DrawCard(int amount)
    {
        int cardsToDraw = Mathf.Min(Hand.CardSlotsFree, amount);

        if (cardsToDraw != amount)
        {
            Debug.Log("Adding To many cards to the hand, the maximum is: " + Hand.MaxCardCount);
        }


        Debug.Log("Adding " + cardsToDraw + " cards to the hand of client: " +
                  netIdentity.connectionToClient.connectionId);

        for (int i = 0; i < cardsToDraw; i++)
        {
            CardEntry e = Deck.DrawCard();
            //Hand.AddCard(c);//Add the Card to the server
            GameObject cardInstance = Instantiate(e.Prefab, Deck.DeckPosition, Quaternion.identity);
            NetworkServer.Spawn(cardInstance, GetComponent <NetworkIdentity>().connectionToClient);
            Card c = cardInstance.GetComponent <Card>();
            c.Statistics = e.Statistics;
            Tuple <int[], int[], string[]> networkData = e.StatisticsToNetworkableTypes();
            Debug.Log("Sending Stats");
            c.TargetSendStats(netIdentity.connectionToClient, networkData.Item1, networkData.Item2, networkData.Item3);

            Hand.AddToHand(c.GetComponent <NetworkIdentity>());
            Hand.TargetAddToHand(netIdentity.connectionToClient,
                                 c.GetComponent <NetworkIdentity>()); //Add Card to the client
        }
    }
Beispiel #4
0
 public void LoadCard(CardEntry card, bool isPositive)
 {
     this.card = card;
     outLight.gameObject.SetActive(false);
     if (isPositive)
     {
         LoadTraitList(card.traitdemand);
         TextMeshProUGUI cardName = UtilityHelper.FindChild <TextMeshProUGUI>(transform, "CardName");
         cardName.text = card.cardInfo.name;
         TextMeshProUGUI cardCost = UtilityHelper.FindChild <TextMeshProUGUI>(transform, "CardCost");
         cardCost.text = card.cost.ToString();
         TextMeshProUGUI cardDescription = UtilityHelper.FindChild <TextMeshProUGUI>(transform, "CardDescription");
         cardDescription.text = card.description;
         //Assets\Resources\Image\CardBG
         //image路径
         string path = "Image/Card/CardBG/";
         path = path + card.bgImageName;
         MonoBehaviour cardBg = UtilityHelper.FindChild <MonoBehaviour>(transform, "CardBg");
         changeImageSprite(cardBg, path);
     }
     else
     {
         //image路径
         string        path   = "Image/Card/CardBG/cardback";
         MonoBehaviour cardBg = UtilityHelper.FindChild <MonoBehaviour>(transform, "CardBg");
         changeImageSprite(cardBg, path);
     }
 }
Beispiel #5
0
 public CardEntry CreateCell(CardEntry cardEntry)
 {
     cardEntry.locationIndex = cellIndex;
     cellIndex++;
     handCells.Add(cardEntry);
     return(cardEntry);
 }
Beispiel #6
0
        //改变材质
        public void MinionCellMaterialChange(MinionCellView minionCellView, CardEntry minionCellItem)
        {
            Component minionCellFrameBg = UtilityHelper.FindChild <Component>(minionCellView.transform, "MinionCellFrameBg");
            Image     imageComponent    = minionCellFrameBg.GetComponent <Image>();

            if (minionCellItem.IsEffectTarget == false)
            {
                if (minionCellView.playerCode == minionCellItem.controllerPlayerItem.playerCode)
                {
                    imageComponent.material = originalMyselfMaterial;
                }
                else
                {
                    imageComponent.material = originalEnemyMaterial;
                }
            }
            else
            {
                if (minionCellView.playerCode == minionCellItem.controllerPlayerItem.playerCode)
                {
                    imageComponent.material = effectTargetMyselfMaterial;
                }
                else
                {
                    imageComponent.material = effectTargetEnemyMaterial;
                }
            }
        }
        public override void Execute(INotification notification)
        {
            GameContainerProxy gameContainerProxy =
                Facade.RetrieveProxy(GameContainerProxy.NAME) as GameContainerProxy;
            EffectInfoProxy effectInfoProxy =
                Facade.RetrieveProxy(EffectInfoProxy.NAME) as EffectInfoProxy;
            QuestStageCircuitProxy questStageCircuitProxy =
                Facade.RetrieveProxy(QuestStageCircuitProxy.NAME) as QuestStageCircuitProxy;

            switch (notification.Type)
            {
            case GameContainerEvent.GAME_CONTAINER_SYS_CARD_NEED_MOVE:
                CardEntry cardEntryNeedMoveToHand = notification.Body as CardEntry;
                gameContainerProxy.MoveOneCardFromOldeContainerItemToNeweContainerItem(cardEntryNeedMoveToHand, cardEntryNeedMoveToHand.nextGameContainerType);
                break;

            case GameContainerEvent.GAME_CONTAINER_SYS_CARD_NEED_ADD_TO_TTS:
                CardEntry cardEntryNeedAddToTTS = notification.Body as CardEntry;
                //获取卡牌的效果,如果是持续效果则添加到全局监听中
                foreach (string effectCode in cardEntryNeedAddToTTS.effectCodeList)
                {
                    EffectInfo oneEffectInfo = effectInfoProxy.GetDepthCloneEffectByName(effectCode);
                    if (oneEffectInfo.impactType == "Continue")
                    {
                        oneEffectInfo.player    = cardEntryNeedAddToTTS.controllerPlayerItem;
                        oneEffectInfo.cardEntry = cardEntryNeedAddToTTS;
                        questStageCircuitProxy.circuitItem.putOneEffectInfoInActiveMap(oneEffectInfo, effectInfoProxy.effectSysItem.impactTimeTriggerMap);
                    }
                }
                break;
            }
        }
Beispiel #8
0
 public void AchieveHandGrid(GameContainerItem handGridItem, bool myself)
 {
     //清除
     foreach (HandCellView handCellView in handCellViews)
     {
         handCellPool.Push(handCellView);
     }
     //重新
     for (int i = 0; i < handGridItem.cardEntryList.Count(); i++)
     {
         CardEntry handCellItem = handGridItem.cardEntryList[i];
         Vector3   position     = new Vector3();
         //position = HandMetrics.erectPosition(position, handCellItem.X);
         //创建一个格子实例
         //       HandCellView cell = Instantiate<HandCellView>(cellPrefab);
         HandCellView cell = handCellPool.Pop();
         //设置图片
         //cell.GetComponent<HandCellInstance>().SetImage();
         cell.transform.SetParent(transform, false);
         cell.transform.localPosition = position;
         cell.myself = myself;
         cell.LoadHandCellItem(handCellItem);
         handCellViews.Add(cell);
     }
     //渲染需要放在格子生成完毕后
     //不再渲染,改为用贴图
     //handMesh.Triangulate(handCellViews);
 }
Beispiel #9
0
 //放置一张卡牌进卡组
 public CardEntry PutOneCard(CardEntry card)
 {
     card.locationIndex = cellIndex;
     cellIndex++;
     cardEntryList.Add(card);
     return(card);
 }
Beispiel #10
0
        //获取第一张牌并移除
        //获取序号为0的?
        public CardEntry GetFirstCard()
        {
            CardEntry cardEntry = cardEntryList[0];

            cardEntryList.RemoveAt(0);
            return(cardEntry);
        }
Beispiel #11
0
        //传入一个生物,判断出这个生物的可移动距离
        public Dictionary <HexCoordinates, HexCellItem> GetCanMoveCellByMinionCard(CardEntry minionCard, HexModelInfo modelInfo)
        {
            Dictionary <HexCoordinates, HexCellItem> alreadyPassedCellMap = new Dictionary <HexCoordinates, HexCellItem>();

            alreadyPassedCellMap.Add(minionCard.nowIndex, HexGrid.cellMap[minionCard.nowIndex]);
            for (int n = 0; n < minionCard.cardInfo.movingDistance; n++)
            {
                Dictionary <HexCoordinates, HexCellItem> oneCheckAddMap = new Dictionary <HexCoordinates, HexCellItem>();
                foreach (KeyValuePair <HexCoordinates, HexCellItem> keyValuePair in alreadyPassedCellMap)
                {
                    HexCoordinates startCoordinates = keyValuePair.Key;
                    foreach (HexCoordinates hexCoordinates in modelInfo.expansionVector)
                    {
                        HexCoordinates targetHexCoordinates = HexUtil.GetTargetHexCoordinatesByStartPointAndVector(startCoordinates, hexCoordinates);
                        if (HexGrid.cellMap.ContainsKey(targetHexCoordinates))
                        {
                            if (HexGrid.cellMap[targetHexCoordinates].inThisCellCardList.Count == 0)
                            {
                                if (!alreadyPassedCellMap.ContainsKey(targetHexCoordinates) && !oneCheckAddMap.ContainsKey(targetHexCoordinates))
                                {
                                    HexGrid.cellMap[targetHexCoordinates].pathfindingLastCell = keyValuePair.Value;
                                    oneCheckAddMap.Add(targetHexCoordinates, HexGrid.cellMap[targetHexCoordinates]);
                                }
                            }
                        }
                    }
                }
                foreach (KeyValuePair <HexCoordinates, HexCellItem> keyValuePair in oneCheckAddMap)
                {
                    alreadyPassedCellMap.Add(keyValuePair.Key, keyValuePair.Value);
                }
            }
            return(alreadyPassedCellMap);
        }
Beispiel #12
0
        public void LoadCardEntryList(List <CardEntry> cardList)
        {
            for (int i = 0; i < cardList.Count; i++)
            {
                CardEntry      card           = cardList[i];
                CardIntactView cardIntactView = null;
                bool           isAdd          = true;
                if (i < cardIntactViews.Count)
                {
                    cardIntactView = cardIntactViews[i];
                    isAdd          = false;
                }
                else
                {
                    cardIntactView = Instantiate <CardIntactView>(cardIntactViewPrefab);
                    Vector3 position = new Vector3();
                    cardIntactView.transform.SetParent(transform, false);
                    cardIntactView.transform.localPosition = position;
                }


                cardIntactView.LoadCard(card, true);
                if (isAdd)
                {
                    cardIntactViews.Add(cardIntactView);
                }
            }
        }
Beispiel #13
0
 public void LoadCardList(GameContainerItem cardDeck)
 {
     for (int i = 0; i < cardDeck.cardEntryList.Count; i++)
     {
         CardEntry    card         = cardDeck.cardEntryList[i];
         CardHeadView cardHeadView = null;
         bool         isAdd        = true;
         if (i < cardHeadViews.Count)
         {
             cardHeadView = cardHeadViews[i];
             isAdd        = false;
         }
         else
         {
             cardHeadView = Instantiate <CardHeadView>(cardHeadPrefab);
             Vector3 position = new Vector3();
             cardHeadView.transform.SetParent(transform, false);
             cardHeadView.transform.localPosition = position;
         }
         cardHeadView.LoadCard(card);
         if (isAdd)
         {
             cardHeadViews.Add(cardHeadView);
         }
     }
 }
Beispiel #14
0
        public void CardEntry_Construction_ShouldNotReturnNull()
        {
            // Arrange and act
            CardEntry card = new CardEntry();

            // Assert
            Assert.IsNotNull(card);
        }
Beispiel #15
0
        public void EmvTrackMapper_MapCardFromEmvTrack_ShouldNotReturnNull()
        {
            // Act
            CardEntry mappedCard = EmvTrackMapper.MapCardFromEmvTrack(this.GcrResponse);

            // Assert
            Assert.IsNotNull(mappedCard);
        }
Beispiel #16
0
        public void EmvTrackMapper_MapCardFromEmvTrack_ShouldReturnEmvCardType_Always()
        {
            // Act
            CardEntry mappedCard = EmvTrackMapper.MapCardFromEmvTrack(this.GcrResponse);

            // Assert
            Assert.IsTrue(mappedCard.Type == CardType.Emv);
        }
Beispiel #17
0
 //鼠标移出了某一张卡牌
 public void OneCardMousenPointerExit(CardEntry handCellItem)
 {
     foreach (HandCellView handCellView in handCellViews)
     {
         if (handCellView.handCellItem.uuid == handCellItem.uuid)
         {
         }
     }
 }
Beispiel #18
0
        //指定生物死亡,从前端移除
        public void MinionIsDeadNeedRemove(CardEntry minionCellItemDead)
        {
            UnityAction callBack = () =>
            {
                minionCellPool.Push(minionCellViews[minionCellItemDead.nowIndex]);
            };

            StartCoroutine(DelayToInvokeDo(callBack, 1f));
        }
Beispiel #19
0
        //添加一个生物实例展示
        public void AchieveOneMinion(CardEntry minionCellItem, HexGridItem hexGridItem, MinionGridMediator minionGridMediator)
        {
            Vector3        position           = new Vector3();
            HexCoordinates showHexCoordinates = HexCoordinates.ReverseFromOffsetCoordinates(minionCellItem.nowIndex.X, minionCellItem.nowIndex.Z, hexGridItem.modelInfo.arrayMode);

            position   = MinionMetrics.erectPosition(position, showHexCoordinates.X, showHexCoordinates.Z, hexGridItem.modelInfo.arrayMode);
            position.y = 1f;
            //创建一个生物实例
            MinionCellView cell = minionCellPool.Pop();

            cell.transform.SetParent(transform, false);
            cell.transform.localPosition = position;
            cell.minionCellItem          = minionCellItem;
            cell.playerCode = minionGridMediator.playerCode;
            TextMeshProUGUI atkAndDef = UtilityHelper.FindChild <TextMeshProUGUI>(cell.transform, "MinionCellLabel");

            atkAndDef.text = minionCellItem.atk.ToString() + "-" + minionCellItem.def.ToString();
            //添加绑定信息
            cell.OnPointerEnter = () =>
            {
                minionGridMediator.SendNotification(
                    UIViewSystemEvent.UI_VIEW_CURRENT,
                    cell,
                    StringUtil.GetNTByNotificationTypeAndUIViewNameAndOtherTypeAndDelayedProcess(
                        UIViewSystemEvent.UI_VIEW_CURRENT_OPEN_ONE_VIEW,
                        UIViewConfig.getNameStrByUIViewName(UIViewName.OneCardAllInfo),
                        "MinionCellView",
                        "N"
                        )
                    );
            };
            cell.OnPointerExit = () =>
            {
                minionGridMediator.SendNotification(
                    UIViewSystemEvent.UI_VIEW_CURRENT,
                    UIViewConfig.getNameStrByUIViewName(UIViewName.OneCardAllInfo),
                    StringUtil.GetNTByNotificationTypeAndDelayedProcess(
                        UIViewSystemEvent.UI_VIEW_CURRENT_CLOSE_ONE_VIEW,
                        "N"
                        )
                    );
            };
            cell.OnPointerDown = (CardEntry downMinionCellItem) =>
            {
                minionGridMediator.SendNotification(
                    OperateSystemEvent.OPERATE_SYS,
                    downMinionCellItem,
                    OperateSystemEvent.OPERATE_SYS_POINTER_DOWN_ONE_MINION
                    );
            };
            cell.OnPointerUp = (CardEntry upMinionCellItem) =>
            {
            };
            minionCellViews.Add(minionCellItem.nowIndex, cell);
            MinionCellMaterialChange(cell, minionCellItem);
            UtilityLog.Log("生成一个生物:" + minionCellItem.cardInfo.name, LogUtType.Operate);
        }
Beispiel #20
0
 //自动展示效果,会自动消失
 public void ShowCradEffectByCardEntryAuto(CardEntry cardEntry, UnityAction callBack)
 {
     //添加需要展示的卡牌
     ShowCradEffect(cardEntry);
     //显示引导线
     ShowEffectIndicationTrail(cardEntry);
     //0.5秒后隐藏擦除
     StartCoroutine(ShowOverAction(callBack));
 }
Beispiel #21
0
 //选中的手牌没有被成功使用
 public void HandChangeUncheckHandItem(CardEntry uncheckHandCellItem)
 {
     foreach (HandCellView handCellView in handCellViews)
     {
         if (uncheckHandCellItem.uuid == handCellView.handCellItem.uuid)
         {
             handCellView.UncheckChange();
         }
     }
 }
Beispiel #22
0
	//Client Sets the content of the deck by ids
	private void SetDeckContent(int[] cardIds)
	{
		DeckContent?.Clear();
		CardEntry[] cardPrefabs = new CardEntry[cardIds.Length];
		for (int i = 0; i < cardPrefabs.Length; i++)
		{
			cardPrefabs[i] = CardNetworkManager.Instance.CardEntries[cardIds[i]];
		}
		DeckContent = new Queue<CardEntry>(cardPrefabs);
	}
Beispiel #23
0
        public void AddOneCardEffect(CardEntry cardEntry)
        {
            Vector3        position       = new Vector3();
            CardIntactView cardIntactView = cardIntactViewPool.Pop();

            cardIntactView.transform.SetParent(transform, false);
            cardIntactView.transform.localPosition = position;
            cardIntactView.LoadCard(cardEntry, true);
            cardIntactViews.Add(cardIntactView);
        }
Beispiel #24
0
 //触发后判断效果是否可以执行
 public void SelectEffectAfterTrigger(List <EffectInfo> effectInfos, CardEntry ttsCardEntry, PlayerItem playerItemNotification, string notificationType)
 {
     foreach (EffectInfo effectInfo in effectInfos)
     {
         //如果是规则效果,那么需要将效果所有者设置成当前玩家
         if (effectInfo.impactType == "GameModelRule")
         {
             effectInfo.player = playerItemNotification;
         }
         foreach (ImpactTimeTrigger impactTimeTrigger in effectInfo.impactTimeTriggerList)
         {
             if (impactTimeTrigger.impactTimeTriggertMonitor == notificationType)
             {
                 //触发了效果
                 for (int n = 0; n < impactTimeTrigger.impactTimeTriggertClaims.Length; n++)
                 {
                     //判断触发点的所有权
                     if (impactTimeTrigger.impactTimeTriggertClaims[n] == "Owner")
                     {
                         //触发点是自己
                         if (impactTimeTrigger.impactTimeTriggertClaimsContents[n] == "Myself")
                         {
                             if (playerItemNotification == effectInfo.player)
                             {
                                 //触发成功,要先清除掉效果的目标列
                                 effectInfo.CleanEffectTargetSetList();
                                 //设置状态
                                 effectInfo.effectInfoStage = EffectInfoStage.UnStart;
                                 effectInfo.cardEntry.triggeredEffectInfo = effectInfo;
                                 UtilityLog.Log("效果【" + effectInfo.description + "】被【" + playerItemNotification.playerCode + "】触发", LogUtType.Effect);
                                 SendNotification(EffectExecutionEvent.EFFECT_EXECUTION_SYS, effectInfo.cardEntry, EffectExecutionEvent.EFFECT_EXECUTION_SYS_EXE_TRIGGERED_CARD);
                             }
                         }
                     }
                     if (impactTimeTrigger.impactTimeTriggertClaims[n] == "UUId")
                     {
                         if (impactTimeTrigger.impactTimeTriggertClaimsContents[n] == "ThisCard")
                         {
                             if (ttsCardEntry.uuid == effectInfo.cardEntry.uuid)
                             {
                                 //触发成功,要先清除掉效果的目标列
                                 effectInfo.CleanEffectTargetSetList();
                                 //设置状态
                                 effectInfo.effectInfoStage = EffectInfoStage.UnStart;
                                 effectInfo.cardEntry.triggeredEffectInfo = effectInfo;
                                 UtilityLog.Log("效果【" + effectInfo.description + "】被【" + ttsCardEntry.code + "】触发", LogUtType.Effect);
                                 SendNotification(EffectExecutionEvent.EFFECT_EXECUTION_SYS, effectInfo.cardEntry, EffectExecutionEvent.EFFECT_EXECUTION_SYS_EXE_TRIGGERED_CARD);
                             }
                         }
                     }
                 }
             }
         }
     }
 }
Beispiel #25
0
 //执行效果
 public void ExecutionEffectContentList(EffectInfoProxy effectInfoProxy, GameContainerProxy gameContainerProxy)
 {
     //if (effectInfoProxy.effectSysItem.cardEntry.gameContainerType == "CardHand") {
     //    effectInfoProxy.effectSysItem.cardEntry.ttCardNeedHideInView(effectInfoProxy.effectSysItem.cardEntry);
     //}
     for (int n = 0; n < effectInfoProxy.effectSysItem.effectInfos.Count; n++)
     {
         EffectInfo effectInfo = effectInfoProxy.effectSysItem.effectInfos[n];
         UtilityLog.Log("开始执行效果【" + effectInfo.code + "】", LogUtType.Effect);
         effectInfo.effectInfoStage = EffectInfoStage.Executing;
         if (effectInfo.effectType == "Independent")
         {
             ExecutionOneEffectContent(effectInfoProxy, effectInfo, gameContainerProxy);
         }
         else if (effectInfo.effectType == "BeforeAndAfter")
         {
             bool allPreEffectExe = true;
             //遍历每一个前置效果
             foreach (EffectInfo preEffect in effectInfo.preEffectEntryList)
             {
                 UtilityLog.Log("执行前置效果", LogUtType.Special);
                 if (preEffect.userChooseExecution)
                 {
                     UtilityLog.Log("执行一个前置效果", LogUtType.Special);
                     ExecutionOneEffectContent(effectInfoProxy, preEffect, gameContainerProxy);
                 }
                 else
                 {
                     allPreEffectExe = false;
                 }
             }
             if (allPreEffectExe)
             {
                 UtilityLog.Log("执行后置效果", LogUtType.Special);
                 //遍历每一个后置效果
                 foreach (EffectInfo postEffect in effectInfo.postEffectEntryList)
                 {
                     UtilityLog.Log("执行一个后置效果", LogUtType.Special);
                     ExecutionOneEffectContent(effectInfoProxy, postEffect, gameContainerProxy);
                 }
             }
             effectInfo.effectInfoStage = EffectInfoStage.Finished;
         }
         //选择效果无需展示
         if (effectInfo.whetherToshow == "Y")
         {
             //发送已经确认目标的效果到前台进行展示
             CardEntry oneCardEntry = effectInfo.cardEntry;
             oneCardEntry.needShowEffectInfo = effectInfo;
             effectInfoProxy.effectSysItem.showEffectNum++;
             SendNotification(UIViewSystemEvent.UI_EFFECT_DISPLAY_SYS, oneCardEntry, UIViewSystemEvent.UI_EFFECT_DISPLAY_SYS_PUT_ONE_EFFECT);
         }
     }
 }
Beispiel #26
0
        //添加信号发射
        public void AddTimeTrigger(CardEntry minionCellItem)
        {
            minionCellItem.ttAttributeChange = () =>
            {
                SendNotification(MinionSystemEvent.MINION_VIEW, minionCellItem, MinionSystemEvent.MINION_VIEW_MINION_CHANGE_ATTRIBUTE);
            };

            //buff发生了变化
            minionCellItem.ttBuffChange = () =>
            {
                SendNotification(UIViewSystemEvent.UI_ONE_CARD_ALL_INFO, minionCellItem, UIViewSystemEvent.UI_ONE_CARD_ALL_INFO_BUFF_CHANGE);
            };
            //buff需要被移除
            minionCellItem.ttBuffNeedRemove = () =>
            {
                SendNotification(EffectExecutionEvent.EFFECT_EXECUTION_SYS, minionCellItem, EffectExecutionEvent.EFFECT_EXECUTION_SYS_MINION_BUFF_NEED_REMOVE);
            };
            //生物准备发起一次攻击
            minionCellItem.ttLaunchAnAttack = () => {
                UtilityLog.Log("玩家【" + minionCellItem.controllerPlayerItem.playerCode + "】的生物【" + minionCellItem.name + "】发起一次攻击", LogUtType.Attack);
                SendNotification(EffectExecutionEvent.EFFECT_EXECUTION_SYS, minionCellItem, EffectExecutionEvent.EFFECT_EXECUTION_SYS_LAUNCH_AN_ATTACK);
            };
            //生物进行一次攻击
            minionCellItem.ttExecuteAnAttack = () =>
            {
                SendNotification(MinionSystemEvent.MINION_VIEW, minionCellItem, MinionSystemEvent.MINION_VIEW_ATTACK_TARGET_MINION);
            };
            //生物发起一次移动
            minionCellItem.ttLaunchAnMove = () =>
            {
                UtilityLog.Log("玩家【" + minionCellItem.controllerPlayerItem.playerCode + "】的生物【" + minionCellItem.name + "】发起一次移动", LogUtType.Attack);
                SendNotification(EffectExecutionEvent.EFFECT_EXECUTION_SYS, minionCellItem, EffectExecutionEvent.EFFECT_EXECUTION_SYS_LAUNCH_AN_MOVE);
            };
            //生物进行一次移动
            minionCellItem.ttExecuteAnMove = () =>
            {
                SendNotification(MinionSystemEvent.MINION_VIEW, minionCellItem, MinionSystemEvent.MINION_VIEW_MOVE_TARGET_HEX_CELL);
            };
            //生物死亡
            minionCellItem.ttCardMinionIsDead = () =>
            {
                SendNotification(MinionSystemEvent.MINION_VIEW, minionCellItem, MinionSystemEvent.MINION_VIEW_ONE_MINION_IS_DEAD);
                SendNotification(MinionSystemEvent.MINION_SYS, minionCellItem, MinionSystemEvent.MINION_SYS_ONE_MINION_IS_DEAD);
            };
            //生物进入战场
            minionCellItem.ttMinionIntoBattlefield = () => {
                SendNotification(EffectExecutionEvent.EFFECT_EXECUTION_SYS, minionCellItem, EffectExecutionEvent.EFFECT_EXECUTION_SYS_MINION_ENTER_THE_BATTLEFIELD);
            };
            //生物被牺牲
            minionCellItem.ttMinionToSacrifice = () =>
            {
                minionCellItem.ttCardMinionIsDead();
            };
        }
Beispiel #27
0
 //初始化
 public void AchieveMinionGrid(MinionGridItem minionGridItem, HexGridItem hexGridItem, MinionGridMediator minionGridMediator)
 {
     Dictionary <HexCoordinates, CardEntry> .KeyCollection keyCol = minionGridItem.minionCells.Keys;
     foreach (HexCoordinates key in keyCol)
     {
         CardEntry minionCellItem = minionGridItem.minionCells[key];
         AchieveOneMinion(minionCellItem, hexGridItem, minionGridMediator);
     }
     //渲染需要放在格子生成完毕后
     //minionMesh.Triangulate(minionCellViews, hexGridItem.modelInfo.arrayMode);
 }
Beispiel #28
0
        bool ChangeOrCheckCard(string impactTarget, string impactContent, CardEntry cardEntry, GameContainerProxy gameContainerProxy, EffectExeType effectExeType)
        {
            bool canExecute = true;

            if (impactTarget == "GameContainerType")
            {
                gameContainerProxy.MoveOneCardFromOldeContainerItemToNeweContainerItem(cardEntry, impactContent);
            }

            return(canExecute);
        }
Beispiel #29
0
 //生物像指定方向进行移动
 public void MinionMoveTargetHexCell(CardEntry minionCellItemNew, HexModelInfo hexModelInfo, UnityAction callBack)
 {
     minionCellViews.Add(minionCellItemNew.nowIndex, minionCellViews[minionCellItemNew.lastIndex]);
     minionCellViews.Remove(minionCellItemNew.lastIndex);
     foreach (MinionCellView minCellView in minionCellViews.Values)
     {
         if (minCellView.minionCellItem.uuid == minionCellItemNew.uuid)
         {
             StartCoroutine(MoveMinionCellShowMove(minionCellItemNew, minCellView, callBack, hexModelInfo));
         }
     }
 }
Beispiel #30
0
        public void AskTheUserOperating(EffectInfo effectInfo,
                                        PlayerGroupProxy playerGroupProxy,
                                        QuestStageCircuitProxy questStageCircuitProxy,
                                        EffectInfoProxy effectInfoProxy,
                                        GameContainerProxy gameContainerProxy)
        {
            effectInfo.effectInfoStage = EffectInfoStage.AskTheUser;
            if (effectInfo.effectType == "Independent")
            {
            }
            else if (effectInfo.effectType == "BeforeAndAfter")
            {
                //遍历每一个前置效果
                foreach (EffectInfo preEffect in effectInfo.preEffectEntryList)
                {
                    if (preEffect.effectInfoStage == EffectInfoStage.AskTheUser ||
                        preEffect.effectInfoStage == EffectInfoStage.ConfirmedTarget)
                    {
                        preEffect.effectInfoStage   = EffectInfoStage.AskTheUser;
                        preEffect.checkCanExecution = true;

                        bool checkOver = EffectExecution(preEffect, EffectExeType.Check, gameContainerProxy);
                        if (!checkOver)
                        {
                            preEffect.checkCanExecution = false;
                            UtilityLog.Log(preEffect.code + ":检查为不能释放", LogUtType.Special);
                        }
                        //判断是否是必发
                        if (preEffect.mustBeLaunched == "N")
                        {
                            //不是必发,需要用户判断
                            effectInfo.needChoosePreEffect = preEffect;
                            //发送已经确认目标的效果到前台进行展示
                            CardEntry oneCardEntry = effectInfo.cardEntry;
                            oneCardEntry.needShowEffectInfo = effectInfo;
                            effectInfoProxy.effectSysItem.showEffectNum++;
                            SendNotification(UIViewSystemEvent.UI_EFFECT_DISPLAY_SYS, oneCardEntry, UIViewSystemEvent.UI_EFFECT_DISPLAY_SYS_ONE_EFFECT_NEED_CHOOSE_EXE);
                            return;
                        }
                        else
                        {
                            preEffect.effectInfoStage = EffectInfoStage.AskTheUserOver;
                        }
                    }
                    else
                    {
                        UtilityLog.LogError("逻辑错误:不应出现【用户判断】阶段前不是【宾语目标寻找结束】阶段");
                    }
                }
            }

            effectInfo.effectInfoStage = EffectInfoStage.AskTheUserOver;
        }