Skip to content

Commit

Permalink
Merge pull request #98 from EliphasNUIT/combat-replay
Browse files Browse the repository at this point in the history
Combat replay
  • Loading branch information
EliphasNUIT authored Aug 6, 2018
2 parents 3ed4aef + 9988181 commit e91f5f4
Show file tree
Hide file tree
Showing 52 changed files with 2,743 additions and 1,287 deletions.
2 changes: 1 addition & 1 deletion LuckParser/Controllers/CSVBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ private void CreateMechanicTable(StreamWriter sw, int phase_index)
enemyList.Remove(p);
}
}
foreach (Mechanic item in log.getMechanicData().GetMechList(log.getBossData().getID()))
foreach (Mechanic item in log.getBossData().getBossBehavior().getMechanics())
{
MechanicLog first_m_log = log.getMechanicData().GetMDataLogs().FirstOrDefault(x => x.GetSkill() == item.GetSkill());
if (first_m_log != null)
Expand Down
11 changes: 4 additions & 7 deletions LuckParser/Controllers/HTMLBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ private void CreateDPSGraph(StreamWriter sw, int phase_index, GraphHelper.GraphM
"visible:'legendonly'," +
"name: 'All Player Dps'");
sw.Write("},");
List<Mechanic> presMech = log.getMechanicData().GetMechList(log.getBossData().getID());
List<Mechanic> presMech = log.getBossData().getBossBehavior().getMechanics();
List<string> distMech = presMech.Select(x => x.GetAltName()).Distinct().ToList();
foreach (string mechAltString in distMech)
{
Expand Down Expand Up @@ -2524,7 +2524,7 @@ private void CreateDMGDistTableBody(StreamWriter sw, bool toBoss, List<CastLog>
}
}
}
HTMLHelper.writeDamageDistTableSkill(sw, skill, list_to_use, finalTotalDamage, casts, timeswasted/1000.0, -timessaved/1000.0);
HTMLHelper.writeDamageDistTableSkill(sw, skill,log.getSkillData(), list_to_use, finalTotalDamage, casts, timeswasted/1000.0, -timessaved/1000.0);
}
}
// non damaging stuff
Expand Down Expand Up @@ -2557,7 +2557,7 @@ private void CreateDMGDistTableBody(StreamWriter sw, bool toBoss, List<CastLog>
}
}
}
HTMLHelper.writeDamageDistTableSkill(sw, skill, new List<DamageLog>(), finalTotalDamage, casts, timeswasted/1000.0, -timessaved/1000.0);
HTMLHelper.writeDamageDistTableSkill(sw, skill,log.getSkillData(), new List<DamageLog>(), finalTotalDamage, casts, timeswasted/1000.0, -timessaved/1000.0);
}
}
}
Expand Down Expand Up @@ -3003,7 +3003,7 @@ private void CreateMechanicTable(StreamWriter sw, int phase_index)
enemyList.Remove(p);
}
}
foreach (Mechanic item in log.getMechanicData().GetMechList(log.getBossData().getID()))
foreach (Mechanic item in log.getBossData().getBossBehavior().getMechanics())
{
MechanicLog first_m_log = log.getMechanicData().GetMDataLogs().FirstOrDefault(x => x.GetSkill() == item.GetSkill());
if (first_m_log != null)
Expand Down Expand Up @@ -3776,9 +3776,6 @@ private void CreateCustomCSS(StreamWriter sw, int simpleRotSize)
}
if (log.getBoss().getCombatReplay() != null)
{
sw.Write("canvas.replay {" +
"border:1px solid #9B0000; "+
"}");
// from W3
sw.Write(".slidecontainer {width: 100%;}");
sw.Write(".slider {width: 100%;appearance: none;height: 25px;background: #F3F3F3;outline: none;opacity: 0.7;-webkit-transition: .2s;transition: opacity .2s;}");
Expand Down
154 changes: 130 additions & 24 deletions LuckParser/Controllers/HTMLHelper.cs

Large diffs are not rendered by default.

39 changes: 12 additions & 27 deletions LuckParser/Controllers/Parser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
//recomend CTRL+M+O to collapse all
using LuckParser.Models.DataModels;
using System.Globalization;
using LuckParser.Models;

//recommend CTRL+M+O to collapse all
namespace LuckParser.Controllers
Expand All @@ -27,9 +28,6 @@ public class Parser
private List<Player> p_list = new List<Player>();
private Boss boss;
private byte revision;
private bool raid_mode;
private bool fractal_mode;
private bool golem_mode;

// Public Methods
public LogData getLogData()
Expand All @@ -43,7 +41,7 @@ public BossData getBossData()

public ParsedLog GetParsedLog()
{
return new ParsedLog(log_data, boss_data, agent_data, skill_data, combat_data, mech_data, p_list, boss, fractal_mode || raid_mode, golem_mode);
return new ParsedLog(log_data, boss_data, agent_data, skill_data, combat_data, mech_data, p_list, boss);
}

//Main Parse method------------------------------------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -426,30 +424,16 @@ private static bool isGolem(ushort id)
{
return id == 16202 || id == 16177 || id == 19676 || id == 19645 || id == 16199;
}

private static bool raidBoss(ushort id)
{
return id == 15438 || id == 15429 || id == 15375 || id == 16123 || id == 16115 || id == 16235
|| id == 16246 || id == 17194 || id == 17172 || id == 17188 || id == 17154 || id == 19767
|| id == 19450;
}

private static bool fractalBoss(ushort id)
{
return id == 17021 || id == 17028 || id == 16948 || id == 17632 || id == 17949
|| id == 17759;
}


/// <summary>
/// Parses all the data again and link related stuff to each other
/// </summary>
private void fillMissingData()
{
var agentsLookup = agent_data.getAllAgentsList().ToDictionary(a => a.getAgent());

golem_mode = isGolem(boss_data.getID());
raid_mode = raidBoss(boss_data.getID());
fractal_mode = fractalBoss(boss_data.getID());
bool golem_mode = boss_data.getBossBehavior().getMode() == BossStrategy.ParseMode.Golem;
bool raid_mode = boss_data.getBossBehavior().getMode() == BossStrategy.ParseMode.Raid;
bool fractal_mode = boss_data.getBossBehavior().getMode() == BossStrategy.ParseMode.Fractal;
// Set Agent instid, first_aware and last_aware
var combat_list = combat_data.getCombatList();
foreach (CombatItem c in combat_list)
Expand Down Expand Up @@ -646,13 +630,14 @@ private void fillMissingData()
}
}
boss_data.setHealthOverTime(bossHealthOverTime);//after xera in case of change
// Put non reward stuff in this as we find them
HashSet<int> notRaidRewardsIds = new HashSet<int>
{
13
};

if (raid_mode)
{
// Put non reward stuff in this as we find them
HashSet<int> notRaidRewardsIds = new HashSet<int>
{
13
};
CombatItem reward = combat_list.Find(x => x.isStateChange() == ParseEnum.StateChange.Reward && !notRaidRewardsIds.Contains(x.getValue()));
if (reward != null)
{
Expand Down
38 changes: 31 additions & 7 deletions LuckParser/LuckParser.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,41 @@
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="Models\BossStrategy\BossStrategy.cs" />
<Compile Include="Models\BossStrategy\Dhuum.cs" />
<Compile Include="Models\BossStrategy\Ensolyss.cs" />
<Compile Include="Models\BossStrategy\Artsariiv.cs" />
<Compile Include="Models\BossStrategy\Arkk.cs" />
<Compile Include="Models\BossStrategy\Skorvald.cs" />
<Compile Include="Models\BossStrategy\Siax.cs" />
<Compile Include="Models\BossStrategy\MAMA.cs" />
<Compile Include="Models\BossStrategy\KeepConstruct.cs" />
<Compile Include="Models\BossStrategy\Cairn.cs" />
<Compile Include="Models\BossStrategy\Deimos.cs" />
<Compile Include="Models\BossStrategy\Golem.cs" />
<Compile Include="Models\BossStrategy\SoullessHorror.cs" />
<Compile Include="Models\BossStrategy\Samarog.cs" />
<Compile Include="Models\BossStrategy\MursaatOverseer.cs" />
<Compile Include="Models\BossStrategy\Xera.cs" />
<Compile Include="Models\BossStrategy\Matthias.cs" />
<Compile Include="Models\BossStrategy\Slothasor.cs" />
<Compile Include="Models\BossStrategy\Sabetha.cs" />
<Compile Include="Models\BossStrategy\Gorseval.cs" />
<Compile Include="Models\BossStrategy\ValeGuardian.cs" />
<Compile Include="Models\DataModels\ParseEnum.cs" />
<Compile Include="Models\DataModels\ParsedLog.cs" />
<Compile Include="Models\DataModels\SettingsContainer.cs" />
<Compile Include="Models\DataModels\Statistics.cs" />
<Compile Include="Models\ParseModels\CombatReplay\Actors\CircleActor.cs" />
<Compile Include="Models\ParseModels\CombatReplay\Actors\FollowingCircle.cs" />
<Compile Include="Models\ParseModels\CombatReplay\Actors\ImmobileCircle.cs" />
<Compile Include="Models\ParseModels\CombatReplay\CombatReplay.cs" />
<Compile Include="Models\ParseModels\CombatReplay\CombatReplayMap.cs" />
<Compile Include="Models\ParseModels\EffectStackingLogic\HealingLogic.cs" />
<Compile Include="Models\ParseModels\EffectStackingLogic\OverrideLogic.cs" />
<Compile Include="Models\ParseModels\EffectStackingLogic\QueueLogic.cs" />
<Compile Include="Models\ParseModels\EffectStackingLogic\StackingLogic.cs" />
<Compile Include="Models\ParseModels\GW2APICategory.cs" />
<Compile Include="Models\ParseModels\GW2API\GW2APICategory.cs" />
<Compile Include="Models\ParseModels\Players\AbstractMasterPlayer.cs" />
<Compile Include="Models\ParseModels\Players\AbstractPlayer.cs" />
<Compile Include="Models\ParseModels\Boons\BoonsGraphModel.cs" />
Expand All @@ -117,13 +141,13 @@
<Compile Include="Models\ParseModels\CombatReplay\Point3D.cs" />
<Compile Include="Models\ParseModels\Simulator\BoonSimulationItem.cs" />
<Compile Include="Models\ParseModels\Players\Boss.cs" />
<Compile Include="Models\ParseModels\GW2APISpec.cs" />
<Compile Include="Models\ParseModels\GW2API\GW2APISpec.cs" />
<Compile Include="Models\ParseModels\Logs\DamageLogCondition.cs" />
<Compile Include="Models\ParseModels\GW2APISkillCheck.cs" />
<Compile Include="Models\ParseModels\GW2APISkillDetailed.cs" />
<Compile Include="Models\ParseModels\GW2APIfacts.cs" />
<Compile Include="Models\ParseModels\GW2APIfactsDetail.cs" />
<Compile Include="Models\ParseModels\GW2APISkill.cs" />
<Compile Include="Models\ParseModels\GW2API\GW2APISkillCheck.cs" />
<Compile Include="Models\ParseModels\GW2API\GW2APISkillDetailed.cs" />
<Compile Include="Models\ParseModels\GW2API\GW2APIfacts.cs" />
<Compile Include="Models\ParseModels\GW2API\GW2APIfactsDetail.cs" />
<Compile Include="Models\ParseModels\GW2API\GW2APISkill.cs" />
<Compile Include="Models\ParseModels\Simulator\BoonSimulationItemDuration.cs" />
<Compile Include="Models\ParseModels\Simulator\BoonSimulationItemIntensity.cs" />
<Compile Include="Models\ParseModels\Simulator\BoonSimulator.cs" />
Expand Down
41 changes: 41 additions & 0 deletions LuckParser/Models/BossStrategy/Arkk.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using LuckParser.Models.DataModels;
using LuckParser.Models.ParseModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LuckParser.Models
{
public class Arkk : BossStrategy
{
public Arkk() : base()
{
mode = ParseMode.Fractal;
mechanicList = new List<Mechanic>
{

new Mechanic(39685, "Horizon Strike 1", Mechanic.MechType.SkillOnPlayer, ParseEnum.BossIDS.Arkk, "symbol:'circle',color:'rgb(50,0,0)',", "Horizon Strike 1",0),
new Mechanic(39001, "Horizon Strike 2", Mechanic.MechType.SkillOnPlayer, ParseEnum.BossIDS.Arkk, "symbol:'circle',color:'rgb(100,0,0)',", "Horizon Strike 2",0),
new Mechanic(39297, "Horizon Strike Normal", Mechanic.MechType.SkillOnPlayer, ParseEnum.BossIDS.Arkk, "symbol:'circle',color:'rgb(150,0,0)',", "Horizon Strike Normal",0),
new Mechanic(38844, "Overhead Smash", Mechanic.MechType.SkillOnPlayer, ParseEnum.BossIDS.Arkk, "symbol:'circle',color:'rgb(200,0,0)',", "Overhead Smash",0),
new Mechanic(38880, "Corporeal Reassignment", Mechanic.MechType.PlayerBoon, ParseEnum.BossIDS.Arkk, "symbol:'square',color:'rgb(0,128,0)',", "Corporeal Reassignment",0)
};
}

public override CombatReplayMap getCombatMap()
{
return new CombatReplayMap("https://i.imgur.com/BIybWJe.png",
Tuple.Create(914, 914),
Tuple.Create(-19231, -18137, -16591, -15677),
Tuple.Create(-24576, -24576, 24576, 24576),
Tuple.Create(11204, 4414, 13252, 6462));
}

public override string getReplayIcon()
{
return "https://i.imgur.com/u6vv8cW.png";
}
}
}
33 changes: 33 additions & 0 deletions LuckParser/Models/BossStrategy/Artsariiv.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using LuckParser.Controllers;
using LuckParser.Models.DataModels;
using LuckParser.Models.ParseModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LuckParser.Models
{
public class Artasariiv : BossStrategy
{
public Artasariiv() : base()
{
mode = ParseMode.Fractal;
}

public override CombatReplayMap getCombatMap()
{
return new CombatReplayMap("https://i.imgur.com/4wmuc8B.png",
Tuple.Create(914, 914),
Tuple.Create(8991, 112, 11731, 2812),
Tuple.Create(-24576, -24576, 24576, 24576),
Tuple.Create(11204, 4414, 13252, 6462));
}

public override string getReplayIcon()
{
return "https://wiki.guildwars2.com/images/b/b4/Artsariiv.jpg";
}
}
}
Loading

0 comments on commit e91f5f4

Please sign in to comment.