diff --git a/GameServer/Game/Rogue/Event/RogueEventManager.cs b/GameServer/Game/Rogue/Event/RogueEventManager.cs index 86e91f55..7bced2f6 100644 --- a/GameServer/Game/Rogue/Event/RogueEventManager.cs +++ b/GameServer/Game/Rogue/Event/RogueEventManager.cs @@ -144,11 +144,16 @@ public class RogueEventManager(PlayerInstance player, BaseRogueInstance rogueIns if (dynamicAct != null) await RogueEventActionExecutor.ExecuteActions(Rogue, eventInstance, dynamicAct.SelectActions); + if (eventInstance.EffectEventId.Count > 0) + option.OverrideSelected = false; + // send rsp await Player.SendPacket(new PacketSyncRogueCommonDialogueOptionFinishScNotify(eventInstance)); option.IsSelected = true; + await Player.SendPacket(new PacketSelectRogueCommonDialogueOptionScRsp(eventInstance)); + eventInstance.EffectEventId.Clear(); } } \ No newline at end of file diff --git a/GameServer/Game/RogueTourn/RogueTournInstance.cs b/GameServer/Game/RogueTourn/RogueTournInstance.cs index c6b6b22b..6af93c4f 100644 --- a/GameServer/Game/RogueTourn/RogueTournInstance.cs +++ b/GameServer/Game/RogueTourn/RogueTournInstance.cs @@ -215,6 +215,19 @@ public class RogueTournInstance : BaseRogueInstance await UpdateMenu(); } + public async ValueTask HandleRerollTitanBless(int location) + { + if (RogueActions.Count == 0) return; + var action = RogueActions.First().Value; + if (action.RogueTitanBlessSelectMenu != null) + { + action.RogueTitanBlessSelectMenu.Reroll(); // reroll + await Player.SendPacket( + new PacketHandleRogueCommonPendingActionScRsp(action.QueuePosition, location, + titanMenu: action.RogueTitanBlessSelectMenu)); + } + } + #endregion #region Buff & Formula diff --git a/GameServer/Game/RogueTourn/Titan/RogueTitanBlessSelectMenu.cs b/GameServer/Game/RogueTourn/Titan/RogueTitanBlessSelectMenu.cs index cd6b3226..291cb543 100644 --- a/GameServer/Game/RogueTourn/Titan/RogueTitanBlessSelectMenu.cs +++ b/GameServer/Game/RogueTourn/Titan/RogueTitanBlessSelectMenu.cs @@ -11,6 +11,8 @@ public class RogueTitanBlessSelectMenu(RogueTournInstance rogue) { public List Blesses { get; set; } = []; public int QueueAppend { get; set; } = 3; + public int MaxRerollCount { get; set; } = 1; + public int CurRerollCount { get; set; } = 0; public bool TypeSelect { get; set; } public void RollTitanBless(int count = 3, bool typeSelect = false) @@ -35,7 +37,14 @@ public class RogueTitanBlessSelectMenu(RogueTournInstance rogue) RogueTitanCategoryEnum.Day && x.TitanBlessLevel == 1 && !rogue.RogueTitanBlessInstance.BlessTypeExcel.Contains(x)).ToList().RandomElement(); + var other = GameData.RogueTournTitanBlessData.Values.Where(x => x.TitanBlessLevel == 1 && + !rogue.RogueTitanBlessInstance + .BlessTypeExcel.Contains(x) && + x != day && x != night).ToList() + .RandomElement(); + list.Add(day); + list.Add(other); list.Add(night); } @@ -55,6 +64,14 @@ public class RogueTitanBlessSelectMenu(RogueTournInstance rogue) Blesses = result; } + public void Reroll() + { + if (CurRerollCount >= MaxRerollCount) return; + CurRerollCount++; + + RollTitanBless(Blesses.Count, TypeSelect); + } + public RogueActionInstance GetActionInstance() { rogue.CurActionQueuePosition += QueueAppend; @@ -65,7 +82,6 @@ public class RogueTitanBlessSelectMenu(RogueTournInstance rogue) }; } - public RogueTitanBlessSelectInfo ToProto() { return new RogueTitanBlessSelectInfo @@ -74,7 +90,9 @@ public class RogueTitanBlessSelectMenu(RogueTournInstance rogue) ? TitanBlessSelectType.KSelectTitanBlessType : TitanBlessSelectType.KSelectTitanBlessEnhance, TitanBlessIdList = { Blesses.Select(x => (uint)x.TitanBlessID) }, - SelectHintId = (uint)(TypeSelect ? 310001 : 310002) + SelectHintId = (uint)(TypeSelect ? 310001 : 310002), + MaxRerollCount = (uint)MaxRerollCount, + CurRerollCount = (uint)CurRerollCount }; } } \ No newline at end of file diff --git a/GameServer/Server/Packet/Recv/RogueCommon/HandlerHandleRogueCommonPendingActionCsReq.cs b/GameServer/Server/Packet/Recv/RogueCommon/HandlerHandleRogueCommonPendingActionCsReq.cs index e8e3d1f2..01b3bbae 100644 --- a/GameServer/Server/Packet/Recv/RogueCommon/HandlerHandleRogueCommonPendingActionCsReq.cs +++ b/GameServer/Server/Packet/Recv/RogueCommon/HandlerHandleRogueCommonPendingActionCsReq.cs @@ -41,6 +41,9 @@ public class HandlerHandleRogueCommonPendingActionCsReq : Handler await tournInstance3.HandleTitanBlessSelect((int)req.TitanBlessSelectEnhanceResult.SelectTitanBlessId, (int)req.QueueLocation); + if (req.TitanBlessRerollResult != null && rogue is RogueTournInstance tournInstance4) + await tournInstance4.HandleRerollTitanBless((int)req.QueueLocation); + if (req.MagicUnitSelectResult != null && rogue is RogueMagicInstance magic) await magic.HandleMagicUnitSelect(req.MagicUnitSelectResult.SelectMagicUnit, (int)req.QueueLocation); diff --git a/GameServer/Server/Packet/Recv/RogueMagic/HandlerRogueMagicEnterRoomCsReq.cs b/GameServer/Server/Packet/Recv/RogueMagic/HandlerRogueMagicEnterRoomCsReq.cs index f9d13183..11eb56ef 100644 --- a/GameServer/Server/Packet/Recv/RogueMagic/HandlerRogueMagicEnterRoomCsReq.cs +++ b/GameServer/Server/Packet/Recv/RogueMagic/HandlerRogueMagicEnterRoomCsReq.cs @@ -1,5 +1,6 @@ using EggLink.DanhengServer.Enums.RogueMagic; using EggLink.DanhengServer.GameServer.Server.Packet.Send.RogueMagic; +using EggLink.DanhengServer.GameServer.Server.Packet.Send.Scene; using EggLink.DanhengServer.Kcp; using EggLink.DanhengServer.Proto; @@ -23,5 +24,6 @@ public class HandlerRogueMagicEnterRoomCsReq : Handler await inst.EnterRoom((int)(req.CurRoomIndex + 1), (RogueMagicRoomTypeEnum)req.NextRoomType); await connection.SendPacket(new PacketRogueMagicEnterRoomScRsp(Retcode.RetSucc, inst)); + await connection.SendPacket(new PacketEnterSceneByServerScNotify(connection.Player!.SceneInstance!)); } } \ No newline at end of file diff --git a/GameServer/Server/Packet/Send/RogueCommon/PacketHandleRogueCommonPendingActionScRsp.cs b/GameServer/Server/Packet/Send/RogueCommon/PacketHandleRogueCommonPendingActionScRsp.cs index 0e7c7a82..903fd397 100644 --- a/GameServer/Server/Packet/Send/RogueCommon/PacketHandleRogueCommonPendingActionScRsp.cs +++ b/GameServer/Server/Packet/Send/RogueCommon/PacketHandleRogueCommonPendingActionScRsp.cs @@ -1,4 +1,5 @@ using EggLink.DanhengServer.GameServer.Game.Rogue.Buff; +using EggLink.DanhengServer.GameServer.Game.RogueTourn.Titan; using EggLink.DanhengServer.Kcp; using EggLink.DanhengServer.Proto; @@ -10,7 +11,7 @@ public class PacketHandleRogueCommonPendingActionScRsp : BasePacket bool selectMiracle = false, bool selectBonus = false, bool selectFormula = false, bool reforgeBuff = false, bool selectMagicUnit = false, bool selectScepter = false, bool selectTitanBlessEnhance = false, bool selectTitanBlessType = false, - RogueBuffSelectMenu? menu = null) : base( + RogueBuffSelectMenu? menu = null, RogueTitanBlessSelectMenu? titanMenu = null) : base( CmdIds.HandleRogueCommonPendingActionScRsp) { var proto = new HandleRogueCommonPendingActionScRsp @@ -43,6 +44,12 @@ public class PacketHandleRogueCommonPendingActionScRsp : BasePacket BuffSelectInfo = menu.ToProto() }; + if (titanMenu != null) + proto.TitanBlessRerollCallback = new RogueTitanBlessRerollCallback + { + TitanRerollInfo = titanMenu.ToProto() + }; + SetData(proto); } } \ No newline at end of file