升星活动
parent
04001f09b6
commit
4bed1f51f9
|
|
@ -137,7 +137,7 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
||||||
Map<Integer, Integer> heroHandBook = heroManager.getHeroHandBook();
|
Map<Integer, Integer> heroHandBook = heroManager.getHeroHandBook();
|
||||||
List<CommonProto.EveryHeroHandBook> heroHandBookList = new ArrayList<>();
|
List<CommonProto.EveryHeroHandBook> heroHandBookList = new ArrayList<>();
|
||||||
heroHandBook.forEach((k,v)->heroHandBookList.add(CommonProto.EveryHeroHandBook.newBuilder().setHeroId(k).setMaxStar(v).build()));
|
heroHandBook.forEach((k,v)->heroHandBookList.add(CommonProto.EveryHeroHandBook.newBuilder().setHeroId(k).setMaxStar(v).build()));
|
||||||
|
initHeroStar(user);
|
||||||
Set<Integer> equipHandBookSet = user.getEquipManager().getEquipHandBook().keySet();
|
Set<Integer> equipHandBookSet = user.getEquipManager().getEquipHandBook().keySet();
|
||||||
int equipPool = user.getEquipManager().getSoulEquipPool();
|
int equipPool = user.getEquipManager().getSoulEquipPool();
|
||||||
List<CommonProto.GiftGoodsInfo> goodsBagInfo = new ArrayList<>(SRechargeCommodityNewConfig.configMap.size());
|
List<CommonProto.GiftGoodsInfo> goodsBagInfo = new ArrayList<>(SRechargeCommodityNewConfig.configMap.size());
|
||||||
|
|
@ -235,5 +235,17 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化英雄星级map(针对老号)
|
||||||
|
* @param user
|
||||||
|
*/
|
||||||
|
private void initHeroStar(User user){
|
||||||
|
if(user.getHeroManager().getHeroStarMap().size()>1){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for(Hero hero : user.getHeroManager().getHeroMap().values()){
|
||||||
|
user.getHeroManager().addHeroStar(hero.getTemplateId(),hero.getStar());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ public class HeroStarActivity extends AbstractActivity {
|
||||||
Map<Integer, ActivityProgressInfo> activityProgressInfoMap = activityMission.getActivityMissionMap();
|
Map<Integer, ActivityProgressInfo> activityProgressInfoMap = activityMission.getActivityMissionMap();
|
||||||
List<SActivityRewardConfig> list = SActivityRewardConfig.getsActivityRewardConfigByActivityId(id);
|
List<SActivityRewardConfig> list = SActivityRewardConfig.getsActivityRewardConfigByActivityId(id);
|
||||||
|
|
||||||
int maxstar = user.getHeroManager().getHeroHandBook().get(heroId);
|
int maxstar = user.getHeroManager().getHeroStarMap().get(heroId);
|
||||||
for (SActivityRewardConfig sActivityRewardConfig : list) {
|
for (SActivityRewardConfig sActivityRewardConfig : list) {
|
||||||
if (maxstar >= sActivityRewardConfig.getValues()[0][1]) {
|
if (maxstar >= sActivityRewardConfig.getValues()[0][1]) {
|
||||||
ActivityProgressInfo activityProgressInfo = activityProgressInfoMap.getOrDefault(sActivityRewardConfig.getId(), null);
|
ActivityProgressInfo activityProgressInfo = activityProgressInfoMap.getOrDefault(sActivityRewardConfig.getId(), null);
|
||||||
|
|
@ -60,6 +60,8 @@ public class HeroStarActivity extends AbstractActivity {
|
||||||
continue;
|
continue;
|
||||||
if(activityProgressInfo.getState()<1){
|
if(activityProgressInfo.getState()<1){
|
||||||
activityProgressInfo.setState(1);
|
activityProgressInfo.setState(1);
|
||||||
|
}else{
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
activityMission.getActivityMissionMap().put(sActivityRewardConfig.getId(), activityProgressInfo);
|
activityMission.getActivityMissionMap().put(sActivityRewardConfig.getId(), activityProgressInfo);
|
||||||
}
|
}
|
||||||
|
|
@ -86,7 +88,7 @@ public class HeroStarActivity extends AbstractActivity {
|
||||||
Map<Integer, ActivityProgressInfo> activityProgressInfoMap = activityMission.getActivityMissionMap();
|
Map<Integer, ActivityProgressInfo> activityProgressInfoMap = activityMission.getActivityMissionMap();
|
||||||
List<SActivityRewardConfig> list = SActivityRewardConfig.getsActivityRewardConfigByActivityId(id);
|
List<SActivityRewardConfig> list = SActivityRewardConfig.getsActivityRewardConfigByActivityId(id);
|
||||||
heroId = list.get(0).getValues()[0][0];
|
heroId = list.get(0).getValues()[0][0];
|
||||||
Integer maxstar = user.getHeroManager().getHeroHandBook().get(heroId);
|
Integer maxstar = user.getHeroManager().getHeroStarMap().get(heroId);
|
||||||
if(maxstar == null){
|
if(maxstar == null){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ public class FiveStarGetEvent implements IEvent {
|
||||||
private int heroid;
|
private int heroid;
|
||||||
|
|
||||||
public FiveStarGetEvent(int uid,int heroid){
|
public FiveStarGetEvent(int uid,int heroid){
|
||||||
|
this.uid = uid;
|
||||||
this.heroid = heroid;
|
this.heroid = heroid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ public class HeroManager extends MongoBase {
|
||||||
|
|
||||||
private Map<Integer,Integer> heroHandBook = new HashMap<>();
|
private Map<Integer,Integer> heroHandBook = new HashMap<>();
|
||||||
private Set<Integer> heroHandBookEnabled = new HashSet<>();
|
private Set<Integer> heroHandBookEnabled = new HashSet<>();
|
||||||
|
private Map<Integer,Integer> heroStarMap = new HashMap<>();
|
||||||
|
|
||||||
|
|
||||||
private Map<String,Hero> endlessHeroInfo = new HashMap<>();
|
private Map<String,Hero> endlessHeroInfo = new HashMap<>();
|
||||||
|
|
@ -96,6 +97,7 @@ public class HeroManager extends MongoBase {
|
||||||
updateString("heroMap." + hero.getId(), hero);
|
updateString("heroMap." + hero.getId(), hero);
|
||||||
heroMap.put(hero.getId(), hero);
|
heroMap.put(hero.getId(), hero);
|
||||||
addHeroHandBook(hero.getTemplateId(),hero.getStar());
|
addHeroHandBook(hero.getTemplateId(),hero.getStar());
|
||||||
|
addHeroStar(hero.getTemplateId(),hero.getStar());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Hero getHero(String heroId) {
|
public Hero getHero(String heroId) {
|
||||||
|
|
@ -136,6 +138,18 @@ public class HeroManager extends MongoBase {
|
||||||
return heroHandBook;
|
return heroHandBook;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void addHeroStar(int heroId,int star){
|
||||||
|
if(heroStarMap.getOrDefault(heroId,0) >= star){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
heroStarMap.put(heroId,Math.max(heroStarMap.getOrDefault(heroId,0),star));
|
||||||
|
updateString("heroStarMap." + heroId, star);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<Integer,Integer> getHeroStarMap(){
|
||||||
|
return heroStarMap;
|
||||||
|
}
|
||||||
|
|
||||||
public int getFirstTenth() {
|
public int getFirstTenth() {
|
||||||
return firstTenth;
|
return firstTenth;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1150,6 +1150,7 @@ public class HeroLogic{
|
||||||
ItemUtil.itemCost(user,removeItemMap,BIReason.COMPLEX_EQUIP_CONSUME,0);
|
ItemUtil.itemCost(user,removeItemMap,BIReason.COMPLEX_EQUIP_CONSUME,0);
|
||||||
|
|
||||||
rankUpHeroExecute(targetHero);
|
rankUpHeroExecute(targetHero);
|
||||||
|
user.getHeroManager().addHeroStar(targetHero.getTemplateId(),targetHero.getStar());
|
||||||
Poster.getPoster().dispatchEvent(new HeroUpStarEvent(user.getId(),targetHero.getTemplateId(),targetHero.getStar()));
|
Poster.getPoster().dispatchEvent(new HeroUpStarEvent(user.getId(),targetHero.getTemplateId(),targetHero.getStar()));
|
||||||
|
|
||||||
targetHero.setStarBreakId(scHeroRankUpConfig.getId());
|
targetHero.setStarBreakId(scHeroRankUpConfig.getId());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue