灵兽逻辑提交

wangzhenxing 2020-09-25 11:45:43 +09:00
parent 6a5eb99853
commit e92fb73587
10 changed files with 152908 additions and 28 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 091d1225053480a4c9ec1d3e61c861f6
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b12ceb5549ecc2d43bb5c55f39cf3bc6
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -2390,4 +2390,9 @@
[12389] = "包含4星或更高星级的神将",
[12390] = "挑战关卡快速升级",
[12391] = "免疫",
[12392] = "放生灵兽",
[12393] = "无可放生灵兽",
[12394] = "请选择灵兽或灵兽碎片",
[12395] = "无法同时选择灵兽与灵兽碎片!"
[12396] = "最多选择%s个灵兽"
}

View File

@ -4766,7 +4766,7 @@ local passivityList = {
if target:IsDead() and BattleUtil.CheckIsNoDead(target) and not role:IsDead() then
-- local target = RoleManager.GetAliveAggro(role)
--BattleUtil.CalDamage(nil, role, target, 1, f1)
--加一个延时操作,防止有的英雄有死亡后再释放一次技能的被动 by:王振兴
--加一个延时操作,防止有的英雄 有死亡后再释放一次技能的被动 表现上让死亡释放技能的人先释放 by:王振兴
BattleLogic.WaitForTrigger(1, function()
role:InsertExtraSkill(f1,f2)
end)

View File

@ -10,6 +10,7 @@ local _TabData={
[2] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = Language[11785] },
[3] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = Language[12383] },
[4] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = Language[12212] },
[5] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = Language[12392] },
}
local _TabFontColor = { default = Color.New(130 / 255, 128 / 255, 120 / 255, 1),
select = Color.New(243 / 255, 235 / 255, 202 / 255, 1)}
@ -23,14 +24,16 @@ this.contents = {
[3] = {view = require("Modules/Resolve/View/Resolve_Talisman"), panelName = "Resolve_Talisman"},
--宝物分解
[4] = {view = require("Modules/Resolve/View/Resolve_EquipTreasure"), panelName = "Resolve_EquipTreasure"},
--放生灵兽
[5] = {view = require("Modules/Resolve/View/Resolve_Pokemon"), panelName = "Resolve_Pokemon"},
}
--子模块预设
this.prefabs={}
--上一子模块索引
local curIndex=0
--Title资源名
local titleImageName={"gongsong","guiyuan","h_guiyuan_zi","h_xianji_fenjie"}
local bgImageName={"h_xianji_ditu","h_huisu_ditu","h_xianji_guiyuanditu","h_xianji_fenjieditu"}
local titleImageName={"gongsong","guiyuan","h_guiyuan_zi","h_xianji_fenjie","lingshou_lingshoufangshengzi"}
local bgImageName={"h_xianji_ditu","h_huisu_ditu","h_xianji_guiyuanditu","h_xianji_fenjieditu","lingshou_lingshoubeijing_03"}
local heroEndBtns = {}
local tabSortType
@ -160,6 +163,7 @@ function this.SwitchView(index)
this.prefabs[i].gameObject:SetActive(i == index)--切换子模块预设显隐
end
--区分显示
this.shaiBtn:SetActive(true)
if index==1 then
this.upView:OnOpen({showType = UpViewOpenType.ShowLeft, panelType = PanelType.HeartFireStone})
this.bgIma.sprite=Util.LoadSprite(bgImageName[1])
@ -176,6 +180,11 @@ function this.SwitchView(index)
this.upView:OnOpen({showType = UpViewOpenType.ShowLeft, panelType = PanelType.HeroReturn})
this.bgIma.sprite=Util.LoadSprite(bgImageName[4])
this.title.sprite=Util.LoadSprite(titleImageName[4])
elseif index==5 then
this.shaiBtn:SetActive(false)
this.upView:OnOpen({showType = UpViewOpenType.ShowLeft, panelType = PanelType.HeroReturn})
this.bgIma.sprite=Util.LoadSprite(bgImageName[5])
this.title.sprite=Util.LoadSprite(titleImageName[5])
end
this.title:SetNativeSize()
@ -198,7 +207,6 @@ end
--特殊的开启条件
function this.SetBottomBarIsActive(tab, index)
local ConfigData = ConfigManager.GetConfig(ConfigName.SpecialConfig)
if index == 4 then
local string = ConfigData[40].Value
local num = string.split(string.split(string,"|")[1],"#")[2]

View File

@ -0,0 +1,218 @@
----- 献祭 -----
local this = {}
local sortingOrder=0
local tabSortType = 0
local tarHero
local selectHeroData={}--选择的英雄list did = data
local maxSelectNum = 30--最大选择数量
--选择碎片的数量
local selectChipNum = 0
--碎片最大数量
local maxChipNum =0
--是否为灵兽/灵兽碎片
local isPokemon = true
function this:InitComponent(gameObject)
--上部内容
this.helpBtn=Util.GetGameObject(gameObject,"Content/Resolve_Pokemon/HelpBtn")
this.helpPos=this.helpBtn:GetComponent("RectTransform").localPosition
--回溯按钮
this.confirmBtn=Util.GetGameObject(gameObject,"Content/Resolve_Pokemon/ConfirmBtn")
Util.GetGameObject(gameObject,"Content/Resolve_Pokemon/ConfirmBtn/Image"):GetComponent("Image").sprite=Util.LoadSprite("lingshou_fangshenganniu")
this.shopBtn=Util.GetGameObject(gameObject,"Content/Resolve_Pokemon/shopBtn")
this.selectText = Util.GetGameObject(gameObject,"Content/Resolve_Pokemon/selectNumText"):GetComponent("Text")
this.selectBtn = Util.GetGameObject(gameObject,"Content/Resolve_Pokemon/btns/selectBtn")
this.cardPre = Util.GetGameObject(gameObject,"item")
this.scrollbar = Util.GetGameObject(gameObject,"Content/Resolve_Pokemon/Scrollbar"):GetComponent("Scrollbar")
this.Empty = Util.GetGameObject(gameObject,"Content/Resolve_Pokemon/Empty")
local v21 = Util.GetGameObject(gameObject, "Content/Resolve_Pokemon/ItemListRoot"):GetComponent("RectTransform").rect
Util.GetGameObject(gameObject, "Content/Resolve_Pokemon/Empty/Bg/Text"):GetComponent("Text").text=Language[12393]
this.chipObj=Util.GetGameObject(gameObject, "Content/Resolve_Pokemon/chipObj")
this.btn_remove=Util.GetGameObject(gameObject, "Content/Resolve_Pokemon/chipObj/btn_remove")
this.btn_add=Util.GetGameObject(gameObject, "Content/Resolve_Pokemon/chipObj/btn_add")
this.chipNumTxt=Util.GetGameObject(gameObject, "Content/Resolve_Pokemon/chipObj/Text")
this.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, Util.GetGameObject(gameObject, "Content/Resolve_Dismantle/ItemListRoot").transform,
this.cardPre, this.scrollbar, Vector2.New(v21.width, v21.height), 1, 5, Vector2.New(43,15))
this.ScrollView.moveTween.MomentumAmount = 1
this.ScrollView.moveTween.Strength = 1
maxSelectNum = tonumber(ConfigManager.GetConfigData(ConfigName.SpecialConfig,54).Value)
end
function this:BindEvent()
--减少按钮
Util.AddClick(this.btn_remove,function()
if selectChipNum==1 then
--减少按钮置灰
return
end
if selectChipNum== maxChipNum-1 then
--取消增加按钮置灰
end
selectChipNum=selectChipNum-1
this.chipNumTxt=selectChipNum
end
)
--增加按钮
Util.AddClick(this.btn_add,function()
if selectChipNum==maxChipNum then
--增加按钮置灰
return
end
if selectChipNum== 2 then
--取消减少按钮置灰
end
selectChipNum=selectChipNum + 1
this.chipNumTxt=selectChipNum
end
)
Util.AddClick(this.helpBtn,function()
UIManager.OpenPanel(UIName.HelpPopup,HELP_TYPE.Resolve_Dismantle,this.helpPos.x,this.helpPos.y)
end)
Util.AddClick(this.confirmBtn,function()
if tonumber(LengthOfTable(selectHeroData))==0 then
PopupTipPanel.ShowTip(Language[12394])
else
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.ResolveDismantle,
HeroManager.GetHeroReturnItems(selectHeroData,GENERAL_POPUP_TYPE.ResolveDismantle),selectHeroData)
end
end)
Util.AddClick(this.shopBtn, function()
local isActive, errorTip = ShopManager.IsActive(SHOP_TYPE.SOUL_CONTRACT_SHOP)
if not isActive then
PopupTipPanel.ShowTip(errorTip or Language[10528])
return
end
UIManager.OpenPanel(UIName.MainShopPanel, SHOP_TYPE.SOUL_CONTRACT_SHOP)
end)
end
function this:AddListener()
end
function this:RemoveListener()
end
function this:OnShow(...)
sortingOrder =0
this.SortTypeClick(sortingOrder)
end
--展示数据
function this.SortTypeClick(_sortType)
tabSortType=_sortType
selectHeroData={}
tarHero=HeroManager.GetAllHeroDataMsinusUpWar(_sortType,2)
this.selectText.text = Language[11775].."0/"..maxSelectNum
this.SortHeroDatas(tarHero)
this.Empty:SetActive(#tarHero <= 0)
this.ScrollView:SetData(tarHero, function (index, go)
this.SingleHeroDataShow(go, tarHero[index])
end)
this.ScrollView:ForeachItemGO(function(index, go)
Timer.New(function()
go.gameObject:SetActive(true)
PlayUIAnim(go.gameObject)
end, 0.001 * (index - 1)):Start()
end)
end
--英雄单个数据展示
function this.SingleHeroDataShow(go,_heroData)
local heroData = _heroData
local _go = go
Util.GetGameObject(_go.transform, "frame"):GetComponent("Image").sprite = Util.LoadSprite(GetHeroQuantityImageByquality(heroData.heroConfig.Quality,heroData.star))
Util.GetGameObject(_go.transform, "lv/Text"):GetComponent("Text").text = heroData.lv
Util.GetGameObject(_go.transform, "Text"):GetComponent("Text").text = heroData.heroConfig.ReadingName
Util.GetGameObject(_go.transform, "icon"):GetComponent("Image").sprite = Util.LoadSprite(GetResourcePath(heroData.heroConfig.Icon))
Util.GetGameObject(_go.transform, "chipImg"):GetComponent("Image").sprite=""
local starGrid = Util.GetGameObject(_go.transform, "star")
SetHeroStars(starGrid, heroData.star,1,Vector2.New(32.5,32.5),-15)
local choosed =Util.GetGameObject(_go.transform, "choosed")
local formationMask =Util.GetGameObject(_go.transform, "mask")
formationMask:SetActive(heroData.isFormation ~= "" and heroData.isFormations[1] ~= FormationTypeDef.EXPEDITION)
choosed:SetActive(selectHeroData[heroData.dynamicId] ~= nil)
local cardclickBtn = Util.GetGameObject(_go.transform, "icon")
this.selectText.text = Language[11775]..LengthOfTable(selectHeroData).."/"..maxSelectNum
Util.AddOnceClick(cardclickBtn, function()
--如果点击的是碎片
if heroData.ischip then
this.selectText:SetActive(false)
this.chipObj:SetActive(true)
selectChipNum=heroData.chipNum
maxChipNum=heroData.chipNum
this.chipNumTxt.text=selectChipNum
isPokemon=false
--点击的是灵兽
else
if selectChipNum==maxSelectNum then
PopupTipPanel.ShowTip(string.format(Language[12396],maxSelectNum))
return
end
this.selectText:SetActive(true)
this.chipObj:SetActive(false)
isPokemon = true
end
if selectHeroData[heroData.dynamicId] then
choosed:SetActive(false)
selectHeroData[heroData.dynamicId] = nil
this.selectText.text = Language[11775]..LengthOfTable(selectHeroData).."/"..maxSelectNum
return
end
if LengthOfTable(selectHeroData) >= maxSelectNum then
PopupTipPanel.ShowTip(string.format(Language[12211],maxSelectNum))
return
end
selectHeroData[heroData.dynamicId]=heroData
choosed:SetActive(true)
this.selectText.text = Language[11775]..LengthOfTable(selectHeroData).."/"..maxSelectNum
end)
--灰色遮罩点击
Util.AddOnceClick(formationMask, function()
PopupTipPanel.ShowTip(Language[12395])
end)
end
--英雄排序
function this.SortHeroDatas(_heroDatas)
--上阵最优先星级优先同星级等级优先同星级同等级按sortId排序。排序时降序排序。
table.sort(_heroDatas, function(a, b)
if a ==nil or b == nil then
return
end
if (a.isFormation == "" or (a.isFormation ~= "" and a.isFormations[1] == FormationTypeDef.EXPEDITION)) and (b.isFormation == "" or (b.isFormation ~= "" and b.isFormations[1] == FormationTypeDef.EXPEDITION)) then
if a.lockState == b.lockState then
if a.heroConfig.Natural ==b.heroConfig.Natural then
if a.star == b.star then
if a.lv == b.lv then
return a.heroConfig.Id > b.heroConfig.Id
else
return a.lv < b.lv
end
else
return a.star < b.star
end
else
return a.heroConfig.Natural < b.heroConfig.Natural
end
else
return a.lockState < b.lockState
end
else
return (a.isFormation == "" or (a.isFormation ~= "" and a.isFormations[1] == FormationTypeDef.EXPEDITION)) and (not b.isFormation ~= "" and b.isFormations[1] ~= FormationTypeDef.EXPEDITION)
end
end)
end
function this:OnClose()
end
function this:OnDestroy()
end
return this

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 7fa838b518bd7bc41a549fc7b3760af2
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: