bump 3.4.0

This commit is contained in:
CWX 2022-12-25 15:41:48 +00:00
parent 57dbda4235
commit 6428699918
41 changed files with 56 additions and 68 deletions

View File

@ -1,10 +1,10 @@
{ {
"name": "HideoutArchitect", "name": "HideoutArchitect",
"version": "1.6.8", "version": "1.6.9",
"main": "./src/hideoutarchitect.js", "main": "./src/hideoutarchitect.js",
"license": "NCSA Open Source", "license": "NCSA Open Source",
"author": "Faupi", "author": "Faupi",
"akiVersion": "3.3.0", "akiVersion": "3.4.0",
"updated by": "CWX", "updated by": "CWX",
"scripts": { "scripts": {
"setup": "npm i", "setup": "npm i",

View File

@ -52,7 +52,7 @@ class HideoutArchitect implements IPreAkiLoadMod, IPostAkiLoadMod
{ {
const attrValue = attrKvPair[attrKey]; const attrValue = attrKvPair[attrKey];
this.globalLocale[language].interface[attrKey] = attrValue; this.globalLocale[language][attrKey] = attrValue;
} }
} }
} }

View File

@ -7,12 +7,10 @@ using System.IO;
using System.Linq; using System.Linq;
using BepInEx; using BepInEx;
using UnityEngine; using UnityEngine;
using Hideout = GClass1682;
using Requirement = GClass1706;
namespace HideoutArchitect namespace HideoutArchitect
{ {
[BepInPlugin("com.FAUPI.HideoutArchitect", "FAUPI-HideoutArchitect", "1.6.8")] [BepInPlugin("com.FAUPI.HideoutArchitect", "FAUPI-HideoutArchitect", "1.6.9")]
public class HideoutArchitect : BaseUnityPlugin public class HideoutArchitect : BaseUnityPlugin
{ {
private void Awake() private void Awake()
@ -71,16 +69,16 @@ namespace HideoutArchitect
public static List<AreaData> GetApplicableUpgrades(Item item) public static List<AreaData> GetApplicableUpgrades(Item item)
{ {
List<AreaData> areas = Singleton<Hideout>.Instance.AreaDatas.Where(area => List<AreaData> areas = Singleton<HideoutClass>.Instance.AreaDatas.Where(area =>
{ {
bool areaActive = area.Status != EAreaStatus.NotSet && area.Template.Enabled == true; bool areaActive = area.Status != EAreaStatus.NotSet && area.Template.Enabled == true;
List<Requirement> targetedRequirements; List<ProductionRequirementsClass> targetedRequirements;
switch (ModConfig.NeededForHideoutDefinition) switch (ModConfig.NeededForHideoutDefinition)
{ {
case ENeededDefinition.NextLevel: case ENeededDefinition.NextLevel:
case ENeededDefinition.NextLevelReady: case ENeededDefinition.NextLevelReady:
targetedRequirements = area.NextStage.Requirements.Value as List<Requirement>; targetedRequirements = area.NextStage.Requirements.Value as List<ProductionRequirementsClass>;
break; break;
default: default:
throw new NotImplementedException(Enum.GetName(typeof(ENeededDefinition), ModConfig.NeededForHideoutDefinition)); throw new NotImplementedException(Enum.GetName(typeof(ENeededDefinition), ModConfig.NeededForHideoutDefinition));

View File

@ -1,10 +1,10 @@
{ {
"name": "HideoutArchitect", "name": "HideoutArchitect",
"version": "1.6.8", "version": "1.6.9",
"main": "./src/hideoutarchitect.js", "main": "./src/hideoutarchitect.js",
"license": "NCSA Open Source", "license": "NCSA Open Source",
"author": "Faupi", "author": "Faupi",
"akiVersion": "3.3.0", "akiVersion": "3.4.0",
"updated by": "CWX", "updated by": "CWX",
"scripts": { "scripts": {
"setup": "npm i", "setup": "npm i",

View File

@ -52,7 +52,7 @@ class HideoutArchitect implements IPreAkiLoadMod, IPostAkiLoadMod
{ {
const attrValue = attrKvPair[attrKey]; const attrValue = attrKvPair[attrKey];
this.globalLocale[language].interface[attrKey] = attrValue; this.globalLocale[language][attrKey] = attrValue;
} }
} }
} }

View File

@ -1,10 +1,10 @@
{ {
"name": "HideoutArchitect", "name": "HideoutArchitect",
"version": "1.6.8", "version": "1.6.9",
"main": "./src/hideoutarchitect.js", "main": "./src/hideoutarchitect.js",
"license": "NCSA Open Source", "license": "NCSA Open Source",
"author": "Faupi", "author": "Faupi",
"akiVersion": "3.3.0", "akiVersion": "3.4.0",
"updated by": "CWX", "updated by": "CWX",
"scripts": { "scripts": {
"setup": "npm i", "setup": "npm i",

View File

@ -52,7 +52,7 @@ class HideoutArchitect implements IPreAkiLoadMod, IPostAkiLoadMod
{ {
const attrValue = attrKvPair[attrKey]; const attrValue = attrKvPair[attrKey];
this.globalLocale[language].interface[attrKey] = attrValue; this.globalLocale[language][attrKey] = attrValue;
} }
} }
} }

View File

@ -1,10 +1,10 @@
{ {
"name": "MunitionsExpert", "name": "MunitionsExpert",
"author": "Faupi", "author": "Faupi",
"version": "1.6.7", "version": "1.6.8",
"license": "NCSA Open Source", "license": "NCSA Open Source",
"main": "./src/MunitionsExpert.js", "main": "./src/MunitionsExpert.js",
"akiVersion": "3.3.0", "akiVersion": "3.4.0",
"updatedBy": "CWX", "updatedBy": "CWX",
"scripts": { "scripts": {
"setup": "npm i", "setup": "npm i",

View File

@ -55,7 +55,7 @@ class MunitionsExpert implements IPreAkiLoadMod, IPostAkiLoadMod
{ {
const attrValue = attrKvPair[attrKey]; const attrValue = attrKvPair[attrKey];
this.globalLocale[language].interface[attrKey] = attrValue; this.globalLocale[language][attrKey] = attrValue;
} }
} }
} }

View File

@ -3,7 +3,6 @@ using EFT.InventoryLogic;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
using ItemAttributes = GClass2210;
namespace MunitionsExpert namespace MunitionsExpert
{ {
@ -15,9 +14,9 @@ namespace MunitionsExpert
} }
[PatchPostfix] [PatchPostfix]
private static void PatchPostfix(ref AmmoTemplate __instance, ref List<ItemAttributes> __result) private static void PatchPostfix(ref AmmoTemplate __instance, ref List<ItemAttributeClass> __result)
{ {
if (!__result.Any((ItemAttributes a) => (Attributes.ENewItemAttributeId)a.Id == Attributes.ENewItemAttributeId.Damage)) if (!__result.Any((ItemAttributeClass a) => (Attributes.ENewItemAttributeId)a.Id == Attributes.ENewItemAttributeId.Damage))
{ {
//MunitionsExpert.FormatExistingAttributes(ref __result, __instance); //MunitionsExpert.FormatExistingAttributes(ref __result, __instance);
Plugin.AddNewAttributes(ref __result, __instance); Plugin.AddNewAttributes(ref __result, __instance);

View File

@ -9,19 +9,16 @@ using BepInEx;
using Comfort.Common; using Comfort.Common;
using Newtonsoft.Json; using Newtonsoft.Json;
using Aki.Common.Utils; using Aki.Common.Utils;
using ItemAttribute = GClass2210;
using ServerSettings = GClass1173;
using static MunitionsExpert.Attributes; using static MunitionsExpert.Attributes;
using Aki.Common.Http; using Aki.Common.Http;
namespace MunitionsExpert namespace MunitionsExpert
{ {
[BepInPlugin("com.Faupi.MunitionsExpert", "Faupi-MunitionsExpert", "1.6.7")] [BepInPlugin("com.Faupi.MunitionsExpert", "Faupi-MunitionsExpert", "1.6.8")]
public class Plugin : BaseUnityPlugin public class Plugin : BaseUnityPlugin
{ {
public static Dictionary<Enum, Sprite> iconCache = new Dictionary<Enum, Sprite>(); public static Dictionary<Enum, Sprite> iconCache = new Dictionary<Enum, Sprite>();
public static List<ItemAttribute> penAttributes = new List<ItemAttribute>(); public static List<ItemAttributeClass> penAttributes = new List<ItemAttributeClass>();
public static string modPath; public static string modPath;
private void Awake() private void Awake()
@ -72,7 +69,7 @@ namespace MunitionsExpert
} }
} }
public static void AddNewAttributes(ref List<ItemAttribute> attributes, AmmoTemplate template) public static void AddNewAttributes(ref List<ItemAttributeClass> attributes, AmmoTemplate template)
{ {
int projCount = template.ProjectileCount; int projCount = template.ProjectileCount;
int totalDamage = template.Damage * template.ProjectileCount; int totalDamage = template.Damage * template.ProjectileCount;
@ -83,7 +80,7 @@ namespace MunitionsExpert
damageStr += $" ({template.Damage} x {template.ProjectileCount})"; // Add the "damage calculation" after total damage (damage per pellet * pellet count) damageStr += $" ({template.Damage} x {template.ProjectileCount})"; // Add the "damage calculation" after total damage (damage per pellet * pellet count)
} }
ItemAttribute at_damage = new ItemAttribute(ENewItemAttributeId.Damage) ItemAttributeClass at_damage = new ItemAttributeClass(ENewItemAttributeId.Damage)
{ {
Name = ENewItemAttributeId.Damage.GetName(), Name = ENewItemAttributeId.Damage.GetName(),
Base = () => totalDamage, Base = () => totalDamage,
@ -94,7 +91,7 @@ namespace MunitionsExpert
if (template.ArmorDamage > 0) if (template.ArmorDamage > 0)
{ {
ItemAttribute at_armordmg = new ItemAttribute(ENewItemAttributeId.ArmorDamage) ItemAttributeClass at_armordmg = new ItemAttributeClass(ENewItemAttributeId.ArmorDamage)
{ {
Name = ENewItemAttributeId.ArmorDamage.GetName(), Name = ENewItemAttributeId.ArmorDamage.GetName(),
Base = () => template.ArmorDamage, Base = () => template.ArmorDamage,
@ -110,8 +107,8 @@ namespace MunitionsExpert
{ {
int ratedClass = 0; int ratedClass = 0;
if (!Singleton<ServerSettings>.Instantiated) { return $"CLASS_DATA_MISSING {template.PenetrationPower.ToString()}"; } if (!Singleton<BackendConfigSettingsClass>.Instantiated) { return $"CLASS_DATA_MISSING {template.PenetrationPower.ToString()}"; }
ServerSettings.GClass1220.GClass1221[] classes = Singleton<ServerSettings>.Instance.Armor.ArmorClass; BackendConfigSettingsClass.GClass1226.GClass1227[] classes = Singleton<BackendConfigSettingsClass>.Instance.Armor.ArmorClass;
for (int i = 0; i < classes.Length; i++) for (int i = 0; i < classes.Length; i++)
{ {
if (classes[i].Resistance > template.PenetrationPower) continue; if (classes[i].Resistance > template.PenetrationPower) continue;
@ -121,7 +118,7 @@ namespace MunitionsExpert
return $"{(ratedClass > 0 ? $"{"ME_class".Localized()} {ratedClass}" : "ME_noarmor".Localized())} ({template.PenetrationPower.ToString()})"; return $"{(ratedClass > 0 ? $"{"ME_class".Localized()} {ratedClass}" : "ME_noarmor".Localized())} ({template.PenetrationPower.ToString()})";
} }
ItemAttribute at_pen = new ItemAttribute(ENewItemAttributeId.Penetration) ItemAttributeClass at_pen = new ItemAttributeClass(ENewItemAttributeId.Penetration)
{ {
Name = ENewItemAttributeId.Penetration.GetName(), Name = ENewItemAttributeId.Penetration.GetName(),
Base = () => template.PenetrationPower, Base = () => template.PenetrationPower,
@ -133,7 +130,7 @@ namespace MunitionsExpert
if (template.FragmentationChance > 0) if (template.FragmentationChance > 0)
{ {
ItemAttribute at_frag = new ItemAttribute(ENewItemAttributeId.FragmentationChance) ItemAttributeClass at_frag = new ItemAttributeClass(ENewItemAttributeId.FragmentationChance)
{ {
Name = ENewItemAttributeId.FragmentationChance.GetName(), Name = ENewItemAttributeId.FragmentationChance.GetName(),
Base = () => template.FragmentationChance, Base = () => template.FragmentationChance,
@ -145,7 +142,7 @@ namespace MunitionsExpert
if (template.RicochetChance > 0) if (template.RicochetChance > 0)
{ {
ItemAttribute at_ricochet = new ItemAttribute(ENewItemAttributeId.RicochetChance) ItemAttributeClass at_ricochet = new ItemAttributeClass(ENewItemAttributeId.RicochetChance)
{ {
Name = ENewItemAttributeId.RicochetChance.GetName(), Name = ENewItemAttributeId.RicochetChance.GetName(),
Base = () => template.RicochetChance, Base = () => template.RicochetChance,

View File

@ -1,10 +1,10 @@
{ {
"name": "MunitionsExpert", "name": "MunitionsExpert",
"author": "Faupi", "author": "Faupi",
"version": "1.6.7", "version": "1.6.8",
"license": "NCSA Open Source", "license": "NCSA Open Source",
"main": "./src/MunitionsExpert.js", "main": "./src/MunitionsExpert.js",
"akiVersion": "3.3.0", "akiVersion": "3.4.0",
"updatedBy": "CWX", "updatedBy": "CWX",
"scripts": { "scripts": {
"setup": "npm i", "setup": "npm i",

View File

@ -55,7 +55,7 @@ class MunitionsExpert implements IPreAkiLoadMod, IPostAkiLoadMod
{ {
const attrValue = attrKvPair[attrKey]; const attrValue = attrKvPair[attrKey];
this.globalLocale[language].interface[attrKey] = attrValue; this.globalLocale[language][attrKey] = attrValue;
} }
} }
} }

View File

@ -1,10 +1,10 @@
{ {
"name": "MunitionsExpert", "name": "MunitionsExpert",
"author": "Faupi", "author": "Faupi",
"version": "1.6.7", "version": "1.6.8",
"license": "NCSA Open Source", "license": "NCSA Open Source",
"main": "./src/MunitionsExpert.js", "main": "./src/MunitionsExpert.js",
"akiVersion": "3.3.0", "akiVersion": "3.4.0",
"updatedBy": "CWX", "updatedBy": "CWX",
"scripts": { "scripts": {
"setup": "npm i", "setup": "npm i",

View File

@ -55,7 +55,7 @@ class MunitionsExpert implements IPreAkiLoadMod, IPostAkiLoadMod
{ {
const attrValue = attrKvPair[attrKey]; const attrValue = attrKvPair[attrKey];
this.globalLocale[language].interface[attrKey] = attrValue; this.globalLocale[language][attrKey] = attrValue;
} }
} }
} }

View File

@ -1,10 +1,10 @@
{ {
"name": "SeeItemValue", "name": "SeeItemValue",
"author": "KcY", "author": "KcY",
"version": "1.5.0", "version": "1.5.1",
"license": "NCSA Open Source", "license": "NCSA Open Source",
"main": "src/mod.js", "main": "src/mod.js",
"akiVersion": "3.3.0", "akiVersion": "3.4.0",
"UpdatedBy": "CWX", "UpdatedBy": "CWX",
"scripts": { "scripts": {
"setup": "npm i", "setup": "npm i",

View File

@ -2,11 +2,6 @@
using System.Reflection; using System.Reflection;
using Aki.Reflection.Patching; using Aki.Reflection.Patching;
using EFT.InventoryLogic; using EFT.InventoryLogic;
using Ammo = BulletClass;
using Grenade = GClass2199;
using GrenadeTemplate = GClass2091;
using SecureContainer = GClass2144;
using SecureContainerTemplate = GClass2051;
namespace itemValueMod namespace itemValueMod
{ {
@ -28,11 +23,11 @@ namespace itemValueMod
{ {
protected override MethodBase GetTargetMethod() protected override MethodBase GetTargetMethod()
{ {
return typeof(Ammo).GetConstructor(new Type[] { typeof(string), typeof(AmmoTemplate) }); return typeof(BulletClass).GetConstructor(new Type[] { typeof(string), typeof(AmmoTemplate) });
} }
[PatchPostfix] [PatchPostfix]
private static void PatchPostFix(ref Ammo __instance, string id, AmmoTemplate template) private static void PatchPostFix(ref BulletClass __instance, string id, AmmoTemplate template)
{ {
ItemValue.AddItemValue(ref __instance, id, template); ItemValue.AddItemValue(ref __instance, id, template);
} }
@ -42,11 +37,11 @@ namespace itemValueMod
{ {
protected override MethodBase GetTargetMethod() protected override MethodBase GetTargetMethod()
{ {
return typeof(Grenade).GetConstructor(new Type[] { typeof(string), typeof(GrenadeTemplate) }); return typeof(GrenadeClass).GetConstructor(new Type[] { typeof(string), typeof(ThrowableWeaponClass) });
} }
[PatchPostfix] [PatchPostfix]
private static void PatchPostFix(ref Grenade __instance, string id, GrenadeTemplate template) private static void PatchPostFix(ref GrenadeClass __instance, string id, ThrowableWeaponClass template)
{ {
ItemValue.AddItemValue(ref __instance, id, template); ItemValue.AddItemValue(ref __instance, id, template);
} }
@ -56,11 +51,11 @@ namespace itemValueMod
{ {
protected override MethodBase GetTargetMethod() protected override MethodBase GetTargetMethod()
{ {
return typeof(SecureContainer).GetConstructor(new Type[] { typeof(string), typeof(SecureContainerTemplate) }); return typeof(ItemContainerClass).GetConstructor(new Type[] { typeof(string), typeof(SecureContainerTemplateClass) });
} }
[PatchPostfix] [PatchPostfix]
private static void PatchPostFix(ref SecureContainer __instance, string id, SecureContainerTemplate template) private static void PatchPostFix(ref ItemContainerClass __instance, string id, SecureContainerTemplateClass template)
{ {
ItemValue.AddItemValue(ref __instance, id, template); ItemValue.AddItemValue(ref __instance, id, template);
} }

View File

@ -2,7 +2,7 @@
namespace itemValueMod namespace itemValueMod
{ {
[BepInPlugin("com.KcY.SeeItemValue", "KcY-SeeItemValue", "1.4.9")] [BepInPlugin("com.KcY.SeeItemValue", "KcY-SeeItemValue", "1.5.1")]
public class Plugin : BaseUnityPlugin public class Plugin : BaseUnityPlugin
{ {
private void Awake() private void Awake()

View File

@ -4,7 +4,6 @@ using EFT.InventoryLogic;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection; using System.Reflection;
using ItemAttribute = GClass2210;
using System.Net; using System.Net;
using System.Threading; using System.Threading;
using UnityEngine; using UnityEngine;
@ -16,11 +15,11 @@ namespace itemValueMod
{ {
public static void AddItemValue<T>(ref T __instance, string id, ItemTemplate template) where T : Item public static void AddItemValue<T>(ref T __instance, string id, ItemTemplate template) where T : Item
{ {
var atts = new List<ItemAttribute>(); var atts = new List<ItemAttributeClass>();
atts.AddRange(__instance.Attributes); atts.AddRange(__instance.Attributes);
__instance.Attributes = atts; __instance.Attributes = atts;
ItemAttribute attr1 = new ItemAttribute(EItemAttributeId.MoneySum) ItemAttributeClass attr1 = new ItemAttributeClass(EItemAttributeId.MoneySum)
{ {
StringValue = new Func<string>(__instance.TraderPrice), StringValue = new Func<string>(__instance.TraderPrice),
FullStringValue = new Func<string>(__instance.TraderName), FullStringValue = new Func<string>(__instance.TraderName),
@ -197,12 +196,12 @@ namespace itemValueMod
var foodDrink = item.GetItemComponent<FoodDrinkComponent>(); var foodDrink = item.GetItemComponent<FoodDrinkComponent>();
if (foodDrink != null && foodDrink.HpPercent != 0) if (foodDrink != null && foodDrink.HpPercent != 0)
{ {
GInterface209 ginterface209_0 = (GInterface209)foodDrink.GetType().GetField("ginterface209_0", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(foodDrink); GInterface211 ginterface211_0 = (GInterface211)foodDrink.GetType().GetField("ginterface211_0", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(foodDrink);
DebugMode($" foodDrink Check - HpPercent is: {foodDrink.HpPercent}"); DebugMode($" foodDrink Check - HpPercent is: {foodDrink.HpPercent}");
DebugMode($" foodDrink Check - MaxResource is: {ginterface209_0.MaxResource}"); DebugMode($" foodDrink Check - MaxResource is: {ginterface211_0.MaxResource}");
editedPrice *= foodDrink.HpPercent / ginterface209_0.MaxResource; editedPrice *= foodDrink.HpPercent / ginterface211_0.MaxResource;
} }
DebugMode($" After foodDrink Check - price is: {editedPrice}"); DebugMode($" After foodDrink Check - price is: {editedPrice}");
@ -210,12 +209,12 @@ namespace itemValueMod
var keys = item.GetItemComponent<KeyComponent>(); var keys = item.GetItemComponent<KeyComponent>();
if (keys != null) if (keys != null)
{ {
GInterface213 gInterface213_0 = (GInterface213)keys.GetType().GetField("Template", BindingFlags.Public | BindingFlags.Instance).GetValue(keys); GInterface215 gInterface215_0 = (GInterface215)keys.GetType().GetField("Template", BindingFlags.Public | BindingFlags.Instance).GetValue(keys);
if (keys.NumberOfUsages > 0) if (keys.NumberOfUsages > 0)
{ {
double totalMinusUsed = Convert.ToDouble(gInterface213_0.MaximumNumberOfUsage - keys.NumberOfUsages); double totalMinusUsed = Convert.ToDouble(gInterface215_0.MaximumNumberOfUsage - keys.NumberOfUsages);
double multi = totalMinusUsed / gInterface213_0.MaximumNumberOfUsage; double multi = totalMinusUsed / gInterface215_0.MaximumNumberOfUsage;
DebugMode($" foodDrink Check - totalMinusUsed is: {totalMinusUsed}"); DebugMode($" foodDrink Check - totalMinusUsed is: {totalMinusUsed}");
DebugMode($" foodDrink Check - multi is: {multi}"); DebugMode($" foodDrink Check - multi is: {multi}");

View File

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>net472</TargetFramework> <TargetFramework>net472</TargetFramework>
<Version>1.4.9</Version> <Version>1.5.1</Version>
<AssemblyName>KcY-SeeItemValue</AssemblyName> <AssemblyName>KcY-SeeItemValue</AssemblyName>
</PropertyGroup> </PropertyGroup>

View File

@ -1,10 +1,10 @@
{ {
"name": "SeeItemValue", "name": "SeeItemValue",
"author": "KcY", "author": "KcY",
"version": "1.4.9", "version": "1.5.1",
"license": "NCSA Open Source", "license": "NCSA Open Source",
"main": "src/mod.js", "main": "src/mod.js",
"akiVersion": "3.3.0", "akiVersion": "3.4.0",
"UpdatedBy": "CWX", "UpdatedBy": "CWX",
"scripts": { "scripts": {
"setup": "npm i", "setup": "npm i",

View File

@ -1,10 +1,10 @@
{ {
"name": "SeeItemValue", "name": "SeeItemValue",
"author": "KcY", "author": "KcY",
"version": "1.4.9", "version": "1.5.1",
"license": "NCSA Open Source", "license": "NCSA Open Source",
"main": "src/mod.js", "main": "src/mod.js",
"akiVersion": "3.3.0", "akiVersion": "3.4.0",
"UpdatedBy": "CWX", "UpdatedBy": "CWX",
"scripts": { "scripts": {
"setup": "npm i", "setup": "npm i",

Binary file not shown.