Sound Tweaks

This commit is contained in:
mikx
2018-12-22 23:04:55 -05:00
parent defe5a81f7
commit 0b3694a424
57 changed files with 2741 additions and 2 deletions

View File

@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{30965CCD-46DF-47A3-BDBC-6FC0B0900B4E}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CHANCING__Belt_</RootNamespace>
<AssemblyName>CHANCING %28Belt%29</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\Builds\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\Builds\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Generator.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -0,0 +1,100 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PoE_MxFilterGen
{
public class ChanceSparklineBody
{
public List<double?> data { get; set; }
public double? totalChange { get; set; }
}
public class ChanceExplicitModifierBody
{
public string text { get; set; }
public bool optional { get; set; }
}
public class ChanceLineBody
{
public int id { get; set; }
public string name { get; set; }
public string icon { get; set; }
public int mapTier { get; set; }
public int levelRequired { get; set; }
public string baseType { get; set; }
public int stackSize { get; set; }
public object variant { get; set; }
public object prophecyText { get; set; }
public object artFilename { get; set; }
public int links { get; set; }
public int itemClass { get; set; }
public ChanceSparklineBody sparkline { get; set; }
public List<object> implicitModifiers { get; set; }
public List<ChanceExplicitModifierBody> explicitModifiers { get; set; }
public string flavourText { get; set; }
public string itemType { get; set; }
public double chaosValue { get; set; }
public double exaltedValue { get; set; }
public int count { get; set; }
}
public class Theme
{
public string border { get; set; }
public string background { get; set; }
public string text { get; set; }
public int text_size { get; set; }
}
public class ChanceRootBody
{
public List<ChanceLineBody> lines { get; set; }
}
class Generator
{
private static string iB;
public static void Gen(string section, string api, string league, int minValue, int chanceMinValue, int confidence)
{
Theme jt = JsonConvert.DeserializeObject<Theme>(File.ReadAllText("structure/Chancing.json", Encoding.UTF8));
List<string> itemBase = new List<string>();
ChanceRootBody j = JsonConvert.DeserializeObject<ChanceRootBody>(File.ReadAllText("data/ninja.accessory.json", Encoding.UTF8));
foreach (var ln in j.lines)
{
// Check if the item count is at least equal to the desired confidence level
if (ln.count >= confidence && ln.links <= 4 && ln.itemType == "Belt")
{
// Check if the item value is equal or superior to the minimum value
if (ln.chaosValue >= chanceMinValue)
{
if (!itemBase.Contains(ln.baseType))
{
itemBase.Add(ln.baseType);
iB = iB + string.Format(@" ""{0}""", ln.baseType);
}
}
}
}
if (iB == null) { iB = @""""""; }
string fn = @"gen\" + section + ".filter";
File.AppendAllText(fn, string.Format("# Section: {0}", section) + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(fn, "" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(fn, "Show" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(fn, " BaseType" + iB + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(fn, " Rarity = Normal" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(fn, " ItemLevel >= 50" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(fn, $" SetTextColor {jt.text}" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(fn, $" SetBorderColor {jt.border}" + Environment.NewLine, Encoding.UTF8);
File.AppendAllText(fn, $" SetFontSize {jt.text_size}", Encoding.UTF8);
}
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Les informations générales relatives à un assembly dépendent de
// l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations
// associées à un assembly.
[assembly: AssemblyTitle("CHANCING (Belt)")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CHANCING (Belt)")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly
// aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de
// COM, affectez la valeur true à l'attribut ComVisible sur ce type.
[assembly: ComVisible(false)]
// Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM
[assembly: Guid("30965ccd-46df-47a3-bdbc-6fc0b0900b4e")]
// Les informations de version pour un assembly se composent des quatre valeurs suivantes :
//
// Version principale
// Version secondaire
// Numéro de build
// Révision
//
// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
// en utilisant '*', comme indiqué ci-dessous :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net461" />
</packages>