mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-14 06:14:45 +01:00
Use rogue manager excel instead of schedule data
This commit is contained in:
@@ -9,7 +9,8 @@ public class GameConstants {
|
||||
public static String VERSION = "1.4.0";
|
||||
public static String MDK_VERSION = "";
|
||||
|
||||
public static final int CURRENT_TIMEZONE = ZoneOffset.systemDefault().getRules().getOffset(Instant.now()).getTotalSeconds() / 3600;
|
||||
public static final ZoneOffset CURRENT_ZONEOFFSET = ZoneOffset.systemDefault().getRules().getOffset(Instant.now());
|
||||
public static final int CURRENT_TIMEZONE = CURRENT_ZONEOFFSET.getTotalSeconds() / 3600;
|
||||
|
||||
// Game
|
||||
public static final String DEFAULT_NAME = "Trailblazer";
|
||||
|
||||
@@ -33,8 +33,8 @@ public class GameData {
|
||||
@Getter private static Int2ObjectMap<ChallengeExcel> challengeExcelMap = new Int2ObjectOpenHashMap<>();
|
||||
@Getter private static Int2ObjectMap<ChallengeTargetExcel> challengeTargetExcelMap = new Int2ObjectOpenHashMap<>();
|
||||
|
||||
@Getter private static Int2ObjectMap<RogueAreaExcel> rogueAreaExcelMap = new Int2ObjectLinkedOpenHashMap<>();
|
||||
@Getter private static Int2ObjectMap<RogueScheduleExcel> rogueScheduleExcelMap = new Int2ObjectOpenHashMap<>();
|
||||
@Getter private static Int2ObjectMap<RogueAreaExcel> rogueAreaExcelMap = new Int2ObjectOpenHashMap<>();
|
||||
@Getter private static Int2ObjectMap<RogueManagerExcel> rogueManagerExcelMap = new Int2ObjectOpenHashMap<>();
|
||||
@Getter private static Int2ObjectMap<RogueRoomExcel> rogueRoomExcelMap = new Int2ObjectOpenHashMap<>();
|
||||
|
||||
private static Int2ObjectMap<AvatarPromotionExcel> avatarPromotionExcelMap = new Int2ObjectOpenHashMap<>();
|
||||
|
||||
@@ -3,10 +3,11 @@ package emu.lunarcore.data;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import emu.lunarcore.GameConstants;
|
||||
import emu.lunarcore.data.excel.RelicMainAffixExcel;
|
||||
import emu.lunarcore.data.excel.RelicSubAffixExcel;
|
||||
import emu.lunarcore.data.excel.RogueMapExcel;
|
||||
import emu.lunarcore.data.excel.RogueScheduleExcel;
|
||||
import emu.lunarcore.data.excel.RogueManagerExcel;
|
||||
import emu.lunarcore.util.Utils;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
@@ -43,10 +44,10 @@ public class GameDepot {
|
||||
}
|
||||
|
||||
// TODO cache this so we dont have to run this function everytime we get the schedule
|
||||
public static RogueScheduleExcel getCurrentRogueSchedule() {
|
||||
public static RogueManagerExcel getCurrentRogueSchedule() {
|
||||
long time = System.currentTimeMillis();
|
||||
|
||||
for (var schedule : GameData.getRogueScheduleExcelMap().values()) {
|
||||
for (var schedule : GameData.getRogueManagerExcelMap().values()) {
|
||||
if (time >= schedule.getBeginTime() && time < schedule.getEndTime()) {
|
||||
return schedule;
|
||||
}
|
||||
|
||||
@@ -3,29 +3,33 @@ package emu.lunarcore.data.excel;
|
||||
import java.time.*;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
import emu.lunarcore.GameConstants;
|
||||
import emu.lunarcore.data.GameResource;
|
||||
import emu.lunarcore.data.ResourceType;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@ResourceType(name = {"ScheduleDataRogue.json"})
|
||||
public class RogueScheduleExcel extends GameResource {
|
||||
@ResourceType(name = {"RogueManager.json"})
|
||||
public class RogueManagerExcel extends GameResource {
|
||||
private static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
private int ID;
|
||||
private int ScheduleDataID;
|
||||
private int RogueSeason;
|
||||
|
||||
@Getter(AccessLevel.NONE)
|
||||
private String BeginTime;
|
||||
@Getter(AccessLevel.NONE)
|
||||
private String EndTime;
|
||||
|
||||
private int[] RogueAreaIDList;
|
||||
|
||||
private transient long beginTime;
|
||||
private transient long endTime;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
return ID;
|
||||
return ScheduleDataID;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -109,7 +109,7 @@ public class RogueManager extends BasePlayerManager {
|
||||
long endTime = beginTime + TimeUnit.DAYS.toSeconds(8);
|
||||
|
||||
if (schedule != null) {
|
||||
seasonId = 68; //schedule.getId() % 100000;
|
||||
seasonId = schedule.getRogueSeason();
|
||||
}
|
||||
|
||||
var score = RogueScoreRewardInfo.newInstance()
|
||||
@@ -146,18 +146,23 @@ public class RogueManager extends BasePlayerManager {
|
||||
}
|
||||
|
||||
// Add areas
|
||||
for (var excel : GameData.getRogueAreaExcelMap().values()) {
|
||||
var area = RogueArea.newInstance()
|
||||
.setAreaId(excel.getRogueAreaID())
|
||||
.setRogueAreaStatus(RogueAreaStatus.ROGUE_AREA_STATUS_FIRST_PASS);
|
||||
|
||||
if (curRogue != null && excel == curRogue.getExcel()) {
|
||||
area.setMapId(curRogue.getExcel().getMapId());
|
||||
area.setCurReachRoomNum(curRogue.getCurrentRoomProgress());
|
||||
area.setRogueStatus(curRogue.getStatus());
|
||||
if (schedule != null) {
|
||||
for (int i = 0; i < schedule.getRogueAreaIDList().length; i++) {
|
||||
var excel = GameData.getRogueAreaExcelMap().get(schedule.getRogueAreaIDList()[i]);
|
||||
if (excel == null) continue;
|
||||
|
||||
var area = RogueArea.newInstance()
|
||||
.setAreaId(excel.getRogueAreaID())
|
||||
.setRogueAreaStatus(RogueAreaStatus.ROGUE_AREA_STATUS_FIRST_PASS);
|
||||
|
||||
if (curRogue != null && excel == curRogue.getExcel()) {
|
||||
area.setMapId(curRogue.getExcel().getMapId());
|
||||
area.setCurReachRoomNum(curRogue.getCurrentRoomProgress());
|
||||
area.setRogueStatus(curRogue.getStatus());
|
||||
}
|
||||
|
||||
proto.addRogueAreaList(area);
|
||||
}
|
||||
|
||||
proto.addRogueAreaList(area);
|
||||
}
|
||||
|
||||
return proto;
|
||||
|
||||
Reference in New Issue
Block a user