Skip to content

Commit

Permalink
Updated for Ritual league
Browse files Browse the repository at this point in the history
  • Loading branch information
Ludeo committed Feb 6, 2021
1 parent a2fcf25 commit 1349dd3
Show file tree
Hide file tree
Showing 32 changed files with 640 additions and 523 deletions.
5 changes: 5 additions & 0 deletions delirium.csproj → DeliriumComparison.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
<RootNamespace>delirium</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNet.Razor" Version="3.2.7" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Net.Http" Version="4.3.4" />
</ItemGroup>

Expand Down
113 changes: 113 additions & 0 deletions Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
using System;
using System.Collections.Generic;
using System.Net;
using Delirium.fossil;
using Delirium.fragment;

namespace Delirium
{
public static class Program
{
public static string League { get; private set; }

public static void Main()
{
League = "Ritual";

string result1 = new WebClient().DownloadString("https://poe.ninja/api/data/ItemOverview?league=" + League + "&type=Fossil&language=en");
Fossil data1 = Fossil.FromJson(result1);

string result2 = new WebClient().DownloadString("https://poe.ninja/api/data/CurrencyOverview?league=" + League + "&type=Fragment&language=en");
Fragment data2 = Fragment.FromJson(result2);

double fracturefossil = 0.0;
double simulacrum = 0.0;

data1.Lines.ForEach(x =>
{
if (x.Name == "Fractured Fossil")
{
fracturefossil = x.ChaosValue;
}
});

data2.Lines.ForEach(x =>
{
if (x.CurrencyTypeName == "Simulacrum")
{
simulacrum = x.ChaosEquivalent;
}
});

double timeless = Math.Round(timelesscalc.calc() + (simulacrum * 7.5 / 20) - fracturefossil, 2);
double skittering = Math.Round(skitteringcalc.calc() + (simulacrum * 7.5 / 20) - fracturefossil, 2);
double obscured = Math.Round(obscuredcalc.calc() + (simulacrum * 7.5 / 20) - fracturefossil, 2);
double blighted = Math.Round(blightedcalc.calc() + (simulacrum * 7.5 / 20) - fracturefossil, 2);
double fragmented = Math.Round(fragmentedcalc.calc() + (simulacrum * 7.5 / 20) - fracturefossil, 2);
double fossilised = Math.Round(fossilisedcalc.calc() + (simulacrum * 7.5 / 20) - fracturefossil, 2);
double foreboding = Math.Round(forebodingcalc.calc() + (simulacrum * 7.5 / 20) - fracturefossil, 2);
double amorphous = Math.Round(amorphouscalc.calc() + (simulacrum * 7.5 / 20) - fracturefossil, 2);
double whispering = Math.Round(whisperingcalc.calc() + (simulacrum * 7.5 / 20) - fracturefossil, 2);

SortedDictionary<double, string> results = new SortedDictionary<double, string>(Comparer<double>.Create((x, y) => y.CompareTo(x)))
{
{ timeless, "Timeless" },
{ skittering, "Skittering" },
{ obscured, "Obscured" },
{ blighted, "Blighted" },
{ fragmented, "Fragmented" },
{ fossilised, "Fossilised" },
{ foreboding, "Foreboding" },
{ amorphous, "Amorphous" },
{ whispering, "Whispering" },
};

int i = 1;

foreach ((double key, string value) in results)
{
switch (i)
{
case 1:
Console.WriteLine("------------------------------------------------");
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("{1} Delirium Orb: {0}c", key, value);
Console.ResetColor();
Console.WriteLine("------------------------------------------------");

break;
case 2:
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("{1} Delirium Orb: {0}c", key, value);
Console.ResetColor();
Console.WriteLine("------------------------------------------------");

break;
default:
{
if (i == 3 || (i > 3 && key > 20))
{
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("{1} Delirium Orb: {0}c", key, value);
Console.ResetColor();
Console.WriteLine("------------------------------------------------");
}
else if (key < 20)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("{1} Delirium Orb: {0}c", key, value);
Console.ResetColor();
Console.WriteLine("------------------------------------------------");
}

break;
}
}

i++;
}

Console.ReadLine();
}
}
}
4 changes: 2 additions & 2 deletions amorphous.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
using Newtonsoft.Json.Converters;
using System.Net;

namespace delirium
namespace Delirium
{
public class amorphouscalc
{

public static double calc()
{
var result = new WebClient().DownloadString("https://poe.ninja/api/data/CurrencyOverview?league=" + main.league + "&type=Currency&language=en");
var result = new WebClient().DownloadString("https://poe.ninja/api/data/CurrencyOverview?league=" + Program.League + "&type=Currency&language=en");
var data = currency.Currency.FromJson(result);

double cat1 = 0.0, cat2 = 0.0, cat3 = 0.0, cat4 = 0.0, cat5 = 0.0, cat6 = 0.0, cat7 = 0.0;
Expand Down
Binary file removed bin/Debug/netcoreapp3.0/delirium.dll
Binary file not shown.
Binary file removed bin/Debug/netcoreapp3.0/delirium.pdb
Binary file not shown.
6 changes: 3 additions & 3 deletions blighted.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
using Newtonsoft.Json.Converters;
using System.Net;

namespace delirium
namespace Delirium
{
public class blightedcalc
{

public static double calc()
{
var result1 = new WebClient().DownloadString("https://poe.ninja/api/data/ItemOverview?league=" + main.league + "&type=Map&language=en");
var result1 = new WebClient().DownloadString("https://poe.ninja/api/data/ItemOverview?league=" + Program.League + "&type=Map&language=en");
var data1 = map.Map.FromJson(result1);

var result2 = new WebClient().DownloadString("https://poe.ninja/api/data/ItemOverview?league=" + main.league + "&type=Oil&language=en");
var result2 = new WebClient().DownloadString("https://poe.ninja/api/data/ItemOverview?league=" + Program.League + "&type=Oil&language=en");
var data2 = map.Map.FromJson(result2);

double bmap1 = 0.0, bmap2 = 0.0, bmap3 = 0.0, bmap4 = 0.0, bmap5 = 0.0, bmap6 = 0.0;
Expand Down
43 changes: 17 additions & 26 deletions currency/currency.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
// <auto-generated />
//
// To parse this JSON data, add NuGet 'Newtonsoft.Json' then do:
//
// using currency;
//
// var currency = Currency.FromJson(jsonString);

namespace currency
{
using System;
using System.Collections.Generic;

using System.Globalization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;
using System.Collections.Generic;
using System.Globalization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace Delirium.currency
{
public partial class Currency
{
[JsonProperty("lines")]
Expand All @@ -27,7 +18,7 @@ public partial class Currency
public Language Language { get; set; }
}

public partial class CurrencyDetail
public class CurrencyDetail
{
[JsonProperty("id")]
public long Id { get; set; }
Expand All @@ -45,7 +36,7 @@ public partial class CurrencyDetail
public string TradeId { get; set; }
}

public partial class Language
public class Language
{
[JsonProperty("name")]
public string Name { get; set; }
Expand All @@ -54,11 +45,11 @@ public partial class Language
public Translations Translations { get; set; }
}

public partial class Translations
public class Translations
{
}

public partial class Line
public class Line
{
[JsonProperty("currencyTypeName")]
public string CurrencyTypeName { get; set; }
Expand Down Expand Up @@ -88,7 +79,7 @@ public partial class Line
public string DetailsId { get; set; }
}

public partial class PaySparkLine
public class PaySparkLine
{
[JsonProperty("data")]
public List<double?> Data { get; set; }
Expand All @@ -97,7 +88,7 @@ public partial class PaySparkLine
public double TotalChange { get; set; }
}

public partial class ReceiveSparkLine
public class ReceiveSparkLine
{
[JsonProperty("data")]
public List<double?> Data { get; set; }
Expand All @@ -106,7 +97,7 @@ public partial class ReceiveSparkLine
public double TotalChange { get; set; }
}

public partial class Receive
public class Receive
{
[JsonProperty("id")]
public long Id { get; set; }
Expand Down Expand Up @@ -138,12 +129,12 @@ public partial class Receive

public partial class Currency
{
public static Currency FromJson(string json) => JsonConvert.DeserializeObject<Currency>(json, currency.Converter.Settings);
public static Currency FromJson(string json) => JsonConvert.DeserializeObject<Currency>(json, Converter.Settings);
}

public static class Serialize
{
public static string ToJson(this Currency self) => JsonConvert.SerializeObject(self, currency.Converter.Settings);
public static string ToJson(this Currency self) => JsonConvert.SerializeObject(self, Converter.Settings);
}

internal static class Converter
Expand All @@ -154,7 +145,7 @@ internal static class Converter
DateParseHandling = DateParseHandling.None,
Converters =
{
new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal }
new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal },
},
};
}
Expand Down
2 changes: 1 addition & 1 deletion delirium.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29519.87
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "delirium", "delirium.csproj", "{2A02BDE5-B819-412D-87DF-52BF9528BF1E}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeliriumComparison", "DeliriumComparison.csproj", "{2A02BDE5-B819-412D-87DF-52BF9528BF1E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
2 changes: 2 additions & 0 deletions delirium.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/UserDictionary/Words/=fracturefossil/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
Loading

0 comments on commit 1349dd3

Please sign in to comment.