back_recharge
wangyuan 2019-05-29 13:55:41 +08:00
parent 65747a5daf
commit ca2386824b
11 changed files with 123 additions and 55 deletions

View File

@ -19,6 +19,7 @@ public class SHeroLevlConfig implements BaseConfig{
private float speedLevelPara; private float speedLevelPara;
private int[][] consume; private int[][] consume;
private int[][] sumConsume;
@ -52,6 +53,10 @@ public class SHeroLevlConfig implements BaseConfig{
return consume; return consume;
} }
public int[][] getSumConsume() {
return sumConsume;
}
public float getSpeedLevelPara() { public float getSpeedLevelPara() {
return speedLevelPara; return speedLevelPara;
} }

View File

@ -3,6 +3,7 @@ package com.ljsd.jieling.logic.dao;
import com.ljsd.jieling.logic.mission.MissionType; import com.ljsd.jieling.logic.mission.MissionType;
import com.ljsd.jieling.logic.mission.data.DataManagerDistributor; import com.ljsd.jieling.logic.mission.data.DataManagerDistributor;
import java.util.BitSet;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -14,7 +15,7 @@ public class CumulationData {
//key: 抽卡类型 value 抽卡次数 //key: 抽卡类型 value 抽卡次数
// private Map<Integer,Integer> randomCountMap = new HashMap<>(); // 抽卡次数统计 // private Map<Integer,Integer> randomCountMap = new HashMap<>(); // 抽卡次数统计
public int recruitmentRands; //群英征募 群英招募次数 private int recruitmentRands; //群英征募 群英招募次数
/** /**
@ -25,7 +26,10 @@ public class CumulationData {
* *
* key:heroTid, value : * 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: * 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 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 { public Result updateData(MissionType missionType, Object...parm) throws Exception {
return DataManagerDistributor.updateData(this, missionType,parm); 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() { public int getSecretRandomCount() {
return secretRandomCount; return secretRandomCount;
@ -145,4 +140,40 @@ public class CumulationData {
public void updateEquipQuality(int quality ){ public void updateEquipQuality(int quality ){
sEquipQualityCount[quality-1]=sEquipQualityCount[quality-1]+1; 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;
}
} }

View File

@ -185,6 +185,8 @@ public class ItemLogic {
MessageUtil.sendErrorResponse(iSession,0,msgId,erroMags); MessageUtil.sendErrorResponse(iSession,0,msgId,erroMags);
return; return;
} }
//1裸角色卡没有突破过的角色卡熔炼后返还的材料=当前等级返还升级材料+item表返还材料
//2有过突破的卡 =当前等级返还升级材料+突破表返还材料
for (String heroId : heroIdsList) { for (String heroId : heroIdsList) {
Hero hero = heroManager.getHeroMap().get(heroId); Hero hero = heroManager.getHeroMap().get(heroId);
SItem sItem = SItem.getsItemMap().get(hero.getTemplateId()); SItem sItem = SItem.getsItemMap().get(hero.getTemplateId());

View File

@ -2,6 +2,7 @@ package com.ljsd.jieling.logic.mission;
import com.ljsd.jieling.config.SCHero; import com.ljsd.jieling.config.SCHero;
import com.ljsd.jieling.config.SLevelDifficultyConfig;
import com.ljsd.jieling.config.STaskConfig; import com.ljsd.jieling.config.STaskConfig;
import com.ljsd.jieling.config.SVipLevelConfig; import com.ljsd.jieling.config.SVipLevelConfig;
import com.ljsd.jieling.logic.dao.*; import com.ljsd.jieling.logic.dao.*;
@ -86,17 +87,10 @@ public class MissionLoigc {
Integer count =0; Integer count =0;
switch (missionType){ switch (missionType){
case RECRUITMENT_RANDOM_HEROES: case RECRUITMENT_RANDOM_HEROES:
// count = cumulationData.getRandomCountMap().get(1); count = cumulationData.getRecruitmentRands();
break; break;
case COLLECT_QUALITY_HERO: case COLLECT_QUALITY_HERO:
Map<Integer, Integer> getsHeroCountMap = cumulationData.getsHeroCountMap(); count = cumulationData.getHeroQualityCount()[missionSubType-3];
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();
}
}
break; break;
case HERO_LEVLE_COUNT: case HERO_LEVLE_COUNT:
count = cumulationData.getHeroLevleCountMap().get(missionSubType); count = cumulationData.getHeroLevleCountMap().get(missionSubType);
@ -142,24 +136,26 @@ public class MissionLoigc {
count = user.getPlayerInfoManager().getMaxForce(); count = user.getPlayerInfoManager().getMaxForce();
break; break;
case USER_CONSUMER_GEM: case USER_CONSUMER_GEM:
//count=cumulationData.getConsumeMaterialMap().get(missionSubType); count=cumulationData.getConsumeGem();
break; break;
case USER_WORKSHOP_LEVEL: case USER_WORKSHOP_LEVEL:
count =user.getWorkShopController().getWorkShopLevel(); count =user.getWorkShopController().getWorkShopLevel();
break; break;
case USER_GET_EQUIP_QUALITY: case USER_GET_EQUIP_QUALITY:
/* Map<Integer, Integer> equipCountMap = cumulationData.getsEquipCountMap(); count = cumulationData.getsEquipQualityCount()[missionSubType-1];
for(Map.Entry<Integer,Integer> item:equipCountMap.entrySet()){
SEquipConfig sEquipConfig = SEquipConfig.getsEquipConfigById(item.getKey());
if(sEquipConfig.getQuality() == missionSubType){
count += item.getValue();
}
}*/
break; break;
case LEVEL_STORY_PASS: 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 GENERAL_STORY_PASS:
case HERO_STORY_PASS: case HERO_STORY_PASS:
count = cumulationData.getStoryFightCountMap().get(missionSubType); count = cumulationData.getExploreFight().get(missionSubType)?1:0;
break; break;
case KILL_INVASIONBOSS: case KILL_INVASIONBOSS:
count = cumulationData.getKillInvasionbossCount(); count = cumulationData.getKillInvasionbossCount();

View File

@ -25,22 +25,19 @@ public class DataManagerDistributor {
judges.put(MissionType.USER_LEVEL,new DefaultDataManager()); judges.put(MissionType.USER_LEVEL,new DefaultDataManager());
judges.put(MissionType.USER_FORCE,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_WORKSHOP_LEVEL,new DefaultDataManager());
judges.put(MissionType.USER_GET_EQUIP_QUALITY,new GetEquipDataManager()); judges.put(MissionType.USER_GET_EQUIP_QUALITY,new GetEquipDataManager());
judges.put(MissionType.LEVEL_STORY_PASS,new DefaultDataManager()); judges.put(MissionType.LEVEL_STORY_PASS,new FightDataManager());
judges.put(MissionType.GENERAL_STORY_PASS,new DefaultDataManager()); judges.put(MissionType.GENERAL_STORY_PASS,new FightDataManager());
judges.put(MissionType.HERO_STORY_PASS,new DefaultDataManager()); judges.put(MissionType.HERO_STORY_PASS,new FightDataManager());
judges.put(MissionType.KILL_INVASIONBOSS,new KillInvasionBossDataManager()); judges.put(MissionType.KILL_INVASIONBOSS,new KillInvasionBossDataManager());
judges.put(MissionType.SECRETBOX_TIMES,new SecretboxRandomManager()); judges.put(MissionType.SECRETBOX_TIMES,new SecretboxRandomManager());
judges.put(MissionType.EQUIP_FORCE_NUMS,new DefaultDataManager()); judges.put(MissionType.EQUIP_FORCE_NUMS,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 {

View File

@ -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;
}
}

View File

@ -1,22 +1,21 @@
package com.ljsd.jieling.logic.mission.data; 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.dao.CumulationData;
import com.ljsd.jieling.logic.mission.MissionType; import com.ljsd.jieling.logic.mission.MissionType;
import java.util.Map;
public class GetHeroManager implements BaseDataManager { public class GetHeroManager implements BaseDataManager {
@Override @Override
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object ...parm) { 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 heroTid = (int)parm[0];
int heroStar = (int)parm[1]; // int heroStar = (int)parm[1];
if(sHeroCountMap.containsKey(heroTid)){ CumulationData.Result result = null;
count+=sHeroCountMap.get(heroTid); 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 result;
return null;
} }
} }

View File

@ -19,6 +19,6 @@ public class HeroLevelUpManager implements BaseDataManager{
heroLevleCountMap.put(oldLevle,count+1); heroLevleCountMap.put(oldLevle,count+1);
} }
return null; return new CumulationData.Result(missionType);
} }
} }

View File

@ -7,6 +7,6 @@ public class KillInvasionBossDataManager implements BaseDataManager{
@Override @Override
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) { public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
data.setKillInvasionbossCount(data.getKillInvasionbossCount() +1); data.setKillInvasionbossCount(data.getKillInvasionbossCount() +1);
return null; return new CumulationData.Result(missionType);
} }
} }

View File

@ -6,10 +6,12 @@ import com.ljsd.jieling.logic.mission.MissionType;
public class RandomHeroDataManager implements BaseDataManager{ public class RandomHeroDataManager implements BaseDataManager{
@Override @Override
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) { public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
int type =(int)parm[0];
int count =(int)parm[1]; int count =(int)parm[1];
CumulationData.Result result = null; CumulationData.Result result = null;
if(missionType == MissionType.RECRUITMENT_RANDOM_HEROES){ if(type == 1 && missionType == MissionType.RECRUITMENT_RANDOM_HEROES){
result = new CumulationData.Result(missionType, ++data.recruitmentRands); data.setRecruitmentRands(data.getRecruitmentRands() + count);
result = new CumulationData.Result(missionType);
} }
return result; return result;
} }

View File

@ -161,6 +161,7 @@ public class StoreLogic {
MessageUtil.sendErrorResponse(iSession,0,msgId,""); MessageUtil.sendErrorResponse(iSession,0,msgId,"");
return; return;
} }
User user = UserManager.getUser(uid); User user = UserManager.getUser(uid);
Map<Integer, StoreInfo> storeInfoMap = user.getStoreManager().getStoreInfoMap(); Map<Integer, StoreInfo> storeInfoMap = user.getStoreManager().getStoreInfoMap();
if (!storeInfoMap.containsKey(storeId)){ if (!storeInfoMap.containsKey(storeId)){
@ -202,11 +203,11 @@ public class StoreLogic {
if(relatedtoVIP == 1 && limit!=0){ if(relatedtoVIP == 1 && limit!=0){
playerInfoManager.updateVipPrivilage(limit,itemNum); playerInfoManager.updateVipPrivilage(limit,itemNum);
} }
// itemNumMap.put(itemId,buyTimes +1);
itemNumMap.put(itemId,buyTimes +itemNum); itemNumMap.put(itemId,buyTimes +itemNum);
storeInfo.setItemNumMap(itemNumMap); storeInfo.setItemNumMap(itemNumMap);
int goodsId = sStoreConfig.getGoods()[0]; int goodsId = sStoreConfig.getGoods()[0];
int goodsNum = sStoreConfig.getGoods()[0]*itemNum; int goodsNum = sStoreConfig.getGoods()[1]*itemNum;
String reward = goodsId +"#"+goodsNum; String reward = goodsId +"#"+goodsNum;
CommonProto.Drop.Builder drop = ItemUtil.drop(user, StringUtil.parseFiledInt2(reward)); CommonProto.Drop.Builder drop = ItemUtil.drop(user, StringUtil.parseFiledInt2(reward));
PlayerInfoProto.BuyStoreItemResponse builder = PlayerInfoProto.BuyStoreItemResponse.newBuilder().setDrop(drop).build(); PlayerInfoProto.BuyStoreItemResponse builder = PlayerInfoProto.BuyStoreItemResponse.newBuilder().setDrop(drop).build();