示例#1
0
 protected override void InitSideEffectParam()
 {
     base.InitSideEffectParam();
     M_SideEffectParam.SetParam_ConstInt("TargetSelect", (int)TargetSelect.All, typeof(TargetSelect));
     M_SideEffectParam.SetParam_ConstInt("TargetRange", (int)TargetRange.None, typeof(TargetRange));
     M_SideEffectParam.SetParam_ConstInt("ChoiceCount", 1);
 }
示例#2
0
        public override bool Execute(ExecutorInfo executorInfo)
        {
            if (!base.Execute(executorInfo))
            {
                return(false);
            }
            BattlePlayer player = (BattlePlayer)Player;
            int          value  = M_SideEffectParam.GetParam_MultipliedInt("Damage");
            int          times  = M_SideEffectParam.GetParam_ConstInt("DamageTimes");

            player.GameManager.SideEffect_ILifeAction(
                delegate(ILife life)
            {
                for (int i = 0; i < times; i++)
                {
                    life.Damage(value);
                }
            },
                player,
                ChoiceCount,
                TargetRange,
                TargetSelect,
                executorInfo.TargetClientIds,
                executorInfo.TargetMechIds
                );
            return(true);
        }
        public override bool Execute(ExecutorInfo executorInfo)
        {
            if (!base.Execute(executorInfo))
            {
                return(false);
            }
            BattlePlayer player = (BattlePlayer)Player;

            int count = player.BattleGroundManager.MechCount + player.MyEnemyPlayer.BattleGroundManager.MechCount;

            player.Damage(count * M_SideEffectParam.GetParam_ConstInt("Damage"));

            List <int> killMechIds = new List <int>();

            foreach (ModuleMech mech in player.BattleGroundManager.Mechs)
            {
                killMechIds.Add(mech.M_MechID);
            }

            foreach (ModuleMech mech in player.MyEnemyPlayer.BattleGroundManager.Mechs)
            {
                killMechIds.Add(mech.M_MechID);
            }

            player.GameManager.KillMechs(killMechIds);
            return(true);
        }
示例#4
0
 public override string GenerateDesc()
 {
     return(HighlightStringFormat(
                DescRaws[LanguageManager_Common.GetCurrentLanguage()],
                GetDescOfTargetRange(),
                M_SideEffectParam.GetParam_MultipliedInt("ArmorValue")));
 }
示例#5
0
        public override bool Execute(ExecutorInfo executorInfo)
        {
            if (!base.Execute(executorInfo))
            {
                return(false);
            }
            BattlePlayer player      = (BattlePlayer)Player;
            int          healPercent = M_SideEffectParam.GetParam_MultipliedInt("Percent");

            if (TargetRange == TargetRange.Self) // 对自身
            {
                ModuleMech mech      = player.BattleGroundManager.GetMech(executorInfo.MechId);
                int        healValue = (int)Math.Ceiling((float)healPercent * mech.M_MechTotalLife / 100);
                player.BattleGroundManager.GetMech(executorInfo.MechId).Heal(healValue);
            }
            else
            {
                player.GameManager.SideEffect_ILifeAction(
                    delegate(ILife life)
                {
                    int healValue = (int)Math.Ceiling((float)healPercent * life.GetTotalLife() / 100);
                    life.Heal(healValue);
                },
                    player,
                    ChoiceCount,
                    TargetRange,
                    TargetSelect,
                    executorInfo.TargetClientIds,
                    executorInfo.TargetMechIds
                    );
            }
            return(true);
        }
示例#6
0
        public override bool Execute(ExecutorInfo executorInfo)
        {
            if (!base.Execute(executorInfo))
            {
                return(false);
            }
            BattlePlayer player = (BattlePlayer)Player;
            int          value  = M_SideEffectParam.GetParam_MultipliedInt("AttackValue");

            if (value < 0)
            {
                return(true);
            }
            if (TargetRange == TargetRange.Self) // 对自身
            {
                player.GameManager.GetMech(executorInfo.MechId).M_MechAttack += value;
            }
            else
            {
                player.GameManager.SideEffect_MechAction(
                    delegate(ModuleMech mech) { mech.M_MechAttack += value; },
                    player,
                    0,
                    executorInfo.TargetMechIds,
                    TargetRange,
                    TargetSelect,
                    -1
                    );
            }
            return(true);
        }
示例#7
0
        public override bool Execute(ExecutorInfo executorInfo)
        {
            if (!base.Execute(executorInfo))
            {
                return(false);
            }
            BattlePlayer player = (BattlePlayer)Player;
            int          value  = M_SideEffectParam.GetParam_MultipliedInt("HealValue");

            if (TargetRange == TargetRange.Self) // 对自身
            {
                player.BattleGroundManager.GetMech(executorInfo.MechId).Heal(value);
            }
            else
            {
                player.GameManager.SideEffect_ILifeAction(
                    delegate(ILife life) { life.Heal(value); },
                    player,
                    ChoiceCount,
                    TargetRange,
                    TargetSelect,
                    executorInfo.TargetClientIds,
                    executorInfo.TargetMechIds
                    );
            }
            return(true);
        }
示例#8
0
        public override bool Execute(ExecutorInfo executorInfo)
        {
            if (!base.Execute(executorInfo))
            {
                return(false);
            }
            BattlePlayer player = (BattlePlayer)Player;

            player.GameManager.SideEffect_ShipAction(
                delegate(BattlePlayer sp)
            {
                int cardCount = M_SideEffectParam.GetParam_ConstInt("CardCount");
                int copyCount = M_SideEffectParam.GetParam_MultipliedInt("CopyCount");

                if (executorInfo.CardInstanceId != ExecutorInfo.EXECUTE_INFO_NONE)
                {
                    List <int> cardIds = player.HandManager.GetRandomHandCardIds(cardCount, new HashSet <int> {
                        executorInfo.CardInstanceId
                    });

                    foreach (int cardId in cardIds)
                    {
                        player.HandManager.GetTempCardsByID(cardId, copyCount);
                    }
                }
            },
                player,
                ChoiceCount,
                TargetRange,
                TargetSelect,
                executorInfo.TargetClientIds);
            return(true);
        }
示例#9
0
        public override bool Execute(ExecutorInfo executorInfo)
        {
            if (!base.Execute(executorInfo))
            {
                return(false);
            }
            BattlePlayer player = (BattlePlayer)Player;

            player.GameManager.SideEffect_ShipAction(
                delegate(BattlePlayer sp)
            {
                CardInfo_Base ci = sp.CardDeckManager.CardDeck.GetFirstCardInfo();
                if (ci != null)
                {
                    sp.HandManager.DrawCards(1);
                    for (int i = 0; i < M_SideEffectParam.GetParam_MultipliedInt("CardCount"); i++)
                    {
                        sp.HandManager.GetACardByID(ci.CardID);
                    }
                }
            },
                player,
                ChoiceCount,
                TargetRange,
                TargetSelect,
                executorInfo.TargetClientIds);
            return(true);
        }
示例#10
0
 public override string GenerateDesc()
 {
     return(base.GenerateDesc() + HighlightStringFormat(DescRaws[LanguageManager_Common.GetCurrentLanguage()],
                                                        GetDescOfTargetRange(),
                                                        M_SideEffectParam.GetParam_ConstInt("CardCount"),
                                                        M_SideEffectParam.GetParam_MultipliedInt("CopyCount")));
 }
示例#11
0
        public override bool Execute(ExecutorInfo executorInfo)
        {
            if (!base.Execute(executorInfo))
            {
                return(false);
            }
            BattlePlayer player = (BattlePlayer)Player;
            int          value  = M_SideEffectParam.GetParam_MultipliedInt("Energy");
            int          times  = M_SideEffectParam.GetParam_ConstInt("Times");

            player.GameManager.SideEffect_ShipAction(
                delegate(BattlePlayer sp)
            {
                for (int i = 0; i < times; i++)
                {
                    sp.AddEnergy(value);
                }
            },
                player,
                ChoiceCount,
                TargetRange,
                TargetSelect,
                executorInfo.TargetClientIds);
            return(true);
        }
示例#12
0
        public override string GenerateDesc()
        {
            int times = M_SideEffectParam.GetParam_ConstInt("Times");

            return(base.GenerateDesc() + HighlightStringFormat(DescRaws[LanguageManager_Common.GetCurrentLanguage()],
                                                               GetDescOfTargetRange(),
                                                               M_SideEffectParam.GetParam_MultipliedInt("Energy"),
                                                               times > 1 ? ("*" + M_SideEffectParam.GetParam_ConstInt("Times")) : ""));
        }
示例#13
0
 public override string GenerateDesc()
 {
     return(base.GenerateDesc() + HighlightStringFormat(
                DescRaws[LanguageManager_Common.GetCurrentLanguage()],
                GetDescOfTargetRange(),
                M_SideEffectParam.GetParam_MultipliedInt("CardCount"),
                BaseInfo.CardTypeNameDict[LanguageManager_Common.GetCurrentLanguage()][(CardTypes)M_SideEffectParam.GetParam_ConstInt("DrawCardType")],
                M_SideEffectParam.GetParam_MultipliedInt("CardCount") <= 1 ? "" : "s"));
 }
 protected override void InitSideEffectParam()
 {
     base.InitSideEffectParam();
     M_SideEffectParam.SetParam_ConstInt("BuffPicId", 0);
     M_SideEffectParam.SetParam_String("BuffColor", "#ffffff");
     M_SideEffectParam.SetParam_Bool("HasNumberShow", false);
     M_SideEffectParam.SetParam_Bool("CanPiled", false);
     M_SideEffectParam.SetParam_Bool("Singleton", false);
     M_SideEffectParam.SetParam_ConstInt("PiledBy", (int)BuffPiledBy.RemoveTriggerTimes, typeof(BuffPiledBy));
 }
        public int GetSideEffectFunctionBias()
        {
            CardInfo_Base card = AllCards.GetCard(M_SideEffectParam.GetParam_ConstInt("SummonCardID"));

            if (card != null)
            {
                return(card.GetCardUseBias() * 3);
            }
            else
            {
                return(0);
            }
        }
示例#16
0
        public override string GenerateDesc()
        {
            int cardID = M_SideEffectParam.GetParam_ConstInt("SummonCardID");
            int count  = M_SideEffectParam.GetParam_ConstInt("NumberOfSummon");

            if (!AllCards.CardDict.ContainsKey(cardID))
            {
                return("Error!!!");
            }

            BaseInfo bi = AllCards.GetCard(cardID).BaseInfo;

            return(base.GenerateDesc() + HighlightStringFormat(DescRaws[LanguageManager_Common.GetCurrentLanguage()], bi.CardNames[LanguageManager_Common.GetCurrentLanguage()], count <= 1 ? "" : ("*" + count), GetDescOfTargetRange()));
        }
示例#17
0
        public override bool Execute(ExecutorInfo executorInfo)
        {
            if (!base.Execute(executorInfo))
            {
                return(false);
            }
            BattlePlayer player = (BattlePlayer)Player;
            int          value  = M_SideEffectParam.GetParam_MultipliedInt("Energy");

            player.GameManager.SideEffect_ForeachMech(
                delegate(int validTargetCount) { player.AddEnergy(value * validTargetCount); },
                player,
                TargetRange);
            return(true);
        }
        public override bool Execute(ExecutorInfo executorInfo)
        {
            if (!base.Execute(executorInfo))
            {
                return(false);
            }
            BattlePlayer player      = (BattlePlayer)Player;
            int          energyValue = M_SideEffectParam.GetParam_MultipliedInt("Energy");
            int          finalValue  = energyValue * player.GameManager.CountMechsByTargetRange(TargetRange, player);

            finalValue = Math.Min(finalValue, player.MyEnemyPlayer.EnergyLeft);
            player.AddEnergy(finalValue);
            player.MyEnemyPlayer.UseEnergy(finalValue);
            return(true);
        }
示例#19
0
        public override bool Execute(ExecutorInfo executorInfo)
        {
            if (!base.Execute(executorInfo))
            {
                return(false);
            }
            BattlePlayer player = (BattlePlayer)Player;

            player.MyEnemyPlayer.Damage(M_SideEffectParam.GetParam_MultipliedInt("Value"));
            int plus_damage = player.EnergyLeft;

            player.UseAllEnergy();
            player.MyEnemyPlayer.Damage(plus_damage * M_SideEffectParam.GetParam_MultipliedInt("ValuePlus"));
            return(true);
        }
        public override bool Execute(ExecutorInfo executorInfo)
        {
            if (!base.Execute(executorInfo))
            {
                return(false);
            }
            BattlePlayer sp = (BattlePlayer)Player;
            CardBase     ci = sp.HandManager.GetCardByCardInstanceId(executorInfo.CardInstanceId);

            if (ci.CardInfo.BaseInfo.Energy >= M_SideEffectParam.GetParam_MultipliedInt("DecValue"))
            {
                ci.M_Energy -= M_SideEffectParam.GetParam_MultipliedInt("DecValue");
            }
            return(true);
        }
        public override string GenerateDesc()
        {
            int cardID = M_SideEffectParam.GetParam_ConstInt("SummonCardID");

            if (cardID == (int)AllCards.EmptyCardTypes.NoCard || cardID == (int)AllCards.EmptyCardTypes.EmptyCard)
            {
                return("Error!!!");
            }

            BaseInfo bi = AllCards.GetCard(cardID).BaseInfo;

            return(base.GenerateDesc() + HighlightStringFormat(DescRaws[LanguageManager_Common.GetCurrentLanguage()],
                                                               GetDescOfTargetRange(),
                                                               bi.CardNames[LanguageManager_Common.GetCurrentLanguage()]));
        }
示例#22
0
        public override string GenerateDesc()
        {
            int cardID = M_SideEffectParam.GetParam_ConstInt("CardID");

            if (cardID == (int)AllCards.EmptyCardTypes.NoCard || cardID == (int)AllCards.EmptyCardTypes.EmptyCard)
            {
                return("Error!!!");
            }

            BaseInfo bi = AllCards.GetCard(cardID).BaseInfo;

            return(HighlightStringFormat(
                       DescRaws[LanguageManager_Common.GetCurrentLanguage()],
                       SideEffectExecute.TriggerRangeDesc[LanguageManager_Common.GetCurrentLanguage()][TriggerRange],
                       "[" + bi.CardNames[LanguageManager_Common.GetCurrentLanguage()] + "]"));
        }
示例#23
0
        public override bool Execute(ExecutorInfo executorInfo)
        {
            if (!base.Execute(executorInfo))
            {
                return(false);
            }
            BattlePlayer player = (BattlePlayer)Player;

            player.GameManager.SideEffect_ShipAction(
                delegate(BattlePlayer sp) { sp.CardDeckManager.RandomInsertTempCard(M_SideEffectParam.GetParam_ConstInt("CardID"), M_SideEffectParam.GetParam_MultipliedInt("CardCount")); },
                player,
                ChoiceCount,
                TargetRange,
                TargetSelect,
                executorInfo.TargetClientIds);
            return(true);
        }
示例#24
0
        public override bool Execute(ExecutorInfo executorInfo)
        {
            if (!base.Execute(executorInfo))
            {
                return(false);
            }
            BattlePlayer player = (BattlePlayer)Player;

            if ((TargetRange & TargetRange.Mechs) != 0)
            {
                foreach (int mechId in executorInfo.TargetMechIds)
                {
                    player.GameManager.GetMech(mechId).M_ImmuneLeftRounds += M_SideEffectParam.GetParam_MultipliedInt("Rounds");
                    player.GameManager.GetMech(mechId).M_InactivityRounds += M_SideEffectParam.GetParam_MultipliedInt("Rounds");
                }
            }
            return(true);
        }
示例#25
0
        public override bool Execute(ExecutorInfo executorInfo)
        {
            if (!base.Execute(executorInfo))
            {
                return(false);
            }
            BattlePlayer player = (BattlePlayer)Player;

            CardFilterTypes dropCardType = (CardFilterTypes)M_SideEffectParam.GetParam_ConstInt("DropCardType");
            CardFilterTypes drawCardType = (CardFilterTypes)M_SideEffectParam.GetParam_ConstInt("DrawCardType");

            int dropCardCount = player.HandManager.DropCardType(dropCardType, new HashSet <int> {
                executorInfo.CardInstanceId
            });

            player.HandManager.GetTempCardByCardTypes(drawCardType, dropCardCount);
            return(true);
        }
示例#26
0
        public override bool IsTrigger(ExecutorInfo executorInfo, ExecutorInfo se_ExecutorInfo)
        {
            BattlePlayer player      = (BattlePlayer)Player;
            bool         playerCheck = false;

            switch (TriggerRange)
            {
            case SideEffectExecute.TriggerRange.SelfPlayer:
                if (executorInfo.ClientId == se_ExecutorInfo.ClientId)
                {
                    playerCheck = true;
                }
                break;

            case SideEffectExecute.TriggerRange.EnemyPlayer:
                if (executorInfo.ClientId != se_ExecutorInfo.ClientId)
                {
                    playerCheck = true;
                }
                break;

            case SideEffectExecute.TriggerRange.OnePlayer:
                playerCheck = true;
                break;

            case SideEffectExecute.TriggerRange.One:
                playerCheck = true;
                break;
            }

            int        cardID       = M_SideEffectParam.GetParam_ConstInt("CardID");
            List <int> cardIDSeries = AllCards.GetCardSeries(cardID);

            if (playerCheck && cardIDSeries.Contains(executorInfo.CardId))
            {
                executorInfo.MechId = se_ExecutorInfo.MechId;
                return(true);
            }
            else
            {
                return(false);
            }
        }
        public override bool Execute(ExecutorInfo executorInfo)
        {
            if (!base.Execute(executorInfo))
            {
                return(false);
            }
            BattlePlayer player = (BattlePlayer)Player;
            int          value  = player.GameManager.CountMechsByTargetRange(TargetRange, player);

            for (int i = 0; i < value; i++)
            {
                int summonCardID = M_SideEffectParam.GetParam_ConstInt("SummonCardID");
                if (summonCardID != (int)AllCards.EmptyCardTypes.NoCard)
                {
                    player.BattleGroundManager.AddMech((CardInfo_Mech)AllCards.GetCard(M_SideEffectParam.GetParam_ConstInt("SummonCardID")));
                }
            }
            return(true);
        }
        public override bool Execute(ExecutorInfo executorInfo)
        {
            if (!base.Execute(executorInfo))
            {
                return(false);
            }
            BattlePlayer player = (BattlePlayer)Player;
            ModuleMech   mech   = player.BattleGroundManager.GetMech(executorInfo.MechId);

            if (mech != null)
            {
                int attackTimes = M_SideEffectParam.GetParam_MultipliedInt("AttackTimes");

                if (!mech.IsSentry)
                {
                    mech.AttackTimesThisRound += attackTimes;
                }
            }
            return(true);
        }
示例#29
0
        public override bool Execute(ExecutorInfo executorInfo)
        {
            if (!base.Execute(executorInfo))
            {
                return(false);
            }
            BattlePlayer player = (BattlePlayer)Player;
            int          energy = M_SideEffectParam.GetParam_MultipliedInt("Energy");

            if (player.EnergyLeft >= energy)
            {
                player.UseEnergy(energy);
                foreach (int mechID in executorInfo.TargetMechIds)
                {
                    int damage = M_SideEffectParam.GetParam_MultipliedInt("Damage");
                    player.GameManager.GetMech(executorInfo.MechId).OnMakeDamage(damage);
                    player.GameManager.GetMech(mechID).Damage(damage);
                }
            }
            return(true);
        }
示例#30
0
        public override bool Execute(ExecutorInfo executorInfo)
        {
            if (!base.Execute(executorInfo))
            {
                return(false);
            }
            BattlePlayer player = (BattlePlayer)Player;
            int          value  = M_SideEffectParam.GetParam_MultipliedInt("Energy");

            if (TargetRange == TargetRange.Self)
            {
                ModuleMech mech = player.BattleGroundManager.GetMech(executorInfo.MechId);
                if (mech?.M_Weapon != null)
                {
                    int increase = Math.Min(mech.M_MechWeaponEnergyMax - mech.M_MechWeaponEnergy, value);
                    mech.M_MechWeaponEnergy += increase;
                }
            }
            else
            {
                player.GameManager.SideEffect_MechAction(
                    delegate(ModuleMech mech)
                {
                    if (mech?.M_Weapon != null)
                    {
                        int increase             = Math.Min(mech.M_MechWeaponEnergyMax - mech.M_MechWeaponEnergy, value);
                        mech.M_MechWeaponEnergy += increase;
                    }
                },
                    player,
                    ChoiceCount,
                    executorInfo.TargetMechIds,
                    TargetRange,
                    TargetSelect,
                    -1);
            }
            return(true);
        }