副本修改

back_recharge
lvxinran 2020-08-28 04:10:01 +08:00
parent 064d737212
commit f078d184f0
2 changed files with 50 additions and 3 deletions

View File

@ -6,6 +6,7 @@ import com.ljsd.fight.CheckFight;
import com.ljsd.fight.FightType;
import com.ljsd.jieling.config.clazzStaticCfg.CommonStaticConfig;
import com.ljsd.jieling.config.clazzStaticCfg.MapStaticConfig;
import com.ljsd.jieling.core.GlobalsDef;
import com.ljsd.jieling.db.redis.RedisKey;
import com.ljsd.jieling.db.redis.RedisUtil;
import com.ljsd.jieling.exception.ErrorCode;
@ -300,7 +301,7 @@ public abstract class AbstractMap implements IMap {
int[] checkResult = new int[0];
int monsterGroupId=0;
List<Integer> remainHp = new ArrayList<>(5);
List<Integer> remainHp = new ArrayList<>(6);
int seed = Integer.parseInt((String) valueMap.get(RedisKey.FIGHT_SEED));
monsterGroupId = Integer.parseInt((String) valueMap.get(RedisKey.FIGHT_GROUPID));
CommonProto.FightTeamInfo.Builder fightTeamBuilder = CommonProto.FightTeamInfo.newBuilder();
@ -352,6 +353,29 @@ public abstract class AbstractMap implements IMap {
}
return;
}
//无尽本更新血量
if(mapManager.getCurMapType()==MapEnum.ENDLESS_MAP.getType()){
List<TeamPosHeroInfo> team = user.getTeamPosManager().getTeamPosForHero().get(GlobalsDef.ENDLESS_TEAM);
if(resultCode==0) {
user.getTeamPosManager().updateTeamPosByTeamId(GlobalsDef.ENDLESS_TEAM, new ArrayList<>());
for (int i = 0 ; i <team.size();i++) {
mapManager.updateEndlessHeroHp(team.get(i).getHeroId(),0);
}
}else{
for (int i = 0 ; i <team.size();i++) {
int position = team.get(i).getPosition();
Hero hero = user.getHeroManager().getHero(team.get(i).getHeroId());
Map<Integer, Integer> heroAllAttribute = HeroLogic.getInstance().calHeroNotBufferAttribute(user, hero,false,GlobalsDef.ENDLESS_TEAM);
int per = (int)(checkResult[position+1] / (double) heroAllAttribute.get(HeroAttributeEnum.Hp.getPropertyId())*10000);
if(checkResult[i+1]>0&&per<=0){
per = 1;
}
mapManager.updateEndlessHeroHp(team.get(i).getHeroId(),per);
}
}
}
for (int i = 2; i < checkResult.length; i++) {
if (checkResult[i] <= 0) {
remainHp.add(0);

View File

@ -215,6 +215,19 @@ public class EndlessMap extends AbstractMap{
int groupId = option[0];
PVEFightEvent pveFightEvent = new PVEFightEvent(uid, GlobalsDef.ENDLESS_TEAM, 10, "", GameFightType.MapFastFight, groupId, 3);
// List<TeamPosHeroInfo> endteam = user.getTeamPosManager().getTeamPosForHero().get(GlobalsDef.ENDLESS_TEAM);
// Map<String,Integer> bloodMap = new HashMap<>();
// Map<String, Integer> endlessHeroInfo = mapManager.getEndlessMapInfo().getEndlessHeroInfo();
// for (int i = 0 ; i <endteam.size();i++) {
//
// String heroId= endteam.get(i).getHeroId();
//// Hero hero = user.getHeroManager().getHero(endteam.get(i).getHeroId());
//// Map<Integer, Integer> heroAllAttribute = HeroLogic.getInstance().calHeroNotBufferAttribute(user, hero,false,GlobalsDef.ENDLESS_TEAM);
//// int blood = (int)((heroAllAttribute.get(HeroAttributeEnum.Hp.getPropertyId())/10000d)* endlessHeroInfo.get(heroId));
//
// bloodMap.put(heroId,(10000-endlessHeroInfo.get(heroId))/100);
// }
// pveFightEvent.setAttackBloodMap(bloodMap);
//怪物剩余血量
FightResult fightResult = FightDispatcher.dispatcher(pveFightEvent);
int[] checkResult = fightResult.getCheckResult();
@ -233,19 +246,29 @@ public class EndlessMap extends AbstractMap{
}
}else{
for (int i = 0 ; i <team.size();i++) {
int position = team.get(i).getPosition();
Hero hero = user.getHeroManager().getHero(team.get(i).getHeroId());
Map<Integer, Integer> heroAllAttribute = HeroLogic.getInstance().calHeroNotBufferAttribute(user, hero,false,GlobalsDef.ENDLESS_TEAM);
int per = (int)(checkResult[i+2] / (double) heroAllAttribute.get(HeroAttributeEnum.Hp.getPropertyId())*10000);
if(checkResult[i+2]>0&&per<=0){
int per = (int)(checkResult[position+1] / (double) heroAllAttribute.get(HeroAttributeEnum.Hp.getPropertyId())*10000);
if(checkResult[i+1]>0&&per<=0){
per = 1;
}
mapManager.updateEndlessHeroHp(team.get(i).getHeroId(),per);
}
endlessRefreshMonster(uid,mapManager.getTriggerXY());
List<TeamPosHeroInfo> updateTeam = new ArrayList<>();
Map<String, Integer> endlessHeroInfo = mapManager.getEndlessMapInfo().getEndlessHeroInfo();
for(TeamPosHeroInfo info:team){
if(endlessHeroInfo.containsKey(info.getHeroId())&&endlessHeroInfo.get(info.getHeroId())!=0){
updateTeam.add(info);
}
}
user.getTeamPosManager().updateTeamPosByTeamId(GlobalsDef.ENDLESS_TEAM, updateTeam);
}
mapManager.setLastFightResult(resultCode);