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