【战斗】=========被动429 430 431添加提交
parent
e1c73c954f
commit
8e05053512
|
@ -277,20 +277,35 @@ function this.PokemonUnitAdapter(pokemonUnit,camp,_teamDamage)
|
|||
property = {},
|
||||
}
|
||||
-- 技能
|
||||
local skills = string.split(pokemonUnit.unitSkillIds, "#")
|
||||
if pokemonUnit.position==100 then -- 特殊处理位置 100 是玩家技能数据
|
||||
for i = 1, #skills do
|
||||
if skills[i] and skills[i]~="" then
|
||||
local newSkill=this.PlayerSkillAdapter(tonumber(skills[i]))
|
||||
role.skill[i] = newSkill
|
||||
LogError(pokemonUnit.unitSkillIds)
|
||||
local skills = string.split(pokemonUnit.unitSkillIds, "|")
|
||||
if skills then
|
||||
if skills[1] then
|
||||
local actives=string.split(skills[1], "#")
|
||||
if pokemonUnit.position==100 then -- 特殊处理位置 100 是玩家技能数据
|
||||
for i = 1, #actives do
|
||||
if actives[i] and actives[i]~="" then
|
||||
local newSkill=this.PlayerSkillAdapter(tonumber(actives[i]))
|
||||
role.skill[i] = newSkill
|
||||
end
|
||||
end
|
||||
else
|
||||
for i = 1, #actives do
|
||||
role.skill[i]= this.MonsterSkillAdapter(tonumber(actives[i]))
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
for i = 1, #skills do
|
||||
role.skill[i]= this.MonsterSkillAdapter(tonumber(skills[i]))
|
||||
end
|
||||
end
|
||||
if skills[2] then
|
||||
local passs=string.split(skills[2], "#")
|
||||
local passivityList = {}
|
||||
for j = 1, #passs do
|
||||
table.insert(passivityList, tonumber(passs[j]))
|
||||
end
|
||||
role.passivity = this.GetPassivityData(passivityList)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- 属性
|
||||
local propertys = string.split(pokemonUnit.property, "#")
|
||||
for j = 1, #propertys do
|
||||
|
|
|
@ -11039,6 +11039,83 @@ local passivityList = {
|
|||
time=time+1
|
||||
end)
|
||||
end,
|
||||
--每次释放技能,有[a]%的概率,使目标被控制概率改变[b][c]%,持续[d]回合
|
||||
--a[float],b[int],c[float],d[int]
|
||||
[429]=function(role, args,id,judge)
|
||||
local p1=args[1]
|
||||
local ct=args[2]
|
||||
local p2=args[3]
|
||||
local r1=args[4]
|
||||
local OnSkillCast=function(skill)
|
||||
if not skill then
|
||||
return
|
||||
end
|
||||
if skill and not skill.isTriggerJudge and judge==1 then
|
||||
return
|
||||
end
|
||||
local list = skill:GetDirectTargets()
|
||||
if list then
|
||||
for i = 1, #list do
|
||||
BattleUtil.RandomAction(p1,function()
|
||||
|
||||
list[i]:AddBuff(Buff.Create(role, BuffName.BreakArmor,r1,4,ct,p2))
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
role.Event:AddEvent(BattleEventName.SkillCastEnd,OnSkillCast,nil,nil,role)
|
||||
end,
|
||||
--释放技能时,有[a]%概率为目标增加[b]属性 改变[c][d]%的效果,持续[e]回合
|
||||
--a[float],b[int 属性],c[int],d[float],e[int]
|
||||
[430]=function(role, args,id,judge)
|
||||
local p1 = args[1]
|
||||
local pro = args[2]
|
||||
local ct = args[3]
|
||||
local v1 = args[4]
|
||||
local r1 = args[5]
|
||||
local OnSkillCast = function(skill)
|
||||
if not skill then
|
||||
return
|
||||
end
|
||||
if skill and not skill.isTriggerJudge and judge==1 then
|
||||
return
|
||||
end
|
||||
local arr=skill:GetDirectTargets()
|
||||
for i = 1, #arr do
|
||||
BattleUtil.RandomAction(p1,function()
|
||||
arr[i]:AddBuff(Buff.Create(role, BuffName.PropertyChange,r1, BattlePropList[pro], v1, ct))
|
||||
end)
|
||||
end
|
||||
end
|
||||
role.Event:AddEvent(BattleEventName.SkillCastEnd, OnSkillCast,nil,nil,role)
|
||||
end,
|
||||
--释放技能时,我方随机[a]个人,增加[b]%[c]属性的御甲
|
||||
--a[int],b[float],c[int 属性]
|
||||
[431]=function(role, args,id,judge)
|
||||
local v1 = args[1]
|
||||
local v2 = args[2]
|
||||
local pro = args[3]
|
||||
local OnSkillCast = function(skill)
|
||||
if not skill then
|
||||
return
|
||||
end
|
||||
if skill and not skill.isTriggerJudge and judge==1 then
|
||||
return
|
||||
end
|
||||
local list = RoleManager.Query(function(v) return role.camp == v.camp end)
|
||||
if list then
|
||||
BattleUtil.RandomList(list)
|
||||
v1=min(v1,#list)
|
||||
for i = 1, v1 do
|
||||
local val = floor(BattleUtil.FP_Mul(v2, list[i]:GetRoleData(BattlePropList[pro])))
|
||||
--如果身上有御甲就添加御甲的值
|
||||
BattleUtil.AddBlood(list[i],val)
|
||||
end
|
||||
end
|
||||
end
|
||||
role.Event:AddEvent(BattleEventName.SkillCastEnd, OnSkillCast,nil,nil,role)
|
||||
end,
|
||||
|
||||
}
|
||||
return passivityList
|
|
@ -2,7 +2,9 @@ BreakArmor = Buff:New()
|
|||
|
||||
--初始化Buff,通过传入一些自定义参数控制成长相关的数值
|
||||
function BreakArmor:SetData(...)
|
||||
self.signType=...
|
||||
self.signType,
|
||||
self.signValue1,
|
||||
self.signValue2=...
|
||||
-- 刷新排序等级
|
||||
self.sort = 4
|
||||
end
|
||||
|
|
|
@ -1074,7 +1074,7 @@ function BattleUtil.CalDamage(skill, atkRole, defRole, damageType, baseFactor, i
|
|||
|
||||
-- 计算克制伤害系数
|
||||
local MieKangFactor = 1
|
||||
if atkRole.type == BattleUnitType.Role and defRole.type == BattleUnitType.Role then
|
||||
if BattleLogic.GetIsPvP() and atkRole.type == BattleUnitType.Role and defRole.type == BattleUnitType.Role then
|
||||
MieKangFactor=MieKangFactor + atkRole:GetRoleData(BattleMieProp[defRole.element]) - defRole:GetRoleData(BattleKangProp[atkRole.element])
|
||||
end
|
||||
|
||||
|
@ -1359,6 +1359,12 @@ function BattleUtil.RandomControl(rand, ctrl, caster, target, round,skill)
|
|||
target.Event:DispatchEvent(BattleEventName.PassiveBeRandomControl, _CallBack, ctrl, target)
|
||||
BattleLogic.Event:DispatchEvent(BattleEventName.PassiveBeRandomControl, _CallBack, ctrl,caster,target)
|
||||
rand = BattleUtil.CountChangeList(rand, cl)
|
||||
local list=BattleLogic.BuffMgr:GetBuff(target,function(buff)
|
||||
return buff.type==BuffName.BreakArmor and buff.signType==4
|
||||
end)
|
||||
for key, value in pairs(list) do
|
||||
rand=BattleUtil.CountValue(rand,value.signValue2,value.signValue1)
|
||||
end
|
||||
local buff = Buff.Create(caster, BuffName.Control, round, ctrl)
|
||||
local isAdd=BattleUtil.RandomAction(rand, function()
|
||||
target:AddBuff(buff)
|
||||
|
|
|
@ -39,6 +39,32 @@ function Monster:Init(data)
|
|||
--LogError("monster skill id=="..data.skill[i])
|
||||
self.skillGroupList[i] = MSkillManager.CreateMSkillGroup(self, i, data.skill[i])
|
||||
end
|
||||
if data.passivity and #data.passivity > 0 then
|
||||
table.sort(data.passivity,function(a,b)
|
||||
return a[1] < b[1]
|
||||
end)
|
||||
for i = 1, #data.passivity do
|
||||
local v = data.passivity[i]
|
||||
local passivityId = tonumber(v[1])
|
||||
local judge=v[2]
|
||||
local id = tonumber(v[3])
|
||||
local args = {}
|
||||
for j = 4, #v do
|
||||
args[j-3] = v[j]
|
||||
end
|
||||
if BattleUtil.Passivity[id] then
|
||||
BattleUtil.Passivity[id](self, args,passivityId,judge)
|
||||
BattleLogManager.Log(
|
||||
"Add Passive",
|
||||
"id", tostring(id),
|
||||
"camp", tostring(self.camp),
|
||||
"pos", tostring(self.position),
|
||||
"passivityId", tostring(passivityId),
|
||||
"judge", tostring(judge)
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
|
|
@ -63,6 +63,9 @@ function this.CheckPlayerSkillRed(redType)
|
|||
end
|
||||
local id=redType-5000
|
||||
local lv=this.playerSkillList[id]
|
||||
if id~=100 and lv>=this.playerSkillList[100] then
|
||||
return false
|
||||
end
|
||||
local openId=PlayerPrefs.GetInt(PlayerManager.uid.."playerSkillRed")
|
||||
if openId==id then
|
||||
return true
|
||||
|
|
|
@ -273,6 +273,7 @@ function Practice:SetSkillInfo()
|
|||
Util.GetGameObject(item, "Text"):SetActive(false)
|
||||
end
|
||||
Util.AddClick(item,function()
|
||||
LogError("i=="..i.." list[i]=="..list[i])
|
||||
UIManager.OpenPanel(UIName.PracticeSkillInfoPanel,i,list[i])
|
||||
end)
|
||||
index=index+1
|
||||
|
|
|
@ -41,6 +41,9 @@ function PracticeSkillInfoPanel:BindEvent()
|
|||
PracticeManager.SetPlayerSkill(skillId,skillLv)
|
||||
end
|
||||
end)
|
||||
elseif btnState==5 then
|
||||
PopupTipPanel.ShowTip("不能超过主动技能等级")
|
||||
return
|
||||
end
|
||||
end)
|
||||
|
||||
|
@ -70,6 +73,7 @@ function PracticeSkillInfoPanel:RefreshShow(id,lv)
|
|||
else
|
||||
currLv=lv
|
||||
end
|
||||
local list=PracticeManager.GetSkillInfo()
|
||||
LogError("level====="..lv)
|
||||
skillLv=lv
|
||||
skillId=id
|
||||
|
@ -125,8 +129,17 @@ function PracticeSkillInfoPanel:RefreshShow(id,lv)
|
|||
self.costImg.sprite=icon
|
||||
if BagManager.GetItemCountById(currData.LvupCost[1][1])>=currData.LvupCost[1][2] then
|
||||
self.costNum.color=UIColor.WRITE
|
||||
btnState=3 --可以点击
|
||||
self.redPoint:SetActive(true)
|
||||
if skillId~=100 and list[skillId] and currLv>=list[100] then
|
||||
btnState=5
|
||||
self.hintInfo.gameObject:SetActive(true)
|
||||
self.costImg.gameObject:SetActive(false)
|
||||
self.hintInfo.text="不能超过主动技能等级"
|
||||
Util.SetGray(self.btn_up,true)
|
||||
else
|
||||
btnState=3 --可以点击
|
||||
Util.SetGray(self.btn_up,false)
|
||||
end
|
||||
|
||||
else
|
||||
self.costNum.color=UIColor.RED
|
||||
btnState=4 --货币不足
|
||||
|
|
Loading…
Reference in New Issue