vip level task
parent
8f588acb05
commit
b4e7cf3e5d
|
@ -477,9 +477,10 @@ function BattleLogic.CastTeamSkill(camp)
|
||||||
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
|
||||||
if playerTeamSkillIndex > #playerTeamSkillList then
|
|
||||||
playerTeamSkillIndex = 1
|
playerTeamSkillIndex = 1
|
||||||
|
else
|
||||||
|
playerTeamSkillIndex = playerTeamSkillIndex + 1
|
||||||
end
|
end
|
||||||
playerMP = 0
|
playerMP = 0
|
||||||
end
|
end
|
||||||
|
@ -487,9 +488,10 @@ function BattleLogic.CastTeamSkill(camp)
|
||||||
local teamSkill = enemyTeamSkillList[enemyTeamSkillIndex]
|
local teamSkill = enemyTeamSkillList[enemyTeamSkillIndex]
|
||||||
if teamSkill then
|
if teamSkill then
|
||||||
teamSkill:Cast()
|
teamSkill:Cast()
|
||||||
enemyTeamSkillIndex = enemyTeamSkillIndex + 1
|
if enemyTeamSkillIndex == #enemyTeamSkillList then
|
||||||
if enemyTeamSkillIndex > #enemyTeamSkillList then
|
|
||||||
enemyTeamSkillIndex = 1
|
enemyTeamSkillIndex = 1
|
||||||
|
else
|
||||||
|
enemyTeamSkillIndex = enemyTeamSkillIndex + 1
|
||||||
end
|
end
|
||||||
enemyMP = 0
|
enemyMP = 0
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,12 +9,33 @@ local max = math.max
|
||||||
local min = math.min
|
local min = math.min
|
||||||
local Passivity = require("Modules/Battle/Logic/Base/Passivity")
|
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 ()
|
local skillPool = BattleObjectPool.New(function ()
|
||||||
return Skill:New()
|
return Skill:New()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
function RoleLogic.New()
|
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(),
|
shield=BattleList.New(),
|
||||||
exCalDmgList=BattleList.New(),
|
exCalDmgList=BattleList.New(),
|
||||||
proTranList=BattleList.New(),
|
proTranList=BattleList.New(),
|
||||||
|
@ -67,6 +88,10 @@ function RoleLogic:Init(uid, data)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
self.aiOrder = data.ai
|
||||||
|
self.aiIndex = 1
|
||||||
|
self.aiTempCount = 0
|
||||||
|
|
||||||
self.isDead = self:GetRoleData(RoleDataName.Hp) <= 0
|
self.isDead = self:GetRoleData(RoleDataName.Hp) <= 0
|
||||||
self.Auto = true
|
self.Auto = true
|
||||||
self.IsDebug = false
|
self.IsDebug = false
|
||||||
|
@ -106,11 +131,7 @@ function RoleLogic:Init(uid, data)
|
||||||
if superSkill.sp >= superSkill.spPass then
|
if superSkill.sp >= superSkill.spPass then
|
||||||
if skill.sp >= skill.spPass then
|
if skill.sp >= skill.spPass then
|
||||||
if self.Auto and self:CanCastSkill() then
|
if self.Auto and self:CanCastSkill() then
|
||||||
if Random.Range01() <= 0.75 then
|
self:ExecuteAI(skill, superSkill)
|
||||||
skill:Cast()
|
|
||||||
else
|
|
||||||
superSkill:Cast()
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
skill.sp = skill.sp + 1
|
skill.sp = skill.sp + 1
|
||||||
|
@ -256,6 +277,29 @@ function RoleLogic:Dispose()
|
||||||
end
|
end
|
||||||
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()
|
function RoleLogic:Update()
|
||||||
if not self.enable then
|
if not self.enable then
|
||||||
return
|
return
|
||||||
|
|
|
@ -195,4 +195,8 @@ public class SMonsterConfig implements BaseConfig {
|
||||||
public float getDifferDemonsBocusFactor() {
|
public float getDifferDemonsBocusFactor() {
|
||||||
return differDemonsBocusFactor;
|
return differDemonsBocusFactor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int[] getMonsterAi() {
|
||||||
|
return monsterAi;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -436,7 +436,11 @@ public class GuildLogic {
|
||||||
targetUser.getPlayerInfoManager().setGuildId(0);
|
targetUser.getPlayerInfoManager().setGuildId(0);
|
||||||
addGuildLog(guildInfo.getId(),GuildDef.Log.KICK,user.getPlayerInfoManager().getNickName());
|
addGuildLog(guildInfo.getId(),GuildDef.Log.KICK,user.getPlayerInfoManager().getNickName());
|
||||||
Family.FamilyKickIndication build = Family.FamilyKickIndication.newBuilder().setType(1).build();
|
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);
|
MessageUtil.sendMessage(session,1,msgId,null,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -83,6 +83,9 @@ public class DataManagerDistributor {
|
||||||
judges.put(MissionType.SYNTHESIS_HERO_STAR_TIMES,new HeroComposDataManager());
|
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 {
|
public static CumulationData.Result updateData(CumulationData data, MissionType missionType, Object...parm) throws Exception {
|
||||||
|
|
|
@ -30,7 +30,7 @@ public class MissionEventDistributor {
|
||||||
|
|
||||||
public static void init(){
|
public static void init(){
|
||||||
|
|
||||||
eventProcessor.put(GameEvent.VIP_LEVLUP,new VipLevelUpEventProcessor());
|
|
||||||
eventProcessor.put(GameEvent.DAILY_REFRESH,new DailyRefreshEventProcess());
|
eventProcessor.put(GameEvent.DAILY_REFRESH,new DailyRefreshEventProcess());
|
||||||
eventProcessor.put(GameEvent.TREASH_REFRESH,new TreasureRefreshEventProcess());
|
eventProcessor.put(GameEvent.TREASH_REFRESH,new TreasureRefreshEventProcess());
|
||||||
eventProcessor.put(GameEvent.SERVENHAPPY_REFRESH,new TreasureRefreshEventProcess());
|
eventProcessor.put(GameEvent.SERVENHAPPY_REFRESH,new TreasureRefreshEventProcess());
|
||||||
|
@ -42,6 +42,12 @@ public class MissionEventDistributor {
|
||||||
eventEnumListMap.put(GameEvent.RANDOM_HERO,typeList);
|
eventEnumListMap.put(GameEvent.RANDOM_HERO,typeList);
|
||||||
eventProcessor.put(GameEvent.RANDOM_HERO,new CumulationDataEventProcessor());
|
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 = new ArrayList<>();
|
||||||
typeList.add(MissionType.COLLECT_QUALITY_HERO);
|
typeList.add(MissionType.COLLECT_QUALITY_HERO);
|
||||||
eventEnumListMap.put(GameEvent.GET_HERO,typeList);
|
eventEnumListMap.put(GameEvent.GET_HERO,typeList);
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.ljsd.jieling.logic.mission.event;
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||||
import com.ljsd.jieling.logic.mission.GameMisionType;
|
import com.ljsd.jieling.logic.mission.GameMisionType;
|
||||||
|
import com.ljsd.jieling.logic.mission.MissionType;
|
||||||
import com.ljsd.jieling.logic.mission.main.MissionStateChangeInfo;
|
import com.ljsd.jieling.logic.mission.main.MissionStateChangeInfo;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -11,7 +12,11 @@ import java.util.Map;
|
||||||
|
|
||||||
public class VipLevelUpEventProcessor implements BaseGameEventProcessor {
|
public class VipLevelUpEventProcessor implements BaseGameEventProcessor {
|
||||||
@Override
|
@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);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,6 +93,7 @@ public class FightDataUtil {
|
||||||
unitData.set("superSkill", getSkill(unitSkill[1]));
|
unitData.set("superSkill", getSkill(unitSkill[1]));
|
||||||
unitData.set("passivity", getPassivity(unitSkill));
|
unitData.set("passivity", getPassivity(unitSkill));
|
||||||
}
|
}
|
||||||
|
unitData.set("ai", getMonsterAi(sMonster.getMonsterAi()));
|
||||||
|
|
||||||
CommonProto.FightUnitInfo fightUnitList = data.getFightUnitList(i);
|
CommonProto.FightUnitInfo fightUnitList = data.getFightUnitList(i);
|
||||||
String property = fightUnitList.getProperty();
|
String property = fightUnitList.getProperty();
|
||||||
|
@ -105,6 +106,15 @@ public class FightDataUtil {
|
||||||
return enemyData;
|
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) {
|
private static LuaValue getPassivity(String[] unitSkill) {
|
||||||
LuaValue passivityData = new LuaTable();
|
LuaValue passivityData = new LuaTable();
|
||||||
int length = unitSkill.length;
|
int length = unitSkill.length;
|
||||||
|
|
Loading…
Reference in New Issue