using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
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 Landfall.TABS.AI.Components.Modifiers;
using Landfall.TABS.UnitEditor;
using SLMA;
using UnityEngine;
using UnityEngine.SceneManagement;
using WarhammerFunctions;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("Warhammer")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Warhammer")]
[assembly: AssemblyProduct("Warhammer")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("7acfaef0-7669-4401-8bff-5a9a02e18c75")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Warhammer
{
public static class UManager
{
public class Utility : MonoBehaviour
{
public static class PrimitiveHelper
{
private static Dictionary<PrimitiveType, Mesh> primitiveMeshes;
public static GameObject CreatePrimitive(PrimitiveType type, bool withCollider)
{
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: 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)
//IL_0035: Expected O, but got Unknown
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
if (withCollider)
{
return GameObject.CreatePrimitive(type);
}
GameObject val = new GameObject(((object)(PrimitiveType)(ref type)).ToString());
val.AddComponent<MeshFilter>().sharedMesh = GetPrimitiveMesh(type);
val.AddComponent<MeshRenderer>();
return val;
}
public static Mesh GetPrimitiveMesh(PrimitiveType type)
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
if (!primitiveMeshes.ContainsKey(type))
{
CreatePrimitiveMesh(type);
}
return primitiveMeshes[type];
}
private static Mesh CreatePrimitiveMesh(PrimitiveType type)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
GameObject obj = GameObject.CreatePrimitive(type);
Mesh sharedMesh = obj.GetComponent<MeshFilter>().sharedMesh;
Object.Destroy((Object)(object)obj);
primitiveMeshes[type] = sharedMesh;
return sharedMesh;
}
static PrimitiveHelper()
{
primitiveMeshes = new Dictionary<PrimitiveType, Mesh>();
}
}
public static GameObject LoadBundleGameObject(string name)
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Expected O, but got Unknown
return (GameObject)bundle.LoadAsset(name);
}
public static Material LoadBundleMaterial(string name)
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Expected O, but got Unknown
try
{
return (Material)bundle.LoadAsset(name);
}
catch (Exception ex)
{
Debug.Log((object)("Bundle Reference Name:" + name));
Debug.Log((object)ex);
return null;
}
}
public static Sprite LoadBundleTextureToSprite(string name)
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Expected O, but got Unknown
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
Texture2D val = (Texture2D)bundle.LoadAsset(name);
((Texture)val).filterMode = (FilterMode)0;
return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f));
}
public static Sprite LoadBundleSprite(string name)
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Expected O, but got Unknown
return (Sprite)bundle.LoadAsset(name);
}
public static void AddLocalization()
{
(string, string, string)[] array = new(string, string, string)[6]
{
("SCOUT_MARINE", "Scout Marines", "侦查连士兵"),
("MK6_WARRIOR", "MK6 Warrior", "MK6战士"),
("MK7_WARRIOR", "MK7 Warrior", "MK7战士"),
("MK8_WARRIOR", "MK8 Warrior", "MK8战士"),
("TERMINATOR_WARRIOR", "Terminator Warrior", "终结者战士"),
("CASTRAFERRUM_DREADNOUGHT", "Castraferrum Dreadnought", "铸铁无畏")
};
Dictionary<Language, Dictionary<string, string>> dictionary = (Dictionary<Language, Dictionary<string, string>>)typeof(Localizer).GetField("m_localization", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null);
try
{
for (int i = 0; i < array.Length; i++)
{
dictionary[(Language)0].Add(array[i].Item1, array[i].Item2);
dictionary[(Language)7].Add(array[i].Item1, array[i].Item3);
}
}
catch
{
}
}
}
private static string comment;
public static AssetBundle bundle;
public static UnitBlueprint[] unitBlueprints;
public static void SetBlueprint(UnitBlueprint unit, LandfallContentDatabase db)
{
//IL_0191: Unknown result type (might be due to invalid IL or missing references)
//IL_0197: Expected O, but got Unknown
//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
//IL_01b8: Expected O, but got Unknown
//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
//IL_01d9: Expected O, but got Unknown
//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
//IL_048f: Unknown result type (might be due to invalid IL or missing references)
//IL_0495: Expected O, but got Unknown
//IL_04b0: Unknown result type (might be due to invalid IL or missing references)
//IL_04b6: Expected O, but got Unknown
//IL_04d1: Unknown result type (might be due to invalid IL or missing references)
//IL_04d7: Expected O, but got Unknown
//IL_04f2: Unknown result type (might be due to invalid IL or missing references)
//IL_04f8: Expected O, but got Unknown
//IL_0513: Unknown result type (might be due to invalid IL or missing references)
//IL_0519: Expected O, but got Unknown
//IL_0534: Unknown result type (might be due to invalid IL or missing references)
//IL_053a: Expected O, but got Unknown
//IL_0548: Unknown result type (might be due to invalid IL or missing references)
//IL_054e: Unknown result type (might be due to invalid IL or missing references)
//IL_0803: Unknown result type (might be due to invalid IL or missing references)
//IL_0809: Expected O, but got Unknown
//IL_0824: Unknown result type (might be due to invalid IL or missing references)
//IL_082a: Expected O, but got Unknown
//IL_0838: Unknown result type (might be due to invalid IL or missing references)
//IL_083e: Unknown result type (might be due to invalid IL or missing references)
//IL_0acd: Unknown result type (might be due to invalid IL or missing references)
//IL_0ad3: Expected O, but got Unknown
//IL_0aee: Unknown result type (might be due to invalid IL or missing references)
//IL_0af4: Expected O, but got Unknown
//IL_0b0f: Unknown result type (might be due to invalid IL or missing references)
//IL_0b15: Expected O, but got Unknown
//IL_0b30: Unknown result type (might be due to invalid IL or missing references)
//IL_0b36: Expected O, but got Unknown
//IL_0b51: Unknown result type (might be due to invalid IL or missing references)
//IL_0b57: Expected O, but got Unknown
//IL_0b89: Unknown result type (might be due to invalid IL or missing references)
//IL_0b8f: Unknown result type (might be due to invalid IL or missing references)
//IL_0d30: Unknown result type (might be due to invalid IL or missing references)
//IL_0d36: Expected O, but got Unknown
//IL_0d51: Unknown result type (might be due to invalid IL or missing references)
//IL_0d57: Expected O, but got Unknown
//IL_0d72: Unknown result type (might be due to invalid IL or missing references)
//IL_0d78: Expected O, but got Unknown
//IL_0d86: Unknown result type (might be due to invalid IL or missing references)
//IL_0d8c: Unknown result type (might be due to invalid IL or missing references)
//IL_0ed9: Unknown result type (might be due to invalid IL or missing references)
//IL_0edf: Expected O, but got Unknown
//IL_0efa: Unknown result type (might be due to invalid IL or missing references)
//IL_0f00: Expected O, but got Unknown
//IL_0f0e: Unknown result type (might be due to invalid IL or missing references)
//IL_0f14: Unknown result type (might be due to invalid IL or missing references)
if (unit.Entity.Name == "SCOUT_MARINE")
{
SLMATool.UnitCost(unit, 500);
unit.UnitBase = UPool.MyPool.GetObject("Humanoid_Astarte_Base");
s.SetField<UnitBlueprint>(unit, "VocalRef", (object)"Medieval Attack Vocals/Knight");
s.SetField<UnitBlueprint>(unit, "DeathRef", (object)"Medieval Death Vocals/Knight");
s.SetField<UnitBlueprint>(unit, "footRef", (object)"Footsteps/Big");
s.SetField<UnitBlueprint>(unit, "VoicePitch", (object)0.8f);
unit.health = 900f;
unit.minSizeRandom = 1f;
unit.maxSizeRandom = 1f;
unit.sizeMultiplier = 1f;
unit.stepMultiplier = 1.4f;
unit.massMultiplier = 20f;
unit.balanceMultiplier = 1.4f;
unit.animationMultiplier = 1.2f;
unit.balanceForceMultiplier = 1.2f;
unit.movementSpeedMuiltiplier = 1.2f;
unit.LeftWeapon = UPool.MyPool.GetObject("CombatKnife");
unit.RightWeapon = UPool.MyPool.GetObject("CombatKnife");
unit.m_props = (GameObject[])(object)new GameObject[4]
{
UPool.MyPool.GetObject("MicComms"),
UPool.MyPool.GetObject("AstartePreparationGears"),
UPool.MyPool.GetObject("ScoutShoulderArmor"),
UPool.MyPool.GetObject("ReconnaissanceCompanySoldiersSuit")
};
unit.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[3]
{
(GameObject)SLMALoader.SDic["moves"]["Dragoncarrier_Walk"],
(GameObject)SLMALoader.SDic["moves"]["Fencer_Dodge"],
(GameObject)SLMALoader.SDic["moves"]["SwordArtParry"]
};
unit.MovementComponents = new List<IMovementComponent> { (IMovementComponent)(object)default(KeepPreferredDistance) };
}
if (unit.Entity.Name == "MK8_WARRIOR")
{
SLMATool.UnitCost(unit, 800);
unit.UnitBase = UPool.MyPool.GetObject("Humanoid_Astarte_Base");
s.SetField<UnitBlueprint>(unit, "VocalRef", (object)"Medieval Attack Vocals/TheKing");
s.SetField<UnitBlueprint>(unit, "DeathRef", (object)"Medieval Death Vocals/TheKing");
s.SetField<UnitBlueprint>(unit, "footRef", (object)"Footsteps/Big");
s.SetField<UnitBlueprint>(unit, "VoicePitch", (object)0.75f);
unit.health = 1500f;
unit.minSizeRandom = 1f;
unit.maxSizeRandom = 1f;
unit.sizeMultiplier = 1f;
unit.stepMultiplier = 1.4f;
unit.massMultiplier = 20f;
unit.balanceMultiplier = 1.4f;
unit.animationMultiplier = 1.2f;
unit.balanceForceMultiplier = 1.2f;
unit.movementSpeedMuiltiplier = 1.35f;
unit.holdinigWithTwoHands = true;
unit.RightWeapon = UPool.MyPool.GetObject("PowerSword");
unit.m_props = (GameObject[])(object)new GameObject[19]
{
Utility.LoadBundleGameObject("MK8ShoulderArmorPatternLeft"),
Utility.LoadBundleGameObject("MK8ShoulderArmorPatternRight"),
UPool.MyPool.GetObject("ElectronicMuscleSuits"),
UPool.MyPool.GetObject("WarhammerBoots"),
UPool.MyPool.GetObject("MK8ChestArmor"),
UPool.MyPool.GetObject("MK8KneeArmor"),
UPool.MyPool.GetObject("MK8StomachArmor"),
UPool.MyPool.GetObject("MK7BigShoulderArmor"),
UPool.MyPool.GetObject("MK7ArmorBelt"),
UPool.MyPool.GetObject("MK7ElbowJointArmor"),
UPool.MyPool.GetObject("MK7ElbowJointCover"),
UPool.MyPool.GetObject("MK7HandArmor"),
UPool.MyPool.GetObject("MK7Helmet"),
UPool.MyPool.GetObject("MK7KneeJointCover"),
UPool.MyPool.GetObject("MK7LowerElbowArmor"),
UPool.MyPool.GetObject("MK7StomachArmor"),
UPool.MyPool.GetObject("MK7ThighArmor"),
UPool.MyPool.GetObject("MK7Jetpack"),
UPool.MyPool.GetObject("MK7UpperElbowArmor")
};
unit.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[6]
{
(GameObject)SLMALoader.SDic["moves"]["Dragoncarrier_Walk"],
(GameObject)SLMALoader.SDic["moves"]["Dodge"],
(GameObject)SLMALoader.SDic["moves"]["Head_up"],
(GameObject)SLMALoader.SDic["moves"]["Halberd_Walk"],
(GameObject)SLMALoader.SDic["moves"]["SwordArtParry"],
(GameObject)SLMALoader.SDic["moves"]["BlockSlow"]
};
unit.MovementComponents = new List<IMovementComponent> { (IMovementComponent)(object)default(KeepPreferredDistance) };
}
if (unit.Entity.Name == "MK7_WARRIOR")
{
SLMATool.UnitCost(unit, 900);
unit.UnitBase = UPool.MyPool.GetObject("Humanoid_Astarte_Base");
s.SetField<UnitBlueprint>(unit, "VocalRef", (object)"Medieval Attack Vocals/TheKing");
s.SetField<UnitBlueprint>(unit, "DeathRef", (object)"Medieval Death Vocals/TheKing");
s.SetField<UnitBlueprint>(unit, "footRef", (object)"Footsteps/Big");
s.SetField<UnitBlueprint>(unit, "VoicePitch", (object)0.75f);
unit.health = 700f;
unit.minSizeRandom = 1f;
unit.maxSizeRandom = 1f;
unit.sizeMultiplier = 1f;
unit.stepMultiplier = 1.4f;
unit.massMultiplier = 20f;
unit.balanceMultiplier = 1.4f;
unit.animationMultiplier = 1.2f;
unit.balanceForceMultiplier = 1.2f;
unit.movementSpeedMuiltiplier = 1.2f;
unit.holdinigWithTwoHands = true;
unit.RightWeapon = UPool.MyPool.GetObject("Bolter");
unit.m_props = (GameObject[])(object)new GameObject[20]
{
Utility.LoadBundleGameObject("MK7ShoulderArmorPatternLeft"),
Utility.LoadBundleGameObject("MK7ShoulderArmorPatternRight"),
UPool.MyPool.GetObject("ElectronicMuscleSuits"),
UPool.MyPool.GetObject("MK7ArmorBelt"),
UPool.MyPool.GetObject("MK7BigShoulderArmor"),
UPool.MyPool.GetObject("MK7Boot"),
UPool.MyPool.GetObject("MK7ChestArmor"),
UPool.MyPool.GetObject("MK7ChestCrest"),
UPool.MyPool.GetObject("MK7ElbowJointArmor"),
UPool.MyPool.GetObject("MK7ElbowJointCover"),
UPool.MyPool.GetObject("MK7HandArmor"),
UPool.MyPool.GetObject("MK7Helmet"),
UPool.MyPool.GetObject("MK7Jetpack"),
UPool.MyPool.GetObject("MK7KneeArmor"),
UPool.MyPool.GetObject("MK7KneeJointCover"),
UPool.MyPool.GetObject("MK7LowerElbowArmor"),
UPool.MyPool.GetObject("MK7SmallShoulderArmor"),
UPool.MyPool.GetObject("MK7StomachArmor"),
UPool.MyPool.GetObject("MK7ThighArmor"),
UPool.MyPool.GetObject("MK7UpperElbowArmor")
};
unit.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[2]
{
(GameObject)SLMALoader.SDic["moves"]["Dragoncarrier_Walk"],
(GameObject)SLMALoader.SDic["moves"]["Dodge"]
};
unit.MovementComponents = new List<IMovementComponent> { (IMovementComponent)(object)default(KeepRangedDistance) };
}
if (unit.Entity.Name == "MK6_WARRIOR")
{
SLMATool.UnitCost(unit, 1100);
unit.UnitBase = UPool.MyPool.GetObject("Humanoid_Astarte_Base");
s.SetField<UnitBlueprint>(unit, "VocalRef", (object)"Medieval Attack Vocals/TheKing");
s.SetField<UnitBlueprint>(unit, "DeathRef", (object)"Medieval Death Vocals/TheKing");
s.SetField<UnitBlueprint>(unit, "footRef", (object)"Footsteps/Big");
s.SetField<UnitBlueprint>(unit, "VoicePitch", (object)0.75f);
unit.health = 1000f;
unit.minSizeRandom = 1f;
unit.maxSizeRandom = 1f;
unit.sizeMultiplier = 1f;
unit.stepMultiplier = 1.4f;
unit.massMultiplier = 20f;
unit.balanceMultiplier = 1.4f;
unit.animationMultiplier = 1.2f;
unit.balanceForceMultiplier = 1.2f;
unit.movementSpeedMuiltiplier = 1.2f;
unit.LeftWeapon = UPool.MyPool.GetObject("CombatKnife");
unit.RightWeapon = UPool.MyPool.GetObject("BolterPistol");
unit.m_props = (GameObject[])(object)new GameObject[17]
{
Utility.LoadBundleGameObject("MK6ShoulderArmorPattern"),
UPool.MyPool.GetObject("ElectronicMuscleSuits"),
UPool.MyPool.GetObject("WarhammerBoots"),
UPool.MyPool.GetObject("MK6Backpack"),
UPool.MyPool.GetObject("MK6Belts"),
UPool.MyPool.GetObject("MK6ChestArmor"),
UPool.MyPool.GetObject("MK6Helmet"),
UPool.MyPool.GetObject("MK6KneeArmor"),
UPool.MyPool.GetObject("MK6ShoulderArmor"),
UPool.MyPool.GetObject("MK6StomachArmor"),
UPool.MyPool.GetObject("MK7ElbowJointArmor"),
UPool.MyPool.GetObject("MK7ElbowJointCover"),
UPool.MyPool.GetObject("MK7HandArmor"),
UPool.MyPool.GetObject("MK7KneeJointCover"),
UPool.MyPool.GetObject("MK7LowerElbowArmor"),
UPool.MyPool.GetObject("MK7ThighArmor"),
UPool.MyPool.GetObject("MK7UpperElbowArmor")
};
unit.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[7]
{
(GameObject)SLMALoader.SDic["moves"]["Dragoncarrier_Walk"],
(GameObject)SLMALoader.SDic["moves"]["ProjectileDodge_Cool2"],
(GameObject)SLMALoader.SDic["moves"]["Fencer_Dodge"],
(GameObject)SLMALoader.SDic["moves"]["SwordArtParry"],
(GameObject)SLMALoader.SDic["moves"]["Dodge"],
UPool.MyPool.GetObject("JetCrash"),
UPool.MyPool.GetObject("JetHover")
};
unit.MovementComponents = new List<IMovementComponent> { (IMovementComponent)(object)default(NeverStopRunning) };
}
if (unit.Entity.Name == "TERMINATOR_WARRIOR")
{
SLMATool.UnitCost(unit, 2500);
unit.UnitBase = UPool.MyPool.GetObject("Humanoid_Astarte_Base");
s.SetField<UnitBlueprint>(unit, "VocalRef", (object)"Medieval Attack Vocals/TheKing");
s.SetField<UnitBlueprint>(unit, "DeathRef", (object)"Medieval Death Vocals/TheKing");
s.SetField<UnitBlueprint>(unit, "footRef", (object)"Footsteps/Big");
s.SetField<UnitBlueprint>(unit, "VoicePitch", (object)0.75f);
unit.health = 3000f;
unit.minSizeRandom = 1f;
unit.maxSizeRandom = 1f;
unit.sizeMultiplier = 1f;
unit.stepMultiplier = 1.4f;
unit.massMultiplier = 20f;
unit.balanceMultiplier = 1.4f;
unit.animationMultiplier = 1.2f;
unit.balanceForceMultiplier = 1.2f;
unit.movementSpeedMuiltiplier = 1.2f;
unit.LeftWeapon = UPool.MyPool.GetObject("StrongPunchTerminator");
unit.RightWeapon = UPool.MyPool.GetObject("TerminatorMinigun");
unit.m_props = (GameObject[])(object)new GameObject[4]
{
UPool.MyPool.GetObject("ElectronicMuscleSuits"),
UPool.MyPool.GetObject("TerminatorArmorAddons"),
UPool.MyPool.GetObject("TerminatorHelmet"),
UPool.MyPool.GetObject("TerminatorArmorSuit")
};
unit.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[3]
{
(GameObject)SLMALoader.SDic["moves"]["Dragoncarrier_Walk"],
(GameObject)SLMALoader.SDic["moves"]["Halberd_Walk"],
(GameObject)SLMALoader.SDic["moves"]["Dodge"]
};
unit.MovementComponents = new List<IMovementComponent> { (IMovementComponent)(object)default(KeepRangedDistance) };
}
if (unit.Entity.Name == "CASTRAFERRUM_DREADNOUGHT")
{
SLMATool.UnitCost(unit, 10000);
unit.UnitBase = UPool.MyPool.GetObject("Dreadnought_Unit_Base");
s.SetField<UnitBlueprint>(unit, "VocalRef", (object)"Halloween Attack Vocals/Reaper");
s.SetField<UnitBlueprint>(unit, "DeathRef", (object)"Halloween Death Vocals/Reaper");
s.SetField<UnitBlueprint>(unit, "footRef", (object)"Footsteps/Mammoth");
s.SetField<UnitBlueprint>(unit, "VoicePitch", (object)0.65f);
unit.health = 100000f;
unit.minSizeRandom = 1f;
unit.maxSizeRandom = 1f;
unit.sizeMultiplier = 1f;
unit.stepMultiplier = 1.4f;
unit.massMultiplier = 100f;
unit.balanceMultiplier = 1.4f;
unit.animationMultiplier = 1.2f;
unit.balanceForceMultiplier = 1.2f;
unit.movementSpeedMuiltiplier = 1.2f;
unit.LeftWeapon = UPool.MyPool.GetObject("StrongClawDreadnought");
unit.RightWeapon = UPool.MyPool.GetObject("TwinHeavyLaserCannons");
unit.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[2]
{
(GameObject)SLMALoader.SDic["moves"]["Small_Hover"],
(GameObject)SLMALoader.SDic["moves"]["SwordArtParry_Piratequeen"]
};
unit.MovementComponents = new List<IMovementComponent> { (IMovementComponent)(object)default(NeverStopRunning) };
}
comment = "------------------------------------------------------------------------------------------------------------------------------------------------------------------------";
comment = "Unit Base Option";
comment = "------------------------------------------------------------------------------------------------------------------------------------------------------------------------";
if (unit.Entity.Name == "AstarteUnitBase")
{
SLMATool.UnitCost(unit, 1000);
unit.UnitBase = UPool.MyPool.GetObject("Humanoid_Astarte_Base");
s.SetField<UnitBlueprint>(unit, "footRef", (object)"Footsteps/Big");
s.SetField<UnitBlueprint>(unit, "VoicePitch", (object)0.75f);
unit.health = 800f;
unit.minSizeRandom = 1f;
unit.maxSizeRandom = 1f;
unit.sizeMultiplier = 1f;
unit.stepMultiplier = 1.4f;
unit.massMultiplier = 20f;
unit.balanceMultiplier = 1.4f;
unit.animationMultiplier = 1.2f;
unit.balanceForceMultiplier = 1.2f;
unit.movementSpeedMuiltiplier = 1.2f;
}
if (unit.Entity.Name == "DreadnoughtUnitBase")
{
SLMATool.UnitCost(unit, 3000);
unit.UnitBase = UPool.MyPool.GetObject("Dreadnought_Unit_Base");
s.SetField<UnitBlueprint>(unit, "footRef", (object)"Footsteps/Big");
s.SetField<UnitBlueprint>(unit, "VoicePitch", (object)0.75f);
unit.health = 1800f;
unit.minSizeRandom = 1f;
unit.maxSizeRandom = 1f;
unit.sizeMultiplier = 1f;
unit.stepMultiplier = 1.4f;
unit.massMultiplier = 100f;
unit.balanceMultiplier = 1.4f;
unit.animationMultiplier = 1.2f;
unit.balanceForceMultiplier = 1.2f;
unit.movementSpeedMuiltiplier = 1.2f;
}
}
public static void SetClothes(GameObject cloth, CharacterItem item, PropItemData data, LandfallContentDatabase db)
{
}
public static void SetMoves(GameObject move, LandfallContentDatabase db)
{
}
public static void SetUnits(Unit unit, LandfallContentDatabase db)
{
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
if (((Object)((Component)unit).gameObject).name == ((Object)UPool.MyPool.GetObject("Humanoid_Astarte_Base")).name)
{
Transform transform = ((Component)unit).transform;
transform.localScale *= 1.25f;
SkinnedMeshRenderer[] componentsInChildren = ((Component)unit).GetComponentsInChildren<SkinnedMeshRenderer>();
for (int i = 0; i < componentsInChildren.Length; i++)
{
((Component)componentsInChildren[i]).gameObject.tag = "UnitMesh";
}
}
}
public static void Init(LandfallContentDatabase db)
{
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_09ac: Unknown result type (might be due to invalid IL or missing references)
//IL_09f0: Unknown result type (might be due to invalid IL or missing references)
//IL_0a16: Unknown result type (might be due to invalid IL or missing references)
//IL_0a33: Unknown result type (might be due to invalid IL or missing references)
//IL_0a45: Unknown result type (might be due to invalid IL or missing references)
//IL_0a68: Unknown result type (might be due to invalid IL or missing references)
//IL_0a6d: Unknown result type (might be due to invalid IL or missing references)
//IL_0a83: Unknown result type (might be due to invalid IL or missing references)
//IL_0a85: Unknown result type (might be due to invalid IL or missing references)
//IL_0a8e: Unknown result type (might be due to invalid IL or missing references)
//IL_0ab1: Unknown result type (might be due to invalid IL or missing references)
//IL_0ab6: Unknown result type (might be due to invalid IL or missing references)
//IL_0acc: Unknown result type (might be due to invalid IL or missing references)
//IL_0ace: Unknown result type (might be due to invalid IL or missing references)
//IL_0ad7: Unknown result type (might be due to invalid IL or missing references)
//IL_0afa: Unknown result type (might be due to invalid IL or missing references)
//IL_0aff: Unknown result type (might be due to invalid IL or missing references)
//IL_0b15: Unknown result type (might be due to invalid IL or missing references)
//IL_0b17: Unknown result type (might be due to invalid IL or missing references)
//IL_0b20: Unknown result type (might be due to invalid IL or missing references)
//IL_0b43: Unknown result type (might be due to invalid IL or missing references)
//IL_0b48: Unknown result type (might be due to invalid IL or missing references)
//IL_0b5e: Unknown result type (might be due to invalid IL or missing references)
//IL_0b60: Unknown result type (might be due to invalid IL or missing references)
//IL_0b69: Unknown result type (might be due to invalid IL or missing references)
//IL_0b8c: Unknown result type (might be due to invalid IL or missing references)
//IL_0b91: Unknown result type (might be due to invalid IL or missing references)
//IL_0ba7: Unknown result type (might be due to invalid IL or missing references)
//IL_0ba9: Unknown result type (might be due to invalid IL or missing references)
//IL_0bb2: Unknown result type (might be due to invalid IL or missing references)
//IL_0bd5: Unknown result type (might be due to invalid IL or missing references)
//IL_0bda: Unknown result type (might be due to invalid IL or missing references)
//IL_0bf0: Unknown result type (might be due to invalid IL or missing references)
//IL_0bf2: Unknown result type (might be due to invalid IL or missing references)
//IL_0bfb: Unknown result type (might be due to invalid IL or missing references)
//IL_0c1e: Unknown result type (might be due to invalid IL or missing references)
//IL_0c23: Unknown result type (might be due to invalid IL or missing references)
//IL_0c39: Unknown result type (might be due to invalid IL or missing references)
//IL_0c3b: Unknown result type (might be due to invalid IL or missing references)
//IL_0c44: Unknown result type (might be due to invalid IL or missing references)
//IL_0c67: Unknown result type (might be due to invalid IL or missing references)
//IL_0c6c: Unknown result type (might be due to invalid IL or missing references)
//IL_0c82: Unknown result type (might be due to invalid IL or missing references)
//IL_0c84: Unknown result type (might be due to invalid IL or missing references)
//IL_0c8d: Unknown result type (might be due to invalid IL or missing references)
//IL_0cb0: Unknown result type (might be due to invalid IL or missing references)
//IL_0cb5: Unknown result type (might be due to invalid IL or missing references)
//IL_0ccb: Unknown result type (might be due to invalid IL or missing references)
//IL_0ccd: Unknown result type (might be due to invalid IL or missing references)
//IL_0cd7: Unknown result type (might be due to invalid IL or missing references)
//IL_0cfa: Unknown result type (might be due to invalid IL or missing references)
//IL_0cff: Unknown result type (might be due to invalid IL or missing references)
//IL_0d15: Unknown result type (might be due to invalid IL or missing references)
//IL_0d17: Unknown result type (might be due to invalid IL or missing references)
//IL_0d21: Unknown result type (might be due to invalid IL or missing references)
//IL_0d44: Unknown result type (might be due to invalid IL or missing references)
//IL_0d49: Unknown result type (might be due to invalid IL or missing references)
//IL_0d5f: Unknown result type (might be due to invalid IL or missing references)
//IL_0d61: Unknown result type (might be due to invalid IL or missing references)
//IL_0d6b: Unknown result type (might be due to invalid IL or missing references)
//IL_0d8e: Unknown result type (might be due to invalid IL or missing references)
//IL_0d93: Unknown result type (might be due to invalid IL or missing references)
//IL_0da9: Unknown result type (might be due to invalid IL or missing references)
//IL_0dab: Unknown result type (might be due to invalid IL or missing references)
//IL_0db5: Unknown result type (might be due to invalid IL or missing references)
//IL_0dd8: Unknown result type (might be due to invalid IL or missing references)
//IL_0ddd: Unknown result type (might be due to invalid IL or missing references)
//IL_0df3: Unknown result type (might be due to invalid IL or missing references)
//IL_0df5: Unknown result type (might be due to invalid IL or missing references)
//IL_0dff: Unknown result type (might be due to invalid IL or missing references)
//IL_0e22: Unknown result type (might be due to invalid IL or missing references)
//IL_0e27: Unknown result type (might be due to invalid IL or missing references)
//IL_0e3d: Unknown result type (might be due to invalid IL or missing references)
//IL_0e3f: Unknown result type (might be due to invalid IL or missing references)
//IL_0e49: Unknown result type (might be due to invalid IL or missing references)
//IL_0e6c: Unknown result type (might be due to invalid IL or missing references)
//IL_0e71: Unknown result type (might be due to invalid IL or missing references)
//IL_0e87: Unknown result type (might be due to invalid IL or missing references)
//IL_0e89: Unknown result type (might be due to invalid IL or missing references)
//IL_0e93: Unknown result type (might be due to invalid IL or missing references)
//IL_0e95: Unknown result type (might be due to invalid IL or missing references)
//IL_0e9f: Unknown result type (might be due to invalid IL or missing references)
//IL_0ea1: Unknown result type (might be due to invalid IL or missing references)
//IL_0ea4: Unknown result type (might be due to invalid IL or missing references)
LoadBundle("warhammerbundles");
Sprite val = Utility.LoadBundleTextureToSprite("UltramarinesBadge1");
comment = "----------------------------------------------------------------------------------------------------------------------------";
comment = "Create Custom Faction";
comment = "----------------------------------------------------------------------------------------------------------------------------";
Faction val2 = SLMATool.CreateFaction("Warhammer", (UnitBlueprint[])null, val, 332421);
val2.m_FactionColor = new Color(0f, 0f, 0.2f);
comment = "----------------------------------------------------------------------------------------------------------------------------";
comment = "Create Custom Units";
comment = "----------------------------------------------------------------------------------------------------------------------------";
SLMATool.CreateUnit("SCOUT_MARINE", (UnitBlueprint)null, val2, val);
SLMATool.CreateUnit("MK6_WARRIOR", (UnitBlueprint)null, val2, val);
SLMATool.CreateUnit("MK7_WARRIOR", (UnitBlueprint)null, val2, val);
SLMATool.CreateUnit("MK8_WARRIOR", (UnitBlueprint)null, val2, val);
SLMATool.CreateUnit("TERMINATOR_WARRIOR", (UnitBlueprint)null, val2, val);
SLMATool.CreateUnit("CASTRAFERRUM_DREADNOUGHT", (UnitBlueprint)null, val2, Utility.LoadBundleTextureToSprite("yellowlogo"));
comment = "----------------------------------------------------------------------------------------------------------------------------";
comment = "Custom Weapons";
comment = "----------------------------------------------------------------------------------------------------------------------------";
UPool.MyPool.AddObject("Bolter", Utility.LoadBundleGameObject("Bolter"), true, (HideFlags)52, val, 523432, true);
UPool.MyPool.AddObject("BolterPistol", Utility.LoadBundleGameObject("BolterPistol"), true, (HideFlags)52, val, 634544, true);
UPool.MyPool.AddObject("CombatKnife", Utility.LoadBundleGameObject("CombatKnife"), true, (HideFlags)52, val, 421321, true);
UPool.MyPool.AddObject("PowerSword", Utility.LoadBundleGameObject("PowerSword"), true, (HideFlags)52, val, 6345434, true);
UPool.MyPool.AddObject("StrongPunchTerminator", Utility.LoadBundleGameObject("StrongPunchTerminator"), true, (HideFlags)52, val, 84563245, true);
UPool.MyPool.AddObject("TerminatorMinigun", Utility.LoadBundleGameObject("TerminatorMinigun"), true, (HideFlags)52, val, 3562353, true);
UPool.MyPool.AddObject("StrongClawDreadnought", Utility.LoadBundleGameObject("StrongClawDreadnought"), true, (HideFlags)52, val, 6234324, true);
UPool.MyPool.AddObject("TwinHeavyLaserCannons", Utility.LoadBundleGameObject("TwinHeavyLaserCannons"), true, (HideFlags)52, val, 7625324, true);
comment = "----------------------------------------------------------------------------------------------------------------------------";
comment = "Custom Clothing";
comment = "----------------------------------------------------------------------------------------------------------------------------";
comment = "MK6";
UPool.MyPool.AddObject("MK6Backpack", Utility.LoadBundleGameObject("MK6Backpack"), true, (HideFlags)52, val, 5642341, true);
UPool.MyPool.AddObject("MK6Belts", Utility.LoadBundleGameObject("MK6Belts"), true, (HideFlags)52, val, 3644321, true);
UPool.MyPool.AddObject("MK6ChestArmor", Utility.LoadBundleGameObject("MK6ChestArmor"), true, (HideFlags)52, val, 6234322, true);
UPool.MyPool.AddObject("MK6Helmet", Utility.LoadBundleGameObject("MK6Helmet"), true, (HideFlags)52, val, 7456454, true);
UPool.MyPool.AddObject("MK6KneeArmor", Utility.LoadBundleGameObject("MK6KneeArmor"), true, (HideFlags)52, val, 6345323, true);
UPool.MyPool.AddObject("MK6ShoulderArmor", Utility.LoadBundleGameObject("MK6ShoulderArmor"), true, (HideFlags)52, val, 754634, true);
UPool.MyPool.AddObject("MK6StomachArmor", Utility.LoadBundleGameObject("MK6StomachArmor"), true, (HideFlags)52, val, 7343542, true);
comment = "MK7";
UPool.MyPool.AddObject("MK7ArmorBelt", Utility.LoadBundleGameObject("MK7ArmorBelt"), true, (HideFlags)52, val, 987654321, true);
UPool.MyPool.AddObject("MK7BigShoulderArmor", Utility.LoadBundleGameObject("MK7BigShoulderArmor"), true, (HideFlags)52, val, 123456789, true);
UPool.MyPool.AddObject("MK7Boot", Utility.LoadBundleGameObject("MK7Boot"), true, (HideFlags)52, val, 456789012, true);
UPool.MyPool.AddObject("MK7ChestArmor", Utility.LoadBundleGameObject("MK7ChestArmor"), true, (HideFlags)52, val, 789012345, true);
UPool.MyPool.AddObject("MK7ChestCrest", Utility.LoadBundleGameObject("MK7ChestCrest"), true, (HideFlags)52, val, 234567890, true);
UPool.MyPool.AddObject("MK7ElbowJointArmor", Utility.LoadBundleGameObject("MK7ElbowJointArmor"), true, (HideFlags)52, val, 567890123, true);
UPool.MyPool.AddObject("MK7ElbowJointCover", Utility.LoadBundleGameObject("MK7ElbowJointCover"), true, (HideFlags)52, val, 890123456, true);
UPool.MyPool.AddObject("MK7HandArmor", Utility.LoadBundleGameObject("MK7HandArmor"), true, (HideFlags)52, val, 345678901, true);
UPool.MyPool.AddObject("MK7Helmet", Utility.LoadBundleGameObject("MK7Helmet"), true, (HideFlags)52, val, 678901234, true);
UPool.MyPool.AddObject("MK7Jetpack", Utility.LoadBundleGameObject("MK7Jetpack"), true, (HideFlags)52, val, 901234567, true);
UPool.MyPool.AddObject("MK7KneeArmor", Utility.LoadBundleGameObject("MK7KneeArmor"), true, (HideFlags)52, val, 123789456, true);
UPool.MyPool.AddObject("MK7KneeJointCover", Utility.LoadBundleGameObject("MK7KneeJointCover"), true, (HideFlags)52, val, 234567891, true);
UPool.MyPool.AddObject("MK7LowerElbowArmor", Utility.LoadBundleGameObject("MK7LowerElbowArmor"), true, (HideFlags)52, val, 345678902, true);
UPool.MyPool.AddObject("MK7SmallShoulderArmor", Utility.LoadBundleGameObject("MK7SmallShoulderArmor"), true, (HideFlags)52, val, 456789013, true);
UPool.MyPool.AddObject("MK7StomachArmor", Utility.LoadBundleGameObject("MK7StomachArmor"), true, (HideFlags)52, val, 567890122, true);
UPool.MyPool.AddObject("MK7ThighArmor", Utility.LoadBundleGameObject("MK7ThighArmor"), true, (HideFlags)52, val, 678901235, true);
UPool.MyPool.AddObject("MK7UpperElbowArmor", Utility.LoadBundleGameObject("MK7UpperElbowArmor"), true, (HideFlags)52, val, 789012346, true);
comment = "MK8";
UPool.MyPool.AddObject("MK8ChestArmor", Utility.LoadBundleGameObject("MK8ChestArmor"), true, (HideFlags)52, val, 6343232, true);
UPool.MyPool.AddObject("MK8KneeArmor", Utility.LoadBundleGameObject("MK8KneeArmor"), true, (HideFlags)52, val, 8456445, true);
UPool.MyPool.AddObject("MK8StomachArmor", Utility.LoadBundleGameObject("MK8StomachArmor"), true, (HideFlags)52, val, 6433534, true);
comment = "Terminator";
UPool.MyPool.AddObject("TerminatorArmorAddons", Utility.LoadBundleGameObject("TerminatorArmorAddons"), true, (HideFlags)52, val, 7834354, true);
UPool.MyPool.AddObject("TerminatorHelmet", Utility.LoadBundleGameObject("TerminatorHelmet"), true, (HideFlags)52, val, 64332431, true);
UPool.MyPool.AddObject("TerminatorArmorSuit", Utility.LoadBundleGameObject("TerminatorArmorSuit"), true, (HideFlags)52, val, 6435212, true);
comment = "CompanySoldiers";
UPool.MyPool.AddObject("MicComms", Utility.LoadBundleGameObject("MicComms"), true, (HideFlags)52, val, 3254523, true);
UPool.MyPool.AddObject("AstartePreparationGears", Utility.LoadBundleGameObject("AstartePreparationGears"), true, (HideFlags)52, val, 642532, true);
UPool.MyPool.AddObject("ScoutShoulderArmor", Utility.LoadBundleGameObject("ScoutShoulderArmor"), true, (HideFlags)52, val, 745243, true);
UPool.MyPool.AddObject("ReconnaissanceCompanySoldiersSuit", Utility.LoadBundleGameObject("ReconnaissanceCompanySoldiersSuit"), true, (HideFlags)52, val, 5642324, true);
comment = "General Armor";
UPool.MyPool.AddObject("ElectronicMuscleSuits", Utility.LoadBundleGameObject("ElectronicMuscleSuits"), true, (HideFlags)52, val, 6345412, true);
UPool.MyPool.AddObject("WarhammerShoulderMedalsInner", Utility.LoadBundleGameObject("WarhammerShoulderMedalsInner"), true, (HideFlags)52, val, 6345342, true);
UPool.MyPool.AddObject("WarhammerShoulderMedalsLeft", Utility.LoadBundleGameObject("WarhammerShoulderMedalsLeft"), true, (HideFlags)52, val, 6345343, true);
UPool.MyPool.AddObject("WarhammerShoulderMedalsRight", Utility.LoadBundleGameObject("WarhammerShoulderMedalsRight"), true, (HideFlags)52, val, 6345344, true);
UPool.MyPool.AddObject("WarhammerBoots", Utility.LoadBundleGameObject("WarhammerBoots"), true, (HideFlags)52, val, 7824523, true);
UPool.MyPool.AddObject("CrotchCloth", Utility.LoadBundleGameObject("CrotchCloth"), true, (HideFlags)52, val, 32421232, true);
comment = "----------------------------------------------------------------------------------------------------------------------------";
comment = "Custom Ability";
comment = "----------------------------------------------------------------------------------------------------------------------------";
UPool.MyPool.AddObject("JetHover", Utility.LoadBundleGameObject("JetHover"), true, (HideFlags)52, val, 61232132, true);
UPool.MyPool.AddObject("JetCrash", Utility.LoadBundleGameObject("JetCrash"), true, (HideFlags)52, val, 74352433, true);
comment = "----------------------------------------------------------------------------------------------------------------------------";
comment = "Custom Projectiles";
comment = "----------------------------------------------------------------------------------------------------------------------------";
UPool.MyPool.AddObject("P_BolterAmmunition", Utility.LoadBundleGameObject("P_BolterAmmunition"), true, (HideFlags)52, val, 4533423, true);
UPool.MyPool.AddObject("P_FastHeavyLaser", Utility.LoadBundleGameObject("P_FastHeavyLaser"), true, (HideFlags)52, val, 63215423, true);
comment = "----------------------------------------------------------------------------------------------------------------------------";
comment = "Custom Explosions";
comment = "----------------------------------------------------------------------------------------------------------------------------";
UPool.MyPool.AddObject("E_Explosion_Bolt", Utility.LoadBundleGameObject("E_Explosion_Bolt"), true, (HideFlags)52, val, 0, true);
UPool.MyPool.AddObject("E_LaserExplosionHit", Utility.LoadBundleGameObject("E_LaserExplosionHit"), true, (HideFlags)52, val, 0, true);
comment = "----------------------------------------------------------------------------------------------------------------------------";
comment = "Custom Unit Bases";
comment = "----------------------------------------------------------------------------------------------------------------------------";
UPool.MyPool.AddObject("Humanoid_Astarte_Base", Utility.LoadBundleGameObject("Humanoid_Astarte"), true, (HideFlags)52, val, 78245234, true);
UPool.MyPool.AddObject("Dreadnought_Unit_Base", Utility.LoadBundleGameObject("Dreadnought_Unit_Base"), true, (HideFlags)52, val, 62345323, true);
new Material(Shader.Find("Standard"));
comment = "----------------------------------------------------------------------------------------------------------------------------";
comment = "Other Neccessities";
comment = "----------------------------------------------------------------------------------------------------------------------------";
UnitEditorColorPalette val3 = Resources.FindObjectsOfTypeAll<UnitEditorColorPalette>()[0];
List<ParentCatagories> list = ((ParentCatagories[])s.GetField<UnitEditorColorPalette>(val3, "m_ColorPalleteParentCatagories")).ToList();
ParentCatagories val4 = default(ParentCatagories);
val4.colorWheelSprite = val;
val4.name = "WarhammerSigns";
val4.colorPaletteCatagories = (ColorPaletteCatagory[])(object)new ColorPaletteCatagory[1]
{
new ColorPaletteCatagory
{
name = "WarhammerSigns",
shardImage = val,
Cataogry = (CatagoryType)0,
Colors = (ColorPaletteData[])(object)new ColorPaletteData[15]
{
new ColorPaletteData
{
ColorIndex = 6243324,
m_color = new Color(0f, 0f, 0f),
m_material = Utility.LoadBundleMaterial("AssaultCareerSigns")
},
new ColorPaletteData
{
ColorIndex = 7533452,
m_color = new Color(0.5f, 0.5f, 0.5f),
m_material = Utility.LoadBundleMaterial("BloodAngelsLegionSigns")
},
new ColorPaletteData
{
ColorIndex = 95754633,
m_color = new Color(1f, 1f, 1f),
m_material = Utility.LoadBundleMaterial("DarkAngelsLegionSigns")
},
new ColorPaletteData
{
ColorIndex = 53241212,
m_color = new Color(0f, 0f, 0f),
m_material = Utility.LoadBundleMaterial("DevastatorCareerSigns")
},
new ColorPaletteData
{
ColorIndex = 74564312,
m_color = new Color(0.5f, 0.5f, 0.5f),
m_material = Utility.LoadBundleMaterial("DreadnoughtInscriptionMat")
},
new ColorPaletteData
{
ColorIndex = 5663445,
m_color = new Color(1f, 1f, 1f),
m_material = Utility.LoadBundleMaterial("ImperialFistsLegionSigns")
},
new ColorPaletteData
{
ColorIndex = 64323432,
m_color = new Color(0f, 0f, 0f),
m_material = Utility.LoadBundleMaterial("IronHandsLegionSigns")
},
new ColorPaletteData
{
ColorIndex = 1231235,
m_color = new Color(0.5f, 0.5f, 0.5f),
m_material = Utility.LoadBundleMaterial("RavenGuardLegionSigns")
},
new ColorPaletteData
{
ColorIndex = 845634,
m_color = new Color(1f, 1f, 1f),
m_material = Utility.LoadBundleMaterial("SalamandersLegionSigns")
},
new ColorPaletteData
{
ColorIndex = 4252354,
m_color = new Color(0f, 0f, 0f),
m_material = Utility.LoadBundleMaterial("SpaceWolvesLegionSigns")
},
new ColorPaletteData
{
ColorIndex = 8563563,
m_color = new Color(0.5f, 0.5f, 0.5f),
m_material = Utility.LoadBundleMaterial("TacticalCareerSigns")
},
new ColorPaletteData
{
ColorIndex = 8646345,
m_color = new Color(1f, 1f, 1f),
m_material = Utility.LoadBundleMaterial("UltramarinesBadgeMat")
},
new ColorPaletteData
{
ColorIndex = 6345322,
m_color = new Color(0f, 0f, 0f),
m_material = Utility.LoadBundleMaterial("UltramarinesScoutMarkerMat")
},
new ColorPaletteData
{
ColorIndex = 7545332,
m_color = new Color(0.5f, 0.5f, 0.5f),
m_material = Utility.LoadBundleMaterial("VeteranCareerSigns")
},
new ColorPaletteData
{
ColorIndex = 4352341,
m_color = new Color(1f, 1f, 1f),
m_material = Utility.LoadBundleMaterial("WhiteScarsLegionSigns")
}
}
}
};
ParentCatagories item = val4;
list.Add(item);
s.SetField<UnitEditorColorPalette>(val3, "m_ColorPalleteParentCatagories", (object)list.ToArray());
val3.Initialize();
comment = "----------------------------------------------------------------------------------------------------------------------------";
comment = "Inserting Unit Bases";
comment = "----------------------------------------------------------------------------------------------------------------------------";
unitBlueprints = new List<UnitBlueprint>
{
SLMATool.CreateUnit("AstarteUnitBase", (UnitBlueprint)null, (Faction)null, val),
SLMATool.CreateUnit("DreadnoughtUnitBase", (UnitBlueprint)null, (Faction)null, val)
}.ToArray();
}
public static void SetWeapon(GameObject weapon, MeleeWeapon melee, RangeWeapon range, LandfallContentDatabase db)
{
if ((Object)(object)weapon == (Object)(object)UPool.MyPool.GetObject("TwinHeavyLaserCannons"))
{
weapon.AddComponent<AimedGun>();
}
}
public static void SetEffects(GameObject effect)
{
}
public static void LoadBundle(string assetBundleName)
{
using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(assetBundleName);
bundle = AssetBundle.LoadFromStream(stream);
}
public static void SetExplosion(GameObject explosion)
{
}
public static void SetProjectile(GameObject proj, ProjectileHit projhit, LandfallContentDatabase db)
{
}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("GeeztJeez.Warhammer", "Warhammer", "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));
Debug.Log((object)"Loading Warhammer!");
SLMALoader.GetInstance();
LandfallContentDatabase landfallContentDatabase = ContentDatabase.Instance().LandfallContentDatabase;
UManager.Init(landfallContentDatabase);
UManager.Utility.AddLocalization();
new Harmony("Warhammer").PatchAll();
GameObject[] array = Resources.FindObjectsOfTypeAll<GameObject>();
for (int i = 0; i < array.Length; i++)
{
if (Object.op_Implicit((Object)(object)array[i].GetComponent<Explosion>()))
{
UManager.SetExplosion(array[i]);
}
if (Object.op_Implicit((Object)(object)array[i].GetComponent<ProjectileHit>()))
{
UManager.SetProjectile(array[i], array[i].GetComponent<ProjectileHit>(), landfallContentDatabase);
}
if (Object.op_Implicit((Object)(object)array[i].GetComponent<Unit>()))
{
UManager.SetUnits(array[i].GetComponent<Unit>(), landfallContentDatabase);
}
if (Object.op_Implicit((Object)(object)array[i].GetComponent<WeaponItem>()))
{
UManager.SetWeapon(array[i], array[i].GetComponent<MeleeWeapon>(), array[i].GetComponent<RangeWeapon>(), landfallContentDatabase);
}
if (Object.op_Implicit((Object)(object)array[i].GetComponent<PlaySoundEffect>()))
{
UManager.SetEffects(array[i]);
}
if (Object.op_Implicit((Object)(object)array[i].GetComponent<SpecialAbility>()))
{
UManager.SetMoves(array[i], landfallContentDatabase);
}
if (Object.op_Implicit((Object)(object)array[i].GetComponent<PropItem>()))
{
UManager.SetClothes(array[i], array[i].GetComponent<CharacterItem>(), array[i].GetComponent<PropItemData>(), landfallContentDatabase);
}
}
UnitBlueprint[] array2 = Resources.FindObjectsOfTypeAll<UnitBlueprint>();
for (int j = 0; j < array2.Length; j++)
{
UManager.SetBlueprint(array2[j], landfallContentDatabase);
array2[j].Validate();
}
SceneManager.sceneLoaded += SceneLoaded;
Debug.Log((object)"Loaded Warhammer Successfully!");
}
public void SceneLoaded(Scene scene, LoadSceneMode loadSceneMode)
{
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_0087: Unknown result type (might be due to invalid IL or missing references)
//IL_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_0091: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: Expected O, but got Unknown
if (!(((Scene)(ref scene)).name == "UnitCreator_GamepadUI"))
{
return;
}
UnitEditorManager component = ((Scene)(ref scene)).GetRootGameObjects().ToList().Find((GameObject x) => Object.op_Implicit((Object)(object)x.GetComponent<UnitEditorManager>()))
.GetComponent<UnitEditorManager>();
List<UnitBaseWrapper> list = new List<UnitBaseWrapper>(component.UnitBases);
UnitBlueprint[] unitBlueprints = UManager.unitBlueprints;
foreach (UnitBlueprint val in unitBlueprints)
{
UnitBaseWrapper wrapper = new UnitBaseWrapper
{
BaseDisplayName = val.Entity.Name,
UnitBaseBlueprint = val,
UnitBaseRestriction = (UnitBaseRestrictions)0
};
val.Entity.GetSpriteIconAsync((Action<Sprite>)delegate(Sprite sprite)
{
wrapper.BaseIcon = sprite;
});
list.Add(wrapper);
}
component.UnitBases = list.ToArray();
}
}
}
namespace WarhammerFunctions
{
public class AimedGun : MonoBehaviour
{
public Unit rootUnit;
public Unit target;
private float speed = 10f;
private Rigidbody rigidbody;
public void Start()
{
rigidbody = ((Component)this).GetComponentInChildren<Rigidbody>();
rootUnit = ((Component)((Component)this).gameObject.transform.root).GetComponentInChildren<Unit>();
}
public void Update()
{
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)rootUnit) && Object.op_Implicit((Object)(object)rootUnit.data.targetData) && Object.op_Implicit((Object)(object)rootUnit.data))
{
target = rootUnit.data.targetData.unit;
if (Object.op_Implicit((Object)(object)rigidbody) && Object.op_Implicit((Object)(object)target) && (Object)(object)target != (Object)null && !rootUnit.data.Dead)
{
Vector3 val = target.data.mainRig.position - ((Component)this).transform.position;
Quaternion val2 = Quaternion.LookRotation(((Vector3)(ref val)).normalized);
Quaternion val3 = Quaternion.Slerp(rigidbody.rotation, val2, speed * Time.deltaTime);
rigidbody.MoveRotation(val3);
}
}
}
}
}