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 TFBGames;
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.1.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
{
}
}
public static void AddToUnitLib(GameObject UnitBaseObject)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
Unit component = UnitBaseObject.GetComponent<Unit>();
if ((Object)(object)component == (Object)null || component.Entity == null)
{
Debug.LogError((object)"UnitBaseObject does not contain a valid Unit or Entity component.");
return;
}
DatabaseID gUID = component.Entity.GUID;
Debug.Log((object)$"Attempting to add Unit with GUID: {gUID}");
unitBases.Add(UnitBaseObject.GetComponentInChildren<Unit>());
}
}
private static string comment;
public static AssetBundle bundle;
public static List<Unit> unitBases;
public static List<GameObject> unitBasesObject;
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_0d42: Unknown result type (might be due to invalid IL or missing references)
//IL_0d48: Expected O, but got Unknown
//IL_0d63: Unknown result type (might be due to invalid IL or missing references)
//IL_0d69: Expected O, but got Unknown
//IL_0d84: Unknown result type (might be due to invalid IL or missing references)
//IL_0d8a: Expected O, but got Unknown
//IL_0d98: Unknown result type (might be due to invalid IL or missing references)
//IL_0d9e: Unknown result type (might be due to invalid IL or missing references)
//IL_0eeb: Unknown result type (might be due to invalid IL or missing references)
//IL_0ef1: Expected O, but got Unknown
//IL_0f0c: Unknown result type (might be due to invalid IL or missing references)
//IL_0f12: Expected O, but got Unknown
//IL_0f20: Unknown result type (might be due to invalid IL or missing references)
//IL_0f26: 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("BolterPistol");
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, 2000);
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_Piratequeen"],
(GameObject)SLMALoader.SDic["moves"]["BlockSlow"]
};
unit.MovementComponents = new List<IMovementComponent> { (IMovementComponent)(object)default(KeepPreferredDistance) };
}
if (unit.Entity.Name == "MK7_WARRIOR")
{
SLMATool.UnitCost(unit, 1200);
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, 1800);
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("Leiting Claw Left");
unit.RightWeapon = UPool.MyPool.GetObject("Leiting Claw Right");
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, 3000);
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("Power Fist Left");
unit.RightWeapon = UPool.MyPool.GetObject("Assault Cannon");
unit.m_props = (GameObject[])(object)new GameObject[5]
{
UPool.MyPool.GetObject("TerminatorHandPipe"),
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, 40000);
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) };
}
}
public static void SetClothes(GameObject cloth, CharacterItem item, PropItemData data, LandfallContentDatabase db)
{
}
public static void SetMoves(GameObject move, LandfallContentDatabase db)
{
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("JetCrash"))
{
SoundEffectForce soundEffectForce = move.AddComponent<SoundEffectForce>();
soundEffectForce.Category = "Effects";
soundEffectForce.Effect = "FanBlow";
soundEffectForce.volume = 1f;
soundEffectForce.pitch = 0.65f;
}
if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("JetHover"))
{
SoundEffectForce soundEffectForce2 = move.AddComponent<SoundEffectForce>();
soundEffectForce2.Category = "Effects";
soundEffectForce2.Effect = "Poof";
soundEffectForce2.volume = 0.15f;
soundEffectForce2.pitch = 0.4f;
}
}
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_0ac2: Unknown result type (might be due to invalid IL or missing references)
//IL_0ae8: Unknown result type (might be due to invalid IL or missing references)
//IL_0b05: 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_0b3a: Unknown result type (might be due to invalid IL or missing references)
//IL_0b3f: Unknown result type (might be due to invalid IL or missing references)
//IL_0b55: Unknown result type (might be due to invalid IL or missing references)
//IL_0b57: 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_0b83: Unknown result type (might be due to invalid IL or missing references)
//IL_0b88: Unknown result type (might be due to invalid IL or missing references)
//IL_0b9e: Unknown result type (might be due to invalid IL or missing references)
//IL_0ba0: 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_0bcc: Unknown result type (might be due to invalid IL or missing references)
//IL_0bd1: Unknown result type (might be due to invalid IL or missing references)
//IL_0be7: Unknown result type (might be due to invalid IL or missing references)
//IL_0be9: 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_0c15: Unknown result type (might be due to invalid IL or missing references)
//IL_0c1a: Unknown result type (might be due to invalid IL or missing references)
//IL_0c30: Unknown result type (might be due to invalid IL or missing references)
//IL_0c32: 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_0c5e: Unknown result type (might be due to invalid IL or missing references)
//IL_0c63: Unknown result type (might be due to invalid IL or missing references)
//IL_0c79: Unknown result type (might be due to invalid IL or missing references)
//IL_0c7b: 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_0ca7: Unknown result type (might be due to invalid IL or missing references)
//IL_0cac: Unknown result type (might be due to invalid IL or missing references)
//IL_0cc2: Unknown result type (might be due to invalid IL or missing references)
//IL_0cc4: 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_0cf0: Unknown result type (might be due to invalid IL or missing references)
//IL_0cf5: Unknown result type (might be due to invalid IL or missing references)
//IL_0d0b: Unknown result type (might be due to invalid IL or missing references)
//IL_0d0d: Unknown result type (might be due to invalid IL or missing references)
//IL_0d16: Unknown result type (might be due to invalid IL or missing references)
//IL_0d39: Unknown result type (might be due to invalid IL or missing references)
//IL_0d3e: Unknown result type (might be due to invalid IL or missing references)
//IL_0d54: Unknown result type (might be due to invalid IL or missing references)
//IL_0d56: 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_0d82: Unknown result type (might be due to invalid IL or missing references)
//IL_0d87: Unknown result type (might be due to invalid IL or missing references)
//IL_0d9d: Unknown result type (might be due to invalid IL or missing references)
//IL_0d9f: 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_0dcc: Unknown result type (might be due to invalid IL or missing references)
//IL_0dd1: Unknown result type (might be due to invalid IL or missing references)
//IL_0de7: Unknown result type (might be due to invalid IL or missing references)
//IL_0de9: 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_0e16: Unknown result type (might be due to invalid IL or missing references)
//IL_0e1b: Unknown result type (might be due to invalid IL or missing references)
//IL_0e31: Unknown result type (might be due to invalid IL or missing references)
//IL_0e33: 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_0e60: Unknown result type (might be due to invalid IL or missing references)
//IL_0e65: Unknown result type (might be due to invalid IL or missing references)
//IL_0e7b: Unknown result type (might be due to invalid IL or missing references)
//IL_0e7d: 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_0eaa: Unknown result type (might be due to invalid IL or missing references)
//IL_0eaf: Unknown result type (might be due to invalid IL or missing references)
//IL_0ec5: Unknown result type (might be due to invalid IL or missing references)
//IL_0ec7: Unknown result type (might be due to invalid IL or missing references)
//IL_0ed1: Unknown result type (might be due to invalid IL or missing references)
//IL_0ef4: Unknown result type (might be due to invalid IL or missing references)
//IL_0ef9: Unknown result type (might be due to invalid IL or missing references)
//IL_0f0f: Unknown result type (might be due to invalid IL or missing references)
//IL_0f11: Unknown result type (might be due to invalid IL or missing references)
//IL_0f1b: Unknown result type (might be due to invalid IL or missing references)
//IL_0f1d: Unknown result type (might be due to invalid IL or missing references)
//IL_0f27: Unknown result type (might be due to invalid IL or missing references)
//IL_0f29: Unknown result type (might be due to invalid IL or missing references)
//IL_0f2d: 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("Power Fist Left", Utility.LoadBundleGameObject("Power Fist Left"), true, (HideFlags)52, val, 84563245, true);
UPool.MyPool.AddObject("Power Fist Right", Utility.LoadBundleGameObject("Power Fist Right"), true, (HideFlags)52, val, 84563246, true);
UPool.MyPool.AddObject("Leiting Claw Left", Utility.LoadBundleGameObject("Leiting Claw Left"), true, (HideFlags)52, val, 84563247, true);
UPool.MyPool.AddObject("Leiting Claw Right", Utility.LoadBundleGameObject("Leiting Claw Right"), true, (HideFlags)52, val, 84563248, true);
UPool.MyPool.AddObject("Assault Cannon", Utility.LoadBundleGameObject("Assault Cannon"), 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);
UPool.MyPool.AddObject("TerminatorHandPipe", Utility.LoadBundleGameObject("TerminatorHandPipe"), true, (HideFlags)52, val, 73544532, 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 = "----------------------------------------------------------------------------------------------------------------------------";
unitBasesObject.Add(UPool.MyPool.AddObject("Humanoid_Astarte_Base", Utility.LoadBundleGameObject("Humanoid_Astarte_Base"), true, (HideFlags)52, val, 624534324, true));
unitBasesObject.Add(UPool.MyPool.AddObject("Dreadnought_Unit_Base", Utility.LoadBundleGameObject("Dreadnought_Unit_Base"), true, (HideFlags)52, val, 743523432, true));
foreach (GameObject item2 in unitBasesObject)
{
Utility.AddToUnitLib(item2);
}
comment = "----------------------------------------------------------------------------------------------------------------------------";
comment = "Other Neccessities";
comment = "----------------------------------------------------------------------------------------------------------------------------";
UnitEditorColorPalette[] array = Resources.FindObjectsOfTypeAll<UnitEditorColorPalette>();
foreach (UnitEditorColorPalette val3 in array)
{
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[14]
{
new ColorPaletteData
{
ColorIndex = 43324789,
m_color = new Color(0.1f, 0.1f, 0.1f),
m_material = Utility.LoadBundleMaterial("AssaultCareerSigns")
},
new ColorPaletteData
{
ColorIndex = 334524567,
m_color = new Color(0.8f, 0.1f, 0.1f),
m_material = Utility.LoadBundleMaterial("BloodAngelsLegionSigns")
},
new ColorPaletteData
{
ColorIndex = 754633298,
m_color = new Color(0f, 0.5f, 0f),
m_material = Utility.LoadBundleMaterial("DarkAngelsLegionSigns")
},
new ColorPaletteData
{
ColorIndex = 241212876,
m_color = new Color(0.1f, 0.1f, 0.3f),
m_material = Utility.LoadBundleMaterial("DevastatorCareerSigns")
},
new ColorPaletteData
{
ColorIndex = 564312765,
m_color = new Color(0.6f, 0.4f, 0.2f),
m_material = Utility.LoadBundleMaterial("DreadnoughtInscriptionMat")
},
new ColorPaletteData
{
ColorIndex = 63445891,
m_color = new Color(1f, 1f, 0f),
m_material = Utility.LoadBundleMaterial("ImperialFistsLegionSigns")
},
new ColorPaletteData
{
ColorIndex = 323432890,
m_color = new Color(0.7f, 0.7f, 0.7f),
m_material = Utility.LoadBundleMaterial("IronHandsLegionSigns")
},
new ColorPaletteData
{
ColorIndex = 31235789,
m_color = new Color(0f, 0f, 0f),
m_material = Utility.LoadBundleMaterial("RavenGuardLegionSigns")
},
new ColorPaletteData
{
ColorIndex = 56341234,
m_color = new Color(0.1f, 0.7f, 0.2f),
m_material = Utility.LoadBundleMaterial("SalamandersLegionSigns")
},
new ColorPaletteData
{
ColorIndex = 52354789,
m_color = new Color(0.5f, 0.5f, 0.6f),
m_material = Utility.LoadBundleMaterial("SpaceWolvesLegionSigns")
},
new ColorPaletteData
{
ColorIndex = 63563987,
m_color = new Color(0.4f, 0.4f, 0.4f),
m_material = Utility.LoadBundleMaterial("TacticalCareerSigns")
},
new ColorPaletteData
{
ColorIndex = 46345678,
m_color = new Color(0f, 0f, 0.8f),
m_material = Utility.LoadBundleMaterial("UltramarinesBadgeMat")
},
new ColorPaletteData
{
ColorIndex = 45322890,
m_color = new Color(0.9f, 0.8f, 0.1f),
m_material = Utility.LoadBundleMaterial("VeteranCareerSigns")
},
new ColorPaletteData
{
ColorIndex = 45332789,
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();
}
}
public static void SetWeapon(GameObject weapon, MeleeWeapon melee, RangeWeapon range, LandfallContentDatabase db)
{
if ((Object)(object)weapon == (Object)(object)UPool.MyPool.GetObject("Leiting Claw Right"))
{
weapon.AddComponent<AimedRigidbody>().speed = 0.5f;
}
if ((Object)(object)weapon == (Object)(object)UPool.MyPool.GetObject("Leiting Claw Left"))
{
weapon.AddComponent<AimedRigidbody>().speed = 0.5f;
}
if ((Object)(object)weapon == (Object)(object)UPool.MyPool.GetObject("TwinHeavyLaserCannons"))
{
weapon.AddComponent<AimedRigidbody>();
}
}
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)
{
}
static UManager()
{
unitBasesObject = new List<GameObject>();
unitBases = new List<Unit>();
}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("GeeztJeez.Warhammer", "Warhammer", "1.0.1")]
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_009e: Unknown result type (might be due to invalid IL or missing references)
//IL_00aa: Expected O, but got Unknown
//IL_00ba: 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_00d0: Unknown result type (might be due to invalid IL or missing references)
//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
//IL_00f5: 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 = component.UnitBases.ToList();
foreach (Unit unitBasis in UManager.unitBases)
{
UnitBlueprint val = SLMATool.CreateUnit("MoreContent Custom:" + unitBasis.Entity.Name, (UnitBlueprint)SLMALoader.SDic["blueprints"]["CustomWobbler"], (Faction)null, (Sprite)null);
val.UnitBase = ((Component)unitBasis).gameObject;
list.Add(new UnitBaseWrapper
{
BaseDisplayName = unitBasis.Entity.Name,
BaseIcon = unitBasis.Entity.SpriteIcon,
UnitBaseBlueprint = val,
UnitBaseRestriction = (UnitBaseRestrictions)0
});
Debug.Log((object)("Inserted Warhammer Unit Bases: " + unitBasis.Entity.Name));
}
component.UnitBases = list.ToArray();
}
}
}
namespace WarhammerFunctions
{
public class AimedRigidbody : MonoBehaviour
{
public Unit rootUnit;
public Unit target;
public 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);
}
}
}
}
public class SoundEffectForce : MonoBehaviour
{
public float pitch = 0.5f;
public float volume = 0.15f;
public string Category;
public string Effect;
public void Update()
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Expected O, but got Unknown
PlaySoundEffect[] componentsInChildren = ((Component)this).GetComponentsInChildren<PlaySoundEffect>();
for (int i = 0; i < componentsInChildren.Length; i++)
{
AudioPathData val = new AudioPathData(Category, Effect, pitch, volume);
s.SetField<PlaySoundEffect>(componentsInChildren[i], "soundPathData", (object)val);
}
}
}
}