back_recharge
jiahuiwen 2019-03-26 17:35:15 +08:00
commit fee1e82d74
3 changed files with 58 additions and 2 deletions

View File

@ -0,0 +1,56 @@
require("Modules/Battle/Logic/Base/Buff")
Immune = Buff:New()
local immune1 = function(buff)
return buff.type == BuffName.Control
end
local immune2 = function(buff)
return buff.type == BuffName.DOT
end
--初始化Buff通过传入一些自定义参数控制成长相关的数值
function Immune:SetData(...)
--log("Immune:SetData")
self.immuneType = ...
end
--初始化后调用一次
function Immune:OnStart()
--log("Immune:OnStart")
if self.immuneType == 1 then --免疫控制状态
self.target.buffFilter:Add(immune1)
elseif self.immuneType == 2 then --免疫dot
self.target.buffFilter:Add(immune2)
end
end
--间隔N帧触发返回true时表示继续触发返回false立刻触发OnEnd
function Immune:OnTrigger()
--log("Immune:OnTrigger")
return true
end
--效果结束时调用一次
function Immune:OnEnd()
--log("Immune:OnEnd")
local immune
if self.immuneType == 1 then --免疫控制状态
immune = immune1
elseif self.immuneType == 2 then --免疫dot
immune = immune2
end
for i = 1, self.target.buffFilter.size do
if self.target.buffFilter.buffer[i] == immune then
self.target.buffFilter:Remove(i)
break
end
end
end
--只有当cover字段为true时触发返回true则被新效果覆盖
function Immune:OnCover(newBuff)
--log("Immune:OnCover")
return true
end
return Immune

View File

@ -650,7 +650,7 @@ public class MapLogic {
resetMapInfo(user, true);
MapMission mapMission = mapManager.getAllMissionProgress().get(mapId);
if(mapMission!=null){
MapInfoProto.MapOutResponse build = MapInfoProto.MapOutResponse.newBuilder().setMapAccomplishInfo(CBean2Proto.getMapAccomplishInfo(mapManager.getAllMissionProgress().get(mapManager.getCurMapId()))).build();
MapInfoProto.MapOutResponse build = MapInfoProto.MapOutResponse.newBuilder().setMapAccomplishInfo(CBean2Proto.getMapAccomplishInfo(mapMission)).build();
MessageUtil.sendMessage(session, 1, messageType.getNumber(), build, true);
return;
}

View File

@ -181,7 +181,7 @@ public class CBean2Proto {
if (sMonsterConfig.getSkillList()!=null){
for (Integer i : sMonsterConfig.getSkillList()){
monsterSkillList.append(i);
monsterSkillList.append(i).append("#");
}
}