vip level task

back_recharge
wangyuan 2019-08-05 15:58:48 +08:00
parent 8f588acb05
commit b4e7cf3e5d
8 changed files with 91 additions and 13 deletions

View File

@ -477,9 +477,10 @@ function BattleLogic.CastTeamSkill(camp)
local teamSkill = playerTeamSkillList[playerTeamSkillIndex]
if teamSkill then
teamSkill:Cast()
playerTeamSkillIndex = playerTeamSkillIndex + 1
if playerTeamSkillIndex > #playerTeamSkillList then
if playerTeamSkillIndex == #playerTeamSkillList then
playerTeamSkillIndex = 1
else
playerTeamSkillIndex = playerTeamSkillIndex + 1
end
playerMP = 0
end
@ -487,9 +488,10 @@ function BattleLogic.CastTeamSkill(camp)
local teamSkill = enemyTeamSkillList[enemyTeamSkillIndex]
if teamSkill then
teamSkill:Cast()
enemyTeamSkillIndex = enemyTeamSkillIndex + 1
if enemyTeamSkillIndex > #enemyTeamSkillList then
if enemyTeamSkillIndex == #enemyTeamSkillList then
enemyTeamSkillIndex = 1
else
enemyTeamSkillIndex = enemyTeamSkillIndex + 1
end
enemyMP = 0
end

View File

@ -9,12 +9,33 @@ local max = math.max
local min = math.min
local Passivity = require("Modules/Battle/Logic/Base/Passivity")
local aiList = {
[0] = function(skill, superSkill) --默认75%释放点击技、25%释放上滑技
return Random.Range01() <= 0.75
end,
[1] = function(skill, superSkill) --只放点技
return true
end,
[2] = function(skill, superSkill) --只放滑技
return false
end,
[3] = function(skill, superSkill) --上滑技初始概率为5%每次释放点击技后增加上滑技释放概率20%释放上滑技后上滑技释放概率回到5%。
local b = Random.Range01() > (0.05 + 0.2 * skill.owner.aiTempCount)
if b then
skill.owner.aiTempCount = skill.owner.aiTempCount + 1
else
skill.owner.aiTempCount = 0
end
return b
end,
}
local skillPool = BattleObjectPool.New(function ()
return Skill:New()
end)
function RoleLogic.New()
local instance = {uid=0,roleData=0,data=RoleData.New(),camp=0,name=0,roleType=0,
local instance = {uid=0,roleData=0,data=RoleData.New(),camp=0,name=0,roleType=0,aiIndex = 1,
shield=BattleList.New(),
exCalDmgList=BattleList.New(),
proTranList=BattleList.New(),
@ -67,6 +88,10 @@ function RoleLogic:Init(uid, data)
end
end
self.aiOrder = data.ai
self.aiIndex = 1
self.aiTempCount = 0
self.isDead = self:GetRoleData(RoleDataName.Hp) <= 0
self.Auto = true
self.IsDebug = false
@ -106,11 +131,7 @@ function RoleLogic:Init(uid, data)
if superSkill.sp >= superSkill.spPass then
if skill.sp >= skill.spPass then
if self.Auto and self:CanCastSkill() then
if Random.Range01() <= 0.75 then
skill:Cast()
else
superSkill:Cast()
end
self:ExecuteAI(skill, superSkill)
end
else
skill.sp = skill.sp + 1
@ -256,6 +277,29 @@ function RoleLogic:Dispose()
end
end
function RoleLogic:ExecuteAI(skill, superSkill)
local ai
if self.aiOrder and self.aiOrder[self.aiIndex] then
ai = aiList[self.aiOrder[self.aiIndex]]
else
ai = aiList[0]
end
if ai(skill, superSkill) then
skill:Cast()
else
superSkill:Cast()
end
if self.aiOrder then
if self.aiIndex == #self.aiOrder then
self.aiIndex = 1
else
self.aiIndex = self.aiIndex + 1
end
end
end
function RoleLogic:Update()
if not self.enable then
return

View File

@ -195,4 +195,8 @@ public class SMonsterConfig implements BaseConfig {
public float getDifferDemonsBocusFactor() {
return differDemonsBocusFactor;
}
public int[] getMonsterAi() {
return monsterAi;
}
}

View File

@ -436,7 +436,11 @@ public class GuildLogic {
targetUser.getPlayerInfoManager().setGuildId(0);
addGuildLog(guildInfo.getId(),GuildDef.Log.KICK,user.getPlayerInfoManager().getNickName());
Family.FamilyKickIndication build = Family.FamilyKickIndication.newBuilder().setType(1).build();
MessageUtil.sendIndicationMessage(session,1, MessageTypeProto.MessageType.FAMILY_KICK_INDICATION_VALUE,build,true);
ISession targetSession = OnlineUserManager.getSessionByUid(targetUid);
if(targetSession!=null){
MessageUtil.sendIndicationMessage(targetSession,1, MessageTypeProto.MessageType.FAMILY_KICK_INDICATION_VALUE,build,true);
}
MessageUtil.sendMessage(session,1,msgId,null,true);
}

View File

@ -83,6 +83,9 @@ public class DataManagerDistributor {
judges.put(MissionType.SYNTHESIS_HERO_STAR_TIMES,new HeroComposDataManager());
judges.put(MissionType.VIP_LEVEL,new DefaultDataManager());
}
public static CumulationData.Result updateData(CumulationData data, MissionType missionType, Object...parm) throws Exception {

View File

@ -30,7 +30,7 @@ public class MissionEventDistributor {
public static void init(){
eventProcessor.put(GameEvent.VIP_LEVLUP,new VipLevelUpEventProcessor());
eventProcessor.put(GameEvent.DAILY_REFRESH,new DailyRefreshEventProcess());
eventProcessor.put(GameEvent.TREASH_REFRESH,new TreasureRefreshEventProcess());
eventProcessor.put(GameEvent.SERVENHAPPY_REFRESH,new TreasureRefreshEventProcess());
@ -42,6 +42,12 @@ public class MissionEventDistributor {
eventEnumListMap.put(GameEvent.RANDOM_HERO,typeList);
eventProcessor.put(GameEvent.RANDOM_HERO,new CumulationDataEventProcessor());
typeList = new ArrayList<>();
typeList.add(MissionType.VIP_LEVEL);
eventEnumListMap.put(GameEvent.VIP_LEVLUP,typeList);
eventProcessor.put(GameEvent.VIP_LEVLUP,new VipLevelUpEventProcessor());
typeList = new ArrayList<>();
typeList.add(MissionType.COLLECT_QUALITY_HERO);
eventEnumListMap.put(GameEvent.GET_HERO,typeList);

View File

@ -3,6 +3,7 @@ package com.ljsd.jieling.logic.mission.event;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.mission.GameEvent;
import com.ljsd.jieling.logic.mission.GameMisionType;
import com.ljsd.jieling.logic.mission.MissionType;
import com.ljsd.jieling.logic.mission.main.MissionStateChangeInfo;
import java.util.List;
@ -11,7 +12,11 @@ import java.util.Map;
public class VipLevelUpEventProcessor implements BaseGameEventProcessor {
@Override
public void onGameEvent(User user, Map<GameMisionType, List<MissionStateChangeInfo>> missionTypeEnumListMap, GameEvent event, Object... parm) {
public void onGameEvent(User user, Map<GameMisionType, List<MissionStateChangeInfo>> missionTypeEnumListMap, GameEvent event, Object... parm) throws Exception {
user.getUserMissionManager().openMission(user,event, missionTypeEnumListMap,parm);
List<MissionType> typeList = MissionEventDistributor.eventEnumListMap.get(event);
for (MissionType type : typeList) {
user.getUserMissionManager().calCumulationDataResult(user,type,missionTypeEnumListMap,parm);
}
}
}

View File

@ -93,6 +93,7 @@ public class FightDataUtil {
unitData.set("superSkill", getSkill(unitSkill[1]));
unitData.set("passivity", getPassivity(unitSkill));
}
unitData.set("ai", getMonsterAi(sMonster.getMonsterAi()));
CommonProto.FightUnitInfo fightUnitList = data.getFightUnitList(i);
String property = fightUnitList.getProperty();
@ -105,6 +106,15 @@ public class FightDataUtil {
return enemyData;
}
private static LuaValue getMonsterAi(int[] monsterAIs) {
LuaValue property = new LuaTable();
int index =1;
for(int monsterAI : monsterAIs){
property.rawset(index++, LuaValue.valueOf(monsterAI));
}
return property;
}
private static LuaValue getPassivity(String[] unitSkill) {
LuaValue passivityData = new LuaTable();
int length = unitSkill.length;