vip
parent
65747a5daf
commit
ca2386824b
|
@ -19,6 +19,7 @@ public class SHeroLevlConfig implements BaseConfig{
|
|||
private float speedLevelPara;
|
||||
|
||||
private int[][] consume;
|
||||
private int[][] sumConsume;
|
||||
|
||||
|
||||
|
||||
|
@ -52,6 +53,10 @@ public class SHeroLevlConfig implements BaseConfig{
|
|||
return consume;
|
||||
}
|
||||
|
||||
public int[][] getSumConsume() {
|
||||
return sumConsume;
|
||||
}
|
||||
|
||||
public float getSpeedLevelPara() {
|
||||
return speedLevelPara;
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.ljsd.jieling.logic.dao;
|
|||
import com.ljsd.jieling.logic.mission.MissionType;
|
||||
import com.ljsd.jieling.logic.mission.data.DataManagerDistributor;
|
||||
|
||||
import java.util.BitSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -14,7 +15,7 @@ public class CumulationData {
|
|||
//key: 抽卡类型 value 抽卡次数
|
||||
// private Map<Integer,Integer> randomCountMap = new HashMap<>(); // 抽卡次数统计
|
||||
|
||||
public int recruitmentRands; //群英征募 群英招募次数
|
||||
private int recruitmentRands; //群英征募 群英招募次数
|
||||
|
||||
|
||||
/**
|
||||
|
@ -25,7 +26,10 @@ public class CumulationData {
|
|||
*
|
||||
* key:heroTid, value :数量
|
||||
*/
|
||||
private Map<Integer,Integer> sHeroCountMap=new HashMap<>(); // 妖灵师数量统计
|
||||
// private Map<Integer,Integer> sHeroCountMap=new HashMap<>(); // 妖灵师数量统计
|
||||
|
||||
// * 获得某品质妖灵师 次数 获得需求品质妖灵师 3.4.5
|
||||
private int[] heroQualityCount = new int[3];
|
||||
|
||||
|
||||
/**
|
||||
|
@ -36,7 +40,7 @@ public class CumulationData {
|
|||
/**
|
||||
* key:副本类型 value:战斗次数
|
||||
*/
|
||||
private Map<Integer,Integer> storyFightCountMap=new HashMap<>(); // 不同副本挑战次数
|
||||
// private Map<Integer,Integer> storyFightCountMap=new HashMap<>(); // 不同副本挑战次数
|
||||
|
||||
/**
|
||||
* 获得某品质装备数量
|
||||
|
@ -53,6 +57,9 @@ public class CumulationData {
|
|||
|
||||
private int consumeGem ;
|
||||
|
||||
private Map<Integer,Integer> storyFightInfo =new HashMap<>(3);
|
||||
private BitSet exploreFight = new BitSet(512);
|
||||
|
||||
|
||||
public Result updateData(MissionType missionType, Object...parm) throws Exception {
|
||||
return DataManagerDistributor.updateData(this, missionType,parm);
|
||||
|
@ -85,18 +92,6 @@ public class CumulationData {
|
|||
}
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getsHeroCountMap() {
|
||||
return sHeroCountMap;
|
||||
}
|
||||
|
||||
|
||||
public Map<Integer, Integer> getStoryFightCountMap() {
|
||||
return storyFightCountMap;
|
||||
}
|
||||
|
||||
public void setStoryFightCountMap(Map<Integer, Integer> storyFightCountMap) {
|
||||
this.storyFightCountMap = storyFightCountMap;
|
||||
}
|
||||
|
||||
public int getSecretRandomCount() {
|
||||
return secretRandomCount;
|
||||
|
@ -145,4 +140,40 @@ public class CumulationData {
|
|||
public void updateEquipQuality(int quality ){
|
||||
sEquipQualityCount[quality-1]=sEquipQualityCount[quality-1]+1;
|
||||
}
|
||||
|
||||
|
||||
public int getRecruitmentRands() {
|
||||
return recruitmentRands;
|
||||
}
|
||||
|
||||
public void setRecruitmentRands(int recruitmentRands) {
|
||||
this.recruitmentRands = recruitmentRands;
|
||||
}
|
||||
public void updateHeroQualityCount(int quality){
|
||||
heroQualityCount[quality-3] = heroQualityCount[quality-3] +1;
|
||||
}
|
||||
|
||||
public int[] getHeroQualityCount() {
|
||||
return heroQualityCount;
|
||||
}
|
||||
|
||||
public int[] getsEquipQualityCount() {
|
||||
return sEquipQualityCount;
|
||||
}
|
||||
|
||||
public void addExploreFight(int exploreFigtId){
|
||||
exploreFight.set(exploreFigtId);
|
||||
}
|
||||
|
||||
public void setStoryFightInfo(Map<Integer, Integer> storyFightInfo) {
|
||||
this.storyFightInfo = storyFightInfo;
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getStoryFightInfo() {
|
||||
return storyFightInfo;
|
||||
}
|
||||
|
||||
public BitSet getExploreFight() {
|
||||
return exploreFight;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -185,6 +185,8 @@ public class ItemLogic {
|
|||
MessageUtil.sendErrorResponse(iSession,0,msgId,erroMags);
|
||||
return;
|
||||
}
|
||||
//1裸角色卡(没有突破过的角色卡)熔炼后返还的材料=当前等级返还升级材料+item表返还材料
|
||||
//2有过突破的卡 =当前等级返还升级材料+突破表返还材料
|
||||
for (String heroId : heroIdsList) {
|
||||
Hero hero = heroManager.getHeroMap().get(heroId);
|
||||
SItem sItem = SItem.getsItemMap().get(hero.getTemplateId());
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.ljsd.jieling.logic.mission;
|
|||
|
||||
|
||||
import com.ljsd.jieling.config.SCHero;
|
||||
import com.ljsd.jieling.config.SLevelDifficultyConfig;
|
||||
import com.ljsd.jieling.config.STaskConfig;
|
||||
import com.ljsd.jieling.config.SVipLevelConfig;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
|
@ -86,17 +87,10 @@ public class MissionLoigc {
|
|||
Integer count =0;
|
||||
switch (missionType){
|
||||
case RECRUITMENT_RANDOM_HEROES:
|
||||
// count = cumulationData.getRandomCountMap().get(1);
|
||||
count = cumulationData.getRecruitmentRands();
|
||||
break;
|
||||
case COLLECT_QUALITY_HERO:
|
||||
Map<Integer, Integer> getsHeroCountMap = cumulationData.getsHeroCountMap();
|
||||
for(Map.Entry<Integer,Integer> item : getsHeroCountMap.entrySet()){
|
||||
SCHero scHero = SCHero.getsCHero().get(item.getKey());
|
||||
int star = scHero.getStar();
|
||||
if(star == missionSubType){
|
||||
count += item.getValue();
|
||||
}
|
||||
}
|
||||
count = cumulationData.getHeroQualityCount()[missionSubType-3];
|
||||
break;
|
||||
case HERO_LEVLE_COUNT:
|
||||
count = cumulationData.getHeroLevleCountMap().get(missionSubType);
|
||||
|
@ -142,24 +136,26 @@ public class MissionLoigc {
|
|||
count = user.getPlayerInfoManager().getMaxForce();
|
||||
break;
|
||||
case USER_CONSUMER_GEM:
|
||||
//count=cumulationData.getConsumeMaterialMap().get(missionSubType);
|
||||
count=cumulationData.getConsumeGem();
|
||||
break;
|
||||
case USER_WORKSHOP_LEVEL:
|
||||
count =user.getWorkShopController().getWorkShopLevel();
|
||||
break;
|
||||
case USER_GET_EQUIP_QUALITY:
|
||||
/* Map<Integer, Integer> equipCountMap = cumulationData.getsEquipCountMap();
|
||||
for(Map.Entry<Integer,Integer> item:equipCountMap.entrySet()){
|
||||
SEquipConfig sEquipConfig = SEquipConfig.getsEquipConfigById(item.getKey());
|
||||
if(sEquipConfig.getQuality() == missionSubType){
|
||||
count += item.getValue();
|
||||
}
|
||||
}*/
|
||||
count = cumulationData.getsEquipQualityCount()[missionSubType-1];
|
||||
break;
|
||||
case LEVEL_STORY_PASS:
|
||||
if(SLevelDifficultyConfig.getLevelDifficultyMap().containsKey(missionSubType)){
|
||||
int type = SLevelDifficultyConfig.getLevelDifficultyMap().get(missionSubType).getType();
|
||||
if(cumulationData.getHeroLevleCountMap().containsKey(type)){
|
||||
count =missionSubType <=cumulationData.getHeroLevleCountMap().get(type) ?1:0;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case GENERAL_STORY_PASS:
|
||||
case HERO_STORY_PASS:
|
||||
count = cumulationData.getStoryFightCountMap().get(missionSubType);
|
||||
count = cumulationData.getExploreFight().get(missionSubType)?1:0;
|
||||
break;
|
||||
case KILL_INVASIONBOSS:
|
||||
count = cumulationData.getKillInvasionbossCount();
|
||||
|
|
|
@ -25,22 +25,19 @@ public class DataManagerDistributor {
|
|||
judges.put(MissionType.USER_LEVEL,new DefaultDataManager());
|
||||
judges.put(MissionType.USER_FORCE,new DefaultDataManager());
|
||||
|
||||
judges.put(MissionType.USER_CONSUMER_GEM,new DefaultDataManager());
|
||||
judges.put(MissionType.USER_CONSUMER_GEM,new ConsumerMaterialDataManager());
|
||||
|
||||
judges.put(MissionType.USER_WORKSHOP_LEVEL,new DefaultDataManager());
|
||||
|
||||
judges.put(MissionType.USER_GET_EQUIP_QUALITY,new GetEquipDataManager());
|
||||
|
||||
judges.put(MissionType.LEVEL_STORY_PASS,new DefaultDataManager());
|
||||
judges.put(MissionType.GENERAL_STORY_PASS,new DefaultDataManager());
|
||||
judges.put(MissionType.HERO_STORY_PASS,new DefaultDataManager());
|
||||
judges.put(MissionType.LEVEL_STORY_PASS,new FightDataManager());
|
||||
judges.put(MissionType.GENERAL_STORY_PASS,new FightDataManager());
|
||||
judges.put(MissionType.HERO_STORY_PASS,new FightDataManager());
|
||||
|
||||
judges.put(MissionType.KILL_INVASIONBOSS,new KillInvasionBossDataManager());
|
||||
judges.put(MissionType.SECRETBOX_TIMES,new SecretboxRandomManager());
|
||||
judges.put(MissionType.EQUIP_FORCE_NUMS,new DefaultDataManager());
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static CumulationData.Result updateData(CumulationData data, MissionType missionType, Object...parm) throws Exception {
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
package com.ljsd.jieling.logic.mission.data;
|
||||
|
||||
import com.ljsd.jieling.config.SLevelDifficultyConfig;
|
||||
import com.ljsd.jieling.logic.dao.CumulationData;
|
||||
import com.ljsd.jieling.logic.dao.LevelDifficulty;
|
||||
import com.ljsd.jieling.logic.mission.MissionType;
|
||||
|
||||
public class FightDataManager implements BaseDataManager{
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
CumulationData.Result result = null;
|
||||
int fightId = (int)parm[0];
|
||||
int fightType = (int)parm[1];// 0: 故事副本 1: 普通副本
|
||||
if(fightType == 0 && missionType == MissionType.LEVEL_STORY_PASS){
|
||||
LevelDifficulty levelDifficulty = SLevelDifficultyConfig.getLevelDifficultyMap().get(fightId);
|
||||
int type = levelDifficulty.getType();
|
||||
Integer maxFightId = data.getHeroLevleCountMap().get(type);
|
||||
if(maxFightId!=null){
|
||||
if(fightId>maxFightId){
|
||||
data.getHeroLevleCountMap().put(type,fightId);
|
||||
result = new CumulationData.Result(missionType);
|
||||
}
|
||||
}else{
|
||||
data.getHeroLevleCountMap().put(type,fightId);
|
||||
result = new CumulationData.Result(missionType);
|
||||
}
|
||||
}
|
||||
|
||||
if(fightType == 1 && (missionType == MissionType.GENERAL_STORY_PASS || missionType == MissionType.HERO_STORY_PASS)){
|
||||
data.addExploreFight(fightId);
|
||||
result = new CumulationData.Result(missionType);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
|
@ -1,22 +1,21 @@
|
|||
package com.ljsd.jieling.logic.mission.data;
|
||||
|
||||
|
||||
import com.ljsd.jieling.config.SCHero;
|
||||
import com.ljsd.jieling.logic.dao.CumulationData;
|
||||
import com.ljsd.jieling.logic.mission.MissionType;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class GetHeroManager implements BaseDataManager {
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object ...parm) {
|
||||
Map<Integer, Integer> sHeroCountMap = data.getsHeroCountMap();
|
||||
int count =1;
|
||||
int heroTid = (int)parm[0];
|
||||
int heroStar = (int)parm[1];
|
||||
if(sHeroCountMap.containsKey(heroTid)){
|
||||
count+=sHeroCountMap.get(heroTid);
|
||||
// int heroStar = (int)parm[1];
|
||||
CumulationData.Result result = null;
|
||||
if(missionType == MissionType.COLLECT_QUALITY_HERO){
|
||||
SCHero scHero = SCHero.getsCHero().get(heroTid);
|
||||
data.updateHeroQualityCount(scHero.getStar());
|
||||
result = new CumulationData.Result(missionType);
|
||||
}
|
||||
sHeroCountMap.put(heroTid,count);
|
||||
return null;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,6 @@ public class HeroLevelUpManager implements BaseDataManager{
|
|||
heroLevleCountMap.put(oldLevle,count+1);
|
||||
|
||||
}
|
||||
return null;
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,6 @@ public class KillInvasionBossDataManager implements BaseDataManager{
|
|||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
data.setKillInvasionbossCount(data.getKillInvasionbossCount() +1);
|
||||
return null;
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,10 +6,12 @@ import com.ljsd.jieling.logic.mission.MissionType;
|
|||
public class RandomHeroDataManager implements BaseDataManager{
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
int type =(int)parm[0];
|
||||
int count =(int)parm[1];
|
||||
CumulationData.Result result = null;
|
||||
if(missionType == MissionType.RECRUITMENT_RANDOM_HEROES){
|
||||
result = new CumulationData.Result(missionType, ++data.recruitmentRands);
|
||||
if(type == 1 && missionType == MissionType.RECRUITMENT_RANDOM_HEROES){
|
||||
data.setRecruitmentRands(data.getRecruitmentRands() + count);
|
||||
result = new CumulationData.Result(missionType);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -161,6 +161,7 @@ public class StoreLogic {
|
|||
MessageUtil.sendErrorResponse(iSession,0,msgId,"");
|
||||
return;
|
||||
}
|
||||
|
||||
User user = UserManager.getUser(uid);
|
||||
Map<Integer, StoreInfo> storeInfoMap = user.getStoreManager().getStoreInfoMap();
|
||||
if (!storeInfoMap.containsKey(storeId)){
|
||||
|
@ -202,11 +203,11 @@ public class StoreLogic {
|
|||
if(relatedtoVIP == 1 && limit!=0){
|
||||
playerInfoManager.updateVipPrivilage(limit,itemNum);
|
||||
}
|
||||
// itemNumMap.put(itemId,buyTimes +1);
|
||||
|
||||
itemNumMap.put(itemId,buyTimes +itemNum);
|
||||
storeInfo.setItemNumMap(itemNumMap);
|
||||
int goodsId = sStoreConfig.getGoods()[0];
|
||||
int goodsNum = sStoreConfig.getGoods()[0]*itemNum;
|
||||
int goodsNum = sStoreConfig.getGoods()[1]*itemNum;
|
||||
String reward = goodsId +"#"+goodsNum;
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, StringUtil.parseFiledInt2(reward));
|
||||
PlayerInfoProto.BuyStoreItemResponse builder = PlayerInfoProto.BuyStoreItemResponse.newBuilder().setDrop(drop).build();
|
||||
|
|
Loading…
Reference in New Issue