示例#1
0
        /// <summary>
        /// 初始化BOSS数据
        /// </summary>
        /// <returns></returns>
        private static CombatGeneral CreateBossGeneral(UserGuild guild)
        {
            CombatGeneral boss = null;

            if (guild != null)
            {
                GuildBossInfo bossInfo = guild.GuildBossInfo;
                if (bossInfo != null)
                {
                    var plotNpcInfoList = new ConfigCacheSet <PlotNPCInfo>().FindAll(m => m.PlotID == gameActive.BossPlotID);
                    if (plotNpcInfoList.Count > 0)
                    {
                        var embattleList = new ConfigCacheSet <PlotEmbattleInfo>().FindAll(m => m.PlotNpcID == plotNpcInfoList[0].PlotNpcID);
                        if (embattleList.Count > 0)
                        {
                            boss    = (CombatGeneral)MonsterQueue.Create(embattleList[0]);
                            boss.Lv = (short)MathUtils.Subtraction(bossInfo.BossLv, 0, gameActive.BossDefLv);
                            int bossLiftNum = MonsterQueue.BossProperty(embattleList[0].PlotNpcID, AbilityType.ShengMing).ToInt();
                            int lifeNum     = boss.LifeNum + (boss.Lv - gameActive.BossDefLv) * bossLiftNum; //ConfigEnvSet.GetInt("BossCombat.IncreaseLiveNum");
                            boss.LifeMaxNum = lifeNum;
                            boss.LifeNum    = lifeNum;
                        }
                    }
                    else
                    {
                        throw new Exception(string.Format("公会战未配置BOSS:{0}", gameActive.BossPlotID));
                    }
                }
            }
            if (boss == null)
            {
                throw new Exception("Loading guid boss faild.");
            }
            return(boss);
        }
示例#2
0
        /// <summary>
        /// 初始化BOSS数据
        /// </summary>
        /// <param name="active"></param>
        /// <returns></returns>
        private static CombatGeneral CreateBossGeneral(GameActive active)
        {
            CombatGeneral boss = null;

            if (active != null)
            {
                var plotNpcInfoList = new ConfigCacheSet <PlotNPCInfo>().FindAll(m => m.PlotID == active.BossPlotID);
                if (plotNpcInfoList.Count > 0)
                {
                    var embattleList = new ConfigCacheSet <PlotEmbattleInfo>().FindAll(m => m.PlotNpcID == plotNpcInfoList[0].PlotNpcID);
                    if (embattleList.Count > 0)
                    {
                        int npcId = plotNpcInfoList[0].PlotNpcID;
                        boss    = (CombatGeneral)MonsterQueue.Create(embattleList[0]);
                        boss.Lv = (short)MathUtils.Subtraction(active.BossLv, 0, active.BossDefLv);
                        int bossLiftNum = MonsterQueue.BossProperty(embattleList[0].PlotNpcID, AbilityType.ShengMing).ToInt();
                        int lv          = (boss.Lv - active.BossDefLv);
                        int lifeNum     = boss.LifeNum + lv * bossLiftNum; //ConfigEnvSet.GetInt("BossCombat.IncreaseLiveNum");
                        boss.LifeMaxNum = lifeNum;
                        boss.LifeNum    = lifeNum;
                        if (lv > 0)
                        {
                            boss.PowerNum      = MathUtils.Addition((lv * MonsterQueue.BossProperty(npcId, AbilityType.PowerNum)).ToInt(), boss.PowerNum).ToInt();
                            boss.SoulNum       = MathUtils.Addition((lv * MonsterQueue.BossProperty(npcId, AbilityType.SoulNum).ToInt()), boss.SoulNum).ToInt();
                            boss.IntellectNum  = MathUtils.Addition((lv * MonsterQueue.BossProperty(npcId, AbilityType.IntelligenceNum).ToInt()), boss.IntellectNum).ToInt();
                            boss.PhyAttackNum  = MathUtils.Addition((lv * MonsterQueue.BossProperty(npcId, AbilityType.WuLiGongJi).ToInt()), boss.PhyAttackNum);
                            boss.AbiAttackNum  = MathUtils.Addition((lv * MonsterQueue.BossProperty(npcId, AbilityType.HunJiGongJi).ToInt()), boss.AbiAttackNum);
                            boss.MagAttackNum  = MathUtils.Addition((lv * MonsterQueue.BossProperty(npcId, AbilityType.MoFaGongJi).ToInt()), boss.MagAttackNum);
                            boss.PhyDefenseNum = MathUtils.Addition((lv * MonsterQueue.BossProperty(npcId, AbilityType.WuLiFangYu).ToInt()), boss.PhyDefenseNum);
                            boss.AbiDefenseNum = MathUtils.Addition((lv * MonsterQueue.BossProperty(npcId, AbilityType.HunJiFangYu).ToInt()), boss.AbiDefenseNum);
                            boss.MagDefenseNum = MathUtils.Addition((lv * MonsterQueue.BossProperty(npcId, AbilityType.MoFaFangYu).ToInt()), boss.MagDefenseNum);
                        }
                        TraceLog.WriteComplement("世界BOSS属性值---血量:{0}、上限血量:{1}、力量:{2}、魂力:{3}、智力:{4}、物理攻击:{5}、魂技攻击:{6}、魔法攻击:{7}、物理防御:{8}、魂技防御:{9}、魔法防御:{10}", boss.LifeNum, boss.LifeMaxNum, boss.PowerNum, boss.SoulNum, boss.IntellectNum, (boss.ExtraAttack.WuliNum + boss.PhyAttackNum), (boss.ExtraAttack.HunjiNum + boss.AbiAttackNum), (boss.ExtraAttack.MofaNum + boss.MagAttackNum), (boss.ExtraDefense.WuliNum + boss.PhyDefenseNum), (boss.ExtraDefense.HunjiNum + boss.AbiDefenseNum), (boss.ExtraDefense.MofaNum + boss.MagDefenseNum));
                    }
                }
                else
                {
                    throw new Exception(string.Format("公会战未配置BOSS:{0}", active.BossPlotID));
                }
            }
            if (boss == null)
            {
                throw new Exception("Loading boss faild.");
            }
            return(boss);
        }