using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using Bifrost.ConstEnum;
using ItemsAPI.Builders;
using ItemsAPI.Descriptors;
using KeepMyMoney;
using MelonLoader;
using Microsoft.CodeAnalysis;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(global::KeepMyMoney.KeepMyMoney), "KeepMyMoney", "0.1.0", "Shlygly", null)]
[assembly: MelonGame("ReLUGames", "MIMESIS")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Shlygly")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+dfe9618f460b5b40a10d66fa012ad463cc75ef05")]
[assembly: AssemblyProduct("KeepMyMoney")]
[assembly: AssemblyTitle("KeepMyMoney")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace KeepMyMoney
{
public class KeepMyMoney : MelonMod
{
private AssetBundle bundle;
public override void OnInitializeMelon()
{
//IL_006b: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_00af: Unknown result type (might be due to invalid IL or missing references)
//IL_0105: Unknown result type (might be due to invalid IL or missing references)
//IL_010a: Unknown result type (might be due to invalid IL or missing references)
//IL_0116: Unknown result type (might be due to invalid IL or missing references)
//IL_0132: Unknown result type (might be due to invalid IL or missing references)
//IL_013f: Unknown result type (might be due to invalid IL or missing references)
//IL_014c: Unknown result type (might be due to invalid IL or missing references)
//IL_0154: Unknown result type (might be due to invalid IL or missing references)
//IL_0160: Unknown result type (might be due to invalid IL or missing references)
//IL_03af: Unknown result type (might be due to invalid IL or missing references)
//IL_03c8: Unknown result type (might be due to invalid IL or missing references)
//IL_03d2: Unknown result type (might be due to invalid IL or missing references)
//IL_03d7: Unknown result type (might be due to invalid IL or missing references)
//IL_03e8: Expected O, but got Unknown
((MelonBase)this).LoggerInstance.Msg("Loading asset bundle...");
if (!LoadAssetBundle())
{
((MelonBase)this).LoggerInstance.Error("Can't load asset bundle !");
return;
}
ItemBuilder.RegisterAssetBundle(bundle);
((MelonBase)this).LoggerInstance.Msg("Adding new acknowledgments of debt...");
List<(int, Vector3)> list = new List<(int, Vector3)>(3)
{
(10, new Vector3(-1.8569995f, -0.05f, 25.03f)),
(50, new Vector3(-0.31199944f, -0.047f, 25.042f)),
(100, new Vector3(1.21f, -0.04f, 25.034f))
};
foreach (var item in list)
{
ItemDescriptor val = ((ItemDescriptor)new ConsumableItemDescriptor($"consumable_iou_{item.Item1}", $"assets/shlygly/keepmymoney/prefab_consumable_iou_{item.Item1}.prefab", "Acknowledgment of debt")
{
DefaultVendingMachineTooltip = "Store your money for a later quota. Sells back for the same value.",
IconSpriteAssetId = $"assets/shlygly/keepmymoney/icon_{item.Item1}.png",
MinPrice = item.Item1,
MaxPrice = item.Item1,
Weight = 5,
AttachSocketName = "holdWeaponSocket",
PuppetHandheldState = (PuppetHandheldState)3
}).AddLocalizedItemName((IDictionary<string, string>)new Dictionary<string, string>
{
{ "ar", "إقرار بالدين" },
{ "de", "Schuldanerkenntnis" },
{ "es", "Reconocimiento de deuda" },
{ "fr", "Reconnaissance de dette" },
{ "it", "Riconoscimento di debito" },
{ "ja", "債務承認書" },
{ "ko", "채무 확인서" },
{ "pl", "Uznanie długu" },
{ "pt_br", "Reconhecimento de dívida" },
{ "ru", "Долговая расписка" },
{ "th", "หน\u0e31งส\u0e37อร\u0e31บสภาพหน\u0e35\u0e49" },
{ "tr", "Borç kabul belgesi" },
{ "uk", "Боргова розписка" },
{ "vi", "Giấy xác nhận nợ" },
{ "zh_cn", "债务确认书" },
{ "zh_tw", "債務確認書" }
}).AddLocalizedVendingMachineTooltip((IDictionary<string, string>)new Dictionary<string, string>
{
{ "ar", "احتفظ بأموالك لحصة لاحقة. ي\u064fباع بنفس القيمة." },
{ "de", "Bewahre dein Geld für eine spätere Quote auf. Wird zum gleichen Wert verkauft." },
{ "es", "Guarda tu dinero para una cuota futura. Se vende por el mismo valor." },
{ "fr", "Garde ton argent pour un quota futur. Se revend à la même valeur." },
{ "it", "Conserva i tuoi soldi per una quota futura. Si rivende allo stesso valore." },
{ "ja", "後のノルマ用にお金を保管する。同じ価値で売れる。" },
{ "ko", "나중의 할당량을 위해 돈을 보관하세요. 같은 가치로 되팔 수 있습니다." },
{ "pl", "Zachowaj pieniądze na późniejszą normę. Sprzedasz za tę samą wartość." },
{ "pt_br", "Guarde seu dinheiro para uma cota futura. Revende pelo mesmo valor." },
{ "ru", "Сохрани деньги для будущей квоты. Продаётся за ту же сумму." },
{ "th", "เก\u0e47บเง\u0e34นไว\u0e49สำหร\u0e31บโควตาคร\u0e31\u0e49งหน\u0e49า ขายค\u0e37นได\u0e49ในราคาเด\u0e34ม." },
{ "tr", "Paranı sonraki kota için sakla. Aynı değere geri satılır." },
{ "uk", "Збережи гроші для майбутньої квоти. Продається за ту саму суму." },
{ "vi", "Giữ tiền cho hạn ngạch sau. Bán lại với cùng giá trị." },
{ "zh_cn", "把钱留到之后的指标。可按相同价值卖回。" },
{ "zh_tw", "把錢留到之後的指標。可按相同價值賣回。" }
});
ItemBuilder.RegisterItem(val);
VendingMachineBuilder.RegisterVendingMachine(new VendingMachineDescriptor(val, item.Item1, item.Item2, (Quaternion?)new Quaternion(0f, 1f, 0f, 0f))
{
ItemScale = 3.5f
});
}
((MelonBase)this).LoggerInstance.Msg("Acknowledgments of debt added !");
}
public bool LoadAssetBundle()
{
string text = Path.Combine(Path.GetDirectoryName(((object)this).GetType().Assembly.Location), "keepmymoney");
((MelonBase)this).LoggerInstance.Msg("Loading AssetBundle: " + text);
if (!File.Exists(text))
{
((MelonBase)this).LoggerInstance.Error("AssetBundle not found: " + text);
return false;
}
bundle = AssetBundle.LoadFromFile(text);
if ((Object)(object)bundle == (Object)null)
{
((MelonBase)this).LoggerInstance.Error("Failed to load AssetBundle.");
return false;
}
((MelonBase)this).LoggerInstance.Msg("AssetBundle loaded.");
string[] allAssetNames = bundle.GetAllAssetNames();
foreach (string text2 in allAssetNames)
{
((MelonBase)this).LoggerInstance.Msg("Asset in bundle: " + text2);
}
return true;
}
}
}