精英本功绩修改,元素共鸣代码提交

back_recharge
lvxinran 2019-07-17 20:15:48 +08:00
parent bed7997dcc
commit f0e926a3f9
7 changed files with 113 additions and 9 deletions

View File

@ -24,6 +24,9 @@ public class SAccomplishmentConfig implements BaseConfig {
private int[] reward;
private int scheduleShow;
private static Map<Integer, List<SAccomplishmentConfig>> sAccomplishmentConfigByMapIdMap;
private static Map<Integer,Map<Integer,List<SAccomplishmentConfig>>> sAccomplishmentConfigByMapIdAndLogicMap;
@ -91,4 +94,8 @@ public class SAccomplishmentConfig implements BaseConfig {
public int[] getReward() {
return reward;
}
public int getScheduleShow() {
return scheduleShow;
}
}

View File

@ -32,6 +32,8 @@ public class SEquipConfig implements BaseConfig {
private int ifClear;
private int ifShow;
private int initialLevel;
private int score;
@ -97,4 +99,6 @@ public class SEquipConfig implements BaseConfig {
public int getScore() {
return score;
}
public int getIfShow(){return ifShow; }
}

View File

@ -90,7 +90,7 @@ public class MapManager extends MongoBase {
// 爬塔副本历史最高层
private int highestTower;
//爬塔副本暂存Buff
private Map<Integer,Integer> towerUnusedBuffer;
private Map<Integer,Integer> towerUnusedBuffer = new HashMap<>();
//副本boss坐标
private int bossXY;
//副本boss类型

View File

@ -131,6 +131,7 @@ public class MapMissionManager {
}
}
if(tempResult){
mapMission.setTotalWeight(mapMission.getTotalWeight()+1);
allMissionProgress.put(missionId,-1);
needUpdate = true;
}
@ -149,6 +150,7 @@ public class MapMissionManager {
tempResult = true;
}
if(tempResult){
mapMission.setTotalWeight(mapMission.getTotalWeight()+1);
allMissionProgress.put(missionId,-1);
needUpdate = true;
}
@ -174,6 +176,7 @@ public class MapMissionManager {
tempResult = true;
}
if(tempResult){
mapMission.setTotalWeight(mapMission.getTotalWeight()+1);
allMissionProgress.put(missionId,-1);
needUpdate = true;
}
@ -186,14 +189,17 @@ public class MapMissionManager {
continue;
}
int[] value = sAccomplishmentConfig.getValues()[0];
missionValue = 0-missionValue;
for(int i = 0 ; i <value.length;i++){
if(eventId==value[i]){
missionValue = missionValue | (1<<i);
missionValue = missionValue | (2<<i);
}
}
if(missionValue+1>>value.length==1){
if(missionValue+2>>(value.length+1)==1){
mapMission.setTotalWeight(mapMission.getTotalWeight()+1);
missionValue = -1;
}else{
missionValue = 0-missionValue;
}
allMissionProgress.put(missionId,missionValue);
needUpdate = true;
@ -222,6 +228,7 @@ public class MapMissionManager {
if(i!=value.length-1){
missionValue = value[i];
}else{
mapMission.setTotalWeight(mapMission.getTotalWeight()+1);
missionValue = -1;
}
}else{
@ -249,6 +256,7 @@ public class MapMissionManager {
}
//确认完成
if(missionValue==configValues.length-1){
mapMission.setTotalWeight(mapMission.getTotalWeight()+1);
missionValue=-1;
}
allMissionProgress.put(missionId,missionValue);
@ -280,6 +288,7 @@ public class MapMissionManager {
if(flag){
for(int i = 0 ; i < finishEvent.length;i++){
if(eventId==finishEvent[i]){
mapMission.setTotalWeight(mapMission.getTotalWeight()+1);
missionValue = -1;
}
}

View File

@ -1,6 +1,7 @@
package com.ljsd.jieling.logic.dao;
import com.ljsd.common.mogodb.MongoBase;
import com.ljsd.jieling.config.SEquipConfig;
import com.ljsd.jieling.db.mongo.MongoKey;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.mission.GameEvent;
@ -18,9 +19,9 @@ public class EquipManager extends MongoBase {
public EquipManager() {
this.setRootCollection(User._COLLECTION_NAME);
this.equipHandBook = new HashMap<>();
this.equipMap = new HashMap<>();
this.setRootCollection(User._COLLECTION_NAME);
}
public void addEquip(User user,Equip equip) throws Exception {
@ -50,7 +51,7 @@ public class EquipManager extends MongoBase {
this.unDetermined = unDetermined;
}
public void addEquipHandBook(int equipId){
if(equipHandBook.containsKey(equipId)){
if(equipHandBook.containsKey(equipId)|| SEquipConfig.getsEquipConfigById(equipId).getIfShow()!=1){
return;
}
equipHandBook.put(equipId,0);

View File

@ -864,4 +864,81 @@ public class CombatLogic {
return "";
}
public static Map<String,Map<Integer, Integer>> elementEffect(User user){
Map<String, Map<Integer, Integer>> heroAllAttributeMap = user.getMapManager().getHeroAllAttributeMap();
Map<String, Hero> heroMap = user.getHeroManager().getHeroMap();
//找出上场的Id
Set<String> heroes = heroAllAttributeMap.keySet();
List<Integer> heroFind = new ArrayList<>(heroes.size());
for(String key :heroes){
for(Map.Entry<String,Hero> entry :heroMap.entrySet()){
if(key.equals(entry.getKey())){
heroFind.add(entry.getValue().getTemplateId());
}
}
}
Map<Integer,Integer> propertiesMap = new HashMap<>();
for(Integer heroId:heroFind){
int propertyName = SCHero.sCHero.get(heroId).getPropertyName();
if(propertiesMap.containsKey(propertyName)){
propertiesMap.put(propertyName,propertiesMap.get(propertyName)+1);
}else{
propertiesMap.put(propertyName,1);
}
}
propertiesMap = sortByValueDescending(propertiesMap);
int[][] effect = new int[2][];
int[] normalProperties = new int[3];
int[] special = new int[2];
if(propertiesMap.containsKey(6)){
special[0] = 2;
special[1] = propertiesMap.get(6);
}
normalProperties[0] = 1;
int nomalIndex = 1;
for(Map.Entry<Integer,Integer> entry:propertiesMap.entrySet()){
if(entry.getKey()!=6){
if(entry.getValue()!=1){
normalProperties[nomalIndex] = entry.getValue();
nomalIndex++;
}
}
}
effect[0] = normalProperties;
effect[1] = special;
Map<Integer, SElementalResonanceConfig> configMap = SElementalResonanceConfig.configMap;
List<int[][]> resultEffect = new ArrayList<>();
for(int i = 0; i <effect.length;i++){
for(Map.Entry<Integer,SElementalResonanceConfig> entry:configMap.entrySet()){
if(Arrays.equals(effect[i],entry.getValue().getType())){
resultEffect.add(entry.getValue().getContent());
}
}
}
System.out.println();
return heroAllAttributeMap;
}
public static <K, V extends Comparable<? super V>> Map<K, V> sortByValueDescending(Map<K, V> map)
{
List<Map.Entry<K, V>> list = new LinkedList<Map.Entry<K, V>>(map.entrySet());
Collections.sort(list, new Comparator<Map.Entry<K, V>>()
{
@Override
public int compare(Map.Entry<K, V> o1, Map.Entry<K, V> o2)
{
int compare = (o1.getValue()).compareTo(o2.getValue());
return -compare;
}
});
Map<K, V> result = new LinkedHashMap<K, V>();
for (Map.Entry<K, V> entry : list) {
result.put(entry.getKey(), entry.getValue());
}
return result;
}
}

View File

@ -101,11 +101,17 @@ public class MissionLoigc {
}
if(takeCopyMisionRewards.contains(missionId)){
state=2;
mineProgess=finishProgress;
}
if(mineProgess == -1){
if(mineProgess!=-1){
mineProgess=finishProgress;
}else {
mineProgess=1;
}
}else if(mineProgess == -1){
state=1;
mineProgess=1;
}else if(mineProgess<-1){
mineProgess=0;
}
missionList.add(CommonProto.UserMissionInfo.newBuilder().setMissionId(missionId).setState(state).setType(missionType).setProgress(mineProgess).build());
}