【四象心法】bug修改
parent
e91140175f
commit
38947760c1
|
@ -1717,6 +1717,7 @@ HELP_TYPE = {
|
||||||
ShanHeShiLian = 96,--山河试炼
|
ShanHeShiLian = 96,--山河试炼
|
||||||
XunBaoMiZong = 103,--寻宝迷踪
|
XunBaoMiZong = 103,--寻宝迷踪
|
||||||
AgeTip = 104,--适龄提示
|
AgeTip = 104,--适龄提示
|
||||||
|
FourQuadrant=108,--四象心法
|
||||||
}
|
}
|
||||||
|
|
||||||
NumToComplexFont = {
|
NumToComplexFont = {
|
||||||
|
|
|
@ -9,6 +9,7 @@ local ProfessionType = {
|
||||||
[3] = 3,--控制
|
[3] = 3,--控制
|
||||||
[4] = 4,--辅助
|
[4] = 4,--辅助
|
||||||
}
|
}
|
||||||
|
|
||||||
--职业id对应职业名称
|
--职业id对应职业名称
|
||||||
local ProfessionName={
|
local ProfessionName={
|
||||||
[1] = "肉盾",
|
[1] = "肉盾",
|
||||||
|
@ -17,6 +18,12 @@ local ProfessionName={
|
||||||
[4] = "辅助",
|
[4] = "辅助",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local propertyType = {
|
||||||
|
[1] = 2,--攻击
|
||||||
|
[2] = 1,--生命
|
||||||
|
[3] = 3,--护甲
|
||||||
|
[4] = 4,--魔抗
|
||||||
|
}
|
||||||
--属性id对应属性名称
|
--属性id对应属性名称
|
||||||
local PropertyName={
|
local PropertyName={
|
||||||
[1] = "生命",
|
[1] = "生命",
|
||||||
|
@ -101,21 +108,22 @@ function this.SetPropAdd(_propAddObj,_gongmingLv,isNext)
|
||||||
local curFourQuadConfig = ConfigManager.GetConfigDataByKey(ConfigName.FourQuadrantConfig,"Star",_gongmingLv)
|
local curFourQuadConfig = ConfigManager.GetConfigDataByKey(ConfigName.FourQuadrantConfig,"Star",_gongmingLv)
|
||||||
if curFourQuadConfig then
|
if curFourQuadConfig then
|
||||||
_propAddObj.transform.parent.gameObject:SetActive(true)
|
_propAddObj.transform.parent.gameObject:SetActive(true)
|
||||||
for i = 1, #PropertyName do
|
for i = 1, #propertyType do
|
||||||
local propertyObj=_propAddObj.transform:GetChild(i-1)
|
local propertyObj=_propAddObj.transform:GetChild(i-1)
|
||||||
|
local propertyId=propertyType[i]
|
||||||
local propertyText=propertyObj:GetComponent("Text")
|
local propertyText=propertyObj:GetComponent("Text")
|
||||||
local propertyIcon= Util.GetGameObject(propertyObj,"Image"):GetComponent("Image")
|
local propertyIcon= Util.GetGameObject(propertyObj,"Image"):GetComponent("Image")
|
||||||
local addNum=0
|
local addNum=0
|
||||||
if curFourQuadConfig.PropResonance then
|
if curFourQuadConfig.PropResonance then
|
||||||
addNum=curFourQuadConfig.PropResonance[i][2]/10000*100
|
addNum=curFourQuadConfig.PropResonance[propertyId][2]/10000*100
|
||||||
end
|
end
|
||||||
if isNext then
|
if isNext then
|
||||||
propertyText.text=string.format("全体神将%s <color=#5AC283>+%s%%</color>",PropertyName[i],addNum)
|
propertyText.text=string.format("全体神将%s <color=#5AC283>+%s%%</color>",PropertyName[propertyId],addNum)
|
||||||
else
|
else
|
||||||
propertyText.text=string.format("全体神将%s +%s%%",PropertyName[i],addNum)
|
propertyText.text=string.format("全体神将%s +%s%%",PropertyName[propertyId],addNum)
|
||||||
end
|
end
|
||||||
|
|
||||||
propertyIcon.sprite= this.spLoader:LoadSprite(PropertyTypeIconDef[i])
|
propertyIcon.sprite= this.spLoader:LoadSprite(PropertyTypeIconDef[propertyId])
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
_propAddObj.transform.parent.gameObject:SetActive(false)
|
_propAddObj.transform.parent.gameObject:SetActive(false)
|
||||||
|
|
|
@ -8,6 +8,13 @@ local ProfessionType = {
|
||||||
[3] = 3,--控制
|
[3] = 3,--控制
|
||||||
[4] = 4,--辅助
|
[4] = 4,--辅助
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local propertyType = {
|
||||||
|
[1] = 2,--攻击
|
||||||
|
[2] = 1,--生命
|
||||||
|
[3] = 3,--护甲
|
||||||
|
[4] = 4,--魔抗
|
||||||
|
}
|
||||||
--职业id对应职业名称
|
--职业id对应职业名称
|
||||||
local ProfessionName={
|
local ProfessionName={
|
||||||
[1] = "肉盾",
|
[1] = "肉盾",
|
||||||
|
@ -112,6 +119,9 @@ function this:BindEvent()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
Util.AddClick(this.upBtn, function()
|
Util.AddClick(this.upBtn, function()
|
||||||
|
if this.CheckIsUpStar() then
|
||||||
|
return
|
||||||
|
end
|
||||||
local costArr=fourQuadConfig.LvupCost
|
local costArr=fourQuadConfig.LvupCost
|
||||||
for i = 1, #costArr do
|
for i = 1, #costArr do
|
||||||
if BagManager.GetTotalItemNum(costArr[i][1])<costArr[i][2]then
|
if BagManager.GetTotalItemNum(costArr[i][1])<costArr[i][2]then
|
||||||
|
@ -138,16 +148,20 @@ function this:BindEvent()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
Util.AddClick(this.helpBtn, function()
|
Util.AddClick(this.helpBtn, function()
|
||||||
UIManager.OpenPanel(UIName.HelpPopup, HELP_TYPE.Practice, self.helpPosition.x,self.helpPosition.y)
|
UIManager.OpenPanel(UIName.HelpPopup, HELP_TYPE.FourQuadrant, self.helpPosition.x,self.helpPosition.y)
|
||||||
LogYellow("点击帮助按钮")
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
Util.AddClick(this.upStarPropBtn, function()
|
Util.AddClick(this.upStarPropBtn, function()
|
||||||
this.upStarPropWin:SetActive(true);
|
this.upStarPropWin:SetActive(true);
|
||||||
for i = 0, this.propWinGrid.transform.childCount-1 do
|
for i = 1, #propertyType do
|
||||||
local _propText= this.propWinGrid.transform:GetChild(i):GetComponent("Text")
|
local objIndex=i-1
|
||||||
local _index=i+1;
|
local propertyId=propertyType[i]
|
||||||
_propText.text=string.format("%s神将%s+%s",ProfessionName[this.professionId],PropertyName[_index],upStarProperty[_index])
|
local _propText= this.propWinGrid.transform:GetChild(objIndex):GetComponent("Text")
|
||||||
|
local addProp=0
|
||||||
|
if upStarProperty[propertyId] then
|
||||||
|
addProp=upStarProperty[propertyId]
|
||||||
|
end
|
||||||
|
_propText.text=string.format("%s神将%s+%s",ProfessionName[this.professionId],PropertyName[propertyId],addProp)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
@ -226,16 +240,10 @@ function this.UpdateData(_professionId)
|
||||||
this.titleText.text="四象心法-"..this.curProfessionName
|
this.titleText.text="四象心法-"..this.curProfessionName
|
||||||
local professionInfo=PracticeManager.FourQuadrantData[_professionId]
|
local professionInfo=PracticeManager.FourQuadrantData[_professionId]
|
||||||
this.professionLv=professionInfo and professionInfo.level or 0
|
this.professionLv=professionInfo and professionInfo.level or 0
|
||||||
|
this.upStarPropBtn:SetActive(this.professionLv>0)
|
||||||
local propertyList=professionInfo and professionInfo.propertyList or nil
|
local propertyList=professionInfo and professionInfo.propertyList or nil
|
||||||
fourQuadConfig = ConfigManager.GetConfigDataByKey(ConfigName.FourQuadrantConfig,"Star",this.professionLv)
|
fourQuadConfig = ConfigManager.GetConfigDataByKey(ConfigName.FourQuadrantConfig,"Star",this.professionLv)
|
||||||
this.upStarCostitem= ConfigManager.GetConfigData(ConfigName.ItemConfig,fourQuadConfig.RankupCost[1][1])
|
|
||||||
local itemName=this.upStarCostitem.Name
|
|
||||||
local itemIcon=GetResourcePath(this.upStarCostitem.ResourceID)
|
|
||||||
LogRed("icon:"..itemIcon)
|
|
||||||
this.limitHint.text=string.format("四种属性强化至上限后使用 <color=#24F604>%s</color>进阶",itemName)
|
|
||||||
this.limitCost.sprite=this.spLoader:LoadSprite(itemIcon)
|
|
||||||
this.itemView:OnOpen(false, {this.upStarCostitem.Id,1}, 0, false,false,false)
|
|
||||||
upStarProperty=PracticeManager.fourQuadrantUpStarPropMap[_professionId]
|
|
||||||
---获取属性上限(属性id:属性上限值)
|
---获取属性上限(属性id:属性上限值)
|
||||||
for i = 1, #fourQuadConfig.PropLimit do
|
for i = 1, #fourQuadConfig.PropLimit do
|
||||||
propertyLimit[fourQuadConfig.PropLimit[i][1]]=fourQuadConfig.PropLimit[i][2]
|
propertyLimit[fourQuadConfig.PropLimit[i][1]]=fourQuadConfig.PropLimit[i][2]
|
||||||
|
@ -243,13 +251,28 @@ function this.UpdateData(_professionId)
|
||||||
if this.professionLv>0 then
|
if this.professionLv>0 then
|
||||||
local lastStarLv=this.professionLv-1
|
local lastStarLv=this.professionLv-1
|
||||||
local lastFourQuadConfig = ConfigManager.GetConfigDataByKey(ConfigName.FourQuadrantConfig,"Star",lastStarLv)
|
local lastFourQuadConfig = ConfigManager.GetConfigDataByKey(ConfigName.FourQuadrantConfig,"Star",lastStarLv)
|
||||||
---获取属性上限(属性id:属性上限值)
|
---获取上一级属性上限(属性id:属性上限值)
|
||||||
for i = 1, #lastFourQuadConfig.PropLimit do
|
for i = 1, #lastFourQuadConfig.PropLimit do
|
||||||
lastPropertyLimit[lastFourQuadConfig.PropLimit[i][1]]=lastFourQuadConfig.PropLimit[i][2]
|
lastPropertyLimit[lastFourQuadConfig.PropLimit[i][1]]=lastFourQuadConfig.PropLimit[i][2]
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
lastPropertyLimit={}
|
lastPropertyLimit={}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
this.upStarCostitem= ConfigManager.GetConfigData(ConfigName.ItemConfig,fourQuadConfig.RankupCost[1][1])
|
||||||
|
if this.CheckIsUpStar() then
|
||||||
|
this.limitCost.gameObject:SetActive(false)
|
||||||
|
this.limitHint.text=string.format("<color=#24F604>进阶后,四种属性全部提升%s%%</color>",10)
|
||||||
|
else
|
||||||
|
local itemName=this.upStarCostitem.Name
|
||||||
|
local itemIcon=GetResourcePath(this.upStarCostitem.ResourceID)
|
||||||
|
this.limitHint.text=string.format("四种属性强化至上限后使用 <color=#24F604>%s</color>进阶",itemName)
|
||||||
|
this.limitCost.gameObject:SetActive(true)
|
||||||
|
this.limitCost.sprite=this.spLoader:LoadSprite(itemIcon)
|
||||||
|
this.itemView:OnOpen(false, {this.upStarCostitem.Id,1}, 0, false,false,false)
|
||||||
|
end
|
||||||
|
upStarProperty=PracticeManager.fourQuadrantUpStarPropMap[_professionId]
|
||||||
|
|
||||||
this.UpdateBtnStateAndCostShow()
|
this.UpdateBtnStateAndCostShow()
|
||||||
this.UpdateProperty(propertyList)
|
this.UpdateProperty(propertyList)
|
||||||
this.UpdateStarLv()
|
this.UpdateStarLv()
|
||||||
|
@ -326,23 +349,25 @@ function this.UpdateProperty(_propertyInfoList)
|
||||||
_propertyInfoMap[_propertyInfoList[i].propertyId]=_propertyInfoList[i].propertyNum
|
_propertyInfoMap[_propertyInfoList[i].propertyId]=_propertyInfoList[i].propertyNum
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
for key,limitValue in ipairs(propertyLimit)do
|
for i = 1, #propertyType do
|
||||||
local obj=this.propertyGrid.transform:GetChild(key-1)
|
local obj=this.propertyGrid.transform:GetChild(i-1)
|
||||||
local bar=Util.GetGameObject(obj.gameObject,"progressBg/progressBar"):GetComponent("Image")
|
local bar=Util.GetGameObject(obj.gameObject,"progressBg/progressBar"):GetComponent("Image")
|
||||||
local propertyValueText=Util.GetGameObject(obj.gameObject,"propertyValue"):GetComponent("Text")
|
local propertyValueText=Util.GetGameObject(obj.gameObject,"propertyValue"):GetComponent("Text")
|
||||||
local propertyNameText=Util.GetGameObject(obj.gameObject,"propertyName"):GetComponent("Text")
|
local propertyNameText=Util.GetGameObject(obj.gameObject,"propertyName"):GetComponent("Text")
|
||||||
local propertyIcon=Util.GetGameObject(obj.gameObject,"propertyIcon"):GetComponent("Image")
|
local propertyIcon=Util.GetGameObject(obj.gameObject,"propertyIcon"):GetComponent("Image")
|
||||||
propertyIcon.sprite=this.spLoader:LoadSprite(PropertyTypeIconDef[key])
|
local propertyId=propertyType[i]
|
||||||
propertyNameText.text=string.format("%s神将%s",this.curProfessionName,PropertyName[key])
|
propertyIcon.sprite=this.spLoader:LoadSprite(PropertyTypeIconDef[propertyId])
|
||||||
local propertyNum=_propertyInfoMap[key] and _propertyInfoMap[key] or 0;
|
propertyNameText.text=string.format("%s神将%s",this.curProfessionName,PropertyName[propertyId])
|
||||||
|
local propertyNum=_propertyInfoMap[propertyId] and _propertyInfoMap[propertyId] or 0;
|
||||||
|
local curPropLimit=propertyLimit[propertyId]
|
||||||
if this.professionLv>0 then
|
if this.professionLv>0 then
|
||||||
local progressNum=_propertyInfoMap[key]-lastPropertyLimit[key]
|
local progressNum=_propertyInfoMap[propertyId]-lastPropertyLimit[propertyId]
|
||||||
local progressLimit=limitValue-lastPropertyLimit[key]
|
local progressLimit=curPropLimit-lastPropertyLimit[propertyId]
|
||||||
bar.fillAmount = progressNum/progressLimit
|
bar.fillAmount = progressNum/progressLimit
|
||||||
else
|
else
|
||||||
bar.fillAmount = propertyNum/limitValue
|
bar.fillAmount = propertyNum/curPropLimit
|
||||||
end
|
end
|
||||||
propertyValueText.text=string.format("%s/%s",propertyNum,limitValue)
|
propertyValueText.text=string.format("%s/%s",propertyNum,curPropLimit)
|
||||||
end
|
end
|
||||||
this.UpdateBtnStateAndCostShow()
|
this.UpdateBtnStateAndCostShow()
|
||||||
_isReqLvUp = false
|
_isReqLvUp = false
|
||||||
|
|
|
@ -502,6 +502,17 @@ function this.HeroCalculateFourQuaWarForce(_professionId)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if this.GetFourQuadrantGongmingLv()>0 then
|
||||||
|
local fourQuadConfig = ConfigManager.GetConfigDataByKey(ConfigName.FourQuadrantConfig,"Star",this.GetFourQuadrantGongmingLv())
|
||||||
|
for i = 1, #fourQuadConfig.PropResonance do
|
||||||
|
local propAdd=fourQuadConfig.PropResonance[i]
|
||||||
|
if addAllProVal[propAdd[1]] then
|
||||||
|
addAllProVal[propAdd[1]]=addAllProVal[propAdd[1]]+propAdd[2]
|
||||||
|
else
|
||||||
|
addAllProVal[propAdd[1]]=propAdd[2]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
return addAllProVal
|
return addAllProVal
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue