mirror of
https://github.com/EggLinks/DanhengServer-OpenSource.git
synced 2026-01-02 20:26:03 +08:00
feat: Divergent Universe: Protean Hero
This commit is contained in:
@@ -7,9 +7,9 @@ namespace EggLink.DanhengServer.Data.Excel;
|
||||
[ResourceEntity("RogueBuffGroup.json")]
|
||||
public class RogueBuffGroupExcel : BaseRogueBuffGroupExcel
|
||||
{
|
||||
[JsonProperty("GroupID")] public int GroupID { get; set; }
|
||||
[JsonProperty("IDLBMIHBAPB")] public int GroupID { get; set; }
|
||||
|
||||
[JsonProperty("BuffTagList")] public List<int> BuffTagList { get; set; } = [];
|
||||
[JsonProperty("GNGDPDOMDFH")] public List<int> BuffTagList { get; set; } = [];
|
||||
|
||||
public override int GetId()
|
||||
{
|
||||
|
||||
@@ -6,8 +6,8 @@ public class RogueMapExcel : ExcelResource
|
||||
public int RogueMapID { get; set; }
|
||||
public int SiteID { get; set; }
|
||||
public bool IsStart { get; set; }
|
||||
public int PosX { get; set; }
|
||||
public int PosY { get; set; }
|
||||
public double PosX { get; set; }
|
||||
public double PosY { get; set; }
|
||||
|
||||
public List<int> NextSiteIDList { get; set; } = [];
|
||||
public List<int> LevelList { get; set; } = [];
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
[ResourceEntity("RogueMonsterGroup.json")]
|
||||
public class RogueMonsterGroupExcel : ExcelResource
|
||||
{
|
||||
public Dictionary<string, int> RogueMonsterListAndWeight { get; set; } = [];
|
||||
public Dictionary<string, double> RogueMonsterListAndWeight { get; set; } = [];
|
||||
public int RogueMonsterGroupID { get; set; }
|
||||
public int EliteGroup { get; set; }
|
||||
|
||||
|
||||
46
Common/Data/Excel/RogueTournTitanBlessExcel.cs
Normal file
46
Common/Data/Excel/RogueTournTitanBlessExcel.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using EggLink.DanhengServer.Enums.TournRogue;
|
||||
using EggLink.DanhengServer.Proto;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Excel;
|
||||
|
||||
[ResourceEntity("RogueTournTitanBless.json")]
|
||||
public class RogueTournTitanBlessExcel : ExcelResource
|
||||
{
|
||||
public int TitanBlessID { get; set; }
|
||||
public int MazeBuffID { get; set; }
|
||||
public int TitanBlessLevel { get; set; }
|
||||
public int BlessRatio { get; set; }
|
||||
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public RogueTitanTypeEnum TitanType { get; set; }
|
||||
|
||||
[JsonProperty(ItemConverterType = typeof(StringEnumConverter))]
|
||||
public List<RogueTitanCategoryEnum> BlessBattleDisplayCategoryList { get; set; } = [];
|
||||
|
||||
public override int GetId()
|
||||
{
|
||||
return TitanBlessID;
|
||||
}
|
||||
|
||||
public override void Loaded()
|
||||
{
|
||||
GameData.RogueTournTitanBlessData.Add(TitanBlessID, this);
|
||||
}
|
||||
|
||||
public RogueCommonActionResult ToResultProto(RogueCommonActionResultSourceType select)
|
||||
{
|
||||
return new RogueCommonActionResult
|
||||
{
|
||||
Source = select,
|
||||
RogueAction = new RogueCommonActionResultData
|
||||
{
|
||||
TitanBlessEvent = new RogueTitanBlessEvent
|
||||
{
|
||||
EventUniqueId = (uint)TitanBlessID
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
27
Common/Data/Excel/RogueTournTitanTalentExcel.cs
Normal file
27
Common/Data/Excel/RogueTournTitanTalentExcel.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using EggLink.DanhengServer.Enums.TournRogue;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Excel;
|
||||
|
||||
[ResourceEntity("RogueTournTitanTalent.json")]
|
||||
public class RogueTournTitanTalentExcel : ExcelResource
|
||||
{
|
||||
public int ID { get; set; }
|
||||
public int PreID { get; set; }
|
||||
public int Level { get; set; }
|
||||
public List<MappingInfoItem> Cost { get; set; } = [];
|
||||
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public RogueTitanTypeEnum RogueTitanType { get; set; }
|
||||
|
||||
public override int GetId()
|
||||
{
|
||||
return ID;
|
||||
}
|
||||
|
||||
public override void Loaded()
|
||||
{
|
||||
GameData.RogueTournTitanTalentData.Add(ID, this);
|
||||
}
|
||||
}
|
||||
24
Common/Data/Excel/RogueTournTitanTypeExcel.cs
Normal file
24
Common/Data/Excel/RogueTournTitanTypeExcel.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using EggLink.DanhengServer.Enums.TournRogue;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace EggLink.DanhengServer.Data.Excel;
|
||||
|
||||
[ResourceEntity("RogueTournTitanType.json")]
|
||||
public class RogueTournTitanTypeExcel : ExcelResource
|
||||
{
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public RogueTitanTypeEnum RogueTitanType { get; set; }
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public RogueTitanCategoryEnum RogueTitanCategory { get; set; }
|
||||
|
||||
public override int GetId()
|
||||
{
|
||||
return (int)RogueTitanType;
|
||||
}
|
||||
|
||||
public override void Loaded()
|
||||
{
|
||||
GameData.RogueTournTitanTypeData.Add(RogueTitanType, this);
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ using EggLink.DanhengServer.Data.Config.Scene;
|
||||
using EggLink.DanhengServer.Data.Custom;
|
||||
using EggLink.DanhengServer.Data.Excel;
|
||||
using EggLink.DanhengServer.Enums.Rogue;
|
||||
using EggLink.DanhengServer.Enums.TournRogue;
|
||||
|
||||
namespace EggLink.DanhengServer.Data;
|
||||
|
||||
@@ -271,6 +272,10 @@ public static class GameData
|
||||
public static Dictionary<int, RogueTournWorkbenchExcel> RogueTournWorkbenchData { get; private set; } = [];
|
||||
public static Dictionary<int, RogueTournWorkbenchFuncExcel> RogueTournWorkbenchFuncData { get; private set; } = [];
|
||||
public static Dictionary<int, RogueTournFormulaExcel> RogueTournFormulaData { get; private set; } = [];
|
||||
public static Dictionary<int, RogueTournTitanTalentExcel> RogueTournTitanTalentData { get; private set; } = [];
|
||||
public static Dictionary<RogueTitanTypeEnum, RogueTournTitanTypeExcel> RogueTournTitanTypeData { get; private set; } =
|
||||
[];
|
||||
public static Dictionary<int, RogueTournTitanBlessExcel> RogueTournTitanBlessData { get; private set; } = [];
|
||||
|
||||
public static Dictionary<int, RogueTournHexAvatarBaseTypeExcel> RogueTournHexAvatarBaseTypeData
|
||||
{
|
||||
|
||||
8
Common/Enums/TournRogue/RogueTitanCategoryEnum.cs
Normal file
8
Common/Enums/TournRogue/RogueTitanCategoryEnum.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace EggLink.DanhengServer.Enums.TournRogue;
|
||||
|
||||
public enum RogueTitanCategoryEnum
|
||||
{
|
||||
None = 0,
|
||||
Day,
|
||||
Night
|
||||
}
|
||||
18
Common/Enums/TournRogue/RogueTitanTypeEnum.cs
Normal file
18
Common/Enums/TournRogue/RogueTitanTypeEnum.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
namespace EggLink.DanhengServer.Enums.TournRogue;
|
||||
|
||||
public enum RogueTitanTypeEnum
|
||||
{
|
||||
None = 0,
|
||||
Moneta = 120,
|
||||
Ianos = 121,
|
||||
Phageina = 122,
|
||||
Zagreus = 123,
|
||||
Nikadory = 124,
|
||||
Xenatos = 125,
|
||||
Aigle = 126,
|
||||
Cerces = 127,
|
||||
Kephale = 128,
|
||||
Olonyx = 129,
|
||||
Talentum = 130,
|
||||
Georia = 131
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using EggLink.DanhengServer.GameServer.Game.Rogue.Miracle;
|
||||
using EggLink.DanhengServer.GameServer.Game.RogueMagic.MagicUnit;
|
||||
using EggLink.DanhengServer.GameServer.Game.RogueMagic.Scepter;
|
||||
using EggLink.DanhengServer.GameServer.Game.RogueTourn.Formula;
|
||||
using EggLink.DanhengServer.GameServer.Game.RogueTourn.Titan;
|
||||
using EggLink.DanhengServer.Proto;
|
||||
|
||||
namespace EggLink.DanhengServer.GameServer.Game.Rogue;
|
||||
@@ -16,6 +17,7 @@ public class RogueActionInstance
|
||||
public RogueFormulaSelectMenu? RogueFormulaSelectMenu { get; set; }
|
||||
public RogueMagicUnitSelectMenu? RogueMagicUnitSelectMenu { get; set; }
|
||||
public RogueScepterSelectMenu? RogueScepterSelectMenu { get; set; }
|
||||
public RogueTitanBlessSelectMenu? RogueTitanBlessSelectMenu { get; set; }
|
||||
|
||||
public bool IsReforge { get; set; }
|
||||
|
||||
@@ -46,6 +48,8 @@ public class RogueActionInstance
|
||||
|
||||
if (RogueScepterSelectMenu != null) action.ScepterSelectInfo = RogueScepterSelectMenu.ToProto();
|
||||
|
||||
if (RogueTitanBlessSelectMenu != null) action.TitanBlessSelectInfo = RogueTitanBlessSelectMenu.ToProto();
|
||||
|
||||
return new RogueCommonPendingAction
|
||||
{
|
||||
QueuePosition = (uint)QueuePosition,
|
||||
|
||||
@@ -128,7 +128,7 @@ public class RogueMagicEntityLoader(SceneInstance scene, PlayerInstance player)
|
||||
{
|
||||
var dict = GameData.RogueMonsterGroupData[FinalRoomBossGroup].RogueMonsterListAndWeight;
|
||||
var random = new RandomList<int>();
|
||||
foreach (var i in dict) random.Add(int.Parse(i.Key), i.Value);
|
||||
foreach (var i in dict) random.Add(int.Parse(i.Key), (int)i.Value);
|
||||
|
||||
rogueMonster = GameData.RogueMonsterData[random.GetRandom()];
|
||||
}
|
||||
@@ -136,7 +136,7 @@ public class RogueMagicEntityLoader(SceneInstance scene, PlayerInstance player)
|
||||
{
|
||||
var dict = GameData.RogueMonsterGroupData[LayerNormalBossGroup2].RogueMonsterListAndWeight;
|
||||
var random = new RandomList<int>();
|
||||
foreach (var i in dict) random.Add(int.Parse(i.Key), i.Value);
|
||||
foreach (var i in dict) random.Add(int.Parse(i.Key), (int)i.Value);
|
||||
|
||||
rogueMonster = GameData.RogueMonsterData[random.GetRandom()];
|
||||
}
|
||||
@@ -144,7 +144,7 @@ public class RogueMagicEntityLoader(SceneInstance scene, PlayerInstance player)
|
||||
{
|
||||
var dict = GameData.RogueMonsterGroupData[LayerNormalBossGroup1].RogueMonsterListAndWeight;
|
||||
var random = new RandomList<int>();
|
||||
foreach (var i in dict) random.Add(int.Parse(i.Key), i.Value);
|
||||
foreach (var i in dict) random.Add(int.Parse(i.Key), (int)i.Value);
|
||||
|
||||
rogueMonster = GameData.RogueMonsterData[random.GetRandom()];
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ using EggLink.DanhengServer.GameServer.Game.Rogue.Buff;
|
||||
using EggLink.DanhengServer.GameServer.Game.Rogue.Event;
|
||||
using EggLink.DanhengServer.GameServer.Game.RogueTourn.Formula;
|
||||
using EggLink.DanhengServer.GameServer.Game.RogueTourn.Scene;
|
||||
using EggLink.DanhengServer.GameServer.Game.RogueTourn.Titan;
|
||||
using EggLink.DanhengServer.GameServer.Server.Packet.Send.Lineup;
|
||||
using EggLink.DanhengServer.GameServer.Server.Packet.Send.RogueCommon;
|
||||
using EggLink.DanhengServer.GameServer.Server.Packet.Send.RogueTourn;
|
||||
@@ -25,23 +26,27 @@ public class RogueTournInstance : BaseRogueInstance
|
||||
public RogueTournInstance(PlayerInstance player, int areaId) : base(player, RogueSubModeEnum.TournRogue, 0)
|
||||
{
|
||||
// generate levels
|
||||
foreach (var index in Enumerable.Range(1, 3))
|
||||
{
|
||||
var levelInstance = new RogueTournLevelInstance(index);
|
||||
Levels.Add(levelInstance.LayerId, levelInstance);
|
||||
}
|
||||
|
||||
AreaExcel = GameData.RogueTournAreaData.GetValueOrDefault(areaId) ??
|
||||
throw new Exception("Invalid area id"); // wont be null because of validation in RogueTournManager
|
||||
|
||||
var index = 0;
|
||||
foreach (var id in AreaExcel.LayerIDList)
|
||||
{
|
||||
var levelInstance = new RogueTournLevelInstance(++index, id);
|
||||
Levels.Add(levelInstance.LayerId, levelInstance);
|
||||
}
|
||||
|
||||
foreach (var difficulty in AreaExcel.DifficultyIDList)
|
||||
if (GameData.RogueTournDifficultyData.TryGetValue(difficulty, out var diff))
|
||||
DifficultyExcels.Add(diff);
|
||||
|
||||
CurLayerId = 1101;
|
||||
CurLayerId = AreaExcel.LayerIDList.FirstOrDefault();
|
||||
EventManager = new RogueEventManager(player, this);
|
||||
|
||||
BaseRerollCount = 0;
|
||||
var t1 = RollTitanBless(1,true);
|
||||
t1.AsTask().Wait();
|
||||
|
||||
var t = RollFormula(1, [RogueFormulaCategoryEnum.Epic]);
|
||||
t.AsTask().Wait();
|
||||
}
|
||||
@@ -55,6 +60,7 @@ public class RogueTournInstance : BaseRogueInstance
|
||||
public Dictionary<int, RogueTournLevelInstance> Levels { get; set; } = [];
|
||||
public List<RogueTournDifficultyExcel> DifficultyExcels { get; set; } = [];
|
||||
public int CurLayerId { get; set; }
|
||||
public int TitanProgress { get; set; } = -1;
|
||||
public RogueTournAreaExcel AreaExcel { get; set; }
|
||||
public RogueTournLevelStatus LevelStatus { get; set; } = RogueTournLevelStatus.Processing;
|
||||
|
||||
@@ -118,6 +124,14 @@ public class RogueTournInstance : BaseRogueInstance
|
||||
|
||||
// sync
|
||||
await Player.SendPacket(new PacketRogueTournLevelInfoUpdateScNotify(this, [CurLevel]));
|
||||
|
||||
TitanProgress++;
|
||||
await Player.SendPacket(new PacketRogueTournTitanUpdateTitanBlessProgressScNotify(this));
|
||||
|
||||
if (TitanProgress >= 4)
|
||||
{
|
||||
await RollTitanBless(1, RogueTitanBlessInstance.EnhanceBlessList.Count / 3 >= RogueTitanBlessInstance.BlessTypeExcel.Count);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -136,6 +150,71 @@ public class RogueTournInstance : BaseRogueInstance
|
||||
|
||||
#endregion
|
||||
|
||||
#region Titan
|
||||
|
||||
public RogueTitanCategoryEnum TitanCategory { get; set; } = RogueTitanCategoryEnum.None;
|
||||
public RogueTitanBlessInstance RogueTitanBlessInstance { get; set; } = new();
|
||||
|
||||
public async ValueTask RollTitanBless(int amount, bool selectType)
|
||||
{
|
||||
for (var i = 0; i < amount; i++)
|
||||
{
|
||||
var menu = new RogueTitanBlessSelectMenu(this);
|
||||
menu.RollTitanBless(typeSelect:selectType);
|
||||
var action = menu.GetActionInstance();
|
||||
RogueActions.Add(action.QueuePosition, action);
|
||||
}
|
||||
|
||||
await UpdateMenu();
|
||||
|
||||
TitanProgress = 0;
|
||||
await Player.SendPacket(new PacketRogueTournTitanUpdateTitanBlessProgressScNotify(this));
|
||||
}
|
||||
|
||||
public async ValueTask HandleTitanBlessSelect(int blessId, int location)
|
||||
{
|
||||
if (RogueActions.Count == 0) return;
|
||||
var action = RogueActions.First().Value;
|
||||
if (action.RogueTitanBlessSelectMenu != null)
|
||||
{
|
||||
var bless = action.RogueTitanBlessSelectMenu.Blesses.Find(x => x.TitanBlessID == blessId);
|
||||
if (bless != null) // check if bless is in the list
|
||||
{
|
||||
if (!RogueTitanBlessInstance.BlessTypeExcel.Exists(x =>
|
||||
x.TitanBlessID == blessId)) // check if bless already exists
|
||||
{
|
||||
if (action.RogueTitanBlessSelectMenu.TypeSelect)
|
||||
{
|
||||
RogueTitanBlessInstance.BlessTypeExcel.Add(bless);
|
||||
TitanCategory =
|
||||
GameData.RogueTournTitanTypeData.GetValueOrDefault(bless.TitanType)?.RogueTitanCategory ??
|
||||
RogueTitanCategoryEnum.Day;
|
||||
}
|
||||
else
|
||||
{
|
||||
RogueTitanBlessInstance.EnhanceBlessList.Add(bless);
|
||||
}
|
||||
|
||||
await Player.SendPacket(new PacketSyncRogueCommonActionResultScNotify(RogueSubMode,
|
||||
bless.ToResultProto(RogueCommonActionResultSourceType.Select)));
|
||||
}
|
||||
}
|
||||
|
||||
RogueActions.Remove(action.QueuePosition);
|
||||
if (action.RogueTitanBlessSelectMenu.TypeSelect)
|
||||
await Player.SendPacket(
|
||||
new PacketHandleRogueCommonPendingActionScRsp(action.QueuePosition, location, selectTitanBlessType: true));
|
||||
else
|
||||
await Player.SendPacket(
|
||||
new PacketHandleRogueCommonPendingActionScRsp(action.QueuePosition, location,
|
||||
selectTitanBlessEnhance: true));
|
||||
}
|
||||
|
||||
await UpdateMenu();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Buff & Formula
|
||||
|
||||
public override async ValueTask RollBuff(int amount)
|
||||
@@ -317,6 +396,21 @@ public class RogueTournInstance : BaseRogueInstance
|
||||
{
|
||||
base.OnBattleStart(battle);
|
||||
|
||||
battle.MagicInfo = new BattleRogueMagicInfo
|
||||
{
|
||||
ModifierContent = new BattleRogueMagicModifierInfo
|
||||
{
|
||||
RogueMagicBattleConst = 3
|
||||
},
|
||||
DetailInfo = new BattleRogueMagicDetailInfo
|
||||
{
|
||||
ENNPJGLCBEM = new FKOCBOOCDNL
|
||||
{
|
||||
POIIAIAKILF = (uint)TitanCategory
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (DifficultyExcels.Count > 0)
|
||||
{
|
||||
var diff = DifficultyExcels.RandomElement();
|
||||
@@ -332,6 +426,8 @@ public class RogueTournInstance : BaseRogueInstance
|
||||
{
|
||||
WaveFlag = -1
|
||||
});
|
||||
|
||||
RogueTitanBlessInstance.OnBattleStart(battle);
|
||||
}
|
||||
|
||||
public override async ValueTask OnBattleEnd(BattleInstance battle, PVEBattleResultCsReq req)
|
||||
|
||||
@@ -58,12 +58,32 @@ public class RogueTournManager(PlayerInstance player) : BasePlayerManager(player
|
||||
RogueTournSaveList =
|
||||
{
|
||||
Capacity = 0
|
||||
}
|
||||
},
|
||||
SeasonTalentInfo = ToSeasonTalentProto(),
|
||||
LKCEFCLJCBM = new KCLCHJMNPGL()
|
||||
};
|
||||
|
||||
return proto;
|
||||
}
|
||||
|
||||
public RogueTournSeasonTalent ToSeasonTalentProto()
|
||||
{
|
||||
return new RogueTournSeasonTalent
|
||||
{
|
||||
TalentInfoList = new RogueTalentInfoList
|
||||
{
|
||||
TalentInfo =
|
||||
{
|
||||
GameData.RogueTournTitanTalentData.Values.Select(x => new RogueTalentInfo
|
||||
{
|
||||
TalentId = (uint)x.ID,
|
||||
Status = RogueTalentStatus.Enable
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public ExtraScoreInfo ToExtraScoreProto()
|
||||
{
|
||||
return new ExtraScoreInfo
|
||||
@@ -103,7 +123,8 @@ public class RogueTournManager(PlayerInstance player) : BasePlayerManager(player
|
||||
public List<RogueTournAreaInfo> ToAreaProtoList()
|
||||
{
|
||||
return (from areaExcel in GameData.RogueTournAreaData
|
||||
where areaExcel.Value.AreaGroupID != RogueTournAreaGroupIDEnum.WeekChallenge
|
||||
where areaExcel.Value.AreaGroupID != RogueTournAreaGroupIDEnum.WeekChallenge &&
|
||||
areaExcel.Value.TournMode != RogueTournModeEnum.Tourn1
|
||||
select new RogueTournAreaInfo
|
||||
{
|
||||
AreaId = (uint)areaExcel.Value.AreaID, Completed = true, IsTakenReward = true, IsUnlocked = true
|
||||
@@ -135,17 +156,19 @@ public class RogueTournManager(PlayerInstance player) : BasePlayerManager(player
|
||||
RogueTournHandbookSeasonId = GameConstants.CURRENT_ROGUE_TOURN_SEASON
|
||||
};
|
||||
|
||||
//foreach (var hexAvatar in GameData.RogueTournHexAvatarBaseTypeData.Keys)
|
||||
// proto.HandbookAvatarBaseList.Add((uint)hexAvatar);
|
||||
foreach (var hexAvatar in GameData.RogueTournHexAvatarBaseTypeData.Keys)
|
||||
proto.HandbookHexAvatarList.Add((uint)hexAvatar);
|
||||
|
||||
//foreach (var buff in GameData.RogueBuffData.Values)
|
||||
// if (buff is RogueTournBuffExcel { IsInHandbook: true })
|
||||
// proto.HandbookBuffList.Add((uint)buff.MazeBuffID);
|
||||
foreach (var buff in GameData.RogueBuffData.Values)
|
||||
if (buff is RogueTournBuffExcel { IsInHandbook: true })
|
||||
proto.HandbookBuffList.Add((uint)buff.MazeBuffID);
|
||||
|
||||
//foreach (var formulaId in GameData.RogueTournFormulaData.Keys) proto.HandbookFormulaList.Add((uint)formulaId);
|
||||
foreach (var formulaId in GameData.RogueTournFormulaData.Keys) proto.HandbookFormulaList.Add((uint)formulaId);
|
||||
|
||||
//foreach (var miracleId in GameData.RogueTournHandbookMiracleData.Keys)
|
||||
// proto.HandbookMiracleList.Add((uint)miracleId);
|
||||
foreach (var miracleId in GameData.RogueTournHandbookMiracleData.Keys)
|
||||
proto.HandbookMiracleList.Add((uint)miracleId);
|
||||
|
||||
foreach (var blessId in GameData.RogueTournTitanBlessData.Keys) proto.HandbookTitanBlessList.Add((uint)blessId);
|
||||
|
||||
//foreach (var eventId in GameData.RogueTournHandBookEventData.Keys) proto.HandbookEventList.Add((uint)eventId);
|
||||
|
||||
|
||||
@@ -7,10 +7,10 @@ namespace EggLink.DanhengServer.GameServer.Game.RogueTourn.Scene;
|
||||
|
||||
public class RogueTournLevelInstance
|
||||
{
|
||||
public RogueTournLevelInstance(int levelIndex)
|
||||
public RogueTournLevelInstance(int levelIndex, int layerId)
|
||||
{
|
||||
LevelIndex = levelIndex;
|
||||
LayerId = levelIndex * 100 + 1001; // temp
|
||||
LayerId = layerId;
|
||||
EntranceId = GameData.RogueTournRoomGenData.Where(x => x.RoomType != RogueTournRoomTypeEnum.Adventure)
|
||||
.Select(x => x.EntranceId).ToHashSet().ToList()
|
||||
.RandomElement();
|
||||
|
||||
30
GameServer/Game/RogueTourn/Titan/RogueTitanBlessInstance.cs
Normal file
30
GameServer/Game/RogueTourn/Titan/RogueTitanBlessInstance.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using EggLink.DanhengServer.Data.Excel;
|
||||
using EggLink.DanhengServer.GameServer.Game.Battle;
|
||||
|
||||
namespace EggLink.DanhengServer.GameServer.Game.RogueTourn.Titan;
|
||||
|
||||
public class RogueTitanBlessInstance
|
||||
{
|
||||
public List<RogueTournTitanBlessExcel> BlessTypeExcel { get; } = [];
|
||||
|
||||
public List<RogueTournTitanBlessExcel> EnhanceBlessList { get; } = [];
|
||||
|
||||
public void OnBattleStart(BattleInstance inst)
|
||||
{
|
||||
foreach (var bless in BlessTypeExcel)
|
||||
{
|
||||
inst.Buffs.Add(new MazeBuff(bless.MazeBuffID, 1, -1)
|
||||
{
|
||||
WaveFlag = -1
|
||||
});
|
||||
}
|
||||
|
||||
foreach (var bless in EnhanceBlessList)
|
||||
{
|
||||
inst.Buffs.Add(new MazeBuff(bless.MazeBuffID, 1, -1)
|
||||
{
|
||||
WaveFlag = -1
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
using EggLink.DanhengServer.Data;
|
||||
using EggLink.DanhengServer.Data.Excel;
|
||||
using EggLink.DanhengServer.Enums.TournRogue;
|
||||
using EggLink.DanhengServer.GameServer.Game.Rogue;
|
||||
using EggLink.DanhengServer.Proto;
|
||||
using EggLink.DanhengServer.Util;
|
||||
|
||||
namespace EggLink.DanhengServer.GameServer.Game.RogueTourn.Titan;
|
||||
|
||||
public class RogueTitanBlessSelectMenu(RogueTournInstance rogue)
|
||||
{
|
||||
public List<RogueTournTitanBlessExcel> Blesses { get; set; } = [];
|
||||
public int QueueAppend { get; set; } = 3;
|
||||
public bool TypeSelect { get; set; }
|
||||
|
||||
public void RollTitanBless(int count = 3, bool typeSelect = false)
|
||||
{
|
||||
var list = GameData.RogueTournTitanBlessData.Values.Where(x => GameData.RogueTournTitanTypeData.GetValueOrDefault(x.TitanType)?.RogueTitanCategory == rogue.TitanCategory).ToList();
|
||||
|
||||
if (typeSelect)
|
||||
{
|
||||
list = [];
|
||||
TypeSelect = true;
|
||||
// random 2 types
|
||||
if (rogue.TitanCategory != RogueTitanCategoryEnum.Night)
|
||||
{
|
||||
var night = GameData.RogueTournTitanBlessData.Values.Where(x => GameData.RogueTournTitanTypeData.GetValueOrDefault(x.TitanType)?.RogueTitanCategory == RogueTitanCategoryEnum.Night && x.TitanBlessLevel == 1).ToList().RandomElement();
|
||||
list.Add(night);
|
||||
}
|
||||
else if (rogue.TitanCategory == RogueTitanCategoryEnum.Day)
|
||||
{
|
||||
var bless = rogue.RogueTitanBlessInstance.BlessTypeExcel.LastOrDefault(x => GameData.RogueTournTitanTypeData.GetValueOrDefault(x.TitanType)?.RogueTitanCategory == RogueTitanCategoryEnum.Day);
|
||||
if (bless != null)
|
||||
{
|
||||
var targetBless = GameData.RogueTournTitanBlessData.Values.FirstOrDefault(x => x.TitanType == bless.TitanType && x.TitanBlessLevel == bless.TitanBlessLevel + 1);
|
||||
if (targetBless != null)
|
||||
{
|
||||
list.Add(targetBless);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (rogue.TitanCategory != RogueTitanCategoryEnum.Day)
|
||||
{
|
||||
var day = GameData.RogueTournTitanBlessData.Values.Where(x => GameData.RogueTournTitanTypeData.GetValueOrDefault(x.TitanType)?.RogueTitanCategory == RogueTitanCategoryEnum.Day && x.TitanBlessLevel == 1).ToList().RandomElement();
|
||||
list.Add(day);
|
||||
}
|
||||
else if (rogue.TitanCategory == RogueTitanCategoryEnum.Night)
|
||||
{
|
||||
var bless = rogue.RogueTitanBlessInstance.BlessTypeExcel.LastOrDefault(x => GameData.RogueTournTitanTypeData.GetValueOrDefault(x.TitanType)?.RogueTitanCategory == RogueTitanCategoryEnum.Night);
|
||||
if (bless != null)
|
||||
{
|
||||
var targetBless = GameData.RogueTournTitanBlessData.Values.FirstOrDefault(x => x.TitanType == bless.TitanType && x.TitanBlessLevel == bless.TitanBlessLevel + 1);
|
||||
if (targetBless != null)
|
||||
{
|
||||
list.Add(targetBless);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (list.Count == 0) return;
|
||||
|
||||
var result = new List<RogueTournTitanBlessExcel>();
|
||||
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
var blessExcel = list.RandomElement();
|
||||
result.Add(blessExcel);
|
||||
list.Remove(blessExcel);
|
||||
|
||||
if (list.Count == 0) break; // No more formulas to roll
|
||||
}
|
||||
|
||||
Blesses = result;
|
||||
}
|
||||
|
||||
public RogueActionInstance GetActionInstance()
|
||||
{
|
||||
rogue.CurActionQueuePosition += QueueAppend;
|
||||
return new RogueActionInstance
|
||||
{
|
||||
QueuePosition = rogue.CurActionQueuePosition,
|
||||
RogueTitanBlessSelectMenu = this
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
public RogueTitanBlessSelectInfo ToProto()
|
||||
{
|
||||
return new RogueTitanBlessSelectInfo
|
||||
{
|
||||
BlessSelectType = TypeSelect ? TitanBlessSelectType.KSelectTitanBlessType : TitanBlessSelectType.KSelectTitanBlessEnhance,
|
||||
TitanBlessIdList = { Blesses.Select(x => (uint)x.TitanBlessID) },
|
||||
SelectHintId = (uint)(TypeSelect ? 310001 : 310002)
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -33,6 +33,14 @@ public class HandlerHandleRogueCommonPendingActionCsReq : Handler
|
||||
await tournInstance.HandleFormulaSelect((int)req.RogueTournFormulaResult.TournFormulaId,
|
||||
(int)req.QueueLocation);
|
||||
|
||||
if (req.TitanBlessSelectTypeResult != null && rogue is RogueTournInstance tournInstance2)
|
||||
await tournInstance2.HandleTitanBlessSelect((int)req.TitanBlessSelectTypeResult.SelectTitanBlessId,
|
||||
(int)req.QueueLocation);
|
||||
|
||||
if (req.TitanBlessSelectEnhanceResult != null && rogue is RogueTournInstance tournInstance3)
|
||||
await tournInstance3.HandleTitanBlessSelect((int)req.TitanBlessSelectEnhanceResult.SelectTitanBlessId,
|
||||
(int)req.QueueLocation);
|
||||
|
||||
if (req.MagicUnitSelectResult != null && rogue is RogueMagicInstance magic)
|
||||
await magic.HandleMagicUnitSelect(req.MagicUnitSelectResult.SelectMagicUnit, (int)req.QueueLocation);
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ public class PacketHandleRogueCommonPendingActionScRsp : BasePacket
|
||||
{
|
||||
public PacketHandleRogueCommonPendingActionScRsp(int queuePosition, int queueLocation, bool selectBuff = false,
|
||||
bool selectMiracle = false, bool selectBonus = false, bool selectFormula = false,
|
||||
bool reforgeBuff = false, bool selectMagicUnit = false, bool selectScepter = false,
|
||||
bool reforgeBuff = false, bool selectMagicUnit = false, bool selectScepter = false, bool selectTitanBlessEnhance = false, bool selectTitanBlessType = false,
|
||||
RogueBuffSelectMenu? menu = null) : base(
|
||||
CmdIds.HandleRogueCommonPendingActionScRsp)
|
||||
{
|
||||
@@ -32,6 +32,10 @@ public class PacketHandleRogueCommonPendingActionScRsp : BasePacket
|
||||
|
||||
if (selectScepter) proto.ScepterSelectCallback = new RogueMagicScepterSelectCallback();
|
||||
|
||||
if (selectTitanBlessEnhance) proto.TitanBlessSelectEnhanceCallback = new RogueTitanBlessSelectCallback();
|
||||
|
||||
if (selectTitanBlessType) proto.TitanBlessSelectTypeCallback = new RogueTitanBlessSelectCallback();
|
||||
|
||||
if (menu != null)
|
||||
proto.BuffRerollCallback = new RogueBuffRerollCallback
|
||||
{
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
using EggLink.DanhengServer.GameServer.Game.RogueTourn;
|
||||
using EggLink.DanhengServer.Kcp;
|
||||
using EggLink.DanhengServer.Proto;
|
||||
|
||||
namespace EggLink.DanhengServer.GameServer.Server.Packet.Send.RogueTourn;
|
||||
|
||||
public class PacketRogueTournTitanUpdateTitanBlessProgressScNotify : BasePacket
|
||||
{
|
||||
public PacketRogueTournTitanUpdateTitanBlessProgressScNotify(RogueTournInstance inst) : base(
|
||||
CmdIds.RogueTournTitanUpdateTitanBlessProgressScNotify)
|
||||
{
|
||||
var proto = new RogueTournTitanUpdateTitanBlessProgressScNotify
|
||||
{
|
||||
TitanBlessProgress = (uint)inst.TitanProgress
|
||||
};
|
||||
|
||||
SetData(proto);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user