Merge branch 'master_prb_gn' into master_test_gn_zf

back_recharge
jiahuiwen 2022-03-29 16:50:40 +08:00
commit 0f7d904e89
33 changed files with 849 additions and 302 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2889,6 +2889,79 @@ local effectList = {
target.isRealDead=true
target:SetRelive(pro, caster)
end,
--造成[a]%的[b]伤害,造成伤害的[c]%用于医疗生命值最低的队友。(攻击目标为多人治疗不重复)
--a[float],b[伤害类型],c[float]
[148] = function(caster, target, args, interval, skill)
local f1 = args[1]
local dt = args[2]
local f2 = args[3]
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
BattleLogic.WaitForTrigger(interval, function ()
local OnBeHit = function(atkRole, damage, bCrit, finalDmg, damageType)
local arr = RoleManager.NoOrder(function (r) return r.camp == caster.camp end,false,true)
BattleUtil.SortByHpFactor(arr, 1)
--之前是finaldag 改成 damage
for i = 1, #arr do
if not BattleUtil.ChecklistIsContainValue(skill.targets,arr[i]) then
f2 = BattleUtil.CheckSkillDamageHeal(f2, caster, arr[i])
BattleUtil.ApplyTreat(caster, arr[i], floor(damage*f2))
table.insert(skill.targets,arr[i])
break
end
end
end
target.Event:AddEvent(BattleEventName.RoleBeHit, OnBeHit)
BattleUtil.CalDamage(skill, caster, target, dt, f1)
target.Event:RemoveEvent(BattleEventName.RoleBeHit, OnBeHit)
end)
end,
--造成[a]%的[b]伤害并记录技能总伤害
--a[float],b[伤害类型]
[149] = function(caster, target, args, interval, skill)
local f1 = args[1]
local dt = args[2]
local f2 = args[3]
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
BattleLogic.WaitForTrigger(interval, function ()
local OnBeHit = function(atkRole, damage, bCrit, finalDmg, damageType,curSkill)
if curSkill then
curSkill.skillDamage=curSkill.skillDamage+damage
end
end
target.Event:AddEvent(BattleEventName.RoleBeHit, OnBeHit)
BattleUtil.CalDamage(skill, caster, target, dt, f1)
target.Event:RemoveEvent(BattleEventName.RoleBeHit, OnBeHit)
end)
end,
--造成技能总伤害的[a]%平分给生命值最低的[b]队友
--a[float],b[int]
[150] = function(caster, target, args, interval, skill)
local f1 = args[1]
local num = args[2]
caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target)
BattleLogic.WaitForTrigger(interval, function ()
local OnSkillEnd
OnSkillEnd=function(skill)
if skill.skillDamage==0 then
return
end
local hp=BattleUtil.ErrorCorrection(skill.skillDamage*f1/num)
local arr = RoleManager.NoOrder(function (r) return r.camp == caster.camp end,false,true)
BattleUtil.SortByHpFactor(arr, 1)
for i = 1, #arr do
if i<=num then
BattleUtil.ApplyTreat(caster, arr[i], hp)
end
end
caster.Event:RemoveEvent(BattleEventName.SkillCastEnd,OnSkillEnd)
end
caster.Event:AddEvent(BattleEventName.SkillCastEnd,OnSkillEnd)
end)
end,
}

View File

@ -50,7 +50,7 @@ function EffectCaster:DoEffect(caster, target, eff, duration, skill)
e.args[i] = eff.args[i]
end
-- 检测被动技能对技能参数的影响
-- 检测被动技能对技能参数的影响
local function _PassiveCheck(pe)
if pe then
e = pe
@ -77,7 +77,7 @@ end
function EffectCaster:takeEffect(caster, target, effects, effectIndex, duration, skill)
for k=1, #effects do
-- 如果不是第一个效果对列的第一个效果则判断是否命中
-- 如果不是第一个效果对列的第一个效果则判断是否命中
if k ~= 1 and effectIndex == 1 then
if self:CheckTargetIsHit(target) then
self:DoEffect(caster, target, effects[k], duration, skill)
@ -93,25 +93,25 @@ function EffectCaster:ChooseTarget()
--
self.effectTargets = {}
self.targetIsHit = {}
-- 先计算出技能的目标
-- 先计算出技能的目标
for i=1, #self.effectList do
-- 是否重新选择目标
-- 是否重新选择目标
local isReTarget = true
if self.targets and self.targets[i] then
self.effectTargets[i] = self.targets[i]
-- 判断是否有有效目标
-- 判断是否有有效目标
for _, role in ipairs(self.effectTargets[i]) do
if not role:IsRealDead() then
isReTarget = false
end
end
end
-- 重新选择目标
-- 重新选择目标
if isReTarget then
local effectGroup = self.effectList[i]
local chooseId = effectGroup.chooseId
self.effectTargets[i] = BattleUtil.ChooseTarget(self.skill.owner, chooseId)
-- 检测被动对攻击目标的影响
-- 检测被动对攻击目标的影响
if i == 1 then
local function _PassiveTarget(targets)
self.effectTargets[i] = targets
@ -122,19 +122,19 @@ function EffectCaster:ChooseTarget()
end
end
-- 释放技能
-- func 技能释放完成回调
-- 释放技能
-- func 技能释放完成回调
function EffectCaster:Cast()
-- 选择目标
-- 选择目标
self:ChooseTarget()
-- 对目标造成相应的效果
-- 对目标造成相应的效果
for i=1, #self.effectList do
local effectGroup = self.effectList[i]
local chooseId = effectGroup.chooseId
local arr = self.effectTargets[i]
if arr and #arr > 0 then
-- 效果延迟1帧生效
-- 效果延迟1帧生效
BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function()
local effects = effectGroup.effects
local weight = math.floor(chooseId % 10000 / 100)
@ -145,10 +145,10 @@ function EffectCaster:Cast()
table.sort(arr, function(a, b)
return a.position < b.position
end)
-- 全部同时生效
-- 全部同时生效
for j=1, count do
if arr[j] and not arr[j]:IsRealDead() then
-- 检测是否命中
-- 检测是否命中
if i == 1 then
self.targetIsHit[arr[j]] = BattleUtil.CheckIsHit(self.skill.owner, arr[j],self.skill)
end
@ -160,7 +160,7 @@ function EffectCaster:Cast()
end
end
-- 遍历技能命中目标
-- 遍历技能命中目标
function EffectCaster:ForeachTargets(func)
local targets = self:GetDirectTargets()
for _, role in ipairs(targets) do
@ -170,7 +170,7 @@ function EffectCaster:ForeachTargets(func)
end
end
-- 获取直接选择目标Id
-- 获取直接选择目标Id
function EffectCaster:GetDirectChooseId()
local effectGroup = self.effectList[1]
local chooseId = effectGroup.chooseId
@ -178,12 +178,12 @@ function EffectCaster:GetDirectChooseId()
end
-- 获取技能的直接目标,和策划规定第一个效果的目标为直接效果目标,(包含miss的目标)
-- 获取技能的直接目标,和策划规定第一个效果的目标为直接效果目标,(包含miss的目标)
function EffectCaster:GetDirectTargets()
return self.effectTargets[1]
end
-- 获取直接目标不包含miss的目标可能为空
-- 获取直接目标不包含miss的目标可能为空
function EffectCaster:GetDirectTargetsNoMiss()
local list = {}
for _, role in ipairs(self.effectTargets[1]) do
@ -194,7 +194,7 @@ function EffectCaster:GetDirectTargetsNoMiss()
return list
end
-- 获取直接目标和没有被放逐的目标不包含miss的目标可能为空
-- 获取直接目标和没有被放逐的目标不包含miss的目标可能为空
function EffectCaster:GetDirectTargetsNoExile()
local list = {}
for _, role in ipairs(self.effectTargets[1]) do
@ -205,7 +205,7 @@ function EffectCaster:GetDirectTargetsNoExile()
return list
end
-- 获取直接目标和没有被放逐的目标,不包含不灭可能为空
-- 获取直接目标和没有被放逐的目标,不包含不灭可能为空
function EffectCaster:GetDirectTargetsNoNODead()
local list = {}
for _, role in ipairs(self.effectTargets[1]) do
@ -216,7 +216,7 @@ function EffectCaster:GetDirectTargetsNoNODead()
return list
end
-- 获取技能目标最大人数
-- 获取技能目标最大人数
function EffectCaster:GetMaxTargetNum()
local mainEffect = self.effectList[1]
if not mainEffect then
@ -225,7 +225,7 @@ function EffectCaster:GetMaxTargetNum()
return BattleUtil.GetMaxTargetNum(mainEffect.chooseId)
end
-- 判断是否命中
-- 判断是否命中
function EffectCaster:CheckTargetIsHit(role)
return self.targetIsHit[role]
end

View File

@ -11053,6 +11053,10 @@ local passivityList = {
if skill and not skill.isTriggerJudge and judge==1 then
return
end
--只有主角一技能才能触发这个被动
if skill.isPlayerSkill~=nil and skill.isPlayerSkill==false then
return
end
local list = skill:GetDirectTargets()
if list then
for i = 1, #list do
@ -11078,6 +11082,10 @@ local passivityList = {
if not skill then
return
end
--只有主角一技能才能触发这个被动
if skill.isPlayerSkill~=nil and skill.isPlayerSkill==false then
return
end
if skill and not skill.isTriggerJudge and judge==1 then
return
end
@ -11090,12 +11098,14 @@ local passivityList = {
end
role.Event:AddEvent(BattleEventName.SkillCastEnd, OnSkillCast,nil,nil,role)
end,
--释放技能时,我方随机[a]个人,增加[b]%[c]属性的御甲
--a[int],b[float],c[int 属性]
--释放技能时,我方随机[a]个人,增加[b]%[c]属性的御甲,技能类型[d],目标选择系数[e]d,e可不填的;d不填默认所有技能e不填随机a人
--a[int],b[float],c[int 属性],d[int 0:所有 1:仅技能],e[int 技能目标查找系数]
[431]=function(role, args,id,judge)
local v1 = args[1]
local v2 = args[2]
local pro = args[3]
local type = args[4]
local targets = args[5]
local OnSkillCast = function(skill)
if not skill then
return
@ -11103,19 +11113,140 @@ local passivityList = {
if skill and not skill.isTriggerJudge and judge==1 then
return
end
local list = RoleManager.QueryNoDead(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)
--只有主角一技能才能触发这个被动
if skill.isPlayerSkill~=nil and skill.isPlayerSkill==false then
return
end
if type and type==1 and skill.type~=BattleSkillType.Special then
return
end
if targets then
local arr = BattleUtil.ChooseTarget(role,targets,1)
for i=1, #arr do
local val = floor(BattleUtil.FP_Mul(v2,arr[i]:GetRoleData(BattlePropList[pro])))
--如果身上有御甲就添加御甲的值
BattleUtil.AddBlood(arr[i],val)
end
else
local list = RoleManager.QueryNoDead(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
end
role.Event:AddEvent(BattleEventName.SkillCastEnd, OnSkillCast,nil,nil,role)
end,
--技能[a]额外造成目标[b][c]%的伤害。
--a[int 1:仅主动技能] b[int 属性id],c[float]
[432]=function(role,args,id,judge)
local type=args[1]
local f1 = args[2]
local dt = args[3]
-- 直接伤害后
local onPassiveDamaging = function(func, defRole, damage,skill)
if not skill then
return
end
if skill and not skill.isTriggerJudge and judge==1 then
return
end
if type then
if type==1 and skill.type~=BattleSkillType.Special then
return
end
if type==2 and (skill.type~=BattleSkillType.Special or skill.type~=BattleSkillType.Extra) then
return
end
end
--如果是boss 并且额外伤害是根据最大生命则返回
if (f1==12 or f1==13) and BattleUtil.CheckIsBoss(defRole) then
return
end
local val = floor(BattleUtil.FP_Mul(dt, defRole:GetRoleData(BattlePropList[f1])))
BattleUtil.FinalDamageCountShield(nil,role,defRole,val)
end
role.Event:AddEvent(BattleEventName.PassiveDamaging, onPassiveDamaging,nil,nil,role)
end,
--释放技能治疗,给目标添加免疫负面效果的护盾[a],持续[b]回合
--a[int],b[int]
[433] = function(role, args,id,judge)
local type = args[1]
local round = args[2]
local onRoleTreat=function(target,realTreat,treat)
target:AddBuff(Buff.Create(role, BuffName.Shield, round,type, 0, 0))
end
local OnSkillCast = function(skill)
if skill and not skill.isTriggerJudge and judge==1 then
return
end
if skill.type ~= BattleSkillType.Special and skill.type~=BattleSkillType.Extra then
return
end
role.Event:AddEvent(BattleEventName.RoleTreat, onRoleTreat,nil,nil,role)
end
local OnSkillCastEnd = function(skill)
if skill and not skill.isTriggerJudge and judge==1 then
return
end
if skill.type ~= BattleSkillType.Special and skill.type~=BattleSkillType.Extra then
return
end
role.Event:RemoveEvent(BattleEventName.RoleTreat,onRoleTreat,nil,nil,role)
end
role.Event:AddEvent(BattleEventName.SkillCast, OnSkillCast,nil,nil,role)
role.Event:AddEvent(BattleEventName.SkillCastEnd, OnSkillCastEnd,nil,nil,role)
end,
--释放技能时,有[a]%概率为目标增加[b]属性 改变[c][d]%的效果,持续[e]回合
--a[float],b[int 属性],c[int],d[float],e[int]
[434] = 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 buff2=nil
local onHit = function(target, damage, bCrit, finalDmg)
BattleUtil.RandomAction(p1,function()
buff2=Buff.Create(role, BuffName.PropertyChange,r1, BattlePropList[pro], v1, ct)
local aaa=BattleLogic.BuffMgr:HasBuff(target, BuffName.PropertyChange, function (buff) return buff.propertyName==buff2.propertyName and buff.Value==buff2.Value and buff.changeType==buff2.changeType end)
if not aaa then
target:AddBuff(buff2)
end
end)
end
local onSkillCast = function(skill)
if skill and not skill.isTriggerJudge and judge==1 then
return
end
if skill.type == BattleSkillType.Special or skill.type==BattleSkillType.Extra then
role.Event:AddEvent(BattleEventName.RoleHit, onHit,nil,nil,role)
end
end
-- 技能后后
local onSkillCastEnd = function(skill)
if skill and not skill.isTriggerJudge and judge==1 then
return
end
if skill.type == BattleSkillType.Special or skill.type==BattleSkillType.Extra then
role.Event:RemoveEvent(BattleEventName.RoleHit, onHit)
end
end
role.Event:AddEvent(BattleEventName.SkillCast, onSkillCast,nil,nil,role)
role.Event:AddEvent(BattleEventName.SkillCastEnd, onSkillCastEnd,nil,nil,role)
end,
}
return passivityList

View File

@ -57,6 +57,8 @@ function Shield:OnStart()
end)
elseif self.shieldType == ShieldTypeName.ThornsReduce then
self.target.Event:AddEvent(BattleEventName.RoleBeHit,self.onRoleBeHit,nil,nil,self.target)
elseif self.shieldType == ShieldTypeName.ImmuneReduce then
self.target.buffFilter:Add(self.immune0)
end
end
@ -70,7 +72,7 @@ end
function Shield:CountShield(damage, atkRole,skill)
self.atk = atkRole
local isImmuneAllReduceShield=false
local finalDamage = 0
local finalDamage = damage
if self.shieldType == ShieldTypeName.NormalReduce then
if damage < self.shieldValue then
@ -144,7 +146,7 @@ end
-- 提前计算护盾吸收伤害
function Shield:PreCountShield(damage)
local finalDamage = 0
local finalDamage = damage
if self.shieldType == ShieldTypeName.NormalReduce then
if damage > self.shieldValue then
finalDamage = damage - self.shieldValue
@ -198,7 +200,7 @@ function Shield:OnEnd()
end
end
elseif self.shieldType == ShieldTypeName.AllReduce then
elseif self.shieldType == ShieldTypeName.AllReduce or self.shieldType==ShieldTypeName.ImmuneReduce then
-- 移除免疫效果
for i = 1, self.target.buffFilter.size do
if self.target.buffFilter.buffer[i] == self.immune0 then

View File

@ -337,6 +337,7 @@ ShieldTypeName = {
RateReduce = 2, -- 百分比减伤
AllReduce = 3, -- 无敌护盾
ThornsReduce = 5, --反伤盾
ImmuneReduce = 6, --免疫负面效果
}
--额外释放技能
@ -383,7 +384,10 @@ BattleArtFontType = {
clear = 3, --清除文字
Blood = 4, --禁甲文字
}
RoleQueryType = {
NoNodead = 1,--没有不灭
}
BattleMieProp = {
[BattleRoleElementType.REN] = RoleDataName.RenBonus,

View File

@ -284,7 +284,7 @@ function BattleUtil.GetMaxTargetNum(chooseId)
end
--
function BattleUtil.ChooseTarget(role, chooseId)
function BattleUtil.ChooseTarget(role, chooseId,queryType)
local chooseType = floor(chooseId / 100000) % 10
local chooseLimit = floor(chooseId / 10000) % 10
local chooseWeight = floor(chooseId / 100) % 100
@ -293,7 +293,11 @@ function BattleUtil.ChooseTarget(role, chooseId)
local arr
-- 选择类型
if chooseType == 1 then
arr = RoleManager.Query(function (r) return r.camp == role.camp end)
if queryType and queryType==1 then
arr = RoleManager.QueryNoDead(function (r) return r.camp == role.camp end)
else
arr = RoleManager.Query(function (r) return r.camp == role.camp end)
end
elseif chooseType == 2 then
if role.lockTarget and not role.lockTarget:IsRealDead() and not role.lockTarget.isExile and num == 1 then --嘲讽时对单个敌军生效
return {role.lockTarget}

View File

@ -31,8 +31,9 @@ function Monster:Init(data)
self.Event:ClearEvent()
self.exileTargets={}--已经被放逐过的目标
-- self.skillGroup = MSkillManager.CreateMSkillGroup(self, data.skill)
-- self.skillList=data.skill
self.skillNum=#data.skill
self.skillGroupList = {}
for i = 1, #data.skill do
-- LogError("---------------------"..data.skill[i].skillData.effect[1])

View File

@ -7,7 +7,7 @@ function MSkill:New()
return o
end
function MSkill:Init(owner, group, index, skillData)
function MSkill:Init(owner, group, index, skillData,playerSkillIndex)
self.owner = owner
self.group = group
self.groupIndex = index
@ -16,7 +16,15 @@ function MSkill:Init(owner, group, index, skillData)
self.isAdd = false
self.isRage = false
self.type = BattleSkillType.Monster
--后端传过来的数据最后一个是主角技能
if owner.position==100 then
if playerSkillIndex==self.owner.skillNum then
self.isPlayerSkill=true
else
self.isPlayerSkill=false
end
end
self.curCastCount = 0
self.maxCastCount = self.skillData.maxCount
-- LogError("monster skill id=="..skillData.effect[1])

View File

@ -22,7 +22,7 @@ function MSkillGroup:Init(monster, groupIndex, groupData)
-- end
for i = 1, #self.skillGroupData do
self.skillList[i] = MSkillManager.CreateMSkill(monster, self, i, self.skillGroupData[i])
self.skillList[i] = MSkillManager.CreateMSkill(monster, self, i, self.skillGroupData[i],groupIndex)
end
end

View File

@ -25,7 +25,7 @@ function this.CreateMSkillGroup(monster, groupIndex, skillGroupData)
end
-- 创建一个技能
function this.CreateMSkill(monster, group, index, skilldata)
function this.CreateMSkill(monster, group, index, skilldata,groupIndex)
local owner = group:GetOwner()
local groupIndex = group.groupIndex
local position = owner:GetCamp() * 6 + owner:GetPosition()
@ -41,7 +41,7 @@ function this.CreateMSkill(monster, group, index, skilldata)
if not this.MSkillList[position][groupIndex][index] then
this.MSkillList[position][groupIndex][index] = MSkill:New()
end
this.MSkillList[position][groupIndex][index]:Init(monster, group, index, skilldata)
this.MSkillList[position][groupIndex][index]:Init(monster, group, index, skilldata,groupIndex)
return this.MSkillList[position][groupIndex][index]
end

View File

@ -24,6 +24,8 @@ function Skill:Init(role, effectData, type, targets, isAdd, isRage,isTriggerJudg
self.isAdd = isAdd
self.isRage = isRage
self.isNotLoop= false
self.targets={}
self.skillDamage=0
if isTriggerJudge~=nil then
self.isTriggerJudge=isTriggerJudge
else
@ -149,8 +151,9 @@ function Skill:EndSkill()
-- 结束回调
self.isTriggePassivity=false
self.triggerPassivityId={}
self.skillDamage=0
if self.castDoneFunc then self.castDoneFunc() end
self.targets={}
end)
--
self.effectTargets = {}

View File

@ -1,168 +1,228 @@
master_zh_online_special同步数据表2022_03_14_17_38_27
master_zh_test同步数据表2022_03_21_16_48_11
v1.0.109
1.新增神系英雄技能被动
master_zh_test同步数据表2022_03_14_18_15_06
master_zh_test同步数据表2022_03_14_17_24_10
v1.0.108
1.新增429 430 431被动
master_zh_test同步数据表2022_03_08_16_52_49
v1.0.107
1.新增427 428被动
master_zh_test同步数据表2022_03_07_17_48_07
master_zh_test同步数据表2022_03_02_15_24_08
v1.0.106
1.新增425 426被动
master_zh_test同步数据表2022_03_01_15_02_06
v1.0.105
1.新增425 426被动
v1.0.104
1.被动375修改
master_zh_test同步数据表2022_02_22_19_20_35
master_zh_test同步数据表2022_02_22_18_59_21
v1.0.103
1.被动226 423 424修改
master_zh_test同步数据表2022_02_22_10_34_06
master_zh_test同步数据表2022_02_15_15_03_42
v1.0.102
1.效果108修改
2.被动356修改 新增422
master_zh_test同步数据表2022_02_08_14_14_42
v1.0.101
1.修复姑获鸟神魂五对所有人生效的问题
v1.0.100
1.御甲初始化修改
master_zh_test同步数据表2022_01_24_18_51_19
v1.0.99
1.御甲显示修改
v1.0.98
1.被动414修改
master_zh_test同步数据表2022_01_24_10_59_41
master_zh_test同步数据表2022_01_18_15_41_40
v1.0.97
1.护盾buff修改
master_zh_test同步数据表2022_01_17_16_56_13
master_zh_test同步数据表2022_01_17_16_30_59
master_zh_test同步数据表2022_01_15_19_12_17
v1.0.96
1.被动417-421 白金法宝
master_zh_test同步数据表2022_01_11_16_23_47
master_zh_test同步数据表2022_01_10_18_57_57
v1.0.95
1.新增被动414-417
2.添加御甲修改
v1.0.94
1.被动283修改
v1.0.93
1.战斗结束获取队伍剩余角色信息接口修改
master_zh_test同步数据表2021_12_28_09_56_49
master_zh_test同步数据表2021_12_24_18_32_21
v1.0.92
1.新增412被动 56被动修改
master_zh_test同步数据表2021_12_21_18_13_54
v1.0.91
1.护盾buff修改
2.鲸吞魂印修改
v1.0.90
1.被动429 430 431修改
master_zh_online_special同步数据表2022_03_08_14_34_13
v1.0.89
1.被动427 428修改
master_zh_online_special同步数据表2022_03_07_18_33_58
master_zh_online_special同步数据表2022_03_02_15_24_02
v1.0.88
1.被动339修改
master_zh_online_special同步数据表2022_03_01_15_11_26
v1.0.87
1.新增425 426被动
v1.0.86
1.被动375修改
master_zh_online_special同步数据表2022_02_22_19_07_18
v1.0.85
1.被动226 423 424修改
master_zh_online_special同步数据表2022_02_15_15_19_15
v1.0.84
1.效果108修改
2.被动356修改 新增422
master_zh_online_special同步数据表2022_02_08_17_17_46
v1.0.83
1、修复姑获鸟神魂五对所有人生效的问题
v1.0.82
1.御甲初始化数值修改
master_zh_online_special同步数据表2022_01_25_10_12_04
v1.0.81
1.被动414修改
2.御甲显示修改
master_zh_online_special同步数据表2022_01_20_10_06_14
master_zh_online_special同步数据表2022_01_18_17_33_33
master_zh_online_special同步数据表2022_01_18_15_44_08
v1.0.80
1.被动418-421
2.护盾buff修改
master_zh_online_special同步数据表2022_01_13_17_48_10
master_zh_online_special同步数据表2022_01_11_16_41_51
v1.0.79
1.被动413-418
master_zh_online_special同步数据表2022_01_11_16_25_15
v1.0.78
1.被动283修改
v1.0.77
1.战斗结束返回服务器队伍数据接口修改
v1.0.76
1.新增412被动 56被动修改
master_zh_online_special同步数据表2021_12_28_09_54_11
master_zh_online_special同步数据表2021_12_21_18_34_24
v1.0.75
1、鲸吞魂印修改
2. 护盾效果修改
v1.0.74
1、修复RoleManager table.removebyvalue方法空报错
v1.0.73
1、第五期神魂技能
2.第二期变身卡
master_zh_online_special同步数据表2021_12_14_14_27_05
master_zh_online_special同步数据表2021_12_08_13_13_42
v1.0.72
1、被动257修改
2.不灭修改
v1.0.71
1、被动257修改
master_zh_online_special同步数据表2021_12_07_18_07_35
v1.0.70
1、第四期神魂技能
master_zh_online_special同步数据表2021_11_30_17_36_04
v1.0.69
1、第一期变身卡技能
v1.0.68
1、第三期神魂技能
2. 新法宝技能
master_zh_online_special同步数据表2021_11_23_15_58_01
v1.0.67
master_zh_test同步数据表2021_12_14_12_03_26
v1.0.89
1.第五期神魂
2.第二期变身卡
master_zh_test同步数据表2021_12_13_18_06_46
v1.0.88
1.被动257修改
2.不灭修改
v1.0.87
1.被动257修改
master_zh_test同步数据表2021_12_07_17_09_58
master_zh_test同步数据表2021_12_07_16_56_46
v1.0.86
1 战斗驱动逻辑修改 回合转换添加延时减半
2.被动257修改
v1.0.85
1 战斗驱动逻辑修改 回合转换添加延时减半
v1.0.84
1 战斗驱动逻辑修改 回合转换添加延时
master_zh_test同步数据表2021_12_06_19_02_28
v1.0.83
1 第四期神魂添加
master_zh_test同步数据表2021_11_30_12_06_26
v1.0.82
1 目标选择逻辑添加
master_zh_test同步数据表2021_11_29_19_48_14
v1.0.81
1、效果137修改
master_zh_test同步数据表2021_11_27_22_26_12
v1.0.80
1、同步战斗逻辑
master_zh_test同步数据表2021_11_23_11_29_17
v1.0.79
1、被动391修改 我方流血显示修改
master_zh_test同步数据表2021_11_22_18_00_26
v1.0.78
1、被动112 258 360修改提交
2. 伤害公式修改
3.战斗超时 pvp添加战斗类型
v1.0.77
1、第三批神魂提交
v1.0.76
1、修复前后端战斗数据格式不一致导致的结果不一致
master_zh_online_special同步数据表2021_11_16_14_56_55
v1.0.66
1 第二期神魂技能
master_zh_online_special同步数据表2021_11_09_11_57_57
master_zh_online_special同步数据表2021_11_09_11_57_46
master_zh_online_special同步数据表2021_11_02_14_08_41
v1.0.65
1 被动180修改
2. 灵兽检测逻辑初始化修改
master_zh_online_special同步数据表2021_10_26_16_05_44
v1.0.64
1 添加主角技能
2. 被动119修改
master_zh_online_special同步数据表2021_10_19_16_13_17
v1.0.63
master_zh_test同步数据表2021_11_16_11_07_25
v1.0.75
1添加不处理增伤的伤害接口
master_zh_test同步数据表2021_11_15_17_10_47
v1.0.74
1第二期神魂技能
master_zh_test同步数据表2021_11_08_18_01_19
v1.0.73
1被动285修改
master_zh_test同步数据表2021_11_08_17_48_59
v1.0.72
1第一期神魂技能
v1.0.71
1灵兽技能检测添加初始化
2.追加技能特效修改
v1.0.70
1、添加神魂被动技能
master_zh_test同步数据表2021_11_01_14_07_31
master_zh_test同步数据表2021_10_26_10_10_26
master_zh_test同步数据表2021_10_25_18_57_36
v1.0.69
1、战斗公式修改
master_zh_test同步数据表2021_10_22_18_57_18
v1.0.68
1、添加主角技能
2. 被动199修改
master_zh_test同步数据表2021_10_18_11_00_42
master_zh_test同步数据表2021_10_16_19_07_28
master_zh_test同步数据表2021_10_16_19_06_48
v1.0.67
1、被动344添加空判断
2. 战斗力公式修改
master_zh_online_special同步数据表2021_10_12_15_59_00
master_zh_online_special同步数据表2021_10_12_15_58_52
master_zh_online_special同步数据表2021_10_12_10_26_03
master_zh_online_special同步数据表2021_10_11_19_54_13
master_zh_online_special同步数据表2021_10_11_19_53_59
v1.0.62
1、被动116 258 281 312 344 250312353 351 137修改
master_zh_test同步数据表2021_10_12_15_58_23
master_zh_test同步数据表2021_10_12_10_25_47
master_zh_test同步数据表2021_10_11_18_25_43
v1.0.66
1、被动312修改
master_zh_test同步数据表2021_10_09_18_47_41
master_zh_test同步数据表2021_10_09_18_46_50
v1.0.65
1、被动116 258 281 312 344 250修改
2. 精卫借的怒气不会回复怒气
3. 添加不处理增伤被动的方法
master_zh_test同步数据表2021_09_28_17_45_03
v1.0.64
1、353 351 137 被动修改
2. 添加获取没有出发不灭的目标
master_zh_test同步数据表2021_09_27_18_41_38
v1.0.63
1、353被动修改
v1.0.62
1、添加御甲buff
2.添加最后一期紫府神印,添加白金装备被动 觉醒被动修改
master_zh_test同步数据表2021_09_26_20_35_14
master_zh_test同步数据表2021_09_18_21_14_36
master_zh_test同步数据表2021_09_18_18_42_35
v1.0.61
1.同步客户端逻辑
master_zh_online_special同步数据表2021_09_28_18_03_42
master_zh_online_special同步数据表2021_09_28_14_34_53
master_zh_online_special同步数据表2021_09_18_21_22_03
v1.0.60
1、技能是否能释放 添加是否有技能目标判断
2.被动196 200 188 修改
master_zh_online_special同步数据表2021_09_16_20_56_10
master_zh_online_special同步数据表2021_09_16_19_56_58
master_zh_online_special同步数据表2021_09_15_16_43_43
master_zh_online_special同步数据表2021_09_15_15_58_04
master_zh_online_special同步数据表2021_09_15_15_55_26
master_zh_online_special同步数据表2021_09_14_15_45_21
master_zh_online_special同步数据表2021_09_14_13_07_13
master_zh_test同步数据表2021_09_17_16_21_53
master_zh_test同步数据表2021_09_15_20_05_28
master_zh_test同步数据表2021_09_15_14_23_26
master_zh_test同步数据表2021_09_14_15_46_46
master_zh_test同步数据表2021_09_14_11_51_05
v1.0.60
1、被动56修改
master_zh_test同步数据表2021_09_11_18_04_19
v1.0.59
1、被动56修改 被动261 修改
master_zh_online_special同步数据表2021_09_14_11_32_16
master_zh_online_special同步数据表2021_09_14_11_26_22
1、被动261 修改
master_zh_test同步数据表2021_09_10_18_24_51
v1.0.58
1、修复方法缺失报错
v1.0.57
1、尝试修复孙悟空大招不会增加伤害的问题
2、添加用于debug的log
master_zh_online_special同步数据表2021_09_07_10_58_24
master_zh_test同步数据表2021_09_07_11_00_31
v1.0.56
1.选生命百分比最少目标逻辑修改 去掉有不灭单位
2. 死亡不把怒气显示清空
3.被动99 307 选目标逻辑修改
master_zh_online_special同步数据表2021_09_03_15_16_49
2. 死亡不把怒气显示清空
3.被动99 307 选目标逻辑修改
v1.0.55
1. 被动263 269 274 332 112 145 修改
2. 添加战斗日志
master_zh_online_special同步数据表2021_08_28_19_41_53
1.被动263 269 274 332 112 145 修改
2. 添加战斗日志
v1.0.54
1. 被动91 被动115 160修改
2. Dot类buff清除逻辑修改
master_zh_online_special同步数据表2021_08_24_14_58_11
v1.0.53
2. Dot类buff清除逻辑修改
master_zh_test同步数据表2021_08_27_18_25_18
master_zh_test同步数据表2021_08_21_16_34_06
v1.0.54
1. 被动141 310 283 330 336修改
master_zh_online_special同步数据表2021_08_03_10_38_57
master_zh_test同步数据表2021_08_02_19_27_29
v1.0.53
1. 随机种子修改
master_zh_test同步数据表2021_07_31_17_55_16
master_zh_test同步数据表2021_07_31_17_54_20
v1.0.52
1. 死亡技能不受控制影响
2.战斗随机种子修改
master_zh_online_special同步数据表2021_07_28_08_34_36
1. 死亡技能不会被控制
2.追加技能是否触发特性修改
master_zh_test同步数据表2021_07_26_11_10_56
v1.0.51
1. 被动292修改
master_zh_online_special同步数据表2021_07_16_19_57_49
1. 被动292 修改
v1.0.50
1. 被动292 319修改
master_zh_test同步数据表2021_07_13_18_19_09
master_zh_test同步数据表2021_07_10_20_33_05
v1.0.49
1. 同步客户端逻辑
master_zh_online_special同步数据表2021_07_13_18_14_42
master_zh_online_special同步数据表2021_07_06_17_33_58
v1.0.48
1. 新增紫府神印被动效果
v1.0.47
1. 新增英雄觉醒被动 及 困难副本被动 效果
master_zh_online_special同步数据表2021_06_30_07_33_07
master_zh_test同步数据表2021_06_30_07_33_23
master_zh_test同步数据表2021_06_28_13_40_30
v1.0.46
1、同步数据表
v1.0.45

View File

@ -37,8 +37,9 @@ public class CarDelayFunction implements FunctionManager {
String guildKey = RedisUtil.getInstence().getKey(guildRank.getRedisKey(), "");
String crossKey = RedisUtil.getInstence().getKey(personRank.getCrossRedisKey(), "",false);
String crossGuildKey = RedisUtil.getInstence().getKey(guildRank.getCrossRedisKey(), "",false);
String carPeopleNum = RedisUtil.getInstence().getKey(RedisKey.CAR_DEALY_GUILD_FIGHT_PEOPLE_NUM,"");
String[] delKeys = {key,guildKey,crossKey,crossGuildKey};
String[] delKeys = {key,guildKey,crossKey,crossGuildKey,carPeopleNum};
RedisUtil.getInstence().rename(60*60*16, backName, delKeys);
// String userLevelGuild = RedisUtil.getInstence().getKey(RedisKey.USER_LEVEL_GUILD_INFO, "");
// delKeys.add(userLevelGuild);

View File

@ -310,6 +310,7 @@ public class RedisKey {
// 车迟斗法
public static final String CAR_DEALY_RANK = "CAR_DEALY_RANK";
public static final String CAR_DEALY_GUILD_RANK = "CAR_DEALY_GUILD_RANK";
public static final String CAR_DEALY_GUILD_FIGHT_PEOPLE_NUM = "CAR_DEALY_GUILD_FIGHT_PEOPLE_NUM";
//公会战进攻获得星数排行榜
public static final String FAMILY_FIGHT_STAR_RANK = "FAMILY_FIGHT_STAR_RANK";

View File

@ -2,12 +2,14 @@ package com.ljsd.jieling.handler;
import com.ljsd.GameApplication;
import com.ljsd.fight.FightType;
import com.ljsd.jieling.core.FunctionIdEnum;
import com.ljsd.jieling.db.redis.RedisKey;
import com.ljsd.jieling.db.redis.RedisUtil;
import com.ljsd.jieling.exception.ErrorCode;
import com.ljsd.jieling.exception.ErrorCodeException;
import com.ljsd.jieling.ktbeans.ReportEventEnum;
import com.ljsd.jieling.ktbeans.ReportUtil;
import com.ljsd.jieling.logic.GlobalDataManaager;
import com.ljsd.jieling.logic.GlobleSystemLogic;
import com.ljsd.jieling.logic.activity.crossService.CrossServiceLogic;
import com.ljsd.jieling.logic.dao.*;
@ -36,6 +38,7 @@ import rpc.protocols.FightInfoProto;
import rpc.protocols.MessageTypeProto;
import util.TimeUtils;
import java.util.HashSet;
import java.util.List;
@Component
@ -54,6 +57,12 @@ public class FastChallengeHandler extends BaseHandler<FightInfoProto.FastFightCh
GuildInfo guildInfo;
int privilege;
int teamId = TeamEnum.CAR_DELAY_TEAM.getTeamId();
TimeControllerOfFunction controller = GlobalDataManaager.getInstance().getTimeControllerOfFunctionByFunctinoType(FunctionIdEnum.Car_Delay);
if (controller == null){
throw new ErrorCodeException(ErrorCode.ACTIVITY_NOT_OPEN);
}
if(type == 1 || type == 2){
guildInfo = GuilidManager.guildInfoMap.get(user.getPlayerInfoManager().getGuildId());
if(guildInfo == null){
@ -88,13 +97,12 @@ public class FastChallengeHandler extends BaseHandler<FightInfoProto.FastFightCh
int challengeId = proto.getChalleageId();
int battleRound = sWorldBossSetting.getBattleRound();
CommonProto.FightData fightData;
boolean isNew = !guildInfo.getCarFightSb().containsKey(uid);
int crossGroup = GlobleSystemLogic.getInstence().getCrossGroup();
AbstractRank personRank = RankContext.getRankEnum(RankEnum.CAR_DEALY_RANK.getType());
AbstractRank guildRank = RankContext.getRankEnum(RankEnum.CAR_DEALY_GUILD_RANK.getType());
switch (type){
case 1:{
case 1:{//挑战
int monsterId = STableManager.getConfig(SWorldBossConfig.class).get(GuildFightLogic.carDelayProgressIndication.getBossIndexId()).getMonsterId();
PVEFightEvent pvpFightEvent = new PVEFightEvent(uid,teamId, battleRound,"", GameFightType.CarBossChallenge,monsterId,3);
FightResult fightResult = FightDispatcher.dispatcher(pvpFightEvent);
@ -108,15 +116,15 @@ public class FastChallengeHandler extends BaseHandler<FightInfoProto.FastFightCh
if(hurt!=0){
if (crossGroup > 0){
personRank.incrementCrossRankScore(uid,"",gainScore);
guildRank.incrementCrossRankScore(guildInfo.getId(),"",gainScore,isNew?1:0);
guildRank.incrementCrossRankScore(guildInfo.getId(),"",gainScore);
}else {
personRank.incrementRankScore(uid,"",gainScore);
guildRank.incrementRankScore(guildInfo.getId(),"",gainScore,isNew?1:0);
guildRank.incrementRankScore(guildInfo.getId(),"",gainScore);
}
}
user.getUserMissionManager().onGameEvent(user, GameEvent.CAR_PLAY,1);
}break;
case 2:{
case 2:{//抢夺
FightResult fightResult;
String challengeName;
String challengeNameColor;
@ -169,16 +177,16 @@ public class FastChallengeHandler extends BaseHandler<FightInfoProto.FastFightCh
if (crossGroup > 0){
personRank.incrementCrossRankScore(uid,"",gainScore);
personRank.incrementCrossRankScore(challengeId,"",-gainScore);
guildRank.incrementCrossRankScore(guildInfo.getId(),"",gainScore,isNew?1:0);
guildRank.incrementCrossRankScore(guildInfo.getId(),"",gainScore);
if(challengeGuild!=0){
guildRank.incrementCrossRankScore(challengeGuild,"",-gainScore,0);
guildRank.incrementCrossRankScore(challengeGuild,"",-gainScore);
}
}else {
personRank.incrementRankScore(uid,"",gainScore);
personRank.incrementRankScore(challengeId,"",-gainScore);
guildRank.incrementRankScore(guildInfo.getId(),"",gainScore,isNew?1:0);
guildRank.incrementRankScore(guildInfo.getId(),"",gainScore);
if(challengeGuild!=0){
guildRank.incrementRankScore(challengeGuild,"",-gainScore,0);
guildRank.incrementRankScore(challengeGuild,"",-gainScore);
}
}
}
@ -244,6 +252,9 @@ public class FastChallengeHandler extends BaseHandler<FightInfoProto.FastFightCh
}
// 公会人数处理
carDealyFightPeopleNum(uid,guildInfo.getId());
CrossServiceLogic.getInstance().saveBasicPlayerToRedis(user);
fightData.toBuilder().setFightId(FightUtil.getFightId(uid,fightData.getFightType()));
@ -253,11 +264,28 @@ public class FastChallengeHandler extends BaseHandler<FightInfoProto.FastFightCh
//扣除次数
PlayerLogic.getInstance().checkAndUpdate(user, privilege, 1);
guildInfo.addCarFightSb(uid);
user.getGuildMyInfo().setCarPlayTime(TimeUtils.nowInt());
user.getGuildMyInfo().setCarPlayProgress(GuildFightLogic.carDelayProgressIndication.getProgress());
FightInfoProto.FastFightChallengeResponse build = FightInfoProto.FastFightChallengeResponse.newBuilder().setHurt(hurt).setScore((long) gainScore).setFightData(fightData).build();
MessageUtil.sendMessage(iSession,1, MessageTypeProto.MessageType.FAST_FIGHT_CHALLENGE_RESPONSE_VALUE,build,true);
ReportUtil.onReportEvent(user, ReportEventEnum.COMPLETE_CHECHI.getType(),sWorldBossSetting.getid(),type,1,gainScore);
}
/**
*
* @param uid
* @param guildId
* @return
*/
public static int carDealyFightPeopleNum(int uid, int guildId){
HashSet value = RedisUtil.getInstence().getMapValue(RedisKey.CAR_DEALY_GUILD_FIGHT_PEOPLE_NUM, "", String.valueOf(guildId), HashSet.class);
if (value == null){
value = new HashSet();
}
if (!value.contains(uid) && uid != 0){
value.add(uid);
RedisUtil.getInstence().putMapEntry(RedisKey.CAR_DEALY_GUILD_FIGHT_PEOPLE_NUM, "", String.valueOf(guildId),value);
}
return value.size();
}
}

View File

@ -19,6 +19,8 @@ import com.ljsd.jieling.logic.fight.GameFightType;
import com.ljsd.jieling.logic.fight.PVEFightEvent;
import com.ljsd.jieling.logic.fight.result.FightResult;
import com.ljsd.jieling.logic.hero.HeroLogic;
import com.ljsd.jieling.logic.mission.GameEvent;
import com.ljsd.jieling.logic.mission.MissionType;
import com.ljsd.jieling.logic.player.PlayerLogic;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.thrift.idl.CrossArenaManager;
@ -35,7 +37,7 @@ import java.util.List;
import java.util.Map;
public class ExplorerMapEventHandler extends BaseHandler<PlayerInfoProto.ExplorerMapEventRequest> {
public class ExplorerMapEventHandler extends BaseHandler<PlayerInfoProto.ExplorerMapEventRequest> {
@Override
public MessageTypeProto.MessageType getMessageCode() {
@ -49,31 +51,36 @@ public class ExplorerMapEventHandler extends BaseHandler<PlayerInfoProto.Explor
if (user == null) {
return;
}
PlayerInfoProto.ExplorerMapEventResponse.Builder builder = PlayerInfoProto.ExplorerMapEventResponse.newBuilder();
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.ExplorerMapEventResponse.getNumber(), builder.build(), true);
/* int id = proto.getId();
PlayerInfoProto.ExplorerMapEventResponse.Builder builder = PlayerInfoProto.ExplorerMapEventResponse.newBuilder();
int id = proto.getId();
Map<Integer, SExploreEvent> exploreEventConfig = STableManager.getConfig(SExploreEvent.class);
if(!exploreEventConfig.containsKey(id)){
if (!exploreEventConfig.containsKey(id)) {
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.ExplorerMapEventResponse.getNumber(), builder.build(), true);
return;
}
List<KeyVal> eventList = user.getPlayerInfoManager().getExploreEvent();
int index = 0;
for(int i =0;i<eventList.size();i++){
if(index == 0 && eventList.get(i).getKey() == id){
boolean isGetIndex = false;
for (int i = 0; i < eventList.size(); i++) {
if (index == 0 && eventList.get(i).getKey() == id) {
index = i;
isGetIndex = true;
}
if(index != 0 && eventList.get(i).getKey() == id){
if(eventList.get(i).getVal()<eventList.get(index).getVal()){
if (index != 0 && eventList.get(i).getKey() == id) {
if (eventList.get(i).getVal() < eventList.get(index).getVal()) {
index = i;
isGetIndex = true;
}
}
}
*//* 1兽潮
if(!isGetIndex){
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.ExplorerMapEventResponse.getNumber(), builder.build(), true);
return;
}
/* 1
2
3*//*
if(exploreEventConfig.get(id).getType() == 1){
3*/
if (exploreEventConfig.get(id).getType() == 1) {
PVEFightEvent pveFightEvent = new PVEFightEvent(user.getId(), TeamEnum.EXPLORE_EVENT_TEAM.getTeamId(), 20, "",
GameFightType.ExploreShouChaoFight, exploreEventConfig.get(id).getMonsterGroup(), 3);
FightResult fightResult = FightDispatcher.dispatcher(pveFightEvent);
@ -82,28 +89,32 @@ public class ExplorerMapEventHandler extends BaseHandler<PlayerInfoProto.Explor
.setFightSeed(fightResult.getSeed())
.setHeroFightInfos(fightResult.getFightTeamInfo())
.addAllMonsterList(fightResult.getMonsterTeamList())
.setFightType(FightType.CrossLingMaiSecretFight.getType())
.setFightId(FightUtil.getFightId(user.getId(), FightType.CrossLingMaiSecretFight.getType()))
.setFightType(FightType.ExploreShouChao.getType())
.setFightId(FightUtil.getFightId(user.getId(), FightType.ExploreShouChao.getType()))
.build();
builder.setFightData(fightData);
builder.setFightResult(fightResult.getResult());
CommonProto.Drop.Builder drop = ItemUtil.drop(user, new int[]{exploreEventConfig.get(id).getRewardGroup()}, 1, 0, BIReason.EXPLORE_EVENT_MONSTER);
builder.setDrop(drop);
}else if(exploreEventConfig.get(id).getType() == 2){
if ((int) fightResult.getCheckResult()[0] == 1) {
user.getUserMissionManager().onGameEvent(user, GameEvent.EXPLORE, MissionType.EXPLORE_REPELMONSTER_NUM,
1);
}
} else if (exploreEventConfig.get(id).getType() == 2) {
int defUid = user.getPlayerInfoManager().getExploreEventMatchDefUid();
CSPlayer csPlayer = CrossServiceLogic.getPlayerByRedis(defUid);
if (csPlayer == null){
if (csPlayer == null) {
throw new ErrorCodeException(ErrorCode.USE_NOT_EXIT);
}
CrossArenaManager crossArenaManager = null;
if(GameApplication.serverId != csPlayer.getServerId()){
if (GameApplication.serverId != csPlayer.getServerId()) {
crossArenaManager = PlayerLogic.getInstance().getCrossArenaManagerData(csPlayer);
}
CommonProto.FightTeamInfo fightTeamInfo = FightUtil.makePersonFightData(user,TeamEnum.EXPLORE_EVENT_TEAM.getTeamId(), null, null);
CommonProto.FightTeamInfo fightTeamInfo = FightUtil.makePersonFightData(user, TeamEnum.EXPLORE_EVENT_TEAM.getTeamId(), null, null);
CommonProto.FightTeamInfo defteamInfo = FightUtil.makeCrossPersonData(csPlayer, TeamEnum.FORMATION_NORMAL.getTeamId(), null, crossArenaManager);
int myforce = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.FORMATION_NORMAL.getTeamId(), false);
int myforce = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.EXPLORE_EVENT_TEAM.getTeamId(), false);
FightResult fightResult = GetWorldArenaChallengeRequestHandler.getFightForPVP(uid, defUid,
fightTeamInfo, defteamInfo, FightUtil.getFightSeed(), myforce< csPlayer.getMainLineForce(),FightType.ExploreXinMo);
fightTeamInfo, defteamInfo, FightUtil.getFightSeed(), myforce < csPlayer.getMainLineForce(), FightType.ExploreXinMo);
int seed = fightResult.getSeed();
CommonProto.FightData fightData = CommonProto.FightData.newBuilder()
.setFightMaxTime(SArenaSetting.getSArenaSetting().getMostTime())
@ -114,15 +125,21 @@ public class ExplorerMapEventHandler extends BaseHandler<PlayerInfoProto.Explor
.setFightId(FightUtil.getFightId(uid, FightType.ExploreXinMo.getType()))
.build();
builder.setFightData(fightData);
builder.setFightResult( (int) fightResult.getCheckResult()[0]);
builder.setFightResult((int) fightResult.getCheckResult()[0]);
CommonProto.Drop.Builder drop = ItemUtil.drop(user, new int[]{exploreEventConfig.get(id).getRewardGroup()}, 1, 0, BIReason.EXPLORE_EVENT_MONSTER);
builder.setDrop(drop);
}else if(exploreEventConfig.get(id).getType() == 3){
if ((int) fightResult.getCheckResult()[0] == 1) {
user.getUserMissionManager().onGameEvent(user, GameEvent.EXPLORE, MissionType.EXPLORE_REPELXINMO_NUM,
1);
}
} else if (exploreEventConfig.get(id).getType() == 3) {
CommonProto.Drop.Builder drop = ItemUtil.drop(user, new int[]{exploreEventConfig.get(id).getRewardGroup()}, 1, 0, BIReason.EXPLORE_EVENT_BOX);
builder.setDrop(drop);
user.getUserMissionManager().onGameEvent(user, GameEvent.EXPLORE, MissionType.EXPLORE_PICKYM_NUM,
1);
}
eventList.remove(index);
user.getPlayerInfoManager().setExploreEvent(eventList);
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.ExplorerMapEventResponse.getNumber(), builder.build(), true);*/
}
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.ExplorerMapEventResponse.getNumber(), builder.build(), true);
}
}

View File

@ -11,12 +11,15 @@ import com.ljsd.jieling.logic.hero.HeroLogic;
import com.ljsd.jieling.logic.player.PlayerLogic;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.util.MessageUtil;
import config.SExploreEvent;
import manager.STableManager;
import org.springframework.data.redis.core.ZSetOperations;
import rpc.protocols.MessageTypeProto;
import rpc.protocols.PlayerInfoProto;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class ExplorerMapEventXMBeforeBattleHandler extends BaseHandler<PlayerInfoProto.ExplorerXMEventChallengeBeforeRequest> {
@ -33,20 +36,31 @@ public class ExplorerMapEventXMBeforeBattleHandler extends BaseHandler<PlayerIn
return;
}
PlayerInfoProto.ExplorerXMEventChallengeBeforeResponse.Builder builder = PlayerInfoProto.ExplorerXMEventChallengeBeforeResponse.newBuilder();
int eventId = proto.getEventId();
Map<Integer, SExploreEvent> exploreEventConfig = STableManager.getConfig(SExploreEvent.class);
if(!exploreEventConfig.containsKey(eventId)){
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.ExplorerXMEventChallengeBeforeResponse.getNumber(), builder.build(), true);
return;
}
int crossGroup = GlobleSystemLogic.getInstence().getCrossGroup();
String key = RedisUtil.getInstence().getKey(RedisKey.FORCE_CURR_RANK,String.valueOf(crossGroup),false);
Set<ZSetOperations.TypedTuple<String>> forceZetSort = RedisUtil.getInstence().getAllZsetRange(key);
int force = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.FORMATION_NORMAL.getTeamId(), false);
final int forcelimit = force+force*500/10000;
int force = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.EXPLORE_EVENT_TEAM.getTeamId(), false);
int forceRange = exploreEventConfig.get(eventId).getForceRange();
final int forcelimit = force+force*forceRange/10000;
int matchUid = forceZetSort.stream().filter(n -> n.getScore() >= forcelimit).map(v -> Integer.parseInt(v.getValue())).findAny().orElse(0);
if(matchUid == 0){
List<ZSetOperations.TypedTuple<String>> lst = new ArrayList<ZSetOperations.TypedTuple<String>>(forceZetSort); //
if(lst.size()>0){
matchUid = Integer.parseInt(lst.get(0).getValue());
}else{
matchUid = uid; //自己镜像
}
}
//TODO
matchUid=10052935;
//matchUid=10052935;
//matchUid=10061221;
//matchUid=10052631;
user.getPlayerInfoManager().setExploreEventMatchDefUid(matchUid);
List<Integer> team = new ArrayList<>();
//new ArrayList<Integer>(TeamEnum.FORMATION_NORMAL.getTeamId())

View File

@ -1,14 +1,16 @@
package com.ljsd.jieling.handler.explorerMap;
import com.ljsd.jieling.handler.BaseHandler;
import com.ljsd.jieling.logic.activity.event.ExploreEvent;
import com.ljsd.jieling.logic.dao.ExplorerInfo;
import com.ljsd.jieling.logic.dao.KeyVal;
import com.ljsd.jieling.logic.dao.TeamEnum;
import com.ljsd.jieling.logic.dao.UserManager;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.mission.main.ExploreMissionType;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.util.MessageUtil;
import config.SExploreTask;
import manager.STableManager;
import rpc.protocols.CommonProto;
import rpc.protocols.MessageTypeProto;
import rpc.protocols.PlayerInfoProto;
@ -16,6 +18,7 @@ import rpc.protocols.PlayerInfoProto;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class ExplorerMapInfoHandler extends BaseHandler<PlayerInfoProto.ExplorerMapInfoRequest> {
@Override
@ -30,6 +33,16 @@ public class ExplorerMapInfoHandler extends BaseHandler<PlayerInfoProto.Explorer
if (user == null) {
return;
}
ExploreMissionType exploreMissionType = user.getUserMissionManager().getExploreMissionType();
if (exploreMissionType.getDoingMissionIds().size() == 0 && exploreMissionType.getFinishMissionIds().size() == 0
&& exploreMissionType.getRewardedMissionIds().size() == 0) {
Set<Integer> arro = STableManager.getConfig(SExploreTask.class).keySet();
exploreMissionType.getDoingMissionIds().clear();
exploreMissionType.getFinishMissionIds().clear();
exploreMissionType.getRewardedMissionIds().clear();
exploreMissionType.getDoingMissionIds().addAll(arro);
user.getUserMissionManager().updateString("exploreMissionType", exploreMissionType);
}
PlayerInfoProto.ExplorerMapInfoResponse.Builder builder = PlayerInfoProto.ExplorerMapInfoResponse.newBuilder();
Map<Integer, ExplorerInfo> explorer = user.getPlayerInfoManager().getExplorer();
for (int i = TeamEnum.EXPLORE_TEAM_ONE.getTeamId(); i <= TeamEnum.EXPLORE_TEAM_FIVE.getTeamId(); i++) {
@ -48,7 +61,7 @@ public class ExplorerMapInfoHandler extends BaseHandler<PlayerInfoProto.Explorer
}
List<KeyVal> event = user.getPlayerInfoManager().getExploreEvent();
for(KeyVal keyVal:event){
for (KeyVal keyVal : event) {
builder.addRandEvent(CommonProto.CommKeyVal.newBuilder().setKey(keyVal.getKey()).setVal(keyVal.getVal()).
setVal2(keyVal.getVa2()).build());
}

View File

@ -68,9 +68,7 @@ public class ExplorerMapSendHandler extends BaseHandler<PlayerInfoProto.Explorer
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.ExplorerMapSendResponse.getNumber(), builder.build(), true);
return;
}
user.getUserMissionManager().onGameEvent(user, GameEvent.EXPLORE, MissionType.EXPLORE_FOOD_NUM,
map.values().stream().mapToInt(Integer::intValue).sum());
//user.getUserMissionManager().onGameEvent(user, GameEvent.EXPLORE, MissionType.EXPLORE_FOOD_NUM, map.values().stream().mapToInt(Integer::intValue).sum());
for (CommonProto.ExplorerMapSendInfo info : reqInfo) {
int mapId = info.getMapId();
int teamId = info.getTeamId();

View File

@ -496,6 +496,10 @@ public class UserMissionManager extends MongoBase {
endlessMissionType.rewardMission((int)parm[0], missionTypeEnumListMap.get(GameMisionType.ENDLESS_MISSION));
updateString("endlessMissionType",endlessMissionType);
}
case EXPLORE_REWARD:{
exploreMissionType.rewardMission((int)parm[0], missionTypeEnumListMap.get(GameMisionType.EXPLORE));
updateString("exploreMissionType",exploreMissionType);
}
break;
default:
break;

View File

@ -9,7 +9,6 @@ import com.ljsd.jieling.globals.Global;
import com.ljsd.jieling.logic.GlobleSystemLogic;
import com.ljsd.jieling.logic.OnlineUserManager;
import com.ljsd.jieling.logic.activity.ActivityLogic;
import com.ljsd.jieling.logic.activity.ActivityType;
import com.ljsd.jieling.logic.activity.ActivityTypeEnum;
import com.ljsd.jieling.logic.activity.crossService.CrossServiceLogic;
import com.ljsd.jieling.logic.activity.event.ExploreEvent;
@ -119,11 +118,11 @@ public class ExplorerMapLogic {
explorerInfo.setPlayerHp(explorerInfo.getPlayerHp() - reducePlayer);
explorerInfo.setEnemyHp(0);
LOGGER.info("{}玩家掉血:=》{},剩余血量-》{}", user.getId(), reducePlayer, explorerInfo.getPlayerHp());
LOGGER.info("{}玩家赢了 怪物死 怪物走复活逻辑=>{} 掉落组=>{}",user.getId(), explorerInfo.getEnemyReliveTime(), exploreConfig.getReward());
LOGGER.info("{}玩家赢了 怪物死 怪物走复活逻辑=>{} 掉落组=>{}", user.getId(), explorerInfo.getEnemyReliveTime(), exploreConfig.getReward());
//活动是否开启
Set<Integer> openActivityIdsByType = ActivityLogic.getInstance().getOpenActivityIdsByType(user, ActivityTypeEnum.EXPLORE_EXPECT_ACTIVITY.getType(), false);
//if (ActivityLogic.checkActivityOpen(user, ActivityType.EXPLORE_EXPECT_ACTIVITY)) {
if(openActivityIdsByType.size()>0){
if (openActivityIdsByType.size() > 0) {
//同个工会 死亡计数
int guildId = user.getPlayerInfoManager().getGuildId();
if (guildId != 0) {
@ -133,7 +132,7 @@ public class ExplorerMapLogic {
Poster.getPoster().dispatchEvent(new ExploreEvent(user.getId(), 1));
Set<Integer> allUid = new HashSet<>();
allUid.addAll(guildInfo.getMembers().get(GlobalsDef.CHAIRMAN));
if(guildInfo.getMembers().get(GlobalsDef.MEMBER)!=null){
if (guildInfo.getMembers().get(GlobalsDef.MEMBER) != null) {
allUid.addAll(guildInfo.getMembers().get(GlobalsDef.MEMBER));
}
for (int uid : allUid) {
@ -161,7 +160,7 @@ public class ExplorerMapLogic {
}
//玩家死亡 设置重生时间
if (explorerInfo.getPlayerHp() == 0) {
explorerInfo.setDeathNum(explorerInfo.getDeathNum()+1);
explorerInfo.setDeathNum(explorerInfo.getDeathNum() + 1);
int reliveTime = SSpecialConfig.getIntegerValue(SSpecialConfig.EXPLORERE_LIVETIME);
if (time == 0) {
explorerInfo.setPlayerReliveTime(TimeUtils.nowInt() + reliveTime);
@ -172,16 +171,15 @@ public class ExplorerMapLogic {
}
//怪物死亡 设置重生时间
if (explorerInfo.getEnemyHp() == 0) {
explorerInfo.setKillNum(explorerInfo.getKillNum()+1);
explorerInfo.setKillNum(explorerInfo.getKillNum() + 1);
if (time == 0) {
explorerInfo.setEnemyReliveTime(TimeUtils.nowInt() + exploreConfig.getBattleInterval());
} else {
explorerInfo.setEnemyReliveTime(time + exploreConfig.getBattleInterval());
}
LOGGER.info("{}怪物死亡=》重生时间{}", user.getId(), explorerInfo.getEnemyReliveTime());
//RankEnum.toRank(RankEnum.EXPLORE_RANK.getType()).addRank(user.getId(),"",1);
//user.getUserMissionManager().onGameEvent(user, GameEvent.EXPLORE, MissionType.EXPLORE_ENEMY_NUM);
RankEnum.toRank(RankEnum.EXPLORE_RANK.getType()).incrementRankScore(user.getId(), "", 1);
//user.getUserMissionManager().onGameEvent(user, GameEvent.EXPLORE, MissionType.EXPLORE_ENEMY_NUM,1);
}
if (time == 0) {
@ -222,6 +220,45 @@ public class ExplorerMapLogic {
.build();
}
public static void sendRandomEvent(User user) {
ISession sess = OnlineUserManager.sessionMap.get(user.getId());
Map<Integer, SExplore> config = STableManager.getConfig(SExplore.class);
Map<Integer, SExploreEvent> exploreEventConfig = STableManager.getConfig(SExploreEvent.class);
List<SExplore> limitConfig = config.values().stream().filter(n -> n.getLevel() <= user.getPlayerInfoManager().getLevel()).collect(Collectors.toList());
Random random = new Random();
int randomMapId = random.nextInt(limitConfig.size());
SExplore rankExplore = limitConfig.get(randomMapId);
int randomEventId = random.nextInt(rankExplore.getEventList().length);
int eventId = rankExplore.getEventList()[randomEventId];
LOGGER.info("explore add eventId:" + eventId + " randomMapId: " + randomMapId+1);
user.getPlayerInfoManager().addExploreEvent(new KeyVal(eventId, TimeUtils.nowInt() + exploreEventConfig.get(eventId).getTime(), randomMapId + 1));
PlayerInfoProto.ExplorerMapIndicationResponse.Builder indication = PlayerInfoProto.ExplorerMapIndicationResponse.newBuilder();
List<KeyVal> event = user.getPlayerInfoManager().getExploreEvent();
//删除过期的
if(event.removeIf(n->n.getVal() < TimeUtils.nowInt())){
user.getPlayerInfoManager().setExploreEvent(event);
}
for (KeyVal keyVal : event) {
indication.addRandEvent(CommonProto.CommKeyVal.newBuilder().setKey(keyVal.getKey()).setVal(keyVal.getVal()).
setVal2(keyVal.getVa2()).build());
}
MessageUtil.sendIndicationMessage(sess, 1, MessageTypeProto.MessageType.ExplorerMapIndicationResponse_VALUE, indication.build(), true);
}
public static void sendDisappearEvent(User user){
ISession sess = OnlineUserManager.sessionMap.get(user.getId());
List<KeyVal> event = user.getPlayerInfoManager().getExploreEvent();
if(event.removeIf(n->n.getVal() < TimeUtils.nowInt())){
user.getPlayerInfoManager().setExploreEvent(event);
PlayerInfoProto.ExplorerMapIndicationResponse.Builder indication = PlayerInfoProto.ExplorerMapIndicationResponse.newBuilder();
for (KeyVal keyVal : event) {
indication.addRandEvent(CommonProto.CommKeyVal.newBuilder().setKey(keyVal.getKey()).setVal(keyVal.getVal()).
setVal2(keyVal.getVa2()).build());
}
MessageUtil.sendIndicationMessage(sess, 1, MessageTypeProto.MessageType.ExplorerMapIndicationResponse_VALUE, indication.build(), true);
}
}
public void calOfflineReward(User user) throws Exception {
//计算离线奖励
Map<Integer, ExplorerInfo> explorer = user.getPlayerInfoManager().getExplorer();
@ -249,6 +286,12 @@ public class ExplorerMapLogic {
continue;
}
LOGGER.info("离线玩家队伍id", keyVal.getKey());
//探索事件
/*long gapDay = TimeUtils.getGapDaysByTwoTime(TimeUtils.getTimeStamp2(keyVal.getValue().getBatteTime()*1000L), TimeUtils.getTimeStamp2(offlineEndTime*1000L));
for(int i = 0;i< gapDay;i++){
LOGGER.error("gapDay------------------------>{}",i);
sendRandomEvent(user);
}*/
for (int i = keyVal.getValue().getBatteTime(); i <= offlineEndTime; i = i + battleInterval) {
//复活玩家
if (keyVal.getValue().getPlayerHp() == 0 && keyVal.getValue().getPlayerReliveTime() <= i) {
@ -279,21 +322,13 @@ public class ExplorerMapLogic {
long now = TimeUtils.now();
for (int uid : uids) {
User user = UserManager.getUser(uid);
if(user == null){
if (user == null) {
continue;
}
//登录一分钟后才执行 避免消息线程和分钟线程同时修改数据
if(now < user.getPlayerInfoManager().getLoginTime()+60000){
if (now < user.getPlayerInfoManager().getLoginTime() + 60000) {
continue;
}
//整点刷出随机事件
/*Calendar calendar = Calendar.getInstance();
int minute = calendar.get(Calendar.MINUTE);
sendRandomEvent(user);
MongoUtil.getLjsdMongoTemplate().lastUpdate();
if(minute == 0){
//sendRandomEvent(user);
}*/
Map<Integer, ExplorerInfo> explorer = user.getPlayerInfoManager().getExplorer();
if (explorer == null || explorer.size() == 0) {
continue;
@ -301,7 +336,7 @@ public class ExplorerMapLogic {
List<Integer> delayId = new ArrayList<>();
List<Integer> deleteMapPlayer = new ArrayList<>(); //地图玩家信息
for (Map.Entry<Integer, ExplorerInfo> keyVal : explorer.entrySet()) {
if(keyVal.getValue().getMapId() == 0){
if (keyVal.getValue().getMapId() == 0) {
delayId.add(keyVal.getKey());
continue;
}
@ -381,14 +416,13 @@ public class ExplorerMapLogic {
MailLogic.getInstance().sendMail(uid, title, content,
"", TimeUtils.nowInt(), Global.MAIL_EFFECTIVE_TIME);
} else {
String title = SErrorCodeEerverConfig.getI18NMessage("exploresuccess_mail_title");
String content = SErrorCodeEerverConfig.getFormatMessage("exploresuccess_mail_txt", new Object[]{
teamName, mapName, hour,explorer.get(id).getKillNum(),explorer.get(id).getDeathNum()});
teamName, mapName, hour, explorer.get(id).getKillNum(), explorer.get(id).getDeathNum()});
//CommonProto.Drop.Builder drop = ItemUtil.drop(user, explorer.get(id).getDropItem().stream().toArray(int[][]::new), BIReason.EXPEDITION_BOX_REWARD);
int[][] dropArray = explorer.get(id).getDropMap().entrySet().stream().map(n -> new int[]{n.getKey(), n.getValue()}).toArray(int[][]::new);
String reward = StringUtil.parseArrayToString(dropArray);
LOGGER.info("{}探索{}小时到期发id=>{}邮件,邮件内容=>{}",uid,hour,id,reward);
LOGGER.info("{}探索{}小时到期发id=>{}邮件,邮件内容=>{}", uid, hour, id, reward);
MailLogic.getInstance().sendMail(uid, title, content,
reward, TimeUtils.nowInt(), Global.MAIL_EFFECTIVE_TIME);
}
@ -404,6 +438,17 @@ public class ExplorerMapLogic {
if (delayId.size() > 0) {
user.getPlayerInfoManager().setExplorer(explorer);
}
//探索有消耗 整点刷出随机事件
if (explorer.size() > 0) {
Calendar calendar = Calendar.getInstance();
/*int minute = calendar.get(Calendar.MINUTE);
if (minute == 0) {
sendRandomEvent(user);
}*/
//sendRandomEvent(user);
}
sendDisappearEvent(user);
MongoUtil.getLjsdMongoTemplate().lastUpdate();
}
} catch (Exception e) {
@ -411,22 +456,6 @@ public class ExplorerMapLogic {
}
}
public static void sendRandomEvent(User user){
//map
Map<Integer, SExplore> config = STableManager.getConfig(SExplore.class);
Map<Integer, SExploreEvent> exploreEventConfig = STableManager.getConfig(SExploreEvent.class);
List<SExplore> limitConfig = config.values().stream().filter(n->n.getLevel()<= user.getPlayerInfoManager().getLevel()).collect(Collectors.toList());
Random random = new Random();
int randomMapId = random.nextInt(limitConfig.size());
SExplore rankExplore = limitConfig.get(randomMapId);
//user.getPlayerInfoManager().getExploreEvent();
int randomEventId = random.nextInt(rankExplore.getEventList().length);
int eventId = rankExplore.getEventList()[randomEventId];
LOGGER.error("explore add eventId:"+eventId+" randomMapId: "+randomMapId);
user.getPlayerInfoManager().addExploreEvent(new KeyVal(eventId,TimeUtils.nowInt()+exploreEventConfig.get(eventId).getTime(),randomMapId));
}
public static class Instance {
public final static ExplorerMapLogic instance = new ExplorerMapLogic();
}

View File

@ -19,6 +19,7 @@ import com.ljsd.jieling.logic.OnlineUserManager;
import com.ljsd.jieling.logic.activity.ActivityLogic;
import com.ljsd.jieling.logic.activity.ActivityType;
import com.ljsd.jieling.logic.activity.ActivityTypeEnum;
import com.ljsd.jieling.logic.activity.crossService.CrossServiceLogic;
import com.ljsd.jieling.logic.activity.event.*;
import com.ljsd.jieling.logic.dao.*;
import com.ljsd.jieling.logic.dao.root.*;
@ -198,6 +199,8 @@ public class GuildLogic {
addGuildLog(guildInfo.getId(),GuildDef.Log.CREATE,user.getPlayerInfoManager().getNickName());
// 创建公会
CrossDeathPathLogic.setCrossGuild(guildInfo);
// 更新redis
CrossServiceLogic.getInstance().saveBasicPlayerToRedis(user);
PlayerInfoCache cache = RedisUtil.getInstence().getMapEntry(RedisKey.PLAYER_INFO_CACHE, "", String.valueOf(uid), PlayerInfoCache.class);
cache.setGuildPosition(GlobalsDef.CHAIRMAN);

View File

@ -148,5 +148,6 @@ public enum GameEvent {
DONGHAIXUNXIAN_REWARD,//东海寻仙,任务奖励
EXPLORE,//探索
EXPLORE_REWARD,//探索奖励
}

View File

@ -607,8 +607,16 @@ public class MissionLoigc {
Set<Integer> finishMissionIds = dailyMissionIdsType.getFinishMissionIds();
Map<Integer, SExploreTask> config = STableManager.getConfig(SExploreTask.class);
int type = GameMisionType.EXPLORE.getType();
if (doingMissionIds.size() == 0 && finishMissionIds.size() == 0) {
Set<Integer> arro = STableManager.getConfig(SExploreTask.class).keySet();
doingMissionIds.clear();
finishMissionIds.clear();
//exploreMissionType.getRewardedMissionIds().clear();
doingMissionIds.addAll(arro);
user.getUserMissionManager().updateString("exploreMissionType", dailyMissionIdsType);
}
for(SExploreTask exploreTask:config.values()){
int state = 2;
int state = 0;
int missionId = exploreTask.getId();
int progrss = exploreTask.getValues()[1][0];
if(doingMissionIds.contains(missionId)){
@ -825,6 +833,11 @@ public class MissionLoigc {
Map<GameMisionType, List<MissionStateChangeInfo>> gameMisionTypeListMap = userMissionManager.onGameEvent(user, GameEvent.ENDLESS_MISSION_REWARD, missionId);
missionStateChangeInfos = gameMisionTypeListMap.get(GameMisionType.ENDLESS_MISSION);
}
//探索任务
if(type==GameMisionType.EXPLORE.getType()){
Map<GameMisionType, List<MissionStateChangeInfo>> gameMisionTypeListMap = userMissionManager.onGameEvent(user, GameEvent.EXPLORE_REWARD, missionId);
missionStateChangeInfos = gameMisionTypeListMap.get(GameMisionType.EXPLORE);
}
if(missionStateChangeInfos!=null && !missionStateChangeInfos.isEmpty()){

View File

@ -10,7 +10,7 @@ public class ExploreEnemyHistoryHighManager implements BaseDataManager{
MissionType type = (MissionType) parm[0];
if (type.getMissionTypeValue() == missionType.getMissionTypeValue()){
data.exploreKillerHistoryHigh_num++;
data.exploreKillerHistoryHigh_num = (int)parm[1];
}
return new CumulationData.Result(missionType);

View File

@ -252,6 +252,7 @@ public class MissionEventDistributor {
eventProcessor.put(GameEvent.JADE_DYNASTY_MISSION_REWARD,new RewardEventProcessor());
eventProcessor.put(GameEvent.COW_FLY_SKY_REWEARD,new RewardEventProcessor());
eventProcessor.put(GameEvent.ENDLESS_MISSION_REWARD,new RewardEventProcessor());
eventProcessor.put(GameEvent.EXPLORE_REWARD,new RewardEventProcessor());
typeList = new ArrayList<>();
typeList.add(MissionType.RING_FIREA_DVANCED);

View File

@ -1,18 +1,16 @@
package com.ljsd.jieling.logic.mission.main;
import com.ljsd.jieling.logic.activity.event.MistyTripEvent;
import com.ljsd.jieling.logic.activity.event.Poster;
import com.ljsd.jieling.logic.dao.CumulationData;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.mission.MissionLoigc;
import com.ljsd.jieling.logic.mission.MissionState;
import com.ljsd.jieling.logic.mission.MissionType;
import com.ljsd.jieling.logic.mission.data.AbstractDataManager;
import com.ljsd.jieling.logic.mission.data.BaseDataManager;
import com.ljsd.jieling.logic.mission.data.DataManagerDistributor;
import config.SExploreTask;
import config.SJourneyWithWind;
import java.util.Iterator;
import manager.STableManager;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
@ -25,7 +23,8 @@ public class ExploreMissionType extends AbstractMissionType {
@Override
public int[][] reward(int missionId) {
return new int[0][];
SExploreTask exploreTask = STableManager.getConfig(SExploreTask.class).get(missionId);
return exploreTask.getReward();
}
@Override
@ -50,7 +49,11 @@ public class ExploreMissionType extends AbstractMissionType {
}else {
//完成
doingProgress = MissionLoigc.getDoingProgress(user, cumulationData, sTaskConfig.getType(), sTaskConfig.getValues()[0]);
isFinish = doingProgress >= sTaskConfig.getValues()[1][0];
if(sTaskConfig.getType() == MissionType.EXPLORE_ENEMYHISTORYHIGH_NUM.getMissionTypeValue()){
isFinish = doingProgress ==0? false:doingProgress <= sTaskConfig.getValues()[1][0];
}else{
isFinish = doingProgress >= sTaskConfig.getValues()[1][0];
}
}
if (!isFinish) {
@ -71,6 +74,18 @@ public class ExploreMissionType extends AbstractMissionType {
}
MissionStateChangeInfo finishInfo = new MissionStateChangeInfo(missionId,
MissionState.FINISH, null);
if(missionStateChangeInfos == null){
missionStateChangeInfos = new ArrayList<MissionStateChangeInfo>();
}
if(missionStateChangeInfos != null ){
missionStateChangeInfos.removeIf(next -> next.getMissionId() == missionId);
missionStateChangeInfos.add(finishInfo);
doingMissionIds.remove(missionId);
getFinishMissionIds().add(missionId);
}
/*
Iterator<MissionStateChangeInfo> iterator = missionStateChangeInfos.iterator();
while (iterator.hasNext()) {
MissionStateChangeInfo next = iterator.next();
@ -91,18 +106,8 @@ public class ExploreMissionType extends AbstractMissionType {
}
missionStateChangeInfos.add(finishInfo);
doingMissionIds.remove(missionId);
getFinishMissionIds().add(missionId);
getFinishMissionIds().add(missionId);*/
}
}
@Override

View File

@ -349,7 +349,6 @@ public abstract class AbstractRank implements IRank {
}
@Override
public long getParam1(Double data) {
return getDataByScore(data).length>0?getDataByScore(data)[0]:0;
}

View File

@ -1,13 +1,26 @@
package com.ljsd.jieling.logic.rank.rankImpl;
import com.ljsd.jieling.core.FunctionIdEnum;
import com.ljsd.jieling.db.redis.RedisUtil;
import com.ljsd.jieling.exception.ErrorCode;
import com.ljsd.jieling.exception.ErrorCodeException;
import com.ljsd.jieling.handler.FastChallengeHandler;
import com.ljsd.jieling.logic.GlobalDataManaager;
import com.ljsd.jieling.logic.activity.crossService.CrossServiceLogic;
import com.ljsd.jieling.logic.dao.GuilidManager;
import com.ljsd.jieling.logic.dao.TimeControllerOfFunction;
import com.ljsd.jieling.logic.dao.cross.CSPlayer;
import com.ljsd.jieling.logic.dao.root.GuildCache;
import com.ljsd.jieling.logic.dao.root.GuildInfo;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.family.CrossDeathPathLogic;
import com.ljsd.jieling.logic.family.DeathPathLogic;
import org.springframework.data.redis.core.ZSetOperations;
import rpc.protocols.CommonProto;
import rpc.protocols.PlayerInfoProto;
import java.util.Set;
/**
* @author Administrator
*/
@ -17,13 +30,93 @@ public class CarDealyGuildRank extends CrossGuildForceRank{
}
@Override
public long[] getDataByScore(Double score) {
return new long[]{ score.longValue()/1000,score.longValue()%1000};
protected void getCrossOptional(int index, ZSetOperations.TypedTuple<String> data, PlayerInfoProto.RankResponse.Builder builder) throws Exception {
GuildCache mapEntry = CrossDeathPathLogic.getCrossGuild(Integer.parseInt(data.getValue()));
if (mapEntry == null){
return;
}
CSPlayer csPlayer = CrossServiceLogic.getPlayerByRedis(mapEntry.getLeaderUId());
if (csPlayer == null){
return;
}
CommonProto.RankInfo.Builder everyRankInfo = CommonProto.RankInfo.newBuilder()
.setRank(index)
.setParam1(getParam1(data.getScore()))
.setParam2(getParam2(0,Integer.parseInt(data.getValue())))
.setParam3(getParam3(data.getScore()));
CommonProto.UserRank.Builder oneUserRank = getCrossOneUserRank(csPlayer,everyRankInfo);
builder.addRanks(oneUserRank);
}
@Override
public double getScore(double... data) {
return (long) (data[0]*1000 + data[1]);
public CommonProto.UserRank.Builder getFirstByCross(String rKey){
Set<ZSetOperations.TypedTuple<String>> rankByKey =
RedisUtil.getInstence().getZsetreverseRangeWithScores(getCrossRedisKey(),rKey, 0, 0, false);
CommonProto.UserRank.Builder builder = CommonProto.UserRank.newBuilder();
if(rankByKey.size()!=1){
return builder;
}
ZSetOperations.TypedTuple<String> data = rankByKey.iterator().next();
GuildCache mapEntry = CrossDeathPathLogic.getCrossGuild(Integer.parseInt(data.getValue()));
if (mapEntry == null){
return builder;
}
CSPlayer csPlayer = CrossServiceLogic.getPlayerByRedis(mapEntry.getLeaderUId());
if (csPlayer == null){
return builder;
}
CommonProto.RankInfo.Builder everyRankInfo = CommonProto.RankInfo.newBuilder()
.setRank(1)
.setParam1(getParam1(data.getScore()))
.setParam2(getParam2(0, Integer.parseInt(data.getValue())))
.setParam3(getParam3(data.getScore()));
builder = getCrossOneUserRank(csPlayer,everyRankInfo);
return builder;
}
@Override
public void getCrossMyInfo(User user,String rkey,PlayerInfoProto.RankResponse.Builder allUserResponse){
int guildId = user.getPlayerInfoManager().getGuildId();
if (guildId == 0){
return;
}
int myRank= RedisUtil.getInstence().getZSetreverseRank(getCrossRedisKey(), rkey, Integer.toString(guildId),false).intValue();
Double zSetScore = RedisUtil.getInstence().getZSetScore(getCrossRedisKey(), rkey, Integer.toString(guildId),false);
CommonProto.RankInfo towerRankInfo = CommonProto.RankInfo.newBuilder()
.setRank(myRank)
.setParam1(getParam1(zSetScore))
.setParam2(getParam2(0,guildId))
.build();
allUserResponse.setMyRankInfo(towerRankInfo);
}
@Override
public PlayerInfoProto.RankResponse getRank(int uid, String rkey, int page, int rankEndLine) throws Exception {
TimeControllerOfFunction controller = GlobalDataManaager.getInstance().getTimeControllerOfFunctionByFunctinoType(FunctionIdEnum.Car_Delay);
if (controller == null){
throw new ErrorCodeException(ErrorCode.ACTIVITY_NOT_OPEN);
}
return super.getRank(uid,rkey,page,rankEndLine);
}
@Override
public PlayerInfoProto.RankResponse getCrossRank(int uid, String rkey, int page, int rankEndLine) throws Exception {
TimeControllerOfFunction controller = GlobalDataManaager.getInstance().getTimeControllerOfFunctionByFunctinoType(FunctionIdEnum.Car_Delay);
if (controller == null){
throw new ErrorCodeException(ErrorCode.ACTIVITY_NOT_OPEN);
}
return super.getCrossRank(uid,rkey,page,rankEndLine);
}
@Override
public long getParam1(Double data) {
return (long) getScore(data);
}
public int getParam2(int uid, int guildId) {
return FastChallengeHandler.carDealyFightPeopleNum(uid,guildId);
}
@Override
@ -38,8 +131,7 @@ public class CarDealyGuildRank extends CrossGuildForceRank{
CommonProto.RankInfo.Builder everyRankInfo = CommonProto.RankInfo.newBuilder()
.setRank(index)
.setParam1(getParam1(data.getScore()))
.setParam2(getParam2(data.getScore()));
.setParam2(getParam2(0,guildId));
CommonProto.UserRank everyRank = CommonProto.UserRank.newBuilder()
.setGuildName(familyName)
.setRankInfo(everyRankInfo)
@ -55,7 +147,8 @@ public class CarDealyGuildRank extends CrossGuildForceRank{
CommonProto.RankInfo towerRankInfo = CommonProto.RankInfo.newBuilder()
.setRank(myRank)
.setParam1(getParam1(zSetScore))
.setParam2(getParam2(zSetScore)).build();
.setParam2(getParam2(0,guildId))
.build();
allUserResponse.setMyRankInfo(towerRankInfo);
}
}

View File

@ -1,8 +1,33 @@
package com.ljsd.jieling.logic.rank.rankImpl;
import com.ljsd.jieling.core.FunctionIdEnum;
import com.ljsd.jieling.exception.ErrorCode;
import com.ljsd.jieling.exception.ErrorCodeException;
import com.ljsd.jieling.logic.GlobalDataManaager;
import com.ljsd.jieling.logic.dao.TimeControllerOfFunction;
import rpc.protocols.PlayerInfoProto;
public class CarDealyRank extends ForceRank{
public CarDealyRank(int type, String redisKey) {
super(type, redisKey);
}
@Override
public PlayerInfoProto.RankResponse getRank(int uid, String rkey, int page, int rankEndLine) throws Exception {
TimeControllerOfFunction controller = GlobalDataManaager.getInstance().getTimeControllerOfFunctionByFunctinoType(FunctionIdEnum.Car_Delay);
if (controller == null){
throw new ErrorCodeException(ErrorCode.ACTIVITY_NOT_OPEN);
}
return super.getRank(uid,rkey,page,rankEndLine);
}
@Override
public PlayerInfoProto.RankResponse getCrossRank(int uid, String rkey, int page, int rankEndLine) throws Exception {
TimeControllerOfFunction controller = GlobalDataManaager.getInstance().getTimeControllerOfFunctionByFunctinoType(FunctionIdEnum.Car_Delay);
if (controller == null){
throw new ErrorCodeException(ErrorCode.ACTIVITY_NOT_OPEN);
}
return super.getCrossRank(uid,rkey,page,rankEndLine);
}
}

View File

@ -33,6 +33,8 @@ import com.ljsd.jieling.logic.family.GuildFightLogic;
import com.ljsd.jieling.logic.family.GuildLogic;
import com.ljsd.jieling.logic.help.HelpHeroLogic;
import com.ljsd.jieling.logic.mail.MailLogic;
import com.ljsd.jieling.logic.mission.GameEvent;
import com.ljsd.jieling.logic.mission.MissionType;
import com.ljsd.jieling.logic.question.QuestionLogic;
import com.ljsd.jieling.logic.rank.CrossRankManager;
import com.ljsd.jieling.logic.rank.RankEnum;
@ -47,6 +49,7 @@ import com.ljsd.jieling.util.MessageUtil;
import manager.STableManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.redis.core.ZSetOperations;
import util.TimeUtils;
import java.util.*;
@ -244,7 +247,20 @@ public class MinuteTask extends Thread {
RedisUtil.getInstence().remove(RedisUtil.getInstence().getKey(RedisKey.CROSS_LINGMAISECRET_INFO,crossGroup + RedisKey.Delimiter_colon + 2,true));
}
//探索排行每日重置
RankEnum.toRank(RankEnum.EXPLORE_RANK.getType()).removeAllRank("");
String key = RedisUtil.getInstence().getKey(RedisKey.EXPLORE_RANK,"",true);
Set<String> exploreRank = RedisUtil.getInstence().getReverseZset(key,0,-1);
int i = 0;
for(String eachEle:exploreRank){
User user = UserManager.getUser(Integer.parseInt(eachEle));
if(user == null){
continue;
}
i++;
LOGGER.error("------------------------------asdfa --------------:"+eachEle+" i:"+i);
//user.getUserMissionManager().onGameEvent(user, GameEvent.EXPLORE, MissionType.EXPLORE_ENEMYHISTORYHIGH_NUM, i);
}
RankEnum.toRank(RankEnum.EXPLORE_RANK.getType()).removeRank("");
// 公会信息处理
Map<Integer, GuildInfo> guildInfoMap = GuilidManager.guildInfoMap;