Пример #1
0
        /// <summary>
        /// 根据施法对象获得不同法术
        /// </summary>
        /// <param name="singleEffect"></param>
        /// <param name="game"></param>
        /// <param name="PosInfo"></param>
        /// <returns></returns>
        private static IAtomicEffect GetEffectHandler(EffectDefine singleEffect, ActionStatus 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;

            case AtomicEffectDefine.AtomicEffectEnum.召回:
                IAtomic = new CallBackEffect();
                break;
            }
            IAtomic.GetField(atomic.InfoArray);
            return((IAtomicEffect)IAtomic);
        }
Пример #2
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;
     }
 }
Пример #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="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;
     }
 }