新增任务类型
parent
01e0b812e9
commit
d28a826f38
|
@ -2,6 +2,7 @@ package com.ljsd.jieling.handler.family;
|
||||||
|
|
||||||
import com.google.protobuf.GeneratedMessage;
|
import com.google.protobuf.GeneratedMessage;
|
||||||
import com.ljsd.GameApplication;
|
import com.ljsd.GameApplication;
|
||||||
|
import com.ljsd.jieling.core.Lockeys;
|
||||||
import com.ljsd.jieling.db.redis.RedisKey;
|
import com.ljsd.jieling.db.redis.RedisKey;
|
||||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||||
import com.ljsd.jieling.exception.ErrorCode;
|
import com.ljsd.jieling.exception.ErrorCode;
|
||||||
|
@ -13,6 +14,7 @@ import com.ljsd.jieling.logic.dao.UserManager;
|
||||||
import com.ljsd.jieling.logic.dao.root.GuildCache;
|
import com.ljsd.jieling.logic.dao.root.GuildCache;
|
||||||
import com.ljsd.jieling.logic.dao.root.GuildInfo;
|
import com.ljsd.jieling.logic.dao.root.GuildInfo;
|
||||||
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.protocols.CommonProto;
|
import com.ljsd.jieling.protocols.CommonProto;
|
||||||
import com.ljsd.jieling.protocols.Family;
|
import com.ljsd.jieling.protocols.Family;
|
||||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||||
|
@ -21,7 +23,9 @@ import config.SGuildLevelConfig;
|
||||||
import config.SGuildSacrificeConfig;
|
import config.SGuildSacrificeConfig;
|
||||||
import manager.STableManager;
|
import manager.STableManager;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description: 祭祀请求
|
* Description: 祭祀请求
|
||||||
|
@ -57,6 +61,9 @@ public class FamilyFeteRequestHandler extends BaseHandler<Family.FamilyFeteReque
|
||||||
if (!enough) {
|
if (!enough) {
|
||||||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
||||||
}
|
}
|
||||||
|
if( user.getGuildMyInfo().getFetetype()!=0){
|
||||||
|
throw new ErrorCodeException("已经祭祀");
|
||||||
|
}
|
||||||
|
|
||||||
//up value
|
//up value
|
||||||
user.getGuildMyInfo().setFetetype(type);
|
user.getGuildMyInfo().setFetetype(type);
|
||||||
|
@ -66,15 +73,23 @@ public class FamilyFeteRequestHandler extends BaseHandler<Family.FamilyFeteReque
|
||||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, sGuildSacrificeConfig.getReward(), BIReason.FETE_REWARD);
|
CommonProto.Drop.Builder drop = ItemUtil.drop(user, sGuildSacrificeConfig.getReward(), BIReason.FETE_REWARD);
|
||||||
|
|
||||||
//drop exp
|
//drop exp
|
||||||
//TODO lock 操作公会
|
//lock 操作公会
|
||||||
GuildInfo guildInfo = GuilidManager.guildInfoMap.get(guildId);
|
GuildInfo guildInfo = GuilidManager.guildInfoMap.get(guildId);
|
||||||
|
|
||||||
if (guildInfo == null) {
|
if (guildInfo == null) {
|
||||||
throw new ErrorCodeException(ErrorCode.FAMILY_NULL);
|
throw new ErrorCodeException(ErrorCode.FAMILY_NULL);
|
||||||
}
|
}
|
||||||
|
Set<Integer> sendUids = new HashSet<>();
|
||||||
|
for (Set<Integer> items : guildInfo.getMembers().values()) {
|
||||||
|
sendUids.addAll(items);
|
||||||
|
}
|
||||||
|
Lockeys.getLockeys().lock("guild",sendUids);
|
||||||
|
|
||||||
|
|
||||||
int addexp = sGuildSacrificeConfig.getGuildExperience();
|
int addexp = sGuildSacrificeConfig.getGuildExperience();
|
||||||
//自动推送给所有成员
|
//自动推送给所有成员
|
||||||
guildInfo.addFete(sGuildSacrificeConfig.getGuildExperience());
|
guildInfo.addFete(sGuildSacrificeConfig.getGuildExperience());
|
||||||
|
user.getUserMissionManager().onGameEvent(user, GameEvent.GUILD_GIVE,1);
|
||||||
Map<Integer, SGuildLevelConfig> levelConfigMap = STableManager.getConfig(SGuildLevelConfig.class);
|
Map<Integer, SGuildLevelConfig> levelConfigMap = STableManager.getConfig(SGuildLevelConfig.class);
|
||||||
if (guildInfo.getExp() + addexp >= levelConfigMap.get(guildInfo.getLevel()).getExp()) {
|
if (guildInfo.getExp() + addexp >= levelConfigMap.get(guildInfo.getLevel()).getExp()) {
|
||||||
guildInfo.updateLevel(guildInfo.getLevel() + 1);
|
guildInfo.updateLevel(guildInfo.getLevel() + 1);
|
||||||
|
|
|
@ -61,7 +61,7 @@ public interface ActivityType {
|
||||||
int LEVEL_EXPERT = 52; //进阶达人
|
int LEVEL_EXPERT = 52; //进阶达人
|
||||||
|
|
||||||
int BUY_GOLD = 53; //购买金币 点石成金
|
int BUY_GOLD = 53; //购买金币 点石成金
|
||||||
|
int COPY_PASS = 54; // 开服福利 副本限时通过奖励
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,8 @@ public enum ActivityTypeEnum {
|
||||||
HERORANDOM_EXPERT(ActivityType.HERORANDOM_EXPERT,HeroRandomExpectRankActivity::new),
|
HERORANDOM_EXPERT(ActivityType.HERORANDOM_EXPERT,HeroRandomExpectRankActivity::new),
|
||||||
SECURTBOX_EXPERT(ActivityType.SECURTBOX_EXPERT,SecurtBoxExpectRankActivity::new),
|
SECURTBOX_EXPERT(ActivityType.SECURTBOX_EXPERT,SecurtBoxExpectRankActivity::new),
|
||||||
FIND_FAIRY_FESTIVAL(ActivityType.FIND_FAIRY_FESTIVAL,RechargeSumActivity::new),
|
FIND_FAIRY_FESTIVAL(ActivityType.FIND_FAIRY_FESTIVAL,RechargeSumActivity::new),
|
||||||
BUY_GOLD(ActivityType.BUY_GOLD,BuyGoldActivity::new)
|
BUY_GOLD(ActivityType.BUY_GOLD,BuyGoldActivity::new),
|
||||||
|
COPY_PASS(ActivityType.COPY_PASS,ChapterRewardActivity::new)
|
||||||
;
|
;
|
||||||
private int type;
|
private int type;
|
||||||
private Function<Integer, AbstractActivity> toActivityFunction;
|
private Function<Integer, AbstractActivity> toActivityFunction;
|
||||||
|
|
|
@ -86,7 +86,7 @@ public enum GameEvent {
|
||||||
|
|
||||||
|
|
||||||
CARD_RANDWM,// 使用普通召唤num次 (十连抽num计10)
|
CARD_RANDWM,// 使用普通召唤num次 (十连抽num计10)
|
||||||
GUILD_GIVE,//使用level级别(0不限、1普通、2钻石小、3钻石大)的公会捐献num次 //TODO
|
GUILD_GIVE,//使用level级别(0不限、1普通、2钻石小、3钻石大)的公会捐献num次
|
||||||
TEN_CHALLENGE,//挑战十绝阵num次 //TODO
|
TEN_CHALLENGE,//挑战十绝阵num次 //TODO
|
||||||
// SIX_RANDOM,//使用6灵阁召唤num次
|
// SIX_RANDOM,//使用6灵阁召唤num次
|
||||||
EXPEDITION_FINISH,//猎妖之路通过第floor层的首领节点(每层最多一个)num次
|
EXPEDITION_FINISH,//猎妖之路通过第floor层的首领节点(每层最多一个)num次
|
||||||
|
@ -94,7 +94,7 @@ public enum GameEvent {
|
||||||
DEATH_PATH,//击杀过关十绝阵num次//TODO
|
DEATH_PATH,//击杀过关十绝阵num次//TODO
|
||||||
|
|
||||||
DAILY_TASK_TYPE,//日常任务 //
|
DAILY_TASK_TYPE,//日常任务 //
|
||||||
GUID_HELP,//公会援助他人次数达到num//TODO
|
GUID_HELP,//公会援助他人次数达到num
|
||||||
CAR_PLAY,//参与车迟斗法num次.//TODO
|
CAR_PLAY,//参与车迟斗法num次.//TODO
|
||||||
CAR_PLAY_LOOT,//于车迟斗法中抢夺其他玩家积分num次//TODO
|
CAR_PLAY_LOOT,//于车迟斗法中抢夺其他玩家积分num次//TODO
|
||||||
|
|
||||||
|
|
|
@ -785,7 +785,12 @@ public class MissionLoigc {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GUILD_GIVE_TIME:
|
case GUILD_GIVE_TIME:
|
||||||
count = cumulationData.guild_give_time.get(missionSubType[0]);
|
if(missionSubType[0] == 0){
|
||||||
|
count = (int)(cumulationData.guild_give_time.values().stream().collect(Collectors.summarizingInt(x->x)).getSum());
|
||||||
|
}else{
|
||||||
|
count = cumulationData.guild_give_time.get(missionSubType[0]);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case TEN_CHALLENGE_TIME:
|
case TEN_CHALLENGE_TIME:
|
||||||
count = cumulationData.ten_challenge_time;
|
count = cumulationData.ten_challenge_time;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.ljsd.jieling.logic.mission.data;
|
package com.ljsd.jieling.logic.mission.data;
|
||||||
|
|
||||||
import com.ljsd.jieling.logic.dao.CumulationData;
|
import com.ljsd.jieling.logic.dao.CumulationData;
|
||||||
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
import com.ljsd.jieling.logic.mission.MissionType;
|
import com.ljsd.jieling.logic.mission.MissionType;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
@ -139,10 +140,16 @@ public class DataManagerDistributor {
|
||||||
}
|
}
|
||||||
|
|
||||||
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 {
|
||||||
BaseDataManager updater = judges.get(missionType);
|
|
||||||
|
BaseDataManager updater = DataManagerDistributor.getMissTypeData(missionType);
|
||||||
if(updater==null){
|
if(updater==null){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
// if(updater instanceof AbstractDataManager){
|
||||||
|
// if(!((AbstractDataManager) updater).ishit(user,data, missionSubType,parm)){
|
||||||
|
// return null;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
return updater.updateData(data, missionType,parm);
|
return updater.updateData(data, missionType,parm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,21 +31,33 @@ public class UpJewlDataManager extends AbstractDataManager{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isFinish(User user,CumulationData data, int[][] cfgValue, Object... parm) {
|
public boolean isFinish(User user,CumulationData data, int[][] cfgValue, Object... parm) {
|
||||||
|
// if(parm.length==1&&(int)parm[0]!=6){
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// if(parm.length==2&&(int)parm[0]!=cfgValue[1][0]){
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
if( data.jewl_all_leve==cfgValue[1][0]){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
for (Map.Entry<Integer, List<TeamPosHeroInfo>> entry:user.getTeamPosManager().getTeamPosForHero().entrySet()){
|
for (Map.Entry<Integer, List<TeamPosHeroInfo>> entry:user.getTeamPosManager().getTeamPosForHero().entrySet()){
|
||||||
List<TeamPosHeroInfo> teamPosHeroInfos =entry.getValue();
|
List<TeamPosHeroInfo> teamPosHeroInfos =entry.getValue();
|
||||||
if(teamPosHeroInfos.size()!=6){
|
if(teamPosHeroInfos.size()!=6){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
boolean isAll =true;
|
||||||
for (TeamPosHeroInfo info:teamPosHeroInfos){
|
for (TeamPosHeroInfo info:teamPosHeroInfos){
|
||||||
Hero hero = user.getHeroManager().getHero(info.getHeroId());
|
Hero hero = user.getHeroManager().getHero(info.getHeroId());
|
||||||
if( hero.getEspecialEquipLevel()<cfgValue[1][0]){
|
if( hero.getEspecialEquipLevel()<cfgValue[1][0]){
|
||||||
return false;
|
isAll = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(isAll){
|
||||||
|
data.jewl_all_leve=cfgValue[1][0];
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
data.jewl_all_leve=1;
|
return false;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -236,6 +236,7 @@ public class MissionEventDistributor {
|
||||||
|
|
||||||
typeList = new ArrayList<>();
|
typeList = new ArrayList<>();
|
||||||
typeList.add(MissionType.HERO_IN_TEAM_NUMS);
|
typeList.add(MissionType.HERO_IN_TEAM_NUMS);
|
||||||
|
typeList.add(MissionType.JEWL_ALL_LEVE);
|
||||||
eventEnumListMap.put(GameEvent.HERO_IN_TEAM,typeList);
|
eventEnumListMap.put(GameEvent.HERO_IN_TEAM,typeList);
|
||||||
eventProcessor.put(GameEvent.HERO_IN_TEAM,new CumulationDataEventProcessor());
|
eventProcessor.put(GameEvent.HERO_IN_TEAM,new CumulationDataEventProcessor());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue