Decompiled source of Longrangebullet v0.1.2

Longrange bullet.dll

Decompiled 2 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using DM;
using HarmonyLib;
using Landfall.TABS;
using SLMA;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("Mod name")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("made in SFT by FhpSlime")]
[assembly: AssemblyCopyright("Copyright ©  2022")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("3a45c3cf-230c-4310-952f-0887d4266a22")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Longrangeprojectile
{
	public static class UManager
	{
		public static string modname;

		public static string modder;

		private static string com;

		static UManager()
		{
			modname = "SFT";
			modder = "FhpSlime";
		}

		public static void SetRiders(UnitBlueprint me, UnitBlueprint[] riders)
		{
			s.SetField<UnitBlueprint>(me, "Riders", (object)riders);
		}

		public static void EditBlueprint(UnitBlueprint unit, LandfallContentDatabase db)
		{
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Expected O, but got Unknown
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Expected O, but got Unknown
			if (unit.Entity.Name == "傻逼")
			{
				unit.health = 114.514f;
				unit.holdinigWithTwoHands = false;
				SLMATool.UnitCost(unit, 320);
				unit.RightWeapon = (GameObject)SLMALoader.SDic["weapons"]["M16 - Automatic"];
				unit.LeftWeapon = (GameObject)SLMALoader.SDic["weapons"]["M16 - Automatic"];
				SetRiders(unit, (UnitBlueprint[])(object)new UnitBlueprint[1] { SLMATool.super<UnitBlueprint>("傻逼")[2] });
			}
		}

		public static void EditClothes(GameObject cloth, CharacterItem item, PropItemData data, Unit unit, int index, LandfallContentDatabase db)
		{
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Expected O, but got Unknown
			Debug.Log((object)"Hey");
			if (unit.unitBlueprint.Entity.Name == "unit name")
			{
				Renderer[] componentsInChildren = cloth.GetComponentsInChildren<Renderer>();
				for (int i = 0; i < componentsInChildren.Length; i++)
				{
					componentsInChildren[i].materials = (Material[])(object)new Material[1] { (Material)SLMALoader.SDic["materials"]["Glow_Neon_Green_143734"] };
				}
			}
		}

		public static void EditProjectiles(GameObject proj, ProjectileHit projhit, Unit unit, LandfallContentDatabase db)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			if (unit.unitBlueprint.Entity.Name == "unit name")
			{
				Transform transform = proj.transform;
				transform.localScale *= 3f;
			}
		}

		public static void EditCombatMoves(GameObject move, int index, Unit unit, LandfallContentDatabase db)
		{
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Expected O, but got Unknown
			if (unit.unitBlueprint.Entity.Name == "unit name" && Object.op_Implicit((Object)(object)move.GetComponentInChildren<DodgeMove>()))
			{
				move.GetComponentInChildren<DodgeMove>().moves[0].forceCurve = new AnimationCurve((Keyframe[])(object)new Keyframe[5]
				{
					new Keyframe(0f, 1f),
					new Keyframe(1f, -2f),
					new Keyframe(2f, 5f),
					new Keyframe(6f, -16f),
					new Keyframe(8f, 0f)
				});
			}
		}

		public static void CodeAfterSpawn(Unit unit, LandfallContentDatabase db)
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			if (unit.unitBlueprint.Entity.Name == "unit name")
			{
				Transform head = unit.data.head;
				head.localScale *= 2f;
			}
		}

		public static void Init(LandfallContentDatabase db)
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Expected O, but got Unknown
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Expected O, but got Unknown
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Expected O, but got Unknown
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Expected O, but got Unknown
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Expected O, but got Unknown
			//IL_023d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0251: Expected O, but got Unknown
			//IL_02bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d3: Expected O, but got Unknown
			//IL_0365: Unknown result type (might be due to invalid IL or missing references)
			//IL_0379: Expected O, but got Unknown
			//IL_03d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e4: Expected O, but got Unknown
			//IL_0426: Unknown result type (might be due to invalid IL or missing references)
			//IL_043a: Expected O, but got Unknown
			//IL_044e: Unknown result type (might be due to invalid IL or missing references)
			//IL_047b: Unknown result type (might be due to invalid IL or missing references)
			//IL_048f: Expected O, but got Unknown
			//IL_04e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0511: Unknown result type (might be due to invalid IL or missing references)
			//IL_0525: Expected O, but got Unknown
			//IL_0567: Unknown result type (might be due to invalid IL or missing references)
			//IL_057b: Expected O, but got Unknown
			//IL_05bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d1: Expected O, but got Unknown
			//IL_0613: Unknown result type (might be due to invalid IL or missing references)
			//IL_0627: Expected O, but got Unknown
			//IL_0669: Unknown result type (might be due to invalid IL or missing references)
			//IL_067d: Expected O, but got Unknown
			//IL_06bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d3: Expected O, but got Unknown
			//IL_0715: Unknown result type (might be due to invalid IL or missing references)
			//IL_0729: Expected O, but got Unknown
			//IL_076b: Unknown result type (might be due to invalid IL or missing references)
			//IL_077f: Expected O, but got Unknown
			//IL_07c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d5: Expected O, but got Unknown
			//IL_0817: Unknown result type (might be due to invalid IL or missing references)
			//IL_082b: Expected O, but got Unknown
			//IL_086d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0881: Expected O, but got Unknown
			//IL_08c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d7: Expected O, but got Unknown
			//IL_0919: Unknown result type (might be due to invalid IL or missing references)
			//IL_092d: Expected O, but got Unknown
			//IL_096f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0983: Expected O, but got Unknown
			//IL_09c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_09d9: Expected O, but got Unknown
			//IL_0a1b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a2f: Expected O, but got Unknown
			//IL_0a71: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a85: Expected O, but got Unknown
			//IL_0ac7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0adb: Expected O, but got Unknown
			//IL_0b1d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b31: Expected O, but got Unknown
			//IL_0b73: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b87: Expected O, but got Unknown
			//IL_0bc9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bdd: Expected O, but got Unknown
			//IL_0c1f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c33: Expected O, but got Unknown
			//IL_0c75: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c89: Expected O, but got Unknown
			//IL_0ccb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cdf: Expected O, but got Unknown
			//IL_0d21: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d35: Expected O, but got Unknown
			//IL_0d77: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d8b: Expected O, but got Unknown
			//IL_0dcd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0de1: Expected O, but got Unknown
			//IL_0e23: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e37: Expected O, but got Unknown
			//IL_0e79: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e8d: Expected O, but got Unknown
			//IL_0ecf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ee3: Expected O, but got Unknown
			//IL_0f25: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f39: Expected O, but got Unknown
			//IL_0f7b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f8f: Expected O, but got Unknown
			//IL_0fd1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fe5: Expected O, but got Unknown
			//IL_1027: Unknown result type (might be due to invalid IL or missing references)
			//IL_103b: Expected O, but got Unknown
			//IL_107d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1091: Expected O, but got Unknown
			//IL_10d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_10e7: Expected O, but got Unknown
			//IL_1129: Unknown result type (might be due to invalid IL or missing references)
			//IL_113d: Expected O, but got Unknown
			//IL_117f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1193: Expected O, but got Unknown
			//IL_11d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_11e9: Expected O, but got Unknown
			//IL_122b: Unknown result type (might be due to invalid IL or missing references)
			//IL_123f: Expected O, but got Unknown
			//IL_12d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_12e5: Expected O, but got Unknown
			//IL_1377: Unknown result type (might be due to invalid IL or missing references)
			//IL_138b: Expected O, but got Unknown
			com = "——————————Fations and Units——————————";
			com = "——————————Clothes——————————";
			com = "——————————Weapons——————————";
			UPool.MyPool.AddObject("较准距离投石1", (GameObject)SLMALoader.SDic["projectiles"]["B_CatapultRock"], true, (HideFlags)52, (Sprite)null, 197441, true).GetComponentInChildren<AddForce>().force.z = 27.25f;
			UPool.MyPool.AddObject("超远距离投石2", (GameObject)SLMALoader.SDic["projectiles"]["B_CatapultRock"], true, (HideFlags)52, (Sprite)null, 1000101, true).GetComponentInChildren<AddForce>().force.z = 32f;
			UPool.MyPool.AddObject("子弹C4", (GameObject)SLMALoader.SDic["projectiles"]["P_BulletGrenade"], true, (HideFlags)52, (Sprite)null, 2977411, true);
			GameObject obj = UPool.MyPool.AddObject("较准距离投石", (GameObject)SLMALoader.SDic["weapons"]["CatapultRock"], true, (HideFlags)52, (Sprite)null, 211, true);
			((Weapon)obj.GetComponentInChildren<RangeWeapon>()).maxRange = 15000f;
			obj.GetComponentInChildren<RangeWeapon>().clampRange = 100000f;
			obj.GetComponentInChildren<RangeWeapon>().force = 4.5f;
			ChineseLibrary.设置子弹(obj, UPool.MyPool.GetObject("较准距离投石1"));
			((Weapon)obj.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 100f;
			((Weapon)obj.GetComponentInChildren<RangeWeapon>()).useTargetingWhenPossessed = true;
			GameObject obj2 = UPool.MyPool.AddObject("最远距离投石", (GameObject)SLMALoader.SDic["weapons"]["CatapultRock"], true, (HideFlags)52, (Sprite)null, 11232211, true);
			((Weapon)obj2.GetComponentInChildren<RangeWeapon>()).maxRange = 15000f;
			obj2.GetComponentInChildren<RangeWeapon>().clampRange = 100000f;
			obj2.GetComponentInChildren<RangeWeapon>().force = 4.5f;
			ChineseLibrary.设置子弹(obj2, UPool.MyPool.GetObject("超远距离投石2"));
			((Weapon)obj2.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 100f;
			((Weapon)obj2.GetComponentInChildren<RangeWeapon>()).useTargetingWhenPossessed = true;
			GameObject obj3 = UPool.MyPool.AddObject("往下投石", (GameObject)SLMALoader.SDic["weapons"]["CatapultRock"], true, (HideFlags)52, (Sprite)null, 11211, true);
			((Weapon)obj3.GetComponentInChildren<RangeWeapon>()).maxRange = 15000f;
			obj3.GetComponentInChildren<RangeWeapon>().clampRange = 100000f;
			obj3.GetComponentInChildren<RangeWeapon>().force = -1f;
			((Weapon)obj3.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 100f;
			((Weapon)obj3.GetComponentInChildren<RangeWeapon>()).useTargetingWhenPossessed = true;
			GameObject obj4 = UPool.MyPool.AddObject("弓箭", (GameObject)SLMALoader.SDic["projectiles"]["P_Bow"], true, (HideFlags)52, (Sprite)null, 2001, true);
			obj4.GetComponentInChildren<MoveTransform>().gravity = 0f;
			obj4.GetComponentInChildren<RaycastTrail>().radius = 1000f;
			obj4.GetComponentInChildren<Compensation>().rangePow = -0.1f;
			obj4.GetComponentInChildren<ProjectileStick>().minWeight = -100f;
			obj4.GetComponentInChildren<ProjectileHit>().hitStop = 25f;
			obj4.GetComponentInChildren<ProjectileHit>().setSpeedOnHit = 100f;
			obj4.GetComponentInChildren<MoveTransform>().drag = 0f;
			GameObject obj5 = UPool.MyPool.AddObject("超远弓", (GameObject)SLMALoader.SDic["weapons"]["Bow"], true, (HideFlags)52, (Sprite)null, 2111, true);
			((Weapon)obj5.GetComponentInChildren<RangeWeapon>()).maxRange = 800f;
			obj5.GetComponentInChildren<RangeWeapon>().force = -1f;
			ChineseLibrary.设置子弹(obj5, UPool.MyPool.GetObject("弓箭"));
			GameObject obj6 = UPool.MyPool.AddObject("远射火枪", (GameObject)SLMALoader.SDic["weapons"]["Musket"], true, (HideFlags)52, (Sprite)null, 211111, true);
			((Weapon)obj6.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+12f;
			((Weapon)obj6.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 1000f;
			UPool.MyPool.AddObject("碎石1", (GameObject)SLMALoader.SDic["projectiles"]["B_Boulder"], true, (HideFlags)52, (Sprite)null, 123411, true).transform.localScale = new Vector3(0.5f, 0.5f, 0.5f);
			GameObject obj7 = UPool.MyPool.AddObject("碎石", (GameObject)SLMALoader.SDic["weapons"]["Thrower_Boulder"], true, (HideFlags)52, (Sprite)null, 211011, true);
			((Weapon)obj7.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 1000f;
			obj7.GetComponentInChildren<RangeWeapon>().force = -1f;
			ChineseLibrary.设置子弹(obj7, UPool.MyPool.GetObject("碎石1"));
			obj7.GetComponentInChildren<RangeWeapon>().numberOfObjects = 3;
			obj7.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f);
			GameObject obj8 = UPool.MyPool.AddObject("M16-L", (GameObject)SLMALoader.SDic["weapons"]["M16"], true, (HideFlags)52, (Sprite)null, 215011, true);
			((Weapon)obj8.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj8.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj9 = UPool.MyPool.AddObject("AA-12-L", (GameObject)SLMALoader.SDic["weapons"]["AA-12"], true, (HideFlags)52, (Sprite)null, 2787511, true);
			((Weapon)obj9.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj9.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj10 = UPool.MyPool.AddObject("AK47-L", (GameObject)SLMALoader.SDic["weapons"]["AK-47"], true, (HideFlags)52, (Sprite)null, 2497411, true);
			((Weapon)obj10.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj10.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj11 = UPool.MyPool.AddObject("Arnold-L", (GameObject)SLMALoader.SDic["weapons"]["Arnold"], true, (HideFlags)52, (Sprite)null, 2497511, true);
			((Weapon)obj11.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj11.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj12 = UPool.MyPool.AddObject("AUG-L", (GameObject)SLMALoader.SDic["weapons"]["AUG"], true, (HideFlags)52, (Sprite)null, 2497611, true);
			((Weapon)obj12.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj12.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj13 = UPool.MyPool.AddObject("Garand-L", (GameObject)SLMALoader.SDic["weapons"]["Garand"], true, (HideFlags)52, (Sprite)null, 2497711, true);
			((Weapon)obj13.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj13.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj14 = UPool.MyPool.AddObject("Famas-L", (GameObject)SLMALoader.SDic["weapons"]["Famas"], true, (HideFlags)52, (Sprite)null, 2398711, true);
			((Weapon)obj14.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj14.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj15 = UPool.MyPool.AddObject("Barrett-L", (GameObject)SLMALoader.SDic["weapons"]["Barrett"], true, (HideFlags)52, (Sprite)null, 2798711, true);
			((Weapon)obj15.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj15.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj16 = UPool.MyPool.AddObject("Beretta 93R-L", (GameObject)SLMALoader.SDic["weapons"]["Beretta 93R"], true, (HideFlags)52, (Sprite)null, 2998711, true);
			((Weapon)obj16.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj16.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj17 = UPool.MyPool.AddObject("Crossbow_Compound-L", (GameObject)SLMALoader.SDic["weapons"]["Crossbow_Compound"], true, (HideFlags)52, (Sprite)null, 2498711, true);
			((Weapon)obj17.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj17.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj18 = UPool.MyPool.AddObject("Desert Eagle-L", (GameObject)SLMALoader.SDic["weapons"]["Desert Eagle"], true, (HideFlags)52, (Sprite)null, 2698712, true);
			((Weapon)obj18.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj18.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj19 = UPool.MyPool.AddObject("DoubleBarrel-L", (GameObject)SLMALoader.SDic["weapons"]["DoubleBarrel"], true, (HideFlags)52, (Sprite)null, 2998712, true);
			((Weapon)obj19.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj19.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj20 = UPool.MyPool.AddObject("Glock18-L", (GameObject)SLMALoader.SDic["weapons"]["Glock18"], true, (HideFlags)52, (Sprite)null, 29486512, true);
			((Weapon)obj20.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj20.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj21 = UPool.MyPool.AddObject("HandCannon-L", (GameObject)SLMALoader.SDic["weapons"]["HandCannon"], true, (HideFlags)52, (Sprite)null, 297776512, true);
			((Weapon)obj21.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj21.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj22 = UPool.MyPool.AddObject("Kar98k-L", (GameObject)SLMALoader.SDic["weapons"]["Kar98k"], true, (HideFlags)52, (Sprite)null, 29787512, true);
			((Weapon)obj22.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj22.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj23 = UPool.MyPool.AddObject("Luger-L", (GameObject)SLMALoader.SDic["weapons"]["Luger"], true, (HideFlags)52, (Sprite)null, 2977514, true);
			((Weapon)obj23.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj23.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj24 = UPool.MyPool.AddObject("M14-L", (GameObject)SLMALoader.SDic["weapons"]["M14"], true, (HideFlags)52, (Sprite)null, 2978702, true);
			((Weapon)obj24.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj24.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj25 = UPool.MyPool.AddObject("M16 - Automatic-L", (GameObject)SLMALoader.SDic["weapons"]["M16 - Automatic"], true, (HideFlags)52, (Sprite)null, 3078702, true);
			((Weapon)obj25.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj25.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj26 = UPool.MyPool.AddObject("M1911-L", (GameObject)SLMALoader.SDic["weapons"]["M1911"], true, (HideFlags)52, (Sprite)null, 3075702, true);
			((Weapon)obj26.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj26.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj27 = UPool.MyPool.AddObject("M2-Browning-L", (GameObject)SLMALoader.SDic["weapons"]["M2-Browning"], true, (HideFlags)52, (Sprite)null, 3455702, true);
			((Weapon)obj27.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj27.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj28 = UPool.MyPool.AddObject("MAC-10-L", (GameObject)SLMALoader.SDic["weapons"]["MAC-10"], true, (HideFlags)52, (Sprite)null, 3855702, true);
			((Weapon)obj28.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj28.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj29 = UPool.MyPool.AddObject("Mg-42-L", (GameObject)SLMALoader.SDic["weapons"]["Mg-42"], true, (HideFlags)52, (Sprite)null, 652702, true);
			((Weapon)obj29.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj29.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj30 = UPool.MyPool.AddObject("MGL-L", (GameObject)SLMALoader.SDic["weapons"]["MGL"], true, (HideFlags)52, (Sprite)null, 652802, true);
			((Weapon)obj30.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj30.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj31 = UPool.MyPool.AddObject("Minigun-L", (GameObject)SLMALoader.SDic["weapons"]["Minigun"], true, (HideFlags)52, (Sprite)null, 114802, true);
			((Weapon)obj31.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj31.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj32 = UPool.MyPool.AddObject("Mossberg-L", (GameObject)SLMALoader.SDic["weapons"]["Mossberg"], true, (HideFlags)52, (Sprite)null, 154802, true);
			((Weapon)obj32.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj32.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj33 = UPool.MyPool.AddObject("Mp-40-L", (GameObject)SLMALoader.SDic["weapons"]["Mp-40"], true, (HideFlags)52, (Sprite)null, 164802, true);
			((Weapon)obj33.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj33.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj34 = UPool.MyPool.AddObject("Mp5k-L", (GameObject)SLMALoader.SDic["weapons"]["Mp5k"], true, (HideFlags)52, (Sprite)null, 145802, true);
			((Weapon)obj34.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj34.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj35 = UPool.MyPool.AddObject("P90-L", (GameObject)SLMALoader.SDic["weapons"]["P90"], true, (HideFlags)52, (Sprite)null, 121802, true);
			((Weapon)obj35.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj35.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj36 = UPool.MyPool.AddObject("Ppsh-L", (GameObject)SLMALoader.SDic["weapons"]["Ppsh"], true, (HideFlags)52, (Sprite)null, 101802, true);
			((Weapon)obj36.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj36.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj37 = UPool.MyPool.AddObject("Revolver_Python-L", (GameObject)SLMALoader.SDic["weapons"]["Revolver_Python"], true, (HideFlags)52, (Sprite)null, 107802, true);
			((Weapon)obj37.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj37.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj38 = UPool.MyPool.AddObject("Bow_Snake-L", (GameObject)SLMALoader.SDic["weapons"]["Bow_Snake"], true, (HideFlags)52, (Sprite)null, 1054102, true);
			((Weapon)obj38.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj38.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj39 = UPool.MyPool.AddObject("CatapultHwacha-L", (GameObject)SLMALoader.SDic["weapons"]["CatapultHwacha"], true, (HideFlags)52, (Sprite)null, 188782, true);
			((Weapon)obj39.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj39.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj40 = UPool.MyPool.AddObject("Scar-L", (GameObject)SLMALoader.SDic["weapons"]["Scar"], true, (HideFlags)52, (Sprite)null, 17782, true);
			((Weapon)obj40.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj40.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj41 = UPool.MyPool.AddObject("Tec-9-L", (GameObject)SLMALoader.SDic["weapons"]["Tec-9"], true, (HideFlags)52, (Sprite)null, 121782, true);
			((Weapon)obj41.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj41.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj42 = UPool.MyPool.AddObject("Thompson-L", (GameObject)SLMALoader.SDic["weapons"]["Thompson"], true, (HideFlags)52, (Sprite)null, 141782, true);
			((Weapon)obj42.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj42.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj43 = UPool.MyPool.AddObject("Vector-L", (GameObject)SLMALoader.SDic["weapons"]["Vector"], true, (HideFlags)52, (Sprite)null, 142782, true);
			((Weapon)obj43.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj43.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj44 = UPool.MyPool.AddObject("Vector_Automatic-L", (GameObject)SLMALoader.SDic["weapons"]["Vector_Automatic"], true, (HideFlags)52, (Sprite)null, 142792, true);
			((Weapon)obj44.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj44.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj45 = UPool.MyPool.AddObject("Vss-L", (GameObject)SLMALoader.SDic["weapons"]["Vss"], true, (HideFlags)52, (Sprite)null, 145792, true);
			((Weapon)obj45.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj45.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj46 = UPool.MyPool.AddObject("TANK-L", (GameObject)SLMALoader.SDic["weapons"]["Leg_TankShoot"], true, (HideFlags)52, (Sprite)null, 155492, true);
			((Weapon)obj46.GetComponentInChildren<RangeWeapon>()).maxRange = 1E+14f;
			((Weapon)obj46.GetComponentInChildren<RangeWeapon>()).attackSpeedM = 10000f;
			GameObject obj47 = UPool.MyPool.AddObject("远射弹", (GameObject)SLMALoader.SDic["projectiles"]["P_M16"], true, (HideFlags)52, (Sprite)null, 254401, true);
			obj47.GetComponentInChildren<MoveTransform>().gravity = 0f;
			obj47.GetComponentInChildren<RaycastTrail>().radius = 1000f;
			obj47.GetComponentInChildren<Compensation>().rangePow = -0.1f;
			obj47.GetComponentInChildren<ProjectileStick>().minWeight = -100f;
			obj47.GetComponentInChildren<ProjectileHit>().hitStop = 25f;
			obj47.GetComponentInChildren<ProjectileHit>().setSpeedOnHit = 100f;
			obj47.GetComponentInChildren<MoveTransform>().drag = 0f;
			GameObject obj48 = UPool.MyPool.AddObject("远射榴弹", (GameObject)SLMALoader.SDic["projectiles"]["P_MGL_Grende-"], true, (HideFlags)52, (Sprite)null, 474401, true);
			obj48.GetComponentInChildren<MoveTransform>().gravity = 0f;
			obj48.GetComponentInChildren<RaycastTrail>().radius = 1000f;
			obj48.GetComponentInChildren<Compensation>().rangePow = -0.1f;
			obj48.GetComponentInChildren<ProjectileStick>().minWeight = -100f;
			obj48.GetComponentInChildren<ProjectileHit>().hitStop = 25f;
			obj48.GetComponentInChildren<ProjectileHit>().setSpeedOnHit = 100f;
			obj48.GetComponentInChildren<MoveTransform>().drag = 0f;
			GameObject obj49 = UPool.MyPool.AddObject("远射破甲弹", (GameObject)SLMALoader.SDic["projectiles"]["P_Winchester--"], true, (HideFlags)52, (Sprite)null, 564401, true);
			obj49.GetComponentInChildren<MoveTransform>().gravity = 0f;
			obj49.GetComponentInChildren<RaycastTrail>().radius = 1000f;
			obj49.GetComponentInChildren<Compensation>().rangePow = -0.1f;
			obj49.GetComponentInChildren<ProjectileStick>().minWeight = -100f;
			obj49.GetComponentInChildren<ProjectileHit>().hitStop = 25f;
			obj49.GetComponentInChildren<ProjectileHit>().setSpeedOnHit = 100f;
			obj49.GetComponentInChildren<MoveTransform>().drag = 0f;
			com = "——————————Effects——————————";
			com = "——————————Explosions——————————";
			com = "——————————UnitBases——————————";
			com = "——————————Projectiles——————————";
			com = "——————————Moves——————————";
		}

		public static void EditWeapons(GameObject weapon, Team team, Unit unit, MeleeWeapon melee, RangeWeapon range, LandfallContentDatabase db)
		{
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Expected O, but got Unknown
			Debug.Log((object)weapon);
			if (unit.unitBlueprint.Entity.Name == "unit name")
			{
				MeshRenderer[] componentsInChildren = weapon.GetComponentsInChildren<MeshRenderer>();
				for (int i = 0; i < componentsInChildren.Length; i++)
				{
					((Renderer)componentsInChildren[i]).materials = (Material[])(object)new Material[1] { (Material)SLMALoader.SDic["materials"]["Glow_Neon_Red_212484"] };
				}
				range.numberOfObjects = 3;
				range.spread = 12f;
			}
		}
	}
	[BepInPlugin("modname", "modname", "1.0.0")]
	internal class Loader : BaseUnityPlugin
	{
		private void Awake()
		{
			((MonoBehaviour)this).StartCoroutine("call");
		}

		private IEnumerator call()
		{
			yield return (object)new WaitUntil((Func<bool>)(() => (Object)(object)Object.FindObjectOfType<ServiceLocator>() != (Object)null));
			yield return (object)new WaitUntil((Func<bool>)(() => ServiceLocator.GetService<ISaveLoaderService>() != null));
			yield return (object)new WaitForSecondsRealtime(0.3f);
			SLMALoader.GetInstance();
			LandfallContentDatabase landfallContentDatabase = ContentDatabase.Instance().LandfallContentDatabase;
			UManager.Init(landfallContentDatabase);
			new Harmony(UManager.modname).PatchAll();
			GOSLMA.EditWeapons = ((GOSLMA.EditWeapons == null) ? new Action<GameObject, Team, Unit, MeleeWeapon, RangeWeapon, LandfallContentDatabase>(UManager.EditWeapons) : ((Action<GameObject, Team, Unit, MeleeWeapon, RangeWeapon, LandfallContentDatabase>)Delegate.Combine(new Action<GameObject, Team, Unit, MeleeWeapon, RangeWeapon, LandfallContentDatabase>(UManager.EditWeapons), GOSLMA.EditWeapons)));
			GOSLMA.EditClothes = ((GOSLMA.EditClothes == null) ? new Action<GameObject, CharacterItem, PropItemData, Unit, int, LandfallContentDatabase>(UManager.EditClothes) : ((Action<GameObject, CharacterItem, PropItemData, Unit, int, LandfallContentDatabase>)Delegate.Combine(new Action<GameObject, CharacterItem, PropItemData, Unit, int, LandfallContentDatabase>(UManager.EditClothes), GOSLMA.EditClothes)));
			GOSLMA.EditCombatMoves = ((GOSLMA.EditCombatMoves == null) ? new Action<GameObject, int, Unit, LandfallContentDatabase>(UManager.EditCombatMoves) : ((Action<GameObject, int, Unit, LandfallContentDatabase>)Delegate.Combine(new Action<GameObject, int, Unit, LandfallContentDatabase>(UManager.EditCombatMoves), GOSLMA.EditCombatMoves)));
			GOSLMA.CodeAfterSpawn = ((GOSLMA.CodeAfterSpawn == null) ? new Action<Unit, LandfallContentDatabase>(UManager.CodeAfterSpawn) : ((Action<Unit, LandfallContentDatabase>)Delegate.Combine(new Action<Unit, LandfallContentDatabase>(UManager.CodeAfterSpawn), GOSLMA.CodeAfterSpawn)));
			GOSLMA.EditProjectiles = ((GOSLMA.EditProjectiles == null) ? new Action<GameObject, ProjectileHit, Unit, LandfallContentDatabase>(UManager.EditProjectiles) : ((Action<GameObject, ProjectileHit, Unit, LandfallContentDatabase>)Delegate.Combine(new Action<GameObject, ProjectileHit, Unit, LandfallContentDatabase>(UManager.EditProjectiles), GOSLMA.EditProjectiles)));
			UnitBlueprint[] array = Resources.FindObjectsOfTypeAll<UnitBlueprint>();
			for (int i = 0; i < array.Length; i++)
			{
				UManager.EditBlueprint(array[i], landfallContentDatabase);
			}
			Debug.Log((object)("Loaded " + UManager.modname + " Successfully"));
			Debug.Log((object)(UManager.modname + "is made in SFT by FhpSlime"));
			Debug.Log((object)(UManager.modder + "wished you a pleasant trip"));
		}
	}
}
public class Item : MonoBehaviour
{
	public enum kind
	{
		Weapon,
		Cloth,
		Skill,
		Unit,
		Projectile,
		Other
	}

	public string name;

	public kind Kind;
}
namespace Longrangeprojectile
{
	public class MyModItems : MonoBehaviour
	{
		private static Dictionary<string, Item> items;

		private static MyModItems instance { get; set; }

		public static MyModItems GetInstance()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)instance == (Object)null)
			{
				instance = new GameObject("MyModItems").AddComponent<MyModItems>();
				Object.DontDestroyOnLoad((Object)(object)instance);
			}
			return instance;
		}

		public void AddItem(Item item)
		{
			items.Add(item.name, item);
		}

		public Item GetItem(string name)
		{
			Item value = new Item
			{
				name = null,
				Kind = Item.kind.Other
			};
			items.TryGetValue(name, out value);
			return value;
		}
	}
}