public void Update(HotDot hotdot, AbnormalityDuration abnormalityDuration, long firstHit, long lastHit) { SkillIcon.Source = BasicTeraData.Instance.Icons.GetImage(hotdot.IconName); SkillIcon.ToolTip = string.IsNullOrEmpty(hotdot.ItemName) ? null : hotdot.ItemName; LabelClass.Content = LP.ResourceManager.GetString(abnormalityDuration.InitialPlayerClass.ToString(), LP.Culture); var intervalEntity = lastHit - firstHit; var ticks = abnormalityDuration.Duration(firstHit, lastHit); var interval = TimeSpan.FromTicks(ticks); LabelAbnormalityDuration.Content = interval.ToString(@"mm\:ss"); if (intervalEntity == 0) { LabelAbnormalityDurationPercentage.Content = "0%"; } else { LabelAbnormalityDurationPercentage.Content = abnormalityDuration.Duration(firstHit, lastHit) * 100 / intervalEntity + "%"; } interval = TimeSpan.FromTicks(intervalEntity); LabelInterval.Content = interval.ToString(@"mm\:ss"); LabelName.Content = hotdot.Name; LabelName.ToolTip = string.IsNullOrEmpty(hotdot.Tooltip) ? null : hotdot.Tooltip; LabelAbnormalityDurationPercentage.ToolTip = hotdot.Id; }
public void Update(HotDot hotdot, AbnormalityDuration abnormalityDuration, long firstHit, long lastHit) { SkillIcon.Source = BasicTeraData.Instance.Icons.GetImage(hotdot.IconName); SkillIcon.ToolTip = string.IsNullOrEmpty(hotdot.ItemName) ? null : hotdot.ItemName; LabelClass.Content = LP.ResourceManager.GetString(abnormalityDuration.InitialPlayerClass.ToString(),LP.Culture); var intervalEntity = lastHit - firstHit; var ticks = abnormalityDuration.Duration(firstHit, lastHit); var interval = TimeSpan.FromTicks(ticks); LabelAbnormalityDuration.Content = interval.ToString(@"mm\:ss"); if (intervalEntity == 0) { LabelAbnormalityDurationPercentage.Content = "0%"; } else { LabelAbnormalityDurationPercentage.Content = abnormalityDuration.Duration(firstHit, lastHit)*100/ intervalEntity + "%"; } interval = TimeSpan.FromTicks(intervalEntity); LabelInterval.Content = interval.ToString(@"mm\:ss"); LabelName.Content = hotdot.Name; LabelName.ToolTip = string.IsNullOrEmpty(hotdot.Tooltip) ? null : hotdot.Tooltip; LabelAbnormalityDurationPercentage.ToolTip = hotdot.Id; StacksDetailList.Items.Clear(); foreach (var stack in abnormalityDuration.Stacks(firstHit, lastHit)) { StacksDetailList.Items.Add(new EnduranceDebuffDetail(hotdot, stack, abnormalityDuration, firstHit, lastHit)); } }
public void Update(HotDot hotdot, AbnormalityDuration abnormalityDuration, long firstHit, long lastHit) { LabelClass.Content = abnormalityDuration.InitialPlayerClass; var intervalEntity = lastHit - firstHit; // Console.WriteLine("f:"+firstHit+";l:"+lastHit+";i:"+intervalEntity); var second = abnormalityDuration.Duration(firstHit, lastHit); // Console.WriteLine(second); var interval = TimeSpan.FromSeconds(second); LabelAbnormalityDuration.Content = interval.ToString(@"mm\:ss"); if (intervalEntity == 0) { LabelAbnormalityDurationPercentage.Content = "0%"; } else { LabelAbnormalityDurationPercentage.Content = abnormalityDuration.Duration(firstHit, lastHit) * 100 / intervalEntity + "%"; } interval = TimeSpan.FromSeconds(intervalEntity); LabelInterval.Content = interval.ToString(@"mm\:ss"); LabelName.Content = hotdot.Name; LabelId.Content = hotdot.Id; }
public Abnormality(HotDot hotdot, EntityId source, EntityId target, int duration, int stack, long ticks) { HotDot = hotdot; Source = source; Target = target; Duration = duration / 1000; Stack = stack == 0 ? 1 : stack; FirstHit = ticks / TimeSpan.TicksPerSecond; if (HotDot.Name == "") { return; } RegisterBuff(); RegisterEnduranceDebuff(); }
public Abnormality(HotDot hotdot, EntityId source, EntityId target, int duration, int stack, long ticks, AbnormalityTracker abnormalityTracker) { HotDot = hotdot; Source = source; Target = target; Duration = duration / 1000; Stack = stack == 0 ? 1 : stack; FirstHit = ticks; if (HotDot.Name == "") { return; } _abnormalityTracker = abnormalityTracker; RegisterBuff(ticks); RegisterEnduranceDebuff(ticks); }
public bool AbnormalityExist(EntityId target, HotDot dot) { if (!_abnormalities.ContainsKey(target)) { return(false); } var abnormalityTarget = _abnormalities[target]; for (var i = 0; i < abnormalityTarget.Count; i++) { if (abnormalityTarget[i].HotDot == dot) { return(true); } } return(false); }
public void Update(HotDot hotdot, AbnormalityDuration abnormalityDuration, long firstHit, long lastHit) { SkillIcon.ImageSource = BasicTeraData.Instance.Icons.GetImage(hotdot.IconName); SkillIconWrapper.ToolTip = string.IsNullOrEmpty(hotdot.ItemName) ? null : hotdot.ItemName; LabelClass.Content = LP.ResourceManager.GetString(abnormalityDuration.InitialPlayerClass.ToString(), LP.Culture); var intervalEntity = lastHit - firstHit; var ticks = abnormalityDuration.Duration(firstHit, lastHit); var interval = TimeSpan.FromTicks(ticks); LabelAbnormalityDuration.Content = interval.ToString(@"mm\:ss"); if (intervalEntity == 0) { LabelAbnormalityDurationPercentage.Content = "0%"; } else { LabelAbnormalityDurationPercentage.Content = abnormalityDuration.Duration(firstHit, lastHit) * 100 / intervalEntity + "%"; } interval = TimeSpan.FromTicks(intervalEntity); LabelInterval.Content = interval.ToString(@"mm\:ss"); LabelName.Content = hotdot.Name; LabelName.ToolTip = string.IsNullOrEmpty(hotdot.Tooltip) ? null : hotdot.Tooltip; LabelAbnormalityDurationPercentage.ToolTip = hotdot.Id; var count = 0; foreach (var stack in abnormalityDuration.Stacks(firstHit, lastHit)) { if (StacksDetailList.Items.Count > count) { ((EnduranceDebuffDetail)StacksDetailList.Items[count]).Update(hotdot, stack, abnormalityDuration, firstHit, lastHit); } else { StacksDetailList.Items.Add(new EnduranceDebuffDetail(hotdot, stack, abnormalityDuration, firstHit, lastHit)); } count++; } while (StacksDetailList.Items.Count > count + 1) { StacksDetailList.Items.RemoveAt(count + 1); } }
public EnduranceDebuffDetail(HotDot hotdot, int stack, AbnormalityDuration abnormalityDuration, long firstHit, long lastHit) { InitializeComponent(); Update(hotdot, stack, abnormalityDuration, firstHit, lastHit); }
public HotDotDatabase(string folder, string language) { var reader = new StreamReader(File.OpenRead(Path.Combine(folder, $"hotdot\\hotdot-{language}.tsv"))); while (!reader.EndOfStream) { var line = reader.ReadLine(); if (line == null) { continue; } var values = line.Split('\t'); var id = int.Parse(values[0]); var type = values[1]; var hp = double.Parse(values[2], CultureInfo.InvariantCulture); var mp = double.Parse(values[3], CultureInfo.InvariantCulture); var method = (HotDot.DotType)Enum.Parse(typeof(HotDot.DotType), values[4]); var time = int.Parse(values[5]); var tick = int.Parse(values[6]); var amount = double.Parse(values[7], CultureInfo.InvariantCulture); var name = values[8]; var itemName = values[10]; var tooltip = values[11]; var iconName = values[12]; if (_hotdots.ContainsKey(id)) { _hotdots[id].Update(id, type, hp, mp, amount, method, time, tick, name, itemName, tooltip, iconName); } else { _hotdots[id] = new HotDot(id, type, hp, mp, amount, method, time, tick, name, itemName, tooltip, iconName); } } _hotdots[(int)StaticallyUsedBuff.Enraged] = new HotDot((int)StaticallyUsedBuff.Enraged, "Endurance", 0, 0, 0, 0, 0, 0, "Enrage", "", "", "enraged"); _hotdots[(int)StaticallyUsedBuff.Slaying] = new HotDot((int)StaticallyUsedBuff.Slaying, "CritPower", 0, 0, 0, 0, 0, 0, "Slaying", "", "'Slaying' crystal is working (if equipped) when player in this state.", "slaying"); var shortnames = Path.Combine(folder, $"hotdot\\hotdot-short-{language}.tsv"); if (File.Exists(shortnames)) { reader = new StreamReader(File.OpenRead(shortnames)); while (!reader.EndOfStream) { var line = reader.ReadLine(); if (line == null) { continue; } var values = line.Split('\t'); var id = int.Parse(values[0]); var shortname = values[1]; if (_hotdots.ContainsKey(id)) { _hotdots[id].ShortName = shortname; } } } Enraged = _hotdots[(int)StaticallyUsedBuff.Enraged]; Slaying = _hotdots[(int)StaticallyUsedBuff.Slaying]; _hotdots.TryGetValue((int)StaticallyUsedBuff.JoyOfPartying0, out JoyOfPartying0); _hotdots.TryGetValue((int)StaticallyUsedBuff.JoyOfPartying20, out JoyOfPartying20); _hotdots.TryGetValue((int)StaticallyUsedBuff.JoyOfPartying50, out JoyOfPartying50); _hotdots.TryGetValue((int)StaticallyUsedBuff.JoyOfPartying100, out JoyOfPartying100); _hotdots.TryGetValue((int)StaticallyUsedBuff.Enraged, out Enrage); _hotdots.TryGetValue((int)StaticallyUsedBuff.Contagion1, out Contagion1); _hotdots.TryGetValue((int)StaticallyUsedBuff.Contagion2, out Contagion2); _hotdots.TryGetValue((int)StaticallyUsedBuff.Hurricane, out Hurricane); }
public void Add(HotDot dot) { _hotdots[dot.Id] = dot; }
public HotDotDatabase(string folder, string language) { var reader = new StreamReader(File.OpenRead(Path.Combine(folder, $"hotdot\\hotdot-{language}.tsv"))); while (!reader.EndOfStream) { var line = reader.ReadLine(); if (line == null) { continue; } var values = line.Split('\t'); var id = int.Parse(values[0]); var type = values[1]; var abType = (HotDot.AbnormalityType)Enum.Parse(typeof(HotDot.AbnormalityType), values[2]); var isBuff = bool.Parse(values[3]); var method = (HotDot.DotType)Enum.Parse(typeof(HotDot.DotType), values[4]); var time = uint.Parse(values[5]); var tick = int.Parse(values[6]); var amount = double.Parse(values[7], CultureInfo.InvariantCulture); var hp = type == "HPChange" ? amount : 0; var mp = type == "MPChange" ? amount : 0; var name = values[8]; var itemName = values[10]; var tooltip = Regex.Replace(values[11].Replace("$H_W_GOOD", "").Replace("H_W_GOOD", "").Replace("$COLOR_END", "").Replace("$H_W_BAD", "").Replace("$H_W_Bad", "").Replace("H_W_BAD", "").Replace("$BR", " ").Replace("<br>", " "), "</?(font{1}).*?/?>", ""); var iconName = values[12]; var effectIcon = values[13]; var isShow = bool.Parse(values[14]); if (_hotdots.ContainsKey(id)) { _hotdots[id].Update(id, type, hp, mp, amount, method, time, tick, name, itemName, tooltip, iconName); } else { _hotdots[id] = new HotDot(id, type, hp, mp, amount, method, time, tick, name, itemName, tooltip, iconName, abType, isBuff, isShow, effectIcon); } } _hotdots[(int)StaticallyUsedBuff.Enraged] = new HotDot((int)StaticallyUsedBuff.Enraged, "Endurance", 0, 0, 0, 0, 36000, 0, "Enrage", "", "", "enraged", HotDot.AbnormalityType.Debuff, true, true, "enraged"); _hotdots[(int)StaticallyUsedBuff.Slaying] = new HotDot((int)StaticallyUsedBuff.Slaying, "CritPower", 0, 0, 0, 0, 0, 0, "Slaying", "", "'Slaying' crystal is working (if equipped) when player in this state.", "slaying", HotDot.AbnormalityType.Buff, true, true, "slaying"); var shortnames = Path.Combine(folder, $"hotdot\\hotdot-short-{language}.tsv"); if (File.Exists(shortnames)) { reader = new StreamReader(File.OpenRead(shortnames)); while (!reader.EndOfStream) { var line = reader.ReadLine(); if (line == null) { continue; } var values = line.Split('\t'); var id = int.Parse(values[0]); var shortname = values[1]; if (_hotdots.ContainsKey(id)) { _hotdots[id].ShortName = shortname; } } } Enraged = _hotdots[(int)StaticallyUsedBuff.Enraged]; Slaying = _hotdots[(int)StaticallyUsedBuff.Slaying]; _hotdots.TryGetValue((int)StaticallyUsedBuff.JoyOfPartying0, out JoyOfPartying0); _hotdots.TryGetValue((int)StaticallyUsedBuff.JoyOfPartying20, out JoyOfPartying20); _hotdots.TryGetValue((int)StaticallyUsedBuff.JoyOfPartying50, out JoyOfPartying50); _hotdots.TryGetValue((int)StaticallyUsedBuff.JoyOfPartying100, out JoyOfPartying100); _hotdots.TryGetValue((int)StaticallyUsedBuff.Enraged, out Enrage); _hotdots.TryGetValue((int)StaticallyUsedBuff.Contagion1, out Contagion1); _hotdots.TryGetValue((int)StaticallyUsedBuff.Contagion2, out Contagion2); _hotdots.TryGetValue((int)StaticallyUsedBuff.Hurricane, out Hurricane); }