Skip to content

Commit

Permalink
Merge pull request #2 from SCHREDDO/releases/1.0.0
Browse files Browse the repository at this point in the history
Update Project to v0.3.0-alpha
  • Loading branch information
SCHREDDO authored Mar 24, 2019
2 parents f60ba0c + 593fef2 commit 88eb5c9
Show file tree
Hide file tree
Showing 10 changed files with 184 additions and 53 deletions.
17 changes: 12 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
## Changelog
### = 0.2.0-alpha March 23rd 2019 =
#### Changed
# Changelog
## = 0.3.0-alpha March 24th 2019 =
### Added
- new damage informationen dps (damage per second)
- new base settings player
### Fixed
- Fix damage calculation: the same attack added multiple times
- Fix damage calculation: damage tick associated for multiple attacks
## = 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
## = 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
Expand Down
22 changes: 21 additions & 1 deletion NerdyAion/NerdyAion/AnalysisTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//
// Created By: Sebastian Lühnen
// Created On: 19.02.2019
// Last Edited On: 23.03.2019
// Last Edited On: 24.03.2019
// Language: C#
//
using System;
Expand All @@ -44,6 +44,7 @@ public class AnalysisTemplate
* eventEffect
* eventName
* eventEffectExtra
* eventSource_eventName
* eventTarget_eventEffect
* eventName_eventEffect
*/
Expand Down Expand Up @@ -111,6 +112,11 @@ public String GetTime(Match result)

public String GetEventSource(Match result)
{
if (Variables.ContainsKey("eventSource_eventName"))
{
return CheckForCriticalHit(SplitEventSourceAndEventName(result)[0]);
}

return CheckForCriticalHit(result.Groups[Variables["eventSource"]].Value);
}

Expand All @@ -120,6 +126,7 @@ public String GetEventTarget(Match result)
{
return CheckForCriticalHit(SplitEventTargetAndEventEffect(result)[0]);
}

return CheckForCriticalHit(result.Groups[Variables["eventTarget"]].Value);
}

Expand All @@ -129,6 +136,11 @@ public String GetEventName(Match result)
{
return CheckForCriticalHit(SplitEventNameAndEventEffect(result)[0]);
}
else if (Variables.ContainsKey("eventSource_eventName"))
{
return CheckForCriticalHit(SplitEventSourceAndEventName(result)[1]);
}

return CheckForCriticalHit(result.Groups[Variables["eventName"]].Value);
}

Expand Down Expand Up @@ -167,6 +179,14 @@ private String[] SplitEventNameAndEventEffect(Match result)
return new String[] { match.Groups["eventName"].Value, match.Groups["eventEffect"].Value };
}

private String[] SplitEventSourceAndEventName(Match result)
{
Regex pattern = new Regex(@"(?<eventSource>[a-zA-Z]+) (?<eventName>[^,]+)");
Match match = pattern.Match(result.Groups[variables["eventSource_eventName"]].Value);

return new String[] { match.Groups["eventSource"].Value, match.Groups["eventName"].Value };
}

private String CheckForCriticalHit(String text)
{
if (text.Contains(CriticalIdentifier))
Expand Down
26 changes: 23 additions & 3 deletions NerdyAion/NerdyAion/Commands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -210,11 +210,21 @@ private static void DmgCommands(String[] command, String usedCommand)

Analyzer[command[1]].AnalyzeLog();

String player = "";
foreach (KeyValuePair<String, Player> item in Analyzer[command[1]].PlayerList)
{
if (!item.Key.Equals(""))
{
Console.WriteLine(item.Key + ": " + item.Value.CalculateSkillDmg());
if (item.Key == "ihr" || item.Key == "Ihr")
{
player = Settings.GetSetting("player");
}
else
{
player = item.Key;
}

Console.WriteLine(player + ": " + item.Value.CalculateSkillDmg() + " (" + item.Value.GetDPS() + ")");
}
}
Console.WriteLine("=====================");
Expand All @@ -238,11 +248,21 @@ private static void DmgCommands(String[] command, String usedCommand)
Analyzer[command[1]].AnalyzeLog();

String dmgData = "| ";
String player = "";
foreach (KeyValuePair<String, Player> item in Analyzer[command[1]].PlayerList)
{
if (!item.Key.Equals(""))
{
dmgData = item.Key + ": " + item.Value.CalculateSkillDmg() + " | ";
if (item.Key == "ihr" || item.Key == "Ihr")
{
player = Settings.GetSetting("player");
}
else
{
player = item.Key;
}

dmgData = player + ": " + item.Value.CalculateSkillDmg() + " (" + item.Value.GetDPS() + ")" + " | ";
}
}

Expand Down
93 changes: 65 additions & 28 deletions NerdyAion/NerdyAion/LogAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//
// Created By: Sebastian Lühnen
// Created On: 19.02.2019
// Last Edited On: 23.03.2019
// Last Edited On: 24.03.2019
// Language: C#
//
using System;
Expand Down Expand Up @@ -137,50 +137,60 @@ public void AnalyzeLog()
eventEffectDamage = template.GetEventEffect(match);
}
break;
case "eventSource_eventName":
eventSource = template.GetEventSource(match);
eventName = template.GetEventName(match);
if (template.DamageEvent)
{
eventEffectDamage = template.GetEventEffect(match);
}
break;
case "time":
time = template.GetTime(match);
break;
default:
break;
}
}
}

if (eventSource != "")
break;
}
}

if (eventSource != "")
{
if (!PlayerList.ContainsKey(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.Add(eventSource, new Player(eventSource));
}

PlayerList[eventSource].AddSkill(new Skill(eventName, eventTarget, actionTime, eventEffectDamage, false));
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 (eventName != "")
{
if (!SkillList.ContainsKey((eventName + "_" + eventTarget)))
{
if (!SkillList.ContainsKey((eventName + "_" + eventTarget)))
{
SkillList.Add((eventName + "_" + eventTarget), "");
}

SkillList[(eventName + "_" + eventTarget)] = eventSource;
SkillList.Add((eventName + "_" + eventTarget), "");
}

SkillList[(eventName + "_" + eventTarget)] = eventSource;
}
else if (SkillList.ContainsKey((eventName + "_" + eventTarget)))
}
else if (SkillList.ContainsKey((eventName + "_" + eventTarget)))
{
if (PlayerList.ContainsKey(SkillList[(eventName + "_" + eventTarget)]))
{
if (PlayerList.ContainsKey(SkillList[(eventName + "_" + eventTarget)]))
{
PlayerList[SkillList[(eventName + "_" + eventTarget)]].AddSkillTick(eventName, eventTarget, eventEffectDamage, actionTime);
}
PlayerList[SkillList[(eventName + "_" + eventTarget)]].AddSkillTick(eventName, eventTarget, eventEffectDamage, actionTime);
}

eventSource = "";
eventTarget = "";
time = "";
eventName = "";
eventEffectDamage = 0;
}

eventSource = "";
eventTarget = "";
time = "";
eventName = "";
eventEffectDamage = 0;
}
}

Expand Down Expand Up @@ -360,6 +370,33 @@ private void SetAnalysisTemplates()
temp.AddVariable("eventName");

AnalysisTemplates.Add(temp);

//2019.03.24 00:38:48 : Prüfungsvogelscheuche erhält den Effekt 'Verzögerte Explosion', weil Ihr Großer Vulkanausbruch benutzt habt.
temp = new AnalysisTemplate();
temp.DamageEvent = false;
temp.DamageOverTime = true;
temp.CriticalHit = false;
temp.Strucktor = ".* : .* erhält den Effekt '.*', weil .* benutzt habt.";
temp.Template = @"(?<time>[^,]+) : (?<eventTarget>[^,]+) erhält den Effekt '(?<effect>[^,]+)', weil (?<eventSource_eventName>[^,]+) benutzt habt.";
temp.CriticalIdentifier = "Kritischer Treffer!";
temp.AddVariable("time");
temp.AddVariable("eventTarget");
temp.AddVariable("eventSource_eventName");

AnalysisTemplates.Add(temp);

temp = new AnalysisTemplate();
temp.DamageEvent = false;
temp.DamageOverTime = true;
temp.CriticalHit = false;
temp.Strucktor = ".* : .* erhält den Effekt '.*', weil .* benutzt hat.";
temp.Template = @"(?<time>[^,]+) : (?<eventTarget>[^,]+) erhält den Effekt '(?<effect>[^,]+)', weil (?<eventSource_eventName>[^,]+) benutzt hat.";
temp.CriticalIdentifier = "Kritischer Treffer!";
temp.AddVariable("time");
temp.AddVariable("eventTarget");
temp.AddVariable("eventSource_eventName");

AnalysisTemplates.Add(temp);
}
}
}
2 changes: 1 addition & 1 deletion NerdyAion/NerdyAion/NerdyAion.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<MapFileExtensions>true</MapFileExtensions>
<AutorunEnabled>true</AutorunEnabled>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>0.2.0.0</ApplicationVersion>
<ApplicationVersion>0.3.0.0</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
Expand Down
35 changes: 31 additions & 4 deletions NerdyAion/NerdyAion/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,28 +56,50 @@ public Player(String name)
{
Name = name;
UsedSkills = new List<Skill>();
ActionTime = 0;
ActionTime = 1;
}

public void AddSkill(Skill skill)
{
if (UsedSkills.Count > 0)
{
int time = (skill.ActionTime - UsedSkills[(UsedSkills.Count - 1)].ActionTime).Seconds;

if (time < 10)
{
ActionTime += time;
}
else
{
ActionTime += 1;
}
}
else
{
ActionTime += 1;
}

UsedSkills.Add(skill);
}

public void AddSkillTick(String skillname, String target, long damage, DateTime actionTime)
public Boolean AddSkillTick(String skillname, String target, long damage, DateTime actionTime)
{
for (int i = usedSkills.Count - 1; i >= 0; i--)
{
if (usedSkills[i].Name == skillname && usedSkills[i].Target == target)
{
usedSkills[i].DmgTicks.Add(damage);
usedSkills[i].AddDmgTick(damage, actionTime);

return true;
}

if (usedSkills[i].ActionTime.AddSeconds(60) < actionTime)
{
return;
break;
}
}

return false;
}

public long CalculateSkillDmg()
Expand All @@ -91,5 +113,10 @@ public long CalculateSkillDmg()

return dmg;
}

public long GetDPS()
{
return CalculateSkillDmg() / ActionTime;
}
}
}
8 changes: 5 additions & 3 deletions NerdyAion/NerdyAion/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,18 @@ static void Main(string[] args)
if (!Commands.Settings.LoudSettings())
{
Commands.Settings.CreateSettingsFile();
Commands.Settings.AddSetting("version", "0.2.0-alpha", true, null);
Commands.Settings.AddSetting("version", "0.3.0-alpha", true, null);
Commands.Settings.AddSetting("log", @"C:\Program Files\Gameforge\AION Free-To-Play\Chat.log");
Commands.Settings.AddSetting("player", "ich");
Commands.Settings.SaveSettings();
}
else
{
if (Commands.Settings.GetSetting("version") != "0.2.0 - alpha")
if (Commands.Settings.GetSetting("version") != "0.3.0 - alpha")
{
SettingsController temp = new SettingsController(System.AppDomain.CurrentDomain.BaseDirectory + @"\settings.txt", false);
temp.AddSetting("version", "0.2.0-alpha", true, null);
temp.AddSetting("version", "0.3.0-alpha", true, null);
temp.AddSetting("player", "ich");

foreach (Setting item in Commands.Settings.GetAllSettings())
{
Expand Down
4 changes: 2 additions & 2 deletions NerdyAion/NerdyAion/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.2.0.0")]
[assembly: AssemblyFileVersion("0.2.0.0")]
[assembly: AssemblyVersion("0.3.0.0")]
[assembly: AssemblyFileVersion("0.3.0.0")]
Loading

0 comments on commit 88eb5c9

Please sign in to comment.