英雄属性公式修改

back_recharge
lvxinran 2020-04-09 19:54:33 +08:00
parent b1b01decdb
commit fb3c445361
6 changed files with 55 additions and 26 deletions

View File

@ -1,6 +1,7 @@
package com.ljsd.jieling.logic.activity;
import com.ljsd.jieling.core.GlobalsDef;
import com.ljsd.jieling.core.VipPrivilegeType;
import com.ljsd.jieling.db.redis.RedisKey;
import com.ljsd.jieling.db.redis.RedisUtil;
import com.ljsd.jieling.globals.Global;
@ -12,6 +13,7 @@ import com.ljsd.jieling.logic.dao.ActivityProgressInfo;
import com.ljsd.jieling.logic.dao.UserManager;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.mail.MailLogic;
import com.ljsd.jieling.logic.player.PlayerLogic;
import com.ljsd.jieling.logic.rank.RankContext;
import com.ljsd.jieling.logic.rank.RankEnum;
import com.ljsd.jieling.logic.rank.rankImpl.AbstractRank;
@ -40,6 +42,11 @@ public class LimitRandomCardActivity extends AbstractActivity {
Poster.getPoster().listenEvent(this,RandomCardEvent.class);
}
@Override
public void initActivity(User user){
user.getPlayerInfoManager().clearVipCount(VipPrivilegeType.TIME_RANDOM_FREE);
}
@Override
public void onEvent(IEvent event) throws Exception {
if(! (event instanceof RandomCardEvent) ){

View File

@ -333,6 +333,11 @@ public class PlayerManager extends MongoBase {
updateString("vipInfo", vipInfo);
setHadTakeDailyBoxVip(-1);
}
public void clearVipCount(int priviliageId){
vipInfo.put(priviliageId,new VipInfo());
updateString("vipInfo", vipInfo);
}
public void addVipInfo(int privilageId){
SPrivilegeTypeConfig config = SPrivilegeTypeConfig.getsPrivilegeTypeConfigMap().get(privilageId);

View File

@ -825,23 +825,31 @@ public class HeroLogic{
int templateId = hero.getTemplateId();
SCHero scHero = SCHero.getsCHero().get(templateId);
SHeroLevlConfig sHeroLevlConfig = SHeroLevlConfig.getsCHero().get(hero.getLevel());
float characterLevelPara = sHeroLevlConfig.getCharacterLevelPara();
Map<Integer, Float> paraForHero = getParaForHero(hero);
int[][] characterLevelPara = sHeroLevlConfig.getCharacterLevelPara();
Map<Integer, Object> paraForHero = getParaForHero(hero);
Map<Integer,Float> baseValueMap = new HashMap<>();
baseValueMap.put(GlobalsDef.HP_TYPE,getBaseValueByType(scHero,GlobalsDef.HP_TYPE));
baseValueMap.put(GlobalsDef.ATTACK_TYPE,getBaseValueByType(scHero,GlobalsDef.ATTACK_TYPE));
baseValueMap.put(GlobalsDef.PHYSICAL_DEFENCE_TYPE,getBaseValueByType(scHero,GlobalsDef.PHYSICAL_DEFENCE_TYPE));
baseValueMap.put(GlobalsDef.MAGIC_DEFENCE_TYPE,getBaseValueByType(scHero,GlobalsDef.MAGIC_DEFENCE_TYPE));
baseValueMap.put(GlobalsDef.SPEED_TYPE,getBaseValueByType(scHero,GlobalsDef.SPEED_TYPE));
for(Map.Entry<Integer,Float> item : baseValueMap.entrySet()){
Integer attributeType = item.getKey();
Float heroBaseValue = item.getValue();
if(attributeType == GlobalsDef.SPEED_TYPE){
result.put (attributeType,(int)(heroBaseValue * sHeroLevlConfig.getSpeedLevelPara() + STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting().calSpeed(heroBaseValue, hero.getBreakId())));
}else{
result.put(attributeType,(int)(heroBaseValue * ( 1 + paraForHero.get(GlobalsDef.RANKUP_PARA_TYPE)/10000.f) * characterLevelPara + heroBaseValue * paraForHero.get(GlobalsDef.BREAK_PARA_TYPE)/10000.f));
int[] levelAttr = Arrays.stream(characterLevelPara).filter(param -> param[0] == attributeType).findFirst().get();
float value = heroBaseValue + levelAttr[1];
int[][] rankUpParam = (int[][]) paraForHero.get(GlobalsDef.RANKUP_PARA_TYPE);
if(rankUpParam!=null){
int[] rankAttr = Arrays.stream(rankUpParam).filter(param -> param[0] == attributeType).findFirst().get();
value = value *(rankAttr[2] == 0 ? 1 : (rankAttr[2] / 10000.f))+rankAttr[1];
}
int[][] breakParam = (int[][]) paraForHero.get(GlobalsDef.BREAK_PARA_TYPE);
if(breakParam!=null){
int[] breakAttr = Arrays.stream(breakParam).filter(param -> param[0] == attributeType).findFirst().get();
value += breakAttr[1];
}
result.put(attributeType,(int)value);
System.out.println(result);
}
if(!isForce){
Map<Integer, Integer> secondaryFactorMap = scHero.getSecondaryFactorMap();
@ -856,22 +864,30 @@ public class HeroLogic{
Map<Integer,Integer> result = new HashMap<>();
SCHero scHero = SCHero.getsCHero().get(templateId);
SHeroLevlConfig sHeroLevlConfig = SHeroLevlConfig.getsCHero().get(heroLevl);
float characterLevelPara = sHeroLevlConfig.getCharacterLevelPara();
Map<Integer, Float> paraForHero = getParaForRobotHero(scHero,heroLevl,templateId);
int[][] characterLevelPara = sHeroLevlConfig.getCharacterLevelPara();
Map<Integer, Object> paraForHero = getParaForRobotHero(scHero,heroLevl,templateId);
Map<Integer,Float> baseValueMap = new HashMap<>();
baseValueMap.put(GlobalsDef.HP_TYPE,getBaseValueByType(scHero,GlobalsDef.HP_TYPE));
baseValueMap.put(GlobalsDef.ATTACK_TYPE,getBaseValueByType(scHero,GlobalsDef.ATTACK_TYPE));
baseValueMap.put(GlobalsDef.PHYSICAL_DEFENCE_TYPE,getBaseValueByType(scHero,GlobalsDef.PHYSICAL_DEFENCE_TYPE));
baseValueMap.put(GlobalsDef.MAGIC_DEFENCE_TYPE,getBaseValueByType(scHero,GlobalsDef.MAGIC_DEFENCE_TYPE));
baseValueMap.put(GlobalsDef.SPEED_TYPE,getBaseValueByType(scHero,GlobalsDef.SPEED_TYPE));
for(Map.Entry<Integer,Float> item : baseValueMap.entrySet()){
Integer attributeType = item.getKey();
Float heroBaseValue = item.getValue();
if(attributeType == GlobalsDef.SPEED_TYPE){
result.put (attributeType,(int)(heroBaseValue * sHeroLevlConfig.getSpeedLevelPara() + STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting().calSpeed(heroBaseValue, heroBreakId)));
}else{
result.put(attributeType,(int)(heroBaseValue * ( 1 + paraForHero.get(GlobalsDef.RANKUP_PARA_TYPE)/10000.f) * characterLevelPara + heroBaseValue * paraForHero.get(GlobalsDef.BREAK_PARA_TYPE)/10000.f));
int[] levelAttr = Arrays.stream(characterLevelPara).filter(param -> param[0] == attributeType).findFirst().get();
float value = heroBaseValue + levelAttr[1];
int[][] rankUpParam = (int[][]) paraForHero.get(GlobalsDef.RANKUP_PARA_TYPE);
if(rankUpParam!=null){
int[] rankAttr = Arrays.stream(rankUpParam).filter(param -> param[0] == attributeType).findFirst().get();
value *= rankAttr[1] == 0 ? 1 : rankAttr[1] / 10000.f+rankAttr[2];
}
int[][] breakParam = (int[][]) paraForHero.get(GlobalsDef.BREAK_PARA_TYPE);
if(breakParam!=null){
int[] breakAttr = Arrays.stream(breakParam).filter(param -> param[0] == attributeType).findFirst().get();
value += breakAttr[1];
}
result.put(attributeType,(int)value);
}
if(!isForce){
Map<Integer, Integer> secondaryFactorMap = scHero.getSecondaryFactorMap();
@ -900,11 +916,12 @@ public class HeroLogic{
return 0;
}
private Map<Integer,Float> getParaRate(SCHero scHero,int heroStar,int heroLevel,int heroBreakId){
Map<Integer,Float> result = new HashMap<>(2);
float rankupPara =0.0f;
private Map<Integer,Object> getParaRate(SCHero scHero,int heroStar,int heroLevel,int heroBreakId){
System.out.println(scHero.getId());
Map<Integer,Object> result = new HashMap<>(2);
Object rankupPara=null;
//突破系数
float breakPara = 0.0f;
Object breakPara=null;
Map<Integer, SCHeroRankUpConfig> scHeroRankUpConfigByTypeOfStar = STableManager.getFigureConfig(HeroStaticConfig.class).getScHeroRankUpConfigByType(GlobalsDef.UP_STAR_TYPE,scHero.getStar());
if(scHeroRankUpConfigByTypeOfStar!= null){
SCHeroRankUpConfig scHeroRankUpConfig = scHeroRankUpConfigByTypeOfStar.get(heroStar-1);
@ -920,7 +937,8 @@ public class HeroLogic{
Map<Integer, SCHeroRankUpConfig> scHeroRankUpConfigByTypOfBreak = STableManager.getFigureConfig(HeroStaticConfig.class).getScHeroRankUpConfigByType(GlobalsDef.BREAK_TYPE,scHero.getStar());
for( SCHeroRankUpConfig scHeroRankUpConfigTmp :scHeroRankUpConfigByTypOfBreak.values()){
if( heroLevel >= scHeroRankUpConfigTmp.getLimitLevel() && heroBreakId>= scHeroRankUpConfigTmp.getId() && breakPara< scHeroRankUpConfigTmp.getRankupPara()){
// && breakPara< scHeroRankUpConfigTmp.getRankupPara()
if( heroLevel >= scHeroRankUpConfigTmp.getLimitLevel() && heroBreakId>= scHeroRankUpConfigTmp.getId() ){
breakPara = scHeroRankUpConfigTmp.getRankupPara();
}
if(heroLevel < scHeroRankUpConfigTmp.getOpenLevel()){
@ -932,13 +950,13 @@ public class HeroLogic{
return result;
}
private Map<Integer,Float> getParaForHero(Hero hero){
private Map<Integer,Object> getParaForHero(Hero hero){
SCHero scHero = SCHero.getsCHero().get(hero.getTemplateId());
return getParaRate(scHero, hero.getStar(), hero.getLevel(), hero.getBreakId());
}
//todo
private Map<Integer,Float> getParaForRobotHero(SCHero scHero,int level,int breakId){
private Map<Integer,Object> getParaForRobotHero(SCHero scHero,int level,int breakId){
return getParaRate(scHero, scHero.getStar(),level, breakId);
}

View File

@ -9,7 +9,7 @@ public class SCHeroRankUpConfig implements BaseConfig{
private int type;
private float rankupPara;
private int[][] rankupPara;
private int limitLevel;
@ -41,7 +41,7 @@ public class SCHeroRankUpConfig implements BaseConfig{
return type;
}
public float getRankupPara() {
public int[][] getRankupPara() {
return rankupPara;
}

View File

@ -40,7 +40,6 @@ public class SEquipTalismana implements BaseConfig {
for(Map.Entry<Integer,SEquipTalismana> entry: equipTalismanaMap.entrySet()){
equipTalismanaStarMap.computeIfAbsent(entry.getValue().getTalismanaId(),v->new HashMap<>()).put(entry.getValue().getLevel(),entry.getValue());
}
System.out.println();
}

View File

@ -14,7 +14,7 @@ public class SHeroLevlConfig implements BaseConfig{
private int level;
private float characterLevelPara;
private int[][] characterLevelPara;
private float speedLevelPara;
@ -47,7 +47,7 @@ public class SHeroLevlConfig implements BaseConfig{
return sHeroLevlConfigMap;
}
public float getCharacterLevelPara() {
public int[][] getCharacterLevelPara() {
return characterLevelPara;
}