Skip to content

Commit

Permalink
fixed a bug with wep estimation. Also added wep icons
Browse files Browse the repository at this point in the history
  • Loading branch information
baaron4 committed Jun 9, 2018
1 parent 31e8997 commit 78744cb
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 44 deletions.
58 changes: 49 additions & 9 deletions LuckParser/Controllers/Controller1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1804,43 +1804,51 @@ private void PrintWeapons(StreamWriter sw, Player p)
string[] wep = p.getWeaponsArray(s_data,c_data,b_data,a_data);
if (wep[0] != null)
{
sw.Write("<img src=\"" + GetLink(wep[0]) + " \" alt=\"" + wep[0] + "\" height=\"18\" width=\"18\" >");
sw.Write("<img src=\"" + GetLink(wep[0]) + " \" alt=\"" + wep[0] + "\" data-toggle=\"tooltip\" title=\"\" height=\"18\" width=\"18\" data-original-title=\"" +wep[0] + "\">");
}
else
{
sw.Write("<img src=\"" + GetLink("Question") + " \" alt=\"Unknown\" height=\"18\" width=\"18\" >");
sw.Write("<img src=\"" + GetLink("Question") + " \" alt=\"Unknown\" data-toggle=\"tooltip\" title=\"\" height=\"18\" width=\"18\" data-original-title=\"Unknown\">");
}
if (wep[1] != null)
{
if (wep[1] != "2Hand")
{
sw.Write("<img src=\"" + GetLink(wep[1]) + " \" alt=\"" + wep[1] + "\" height=\"18\" width=\"18\" >");
sw.Write("<img src=\"" + GetLink(wep[1]) + " \" alt=\"" + wep[1] + "\" data-toggle=\"tooltip\" title=\"\" height=\"18\" width=\"18\" data-original-title=\"" + wep[1] + "\">");
}
}
else
{
sw.Write("<img src=\"" + GetLink("Question") + " \" alt=\"Unknown\" height=\"18\" width=\"18\" >");
sw.Write("<img src=\"" + GetLink("Question") + " \" alt=\"Unknown\" data-toggle=\"tooltip\" title=\"\" height=\"18\" width=\"18\" data-original-title=\"Unknown\">");
}
sw.Write("/");
if (wep[2] == null && wep[3] == null)
{

}
else {
sw.Write("/");
}

if (wep[2] != null)
{
sw.Write("<img src=\"" + GetLink(wep[2]) + " \" alt=\"" + wep[2] + "\" height=\"18\" width=\"18\" >");
sw.Write("<img src=\"" + GetLink(wep[2]) + " \" alt=\"" + wep[2] + "\" data-toggle=\"tooltip\" title=\"\" height=\"18\" width=\"18\" data-original-title=\"" + wep[2] + "\">");
}
else
{
sw.Write("<img src=\"" + GetLink("Question") + " \" alt=\"Unknown\" height=\"18\" width=\"18\" >");
// sw.Write("<img src=\"" + GetLink("Question") + " \" alt=\"Unknown\" height=\"18\" width=\"18\" >");
}
if (wep[3] != null)
{
if (wep[3] != "2Hand")
{
sw.Write("<img src=\"" + GetLink(wep[3]) + " \" alt=\"" + wep[3] + "\" height=\"18\" width=\"18\" >");
sw.Write("<img src=\"" + GetLink(wep[3]) + " \" alt=\"" + wep[3] + "\" data-toggle=\"tooltip\" title=\"\" height=\"18\" width=\"18\" data-original-title=\"" + wep[3] + "\">");
}
}
else
{
sw.Write("<img src=\"" + GetLink("Question") + " \" alt=\"Unknown\" height=\"18\" width=\"18\" >");
//sw.Write("<img src=\"" + GetLink("Question") + " \" alt=\"Unknown\" height=\"18\" width=\"18\" >");
}
sw.Write("<br>");
}

bool[] SnapSettings;
Expand Down Expand Up @@ -6020,6 +6028,38 @@ public string GetLink(string name)
{
switch (name)
{
case "Sword":
return "https://wiki.guildwars2.com/images/6/61/Sword_Proficiency.png";
case "Axe":
return "https://wiki.guildwars2.com/images/a/a2/Axe_Proficiency.png";
case "Dagger":
return "https://wiki.guildwars2.com/images/c/c9/Dagger_Proficiency.png";
case "Mace":
return "https://wiki.guildwars2.com/images/3/37/Mace_Smash.png";
case "Pistol":
return "https://wiki.guildwars2.com/images/7/7a/Phantasmal_Duelist.png";
case "Sceptor":
return "https://wiki.guildwars2.com/images/2/22/Water_Trident.png";
case "Focus":
return "https://wiki.guildwars2.com/images/7/79/Focus_Mastery.png";
case "Shield":
return "https://wiki.guildwars2.com/images/c/c6/Shield_Proficiency.png";
case "Torch":
return "https://wiki.guildwars2.com/images/1/11/Torch_Proficiency.png";
case "Warhorn":
return "https://wiki.guildwars2.com/images/b/b8/Warhorn_Proficiency.png";
case "Greatsword":
return "https://wiki.guildwars2.com/images/8/8b/Greatsword_Proficiency.png";
case "Hammer":
return "https://wiki.guildwars2.com/images/5/5f/Hammer_Proficiency.png";
case "Longbow":
return "https://wiki.guildwars2.com/images/5/53/Longbow_Proficiency.png";
case "Shortbow":
return "https://wiki.guildwars2.com/images/e/e7/Short_Bow_Proficiency_%28renegade%29.png";
case "Rifle":
return "https://wiki.guildwars2.com/images/5/5d/Rifle_Proficiency_%28deadeye%29.png";
case "Staff":
return "https://wiki.guildwars2.com/images/7/78/Staff_Proficiency.png";
case "Vale Guardian-icon":
return "https://wiki.guildwars2.com/images/f/fb/Mini_Vale_Guardian.png";
case "Gorseval the Multifarious-icon":
Expand Down
70 changes: 35 additions & 35 deletions LuckParser/Models/ParseModels/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ private void EstimateWeapons(SkillData s_data, CombatData c_data, BossData b_dat
}
if (apiskill != null)
{
if (apiskill.type != "Weapon")
if (apiskill.type == "Weapon")
{
if (apiskill.weapon_type == "Greatsword" || apiskill.weapon_type == "Staff" || apiskill.weapon_type == "Rifle" || apiskill.weapon_type == "Longbow" || apiskill.weapon_type == "Shortbow" || apiskill.weapon_type == "Hammer")
{
Expand All @@ -328,16 +328,16 @@ private void EstimateWeapons(SkillData s_data, CombatData c_data, BossData b_dat
continue;
}

if (weapons[0] == null && weapons[1] == null)
{
weapons[0] = apiskill.weapon_type;
weapons[1] = "2Hand";
}
else if (weapons[2] == null && weapons[3] == null)
{
weapons[2] = apiskill.weapon_type;
weapons[3] = "2Hand";
}
//if (weapons[0] == null && weapons[1] == null)
//{
// weapons[0] = apiskill.weapon_type;
// weapons[1] = "2Hand";
//}
//else if (weapons[2] == null && weapons[3] == null)
//{
// weapons[2] = apiskill.weapon_type;
// weapons[3] = "2Hand";
//}
continue;
}//2 handed
if (apiskill.weapon_type == "Focus" || apiskill.weapon_type == "Shield" || apiskill.weapon_type == "Torch" || apiskill.weapon_type == "Warhorn")
Expand All @@ -354,16 +354,16 @@ private void EstimateWeapons(SkillData s_data, CombatData c_data, BossData b_dat
weapons[3] = apiskill.weapon_type;
continue;
}
if (weapons[1] == null)
{
//if (weapons[1] == null)
//{

weapons[1] = apiskill.weapon_type;
}
else if (weapons[3] == null)
{
// weapons[1] = apiskill.weapon_type;
//}
//else if (weapons[3] == null)
//{

weapons[3] = apiskill.weapon_type;
}
// weapons[3] = apiskill.weapon_type;
//}
continue;
}//OffHand
if (apiskill.weapon_type == "Axe" || apiskill.weapon_type == "Dagger" || apiskill.weapon_type == "Mace" || apiskill.weapon_type == "Pistol" || apiskill.weapon_type == "Sword" || apiskill.weapon_type == "Sceptor")
Expand All @@ -382,16 +382,16 @@ private void EstimateWeapons(SkillData s_data, CombatData c_data, BossData b_dat
weapons[2] = apiskill.weapon_type;
continue;
}
if (weapons[0] == null)
{
//if (weapons[0] == null)
//{

weapons[0] = apiskill.weapon_type;
}
else if (weapons[2] == null)
{
// weapons[0] = apiskill.weapon_type;
//}
//else if (weapons[2] == null)
//{

weapons[2] = apiskill.weapon_type;
}
// weapons[2] = apiskill.weapon_type;
//}
continue;
}
if (apiskill.slot == "Weapon_4" || apiskill.slot == "Weapon_5")
Expand All @@ -408,16 +408,16 @@ private void EstimateWeapons(SkillData s_data, CombatData c_data, BossData b_dat
weapons[3] = apiskill.weapon_type;
continue;
}
if (weapons[1] == null)
{
//if (weapons[1] == null)
//{

weapons[1] = apiskill.weapon_type;
}
else if (weapons[3] == null)
{
// weapons[1] = apiskill.weapon_type;
//}
//else if (weapons[3] == null)
//{

weapons[3] = apiskill.weapon_type;
}
// weapons[3] = apiskill.weapon_type;
//}
continue;
}
}//1 handed
Expand Down

0 comments on commit 78744cb

Please sign in to comment.