法相修改提交
parent
1f83739af1
commit
d84f374bf2
|
@ -1755,6 +1755,7 @@ FUNCTION_OPEN_TYPE = {
|
|||
NewShenzun=133,--新神尊特权
|
||||
XIUWEI=136,--主角修为
|
||||
FightJump=137, --战斗跳过
|
||||
FaXiang=138,--法相
|
||||
Number_Game=149,--数字游戏
|
||||
}
|
||||
|
||||
|
|
|
@ -747,7 +747,7 @@ GMBUYGOODREQUEST = protobuf.Descriptor();
|
|||
GMBUYGOODREQUEST_GOODSID_FIELD = protobuf.FieldDescriptor();
|
||||
WEARFAXIANGEQUIPREQUEST = protobuf.Descriptor();
|
||||
WEARFAXIANGEQUIPREQUEST_HEROID_FIELD = protobuf.FieldDescriptor();
|
||||
WEARFAXIANGEQUIPREQUEST_FAXIANGID_FIELD = protobuf.FieldDescriptor();
|
||||
WEARFAXIANGEQUIPREQUEST_WEARID_FIELD = protobuf.FieldDescriptor();
|
||||
WEARFAXIANGEQUIPREQUEST_ACTION_FIELD = protobuf.FieldDescriptor();
|
||||
STRONGTHENFAXIANGEQUIPREQUEST = protobuf.Descriptor();
|
||||
STRONGTHENFAXIANGEQUIPREQUEST_FAXIANGID_FIELD = protobuf.FieldDescriptor();
|
||||
|
@ -7559,15 +7559,15 @@ WEARFAXIANGEQUIPREQUEST_HEROID_FIELD.default_value = ""
|
|||
WEARFAXIANGEQUIPREQUEST_HEROID_FIELD.type = 9
|
||||
WEARFAXIANGEQUIPREQUEST_HEROID_FIELD.cpp_type = 9
|
||||
|
||||
WEARFAXIANGEQUIPREQUEST_FAXIANGID_FIELD.name = "faxiangID"
|
||||
WEARFAXIANGEQUIPREQUEST_FAXIANGID_FIELD.full_name = ".rpc.protocols.WearFaxiangEquipRequest.faxiangID"
|
||||
WEARFAXIANGEQUIPREQUEST_FAXIANGID_FIELD.number = 2
|
||||
WEARFAXIANGEQUIPREQUEST_FAXIANGID_FIELD.index = 1
|
||||
WEARFAXIANGEQUIPREQUEST_FAXIANGID_FIELD.label = 1
|
||||
WEARFAXIANGEQUIPREQUEST_FAXIANGID_FIELD.has_default_value = false
|
||||
WEARFAXIANGEQUIPREQUEST_FAXIANGID_FIELD.default_value = ""
|
||||
WEARFAXIANGEQUIPREQUEST_FAXIANGID_FIELD.type = 9
|
||||
WEARFAXIANGEQUIPREQUEST_FAXIANGID_FIELD.cpp_type = 9
|
||||
WEARFAXIANGEQUIPREQUEST_WEARID_FIELD.name = "wearID"
|
||||
WEARFAXIANGEQUIPREQUEST_WEARID_FIELD.full_name = ".rpc.protocols.WearFaxiangEquipRequest.wearID"
|
||||
WEARFAXIANGEQUIPREQUEST_WEARID_FIELD.number = 2
|
||||
WEARFAXIANGEQUIPREQUEST_WEARID_FIELD.index = 1
|
||||
WEARFAXIANGEQUIPREQUEST_WEARID_FIELD.label = 3
|
||||
WEARFAXIANGEQUIPREQUEST_WEARID_FIELD.has_default_value = false
|
||||
WEARFAXIANGEQUIPREQUEST_WEARID_FIELD.default_value = {}
|
||||
WEARFAXIANGEQUIPREQUEST_WEARID_FIELD.type = 9
|
||||
WEARFAXIANGEQUIPREQUEST_WEARID_FIELD.cpp_type = 9
|
||||
|
||||
WEARFAXIANGEQUIPREQUEST_ACTION_FIELD.name = "action"
|
||||
WEARFAXIANGEQUIPREQUEST_ACTION_FIELD.full_name = ".rpc.protocols.WearFaxiangEquipRequest.action"
|
||||
|
@ -7583,7 +7583,7 @@ WEARFAXIANGEQUIPREQUEST.name = "WearFaxiangEquipRequest"
|
|||
WEARFAXIANGEQUIPREQUEST.full_name = ".rpc.protocols.WearFaxiangEquipRequest"
|
||||
WEARFAXIANGEQUIPREQUEST.nested_types = {}
|
||||
WEARFAXIANGEQUIPREQUEST.enum_types = {}
|
||||
WEARFAXIANGEQUIPREQUEST.fields = {WEARFAXIANGEQUIPREQUEST_HEROID_FIELD, WEARFAXIANGEQUIPREQUEST_FAXIANGID_FIELD, WEARFAXIANGEQUIPREQUEST_ACTION_FIELD}
|
||||
WEARFAXIANGEQUIPREQUEST.fields = {WEARFAXIANGEQUIPREQUEST_HEROID_FIELD, WEARFAXIANGEQUIPREQUEST_WEARID_FIELD, WEARFAXIANGEQUIPREQUEST_ACTION_FIELD}
|
||||
WEARFAXIANGEQUIPREQUEST.is_extendable = false
|
||||
WEARFAXIANGEQUIPREQUEST.extensions = {}
|
||||
STRONGTHENFAXIANGEQUIPREQUEST_FAXIANGID_FIELD.name = "faxiangID"
|
||||
|
|
|
@ -459,7 +459,7 @@ function this.GetHeroDatas(_msgHeroData, force, specialEffects,guildSkill)
|
|||
heroData.equipIdList = _msgHeroData.equipIdList
|
||||
heroData.talismanList = _msgHeroData.especialEquipLevel
|
||||
heroData.jewels = _msgHeroData.jewels
|
||||
|
||||
heroData.faxiang = _msgHeroData.faxiang
|
||||
---↓↓↓↓↓↓↓↓↓↓↓摘星阁
|
||||
heroData.equipStrong={}
|
||||
for i = 1, #_msgHeroData.equipStrong do
|
||||
|
@ -633,11 +633,23 @@ function this.InitUpdateEquipData(_equipData, heroData)
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
--法相
|
||||
if(heroData.faxiang) then
|
||||
for i = 1, #heroData.faxiang do
|
||||
if heroData.faxiang[i] and heroData.faxiang[i] == _equipData.id then
|
||||
this.InitSingleFaXiangData(_equipData,heroData)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--宝器
|
||||
local jewelConfig = ConfigManager.GetConfig(ConfigName.JewelConfig)
|
||||
local faXiangConfig = ConfigManager.GetConfig(ConfigName.FaxiangConfig)
|
||||
local allTreasures = {}
|
||||
local allFaXiangs ={}
|
||||
--初始化单个宝物的数据
|
||||
function this.InitSingleTreasureData(_singleData,heroData)
|
||||
if _singleData==nil then
|
||||
|
@ -679,6 +691,46 @@ function this.InitSingleTreasureData(_singleData,heroData)
|
|||
allTreasures[_singleData.id]=single
|
||||
end
|
||||
|
||||
|
||||
--初始化单个宝物的数据
|
||||
function this.InitSingleFaXiangData(_singleData,herodata)
|
||||
if _singleData == nil then
|
||||
return
|
||||
end
|
||||
local single = {}
|
||||
local staticId = _singleData.equipId
|
||||
|
||||
local currJewel = faXiangConfig[staticId]
|
||||
single.faXiangConfig=currJewel
|
||||
single.equipType = currJewel.Location
|
||||
single.id = staticId
|
||||
single.idDyn = _singleData.id
|
||||
single.lv = _singleData.exp
|
||||
single.refineLv = _singleData.rebuildLevel --星级
|
||||
single.fourSpirit=_singleData.fourSpirit
|
||||
single.maxLv = currJewel.LevelMax
|
||||
single.maxRefineLv = currJewel.StarMax
|
||||
single.upHeroDid = herodata.dynamicId
|
||||
-- single.race = currJewel.Race
|
||||
single.itemConfig = itemConfig[staticId]
|
||||
single.quantity = single.itemConfig.Quantity
|
||||
single.name = GetLanguageStrById(itemConfig[staticId].Name)
|
||||
single.frame = GetQuantityImageByquality(itemConfig[staticId].Quantity)
|
||||
single.levelPool = currJewel.LevelUpPool
|
||||
single.refinePool = currJewel.Star
|
||||
single.equipType = currJewel.Type
|
||||
local quantity = currJewel.Level
|
||||
single.icon = GetResourcePath(itemConfig[staticId].ResourceID)
|
||||
single.strongConfig = this.GetCurrTreasureLvConfig(currJewel.LevelUpPool, _singleData.exp)
|
||||
single.refineConfig = this.GetCurrTreasureLvConfig(2, currJewel.Star, _singleData.rebuildLevel)
|
||||
allFaXiangs[_singleData.id] = single
|
||||
-- end
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
local jewerLevelUpConfig = ConfigManager.GetConfig(ConfigName.JewelRankupConfig)
|
||||
--获取当前宝物升级数据
|
||||
function this.GetCurrTreasureLvConfig(_type,_id,_lv)
|
||||
|
@ -696,6 +748,15 @@ function this.GetSingleTreasureByIdDyn(_idDyn)
|
|||
return allTreasures[_idDyn]
|
||||
|
||||
end
|
||||
--根据动态id获取法相
|
||||
function this.GetSingleFaXiangByIdDyn(_idDyn)
|
||||
if allFaXiangs==nil then
|
||||
return
|
||||
end
|
||||
return allFaXiangs[_idDyn]
|
||||
|
||||
end
|
||||
|
||||
|
||||
--获取单个装备数据
|
||||
function this.GetSingleEquipData(_equipid)
|
||||
|
|
|
@ -611,11 +611,13 @@ function this.EquipWearRequest(_heroId, _equipIds,_type, func)
|
|||
end
|
||||
|
||||
--请求穿脱法相
|
||||
function this.WearFaxiangEquipRequest(_heroId,_faxiangId,_type,func)
|
||||
function this.WearFaxiangEquipRequest(_heroId,_ups,_type,func)
|
||||
local data = PlayerInfoProto_pb.WearFaxiangEquipRequest()
|
||||
data.heroID = _heroId
|
||||
data.action =_type
|
||||
data.faxiangID=_faxiangId
|
||||
for i = 1, #_ups do
|
||||
data.wearID:append(_ups[i])
|
||||
end
|
||||
local msg = data:SerializeToString()
|
||||
Network:SendMessageWithCallBack(MessageTypeProto_pb.WEAR_FAXIANG_EQUIP_REQUEST, MessageTypeProto_pb.WEAR_FAXIANG_EQUIP_RESPONSE, msg, function(buffer)
|
||||
local data = buffer:DataByte()
|
||||
|
|
|
@ -68,7 +68,9 @@ function RewardTalismanSingleShowPopup2:InitComponent()
|
|||
self.btnDown = Util.GetGameObject(self.btnGrid, "btnDown")
|
||||
self.btnSwitch = Util.GetGameObject(self.btnGrid, "btnSwitch")
|
||||
self.btnUpgrade = Util.GetGameObject(self.btnGrid, "btnUpgrade")
|
||||
self.btnUpgradeTxt =Util.GetGameObject(self.btnGrid, "btnUpgrade/Text"):GetComponent("Text")
|
||||
self.btnUpstar = Util.GetGameObject(self.btnGrid, "btnUpstar")
|
||||
self.btnUpstarTxt = Util.GetGameObject(self.btnGrid, "btnUpstar/Text"):GetComponent("Text")
|
||||
self.btnShenYing = Util.GetGameObject(self.btnGrid, "btnShenYing")
|
||||
self.upgradeRed = Util.GetGameObject(self.btnUpgrade, "red")
|
||||
self.upstarRed = Util.GetGameObject(self.btnUpstar, "red")
|
||||
|
@ -153,7 +155,8 @@ function RewardTalismanSingleShowPopup2:BindEvent()
|
|||
table.insert(equipDataList,self.equipData)
|
||||
--法相穿戴
|
||||
if self.position>6 then
|
||||
NetManager.WearFaxiangEquipRequest(self.curHeroData.dynamicId,self.equipData.idDyn,1,function ()
|
||||
|
||||
NetManager.WearFaxiangEquipRequest(self.curHeroData.dynamicId,equipIdList,1,function ()
|
||||
self:ClosePanel()
|
||||
self.parent.UpdateEquipPosHeroData(3,typeToUpdate[self.openType],equipDataList,0,self.position)
|
||||
end)
|
||||
|
@ -172,7 +175,7 @@ function RewardTalismanSingleShowPopup2:BindEvent()
|
|||
table.insert(equipIdList,self.equipData.idDyn)
|
||||
table.insert(equipDataList,self.equipData)
|
||||
if self.position>6 then
|
||||
NetManager.WearFaxiangEquipRequest(self.curHeroData.dynamicId,self.equipData.idDyn,2,function ()
|
||||
NetManager.WearFaxiangEquipRequest(self.curHeroData.dynamicId,equipIdList,2,function ()
|
||||
self:ClosePanel()
|
||||
self.parent.UpdateEquipPosHeroData(3,typeToUpdate[self.openType],equipDataList)
|
||||
end)
|
||||
|
@ -200,7 +203,7 @@ function RewardTalismanSingleShowPopup2:BindEvent()
|
|||
return
|
||||
end
|
||||
end
|
||||
NetManager.WearFaxiangEquipRequest(self.curHeroData.dynamicId,self.equipData.idDyn,3,function ()
|
||||
NetManager.WearFaxiangEquipRequest(self.curHeroData.dynamicId,equipIdList,3,function ()
|
||||
self:ClosePanel()
|
||||
self.parent.UpdateEquipPosHeroData(3,typeToUpdate[self.openType],equipDataList,self.nextEquip,self.position)
|
||||
end)
|
||||
|
@ -280,7 +283,13 @@ function RewardTalismanSingleShowPopup2:SetBtns()
|
|||
self.btnUpgrade:SetActive(self.openType == 2)
|
||||
self.btnUpstar:SetActive(self.openType == 2)
|
||||
self.btnShenYing:SetActive(self.openType == 2 and CheckFunctionOpen(84) and self.position<7)--对标建木神树功能开启
|
||||
|
||||
if self.position and self.position>6 then
|
||||
self.btnUpgradeTxt.text="升 级"
|
||||
self.btnUpstarTxt.text="升 星"
|
||||
else
|
||||
self.btnUpgradeTxt.text="强 化"
|
||||
self.btnUpstarTxt.text="精 炼"
|
||||
end
|
||||
if self.equipData and self.equipData ~= 0 then
|
||||
isGongMing = HarmonyManager.IsInfo(self.equipData.upHeroDid)
|
||||
Util.SetGray(self.btnUpgrade, isGongMing)
|
||||
|
|
|
@ -429,6 +429,7 @@ function this.EquipInfo()
|
|||
|
||||
local curHeroEquipDatas = {}
|
||||
for i = 1, #curHeroData.equipIdList do
|
||||
--LogError("equip-----------------"..i)
|
||||
local equipData = GoodFriendManager.GetSingleEquipData(curHeroData.equipIdList[i]) or EquipManager.GetSingleEquipData(curHeroData.equipIdList[i])
|
||||
if equipData ~= nil then
|
||||
curHeroEquipDatas[equipData.equipConfig.Position] = equipData
|
||||
|
@ -496,6 +497,34 @@ function this.EquipInfo()
|
|||
end
|
||||
end)
|
||||
end
|
||||
|
||||
for n = 1, #curHeroData.faxiang do
|
||||
local did=curHeroData.faxiang[n]
|
||||
local data = FaXiangManager.GetSingleTreasureByIdDyn(did)
|
||||
if not data then
|
||||
data = MonsterCampManager.GetSingleTreasureByIdDyn(did)
|
||||
end
|
||||
if not data then
|
||||
data = ExpeditionManager.GetSingleTreasureByIdDyn(did)
|
||||
end
|
||||
if not data then
|
||||
data = GoodFriendManager.GetSingleFaXiangByIdDyn(did)
|
||||
end
|
||||
local pos = Util.GetGameObject(this.faXiangGrid,"Pre"..n.."/pos")
|
||||
local btn = Util.GetGameObject(pos,"mask")
|
||||
if not this.treasureDatas[pos] then
|
||||
this.treasureDatas[pos] = SubUIManager.Open(SubUIConfig.ItemView,pos.transform)
|
||||
end
|
||||
this.treasureDatas[pos].gameObject:SetActive(true)
|
||||
this.treasureDatas[pos].transform:SetAsFirstSibling()
|
||||
this.treasureDatas[pos]:OnOpen(false, {data.id,0}, 0.8, false, false, false, 0,did)
|
||||
Util.AddOnceClick(btn,function()
|
||||
if did and data then
|
||||
-- UIManager.OpenPanel(UIName.RoleEquipTreasureChangePopup,this,2,curHeroData,data,nil,pos,0)
|
||||
UIManager.OpenPanel(UIName.RewardTalismanSingleShowPopup2,this,data,0,false,nil,curHeroData,n+6)
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
--魂印
|
||||
|
||||
|
|
|
@ -26,14 +26,14 @@ function this.InitSingleTreasureData(_singleData,notAdd)
|
|||
end
|
||||
local single = {}
|
||||
local staticId = _singleData.equipId
|
||||
LogError("starticid=="..staticId)
|
||||
--LogError("starticid=="..staticId)
|
||||
local currJewel = faXiangConfig[staticId]
|
||||
single.faXiangConfig=currJewel
|
||||
single.equipType = currJewel.Location
|
||||
single.id = staticId
|
||||
single.idDyn = _singleData.id
|
||||
single.lv = _singleData.exp
|
||||
LogError("single.lv=="..single.lv)
|
||||
--LogError("single.lv=="..single.lv)
|
||||
single.refineLv = _singleData.rebuildLevel --星级
|
||||
single.fourSpirit=_singleData.fourSpirit
|
||||
single.maxLv = currJewel.LevelMax
|
||||
|
@ -138,7 +138,7 @@ function this.GetCurrLvAndNextLvPropertyValue(_id, _lv,_data)
|
|||
local Para=0
|
||||
local starConfig=ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.FaxiangStarConfig,"PoolId",_data.refinePool,"Level",_data.refineLv)
|
||||
if starConfig then
|
||||
LogError("starConfig.id=="..starConfig.Id)
|
||||
--LogError("starConfig.id=="..starConfig.Id)
|
||||
Para=starConfig.StarPara/10000
|
||||
end
|
||||
|
||||
|
@ -202,10 +202,10 @@ function this.GetCurrStarAndNextStarPropertyValue(_id, _lv,_data)
|
|||
local nexLvConfig = nil
|
||||
local Para=0
|
||||
local nextPara=0
|
||||
LogError("lv======================".._lv)
|
||||
--LogError("lv======================".._lv)
|
||||
local starConfig=ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.FaxiangStarConfig,"PoolId",_data.refinePool,"Level",_data.refineLv)
|
||||
if starConfig then
|
||||
LogError("starConfig.id=="..starConfig.Id)
|
||||
--LogError("starConfig.id=="..starConfig.Id)
|
||||
Para=starConfig.StarPara/10000
|
||||
end
|
||||
|
||||
|
@ -222,7 +222,7 @@ function this.GetCurrStarAndNextStarPropertyValue(_id, _lv,_data)
|
|||
break
|
||||
end
|
||||
end
|
||||
LogError("lvConfig.id========="..lvConfig.Id)
|
||||
--LogError("lvConfig.id========="..lvConfig.Id)
|
||||
local proList = {}
|
||||
if lvConfig then
|
||||
for i = 1, table.getn(lvConfig.LevelPara) do
|
||||
|
@ -371,7 +371,7 @@ end
|
|||
|
||||
function this.CalculateAllFaXiangAddPro(_heroData)
|
||||
-- LogGreen("sId:"..sId.." lv:"..lv.." rlv:"..rlv.." tlv:"..tlv)
|
||||
LogError("===============================获取英雄法相添加的属性")
|
||||
--LogError("===============================获取英雄法相添加的属性")
|
||||
local allProVal = {}
|
||||
if _heroData==nil then
|
||||
return allProVal
|
||||
|
@ -402,7 +402,7 @@ function this.CalculateAllFaXiangAddPro(_heroData)
|
|||
end
|
||||
end
|
||||
for key, value in pairs(addProList) do
|
||||
LogError("key========="..key.." value=="..value)
|
||||
--LogError("key========="..key.." value=="..value)
|
||||
allProVal[key]=allProVal[key]+value
|
||||
end
|
||||
end
|
||||
|
@ -412,7 +412,36 @@ function this.CalculateAllFaXiangAddPro(_heroData)
|
|||
end
|
||||
|
||||
|
||||
|
||||
function this.CalculateFaXiangAddPro(faxiang)
|
||||
-- LogGreen("sId:"..sId.." lv:"..lv.." rlv:"..rlv.." tlv:"..tlv)
|
||||
--LogError("===============================获取英雄法相添加的属性")
|
||||
local allProVal = {}
|
||||
if faxiang==nil then
|
||||
return allProVal
|
||||
end
|
||||
for i, v in ConfigPairs(propertyConfig) do
|
||||
allProVal[i] = 0
|
||||
end
|
||||
local addProList={}
|
||||
if faxiang then
|
||||
local levelConfig=ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.FaxiangLevelConfig,"PoolId",faxiang.levelPool,"Level",faxiang.lv)
|
||||
if levelConfig then
|
||||
for j = 1, #levelConfig.LevelPara do
|
||||
local pro=levelConfig.LevelPara[j][1]
|
||||
addProList[pro]=levelConfig.LevelPara[j][2]
|
||||
end
|
||||
end
|
||||
local starConfig=ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.FaxiangStarConfig,"PoolId",faxiang.refinePool,"Level",faxiang.refineLv)
|
||||
if starConfig then
|
||||
for j = 1, #addProList do
|
||||
local Para=starConfig.StarPara/10000
|
||||
addProList[j]=math.floor(addProList[j] * (1 + Para))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return addProList
|
||||
end
|
||||
|
||||
--获取消耗物品数据
|
||||
function this.GetCostItems(_config)
|
||||
|
@ -457,12 +486,64 @@ function this.GetSingleTreasureByIdDyn(_idDyn)
|
|||
end
|
||||
|
||||
|
||||
function this.GetOneKeyUpFaXiangByType(_hero)
|
||||
local list={}
|
||||
local yinList={}
|
||||
local YangList={}
|
||||
local curyin
|
||||
local yinPower=0
|
||||
local curyang
|
||||
local yangPower=0
|
||||
for i, v in pairs(allTreasures) do
|
||||
if v.faXiangConfig.Type==0
|
||||
and (v.faXiangConfig.Profession==0 or v.faXiangConfig.Profession==_hero.heroConfig.Profession)
|
||||
and (v.faXiangConfig.Job==0 or v.faXiangConfig.Profession==_hero.heroConfig.Job) then
|
||||
local power=this.CalculateEquipWarForce(v)
|
||||
--LogError("power=========="..power)
|
||||
--table.insert(yinList,v)
|
||||
if power>yinPower then
|
||||
yinPower=power
|
||||
curyin=v.idDyn
|
||||
end
|
||||
end
|
||||
end
|
||||
for i, v in pairs(allTreasures) do
|
||||
if v.faXiangConfig.Type==1
|
||||
and (v.faXiangConfig.Profession==0 or v.faXiangConfig.Profession==_hero.heroConfig.Profession)
|
||||
and (v.faXiangConfig.Job==0 or v.faXiangConfig.Profession==_hero.heroConfig.Job) then
|
||||
local power=this.CalculateEquipWarForce(v)
|
||||
-- LogError("power=========="..power)
|
||||
--table.insert(yinList,v)
|
||||
if power>yangPower then
|
||||
yangPower=power
|
||||
curyang=v.idDyn
|
||||
end
|
||||
end
|
||||
end
|
||||
if curyin then
|
||||
table.insert(list,curyin)
|
||||
end
|
||||
if curyang then
|
||||
table.insert(list,curyang)
|
||||
end
|
||||
return list
|
||||
end
|
||||
|
||||
--根据装备数据计算战斗力
|
||||
function this.CalculateEquipWarForce(curEquip)
|
||||
local addAllProVal = {}
|
||||
addAllProVal= this.CalculateFaXiangAddPro(curEquip)
|
||||
local powerEndVal = HeroPowerManager.CalPower(addAllProVal)
|
||||
return powerEndVal
|
||||
end
|
||||
|
||||
|
||||
--获取当前等级加成的属性
|
||||
function this.GetCurLvPropertyValue(_id, _lv, _isShow)
|
||||
local lvConfig = nil
|
||||
local isShow = _isShow == true
|
||||
--获取当前等级属性加成
|
||||
LogError("_id==".._id.." level==".._lv)
|
||||
-- LogError("_id==".._id.." level==".._lv)
|
||||
for _, configInfo in ConfigPairs(faxiangLevelConfig) do
|
||||
if configInfo.PoolId == _id and configInfo.Level == _lv then
|
||||
|
||||
|
@ -534,7 +615,7 @@ end
|
|||
function this.GetCurrTreasureLvConfig( _id, _lv)
|
||||
for _, configInfo in ConfigPairs(faxiangLevelConfig) do
|
||||
if configInfo.PoolId == _id and configInfo.Level == _lv then
|
||||
LogError("poolid==".._id .."_lv==================".._lv)
|
||||
--LogError("poolid==".._id .."_lv==================".._lv)
|
||||
return configInfo
|
||||
end
|
||||
end
|
||||
|
@ -581,6 +662,11 @@ function this.CalculateWarForceBase(sId, lv, rlv, tlv,curTreasure)
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
function this.SetTreasureUpOrDown(_idDyn, _hero)
|
||||
if allTreasures[_idDyn] then
|
||||
allTreasures[_idDyn].upHeroDid = _hero
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
return FaXiangManager
|
|
@ -56,6 +56,7 @@ local currPageIndex = 0
|
|||
local curEquipTreasureDatas = {}
|
||||
local curFaXiangDatas={}
|
||||
local isCanUpEquipTreasure = false
|
||||
local isCanUpFaXiang = false
|
||||
local isPlayAnim = true
|
||||
local isFristOpenTime
|
||||
--初始化组件(用于子类重写)RoleEquipChangePopup
|
||||
|
@ -131,8 +132,10 @@ function RoleEquipPanel:InitComponent()
|
|||
this.handBookBtn = Util.GetGameObject(self.transform, "handBookBtn")
|
||||
this.treasure1 = Util.GetGameObject(self.transform, "bg/equipInfo/equip5")
|
||||
this.treasure2 = Util.GetGameObject(self.transform, "bg/equipInfo/equip6")
|
||||
this.faXiang1 = Util.GetGameObject(self.transform, "bg/equipInfo/equip7")
|
||||
this.faXiang2 = Util.GetGameObject(self.transform, "bg/equipInfo/equip8")
|
||||
this.treasurePage1 = Util.GetGameObject(self.transform, "Tabs/Btn5")
|
||||
this.treasurePage2 = Util.GetGameObject(self.transform, "Tabs/Btn6")
|
||||
this.faXiangPage = Util.GetGameObject(self.transform, "Tabs/Btn6")
|
||||
this.emptyObj = Util.GetGameObject(self.transform, "emptyObj")
|
||||
this.emptyObj.gameObject:SetActive(false)
|
||||
this.mask = Util.GetGameObject(self.gameObject, "mask")
|
||||
|
@ -258,6 +261,8 @@ function RoleEquipPanel:OnShow()
|
|||
this:OnClickTabBtn(indexBtnNum)
|
||||
this.CheckRedTab()
|
||||
this.UpView:OnOpen({showType = UpViewOpenType.ShowLeft, panelType = PanelType.Main})
|
||||
local list=FaXiangManager.GetOneKeyUpFaXiangByType(curHeroData)
|
||||
LogError("list len=="..#list)
|
||||
end
|
||||
|
||||
function this:OnSortingOrderChange()
|
||||
|
@ -287,7 +292,7 @@ end
|
|||
function this:AllEquipUpBtnOnClick()
|
||||
local allEquipIds = {}
|
||||
local allTreasureIds = {}
|
||||
|
||||
local allFaXiang = {}
|
||||
--计算英雄身上的所有装备位的装备
|
||||
local curHeroEquipDatas = {}
|
||||
local curHeroDataequipIdList = curHeroData.equipIdList
|
||||
|
@ -307,6 +312,13 @@ function this:AllEquipUpBtnOnClick()
|
|||
curHeroEquipDatas[equipData.equipType + 4] = equipData
|
||||
end
|
||||
end
|
||||
--法相数据
|
||||
for k, v in ipairs(curHeroData.faxiang) do
|
||||
local equipData = FaXiangManager.GetSingleTreasureByIdDyn(v)
|
||||
if equipData ~= nil then
|
||||
curHeroEquipDatas[equipData.equipType + 7] = equipData
|
||||
end
|
||||
end
|
||||
|
||||
local equipEffectPos = {}
|
||||
local treasureEffectPos = {}
|
||||
|
@ -384,8 +396,21 @@ function this:AllEquipUpBtnOnClick()
|
|||
end
|
||||
LogYellow("装备:"..#allEquipIds)
|
||||
LogYellow("宝物:"..#allTreasureIds)
|
||||
local list={}
|
||||
if isCanUpFaXiang then
|
||||
list=FaXiangManager.GetOneKeyUpFaXiangByType(curHeroData)
|
||||
|
||||
for i = 1, #curHeroData.faxiang do
|
||||
local isCon=BattleUtil.ChecklistIsContainValue(list,curHeroData.faxiang[i])
|
||||
if isCon then
|
||||
table.removebyvalue(list,curHeroData.faxiang[i])
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
LogYellow("isCanUpEquipTreasure:"..tostring(isCanUpEquipTreasure))
|
||||
if (allEquipIds and #allEquipIds > 0) or (isCanUpEquipTreasure and allTreasureIds and #allTreasureIds > 0) then
|
||||
if (allEquipIds and #allEquipIds > 0) or (isCanUpEquipTreasure and allTreasureIds and #allTreasureIds > 0) or (isCanUpFaXiang and list and #list > 0) then
|
||||
if allEquipIds and #allEquipIds > 0 and not curHeroData.harmonyGongMing then
|
||||
--穿装备协议
|
||||
NetManager.EquipWearRequest(curHeroData.dynamicId,allEquipIds,1,function()
|
||||
|
@ -414,6 +439,12 @@ function this:AllEquipUpBtnOnClick()
|
|||
end
|
||||
end)
|
||||
end
|
||||
if isCanUpFaXiang and list and #list>0 then
|
||||
|
||||
NetManager.WearFaxiangEquipRequest(curHeroData.dynamicId,list,1,function()
|
||||
this.UpdateEquipPosHeroData(3, 4, list)
|
||||
end)
|
||||
end
|
||||
else
|
||||
if not allEquipIds or #allEquipIds < 1 then
|
||||
if #curHeroData.equipIdList <= 0 then
|
||||
|
@ -431,7 +462,7 @@ end
|
|||
|
||||
--一键卸下
|
||||
function this:AllEquipDownBtnOnClick()
|
||||
if(curHeroData.equipIdList and #curHeroData.equipIdList > 0) or(curHeroData.jewels and #curHeroData.jewels > 0 and isCanUpEquipTreasure) then
|
||||
if(curHeroData.equipIdList and #curHeroData.equipIdList > 0) or (curHeroData.jewels and #curHeroData.jewels > 0 and isCanUpEquipTreasure) or (curHeroData.faxiang and #curHeroData.faxiang > 0 and isCanUpFaXiang) then
|
||||
if curHeroData.equipIdList and #curHeroData.equipIdList > 0 then
|
||||
NetManager.EquipUnLoadOptRequest(curHeroData.dynamicId,curHeroData.equipIdList,1,function()
|
||||
this.UpdateEquipPosHeroData(1, 5, curHeroData.equipIdList)
|
||||
|
@ -444,6 +475,12 @@ function this:AllEquipDownBtnOnClick()
|
|||
this.UpdateEquipPosHeroData(2, 5, curHeroData.jewels)
|
||||
end)
|
||||
end
|
||||
if curHeroData.faxiang and #curHeroData.faxiang > 0 then
|
||||
-- 一键卸下音效
|
||||
NetManager.WearFaxiangEquipRequest(curHeroData.dynamicId,curHeroData.faxiang,2,function()
|
||||
this.UpdateEquipPosHeroData(3, 5, curHeroData.faxiang)
|
||||
end)
|
||||
end
|
||||
else
|
||||
PopupTipPanel.ShowTip(Language[11800])
|
||||
end
|
||||
|
@ -472,17 +509,20 @@ function this.ShowHeroEquip()
|
|||
this.treasure1.gameObject:SetActive(true)
|
||||
this.treasure2.gameObject:SetActive(true)
|
||||
this.treasurePage1.gameObject:SetActive(true)
|
||||
this.treasurePage2.gameObject:SetActive(true)
|
||||
else
|
||||
isCanUpEquipTreasure = false
|
||||
this.equipTreasureBtn.gameObject:SetActive(false)
|
||||
this.treasure1.gameObject:SetActive(false)
|
||||
this.treasure2.gameObject:SetActive(false)
|
||||
this.treasurePage1.gameObject:SetActive(false)
|
||||
this.treasurePage2.gameObject:SetActive(false)
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
isCanUpFaXiang=CheckFunctionOpen(FUNCTION_OPEN_TYPE.FaXiang)
|
||||
this.faXiangPage.gameObject:SetActive(isCanUpFaXiang)
|
||||
this.faXiang1:SetActive(isCanUpFaXiang)
|
||||
this.faXiang2:SetActive(isCanUpFaXiang)
|
||||
end
|
||||
SetHeroBg(this.spLoader, Util.GetGameObject(this.transform, "bg/heroInfo"),Util.GetGameObject(this.transform, "bg/heroInfo/bg"), curHeroData.star,0, orginLayer)
|
||||
this.heroLv.text = curHeroData.lv
|
||||
|
@ -974,7 +1014,8 @@ function this.UpdateEquipPosHeroData(_equipOrTreasure, _type, _selectEquipDataLi
|
|||
HeroManager.SetHeroEquipIdList(curHeroData.dynamicId, curHeroData.equipIdList)
|
||||
EquipManager.UpdateEquipData(_selectEquipDataList, curHeroData.dynamicId)
|
||||
end
|
||||
else
|
||||
elseif _equipOrTreasure == 2 then
|
||||
-- body
|
||||
local isadd
|
||||
for i = 1, #_selectEquipDataList do
|
||||
isadd = true
|
||||
|
@ -994,6 +1035,26 @@ function this.UpdateEquipPosHeroData(_equipOrTreasure, _type, _selectEquipDataLi
|
|||
table.insert(curHeroData.jewels, _selectEquipDataList[i])
|
||||
end
|
||||
end
|
||||
elseif _equipOrTreasure == 3 then
|
||||
local isadd
|
||||
for i = 1, #_selectEquipDataList do
|
||||
isadd = true
|
||||
for j = 1, #curHeroData.faxiang do
|
||||
--如果英雄身上有和选中的宝物的位置相同的,就替换
|
||||
if FaXiangManager.GetSingleTreasureByIdDyn(curHeroData.faxiang[j]).equipType ==
|
||||
FaXiangManager.GetSingleTreasureByIdDyn(_selectEquipDataList[i]).equipType then
|
||||
FaXiangManager.SetTreasureUpOrDown(curHeroData.faxiang[j], "0")
|
||||
--FaXiangManager.SetTreasureUpOrDown(_selectEquipDataList[i], curHeroData.dynamicId)
|
||||
curHeroData.jewels[j] = _selectEquipDataList[i]
|
||||
isadd = false
|
||||
break
|
||||
end
|
||||
end
|
||||
if isadd then
|
||||
FaXiangManager.SetTreasureUpOrDown(_selectEquipDataList[i], curHeroData.dynamicId)
|
||||
table.insert(curHeroData.faxiang, _selectEquipDataList[i])
|
||||
end
|
||||
end
|
||||
end
|
||||
elseif _type == 5 then
|
||||
--一键脱 把身上装备英雄id置为“0” 再把英雄装备list清空
|
||||
|
@ -1006,13 +1067,21 @@ function this.UpdateEquipPosHeroData(_equipOrTreasure, _type, _selectEquipDataLi
|
|||
curHeroData.equipIdList = {}
|
||||
HeroManager.SetHeroEquipIdList(curHeroData.dynamicId, {})
|
||||
curHeroData.equipIdList = {}
|
||||
else
|
||||
elseif _equipOrTreasure == 2 then
|
||||
-- body
|
||||
if _selectEquipDataList then
|
||||
for i = 1, #_selectEquipDataList do
|
||||
EquipTreasureManager.SetTreasureUpOrDown(_selectEquipDataList[i], "")
|
||||
end
|
||||
curHeroData.jewels = {}
|
||||
end
|
||||
elseif _equipOrTreasure == 3 then
|
||||
if _selectEquipDataList then
|
||||
for i = 1, #_selectEquipDataList do
|
||||
FaXiangManager.SetTreasureUpOrDown(_selectEquipDataList[i], "")
|
||||
end
|
||||
curHeroData.faxiang = {}
|
||||
end
|
||||
end
|
||||
end
|
||||
--刷新界面
|
||||
|
|
Loading…
Reference in New Issue