示例#1
0
 /// <summary>
 /// 处理对方的动作
 /// </summary>
 /// <param name="item"></param>
 /// <param name="game"></param>
 public static void Process(string item, GameManager game)
 {
     string[] actField = item.Split(CardUtility.strSplitMark.ToCharArray());
     switch (Engine.Server.ActionCode.GetActionType(item))
     {
         case ActionCode.ActionType.Card:
             CardEffect.ReRunEffect(game, actField);
             break;
         case ActionCode.ActionType.UseMinion:
             int Pos = int.Parse(actField[2]);
             var minion = (Engine.Card.MinionCard)Engine.Utility.CardUtility.GetCardInfoBySN(actField[1]);
             minion.Init();
             game.YourInfo.BattleField.PutToBattle(Pos, minion);
             game.YourInfo.BattleField.ResetBuff();
             break;
         case ActionCode.ActionType.UseWeapon:
             game.YourInfo.Weapon = (Engine.Card.WeaponCard)Engine.Utility.CardUtility.GetCardInfoBySN(actField[1]);
             break;
         case ActionCode.ActionType.UseSecret:
             game.YourInfo.SecretCount++; ;
             break;
         case ActionCode.ActionType.UseAbility:
             break;
         case ActionCode.ActionType.Fight:
             //FIGHT#1#2
             FightHandler.Fight(int.Parse(actField[2]), int.Parse(actField[1]), game, true);
             break;
         case ActionCode.ActionType.Point:
             IAtomicEffect point = new PointEffect();
             point.ReRunEffect(game, actField);
             break;
         case ActionCode.ActionType.Health:
             IAtomicEffect health = new HealthEffect();
             health.ReRunEffect(game, actField);
             break;
         case ActionCode.ActionType.Status:
             IAtomicEffect status = new StatusEffect();
             status.ReRunEffect(game, actField);
             break;
         case ActionCode.ActionType.Transform:
             IAtomicEffect transform = new TransformEffect();
             transform.ReRunEffect(game, actField);
             break;
         case ActionCode.ActionType.Attack:
             IAtomicEffect attack = new AttackEffect();
             attack.ReRunEffect(game, actField);
             break;
         case ActionCode.ActionType.HitSecret:
             SecretCard.ReRunSecret(game, actField);
             break;
         case ActionCode.ActionType.Control:
             ControlEffect.ReRunEffect(game, actField);
             break;
         case ActionCode.ActionType.Summon:
             SummonEffect.ReRunEffect(game, actField);
             break;
         case ActionCode.ActionType.Crystal:
             CrystalEffect.ReRunEffect(game, actField);
             break;
         case ActionCode.ActionType.WeaponPoint:
             WeaponPointEffect.ReRunEffect(game, actField);
             break;
         case ActionCode.ActionType.Settle:
             game.Settle();
             break;
     }
 }
示例#2
0
 /// <summary>
 /// 处理对方的动作
 /// </summary>
 /// <param name="ActionCommand"></param>
 /// <param name="game"></param>
 public static void Process(string ActionCommand, ActionStatus game)
 {
     string[] actField = ActionCommand.Split(CardUtility.strSplitMark.ToCharArray());
     switch (ActionCode.GetActionType(ActionCommand))
     {
         case ActionCode.ActionType.Card:
             CardEffect.ReRunEffect(1, game, actField);
             break;
         case ActionCode.ActionType.UseMinion:
             int Pos = int.Parse(actField[2]);
             var minion = (MinionCard)CardUtility.GetCardInfoBySN(actField[1]);
             minion.初始化();
             game.AllRole.YourPublicInfo.BattleField.PutToBattle(Pos, minion);
             Buff.ResetBuff(game);
             break;
         case ActionCode.ActionType.UseWeapon:
             game.AllRole.YourPublicInfo.Hero.Weapon = (WeaponCard)CardUtility.GetCardInfoBySN(actField[1]);
             break;
         case ActionCode.ActionType.UseSecret:
             game.AllRole.YourPublicInfo.Hero.SecretCount++; ;
             break;
         case ActionCode.ActionType.UseAbility:
             break;
         case ActionCode.ActionType.Fight:
             //FIGHT#1#2
             FightHandler.Fight(int.Parse(actField[2]), int.Parse(actField[1]), game, false);
             break;
         case ActionCode.ActionType.Point:
             IAtomicEffect point = new PointEffect();
             point.ReRunEffect(game, actField);
             break;
         case ActionCode.ActionType.Health:
             IAtomicEffect health = new HealthEffect();
             health.ReRunEffect(game, actField);
             break;
         case ActionCode.ActionType.Status:
             IAtomicEffect status = new StatusEffect();
             status.ReRunEffect(game, actField);
             break;
         case ActionCode.ActionType.Transform:
             IAtomicEffect transform = new TransformEffect();
             transform.ReRunEffect(game, actField);
             break;
         case ActionCode.ActionType.Attack:
             IAtomicEffect attack = new AttackEffect();
             attack.ReRunEffect(game, actField);
             break;
         case ActionCode.ActionType.HitSecret:
             SecretCard.ReRunSecret(game, actField);
             break;
         case ActionCode.ActionType.Control:
             ControlEffect.ReRunEffect(game, actField);
             break;
         case ActionCode.ActionType.Summon:
             SummonEffect.ReRunEffect(game, actField);
             break;
         case ActionCode.ActionType.Crystal:
             CrystalEffect.ReRunEffect(game, actField);
             break;
         case ActionCode.ActionType.WeaponPoint:
             WeaponPointEffect.ReRunEffect(game, actField);
             break;
         case ActionCode.ActionType.Settle:
             ActionStatus.Settle(game);
             break;
     }
 }
示例#3
0
 /// <summary>
 /// 根据施法对象获得不同法术
 /// </summary>
 /// <param name="singleEffect"></param>
 /// <param name="game"></param>
 /// <param name="PosInfo"></param>
 /// <returns></returns>
 private static IAtomicEffect GetEffectHandler(EffectDefine singleEffect, Engine.Client.GameManager game, String PosInfo)
 {
     AtomicEffectDefine atomic;
     if (String.IsNullOrEmpty(singleEffect.效果条件) ||
         singleEffect.效果条件 == CardUtility.strIgnore ||
         ExpressHandler.AtomicEffectPickCondition(game, PosInfo, singleEffect))
     {
         atomic = singleEffect.TrueAtomicEffect;
     }
     else
     {
         atomic = singleEffect.FalseAtomicEffect;
     }
     IAtomicEffect IAtomic = new AttackEffect();
     switch (atomic.AtomicEffectType)
     {
         case AtomicEffectDefine.AtomicEffectEnum.攻击:
             IAtomic = new AttackEffect();
             break;
         case AtomicEffectDefine.AtomicEffectEnum.回复:
             IAtomic = new HealthEffect();
             break;
         case AtomicEffectDefine.AtomicEffectEnum.状态:
             IAtomic = new StatusEffect();
             break;
         case AtomicEffectDefine.AtomicEffectEnum.增益:
             IAtomic = new PointEffect();
             break;
         case AtomicEffectDefine.AtomicEffectEnum.变形:
             IAtomic = new TransformEffect();
             break;
     }
     IAtomic.GetField(atomic.InfoArray);
     return (IAtomicEffect)IAtomic;
 }
示例#4
0
 /// <summary>
 /// 发动战吼
 /// 自身/相邻
 /// </summary>
 /// <param name="MinionPos"></param>
 public List<String> 发动战吼(int MinionPos, GameManager game)
 {
     List<String> ActionCodeLst = new List<string>();
     if (!String.IsNullOrEmpty(BattleMinions[MinionPos - 1].战吼效果))
     {
         List<int> PosList = new List<int>();
         if (BattleMinions[MinionPos - 1].战吼类型 == MinionCard.战吼类型列表.相邻)
         {
             //相邻左边随从存在?
             if (MinionPos != 1) PosList.Add(MinionPos - 1);
             //相邻右边随从存在?
             if (MinionPos != MinionCount) PosList.Add(MinionPos + 1);
         }
         else
         {
             //自身
             PosList.Add(MinionPos);
         }
         //处理状态和数值变化
         var 战吼 = (Engine.Card.AbilityCard)Engine.Utility.CardUtility.GetCardInfoBySN(BattleMinions[MinionPos - 1].战吼效果);
         foreach (int PosInfo in PosList)
         {
             switch (战吼.FirstAbilityDefine.MainAbilityDefine.TrueAtomicEffect.AtomicEffectType)
             {
                 case Engine.Effect.AtomicEffectDefine.AtomicEffectEnum.增益:
                     IAtomicEffect IAtomicPoint = new PointEffect();
                     IAtomicPoint.GetField(战吼.FirstAbilityDefine.MainAbilityDefine.TrueAtomicEffect.InfoArray);
                     IAtomicPoint.DealMinion(game, BattleMinions[PosInfo - 1]);
                     ActionCodeLst.Add(Engine.Server.ActionCode.strPoint + Engine.Utility.CardUtility.strSplitMark + Engine.Utility.CardUtility.strMe + Engine.Utility.CardUtility.strSplitMark +
                     PosInfo + Engine.Utility.CardUtility.strSplitMark + 战吼.FirstAbilityDefine.MainAbilityDefine);
                     break;
                 case Engine.Effect.AtomicEffectDefine.AtomicEffectEnum.状态:
                     IAtomicEffect IAtomicStatus = new StatusEffect();
                     IAtomicStatus.GetField(战吼.FirstAbilityDefine.MainAbilityDefine.TrueAtomicEffect.InfoArray);
                     IAtomicStatus.DealMinion(game, BattleMinions[PosInfo - 1]);
                     ActionCodeLst.Add(Engine.Server.ActionCode.strStatus + Engine.Utility.CardUtility.strSplitMark + Engine.Utility.CardUtility.strMe + Engine.Utility.CardUtility.strSplitMark +
                     PosInfo + Engine.Utility.CardUtility.strSplitMark + 战吼.FirstAbilityDefine.MainAbilityDefine);
                     break;
             }
             switch (战吼.SecondAbilityDefine.MainAbilityDefine.TrueAtomicEffect.AtomicEffectType)
             {
                 case Engine.Effect.AtomicEffectDefine.AtomicEffectEnum.增益:
                     IAtomicEffect IAtomicPoint = new PointEffect();
                     IAtomicPoint.GetField(战吼.FirstAbilityDefine.MainAbilityDefine.TrueAtomicEffect.InfoArray);
                     IAtomicPoint.DealMinion(game, BattleMinions[PosInfo - 1]);
                     ActionCodeLst.Add(Engine.Server.ActionCode.strPoint + Engine.Utility.CardUtility.strSplitMark + Engine.Utility.CardUtility.strMe + Engine.Utility.CardUtility.strSplitMark +
                     PosInfo + Engine.Utility.CardUtility.strSplitMark + 战吼.SecondAbilityDefine.MainAbilityDefine);
                     break;
                 case Engine.Effect.AtomicEffectDefine.AtomicEffectEnum.状态:
                     IAtomicEffect IAtomicStatus = new StatusEffect();
                     IAtomicStatus.GetField(战吼.FirstAbilityDefine.MainAbilityDefine.TrueAtomicEffect.InfoArray);
                     IAtomicStatus.DealMinion(game, BattleMinions[PosInfo - 1]);
                     ActionCodeLst.Add(Engine.Server.ActionCode.strStatus + Engine.Utility.CardUtility.strSplitMark + Engine.Utility.CardUtility.strMe + Engine.Utility.CardUtility.strSplitMark +
                     PosInfo + Engine.Utility.CardUtility.strSplitMark + 战吼.SecondAbilityDefine.MainAbilityDefine);
                     break;
             }
         }
     }
     return ActionCodeLst;
 }