Merge branch 'china/dev' of http://60.1.1.230/gaoxin/JL_Client into china/dev
commit
b88bfef04f
|
@ -1873,7 +1873,8 @@ FormationTypeDef = {
|
||||||
FourElement_MAGIC = 3003,
|
FourElement_MAGIC = 3003,
|
||||||
FourElement_TAOIST = 3004,
|
FourElement_TAOIST = 3004,
|
||||||
|
|
||||||
FORMATION_TEMPORARY = 10000, --临时编队
|
FORMATION_TEMPORARY = 10000, --临时编队, 编队用
|
||||||
|
FORMATION_TEMPORARY_PROP = 10001, -- 临时编队, 属性计算用
|
||||||
}
|
}
|
||||||
|
|
||||||
--编队需要拉取主线
|
--编队需要拉取主线
|
||||||
|
|
|
@ -118,9 +118,13 @@ function this.UpdateFormation(msg)
|
||||||
this.CheckGuildFightDefendFormation()
|
this.CheckGuildFightDefendFormation()
|
||||||
end
|
end
|
||||||
--刷新临时编队数据
|
--刷新临时编队数据
|
||||||
function this.UpdateTemporaryFormation(TeamPosInfo)
|
function this.UpdateTemporaryFormation(teamId, TeamPosInfo)
|
||||||
|
if teamId < FormationTypeDef.FORMATION_TEMPORARY then
|
||||||
|
LogError("临时编队ID错误")
|
||||||
|
return
|
||||||
|
end
|
||||||
local curFormation = {}
|
local curFormation = {}
|
||||||
curFormation.teamId = FormationTypeDef.FORMATION_TEMPORARY
|
curFormation.teamId = teamId
|
||||||
curFormation.teamName = "临时"
|
curFormation.teamName = "临时"
|
||||||
curFormation.teamHeroInfos = {}
|
curFormation.teamHeroInfos = {}
|
||||||
curFormation.teamPokemonInfos = {}
|
curFormation.teamPokemonInfos = {}
|
||||||
|
@ -129,9 +133,9 @@ function this.UpdateTemporaryFormation(TeamPosInfo)
|
||||||
table.insert(curFormation.teamHeroInfos, TeamPosInfo[j])
|
table.insert(curFormation.teamHeroInfos, TeamPosInfo[j])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
this.formationList[FormationTypeDef.FORMATION_TEMPORARY] = curFormation
|
this.formationList[teamId] = curFormation
|
||||||
-- 设置临时编队为脏数据
|
-- 设置临时编队为脏数据
|
||||||
HeroPropManager.SetFormationPropDirty(FormationTypeDef.FORMATION_TEMPORARY)
|
HeroPropManager.SetFormationPropDirty(teamId)
|
||||||
end
|
end
|
||||||
-- function this.SetCurFormationIndex()
|
-- function this.SetCurFormationIndex()
|
||||||
-- local curIndex = 1
|
-- local curIndex = 1
|
||||||
|
|
|
@ -362,7 +362,7 @@ function this.SetCardsData()
|
||||||
end
|
end
|
||||||
|
|
||||||
LogGreen("刷新编队·············· ")
|
LogGreen("刷新编队·············· ")
|
||||||
FormationManager.UpdateTemporaryFormation(this.choosedList)
|
FormationManager.UpdateTemporaryFormation(FormationTypeDef.FORMATION_TEMPORARY, this.choosedList)
|
||||||
this.formationPower = 0--战力
|
this.formationPower = 0--战力
|
||||||
this.formationPowerOld = 0--战力
|
this.formationPowerOld = 0--战力
|
||||||
--元素共鸣
|
--元素共鸣
|
||||||
|
|
|
@ -269,20 +269,24 @@ function this.GetHeroProp(dId, formationId, NoFuncProp)
|
||||||
-- Log_Prop("减益属性")
|
-- Log_Prop("减益属性")
|
||||||
-- this.CountDeProp(dId, allPropList)
|
-- this.CountDeProp(dId, allPropList)
|
||||||
|
|
||||||
|
local isTempHero = HeroTempPropManager.IsTempHeroID(dId)
|
||||||
-- 判断是否需要加入团队属性加成
|
-- 判断是否需要加入团队属性加成
|
||||||
if formationId and FormationManager.CheckFormationHasId(formationId, dId) then
|
if formationId and (FormationManager.CheckFormationHasId(formationId, dId) or isTempHero) then
|
||||||
local formationList = FormationManager.GetFormationByID(formationId)
|
local formationList = FormationManager.GetFormationByID(formationId)
|
||||||
table.walk(formationList.teamHeroInfos, function(teamInfo)
|
table.walk(formationList.teamHeroInfos, function(teamInfo)
|
||||||
|
local heroId = teamInfo.heroId
|
||||||
|
if isTempHero and teamInfo.tempHeroId then
|
||||||
|
heroId = teamInfo.tempHeroId
|
||||||
|
end
|
||||||
-- 团队属性加成
|
-- 团队属性加成
|
||||||
if teamInfo.heroId then
|
if heroId then
|
||||||
Log_Prop("团队属性")
|
Log_Prop("团队属性")
|
||||||
local teamProp = this.GetTeamData(teamInfo.heroId)
|
local teamProp = this.GetTeamData(heroId)
|
||||||
LogGreenTable_Prop(teamProp)
|
LogGreenTable_Prop(teamProp)
|
||||||
DoubleTableCompound(allPropList, teamProp)
|
DoubleTableCompound(allPropList, teamProp)
|
||||||
-- 团队条件属性加成
|
-- 团队条件属性加成
|
||||||
Log_Prop("团队条件属性")
|
Log_Prop("团队条件属性")
|
||||||
local conTeamProp = this.GetConditionTeamData(teamInfo.heroId, dId)
|
local conTeamProp = this.GetConditionTeamData(heroId, dId)
|
||||||
LogGreenTable_Prop(conTeamProp)
|
LogGreenTable_Prop(conTeamProp)
|
||||||
DoubleTableCompound(allPropList, conTeamProp)
|
DoubleTableCompound(allPropList, conTeamProp)
|
||||||
end
|
end
|
||||||
|
|
|
@ -15,6 +15,13 @@ function this.IsTempHeroID(tempId)
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
-- 根据临时ID获取did
|
||||||
|
function this.GetDynamicIdByTempId(tempId)
|
||||||
|
if this.IsTempHeroID(tempId) then
|
||||||
|
return string.gsub(tempId, "TEMP_", "")
|
||||||
|
end
|
||||||
|
return tempId
|
||||||
|
end
|
||||||
-- 复制一个神将数据,不影响原数据
|
-- 复制一个神将数据,不影响原数据
|
||||||
function this.CreateTempHero(dId)
|
function this.CreateTempHero(dId)
|
||||||
if this.IsTempHeroID(dId) then
|
if this.IsTempHeroID(dId) then
|
||||||
|
@ -48,15 +55,44 @@ function this.ClearTempHero(tempId)
|
||||||
HeroPropManager.ClearHeroData(tempId)
|
HeroPropManager.ClearHeroData(tempId)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- 更新用于计算临时属性的编队
|
||||||
|
function this.UpdateTempFormation(tempId, formationId)
|
||||||
|
local dId = this.GetDynamicIdByTempId(tempId)
|
||||||
|
local teamInfo = FormationManager.GetFormationByID(formationId)
|
||||||
|
local heroList = {}
|
||||||
|
if teamInfo and teamInfo.teamHeroInfos and #teamInfo.teamHeroInfos > 0 then
|
||||||
|
for _, hero in ipairs(teamInfo.teamHeroInfos) do
|
||||||
|
local h = {}
|
||||||
|
h.heroId = hero.heroId
|
||||||
|
h.position = hero.position
|
||||||
|
-- 将对应的人替换成临时数据
|
||||||
|
if h.heroId == dId then
|
||||||
|
h.tempHeroId = tempId
|
||||||
|
end
|
||||||
|
table.insert(heroList, h)
|
||||||
|
end
|
||||||
|
-- 刷新用于计算临时属性的编队
|
||||||
|
FormationManager.UpdateTemporaryFormation(FormationTypeDef.FORMATION_TEMPORARY_PROP, heroList)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- 获取临时英雄属性
|
-- 获取临时英雄属性
|
||||||
function this.GetTempHeroProp(tempId, formationId)
|
function this.GetTempHeroProp(tempId, formationId)
|
||||||
if this.IsTempHeroExist(tempId) then
|
if this.IsTempHeroExist(tempId) then
|
||||||
|
if formationId then
|
||||||
|
this.UpdateTempFormation(tempId, formationId)
|
||||||
|
formationId = FormationTypeDef.FORMATION_TEMPORARY_PROP
|
||||||
|
end
|
||||||
return HeroPropManager.GetHeroProp(tempId, formationId)
|
return HeroPropManager.GetHeroProp(tempId, formationId)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- 获取临时英雄属性
|
-- 获取临时英雄属性
|
||||||
function this.GetTempHeroPower(tempId, formationId)
|
function this.GetTempHeroPower(tempId, formationId)
|
||||||
if this.IsTempHeroExist(tempId) then
|
if this.IsTempHeroExist(tempId) then
|
||||||
|
if formationId then
|
||||||
|
this.UpdateTempFormation(tempId, formationId)
|
||||||
|
formationId = FormationTypeDef.FORMATION_TEMPORARY_PROP
|
||||||
|
end
|
||||||
return HeroPowerManager.GetHeroPower(tempId, formationId)
|
return HeroPowerManager.GetHeroPower(tempId, formationId)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -299,7 +299,12 @@ function RoleUpStarLayout:UpdateHeroUpStarProUpShow()
|
||||||
local tempDId, tempData = HeroTempPropManager.CreateTempHero(curHeroData.dynamicId)
|
local tempDId, tempData = HeroTempPropManager.CreateTempHero(curHeroData.dynamicId)
|
||||||
tempData.upStarId = upStarRankUpConfig.Id
|
tempData.upStarId = upStarRankUpConfig.Id
|
||||||
tempData.breakId = curHeroData.breakId
|
tempData.breakId = curHeroData.breakId
|
||||||
local nextallAddProVal = HeroTempPropManager.GetTempHeroProp(tempDId)
|
local nextallAddProVal = {}
|
||||||
|
if isUpZhen then
|
||||||
|
nextallAddProVal = HeroTempPropManager.GetTempHeroProp(tempDId, FormationTypeDef.FORMATION_NORMAL)
|
||||||
|
else
|
||||||
|
nextallAddProVal = HeroTempPropManager.GetTempHeroProp(tempDId)
|
||||||
|
end
|
||||||
HeroTempPropManager.ClearTempHero(tempDId)-- 清理
|
HeroTempPropManager.ClearTempHero(tempDId)-- 清理
|
||||||
|
|
||||||
this:ProShow(this.atkPro_UpStar,allAddProVal,HeroProType.Attack,nextallAddProVal)
|
this:ProShow(this.atkPro_UpStar,allAddProVal,HeroProType.Attack,nextallAddProVal)
|
||||||
|
|
Loading…
Reference in New Issue