mirror of
https://github.com/EggLinks/DanhengServer-OpenSource.git
synced 2026-01-02 20:26:03 +08:00
Feature: Better Chess Rogue Room & Fix Bugs
- The room in chess rogue will be more - Fix a res bug ( recommend to use Andy's res )
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
using EggLink.DanhengServer.Enums.Scene;
|
using EggLink.DanhengServer.Enums.Scene;
|
||||||
using EggLink.DanhengServer.Util;
|
using EggLink.DanhengServer.Util;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
|
||||||
namespace EggLink.DanhengServer.Data.Config
|
namespace EggLink.DanhengServer.Data.Config
|
||||||
{
|
{
|
||||||
@@ -86,6 +87,7 @@ namespace EggLink.DanhengServer.Data.Config
|
|||||||
public string GroupPath { get; set; } = "";
|
public string GroupPath { get; set; } = "";
|
||||||
public bool IsDelete { get; set; }
|
public bool IsDelete { get; set; }
|
||||||
public int ID { get; set; }
|
public int ID { get; set; }
|
||||||
|
public string Name { get; set; } = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ namespace EggLink.DanhengServer.Data.Config
|
|||||||
public int Id;
|
public int Id;
|
||||||
[JsonConverter(typeof(StringEnumConverter))]
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
public GroupLoadSideEnum LoadSide { get; set; }
|
public GroupLoadSideEnum LoadSide { get; set; }
|
||||||
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
|
public GroupCategoryEnum Category { get; set; }
|
||||||
public bool LoadOnInitial { get; set; }
|
public bool LoadOnInitial { get; set; }
|
||||||
public string GroupName { get; set; } = "";
|
public string GroupName { get; set; } = "";
|
||||||
public LoadCondition LoadCondition { get; set; } = new();
|
public LoadCondition LoadCondition { get; set; } = new();
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ namespace EggLink.DanhengServer.Data.Config
|
|||||||
public int ID { get; set; }
|
public int ID { get; set; }
|
||||||
public int SummonUnitID { get; set; }
|
public int SummonUnitID { get; set; }
|
||||||
|
|
||||||
public bool TriggerBattle { get; set; } = true;
|
// Here's a conflict between Dimbreath's res and Andy's res ( we recommend to use the one from Andy's res )
|
||||||
|
public bool TriggerBattle { get; set; } = false;
|
||||||
|
|
||||||
public List<TaskInfo> OnAttack { get; set; } = [];
|
public List<TaskInfo> OnAttack { get; set; } = [];
|
||||||
public List<TaskInfo> OnBattle { get; set; } = [];
|
public List<TaskInfo> OnBattle { get; set; } = [];
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
using EggLink.DanhengServer.Util;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace EggLink.DanhengServer.Data.Custom
|
|
||||||
{
|
|
||||||
public class ChessRogueCellConfig
|
|
||||||
{
|
|
||||||
public double PosX { get; set; }
|
|
||||||
public double PosY { get; set; }
|
|
||||||
public double PosZ { get; set; }
|
|
||||||
public double RotY { get; set; }
|
|
||||||
|
|
||||||
public List<int> Groups { get; set; } = [];
|
|
||||||
|
|
||||||
public Position ToPosition() => new((int) (PosX * 10000), (int) (PosY * 10000), (int) (PosZ * 10000));
|
|
||||||
|
|
||||||
public Position ToRotation() => new(0, (int) RotY * 10000, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,7 @@
|
|||||||
using System;
|
using EggLink.DanhengServer.Enums.Rogue;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@@ -9,14 +12,17 @@ namespace EggLink.DanhengServer.Data.Custom
|
|||||||
public class ChessRogueRoomConfig
|
public class ChessRogueRoomConfig
|
||||||
{
|
{
|
||||||
public int EntranceId { get; set; }
|
public int EntranceId { get; set; }
|
||||||
public List<int> Groups { get; set; } = [];
|
public int RoomPrefix { get; set; }
|
||||||
public Dictionary<int, ChessRogueRoom> CellGroup { get; set; } = [];
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
}
|
public RogueDLCBlockTypeEnum BlockType { get; set; }
|
||||||
|
public int AnchorGroup { get; set; }
|
||||||
|
public int AnchorId { get; set; }
|
||||||
|
|
||||||
public class ChessRogueRoom
|
public List<int> DefaultLoadBasicGroup { get; set; } = [];
|
||||||
{
|
public List<int> DefaultLoadGroup { get; set; } = [];
|
||||||
public List<int> Groups { get; set; } = [];
|
public List<int> DoubleEventLoadGroup { get; set; } = []; // override DefaultLoadGroup
|
||||||
public bool IsBoss { get; set; } = false;
|
public List<int> SelectEventLoadGroup { get; set; } = []; // override DefaultLoadGroup
|
||||||
public bool IsLastBoss { get; set; } = false;
|
|
||||||
|
public List<int> SubMonsterGroup { get; set; } = []; // combine with DefaultLoadGroup
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using EggLink.DanhengServer.Data.Config;
|
using EggLink.DanhengServer.Data.Config;
|
||||||
using EggLink.DanhengServer.Data.Custom;
|
using EggLink.DanhengServer.Data.Custom;
|
||||||
using EggLink.DanhengServer.Data.Excel;
|
using EggLink.DanhengServer.Data.Excel;
|
||||||
|
using EggLink.DanhengServer.Enums.Rogue;
|
||||||
|
|
||||||
namespace EggLink.DanhengServer.Data
|
namespace EggLink.DanhengServer.Data
|
||||||
{
|
{
|
||||||
@@ -49,9 +50,7 @@ namespace EggLink.DanhengServer.Data
|
|||||||
#region ChessRogue
|
#region ChessRogue
|
||||||
|
|
||||||
public static Dictionary<int, ActionPointOverdrawExcel> ActionPointOverdrawData { get; private set; } = [];
|
public static Dictionary<int, ActionPointOverdrawExcel> ActionPointOverdrawData { get; private set; } = [];
|
||||||
public static Dictionary<int, List<int>> ChessRogueContentGenData { get; set; } = [];
|
public static Dictionary<RogueDLCBlockTypeEnum, List<ChessRogueRoomConfig>> ChessRogueRoomData { get; private set; } = [];
|
||||||
public static Dictionary<int, ChessRogueCellConfig> ChessRogueCellGenData { get; set; } = [];
|
|
||||||
public static Dictionary<int, ChessRogueRoomConfig> ChessRogueRoomGenData { get; set; } = [];
|
|
||||||
public static Dictionary<int, RogueDLCAreaExcel> RogueDLCAreaData { get; private set; } = [];
|
public static Dictionary<int, RogueDLCAreaExcel> RogueDLCAreaData { get; private set; } = [];
|
||||||
public static Dictionary<int, RogueDLCBossDecayExcel> RogueDLCBossDecayData { get; private set; } = [];
|
public static Dictionary<int, RogueDLCBossDecayExcel> RogueDLCBossDecayData { get; private set; } = [];
|
||||||
public static Dictionary<int, RogueDLCBossBpExcel> RogueDLCBossBpData { get; private set; } = [];
|
public static Dictionary<int, RogueDLCBossBpExcel> RogueDLCBossBpData { get; private set; } = [];
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ using Newtonsoft.Json;
|
|||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using EggLink.DanhengServer.Data.Custom;
|
using EggLink.DanhengServer.Data.Custom;
|
||||||
using EggLink.DanhengServer.Data.Excel;
|
using EggLink.DanhengServer.Data.Excel;
|
||||||
|
using EggLink.DanhengServer.Enums.Rogue;
|
||||||
|
|
||||||
namespace EggLink.DanhengServer.Data
|
namespace EggLink.DanhengServer.Data
|
||||||
{
|
{
|
||||||
@@ -29,9 +30,7 @@ namespace EggLink.DanhengServer.Data
|
|||||||
GameData.RogueMapGenData = LoadCustomFile<Dictionary<int, List<int>>>("Rogue Map", "RogueMapGen") ?? [];
|
GameData.RogueMapGenData = LoadCustomFile<Dictionary<int, List<int>>>("Rogue Map", "RogueMapGen") ?? [];
|
||||||
GameData.RogueMiracleGroupData = LoadCustomFile<Dictionary<int, List<int>>>("Rogue Miracle Group", "RogueMiracleGroup") ?? [];
|
GameData.RogueMiracleGroupData = LoadCustomFile<Dictionary<int, List<int>>>("Rogue Miracle Group", "RogueMiracleGroup") ?? [];
|
||||||
GameData.RogueMiracleEffectData = LoadCustomFile<RogueMiracleEffectConfig>("Rogue Miracle Effect", "RogueMiracleEffectGen") ?? new();
|
GameData.RogueMiracleEffectData = LoadCustomFile<RogueMiracleEffectConfig>("Rogue Miracle Effect", "RogueMiracleEffectGen") ?? new();
|
||||||
GameData.ChessRogueRoomGenData = LoadCustomFile<Dictionary<int, ChessRogueRoomConfig>>("Chess Rogue Map", "ChessRogueMapGen") ?? [];
|
LoadChessRogueRoomData();
|
||||||
GameData.ChessRogueContentGenData = LoadCustomFile<Dictionary<int, List<int>>>("Chess Rogue Content", "ChessRogueContentGen") ?? [];
|
|
||||||
GameData.ChessRogueCellGenData = LoadCustomFile<Dictionary<int, ChessRogueCellConfig>>("Chess Rogue Cell", "ChessRogueRoomGen") ?? [];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void LoadExcel()
|
public static void LoadExcel()
|
||||||
@@ -476,5 +475,82 @@ namespace EggLink.DanhengServer.Data
|
|||||||
|
|
||||||
Logger.Info("Loaded " + count + " board infos.");
|
Logger.Info("Loaded " + count + " board infos.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void LoadChessRogueRoomData()
|
||||||
|
{
|
||||||
|
var count = 0;
|
||||||
|
|
||||||
|
FileInfo file = new(ConfigManager.Config.Path.ConfigPath + $"/ChessRogueRoomGen.json");
|
||||||
|
List<ChessRogueRoomConfig>? customFile = default;
|
||||||
|
if (!file.Exists)
|
||||||
|
{
|
||||||
|
Logger.Warn($"Banner infos are missing, please check your resources folder: {ConfigManager.Config.Path.ConfigPath}/ChessRogueRoomGen.json. Chess Rogue may not work!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using var reader = file.OpenRead();
|
||||||
|
using StreamReader reader2 = new(reader);
|
||||||
|
var text = reader2.ReadToEnd();
|
||||||
|
var json = JsonConvert.DeserializeObject<List<ChessRogueRoomConfig>>(text);
|
||||||
|
customFile = json;
|
||||||
|
|
||||||
|
foreach (var room in customFile!)
|
||||||
|
{
|
||||||
|
if (room.BlockType == RogueDLCBlockTypeEnum.MonsterNormal)
|
||||||
|
{
|
||||||
|
AddRoomToGameData(RogueDLCBlockTypeEnum.MonsterNormal, room);
|
||||||
|
AddRoomToGameData(RogueDLCBlockTypeEnum.MonsterSwarm, room);
|
||||||
|
count += 2;
|
||||||
|
}
|
||||||
|
else if (room.BlockType == RogueDLCBlockTypeEnum.MonsterBoss)
|
||||||
|
{
|
||||||
|
AddRoomToGameData(RogueDLCBlockTypeEnum.MonsterBoss, room);
|
||||||
|
AddRoomToGameData(RogueDLCBlockTypeEnum.MonsterNousBoss, room);
|
||||||
|
AddRoomToGameData(RogueDLCBlockTypeEnum.MonsterSwarmBoss, room);
|
||||||
|
count += 3;
|
||||||
|
}
|
||||||
|
else if (room.BlockType == RogueDLCBlockTypeEnum.Event)
|
||||||
|
{
|
||||||
|
AddRoomToGameData(RogueDLCBlockTypeEnum.Event, room);
|
||||||
|
AddRoomToGameData(RogueDLCBlockTypeEnum.Reward, room);
|
||||||
|
AddRoomToGameData(RogueDLCBlockTypeEnum.Adventure, room); // adventure is not this type
|
||||||
|
AddRoomToGameData(RogueDLCBlockTypeEnum.NousSpecialEvent, room);
|
||||||
|
AddRoomToGameData(RogueDLCBlockTypeEnum.SwarmEvent, room);
|
||||||
|
AddRoomToGameData(RogueDLCBlockTypeEnum.NousEvent, room);
|
||||||
|
count += 6;
|
||||||
|
}
|
||||||
|
else if (room.BlockType == RogueDLCBlockTypeEnum.Trade)
|
||||||
|
{
|
||||||
|
AddRoomToGameData(RogueDLCBlockTypeEnum.Trade, room);
|
||||||
|
AddRoomToGameData(RogueDLCBlockTypeEnum.BlackMarket, room);
|
||||||
|
count += 2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AddRoomToGameData(room.BlockType, room);
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logger.Error("Error in reading " + file.Name, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
Logger.Info("Loaded " + count + " room infos.");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void AddRoomToGameData(RogueDLCBlockTypeEnum type, ChessRogueRoomConfig room)
|
||||||
|
{
|
||||||
|
if (GameData.ChessRogueRoomData.TryGetValue(type, out var list))
|
||||||
|
{
|
||||||
|
list.Add(room);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GameData.ChessRogueRoomData.Add(type, [room]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
12
Common/Enums/Scene/GroupCategoryEnum.cs
Normal file
12
Common/Enums/Scene/GroupCategoryEnum.cs
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
namespace EggLink.DanhengServer.Enums.Scene
|
||||||
|
{
|
||||||
|
public enum GroupCategoryEnum
|
||||||
|
{
|
||||||
|
Normal = 0,
|
||||||
|
Mission = 1,
|
||||||
|
BattleProps = 2,
|
||||||
|
Custom = 3,
|
||||||
|
System = 4,
|
||||||
|
Atmosphere = 5,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -14,6 +14,7 @@
|
|||||||
public const int MAX_LINEUP_COUNT = 9;
|
public const int MAX_LINEUP_COUNT = 9;
|
||||||
|
|
||||||
public static readonly List<int> UpgradeWorldLevel = [20, 30, 40, 50, 60, 65];
|
public static readonly List<int> UpgradeWorldLevel = [20, 30, 40, 50, 60, 65];
|
||||||
|
public static readonly List<int> AllowedChessRogueEntranceId = [8020701, 8020901, 8020401, 8020201];
|
||||||
|
|
||||||
public const int AMBUSH_BUFF_ID = 1000102;
|
public const int AMBUSH_BUFF_ID = 1000102;
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"114": [204002],
|
|
||||||
"115": [206001],
|
|
||||||
"116": [204004],
|
|
||||||
"12": [0],
|
|
||||||
"52": [0],
|
|
||||||
"34": [200008],
|
|
||||||
"81": [205002],
|
|
||||||
"83": [205004],
|
|
||||||
"82": [205003],
|
|
||||||
"48": [201002],
|
|
||||||
"50": [201004],
|
|
||||||
"49": [201003]
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
{
|
|
||||||
"2021": {
|
|
||||||
"-1": [2111011],
|
|
||||||
"0": [3],
|
|
||||||
"1": [1, 2, 3, 4],
|
|
||||||
"2": [1, 2, 3, 4, 5],
|
|
||||||
"3": [1, 2, 3, 4],
|
|
||||||
"4": [3]
|
|
||||||
},
|
|
||||||
"2022": {
|
|
||||||
"-1": [2112025],
|
|
||||||
"0": [2, 3, 4, 5],
|
|
||||||
"1": [0, 1, 2, 4, 5],
|
|
||||||
"2": [0, 1, 2, 3, 4, 5, 6],
|
|
||||||
"3": [0, 1, 2, 4, 5],
|
|
||||||
"4": [2, 3, 4, 5]
|
|
||||||
},
|
|
||||||
"2023": {
|
|
||||||
"-1": [2113011],
|
|
||||||
"1": [1, 2],
|
|
||||||
"2": [1, 2, 3, 4],
|
|
||||||
"3": [1, 2]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
{
|
|
||||||
"211": {
|
|
||||||
"EntranceId": 8020701,
|
|
||||||
"Groups": [
|
|
||||||
8,
|
|
||||||
3,
|
|
||||||
9,
|
|
||||||
121,
|
|
||||||
1,
|
|
||||||
2,
|
|
||||||
7
|
|
||||||
],
|
|
||||||
"CellGroup": {}
|
|
||||||
},
|
|
||||||
"222": {
|
|
||||||
"EntranceId": 8020901,
|
|
||||||
"Groups": [
|
|
||||||
28,
|
|
||||||
27,
|
|
||||||
26,
|
|
||||||
22,
|
|
||||||
1,
|
|
||||||
23,
|
|
||||||
21,
|
|
||||||
20,
|
|
||||||
24
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"122": {
|
|
||||||
"EntranceId": 8020401,
|
|
||||||
"Groups": [
|
|
||||||
9,
|
|
||||||
8,
|
|
||||||
7,
|
|
||||||
6,
|
|
||||||
2,
|
|
||||||
5,
|
|
||||||
4,
|
|
||||||
1,
|
|
||||||
3
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"300": {
|
|
||||||
"EntranceId": 8020201,
|
|
||||||
"Groups": [
|
|
||||||
9,
|
|
||||||
1,
|
|
||||||
6,
|
|
||||||
3,
|
|
||||||
8,
|
|
||||||
2
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -15,7 +15,7 @@ namespace EggLink.DanhengServer.Game.ChessRogue.Cell
|
|||||||
{
|
{
|
||||||
public class ChessRogueCellInstance
|
public class ChessRogueCellInstance
|
||||||
{
|
{
|
||||||
public int CellType { get; set; }
|
public RogueDLCBlockTypeEnum CellType { get; set; }
|
||||||
public int PosY { get; set; }
|
public int PosY { get; set; }
|
||||||
public int PosX { get; set; }
|
public int PosX { get; set; }
|
||||||
public int CellId { get; set; }
|
public int CellId { get; set; }
|
||||||
@@ -25,7 +25,6 @@ namespace EggLink.DanhengServer.Game.ChessRogue.Cell
|
|||||||
public ChessRogueInstance Instance { get; set; }
|
public ChessRogueInstance Instance { get; set; }
|
||||||
public ChessRogueBoardCellStatus CellStatus { get; set; } = ChessRogueBoardCellStatus.Idle;
|
public ChessRogueBoardCellStatus CellStatus { get; set; } = ChessRogueBoardCellStatus.Idle;
|
||||||
public ChessRogueRoomConfig? RoomConfig { get; set; }
|
public ChessRogueRoomConfig? RoomConfig { get; set; }
|
||||||
public ChessRogueCellConfig? CellConfig { get; set; }
|
|
||||||
public int SelectMonsterId { get; set; }
|
public int SelectMonsterId { get; set; }
|
||||||
|
|
||||||
public List<int> SelectedDecayId { get; set; } = [];
|
public List<int> SelectedDecayId { get; set; } = [];
|
||||||
@@ -36,16 +35,16 @@ namespace EggLink.DanhengServer.Game.ChessRogue.Cell
|
|||||||
{
|
{
|
||||||
Instance = instance;
|
Instance = instance;
|
||||||
Layer = instance.Layers.IndexOf(instance.CurLayer) + 1;
|
Layer = instance.Layers.IndexOf(instance.CurLayer) + 1;
|
||||||
var list = new RandomList<int>();
|
var list = new RandomList<RogueDLCBlockTypeEnum>();
|
||||||
list.Add((int)RogueDLCBlockTypeEnum.MonsterNormal, 8);
|
list.Add(RogueDLCBlockTypeEnum.MonsterNormal, 8);
|
||||||
list.Add((int)RogueDLCBlockTypeEnum.Reward, 4);
|
list.Add(RogueDLCBlockTypeEnum.Reward, 4);
|
||||||
list.Add((int)RogueDLCBlockTypeEnum.Event, 6);
|
list.Add(RogueDLCBlockTypeEnum.Event, 6);
|
||||||
list.Add((int)RogueDLCBlockTypeEnum.NousSpecialEvent, 4);
|
list.Add(RogueDLCBlockTypeEnum.NousSpecialEvent, 4);
|
||||||
list.Add((int)RogueDLCBlockTypeEnum.NousEvent, 2);
|
list.Add(RogueDLCBlockTypeEnum.NousEvent, 2);
|
||||||
|
|
||||||
if (item.BlockTypeList.Count > 0)
|
if (item.BlockTypeList.Count > 0)
|
||||||
{
|
{
|
||||||
CellType = (int)item.BlockTypeList.RandomElement();
|
CellType = item.BlockTypeList.RandomElement();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -55,7 +54,7 @@ namespace EggLink.DanhengServer.Game.ChessRogue.Cell
|
|||||||
|
|
||||||
public void Init()
|
public void Init()
|
||||||
{
|
{
|
||||||
if (CellType == 11)
|
if (CellType == RogueDLCBlockTypeEnum.MonsterBoss)
|
||||||
{
|
{
|
||||||
// boss
|
// boss
|
||||||
if (Layer == 1)
|
if (Layer == 1)
|
||||||
@@ -105,7 +104,7 @@ namespace EggLink.DanhengServer.Game.ChessRogue.Cell
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (CellType == 15)
|
else if (CellType == RogueDLCBlockTypeEnum.MonsterNousBoss || CellType == RogueDLCBlockTypeEnum.MonsterSwarmBoss)
|
||||||
{
|
{
|
||||||
// last boss
|
// last boss
|
||||||
CellAdvanceInfo.Add(new ChessRogueCellAdvanceInfo()
|
CellAdvanceInfo.Add(new ChessRogueCellAdvanceInfo()
|
||||||
@@ -151,31 +150,20 @@ namespace EggLink.DanhengServer.Game.ChessRogue.Cell
|
|||||||
|
|
||||||
public int GetEntryId()
|
public int GetEntryId()
|
||||||
{
|
{
|
||||||
List<int> mapList = [];
|
if (RoomConfig == null)
|
||||||
foreach (var cell in GameData.ChessRogueCellGenData)
|
|
||||||
{
|
{
|
||||||
var cellType = int.Parse(cell.Key.ToString().Substring(3, 2));
|
var pool = GameData.ChessRogueRoomData[CellType].FindAll(x => x.EntranceId == Instance.LayerMap).ToList();
|
||||||
if (cellType != CellType) continue;
|
RoomConfig = pool.RandomElement();
|
||||||
|
if (Instance.FirstEnterBattle && CellType == RogueDLCBlockTypeEnum.MonsterNormal)
|
||||||
var mapId = int.Parse(cell.Key.ToString()[..3]);
|
|
||||||
mapList.SafeAdd(mapId);
|
|
||||||
}
|
|
||||||
|
|
||||||
MapId = mapList.RandomElement();
|
|
||||||
RoomConfig = GameData.ChessRogueRoomGenData[MapId];
|
|
||||||
|
|
||||||
var randomList = new List<int>();
|
|
||||||
foreach (var key in GameData.ChessRogueCellGenData.Keys)
|
|
||||||
{
|
|
||||||
if (key.ToString().StartsWith($"{MapId * 100 + CellType}"))
|
|
||||||
{
|
{
|
||||||
randomList.Add(key);
|
do
|
||||||
|
{
|
||||||
|
RoomConfig = pool.RandomElement();
|
||||||
|
} while (RoomConfig.SubMonsterGroup.Count == 0); // make sure the room has sub monster
|
||||||
|
Instance.FirstEnterBattle = false;
|
||||||
}
|
}
|
||||||
|
RoomId = RoomConfig.RoomPrefix * 10000 + (int) CellType * 100 + Random.Shared.Next(1, 10); // find a better way to generate room id
|
||||||
}
|
}
|
||||||
|
|
||||||
RoomId = randomList.RandomElement();
|
|
||||||
CellConfig = GameData.ChessRogueCellGenData[RoomId];
|
|
||||||
|
|
||||||
return RoomConfig.EntranceId;
|
return RoomConfig.EntranceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -187,12 +175,9 @@ namespace EggLink.DanhengServer.Game.ChessRogue.Cell
|
|||||||
public List<int> GetLoadGroupList()
|
public List<int> GetLoadGroupList()
|
||||||
{
|
{
|
||||||
var groupList = new List<int>();
|
var groupList = new List<int>();
|
||||||
if (RoomConfig!.CellGroup.TryGetValue(CellType, out ChessRogueRoom? value))
|
groupList.AddRange(RoomConfig!.DefaultLoadBasicGroup);
|
||||||
{
|
groupList.AddRange(RoomConfig.DefaultLoadGroup);
|
||||||
groupList.AddRange(value.Groups);
|
groupList.AddRange(RoomConfig.SubMonsterGroup);
|
||||||
}
|
|
||||||
groupList.AddRange(CellConfig?.Groups ?? []);
|
|
||||||
groupList.AddRange(RoomConfig.Groups);
|
|
||||||
|
|
||||||
return groupList;
|
return groupList;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ using System.Text;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using EggLink.DanhengServer.Game.Rogue;
|
using EggLink.DanhengServer.Game.Rogue;
|
||||||
using EggLink.DanhengServer.Util;
|
using EggLink.DanhengServer.Util;
|
||||||
|
using EggLink.DanhengServer.Enums.Rogue;
|
||||||
|
using EggLink.DanhengServer.Data.Excel;
|
||||||
|
|
||||||
namespace EggLink.DanhengServer.Game.ChessRogue.Cell
|
namespace EggLink.DanhengServer.Game.ChessRogue.Cell
|
||||||
{
|
{
|
||||||
@@ -32,6 +34,10 @@ namespace EggLink.DanhengServer.Game.ChessRogue.Cell
|
|||||||
{
|
{
|
||||||
LoadGroup(group);
|
LoadGroup(group);
|
||||||
}
|
}
|
||||||
|
else if (group.Category == GroupCategoryEnum.Normal)
|
||||||
|
{
|
||||||
|
LoadGroup(group);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Scene.IsLoaded = true;
|
Scene.IsLoaded = true;
|
||||||
}
|
}
|
||||||
@@ -89,20 +95,33 @@ namespace EggLink.DanhengServer.Game.ChessRogue.Cell
|
|||||||
var room = instance.CurCell;
|
var room = instance.CurCell;
|
||||||
if (room == null) return null;
|
if (room == null) return null;
|
||||||
int monsterId;
|
int monsterId;
|
||||||
|
RogueMonsterExcel? rogueMonster;
|
||||||
if (room.SelectMonsterId > 0)
|
if (room.SelectMonsterId > 0)
|
||||||
{
|
{
|
||||||
monsterId = room.SelectMonsterId;
|
monsterId = room.SelectMonsterId;
|
||||||
|
|
||||||
|
GameData.RogueMonsterData.TryGetValue(monsterId * 10 + 1, out rogueMonster);
|
||||||
|
if (rogueMonster == null) return null;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GameData.ChessRogueContentGenData.TryGetValue(group.Id, out var content);
|
List<MonsterRankEnum> allowedRank = [];
|
||||||
if (content == null) return null;
|
if (room.CellType == RogueDLCBlockTypeEnum.MonsterElite)
|
||||||
monsterId = content.RandomElement();
|
{
|
||||||
}
|
allowedRank.Add(MonsterRankEnum.Elite);
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
allowedRank.Add(MonsterRankEnum.Minion);
|
||||||
|
allowedRank.Add(MonsterRankEnum.MinionLv2);
|
||||||
|
}
|
||||||
|
|
||||||
GameData.RogueMonsterData.TryGetValue(monsterId * 10 + 1, out var rogueMonster);
|
NPCMonsterDataExcel? data;
|
||||||
if (rogueMonster == null) return null;
|
do
|
||||||
|
{
|
||||||
|
rogueMonster = GameData.RogueMonsterData.Values.ToList().RandomElement();
|
||||||
|
GameData.NpcMonsterDataData.TryGetValue(rogueMonster.NpcMonsterID, out data);
|
||||||
|
} while (data == null || !allowedRank.Contains(data.Rank));
|
||||||
|
}
|
||||||
|
|
||||||
GameData.NpcMonsterDataData.TryGetValue(rogueMonster.NpcMonsterID, out var excel);
|
GameData.NpcMonsterDataData.TryGetValue(rogueMonster.NpcMonsterID, out var excel);
|
||||||
if (excel == null) return null;
|
if (excel == null) return null;
|
||||||
@@ -132,10 +151,10 @@ namespace EggLink.DanhengServer.Game.ChessRogue.Cell
|
|||||||
{
|
{
|
||||||
prop.SetState(PropStateEnum.CustomState02);
|
prop.SetState(PropStateEnum.CustomState02);
|
||||||
prop.IsChessRogue = true;
|
prop.IsChessRogue = true;
|
||||||
if (instance.CurCell!.CellType == 11 || instance.CurCell.CellType == 15)
|
if (instance.CurCell!.CellType == RogueDLCBlockTypeEnum.MonsterBoss || instance.CurCell.CellType == RogueDLCBlockTypeEnum.MonsterNousBoss || instance.CurCell.CellType == RogueDLCBlockTypeEnum.MonsterSwarmBoss)
|
||||||
{
|
{
|
||||||
prop.SetState(PropStateEnum.CustomState04);
|
prop.SetState(PropStateEnum.CustomState04);
|
||||||
if (instance.CurCell!.CellType == 11)
|
if (instance.CurCell!.CellType != RogueDLCBlockTypeEnum.MonsterBoss)
|
||||||
{
|
{
|
||||||
prop.IsLastRoom = true;
|
prop.IsLastRoom = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using EggLink.DanhengServer.Data;
|
using EggLink.DanhengServer.Data;
|
||||||
using EggLink.DanhengServer.Data.Excel;
|
using EggLink.DanhengServer.Data.Excel;
|
||||||
|
using EggLink.DanhengServer.Enums.Rogue;
|
||||||
using EggLink.DanhengServer.Game.Battle;
|
using EggLink.DanhengServer.Game.Battle;
|
||||||
using EggLink.DanhengServer.Game.ChessRogue.Cell;
|
using EggLink.DanhengServer.Game.ChessRogue.Cell;
|
||||||
using EggLink.DanhengServer.Game.ChessRogue.Dice;
|
using EggLink.DanhengServer.Game.ChessRogue.Dice;
|
||||||
@@ -32,6 +33,9 @@ namespace EggLink.DanhengServer.Game.ChessRogue
|
|||||||
public RogueDLCChessBoardExcel? CurBoardExcel { get; set; }
|
public RogueDLCChessBoardExcel? CurBoardExcel { get; set; }
|
||||||
public ChessRogueLevelStatusType CurLevelStatus { get; set; } = ChessRogueLevelStatusType.ChessRogueLevelProcessing;
|
public ChessRogueLevelStatusType CurLevelStatus { get; set; } = ChessRogueLevelStatusType.ChessRogueLevelProcessing;
|
||||||
|
|
||||||
|
public bool FirstEnterBattle { get; set; } = true;
|
||||||
|
public int LayerMap { get; set; } = 0;
|
||||||
|
|
||||||
public int ActionPoint { get; set; } = 15;
|
public int ActionPoint { get; set; } = 15;
|
||||||
|
|
||||||
public List<int> DisableAeonIds { get; set; } = [];
|
public List<int> DisableAeonIds { get; set; } = [];
|
||||||
@@ -78,7 +82,7 @@ namespace EggLink.DanhengServer.Game.ChessRogue
|
|||||||
|
|
||||||
public override void RollBuff(int amount)
|
public override void RollBuff(int amount)
|
||||||
{
|
{
|
||||||
if (CurCell!.CellType == 11)
|
if (CurCell!.CellType == RogueDLCBlockTypeEnum.MonsterBoss)
|
||||||
{
|
{
|
||||||
RollBuff(amount, 100003, 2); // boss room
|
RollBuff(amount, 100003, 2); // boss room
|
||||||
RollMiracle(1);
|
RollMiracle(1);
|
||||||
@@ -183,6 +187,10 @@ namespace EggLink.DanhengServer.Game.ChessRogue
|
|||||||
public void GenerateLayer()
|
public void GenerateLayer()
|
||||||
{
|
{
|
||||||
var level = Layers.IndexOf(CurLayer) + 1;
|
var level = Layers.IndexOf(CurLayer) + 1;
|
||||||
|
FirstEnterBattle = true;
|
||||||
|
|
||||||
|
LayerMap = GameConstants.AllowedChessRogueEntranceId.RandomElement();
|
||||||
|
|
||||||
if (RogueVersionId == 201)
|
if (RogueVersionId == 201)
|
||||||
{
|
{
|
||||||
CurBoardExcel = GameData.RogueSwarmChessBoardData[level].RandomElement();
|
CurBoardExcel = GameData.RogueSwarmChessBoardData[level].RandomElement();
|
||||||
@@ -235,15 +243,7 @@ namespace EggLink.DanhengServer.Game.ChessRogue
|
|||||||
CurCell = cell;
|
CurCell = cell;
|
||||||
cell.CellStatus = ChessRogueBoardCellStatus.Finish;
|
cell.CellStatus = ChessRogueBoardCellStatus.Finish;
|
||||||
|
|
||||||
Player.EnterScene(cell.GetEntryId(), 0, false);
|
Player.EnterMissionScene(cell.GetEntryId(), cell.RoomConfig!.AnchorGroup, cell.RoomConfig!.AnchorId, false);
|
||||||
Player.MoveTo(new EntityMotion()
|
|
||||||
{
|
|
||||||
Motion = new()
|
|
||||||
{
|
|
||||||
Rot = cell.CellConfig!.ToRotation().ToProto(),
|
|
||||||
Pos = cell.CellConfig!.ToPosition().ToProto(),
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
HistoryCell.Add(cell);
|
HistoryCell.Add(cell);
|
||||||
|
|
||||||
@@ -380,12 +380,12 @@ namespace EggLink.DanhengServer.Game.ChessRogue
|
|||||||
|
|
||||||
CalculateDifficulty(battle);
|
CalculateDifficulty(battle);
|
||||||
|
|
||||||
if (CurCell!.CellType == 15)
|
if (CurCell!.CellType == RogueDLCBlockTypeEnum.MonsterNousBoss || CurCell!.CellType == RogueDLCBlockTypeEnum.MonsterSwarmBoss)
|
||||||
{
|
{
|
||||||
var buffList = new List<int>();
|
var buffList = new List<int>();
|
||||||
foreach (var buff in BossBuff)
|
foreach (var buff in BossBuff)
|
||||||
{
|
{
|
||||||
if (buff.EffectType == Enums.Rogue.BossDecayEffectTypeEnum.AddMazeBuffList)
|
if (buff.EffectType == BossDecayEffectTypeEnum.AddMazeBuffList)
|
||||||
{
|
{
|
||||||
buffList.SafeAddRange(buff.EffectParamList); // add buff
|
buffList.SafeAddRange(buff.EffectParamList); // add buff
|
||||||
} else
|
} else
|
||||||
@@ -478,11 +478,11 @@ namespace EggLink.DanhengServer.Game.ChessRogue
|
|||||||
|
|
||||||
RollBuff(battle.Stages.Count);
|
RollBuff(battle.Stages.Count);
|
||||||
|
|
||||||
if (CurCell!.CellType == 11)
|
if (CurCell!.CellType == RogueDLCBlockTypeEnum.MonsterBoss)
|
||||||
{
|
{
|
||||||
Player.SendPacket(new PacketChessRogueLayerAccountInfoNotify(this));
|
Player.SendPacket(new PacketChessRogueLayerAccountInfoNotify(this));
|
||||||
}
|
}
|
||||||
else if (CurCell!.CellType == 15)
|
else if (CurCell!.CellType == RogueDLCBlockTypeEnum.MonsterNousBoss || CurCell!.CellType == RogueDLCBlockTypeEnum.MonsterSwarmBoss)
|
||||||
{
|
{
|
||||||
CurLevelStatus = ChessRogueLevelStatusType.ChessRogueLevelFinish;
|
CurLevelStatus = ChessRogueLevelStatusType.ChessRogueLevelFinish;
|
||||||
Player.SendPacket(new PacketChessRogueLayerAccountInfoNotify(this));
|
Player.SendPacket(new PacketChessRogueLayerAccountInfoNotify(this));
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using EggLink.DanhengServer.Data;
|
using EggLink.DanhengServer.Data;
|
||||||
using EggLink.DanhengServer.Enums.Rogue;
|
using EggLink.DanhengServer.Enums.Rogue;
|
||||||
using EggLink.DanhengServer.Game.Player;
|
using EggLink.DanhengServer.Game.Player;
|
||||||
|
using EggLink.DanhengServer.GameServer.Server.Packet.Send.Rogue;
|
||||||
using EggLink.DanhengServer.Server.Packet.Send.Rogue;
|
using EggLink.DanhengServer.Server.Packet.Send.Rogue;
|
||||||
using Google.Protobuf.WellKnownTypes;
|
using Google.Protobuf.WellKnownTypes;
|
||||||
using System;
|
using System;
|
||||||
@@ -156,6 +157,7 @@ namespace EggLink.DanhengServer.Game.Rogue.Event
|
|||||||
}
|
}
|
||||||
|
|
||||||
// send rsp
|
// send rsp
|
||||||
|
Player.SendPacket(new PacketSyncRogueCommonDialogueOptionFinishScNotify(eventInstance));
|
||||||
Player.SendPacket(new PacketSelectRogueCommonDialogueOptionScRsp(eventInstance));
|
Player.SendPacket(new PacketSelectRogueCommonDialogueOptionScRsp(eventInstance));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
using EggLink.DanhengServer.Game.Rogue.Event;
|
||||||
|
using EggLink.DanhengServer.Proto;
|
||||||
|
using EggLink.DanhengServer.Server.Packet;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace EggLink.DanhengServer.GameServer.Server.Packet.Send.Rogue
|
||||||
|
{
|
||||||
|
public class PacketSyncRogueCommonDialogueOptionFinishScNotify : BasePacket
|
||||||
|
{
|
||||||
|
public PacketSyncRogueCommonDialogueOptionFinishScNotify(RogueEventInstance instance) : base(CmdIds.SyncRogueCommonDialogueOptionFinishScNotify)
|
||||||
|
{
|
||||||
|
var proto = new SyncRogueCommonDialogueOptionFinishScNotify()
|
||||||
|
{
|
||||||
|
DialogueData = instance.ToProto(),
|
||||||
|
EventUniqueId = (uint)instance.EventUniqueId,
|
||||||
|
OptionId = (uint)instance.SelectedOptionId,
|
||||||
|
ResultOptionInfo = instance.Options.Find(o => o.OptionId == instance.SelectedOptionId)!.ToProto()
|
||||||
|
};
|
||||||
|
|
||||||
|
SetData(proto);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using EggLink.DanhengServer.Data;
|
using EggLink.DanhengServer.Data;
|
||||||
|
using EggLink.DanhengServer.Internationalization;
|
||||||
using EggLink.DanhengServer.Program;
|
using EggLink.DanhengServer.Program;
|
||||||
using EggLink.DanhengServer.Util;
|
using EggLink.DanhengServer.Util;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
@@ -83,8 +84,8 @@ namespace EggLink.DanhengServer.Handbook
|
|||||||
foreach (var cmd in EntryPoint.CommandManager.CommandInfo)
|
foreach (var cmd in EntryPoint.CommandManager.CommandInfo)
|
||||||
{
|
{
|
||||||
builder.Append("Command: " + cmd.Key);
|
builder.Append("Command: " + cmd.Key);
|
||||||
builder.Append(" --- Description: " + cmd.Value.Description);
|
builder.Append(" --- Description: " + I18nManager.Translate(cmd.Value.Description));
|
||||||
builder.Append(" --- Usage: " + cmd.Value.Usage);
|
builder.Append(" --- Usage: " + I18nManager.Translate(cmd.Value.Usage));
|
||||||
builder.AppendLine();
|
builder.AppendLine();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user