同步牛气冲天创角时间活动修复,同步心愿固定概率调整(包括法灵),同步助阵
parent
2b5e48af3a
commit
09959ed6a3
|
|
@ -0,0 +1,39 @@
|
|||
package com.ljsd.jieling.logic.dao;
|
||||
|
||||
public class AssistBox {
|
||||
private int id;
|
||||
private int state;
|
||||
private String heroId;
|
||||
|
||||
public AssistBox(){}
|
||||
|
||||
public AssistBox(int id){
|
||||
this.id = id;
|
||||
this.state = 0;
|
||||
this.heroId = "";
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(int state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public String getHeroId() {
|
||||
return heroId;
|
||||
}
|
||||
|
||||
public void setHeroId(String heroId) {
|
||||
this.heroId = heroId;
|
||||
}
|
||||
}
|
||||
|
|
@ -9,9 +9,9 @@ import com.ljsd.jieling.logic.dao.root.User;
|
|||
import com.ljsd.jieling.logic.hero.HongMengAttributeEnum;
|
||||
import config.SLikeAbilityConfig;
|
||||
import config.SSpecialConfig;
|
||||
import config.SWishConfig;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import util.StringUtil;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
|
@ -129,6 +129,8 @@ public class HeroManager extends MongoBase {
|
|||
private Map<Integer,Map<Integer,Integer>> LifeGridMap = new HashMap<>();//命格数据
|
||||
private Map<Integer,TransformationInfo> transformationList = new HashMap<>();//变身卡列表
|
||||
|
||||
private Map<Integer, AssistBox> assistBoxMap = new HashMap<>();//助阵盒子
|
||||
|
||||
public Map<Integer, SixiangProfessionInfo> getSixiangDataMap() {
|
||||
return sixiangDataMap;
|
||||
}
|
||||
|
|
@ -141,6 +143,9 @@ public class HeroManager extends MongoBase {
|
|||
return heroLikableMap;
|
||||
}
|
||||
|
||||
public int drawFiveStarHeroNum;//点将招募获取5星英雄的抽中次数
|
||||
public int drawFabaoNum;//法宝招募获取法宝的抽中次数
|
||||
|
||||
/**
|
||||
* 获取单个英雄好感度加成属性
|
||||
*/
|
||||
|
|
@ -210,19 +215,6 @@ public class HeroManager extends MongoBase {
|
|||
updateString("randomCountByType."+type, value);
|
||||
}
|
||||
|
||||
public int getWeightByDraw(int type){
|
||||
int weight = 0;
|
||||
Map<Integer, SWishConfig> map = SWishConfig.map;
|
||||
Integer count = randomCountByType.getOrDefault(type, 0);
|
||||
for (SWishConfig config : map.values()) {
|
||||
if (count < config.getDrawCardNumber()){
|
||||
break;
|
||||
}
|
||||
weight = config.getWeight();
|
||||
}
|
||||
return weight;
|
||||
}
|
||||
|
||||
public int getCountByDraw(int type){
|
||||
return randomCountByType.getOrDefault(type, 0);
|
||||
}
|
||||
|
|
@ -307,15 +299,17 @@ public class HeroManager extends MongoBase {
|
|||
updateString("randomPoolByType." + type, map);
|
||||
}
|
||||
|
||||
public Map<String, Hero> getItemMap() {
|
||||
return heroMap;
|
||||
}
|
||||
|
||||
public void setItemMap(Map<String, Hero> heroMap) {
|
||||
public void setHeroMap(Map<String, Hero> heroMap) {
|
||||
this.heroMap = heroMap;
|
||||
updateString("heroMap", heroMap);
|
||||
}
|
||||
|
||||
public void addHero(Hero hero) throws Exception {
|
||||
public void updateHero(Hero hero) {
|
||||
this.heroMap.put(hero.getId(), hero);
|
||||
updateString("heroMap", heroMap);
|
||||
}
|
||||
|
||||
public void addHero(Hero hero) {
|
||||
//绑定关系
|
||||
hero.init(this.getRootId(),getMongoKey() + ".heroMap." + hero.getId());
|
||||
updateString("heroMap." + hero.getId(), hero);
|
||||
|
|
@ -679,6 +673,66 @@ public class HeroManager extends MongoBase {
|
|||
updateString("xiuweiLevel", xiuweiLevel);
|
||||
}
|
||||
|
||||
public Map<Integer, AssistBox> getAssistBoxMap() {
|
||||
return assistBoxMap;
|
||||
}
|
||||
|
||||
public void setAssistBoxMap(Map<Integer, AssistBox> assistBoxMap) {
|
||||
this.assistBoxMap = assistBoxMap;
|
||||
updateString("assistBoxMap", assistBoxMap);
|
||||
}
|
||||
|
||||
public void putAssistBox(AssistBox box) {
|
||||
this.assistBoxMap.put(box.getId(), box);
|
||||
updateString("assistBoxMap", assistBoxMap);
|
||||
}
|
||||
|
||||
public AssistBox getAssistBox(int id) {
|
||||
AssistBox box = assistBoxMap.get(id);
|
||||
if (box == null){
|
||||
box = new AssistBox(id);
|
||||
}
|
||||
return box;
|
||||
}
|
||||
|
||||
public List<Integer> getOpenAssistBoxIds() {
|
||||
ArrayList<Integer> list = new ArrayList<>();
|
||||
for (AssistBox value : assistBoxMap.values()) {
|
||||
if (value.getState() == 1){
|
||||
list.add(value.getId());
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public Map<String, Integer> getAssistHeroIds() {
|
||||
HashMap<String, Integer> map = new HashMap<>();
|
||||
for (AssistBox value : assistBoxMap.values()) {
|
||||
if (!StringUtil.isEmpty(value.getHeroId())){
|
||||
map.put(value.getHeroId(),value.getId());
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
public void setDrawFiveStarHeroNum(int drawFiveStarHeroNum){
|
||||
this.drawFiveStarHeroNum = drawFiveStarHeroNum;
|
||||
updateString("drawFiveStarHeroNum", drawFiveStarHeroNum);
|
||||
}
|
||||
|
||||
public int getDrawFiveStarHeroNum(){
|
||||
return this.drawFiveStarHeroNum;
|
||||
}
|
||||
|
||||
public void setDrawFabaoNum(int drawFabaoNum){
|
||||
this.drawFabaoNum = drawFabaoNum;
|
||||
updateString("drawFabaoNum", drawFabaoNum);
|
||||
}
|
||||
|
||||
public int getDrawFabaoNum(){
|
||||
return this.drawFabaoNum;
|
||||
}
|
||||
|
||||
public int getHongMengLevel(){
|
||||
if(this.getHongmengTablet() > 0){
|
||||
return this.getHongmengTablet();
|
||||
|
|
|
|||
|
|
@ -949,14 +949,37 @@ public class HeroLogic {
|
|||
private int[] wishDrawCardCheck(User user, int[] item, int type) {
|
||||
// 查找物品
|
||||
SItem sItem = SItem.getsItemMap().get(item[0]);
|
||||
// 非英雄奖励直接返回
|
||||
if (sItem.getXinyuan() != 1) {
|
||||
return item;
|
||||
//法宝聚灵通过获取碎片的数量判断,大于等于50个代表抽中
|
||||
if(type == 15){
|
||||
if(item == null || item.length < 2){
|
||||
return item;
|
||||
}
|
||||
int num = item[1];
|
||||
if(num < 50){//未抽中直接返回
|
||||
return item;
|
||||
}
|
||||
}else{
|
||||
// 非5星英雄或法宝奖励直接返回
|
||||
if (sItem.getXinyuan() != 1) {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
|
||||
int weight = getWeightByDraw(user, type);
|
||||
int randomInt = MathUtils.randomInt(10000);
|
||||
if (randomInt <= weight) {
|
||||
//记录抽中5星英雄或法宝的数量
|
||||
int fiveStarHeroCount = 0;
|
||||
if(type == 4){//法宝
|
||||
fiveStarHeroCount = user.getHeroManager().getDrawFabaoNum()+ 1;
|
||||
user.getHeroManager().setDrawFabaoNum(fiveStarHeroCount);
|
||||
}else if(type == 1){//英雄
|
||||
fiveStarHeroCount = user.getHeroManager().getDrawFiveStarHeroNum() + 1;
|
||||
user.getHeroManager().setDrawFiveStarHeroNum(fiveStarHeroCount);
|
||||
}else if(type == 15){//法宝聚灵
|
||||
//法宝聚灵心愿概率为100%,抽中次数设置为3,取余必然中
|
||||
fiveStarHeroCount = 3;
|
||||
}
|
||||
//固定30%概率,次数个位数在3,6,9时固定出
|
||||
int value = fiveStarHeroCount % 10;
|
||||
if(value == 3 || value == 6 || value == 9){
|
||||
// 读取格子信息
|
||||
Integer integer = user.getPlayerInfoManager().getDesireDraw().getOrDefault(type, 0);
|
||||
// null表示未中心愿, 该格子已锁定, 是空格子
|
||||
|
|
@ -1040,7 +1063,6 @@ public class HeroLogic {
|
|||
// }
|
||||
// return item;
|
||||
}
|
||||
|
||||
/**
|
||||
* 从抽卡获取服务器开服时间
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue