mirror of
https://github.com/EggLinks/DanhengServer-OpenSource.git
synced 2026-01-02 20:26:03 +08:00
feat: titan bless reroll
This commit is contained in:
@@ -144,11 +144,16 @@ public class RogueEventManager(PlayerInstance player, BaseRogueInstance rogueIns
|
|||||||
if (dynamicAct != null)
|
if (dynamicAct != null)
|
||||||
await RogueEventActionExecutor.ExecuteActions(Rogue, eventInstance, dynamicAct.SelectActions);
|
await RogueEventActionExecutor.ExecuteActions(Rogue, eventInstance, dynamicAct.SelectActions);
|
||||||
|
|
||||||
|
if (eventInstance.EffectEventId.Count > 0)
|
||||||
|
option.OverrideSelected = false;
|
||||||
|
|
||||||
// send rsp
|
// send rsp
|
||||||
await Player.SendPacket(new PacketSyncRogueCommonDialogueOptionFinishScNotify(eventInstance));
|
await Player.SendPacket(new PacketSyncRogueCommonDialogueOptionFinishScNotify(eventInstance));
|
||||||
option.IsSelected = true;
|
option.IsSelected = true;
|
||||||
|
|
||||||
await Player.SendPacket(new PacketSelectRogueCommonDialogueOptionScRsp(eventInstance));
|
await Player.SendPacket(new PacketSelectRogueCommonDialogueOptionScRsp(eventInstance));
|
||||||
|
|
||||||
|
|
||||||
eventInstance.EffectEventId.Clear();
|
eventInstance.EffectEventId.Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -215,6 +215,19 @@ public class RogueTournInstance : BaseRogueInstance
|
|||||||
await UpdateMenu();
|
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
|
#endregion
|
||||||
|
|
||||||
#region Buff & Formula
|
#region Buff & Formula
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ public class RogueTitanBlessSelectMenu(RogueTournInstance rogue)
|
|||||||
{
|
{
|
||||||
public List<RogueTournTitanBlessExcel> Blesses { get; set; } = [];
|
public List<RogueTournTitanBlessExcel> Blesses { get; set; } = [];
|
||||||
public int QueueAppend { get; set; } = 3;
|
public int QueueAppend { get; set; } = 3;
|
||||||
|
public int MaxRerollCount { get; set; } = 1;
|
||||||
|
public int CurRerollCount { get; set; } = 0;
|
||||||
public bool TypeSelect { get; set; }
|
public bool TypeSelect { get; set; }
|
||||||
|
|
||||||
public void RollTitanBless(int count = 3, bool typeSelect = false)
|
public void RollTitanBless(int count = 3, bool typeSelect = false)
|
||||||
@@ -35,7 +37,14 @@ public class RogueTitanBlessSelectMenu(RogueTournInstance rogue)
|
|||||||
RogueTitanCategoryEnum.Day && x.TitanBlessLevel == 1 &&
|
RogueTitanCategoryEnum.Day && x.TitanBlessLevel == 1 &&
|
||||||
!rogue.RogueTitanBlessInstance.BlessTypeExcel.Contains(x)).ToList().RandomElement();
|
!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(day);
|
||||||
|
list.Add(other);
|
||||||
list.Add(night);
|
list.Add(night);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,6 +64,14 @@ public class RogueTitanBlessSelectMenu(RogueTournInstance rogue)
|
|||||||
Blesses = result;
|
Blesses = result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Reroll()
|
||||||
|
{
|
||||||
|
if (CurRerollCount >= MaxRerollCount) return;
|
||||||
|
CurRerollCount++;
|
||||||
|
|
||||||
|
RollTitanBless(Blesses.Count, TypeSelect);
|
||||||
|
}
|
||||||
|
|
||||||
public RogueActionInstance GetActionInstance()
|
public RogueActionInstance GetActionInstance()
|
||||||
{
|
{
|
||||||
rogue.CurActionQueuePosition += QueueAppend;
|
rogue.CurActionQueuePosition += QueueAppend;
|
||||||
@@ -65,7 +82,6 @@ public class RogueTitanBlessSelectMenu(RogueTournInstance rogue)
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public RogueTitanBlessSelectInfo ToProto()
|
public RogueTitanBlessSelectInfo ToProto()
|
||||||
{
|
{
|
||||||
return new RogueTitanBlessSelectInfo
|
return new RogueTitanBlessSelectInfo
|
||||||
@@ -74,7 +90,9 @@ public class RogueTitanBlessSelectMenu(RogueTournInstance rogue)
|
|||||||
? TitanBlessSelectType.KSelectTitanBlessType
|
? TitanBlessSelectType.KSelectTitanBlessType
|
||||||
: TitanBlessSelectType.KSelectTitanBlessEnhance,
|
: TitanBlessSelectType.KSelectTitanBlessEnhance,
|
||||||
TitanBlessIdList = { Blesses.Select(x => (uint)x.TitanBlessID) },
|
TitanBlessIdList = { Blesses.Select(x => (uint)x.TitanBlessID) },
|
||||||
SelectHintId = (uint)(TypeSelect ? 310001 : 310002)
|
SelectHintId = (uint)(TypeSelect ? 310001 : 310002),
|
||||||
|
MaxRerollCount = (uint)MaxRerollCount,
|
||||||
|
CurRerollCount = (uint)CurRerollCount
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -41,6 +41,9 @@ public class HandlerHandleRogueCommonPendingActionCsReq : Handler
|
|||||||
await tournInstance3.HandleTitanBlessSelect((int)req.TitanBlessSelectEnhanceResult.SelectTitanBlessId,
|
await tournInstance3.HandleTitanBlessSelect((int)req.TitanBlessSelectEnhanceResult.SelectTitanBlessId,
|
||||||
(int)req.QueueLocation);
|
(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)
|
if (req.MagicUnitSelectResult != null && rogue is RogueMagicInstance magic)
|
||||||
await magic.HandleMagicUnitSelect(req.MagicUnitSelectResult.SelectMagicUnit, (int)req.QueueLocation);
|
await magic.HandleMagicUnitSelect(req.MagicUnitSelectResult.SelectMagicUnit, (int)req.QueueLocation);
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using EggLink.DanhengServer.Enums.RogueMagic;
|
using EggLink.DanhengServer.Enums.RogueMagic;
|
||||||
using EggLink.DanhengServer.GameServer.Server.Packet.Send.RogueMagic;
|
using EggLink.DanhengServer.GameServer.Server.Packet.Send.RogueMagic;
|
||||||
|
using EggLink.DanhengServer.GameServer.Server.Packet.Send.Scene;
|
||||||
using EggLink.DanhengServer.Kcp;
|
using EggLink.DanhengServer.Kcp;
|
||||||
using EggLink.DanhengServer.Proto;
|
using EggLink.DanhengServer.Proto;
|
||||||
|
|
||||||
@@ -23,5 +24,6 @@ public class HandlerRogueMagicEnterRoomCsReq : Handler
|
|||||||
|
|
||||||
await inst.EnterRoom((int)(req.CurRoomIndex + 1), (RogueMagicRoomTypeEnum)req.NextRoomType);
|
await inst.EnterRoom((int)(req.CurRoomIndex + 1), (RogueMagicRoomTypeEnum)req.NextRoomType);
|
||||||
await connection.SendPacket(new PacketRogueMagicEnterRoomScRsp(Retcode.RetSucc, inst));
|
await connection.SendPacket(new PacketRogueMagicEnterRoomScRsp(Retcode.RetSucc, inst));
|
||||||
|
await connection.SendPacket(new PacketEnterSceneByServerScNotify(connection.Player!.SceneInstance!));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using EggLink.DanhengServer.GameServer.Game.Rogue.Buff;
|
using EggLink.DanhengServer.GameServer.Game.Rogue.Buff;
|
||||||
|
using EggLink.DanhengServer.GameServer.Game.RogueTourn.Titan;
|
||||||
using EggLink.DanhengServer.Kcp;
|
using EggLink.DanhengServer.Kcp;
|
||||||
using EggLink.DanhengServer.Proto;
|
using EggLink.DanhengServer.Proto;
|
||||||
|
|
||||||
@@ -10,7 +11,7 @@ public class PacketHandleRogueCommonPendingActionScRsp : BasePacket
|
|||||||
bool selectMiracle = false, bool selectBonus = false, bool selectFormula = 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,
|
bool selectTitanBlessEnhance = false, bool selectTitanBlessType = false,
|
||||||
RogueBuffSelectMenu? menu = null) : base(
|
RogueBuffSelectMenu? menu = null, RogueTitanBlessSelectMenu? titanMenu = null) : base(
|
||||||
CmdIds.HandleRogueCommonPendingActionScRsp)
|
CmdIds.HandleRogueCommonPendingActionScRsp)
|
||||||
{
|
{
|
||||||
var proto = new HandleRogueCommonPendingActionScRsp
|
var proto = new HandleRogueCommonPendingActionScRsp
|
||||||
@@ -43,6 +44,12 @@ public class PacketHandleRogueCommonPendingActionScRsp : BasePacket
|
|||||||
BuffSelectInfo = menu.ToProto()
|
BuffSelectInfo = menu.ToProto()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (titanMenu != null)
|
||||||
|
proto.TitanBlessRerollCallback = new RogueTitanBlessRerollCallback
|
||||||
|
{
|
||||||
|
TitanRerollInfo = titanMenu.ToProto()
|
||||||
|
};
|
||||||
|
|
||||||
SetData(proto);
|
SetData(proto);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user