Exemplo n.º 1
0
        public static IGeneral Create(SJTPlotEmbattleInfo embattle)
        {
            var monster = new ConfigCacheSet<SJTMonsterInfo>().FindKey(embattle.MonsterID);
            if (monster == null) throw new Exception("Plot monster:" + embattle.MonsterID + " is not exist");

            CareerInfo career = new ConfigCacheSet<CareerInfo>().FindKey(monster.CareerID);
            AbilityInfo ability = new ConfigCacheSet<AbilityInfo>().FindKey(monster.AbilityID);
            var abilityLv = new ConfigCacheSet<AbilityLvInfo>().FindKey(monster.AbilityLv);

            if (career == null || ability == null || abilityLv == null)
            {
                throw new Exception("career or ability or AbilityLv is null.");
            }

            CombatGeneral general = new CombatGeneral()
            {
                UserID = null,
                Position = embattle.GridSeqNo,
                GeneralID = embattle.MonsterID,
                GeneralName = monster.GeneralName,
                HeadID = monster.HeadID,
                CareerID = monster.CareerID,
                CareerType = career.CareerType,
                IsMove = career.IsMove,
                LifeNum = monster.LifeNum,
                LifeMaxNum = monster.LifeNum,
                Lv = monster.GeneralLv,
                Momentum = (short)monster.MomentumNum,
                Ability = ability,
                IsAttrMove = ability.IsMove,
                BaojiNum = monster.BaojiNum,
                BishaNum = monster.BishaNum,
                RenxingNum = monster.RenxingNum,
                HitNum =
                    monster.HitNum == 0
                        ? ConfigEnvSet.GetDecimal("Combat.HitiNum")
                        : monster.HitNum,
                ShanbiNum = monster.ShanbiNum,
                GedangNum = monster.GedangNum,
                PojiNum = monster.PojiNum,
                BattleStatus = BattleStatus.Normal,
                PowerNum = monster.PowerNum,
                SoulNum = monster.SoulNum,
                IntellectNum = monster.IntellectNum,
                FixedDamageNum = 0,
                //怪物没有附加属性
                ExtraAttack = new CombatProperty(),
                ExtraDefense = new CombatProperty(),
                IsMonster = true,
                IsWait = false,
                PhyAttackNum = monster.PhyAttackNum,
                PhyDefenseNum = monster.PhyDefenseNum,
                MagAttackNum = monster.MagAttackNum,
                MagDefenseNum = monster.MagDefenseNum,
                AbiAttackNum = monster.AbiAttackNum,
                AbiDefenseNum = monster.AbiDefenseNum

            };
            general.PhyAttackNum = MathUtils.Addition(general.PhyAttackNum,
                                                      (general.PhyAttackNum*abilityLv.EffectValue)).ToInt();
            general.PhyDefenseNum = MathUtils.Addition(general.PhyDefenseNum,
                                                      (general.PhyDefenseNum * abilityLv.EffectValue)).ToInt();
            general.MagAttackNum = MathUtils.Addition(general.MagAttackNum,
                                                      (general.MagAttackNum * abilityLv.EffectValue)).ToInt();
            general.MagDefenseNum = MathUtils.Addition(general.MagDefenseNum,
                                                      (general.MagDefenseNum * abilityLv.EffectValue)).ToInt();
            general.AbiAttackNum = MathUtils.Addition(general.AbiAttackNum,
                                                      (general.AbiAttackNum * abilityLv.EffectValue)).ToInt();
            general.AbiDefenseNum = MathUtils.Addition(general.AbiDefenseNum,
                                                      (general.AbiDefenseNum * abilityLv.EffectValue)).ToInt();
            return general;
        }
Exemplo n.º 2
0
        public static IGeneral Create(SJTPlotEmbattleInfo embattle, double difficultNum)
        {

            SJTMonsterInfo monster = new ShareCacheStruct<SJTMonsterInfo>().FindKey(embattle.MonsterID);
            if (monster == null) throw new Exception("Plot monster:" + embattle.MonsterID + " is not exist");

            CareerInfo career = new ShareCacheStruct<CareerInfo>().FindKey(monster.CareerID);
            AbilityInfo ability = new ShareCacheStruct<AbilityInfo>().FindKey(monster.AbilityID);
            if (career == null || ability == null)
            {
                throw new Exception("career or ability is null.");
            }
            CombatGeneral general = new CombatGeneral()
            {
                UserID = null,
                Position = embattle.GridSeqNo,
                GeneralID = embattle.MonsterID,
                GeneralName = monster.GeneralName,
                HeadID = monster.HeadID,
                CareerID = monster.CareerID,
                CareerType = career.CareerType,
                IsMove = career.IsMove,
                LifeNum = monster.LifeNum,
                LifeMaxNum = monster.LifeNum,
                Lv = monster.GeneralLv,
                Momentum = (short)monster.MomentumNum,
                Ability = ability,
                IsAttrMove = ability.IsMove,
                BaojiNum = monster.BaojiNum,
                BishaNum = monster.BishaNum,
                RenxingNum = monster.RenxingNum,
                HitNum =
                    monster.HitNum == 0
                        ? ConfigEnvSet.GetDecimal("Combat.HitiNum")
                        : monster.HitNum,
                ShanbiNum = monster.ShanbiNum,
                GedangNum = monster.GedangNum,
                PojiNum = monster.PojiNum,
                BattleStatus = BattleStatus.Normal,
                PowerNum = monster.PowerNum,
                SoulNum = monster.SoulNum,
                IntellectNum = monster.IntellectNum,
                //todo 圣吉塔怪物表未配置固定伤害值
                FixedDamageNum = 1, //monster.DamageNum,
                //怪物没有附加属性
                ExtraAttack = new CombatProperty(),
                ExtraDefense = new CombatProperty(),
                IsMonster = true,
                IsWait = false,
                PhyAttackNum = (monster.PhyAttackNum * difficultNum).ToInt(),
                PhyDefenseNum = (monster.PhyDefenseNum * difficultNum).ToInt(),
                MagAttackNum = (monster.MagAttackNum * difficultNum).ToInt(),
                MagDefenseNum = (monster.MagDefenseNum * difficultNum).ToInt(),
                AbiAttackNum = (monster.AbiAttackNum * difficultNum).ToInt(),
                AbiDefenseNum = (monster.AbiDefenseNum * difficultNum).ToInt()

            };
            return general;
        }