using System; using System.Collections.Generic; using Vision.Core.IO.SHN; using Vision.Core.Utils; namespace Vision.Game.Content.Data.AbnormalState { public class SubAbnormalStateInfo { public ushort ID { get; } public uint Strength { get; } public byte Type { get; } public byte SubType { get; } public TimeSpan KeepTime { get; } public List Actions { get; } public SubAbnormalStateInfo(ushort id, uint strength, byte type, byte subType, TimeSpan keepTime, params SubAbnormalStateAction[] actions) { ID = id; Strength = strength; Type = type; SubType = subType; KeepTime = keepTime; Actions = new List(actions); } public SubAbnormalStateInfo(SHNResult result, int rIndex) { ID = result.Read(rIndex, "ID"); Strength = result.Read(rIndex, "Strength"); Type = result.Read(rIndex, "Type"); SubType = result.Read(rIndex, "SubType"); KeepTime = TimeSpan.FromMilliseconds(result.Read(rIndex, "KeepTime")); Actions = new List(); for (var i = 0; i < 4; i++) { var letter = StringUtils.CharactersUpper[i]; uint actionIndex = result.Read(rIndex, "ActionIndex" + letter), actionValue = result.Read(rIndex, "ActionArg" + letter); if (actionIndex == 0) continue; Actions.Add(new SubAbnormalStateAction(actionIndex, actionValue)); } } } }