master_otnew
parent
5306957945
commit
ead65db5c4
|
@ -56,6 +56,7 @@ public class Hero extends MongoBase implements Comparable<Hero>,Cloneable {
|
||||||
this.setRootCollection(User._COLLECTION_NAME);
|
this.setRootCollection(User._COLLECTION_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 置换
|
||||||
public Hero(int uid, int heroTid, int initStar, Hero hero) {
|
public Hero(int uid, int heroTid, int initStar, Hero hero) {
|
||||||
this.setRootCollection(User._COLLECTION_NAME);
|
this.setRootCollection(User._COLLECTION_NAME);
|
||||||
this.id = KeyGenUtils.produceIdByModule(UUIDEnum.HERO, uid);
|
this.id = KeyGenUtils.produceIdByModule(UUIDEnum.HERO, uid);
|
||||||
|
@ -83,9 +84,11 @@ public class Hero extends MongoBase implements Comparable<Hero>,Cloneable {
|
||||||
this.createTime = TimeUtils.nowInt();
|
this.createTime = TimeUtils.nowInt();
|
||||||
this.speed = hero.speed;
|
this.speed = hero.speed;
|
||||||
this.createType = 1;
|
this.createType = 1;
|
||||||
|
this.training = new Training();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 大脑天宫
|
||||||
* 初始化英雄,不入英雄背包
|
* 初始化英雄,不入英雄背包
|
||||||
*/
|
*/
|
||||||
public Hero(Hero hero,int uid,int heroTid,int level) {
|
public Hero(Hero hero,int uid,int heroTid,int level) {
|
||||||
|
@ -108,10 +111,12 @@ public class Hero extends MongoBase implements Comparable<Hero>,Cloneable {
|
||||||
this.jewelInfo = new HashSet<>(hero.getJewelInfo());
|
this.jewelInfo = new HashSet<>(hero.getJewelInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建默认英雄
|
||||||
|
*/
|
||||||
public Hero(int uid, int heroTid, int initStar){
|
public Hero(int uid, int heroTid, int initStar){
|
||||||
this.setRootCollection(User._COLLECTION_NAME);
|
this.setRootCollection(User._COLLECTION_NAME);
|
||||||
this.id = KeyGenUtils.produceIdByModule(UUIDEnum.HERO, uid);
|
this.id = KeyGenUtils.produceIdByModule(UUIDEnum.HERO, uid);
|
||||||
|
|
||||||
SCHero scHero = SCHero.getsCHero().get(heroTid);
|
SCHero scHero = SCHero.getsCHero().get(heroTid);
|
||||||
this.templateId = scHero.getId();
|
this.templateId = scHero.getId();
|
||||||
this.setPropertyId(scHero.getPropertyName());
|
this.setPropertyId(scHero.getPropertyName());
|
||||||
|
@ -126,10 +131,10 @@ public class Hero extends MongoBase implements Comparable<Hero>,Cloneable {
|
||||||
starBreakId = scHeroRankUpConfig.getId();
|
starBreakId = scHeroRankUpConfig.getId();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
createTime = TimeUtils.nowInt();
|
||||||
createTime = (int) (System.currentTimeMillis() / 1000);
|
|
||||||
breakId = 0;
|
breakId = 0;
|
||||||
jewelInfo = new HashSet<>(2);
|
jewelInfo = new HashSet<>(2);
|
||||||
|
training = new Training();
|
||||||
}
|
}
|
||||||
|
|
||||||
//无尽和玉虚使用固定配置英雄
|
//无尽和玉虚使用固定配置英雄
|
||||||
|
|
|
@ -3869,8 +3869,7 @@ public class HeroLogic {
|
||||||
public boolean isBattleArray(User user, String heroId, int[] teamId) {
|
public boolean isBattleArray(User user, String heroId, int[] teamId) {
|
||||||
Map<Integer, List<TeamPosHeroInfo>> teamPosForHero = user.getTeamPosManager().getTeamPosForHero();
|
Map<Integer, List<TeamPosHeroInfo>> teamPosForHero = user.getTeamPosManager().getTeamPosForHero();
|
||||||
//判断是否不可下阵中有该英雄
|
//判断是否不可下阵中有该英雄
|
||||||
|
|
||||||
|
|
||||||
List<Integer> list = new ArrayList<>();
|
List<Integer> list = new ArrayList<>();
|
||||||
Arrays.stream(teamId).forEach(list::add);
|
Arrays.stream(teamId).forEach(list::add);
|
||||||
|
|
||||||
|
|
|
@ -385,9 +385,6 @@ public class CBean2Proto {
|
||||||
public static CommonProto.HeroTraining getTrainingProto(Hero hero){
|
public static CommonProto.HeroTraining getTrainingProto(Hero hero){
|
||||||
CommonProto.HeroTraining.Builder builder = CommonProto.HeroTraining.newBuilder();
|
CommonProto.HeroTraining.Builder builder = CommonProto.HeroTraining.newBuilder();
|
||||||
Training training = hero.getTraining();
|
Training training = hero.getTraining();
|
||||||
if (training.getLv() == 0){
|
|
||||||
return builder.build();
|
|
||||||
}
|
|
||||||
builder.setHeroId(hero.getId());
|
builder.setHeroId(hero.getId());
|
||||||
builder.setTrainingLv(training.getLv());
|
builder.setTrainingLv(training.getLv());
|
||||||
builder.setAttackExp(training.getAttackExp());
|
builder.setAttackExp(training.getAttackExp());
|
||||||
|
|
|
@ -22,7 +22,6 @@ import com.ljsd.jieling.logic.activity.activityLogic.GmActivityLogic;
|
||||||
import com.ljsd.jieling.logic.activity.event.*;
|
import com.ljsd.jieling.logic.activity.event.*;
|
||||||
import com.ljsd.jieling.logic.dao.*;
|
import com.ljsd.jieling.logic.dao.*;
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
|
||||||
import com.ljsd.jieling.logic.home.event.HomeEvent;
|
import com.ljsd.jieling.logic.home.event.HomeEvent;
|
||||||
import com.ljsd.jieling.logic.item.ItemLog;
|
import com.ljsd.jieling.logic.item.ItemLog;
|
||||||
import com.ljsd.jieling.logic.item.ItemLogic;
|
import com.ljsd.jieling.logic.item.ItemLogic;
|
||||||
|
@ -1423,7 +1422,7 @@ public class ItemUtil {
|
||||||
}
|
}
|
||||||
heroManager.addHero(hero);
|
heroManager.addHero(hero);
|
||||||
// 鸿蒙阵推送
|
// 鸿蒙阵推送
|
||||||
HeroLogic.getInstance().addOrUpdateHongmeng(OnlineUserManager.getSessionByUid(user.getId()));
|
// HeroLogic.getInstance().addOrUpdateHongmeng(OnlineUserManager.getSessionByUid(user.getId()));
|
||||||
heroList.add(CBean2Proto.getHero(hero));
|
heroList.add(CBean2Proto.getHero(hero));
|
||||||
if (reason != BIReason.HERO_RETURN) {
|
if (reason != BIReason.HERO_RETURN) {
|
||||||
if (scHero.getStar() >= SSpecialConfig.getIntegerValue(SSpecialConfig.lamp_lottery_content_parm)) { //策划资质改成星级
|
if (scHero.getStar() >= SSpecialConfig.getIntegerValue(SSpecialConfig.lamp_lottery_content_parm)) { //策划资质改成星级
|
||||||
|
|
Loading…
Reference in New Issue