战斗校验
parent
39404df90d
commit
495c238a9e
|
@ -29,7 +29,7 @@ local effectList = {
|
||||||
[1] = function(caster, target, args, interval)
|
[1] = function(caster, target, args, interval)
|
||||||
local f1 = args[1]
|
local f1 = args[1]
|
||||||
local dt = args[2]
|
local dt = args[2]
|
||||||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, interval)
|
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, interval, target)
|
||||||
if caster.camp == 0 and target.camp == 1 then
|
if caster.camp == 0 and target.camp == 1 then
|
||||||
BattleLogic.Event:DispatchEvent(BattleEventName.ZoomChange, target, interval)
|
BattleLogic.Event:DispatchEvent(BattleEventName.ZoomChange, target, interval)
|
||||||
end
|
end
|
||||||
|
@ -95,7 +95,7 @@ local effectList = {
|
||||||
end
|
end
|
||||||
for i=1, count do
|
for i=1, count do
|
||||||
BattleLogic.WaitForTrigger(d * (i-1), function ()
|
BattleLogic.WaitForTrigger(d * (i-1), function ()
|
||||||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, d)
|
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, d, target)
|
||||||
BattleLogic.WaitForTrigger(d, function ()
|
BattleLogic.WaitForTrigger(d, function ()
|
||||||
BattleUtil.CalDamage(caster, target, dt, f1)
|
BattleUtil.CalDamage(caster, target, dt, f1)
|
||||||
end)
|
end)
|
||||||
|
@ -142,6 +142,7 @@ local effectList = {
|
||||||
target.skill.sp = min(target.skill.sp + floor(target.skill.spPass * f1), target.skill.spPass)
|
target.skill.sp = min(target.skill.sp + floor(target.skill.spPass * f1), target.skill.spPass)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
target.Event:DispatchEvent(BattleEventName.RoleCDChanged, target.skill.sp, target.skill.spPass)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
@ -163,7 +164,7 @@ local effectList = {
|
||||||
local f1 = args[1]
|
local f1 = args[1]
|
||||||
local dt = args[2]
|
local dt = args[2]
|
||||||
local f2 = args[3]
|
local f2 = args[3]
|
||||||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, interval)
|
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, interval, target)
|
||||||
if caster.camp == 0 and target.camp == 1 then
|
if caster.camp == 0 and target.camp == 1 then
|
||||||
BattleLogic.Event:DispatchEvent(BattleEventName.ZoomChange, target, interval)
|
BattleLogic.Event:DispatchEvent(BattleEventName.ZoomChange, target, interval)
|
||||||
end
|
end
|
||||||
|
@ -179,7 +180,7 @@ local effectList = {
|
||||||
local dt = args[2]
|
local dt = args[2]
|
||||||
local i1 = args[3]
|
local i1 = args[3]
|
||||||
local f2 = args[4]
|
local f2 = args[4]
|
||||||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, interval)
|
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, interval, target)
|
||||||
if caster.camp == 0 and target.camp == 1 then
|
if caster.camp == 0 and target.camp == 1 then
|
||||||
BattleLogic.Event:DispatchEvent(BattleEventName.ZoomChange, target, interval)
|
BattleLogic.Event:DispatchEvent(BattleEventName.ZoomChange, target, interval)
|
||||||
end
|
end
|
||||||
|
@ -220,7 +221,7 @@ local effectList = {
|
||||||
local rid = args[4]
|
local rid = args[4]
|
||||||
local f3 = args[5]
|
local f3 = args[5]
|
||||||
local i1 = args[6]
|
local i1 = args[6]
|
||||||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, interval)
|
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, interval, target)
|
||||||
BattleLogic.WaitForTrigger(interval, function ()
|
BattleLogic.WaitForTrigger(interval, function ()
|
||||||
local layer
|
local layer
|
||||||
if BattleLogic.BuffMgr:HasBuff(target, BuffName.Brand, function (buff)
|
if BattleLogic.BuffMgr:HasBuff(target, BuffName.Brand, function (buff)
|
||||||
|
@ -245,7 +246,7 @@ local effectList = {
|
||||||
local f1 = args[1]
|
local f1 = args[1]
|
||||||
local dt = args[2]
|
local dt = args[2]
|
||||||
local f2 = args[3]
|
local f2 = args[3]
|
||||||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, interval)
|
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, interval, target)
|
||||||
if caster.camp == 0 and target.camp == 1 then
|
if caster.camp == 0 and target.camp == 1 then
|
||||||
BattleLogic.Event:DispatchEvent(BattleEventName.ZoomChange, target, interval)
|
BattleLogic.Event:DispatchEvent(BattleEventName.ZoomChange, target, interval)
|
||||||
end
|
end
|
||||||
|
@ -277,7 +278,7 @@ local effectList = {
|
||||||
local dt = args[2]
|
local dt = args[2]
|
||||||
local i1 = args[3]
|
local i1 = args[3]
|
||||||
local f2 = args[4] * (1 + caster:GetRoleData(RoleDataName.Hit) / (1 + target:GetRoleData(RoleDataName.Dodge)))
|
local f2 = args[4] * (1 + caster:GetRoleData(RoleDataName.Hit) / (1 + target:GetRoleData(RoleDataName.Dodge)))
|
||||||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, interval)
|
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, interval, target)
|
||||||
if caster.camp == 0 and target.camp == 1 then
|
if caster.camp == 0 and target.camp == 1 then
|
||||||
BattleLogic.Event:DispatchEvent(BattleEventName.ZoomChange, target, interval)
|
BattleLogic.Event:DispatchEvent(BattleEventName.ZoomChange, target, interval)
|
||||||
end
|
end
|
||||||
|
@ -300,7 +301,7 @@ local effectList = {
|
||||||
local f1 = args[1]
|
local f1 = args[1]
|
||||||
local dt = args[2]
|
local dt = args[2]
|
||||||
local f2 = args[3]
|
local f2 = args[3]
|
||||||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, interval)
|
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, interval, target)
|
||||||
if caster.camp == 0 and target.camp == 1 then
|
if caster.camp == 0 and target.camp == 1 then
|
||||||
BattleLogic.Event:DispatchEvent(BattleEventName.ZoomChange, target, interval)
|
BattleLogic.Event:DispatchEvent(BattleEventName.ZoomChange, target, interval)
|
||||||
end
|
end
|
||||||
|
@ -334,7 +335,7 @@ local effectList = {
|
||||||
end
|
end
|
||||||
for i=1, count do
|
for i=1, count do
|
||||||
BattleLogic.WaitForTrigger(d * (i-1), function ()
|
BattleLogic.WaitForTrigger(d * (i-1), function ()
|
||||||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, d)
|
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, d, target)
|
||||||
BattleLogic.WaitForTrigger(d, function ()
|
BattleLogic.WaitForTrigger(d, function ()
|
||||||
BattleUtil.CalDamage(caster, target, dt, f1)
|
BattleUtil.CalDamage(caster, target, dt, f1)
|
||||||
end)
|
end)
|
||||||
|
@ -348,7 +349,7 @@ local effectList = {
|
||||||
local dt = args[2]
|
local dt = args[2]
|
||||||
local i1 = args[3]
|
local i1 = args[3]
|
||||||
local f2 = args[4]
|
local f2 = args[4]
|
||||||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, interval)
|
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, interval, target)
|
||||||
if caster.camp == 0 and target.camp == 1 then
|
if caster.camp == 0 and target.camp == 1 then
|
||||||
BattleLogic.Event:DispatchEvent(BattleEventName.ZoomChange, target, interval)
|
BattleLogic.Event:DispatchEvent(BattleEventName.ZoomChange, target, interval)
|
||||||
end
|
end
|
||||||
|
@ -398,7 +399,7 @@ local effectList = {
|
||||||
local dt = args[2]
|
local dt = args[2]
|
||||||
local ht = args[3]
|
local ht = args[3]
|
||||||
local f2 = args[4]
|
local f2 = args[4]
|
||||||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, interval)
|
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, interval, target)
|
||||||
if caster.camp == 0 and target.camp == 1 then
|
if caster.camp == 0 and target.camp == 1 then
|
||||||
BattleLogic.Event:DispatchEvent(BattleEventName.ZoomChange, target, interval)
|
BattleLogic.Event:DispatchEvent(BattleEventName.ZoomChange, target, interval)
|
||||||
end
|
end
|
||||||
|
@ -473,7 +474,7 @@ local effectList = {
|
||||||
local dt = args[2]
|
local dt = args[2]
|
||||||
local dot = args[3]
|
local dot = args[3]
|
||||||
local f2 = args[4]
|
local f2 = args[4]
|
||||||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, interval)
|
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, interval, target)
|
||||||
if caster.camp == 0 and target.camp == 1 then
|
if caster.camp == 0 and target.camp == 1 then
|
||||||
BattleLogic.Event:DispatchEvent(BattleEventName.ZoomChange, target, interval)
|
BattleLogic.Event:DispatchEvent(BattleEventName.ZoomChange, target, interval)
|
||||||
end
|
end
|
||||||
|
@ -501,7 +502,7 @@ local effectList = {
|
||||||
end
|
end
|
||||||
for i=1, count do
|
for i=1, count do
|
||||||
BattleLogic.WaitForTrigger(d * (i-1), function ()
|
BattleLogic.WaitForTrigger(d * (i-1), function ()
|
||||||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, d)
|
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, d, target)
|
||||||
BattleLogic.WaitForTrigger(d, function ()
|
BattleLogic.WaitForTrigger(d, function ()
|
||||||
if target.professionId == pt then
|
if target.professionId == pt then
|
||||||
f1 = f1 + f2
|
f1 = f1 + f2
|
||||||
|
@ -518,7 +519,7 @@ local effectList = {
|
||||||
local dt = args[2]
|
local dt = args[2]
|
||||||
local ct = args[3]
|
local ct = args[3]
|
||||||
local f2 = args[4]
|
local f2 = args[4]
|
||||||
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, interval)
|
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, interval, target)
|
||||||
if caster.camp == 0 and target.camp == 1 then
|
if caster.camp == 0 and target.camp == 1 then
|
||||||
BattleLogic.Event:DispatchEvent(BattleEventName.ZoomChange, target, interval)
|
BattleLogic.Event:DispatchEvent(BattleEventName.ZoomChange, target, interval)
|
||||||
end
|
end
|
||||||
|
@ -566,6 +567,7 @@ local effectList = {
|
||||||
target.skill.sp = min(target.skill.sp + floor(target.skill.spPass * f1), target.skill.spPass)
|
target.skill.sp = min(target.skill.sp + floor(target.skill.spPass * f1), target.skill.spPass)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
target.Event:DispatchEvent(BattleEventName.RoleCDChanged, target.skill.sp, target.skill.spPass)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
func()
|
func()
|
||||||
|
|
|
@ -215,13 +215,9 @@ function Skill:Cast()
|
||||||
BattleLogic.Event:DispatchEvent(BattleEventName.ZoomOut, 0.3)
|
BattleLogic.Event:DispatchEvent(BattleEventName.ZoomOut, 0.3)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
if chooseId == 10000 then --我方aoe
|
if chooseId == 10000 or chooseId == 20000 then --10000 我方aoe 20000 敌方aoe
|
||||||
self.owner.Event:DispatchEvent(BattleEventName.AOE, 0)
|
local camp = chooseId == 10000 and self.owner.camp or 1 - self.owner.camp
|
||||||
for j=1, #arr do
|
self.owner.Event:DispatchEvent(BattleEventName.AOE, camp)
|
||||||
takeEffect(self.owner, arr[j], effects, duration)
|
|
||||||
end
|
|
||||||
elseif chooseId == 20000 then --敌方aoe
|
|
||||||
self.owner.Event:DispatchEvent(BattleEventName.AOE, 1)
|
|
||||||
for j=1, #arr do
|
for j=1, #arr do
|
||||||
takeEffect(self.owner, arr[j], effects, duration)
|
takeEffect(self.owner, arr[j], effects, duration)
|
||||||
end
|
end
|
||||||
|
|
|
@ -198,6 +198,9 @@ function BattleLogic.InitAggro()
|
||||||
end
|
end
|
||||||
|
|
||||||
function BattleLogic.SetAggro(role)
|
function BattleLogic.SetAggro(role)
|
||||||
|
if role.isTeam then
|
||||||
|
return
|
||||||
|
end
|
||||||
if role.camp == 1 then
|
if role.camp == 1 then
|
||||||
playerAggro = role
|
playerAggro = role
|
||||||
BattleLogic.Event:DispatchEvent(BattleEventName.ZoomChange, role, 1)
|
BattleLogic.Event:DispatchEvent(BattleEventName.ZoomChange, role, 1)
|
||||||
|
@ -364,6 +367,11 @@ function BattleLogic.Update()
|
||||||
local teamSkill = playerTeamSkillList[playerTeamSkillIndex]
|
local teamSkill = playerTeamSkillList[playerTeamSkillIndex]
|
||||||
if teamSkill then
|
if teamSkill then
|
||||||
teamSkill:Cast()
|
teamSkill:Cast()
|
||||||
|
playerTeamSkillIndex = playerTeamSkillIndex + 1
|
||||||
|
if playerTeamSkillIndex > #playerTeamSkillList then
|
||||||
|
playerTeamSkillIndex = 1
|
||||||
|
end
|
||||||
|
playerMP = 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -27,6 +27,7 @@ BattleEventName = {
|
||||||
RoleDead = indexAdd(),
|
RoleDead = indexAdd(),
|
||||||
RoleRevive = indexAdd(),
|
RoleRevive = indexAdd(),
|
||||||
RolePropertyChanged = indexAdd(),
|
RolePropertyChanged = indexAdd(),
|
||||||
|
RoleCDChanged = indexAdd(),
|
||||||
|
|
||||||
SkillCast = indexAdd(),
|
SkillCast = indexAdd(),
|
||||||
|
|
||||||
|
|
|
@ -76,14 +76,14 @@ public class NettyClient {
|
||||||
return HeroInfoProto.HeroComposeRequest.newBuilder().setItem(item).build();
|
return HeroInfoProto.HeroComposeRequest.newBuilder().setItem(item).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static MessageLite useAndPriceItemRequest(int type ,int itemId , int itemNum) {
|
// private static MessageLite useAndPriceItemRequest(int type ,int itemId , int itemNum) {
|
||||||
CommonProto.Item item = CommonProto.Item.newBuilder()
|
// CommonProto.Item item = CommonProto.Item.newBuilder()
|
||||||
.setItemId(itemId)
|
// .setItemId(itemId)
|
||||||
.setItemNum(itemNum)
|
// .setItemNum(itemNum)
|
||||||
.build();
|
// .build();
|
||||||
return PlayerInfoProto.UseAndPriceItemRequest.newBuilder().setType(type).setItem(item).build();
|
// return PlayerInfoProto.UseAndPriceItemRequest.newBuilder().setType(type).setItem(item).build();
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
|
|
||||||
public static HeroInfoProto.GetHeroListInfoRequest getHero(){
|
public static HeroInfoProto.GetHeroListInfoRequest getHero(){
|
||||||
return HeroInfoProto.GetHeroListInfoRequest.newBuilder().setIndex(1).build();
|
return HeroInfoProto.GetHeroListInfoRequest.newBuilder().setIndex(1).build();
|
||||||
|
|
Loading…
Reference in New Issue