【战斗】假战斗加入对MonsterGroup配置的灵兽数据的处理
parent
1615d0c2d2
commit
db20230131
|
|
@ -548,6 +548,63 @@ function this.GetBattlePlayerData(fId)
|
|||
return playerData
|
||||
end
|
||||
|
||||
|
||||
function this.GetMonsterPros(id, lv, star)
|
||||
local proList = PokemonManager.GetSinglePokemonAddProDataByLvAndStar(id, lv, star)
|
||||
local allProVal = {}
|
||||
table.insert(allProVal, 1, lv) --等级
|
||||
table.insert(allProVal, 2, proList[HeroProType.Hp]) --生命
|
||||
table.insert(allProVal, 3, proList[HeroProType.Hp]) --最大生命
|
||||
table.insert(allProVal, 4, proList[HeroProType.Attack]) --攻击力
|
||||
table.insert(allProVal, 5, proList[HeroProType.PhysicalDefence]) --护甲
|
||||
table.insert(allProVal, 6, proList[HeroProType.MagicDefence]) --魔抗
|
||||
table.insert(allProVal, 7, proList[HeroProType.Speed]) --速度
|
||||
table.insert(allProVal, 8, proList[HeroProType.DamageBocusFactor]) --伤害加成系数(%)
|
||||
table.insert(allProVal, 9, proList[HeroProType.DamageReduceFactor]) --伤害减免系数(%)
|
||||
table.insert(allProVal, 10, proList[HeroProType.Hit]) --命中率(%)
|
||||
table.insert(allProVal, 11, proList[HeroProType.Dodge]) --闪避率(%)
|
||||
table.insert(allProVal, 12, proList[HeroProType.CritFactor]) --暴击率(%)
|
||||
table.insert(allProVal, 13, proList[HeroProType.CritDamageFactor]) --暴击伤害系数(%)
|
||||
table.insert(allProVal, 14, proList[HeroProType.AntiCritDamageFactor]) --抗暴率(%)
|
||||
table.insert(allProVal, 15, proList[HeroProType.TreatFacter]) --治疗加成系数(%)
|
||||
table.insert(allProVal, 16, proList[HeroProType.CureFacter]) --受到治疗系数(%)
|
||||
table.insert(allProVal, 17, 0) --异妖伤害加成系数(%)
|
||||
table.insert(allProVal, 18, 0) --异妖减伤率(%)
|
||||
table.insert(allProVal, 19, 0) --火系伤害减免系数(%)
|
||||
table.insert(allProVal, 20, 0) --风系伤害减免系数(%)
|
||||
table.insert(allProVal, 21, 0) --冰系伤害减免系数(%)
|
||||
table.insert(allProVal, 22, 0) --地系伤害减免系数(%)
|
||||
table.insert(allProVal, 23, 0) --光系伤害减免系数(%)
|
||||
table.insert(allProVal, 24, 0) --暗系伤害减免系数(%)
|
||||
table.insert(allProVal, 25, 0)
|
||||
local pros = table.concat(allProVal, "#")
|
||||
return pros
|
||||
end
|
||||
|
||||
-- 从monsterGroup中获取灵兽数据
|
||||
function this.GetMonsterDataFromGroup(gId, camp)
|
||||
local list = {}
|
||||
local Monsters = MonsterGroup[gId].Animal
|
||||
for i = 1, #Monsters do
|
||||
local monster = Monsters[i]
|
||||
local id = monster[1]
|
||||
local star = monster[2]
|
||||
local level = monster[3]
|
||||
|
||||
local mUnit = {
|
||||
unitId = id,
|
||||
position = i,
|
||||
star = star
|
||||
}
|
||||
local pros = this.GetMonsterPros(id, level, star)
|
||||
mUnit.propertys = pros
|
||||
local mSkill = ConfigManager.GetConfigDataByDoubleKey(ConfigName.SpiritAnimalSkill, "SpiritAnimalMatch", id, "StarMatch", star)
|
||||
mUnit.unitSkillIds = mSkill.Id
|
||||
list[i] = this.PokemonUnitAdapter(mUnit, camp)
|
||||
end
|
||||
return list
|
||||
end
|
||||
|
||||
-- 根据怪物组数据
|
||||
function this.GetBattleEnemyData(gId)
|
||||
-- body
|
||||
|
|
@ -563,7 +620,10 @@ function this.GetBattleEnemyData(gId)
|
|||
end
|
||||
end
|
||||
enemyData[i] = enemyList
|
||||
-- 构建灵兽数据
|
||||
enemyData[i].monsterList = this.GetMonsterDataFromGroup(gId, 1)
|
||||
end
|
||||
|
||||
return enemyData
|
||||
end
|
||||
|
||||
|
|
@ -580,6 +640,8 @@ function this.GetPlayerDataFromMonsterGroup(gId)
|
|||
end
|
||||
end
|
||||
end
|
||||
-- 构建灵兽数据
|
||||
playerData.monsterList = this.GetMonsterDataFromGroup(gId, 0)
|
||||
return playerData
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue