bool ChangeOrCheckPlayer(string impactTarget, string impactContent, PlayerItem playerItem, EffectExeType effectExeType) { bool canExecute = true; switch (impactTarget) { case "Hand": playerItem.DrawCard(Convert.ToInt32(impactContent)); break; //资源上限 case "ManaUpperLimit": playerItem.ChangeManaUpperLimit(Convert.ToInt32(impactContent)); break; case "ManaUsable": if (effectExeType == EffectExeType.Execute) { //恢复至上限使用Max,是不能被转为数字的 if (impactContent == "Max") { playerItem.RestoreToTheUpperLimit(); } else { playerItem.ChangeManaUsable(Convert.ToInt32(impactContent)); } } else if (effectExeType == EffectExeType.Check) { //恢复至上限使用Max,是不能被转为数字的 if (impactContent == "Max") { } else { canExecute = playerItem.CheckCanChangeManaUsable(Convert.ToInt32(impactContent)); } } break; //科技相关 case "TraitAddOne": playerItem.AddTraitType(impactContent); break; case "Score": playerItem.ChangeSocre(Convert.ToInt32(impactContent)); break; case "CanUseResourceNum": if (impactContent == "Max") { // 使用资源牌恢复到最大次数 playerItem.RestoreCanUseResourceNumMax(); } else { } break; } return(canExecute); }
bool ChangeOrCheckMinion(string impactTarget, string impactContent, CardEntry minionCellItem, bool isReverse, EffectExeType effectExeType) { bool canExecute = true; switch (impactTarget) { case "ATK": minionCellItem.cardEntryVariableAttributeMap.ChangeValueByCodeAndTypeAndIsReverse("Atk", Convert.ToInt32(impactContent), isReverse); minionCellItem.ttAttributeChange(); break; case "DEF": minionCellItem.cardEntryVariableAttributeMap.ChangeValueByCodeAndTypeAndIsReverse("Def", Convert.ToInt32(impactContent), isReverse); minionCellItem.ttAttributeChange(); break; case "Attack": minionCellItem.ttLaunchAnAttack(); break; case "Move": minionCellItem.ttLaunchAnMove(); break; case "Life": if (impactContent == "Sacrifice") { if (effectExeType == EffectExeType.Check) { canExecute = true; } else if (effectExeType == EffectExeType.Execute) { minionCellItem.ttMinionToSacrifice(); } } break; } return(canExecute); }
bool ChangeOrCheckCard(string impactTarget, string impactContent, CardEntry cardEntry, GameContainerProxy gameContainerProxy, EffectExeType effectExeType) { bool canExecute = true; if (impactTarget == "GameContainerType") { gameContainerProxy.MoveOneCardFromOldeContainerItemToNeweContainerItem(cardEntry, impactContent); } return(canExecute); }
public bool EffectExecution(EffectInfo exeEffect, EffectExeType effectExeType, GameContainerProxy gameContainerProxy) { if (exeEffect.operationalContent != null) { if (exeEffect.operationalContent.operationalTarget == "All") { foreach (TargetSet targetSetDto in exeEffect.operationalTarget.selectTargetList) { if (targetSetDto.target == "Minion") { for (int n = 0; n < targetSetDto.targetMinionCellItems.Count; n++) { if (!exeEffect.isReverse) { if (exeEffect.effectiveTime.ContinuousStage != "Moment" && exeEffect.effectiveTime.ContinuousStage != "Permanent") { targetSetDto.targetMinionCellItems[n].effectBuffInfoList.Add(exeEffect); targetSetDto.targetMinionCellItems[n].ttBuffChange(); } } for (int m = 0; m < exeEffect.operationalContent.impactTargets.Length; m++) { bool result = ChangeOrCheckMinion(exeEffect.operationalContent.impactTargets[m], exeEffect.operationalContent.impactContents[m], targetSetDto.targetMinionCellItems[n], exeEffect.isReverse, effectExeType); } } } else if (targetSetDto.target == "Player") { for (int n = 0; n < targetSetDto.targetPlayerItems.Count; n++) { UtilityLog.Log("目标玩家【" + targetSetDto.targetPlayerItems[n].playerCode + "】生效效果【" + exeEffect.description + "】", LogUtType.Effect); for (int m = 0; m < exeEffect.operationalContent.impactTargets.Length; m++) { bool result = ChangeOrCheckPlayer( exeEffect.operationalContent.impactTargets[m], exeEffect.operationalContent.impactContents[m], targetSetDto.targetPlayerItems[n], effectExeType); if (!result) { return(false); } } } } else if (targetSetDto.target == "Card") { for (int n = 0; n < targetSetDto.targetCardEntries.Count; n++) { for (int m = 0; m < exeEffect.operationalContent.impactTargets.Length; m++) { bool result = ChangeOrCheckCard( exeEffect.operationalContent.impactTargets[m], exeEffect.operationalContent.impactContents[m], targetSetDto.targetCardEntries[n], gameContainerProxy, effectExeType); if (!result) { return(false); } } } } } } } return(true); }