add task
parent
95e7381a2e
commit
714599814e
|
@ -0,0 +1,21 @@
|
|||
package com.ljsd.jieling.battle;
|
||||
|
||||
|
||||
|
||||
import com.ljsd.jieling.handler.map.behavior.BehaviorUtil;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.protocols.CommonProto;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class BattleManager {
|
||||
|
||||
static Map<Integer, CommonProto.FightTeamInfo> fightTeamInfoMap = new HashMap<>();
|
||||
|
||||
public static void snapUserFightInfo(User mine, int myteamId){
|
||||
CommonProto.FightTeamInfo fightTeamInfo = BehaviorUtil.getFightTeamInfo(mine,myteamId,false);
|
||||
fightTeamInfoMap.put(mine.getId(),fightTeamInfo);
|
||||
}
|
||||
|
||||
}
|
|
@ -92,7 +92,9 @@ public class CumulationData {
|
|||
public int wearEquipTimes;// 妖灵师穿戴装备件数达到
|
||||
public Map<Integer,Integer> synthesisHeroStarTimesMap = new HashMap<>();// 碎片合成%s星妖灵师次数达到
|
||||
|
||||
public Map<Integer,Integer> heroUpStarTimesMap = new HashMap<>();// 碎片合成%s星妖灵师次数达到
|
||||
public Map<Integer,Integer> heroUpStarTimesMap = new HashMap<>();//将妖灵师%s进阶次数达到
|
||||
|
||||
public Map<Integer,Integer> heroUpSomeStarTimesMap = new HashMap<>();// 进阶x星卡牌个数达到
|
||||
|
||||
public int consumerStamina; //消耗体力数量达到
|
||||
|
||||
|
@ -100,6 +102,12 @@ public class CumulationData {
|
|||
|
||||
public Set<Integer> differentHeros = new HashSet<>();
|
||||
|
||||
public int buyGenerStoreTimes;
|
||||
|
||||
public int givePresents ; //好友赠礼
|
||||
|
||||
public int friendNums;
|
||||
|
||||
|
||||
|
||||
//任务重置
|
||||
|
@ -141,6 +149,10 @@ public class CumulationData {
|
|||
differentHeros.clear();
|
||||
heroUpStarTimesMap.clear();
|
||||
heroInTeamNums=0;
|
||||
buyGenerStoreTimes=0;
|
||||
heroUpSomeStarTimesMap.clear();
|
||||
givePresents=0;
|
||||
friendNums=0;
|
||||
}
|
||||
|
||||
private void clearArray(int[] source){
|
||||
|
@ -189,6 +201,14 @@ public class CumulationData {
|
|||
heroUpStarTimesMap.put(heroTid,count+1);
|
||||
}
|
||||
|
||||
public void updateHeroUpSomeStarTimes(int heroStar){
|
||||
Integer count = heroUpSomeStarTimesMap.get(heroStar);
|
||||
if(count == null){
|
||||
count = 0;
|
||||
}
|
||||
heroUpStarTimesMap.put(heroStar,count+1);
|
||||
}
|
||||
|
||||
|
||||
public int getSecretRandomCount() {
|
||||
return secretRandomCount;
|
||||
|
|
|
@ -108,6 +108,7 @@ public class UserMissionManager extends MongoBase {
|
|||
case DAILY_MISSION_REWARD:{
|
||||
dailyMissionIdsType.rewardMission((int)parm[0], missionTypeEnumListMap.get(GameMisionType.DAILYMISSION));
|
||||
calCumulationDataResult(user,MissionType.FINSIH_DAYILY_TIMES,missionTypeEnumListMap,(int)parm[0]);
|
||||
updateString("dailyMissionIdsType",dailyMissionIdsType);
|
||||
}
|
||||
break;
|
||||
case TREASURE_MISSION_REWARD:{
|
||||
|
@ -123,6 +124,7 @@ public class UserMissionManager extends MongoBase {
|
|||
int score = STreasureTaskConfig.sTreasureTaskConfigMap.get(missionId).getPoints();
|
||||
calCumulationDataResult(user,MissionType.SENVER_HAPPY,missionTypeEnumListMap,score);
|
||||
}
|
||||
updateString("sevenHappyMissionType",sevenHappyMissionType);
|
||||
}
|
||||
break;
|
||||
case BEGINNER_MISSION_REWARD:{
|
||||
|
|
|
@ -12,6 +12,7 @@ import com.ljsd.jieling.logic.dao.FriendManager;
|
|||
import com.ljsd.jieling.logic.dao.PlayerManager;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.CommonProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
|
@ -272,6 +273,7 @@ public class FriendLogic {
|
|||
|
||||
initFriendGriveAndRreward(friendId, uid, friendManager, friendfriendManager);
|
||||
sendFriendInfoIndication(uid,friendId,2);
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.FRIEND_NUMS,1);
|
||||
break;
|
||||
case 2://拒绝
|
||||
applyFriends = friendManager.getApplyFriends();
|
||||
|
@ -280,7 +282,8 @@ public class FriendLogic {
|
|||
}
|
||||
break;
|
||||
case 3://全部同意
|
||||
allApplyFriend(uid, friendManager, friends, applyFriends, maxFriends);
|
||||
int nums = allApplyFriend(uid, friendManager, friends, applyFriends, maxFriends);
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.FRIEND_NUMS,nums);
|
||||
break;
|
||||
case 4://全部拒绝
|
||||
friendManager.setApplyFriends(new CopyOnWriteArrayList<>());
|
||||
|
@ -289,10 +292,11 @@ public class FriendLogic {
|
|||
MessageUtil.sendMessage(iSession, 1, msgId, null, true);
|
||||
}
|
||||
|
||||
private void allApplyFriend(int uid, FriendManager friendManager, List<Integer> friends, List<Integer> applyFriends, int maxFriends) throws Exception {
|
||||
private int allApplyFriend(int uid, FriendManager friendManager, List<Integer> friends, List<Integer> applyFriends, int maxFriends) throws Exception {
|
||||
User friendUser;
|
||||
FriendManager friendfriendManager;
|
||||
List<Integer> friendFriendList;
|
||||
int nums =0;
|
||||
for (Integer applyfriendId :applyFriends){
|
||||
friendUser = UserManager.getUser(applyfriendId);
|
||||
friendfriendManager = friendUser.getFriendManager();
|
||||
|
@ -311,7 +315,9 @@ public class FriendLogic {
|
|||
friendManager.addFriendId(applyfriendId);
|
||||
initFriendGriveAndRreward(applyfriendId, uid, friendManager, friendfriendManager);
|
||||
sendFriendInfoIndication(uid,applyfriendId,2);
|
||||
nums++;
|
||||
}
|
||||
return nums;
|
||||
}
|
||||
|
||||
private void initFriendGriveAndRreward(int friendId, int uid, FriendManager friendManager, FriendManager friendfriendManager) {
|
||||
|
@ -377,6 +383,7 @@ public class FriendLogic {
|
|||
FriendManager friendManager = user.getFriendManager();
|
||||
List<Integer> friends = friendManager.getFriends();
|
||||
Map<Integer, Integer> giveMap = friendManager.getGiveMap();
|
||||
int times = 0;
|
||||
if (type == 1) {//赠送一个人
|
||||
if (!friends.contains(friendId)) {
|
||||
MessageUtil.sendErrorResponse(iSession, 0, msgId, "没有该好友");
|
||||
|
@ -398,6 +405,7 @@ public class FriendLogic {
|
|||
if(check){
|
||||
friendManager1.updateHaveRewardMap(uid,1);
|
||||
sendFriendStatedication(uid,friendId,2);
|
||||
times++;
|
||||
}
|
||||
}else{ //赠送全部好友
|
||||
for (Integer friendUserId : friends) {
|
||||
|
@ -415,9 +423,11 @@ public class FriendLogic {
|
|||
if(check){
|
||||
friendManager1.updateHaveRewardMap(uid,1);
|
||||
sendFriendStatedication(uid,friendId,2);
|
||||
times++;
|
||||
}
|
||||
}
|
||||
}
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.GIVE_PRESENT,times);
|
||||
MessageUtil.sendMessage(iSession, 1, msgId, null, true);
|
||||
}
|
||||
|
||||
|
|
|
@ -638,7 +638,7 @@ public class HeroLogic {
|
|||
targetHero.upStar( 1 );
|
||||
Poster.getPoster().dispatchEvent(new HeroUpStarEvent(user.getId(),targetHero.getStar()));
|
||||
targetHero.setStarBreakId(scHeroRankUpConfig.getId());
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.HERO_UP,2,targetHero.getTemplateId());
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.HERO_UP,2,targetHero.getTemplateId(),targetHero.getStar());
|
||||
MessageUtil.sendMessage(session,1,MessageTypeProto.MessageType.UP_HERO_STAR_RESPONSE_VALUE,null,true);
|
||||
if(targetHero.getStar()>=7){
|
||||
String message = SErrorCodeEerverConfig.getI18NMessage("lamp_rankup_hero_content", new Object[]{user.getPlayerInfoManager().getNickName(), scHero.getReadingName(),targetHero.getStar()});
|
||||
|
|
|
@ -46,4 +46,7 @@ public enum GameEvent {
|
|||
|
||||
HERO_IN_TEAM, // 上阵卡牌数量
|
||||
|
||||
GIVE_PRESENT,//赠送体力
|
||||
FRIEND_NUMS,//好友数量
|
||||
|
||||
}
|
||||
|
|
|
@ -559,6 +559,21 @@ public class MissionLoigc {
|
|||
case HERO_IN_TEAM_NUMS:
|
||||
count = cumulationData.heroInTeamNums;
|
||||
break;
|
||||
case BUY_GROCERY_TIMES:
|
||||
count = cumulationData.buyGenerStoreTimes;
|
||||
break;
|
||||
case FRIEND_NUMS:
|
||||
count = cumulationData.friendNums;
|
||||
break;
|
||||
case GIVE_FRIEND_STAMIN_TIMES:
|
||||
count = cumulationData.givePresents;
|
||||
break;
|
||||
case HERO_UP_SOME_STAR_TIMES:
|
||||
num = cumulationData.heroUpSomeStarTimesMap.get(missionSubType[0]);
|
||||
if(num!=null){
|
||||
count = num;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
count = 0;
|
||||
break;
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
package com.ljsd.jieling.logic.mission;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public enum MissionType {
|
||||
RECRUITMENT_RANDOM_HEROES(1), //群英征募 群英招募次数
|
||||
COLLECT_QUALITY_HERO (2), //获得某品质妖灵师 获得SSR、SR品质的妖灵师数量
|
||||
|
@ -62,9 +65,16 @@ public enum MissionType {
|
|||
SYNTHESIS_HERO_STAR_TIMES(47),//碎片合成%s星妖灵师次数达到
|
||||
USER_CONSUMER_STAMINA(48),//消耗体力数量达到
|
||||
COLLECT_DIFFERENT_HEROS(49), // 收集不同妖灵师数目达到
|
||||
ONE_HERO_UP_STAR_TIMES(50), // 收集不同妖灵师数目达到
|
||||
ONE_HERO_UP_STAR_TIMES(50), // 将妖灵师%s进阶次数达到
|
||||
|
||||
HERO_IN_TEAM_NUMS(51), // 上阵卡牌数量
|
||||
|
||||
BUY_GROCERY_TIMES(52),//杂货店购买次数:%s
|
||||
FRIEND_NUMS(53),//拥有好友的个数:%:%s
|
||||
GIVE_FRIEND_STAMIN_TIMES(54),//赠送好友体力次数:%s
|
||||
HERO_UP_SOME_STAR_TIMES(55),//进阶x星卡牌个数达到:%s
|
||||
|
||||
|
||||
;
|
||||
|
||||
private int missionType;
|
||||
|
|
|
@ -3,18 +3,23 @@ package com.ljsd.jieling.logic.mission.data;
|
|||
import com.ljsd.jieling.globals.Global;
|
||||
import com.ljsd.jieling.logic.dao.CumulationData;
|
||||
import com.ljsd.jieling.logic.mission.MissionType;
|
||||
import com.ljsd.jieling.logic.store.StoreType;
|
||||
|
||||
public class BuyGoodsManager implements BaseDataManager {
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
int itemId = (int)parm[0];
|
||||
int itemNum = (int)parm[1];
|
||||
int storeType = (int)parm[2];
|
||||
if(missionType == MissionType.BUY_GOLD_TIMES && itemId == Global.GOLD){
|
||||
data.buyGoldTimes = data.buyGoldTimes + itemNum;
|
||||
return new CumulationData.Result(missionType);
|
||||
}else if(missionType == MissionType.BUY_STAMINA_TIMES && itemId == Global.STAMINA){
|
||||
data.buyStaminaTimes = data.buyStaminaTimes + itemNum;
|
||||
return new CumulationData.Result(missionType);
|
||||
}else if(missionType == MissionType.BUY_GROCERY_TIMES && storeType == StoreType.GENERAL_STORE.getType()){
|
||||
data.buyGenerStoreTimes = data.buyGenerStoreTimes + itemNum;
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -46,6 +46,7 @@ public class DataManagerDistributor {
|
|||
|
||||
judges.put(MissionType.BUY_GOLD_TIMES,new BuyGoodsManager());
|
||||
judges.put(MissionType.BUY_STAMINA_TIMES,new BuyGoodsManager());
|
||||
judges.put(MissionType.BUY_GROCERY_TIMES,new BuyGoodsManager());
|
||||
|
||||
judges.put(MissionType.WORKSHOP_CREATE_EQUIP_NUMS,new WorkShopCreateEquipTimesManager());
|
||||
|
||||
|
@ -73,6 +74,7 @@ public class DataManagerDistributor {
|
|||
judges.put(MissionType.HERO_BREAK_TIMES,new HeroUpDataManager());
|
||||
judges.put(MissionType.HERO_UP_STAR_TIMES,new HeroUpDataManager());
|
||||
judges.put(MissionType.ONE_HERO_UP_STAR_TIMES,new HeroUpDataManager());
|
||||
judges.put(MissionType.HERO_UP_SOME_STAR_TIMES,new HeroUpDataManager());
|
||||
|
||||
judges.put(MissionType.TAKE_CHAPTER_REWARD_TIMES,new TakeActivityRewardHandler());
|
||||
judges.put(MissionType.TAKE_ONLINE_REWARD_TIMES,new TakeActivityRewardHandler());
|
||||
|
@ -86,6 +88,10 @@ public class DataManagerDistributor {
|
|||
|
||||
judges.put(MissionType.HERO_IN_TEAM_NUMS,new HeroInTeamNumsDataManager());
|
||||
|
||||
judges.put(MissionType.GIVE_FRIEND_STAMIN_TIMES,new GivePresentDataManager());
|
||||
|
||||
judges.put(MissionType.FRIEND_NUMS,new FriendNumDataManager());
|
||||
|
||||
|
||||
judges.put(MissionType.VIP_LEVEL,new DefaultDataManager());
|
||||
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
package com.ljsd.jieling.logic.mission.data;
|
||||
|
||||
import com.ljsd.jieling.logic.dao.CumulationData;
|
||||
import com.ljsd.jieling.logic.mission.MissionType;
|
||||
|
||||
public class FriendNumDataManager implements BaseDataManager{
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
int nums = (int)parm[0];
|
||||
data.friendNums+=nums;
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package com.ljsd.jieling.logic.mission.data;
|
||||
|
||||
import com.ljsd.jieling.logic.dao.CumulationData;
|
||||
import com.ljsd.jieling.logic.mission.MissionType;
|
||||
|
||||
public class GivePresentDataManager implements BaseDataManager{
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
int times = (int)parm[0];
|
||||
data.givePresents+=times;
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
}
|
|
@ -7,13 +7,24 @@ public class HeroUpDataManager implements BaseDataManager {
|
|||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
int type = (int) parm[0];
|
||||
if(missionType == MissionType.HERO_BREAK_TIMES && type == 1){
|
||||
data.heroBreakTimes++;
|
||||
}else if(missionType == MissionType.HERO_UP_STAR_TIMES && type == 2){
|
||||
data.heroUpStarTimes++;
|
||||
}else if(missionType == MissionType.ONE_HERO_UP_STAR_TIMES && type == 2){
|
||||
int heroTid = (int) parm[1];
|
||||
data.updateHeroUpStarTimes(heroTid);
|
||||
if(type == 1){
|
||||
if(missionType == MissionType.HERO_BREAK_TIMES){
|
||||
data.heroBreakTimes++;
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}else if(type == 2){
|
||||
if(missionType == MissionType.HERO_UP_STAR_TIMES){
|
||||
data.heroUpStarTimes++;
|
||||
}else if(missionType == MissionType.ONE_HERO_UP_STAR_TIMES){
|
||||
int heroTid = (int) parm[1];
|
||||
data.updateHeroUpStarTimes(heroTid);
|
||||
}else if(missionType == MissionType.HERO_UP_SOME_STAR_TIMES){
|
||||
int heroStar = (int) parm[2];
|
||||
data.updateHeroUpSomeStarTimes(heroStar);
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -150,6 +150,7 @@ public class MissionEventDistributor {
|
|||
typeList = new ArrayList<>();
|
||||
typeList.add(MissionType.BUY_GOLD_TIMES);
|
||||
typeList.add(MissionType.BUY_STAMINA_TIMES);
|
||||
typeList.add(MissionType.BUY_GROCERY_TIMES);
|
||||
eventEnumListMap.put(GameEvent.BUY_MATERIAL,typeList);
|
||||
eventProcessor.put(GameEvent.BUY_MATERIAL,new CumulationDataEventProcessor());
|
||||
|
||||
|
@ -189,6 +190,7 @@ public class MissionEventDistributor {
|
|||
typeList.add(MissionType.HERO_BREAK_TIMES);
|
||||
typeList.add(MissionType.HERO_UP_STAR_TIMES);
|
||||
typeList.add(MissionType.ONE_HERO_UP_STAR_TIMES);
|
||||
typeList.add(MissionType.HERO_UP_SOME_STAR_TIMES);
|
||||
eventEnumListMap.put(GameEvent.HERO_UP,typeList);
|
||||
eventProcessor.put(GameEvent.HERO_UP,new CumulationDataEventProcessor());
|
||||
|
||||
|
@ -219,6 +221,16 @@ public class MissionEventDistributor {
|
|||
eventEnumListMap.put(GameEvent.HERO_IN_TEAM,typeList);
|
||||
eventProcessor.put(GameEvent.HERO_IN_TEAM,new CumulationDataEventProcessor());
|
||||
|
||||
typeList = new ArrayList<>();
|
||||
typeList.add(MissionType.GIVE_FRIEND_STAMIN_TIMES);
|
||||
eventEnumListMap.put(GameEvent.GIVE_PRESENT,typeList);
|
||||
eventProcessor.put(GameEvent.GIVE_PRESENT,new CumulationDataEventProcessor());
|
||||
|
||||
typeList = new ArrayList<>();
|
||||
typeList.add(MissionType.FRIEND_NUMS);
|
||||
eventEnumListMap.put(GameEvent.FRIEND_NUMS,typeList);
|
||||
eventProcessor.put(GameEvent.FRIEND_NUMS,new CumulationDataEventProcessor());
|
||||
|
||||
}
|
||||
|
||||
private static final ThreadLocal<Map<GameMisionType, List<MissionStateChangeInfo>>> threadMissionChangeList =
|
||||
|
|
|
@ -305,7 +305,7 @@ public class StoreLogic {
|
|||
}
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, dropItems, BIReason.STORE_BUY_ITEM);
|
||||
if(SStoreTypeConfig.getsStoreTypeConfigMap().get(storeId).getStoreType() != StoreType.GIFT_STORE.getType()){
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.BUY_MATERIAL,sStoreConfig.getGoods()[0][0],itemNum);
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.BUY_MATERIAL,sStoreConfig.getGoods()[0][0],itemNum,SStoreTypeConfig.getsStoreTypeConfigMap().get(storeId).getStoreType());
|
||||
}
|
||||
if(itemId==10005){
|
||||
Poster.getPoster().dispatchEvent(new GoldEvent(user.getId(),itemNum));
|
||||
|
|
Loading…
Reference in New Issue