Exemple #1
0
 /// <summary>
 // 森严/凝固/凝霜/附骨(被动)
 // 添加(混乱/石化/冰冻/附骨)
 /// </summary>
 /// <param name="r"></param>
 /// <param name="target"></param>
 /// <param name="level"></param>
 /// <param name="gc"></param>
 /// <returns></returns>
 private bool TryAddBuffer(ActionResult r, FightObject target, int level, GameConfig gc)
 {
     Variant levelConfig = gc.Value.GetVariantOrDefault(level.ToString());
     if (levelConfig == null) return false;
     //根据概率计算出是否产生附加Buffer
     if (RandomHit(levelConfig.GetDoubleOrDefault("C")))
     {
         int senderSkillType = gc.Value.GetIntOrDefault("SkillType");
         bool pass = CheckSkillType(senderSkillType);
         if (pass)
         {
             string newbuffer = gc.Value.GetStringOrDefault("BufferID");
             GameConfig buffConfig = GameConfigAccess.Instance.FindOneById(newbuffer);
             //Round:int  Buffer可持续回合数
             int round = levelConfig.GetIntOrDefault("Round");
             //A:double  生成的Buffer的值
             double v = levelConfig.GetDoubleOrDefault("A");
             //每1点精神会增加的伤害(附骨)
             double b = levelConfig.GetDoubleOrDefault("B");
             if (b > 0)
             {
                 v += (b * m_a.Life.JingShen);
             }
             SkillBuffer bf = new SkillBuffer(buffConfig.Name, m_a.ID, level, round, gc.Value, v);
             if (target.AddBuffer(bf))
             {
                 r.Value["AddBuffer"] = bf;
             }
             return true;
         }
     }
     return false;
 }
Exemple #2
0
        /// <summary>
        /// 增加攻击次数(蓄力)
        /// </summary>
        /// <param name="fighter"></param>
        /// <param name="level"></param>
        /// <param name="gc"></param>
        private bool SkillXuli(FightObject fighter, int level, GameConfig gc)
        {
            var config = gc.Value.GetVariantOrDefault(level.ToString());
            if (config == null) return false;
            int r = config.GetIntOrDefault("Round");

            SkillBuffer buf = new SkillBuffer(gc.Name, fighter.ID, level, r + 1, gc.Value);
            fighter.AddBuffer(buf);
            fighter.Action.Value = new Variant();

            ActionResult result = new ActionResult(fighter.ID);
            result.ActionFlag |= ActionFlag.AddBuff;
            result.Value["AddBuffer"] = buf;

            fighter.Action.Result = new List<ActionResult>() { result };
            fighter.Action.FightCount = FightAction.HasAction;
            m_actions.Add(fighter.Action);
            return true;
        }
Exemple #3
0
        /// <summary>
        /// 开刃/沼气/焚烧 (主动)
        /// 添加(流血/中毒/灼烧)
        /// </summary>
        /// <param name="r"></param>
        /// <param name="target"></param>
        /// <param name="level"></param>
        /// <param name="buffer"></param>
        /// <returns></returns>
        private bool TryAddBuffer(ActionResult r, FightObject target, int level, SkillBuffer buffer)
        {
            Variant levelConfig = buffer.LevelConfig;
            if (levelConfig == null) return false;
            //根据概率计算出是否产生附加Buffer
            if (RandomHit(levelConfig.GetDoubleOrDefault("C")))
            {
                int senderSkillType = buffer.Config.GetIntOrDefault("SkillType");
                bool pass = CheckSkillType(senderSkillType);
                if (pass)
                {
                    //Round:int  Buffer可持续回合数
                    int round = levelConfig.GetIntOrDefault("Round");
                    //A:double  生成的Buffer的值
                    double v = levelConfig.GetDoubleOrDefault("A");
                    if (buffer.ID == BufferType.KaiRen)
                    {
                        IncreaseBuffer(BufferType.DaMo, ref round, ref v);
                    }
                    else if (buffer.ID == BufferType.ZhaoQi)
                    {
                        IncreaseBuffer(BufferType.DiMai, ref round, ref v);
                    }
                    else if (buffer.ID == BufferType.FenShao)
                    {
                        IncreaseBuffer(BufferType.XuanJi, ref round, ref v);
                    }

                    string newID = buffer.Config.GetStringOrDefault("BufferID");
                    GameConfig buffConfig = GameConfigAccess.Instance.FindOneById(newID);
                    SkillBuffer newBuff = new SkillBuffer(buffConfig.Name, m_a.ID, m_Par.Level, round, buffer.Config, v);
                    if (target.AddBuffer(newBuff))
                    {
                        r.Value["AddBuffer"] = newBuff;
                    }
                    return true;
                }
            }
            return false;
        }