From 1962fb4cdab16120dde8ac2625b53d959a963c45 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sat, 23 Mar 2019 16:50:52 +0100 Subject: [PATCH] Update Project to v0.2.0-alpha - update project to v0.2.0-alpha - update README.md - add COMMANDS.md - add CHANGELOG.md --- CHANGELOG.md | 23 +++ COMMANDS.md | 104 +++++++++++ NerdyAion/NerdyAion/AnalysisTemplate.cs | 54 +++++- NerdyAion/NerdyAion/LogAnalyzer.cs | 94 +++++++++- NerdyAion/NerdyAion/NerdyAion.csproj | 2 +- NerdyAion/NerdyAion/Player.cs | 18 +- NerdyAion/NerdyAion/Program.cs | 23 ++- .../NerdyAion/Properties/AssemblyInfo.cs | 4 +- NerdyAion/NerdyAion/Skill.cs | 18 +- README.md | 162 ++++-------------- 10 files changed, 357 insertions(+), 145 deletions(-) create mode 100644 CHANGELOG.md create mode 100644 COMMANDS.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..3852ce0 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,23 @@ +## Changelog +### = 0.2.0-alpha March 23rd 2019 = +#### Changed +- expand the damage calculation by dot (damage over time) ticks +- expand the damage calculation by critique hits +### = 0.1.0-alpha March 18th 2019 = +#### Added +- damage calculation on the base of the immediate damage +- new base command goto +- new base command back +- new base command clear +- new base command info +- new base command help +- new base command bye +- new damage (path: dmg) command create +- new damage (path: dmg) command list +- new damage (path: dmg) command show +- new damage (path: dmg) command copy +- new settings (path: settings) command show +- new settings (path: settings) command edit +- new settings (path: settings) command save +- new settings (path: settings) command undo +- new base settings log \ No newline at end of file diff --git a/COMMANDS.md b/COMMANDS.md new file mode 100644 index 0000000..bd23424 --- /dev/null +++ b/COMMANDS.md @@ -0,0 +1,104 @@ +# Commands + +| Name | Description | Path | +|------|-------------|------| +|[goto](https://github.com/SCHREDDO/NerdyAion-Aion-Tool-Manager/blob/master/COMMANDS.md#command-goto)|go to path x|| +|[back](https://github.com/SCHREDDO/NerdyAion-Aion-Tool-Manager/blob/master/COMMANDS.md#command-back)|go back to main path|| +|[clear](https://github.com/SCHREDDO/NerdyAion-Aion-Tool-Manager/blob/master/COMMANDS.md#command-clear)|cleared the console|| +|[info](https://github.com/SCHREDDO/NerdyAion-Aion-Tool-Manager/blob/master/COMMANDS.md#command-info)|informations about NerdyAion|| +|[help](https://github.com/SCHREDDO/NerdyAion-Aion-Tool-Manager/blob/master/COMMANDS.md#command-help)|shows commands and paths|| +|[bye](https://github.com/SCHREDDO/NerdyAion-Aion-Tool-Manager/blob/master/COMMANDS.md#command-bye)|close NerdyAion|| +|[create](https://github.com/SCHREDDO/NerdyAion-Aion-Tool-Manager/blob/master/COMMANDS.md#command-create)|create a dmg chatlog pointer|dmg| +|[show](https://github.com/SCHREDDO/NerdyAion-Aion-Tool-Manager/blob/master/COMMANDS.md#command-show)|shows dmg informations from pointer x|dmg| +|[copy](https://github.com/SCHREDDO/NerdyAion-Aion-Tool-Manager/blob/master/COMMANDS.md#command-copy)|copy dmg informations from pointer x|dmg| +|[show](https://github.com/SCHREDDO/NerdyAion-Aion-Tool-Manager/blob/master/COMMANDS.md#command-show)|list of settings|settings| +|[edit](https://github.com/SCHREDDO/NerdyAion-Aion-Tool-Manager/blob/master/COMMANDS.md#command-edit)|edit a setting|settings| +|[save](https://github.com/SCHREDDO/NerdyAion-Aion-Tool-Manager/blob/master/COMMANDS.md#command-save)|saved changes from settings|settings| +|[undo](https://github.com/SCHREDDO/NerdyAion-Aion-Tool-Manager/blob/master/COMMANDS.md#command-undo)|reset the last changes|settings| + +# Base Commands +## Command "goto" +Sets the activ path to the path ``. +```console +goto +``` +Arguments: +- `path` the path +## Command "back" +Sets the activ path to the main path +```console +back +``` +## Command "clear" +Cleared the console. +```console +clear +``` +## Command "info" +Shows informations about NerdyAvion +```console +info +``` +## Command "help" +Shows a list of commands and paths or informations about a the ``. +```console +help [command] +``` +Arguments: +- `command` the command +## Command "bye" +Closes NerdyAion. +```console +bye +``` +# Damage (Path: dmg) Commands +## Command "create" +Create a pointer (start point) for the analyzing with the given name ``. +```console +create +``` +Arguments: +- `pointer name` the pointer name +## Command "list" +Shows all pointer. +```console +list +``` +## Command "show" +Shows dmg informations from pointer ``. +```console +show +``` +Arguments: +- `pointer name` the pointer name +## Command "copy" +Cpy the dmg informations from pointer ``. +```console +copy +``` +Arguments: +- `pointer name` the pointer name +# Settings (Path: settings) Commands +## Command "show" +Shows all settings an values. +```console +show +``` +## Command "edit" +Edit the `` with the new value ``. +```console +edit +``` +Arguments: +- `setting` which setting is to be changed +- `value` what value the setting should be set to +## Command "save" +Saved changes from settings. +```console +save +``` +## Command "undo" +Reset the last changes from settings. +```console +undo +``` \ No newline at end of file diff --git a/NerdyAion/NerdyAion/AnalysisTemplate.cs b/NerdyAion/NerdyAion/AnalysisTemplate.cs index ed75314..08e088c 100644 --- a/NerdyAion/NerdyAion/AnalysisTemplate.cs +++ b/NerdyAion/NerdyAion/AnalysisTemplate.cs @@ -19,7 +19,7 @@ // // Created By: Sebastian Lühnen // Created On: 19.02.2019 -// Last Edited On: 18.03.2019 +// Last Edited On: 23.03.2019 // Language: C# // using System; @@ -35,8 +35,10 @@ public class AnalysisTemplate { private String strucktor; private String template; + private String criticalIdentifier; /* * Supported variables: + * time * eventSource * eventTarget * eventEffect @@ -47,7 +49,9 @@ public class AnalysisTemplate */ private Dictionary variables; private Boolean damageEvent; - + private Boolean damageOverTime; + private Boolean criticalHit; + public String Strucktor { get { return strucktor; } @@ -58,6 +62,11 @@ public String Template get { return template; } set { template = value; } } + public String CriticalIdentifier + { + get { return criticalIdentifier; } + set { criticalIdentifier = value; } + } public Dictionary Variables { get { return variables; } @@ -68,13 +77,26 @@ public Boolean DamageEvent get { return damageEvent; } set { damageEvent = value; } } + public Boolean DamageOverTime + { + get { return damageOverTime; } + set { damageOverTime = value; } + } + public Boolean CriticalHit + { + get { return criticalHit; } + set { criticalHit = value; } + } public AnalysisTemplate() { Strucktor = ""; Template = ""; + CriticalIdentifier = ""; Variables = new Dictionary(); DamageEvent = false; + DamageOverTime = false; + CriticalHit = false; } public void AddVariable(String variable) @@ -82,27 +104,32 @@ public void AddVariable(String variable) Variables.Add(variable, variable); } + public String GetTime(Match result) + { + return CheckForCriticalHit(result.Groups[Variables["time"]].Value); + } + public String GetEventSource(Match result) { - return result.Groups[Variables["eventSource"]].Value; + return CheckForCriticalHit(result.Groups[Variables["eventSource"]].Value); } public String GetEventTarget(Match result) { if (Variables.ContainsKey("eventTarget_eventEffect")) { - return SplitEventTargetAndEventEffect(result)[0]; + return CheckForCriticalHit(SplitEventTargetAndEventEffect(result)[0]); } - return result.Groups[Variables["eventTarget"]].Value; + return CheckForCriticalHit(result.Groups[Variables["eventTarget"]].Value); } public String GetEventName(Match result) { if (Variables.ContainsKey("eventName_eventEffect")) { - return SplitEventNameAndEventEffect(result)[0]; + return CheckForCriticalHit(SplitEventNameAndEventEffect(result)[0]); } - return result.Groups[Variables["eventName"]].Value; + return CheckForCriticalHit(result.Groups[Variables["eventName"]].Value); } public long GetEventEffect(Match result) @@ -121,7 +148,7 @@ public long GetEventEffect(Match result) public String GetEventEffectExtra(Match result) { - return result.Groups[Variables["eventEffectExtra"]].Value; + return CheckForCriticalHit(result.Groups[Variables["eventEffectExtra"]].Value); } private String[] SplitEventTargetAndEventEffect(Match result) @@ -139,5 +166,16 @@ private String[] SplitEventNameAndEventEffect(Match result) return new String[] { match.Groups["eventName"].Value, match.Groups["eventEffect"].Value }; } + + private String CheckForCriticalHit(String text) + { + if (text.Contains(CriticalIdentifier)) + { + CriticalHit = true; + text = text.Substring((CriticalIdentifier.Length)); + } + + return text; + } } } diff --git a/NerdyAion/NerdyAion/LogAnalyzer.cs b/NerdyAion/NerdyAion/LogAnalyzer.cs index 2f804d1..76c8b4d 100644 --- a/NerdyAion/NerdyAion/LogAnalyzer.cs +++ b/NerdyAion/NerdyAion/LogAnalyzer.cs @@ -19,7 +19,7 @@ // // Created By: Sebastian Lühnen // Created On: 19.02.2019 -// Last Edited On: 18.03.2019 +// Last Edited On: 23.03.2019 // Language: C# // using System; @@ -82,6 +82,8 @@ public void AnalyzeLog() String eventSource = ""; String eventTarget = ""; + DateTime actionTime = new DateTime(); + String time = ""; String eventName = ""; long eventEffectDamage = 0; @@ -135,21 +137,47 @@ public void AnalyzeLog() eventEffectDamage = template.GetEventEffect(match); } break; + case "time": + time = template.GetTime(match); + break; default: break; } } } - if (!PlayerList.ContainsKey(eventSource)) + if (eventSource != "") { - PlayerList.Add(eventSource, new Player(eventSource)); - } + if (!PlayerList.ContainsKey(eventSource)) + { + PlayerList.Add(eventSource, new Player(eventSource)); + } + + actionTime = DateTime.ParseExact(time, "yyyy.MM.dd HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture); + + PlayerList[eventSource].AddSkill(new Skill(eventName, eventTarget, actionTime, eventEffectDamage, false)); + + if (eventName != "") + { + if (!SkillList.ContainsKey((eventName + "_" + eventTarget))) + { + SkillList.Add((eventName + "_" + eventTarget), ""); + } - PlayerList[eventSource].AddSkill(new Skill(eventName, eventEffectDamage, false)); + SkillList[(eventName + "_" + eventTarget)] = eventSource; + } + } + else if (SkillList.ContainsKey((eventName + "_" + eventTarget))) + { + if (PlayerList.ContainsKey(SkillList[(eventName + "_" + eventTarget)])) + { + PlayerList[SkillList[(eventName + "_" + eventTarget)]].AddSkillTick(eventName, eventTarget, eventEffectDamage, actionTime); + } + } eventSource = ""; eventTarget = ""; + time = ""; eventName = ""; eventEffectDamage = 0; } @@ -175,8 +203,11 @@ private void SetAnalysisTemplates() //2019.03.16 17:09:04 : Ihr habt Wilder Sumpf-Oculis durch Benutzung von Seelenraub 24.876 Schaden zugefügt. temp = new AnalysisTemplate(); temp.DamageEvent = true; + temp.DamageOverTime = false; + temp.CriticalHit = false; temp.Strucktor = ".* : .* habt .* durch Benutzung von .* Schaden zugefügt."; temp.Template = @"(?