回春散逻辑提交

back_recharge
lvxinran 2020-06-05 10:16:09 +08:00
parent f60bca059e
commit 47ad4f8c1c
8 changed files with 17 additions and 8 deletions

View File

@ -1328,17 +1328,17 @@ public class TimeUtils {
}
/**
*
*
* @param hour
* @param lastOrUnder truefalse
* @return
*/
public static long getLastOrUnderHour(long time,int hour,boolean lastOrUnder){
public static long getLastOrUnderHour(long time,int hour,int minute,boolean lastOrUnder){
Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(time);
int i = cal.get(Calendar.HOUR_OF_DAY);
cal.set(Calendar.HOUR_OF_DAY,hour);
cal.set(Calendar.MINUTE,0);
cal.set(Calendar.MINUTE,minute);
cal.set(Calendar.SECOND,0);
cal.set(Calendar.MILLISECOND,0);
long result = cal.getTimeInMillis();

View File

@ -2589,8 +2589,10 @@ public class MapLogic {
}else{
//todo 加血逻辑
int maxHp = propertyMap.get(HeroAttributeEnum.Hp.getPropertyId());
propertyMap.put(HeroAttributeEnum.CurHP.getPropertyId(),curHp+maxHp*5000/10000);
int resultHp = Math.min(curHp+maxHp*5000/10000,maxHp);
propertyMap.put(HeroAttributeEnum.CurHP.getPropertyId(),resultHp);
trialInfo.getHeroInfo().get(heroId).setProperty(propertyMap);
mapManager.updateTrialAddHpCount(1);
mapManager.updateTrailHeroInfo(heroInfo);
}
MessageUtil.sendMessage(session,1,messageType.getNumber(),null);

View File

@ -803,6 +803,10 @@ public class MapManager extends MongoBase {
trialInfo.setQuitMapId(mapId);
updateString("trialInfo",trialInfo);
}
public void updateTrialAddHpCount(int count){
trialInfo.setAddHpCount(count+trialInfo.getAddHpCount());
updateString("trialInfo",trialInfo);
}
}

View File

@ -282,6 +282,7 @@ public class BehaviorUtil {
.setUnitSkillIds(heroSkill.substring(0,heroSkill.length()-1))
.setProperty(property.substring(0, property.length()-1))
.setPosition(teamPosHeroInfo.getPosition())
.setStar(trailHero.getStar())
.build();
heroFightInfos.add(heroFightInfo);
}

View File

@ -93,6 +93,7 @@ public class TowerMap extends AbstractMap {
if(!trialInfo.getMapInfo().isEmpty()&&mapManager.getCurMapId()==0){
mapManager.setMapInfo(trialInfo.getMapInfo());
mapManager.setCurMapId(trialInfo.getQuitMapId());
mapManager.setCurXY(trialInfo.getCurXY());
List<CommonProto.Cell> cells = new ArrayList<>(trialInfo.getMapInfo().size());
for (Map.Entry<Integer, Cell> entry : trialInfo.getMapInfo().entrySet()) {
cellToProto(cells, entry);
@ -134,6 +135,7 @@ public class TowerMap extends AbstractMap {
if(teamPosHeroInfos!=null&&teamPosHeroInfos.size()==1){
mapEnterResponse.setCurHero(teamPosHeroInfos.get(0).getHeroId());
}
mapEnterResponse.setAddHpCount(trialInfo.getAddHpCount());
}
@Override
@ -384,8 +386,8 @@ public class TowerMap extends AbstractMap {
createCell=callChief(user);
}
remainHp = checkResult[2];
BehaviorUtil.destoryApointXY(user, destoryXY);
}
BehaviorUtil.destoryApointXY(user, destoryXY);
//生成传送门,需要在删点之后
if(createCell!=null){
mapManager.addOrUpdateCell(createCell.getCellId(),createCell);

View File

@ -1285,7 +1285,7 @@ public class ActivityLogic implements IEventHandler{
}
public void getTreasureNextRefreshTime(ISession session,MessageTypeProto.MessageType messageType) throws Exception {
int dayRefreshTime=(int) (TimeUtils.getLastOrUnderHour(TimeUtils.now(), 5, false)/1000);
int dayRefreshTime=(int) (TimeUtils.getLastOrUnderHour(TimeUtils.now(), 5,0, false)/1000);
int weekRefreshTime = (int)(TimeUtils.getNextWeekendStartTime(1,5)/1000);
PlayerInfoProto.TreasureRefreshTimeResponse response = PlayerInfoProto.TreasureRefreshTimeResponse.newBuilder().setDayTime(dayRefreshTime).setWeekTime(weekRefreshTime).build();
MessageUtil.sendMessage(session,1,messageType.getNumber(),response,true);

View File

@ -367,7 +367,7 @@ public class PlayerManager extends MongoBase {
}else {
maxTime = TimeUtils.now()/1000+config.getContinueTime()[0];
}
maxTime = (int)(TimeUtils.getLastOrUnderHour(maxTime*1000,5,true)/1000);
maxTime = (int)(TimeUtils.getLastOrUnderHour(maxTime*1000,5,0,true)/1000);
newVipInfo.setEffectTime((int)maxTime);
}
this.vipInfo.put(privilageId,newVipInfo);

View File

@ -96,7 +96,7 @@ public class UserMissionManager extends MongoBase {
case TREASH_REFRESH:
int[] refreshIds =resetTreasureTaskInfo(1,missionTypeEnumListMap,treasureCumulationData);
treasureCumulationData = new CumulationData();
int dayRefreshTime=(int) (TimeUtils.getLastOrUnderHour(TimeUtils.now(), 5, false)/1000);
int dayRefreshTime=(int) (TimeUtils.getLastOrUnderHour(TimeUtils.now(), 5, 0,false)/1000);
CommonProto.RefreshTask.Builder task = treasureIndicationBuild(1, refreshIds).setRefreshTime(dayRefreshTime);
PlayerInfoProto.TreasureRefreshIndication indication1 = PlayerInfoProto.TreasureRefreshIndication.newBuilder().addTasks(task.build()).build();
MessageUtil.sendIndicationMessage(session,1, MessageTypeProto.MessageType.TREASURE_REFRESH_INDICATION_VALUE,indication1,true);