From 784037c865418c0ffae6e316d4e3ac6166350b92 Mon Sep 17 00:00:00 2001 From: Rutherther Date: Sun, 1 Jan 2023 18:38:45 +0100 Subject: [PATCH] fix(game): make effects vnum short instead of long --- Core/NosSmooth.Game/Data/Entities/LivingEntity.cs | 2 +- .../PacketHandlers/Entities/StPacketResponder.cs | 2 +- .../{SuResponder.cs => SkillUseResponder.cs} | 10 +++++++++- 3 files changed, 11 insertions(+), 3 deletions(-) rename Extensions/NosSmooth.Extensions.Combat/Responders/{SuResponder.cs => SkillUseResponder.cs} (73%) diff --git a/Core/NosSmooth.Game/Data/Entities/LivingEntity.cs b/Core/NosSmooth.Game/Data/Entities/LivingEntity.cs index b3775e2..7033db0 100644 --- a/Core/NosSmooth.Game/Data/Entities/LivingEntity.cs +++ b/Core/NosSmooth.Game/Data/Entities/LivingEntity.cs @@ -57,7 +57,7 @@ public interface ILivingEntity : IEntity /// /// Gets the VNums of the effects the entity has. /// - public IReadOnlyList? EffectsVNums { get; set; } + public IReadOnlyList? EffectsVNums { get; set; } /// /// Gets the name of the entity. May be null if unknown. diff --git a/Core/NosSmooth.Game/PacketHandlers/Entities/StPacketResponder.cs b/Core/NosSmooth.Game/PacketHandlers/Entities/StPacketResponder.cs index 320dc60..c93f25f 100644 --- a/Core/NosSmooth.Game/PacketHandlers/Entities/StPacketResponder.cs +++ b/Core/NosSmooth.Game/PacketHandlers/Entities/StPacketResponder.cs @@ -45,7 +45,7 @@ public class StPacketResponder : IPacketResponder return Task.FromResult(Result.FromSuccess()); } - entity.EffectsVNums = packet.BuffVNums?.Select(x => x.CardId).Cast().ToList(); + entity.EffectsVNums = packet.BuffVNums?.Select(x => x.CardId).ToList(); entity.Level = packet.Level; if (entity is Player player) { diff --git a/Extensions/NosSmooth.Extensions.Combat/Responders/SuResponder.cs b/Extensions/NosSmooth.Extensions.Combat/Responders/SkillUseResponder.cs similarity index 73% rename from Extensions/NosSmooth.Extensions.Combat/Responders/SuResponder.cs rename to Extensions/NosSmooth.Extensions.Combat/Responders/SkillUseResponder.cs index 933d0b9..796654a 100644 --- a/Extensions/NosSmooth.Extensions.Combat/Responders/SuResponder.cs +++ b/Extensions/NosSmooth.Extensions.Combat/Responders/SkillUseResponder.cs @@ -5,6 +5,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using NosSmooth.Core.Packets; +using NosSmooth.Packets; using NosSmooth.Packets.Server.Battle; using Remora.Results; @@ -13,7 +14,7 @@ namespace NosSmooth.Extensions.Combat.Responders; /// /// Responds to su packet. /// -public class SuResponder : IPacketResponder +public class SuResponder : IPacketResponder, IPacketResponder { private readonly CombatManager _combatManager; @@ -32,4 +33,11 @@ public class SuResponder : IPacketResponder _combatManager.CancelSkillTokensAsync(ct); return Task.FromResult(Result.FromSuccess()); } + + /// + public Task Respond(PacketEventArgs packetArgs, CancellationToken ct = default) + { + _combatManager.CancelSkillTokensAsync(ct); + return Task.FromResult(Result.FromSuccess()); + } } \ No newline at end of file -- 2.48.1