Decompiled source of Neon faction v1.0.2
Niiido.dll
Decompiled a month ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Xml; using BepInEx; using DM; using Landfall.TABS; using Landfall.TABS.UnitEditor; using ModdingForDummies.AssetManagement; using ModdingForDummies.TABSSimp; using Niiido; using SLMA; using Sirenix.Serialization; using TFBGames; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("ModdingForDummies")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ModdingForDummies")] [assembly: AssemblyCopyright("Copyright © 2021")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("1619c49c-bc45-486c-bbca-6b52cef4f478")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace ModdingForDummies { [BepInPlugin("nihongpaoxi34589", "nihongpaoxi344589", "1.0.0")] public class Launcher : BaseUnityPlugin { public Launcher() { Debug.Log((object)"已加载霓虹派系"); AssetImporter.Initialize(); new Main(); } } public class Main : Mod { private string comment; public Main() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Expected O, but got Unknown //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Expected O, but got Unknown //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_03d2: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_041f: Unknown result type (might be due to invalid IL or missing references) //IL_042e: Unknown result type (might be due to invalid IL or missing references) //IL_046c: Unknown result type (might be due to invalid IL or missing references) //IL_047b: Unknown result type (might be due to invalid IL or missing references) //IL_04b9: Unknown result type (might be due to invalid IL or missing references) //IL_04c8: Unknown result type (might be due to invalid IL or missing references) //IL_0506: Unknown result type (might be due to invalid IL or missing references) //IL_0515: Unknown result type (might be due to invalid IL or missing references) //IL_07c6: Unknown result type (might be due to invalid IL or missing references) //IL_07da: Expected O, but got Unknown //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_08b0: Expected O, but got Unknown //IL_0c08: Unknown result type (might be due to invalid IL or missing references) //IL_0c1d: Expected O, but got Unknown //IL_0c42: Unknown result type (might be due to invalid IL or missing references) //IL_0c57: Expected O, but got Unknown //IL_0c7c: Unknown result type (might be due to invalid IL or missing references) //IL_0c91: Expected O, but got Unknown //IL_1006: Unknown result type (might be due to invalid IL or missing references) //IL_100c: Expected O, but got Unknown //IL_102b: Unknown result type (might be due to invalid IL or missing references) //IL_1031: Expected O, but got Unknown //IL_1080: Unknown result type (might be due to invalid IL or missing references) //IL_108a: Unknown result type (might be due to invalid IL or missing references) //IL_1213: Unknown result type (might be due to invalid IL or missing references) //IL_1219: Expected O, but got Unknown //IL_124c: Unknown result type (might be due to invalid IL or missing references) //IL_1252: Expected O, but got Unknown //IL_129f: Unknown result type (might be due to invalid IL or missing references) //IL_12a5: Expected O, but got Unknown //IL_12c4: Unknown result type (might be due to invalid IL or missing references) //IL_12ca: Expected O, but got Unknown //IL_13e1: Unknown result type (might be due to invalid IL or missing references) //IL_13eb: Unknown result type (might be due to invalid IL or missing references) //IL_1431: Unknown result type (might be due to invalid IL or missing references) //IL_1436: Unknown result type (might be due to invalid IL or missing references) //IL_1447: Unknown result type (might be due to invalid IL or missing references) //IL_144c: Unknown result type (might be due to invalid IL or missing references) //IL_1451: Unknown result type (might be due to invalid IL or missing references) //IL_145b: Expected O, but got Unknown //IL_1543: Unknown result type (might be due to invalid IL or missing references) //IL_1548: Unknown result type (might be due to invalid IL or missing references) //IL_16ad: Unknown result type (might be due to invalid IL or missing references) //IL_16b7: Expected O, but got Unknown //IL_17c1: Unknown result type (might be due to invalid IL or missing references) //IL_17c7: Expected O, but got Unknown //IL_18d4: Unknown result type (might be due to invalid IL or missing references) //IL_18da: Expected O, but got Unknown comment = "adfdfgxc"; Mod.DEV_MODE = false; Assembly executingAssembly = Assembly.GetExecutingAssembly(); Stream manifestResourceStream = executingAssembly.GetManifestResourceStream("Niiido.fghrrh"); AssetBundle val = AssetBundle.LoadFromStream(manifestResourceStream); Material[] redmaterials = (Material[])(object)new Material[1] { new Material(val.LoadAsset<Material>("redt1")) }; Material[] bullmasss = (Material[])(object)new Material[1] { new Material(val.LoadAsset<Material>("bullt1")) }; Material[] redmaterials2 = (Material[])(object)new Material[1] { new Material(val.LoadAsset<Material>("redt2")) }; Material[] bullmasss2 = (Material[])(object)new Material[1] { new Material(val.LoadAsset<Material>("bullt2")) }; Texture2D val2 = val.LoadAsset<Texture2D>("光剑士兵43"); ((Texture)val2).filterMode = (FilterMode)0; Sprite val3 = Sprite.Create(val2, new Rect(0f, 0f, (float)((Texture)val2).width, (float)((Texture)val2).height), new Vector2(0.5f, 0.5f)); Texture2D val4 = val.LoadAsset<Texture2D>("光剑大师34"); ((Texture)val4).filterMode = (FilterMode)0; Sprite val5 = Sprite.Create(val4, new Rect(0f, 0f, (float)((Texture)val4).width, (float)((Texture)val4).height), new Vector2(0.5f, 0.5f)); Texture2D val6 = val.LoadAsset<Texture2D>("或i吨传送23"); ((Texture)val6).filterMode = (FilterMode)0; Sprite val7 = Sprite.Create(val6, new Rect(0f, 0f, (float)((Texture)val6).width, (float)((Texture)val6).height), new Vector2(0.5f, 0.5f)); Texture2D val8 = val.LoadAsset<Texture2D>("擂台炮2342"); ((Texture)val8).filterMode = (FilterMode)0; Sprite val9 = Sprite.Create(val8, new Rect(0f, 0f, (float)((Texture)val8).width, (float)((Texture)val8).height), new Vector2(0.5f, 0.5f)); Texture2D val10 = val.LoadAsset<Texture2D>("激光塔345t"); ((Texture)val10).filterMode = (FilterMode)0; Sprite val11 = Sprite.Create(val10, new Rect(0f, 0f, (float)((Texture)val10).width, (float)((Texture)val10).height), new Vector2(0.5f, 0.5f)); Texture2D val12 = val.LoadAsset<Texture2D>("激光枪手i234"); ((Texture)val12).filterMode = (FilterMode)0; Sprite val13 = Sprite.Create(val12, new Rect(0f, 0f, (float)((Texture)val12).width, (float)((Texture)val12).height), new Vector2(0.5f, 0.5f)); Texture2D val14 = val.LoadAsset<Texture2D>("磁暴步兵234"); ((Texture)val14).filterMode = (FilterMode)0; Sprite val15 = Sprite.Create(val14, new Rect(0f, 0f, (float)((Texture)val14).width, (float)((Texture)val14).height), new Vector2(0.5f, 0.5f)); Texture2D val16 = val.LoadAsset<Texture2D>("罪恶克星1234"); ((Texture)val16).filterMode = (FilterMode)0; Sprite val17 = Sprite.Create(val16, new Rect(0f, 0f, (float)((Texture)val16).width, (float)((Texture)val16).height), new Vector2(0.5f, 0.5f)); Texture2D val18 = val.LoadAsset<Texture2D>("雷电法王3144"); ((Texture)val18).filterMode = (FilterMode)0; Sprite val19 = Sprite.Create(val18, new Rect(0f, 0f, (float)((Texture)val18).width, (float)((Texture)val18).height), new Vector2(0.5f, 0.5f)); Texture2D val20 = val.LoadAsset<Texture2D>("穿透射线23"); ((Texture)val20).filterMode = (FilterMode)0; Sprite val21 = Sprite.Create(val20, new Rect(0f, 0f, (float)((Texture)val20).width, (float)((Texture)val20).height), new Vector2(0.5f, 0.5f)); Texture2D val22 = val.LoadAsset<Texture2D>("擂台拳击手3425245"); ((Texture)val22).filterMode = (FilterMode)0; Sprite val23 = Sprite.Create(val22, new Rect(0f, 0f, (float)((Texture)val22).width, (float)((Texture)val22).height), new Vector2(0.5f, 0.5f)); Texture2D val24 = val.LoadAsset<Texture2D>("引力风暴312445"); ((Texture)val14).filterMode = (FilterMode)0; Sprite val25 = Sprite.Create(val24, new Rect(0f, 0f, (float)((Texture)val24).width, (float)((Texture)val24).height), new Vector2(0.5f, 0.5f)); Texture2D val26 = val.LoadAsset<Texture2D>("最终冷静23r"); ((Texture)val16).filterMode = (FilterMode)0; Sprite val27 = Sprite.Create(val26, new Rect(0f, 0f, (float)((Texture)val26).width, (float)((Texture)val26).height), new Vector2(0.5f, 0.5f)); Texture2D val28 = val.LoadAsset<Texture2D>("超级坦克234"); ((Texture)val28).filterMode = (FilterMode)0; Sprite val29 = Sprite.Create(val28, new Rect(0f, 0f, (float)((Texture)val28).width, (float)((Texture)val28).height), new Vector2(0.5f, 0.5f)); Texture2D val30 = val.LoadAsset<Texture2D>("霓虹派系2547"); ((Texture)val30).filterMode = (FilterMode)0; Sprite val31 = Sprite.Create(val30, new Rect(0f, 0f, (float)((Texture)val30).width, (float)((Texture)val30).height), new Vector2(0.5f, 0.5f)); Faction val32 = SLMATool.CreateFaction("霓虹派系", (UnitBlueprint[])null, val31, 4354536); UnitBlueprint val33 = SLMATool.CreateUnit("空白单位2", (UnitBlueprint)null, (Faction)null, (Sprite)null); val33.SetField<UnitBlueprint>("VocalRef", "Misc Attack Vocals/Crow"); val33.SetField<UnitBlueprint>("DeathRef", "Misc Attack Vocals/Crow"); val33.SetField<UnitBlueprint>("footRef", "Misc Attack Vocals/Crow"); UnitBlueprint val34 = SLMATool.CreateUnit("霓虹光剑兵", val33, val32, val3); val34.forceCost = 230u; UnitBlueprint val35 = SLMATool.CreateUnit("霓虹激光枪手", val33, val32, val13); val35.forceCost = 500u; UnitBlueprint val36 = SLMATool.CreateUnit("霓虹混沌刺客", val33, val32, val7); val36.forceCost = 1000u; UnitBlueprint val37 = SLMATool.CreateUnit("霓虹光剑大师", val33, val32, val5); val37.forceCost = 1500u; UnitBlueprint val38 = SLMATool.CreateUnit("罪恶克星", val33, val32, val17); val38.forceCost = 3008u; UnitBlueprint val39 = SLMATool.CreateUnit("霓虹磁暴步兵", val33, val32, val15); val39.forceCost = 3300u; UnitBlueprint val40 = SLMATool.CreateUnit("霓虹激光塔", val33, val32, val11); val40.forceCost = 3500u; UnitBlueprint val41 = SLMATool.CreateUnit("霓虹雷电法王", val33, val32, val19); val41.forceCost = 4000u; UnitBlueprint val42 = SLMATool.CreateUnit("霓虹擂台发射器", val33, val32, val9); val42.forceCost = 4500u; UnitBlueprint val43 = SLMATool.CreateUnit("霓虹穿透狙击手", val33, val32, val21); val43.forceCost = 7700u; UnitBlueprint val44 = SLMATool.CreateUnit("霓虹擂台拳击手", val33, val32, val23); val44.forceCost = 10500u; UnitBlueprint val45 = SLMATool.CreateUnit("霓虹引力风暴", val33, val32, val25); val45.forceCost = 12000u; UnitBlueprint val46 = SLMATool.CreateUnit("霓虹折跃者", val33, val32, val27); val46.forceCost = 20000u; UnitBlueprint val47 = SLMATool.CreateUnit("霓虹超级坦克", val33, val32, val29); val47.forceCost = 20000u; UnitBlueprint val48 = SLMATool.CreateUnit("虚拟擂台冠军", val33, (Faction)null, (Sprite)null); GameObject unitBase = UPool.MyPool.AddObject("霓虹坦克模型", val.LoadAsset<GameObject>("ZHUZHANTANKE"), true, (HideFlags)52, (Sprite)null, 5120968, true); GameObject unitBase2 = UPool.MyPool.AddObject("霓虹挡光塔模型", val.LoadAsset<GameObject>("nihonmhgbjiadhd"), true, (HideFlags)52, (Sprite)null, 5120969, true); GameObject unitBase3 = UPool.MyPool.AddObject("霓虹大炮模型", val.LoadAsset<GameObject>("lwesdftgfe"), true, (HideFlags)52, (Sprite)null, 5120970, true); GameObject val49 = UPool.MyPool.AddObject("虚拟擂台冠军模型", (GameObject)SLMALoader.SDic["bases"]["Humanoid"], true, (HideFlags)52, (Sprite)null, 5120971, true); GameObject rightWeapon = UPool.MyPool.AddObject("霓虹坦克炮管", val.LoadAsset<GameObject>("NIHONGPAOGUAN"), true, (HideFlags)52, val31, 5120972, true); GameObject val50 = UPool.MyPool.AddObject("霓虹激光发射器", val.LoadAsset<GameObject>("minigunadsfasdf"), true, (HideFlags)52, val31, 5120973, true); GameObject val51 = UPool.MyPool.AddObject("霓虹穿透射线发射器", val.LoadAsset<GameObject>("nihongjujiqiangsfdj"), true, (HideFlags)52, val31, 5120974, true); GameObject val52 = UPool.MyPool.AddObject("最终棱镜1", val.LoadAsset<GameObject>("zuizhonglengjinghjsdff"), true, (HideFlags)52, val31, 5120975, true); GameObject val53 = UPool.MyPool.AddObject("擂台发射器武器", (GameObject)SLMALoader.SDic["weapons"]["CannonBallBomb"], true, (HideFlags)52, val31, 5120976, true); GameObject val54 = UPool.MyPool.AddObject("擂台虚拟拳套", val.LoadAsset<GameObject>("nihonghquantao"), true, (HideFlags)52, val31, 5120977, true); GameObject val55 = UPool.MyPool.AddObject("磁暴步枪123", val.LoadAsset<GameObject>("diancipao78"), true, (HideFlags)52, val31, 5120978, true); GameObject val56 = UPool.MyPool.AddObject("擂台冠军拳套", val.LoadAsset<GameObject>("noghusdfuogknvdcss"), true, (HideFlags)52, val31, 5120979, true); GameObject val57 = UPool.MyPool.AddObject("超级拳击手拳套(超浓版)", val.LoadAsset<GameObject>("chaioaosdjifeui"), true, (HideFlags)52, val31, 5120980, true); GameObject val58 = UPool.MyPool.AddObject("激光手枪3eq", val.LoadAsset<GameObject>("jiguangsghiascd"), true, (HideFlags)52, val31, 5120981, true); GameObject rightWeapon2 = UPool.MyPool.AddObject("能量枪223", val.LoadAsset<GameObject>("nengliangdfsq"), true, (HideFlags)52, val31, 5120982, true); GameObject rightWeapon3 = UPool.MyPool.AddObject("普通光剑3143", val.LoadAsset<GameObject>("Neon_Sword231"), true, (HideFlags)52, val31, 5120983, true); GameObject rightWeapon4 = UPool.MyPool.AddObject("旋转光剑243r", val.LoadAsset<GameObject>("Neon_Sworddfghfg"), true, (HideFlags)52, val31, 5120984, true); GameObject rightWeapon5 = UPool.MyPool.AddObject("引力枪123", val.LoadAsset<GameObject>("yinliquahdc"), true, (HideFlags)52, val31, 5120985, true); GameObject rightWeapon6 = UPool.MyPool.AddObject("队伍霓虹色手爪1", val.LoadAsset<GameObject>("霓虹爪1231"), true, (HideFlags)52, val31, 5120986, true); GameObject leftWeapon = UPool.MyPool.AddObject("队伍霓虹色手爪2", val.LoadAsset<GameObject>("霓虹爪5416"), true, (HideFlags)52, val31, 5120987, true); GameObject val59 = UPool.MyPool.AddObject("霓虹坦克炮弹", val.LoadAsset<GameObject>("nihongpaodaaan"), true, (HideFlags)52, val31, 5120988, true); GameObject val60 = UPool.MyPool.AddObject("霓虹穿透射线子弹", val.LoadAsset<GameObject>("nihingzidan234524"), true, (HideFlags)52, val31, 5120989, true); GameObject val61 = UPool.MyPool.AddObject("擂台弹", val.LoadAsset<GameObject>("letyatfg"), true, (HideFlags)52, val31, 512090, true); GameObject val62 = UPool.MyPool.AddObject("磁暴步兵子弹", val.LoadAsset<GameObject>("zxafasfhff"), true, (HideFlags)52, val31, 512091, true); GameObject val63 = UPool.MyPool.AddObject("激光子弹345", val.LoadAsset<GameObject>("duanzhajisad"), true, (HideFlags)52, val31, 512092, true); GameObject val64 = UPool.MyPool.AddObject("引力风暴22", val.LoadAsset<GameObject>("heidongsdaad"), true, (HideFlags)52, val31, 512093, true); GameObject val65 = UPool.MyPool.AddObject("激光子弹粒子拖尾134", val.LoadAsset<GameObject>("激光塔飞弹93029"), true, (HideFlags)52, val31, 512094, true); GameObject val66 = UPool.MyPool.AddObject("斥力风暴34", val.LoadAsset<GameObject>("斥力风暴3465"), true, (HideFlags)52, val31, 512095, true); GameObject gameObject = UPool.MyPool.AddObject("射线爆炸", val.LoadAsset<GameObject>("jiguangmingzhong"), true, (HideFlags)52, val31, 512096, true); GameObject gameObject2 = UPool.MyPool.AddObject("雷电爆炸34", val.LoadAsset<GameObject>("shandiansdf"), true, (HideFlags)52, val31, 512097, true); GameObject val67 = UPool.MyPool.AddObject("8秒后死亡", (GameObject)SLMALoader.SDic["moves"]["Head_up"], true, (HideFlags)52, val31, 512098, true); GameObject val68 = UPool.MyPool.AddObject("开局生成风暴", (GameObject)SLMALoader.SDic["moves"]["Head_up"], true, (HideFlags)52, val31, 512099, true); GameObject val69 = UPool.MyPool.AddObject("开局生成传送阵", (GameObject)SLMALoader.SDic["moves"]["Head_up"], true, (HideFlags)52, val31, 512100, true); GameObject val70 = UPool.MyPool.AddObject("生成虚拟擂台", val.LoadAsset<GameObject>("komngjin"), true, (HideFlags)52, val31, 512101, true); GameObject val71 = UPool.MyPool.AddObject("喷射器1", val.LoadAsset<GameObject>("sdfhggiseu"), true, (HideFlags)52, val31, 512102, true); GameObject val72 = UPool.MyPool.AddObject("测试服装3", val.LoadAsset<GameObject>("jiao1"), true, (HideFlags)52, val31, 512103, true); GameObject val73 = UPool.MyPool.AddObject("测试服装4", val.LoadAsset<GameObject>("huwed1"), true, (HideFlags)52, val31, 512104, true); GameObject val74 = UPool.MyPool.AddObject("测试服装5", val.LoadAsset<GameObject>("tou1"), true, (HideFlags)52, val31, 512105, true); GameObject val75 = UPool.MyPool.AddObject("测试服装6", val.LoadAsset<GameObject>("zhongjiqiangdcxzsda"), true, (HideFlags)52, val31, 512106, true); GameObject val76 = UPool.MyPool.AddObject("霓虹脖套粗1", val.LoadAsset<GameObject>("霓虹脖套1"), true, (HideFlags)52, val31, 512107, true); GameObject val77 = UPool.MyPool.AddObject("黑色现代护腿1", val.LoadAsset<GameObject>("ghjmnbfgch"), true, (HideFlags)52, val31, 512108, true); GameObject val78 = UPool.MyPool.AddObject("霓虹脖套细1", val.LoadAsset<GameObject>("霓虹脖套2"), true, (HideFlags)52, val31, 512109, true); GameObject val79 = UPool.MyPool.AddObject("霓虹袖套短1", val.LoadAsset<GameObject>("霓虹胳膊4"), true, (HideFlags)52, val31, 512110, true); GameObject val80 = UPool.MyPool.AddObject("霓虹袖套长1", val.LoadAsset<GameObject>("霓虹胳膊5"), true, (HideFlags)52, val31, 512111, true); GameObject val81 = UPool.MyPool.AddObject("霓虹黑风衣1", val.LoadAsset<GameObject>("霓虹乌萨黑1"), true, (HideFlags)52, val31, 512112, true); GameObject val82 = UPool.MyPool.AddObject("霓虹武士甲1", val.LoadAsset<GameObject>("霓虹武士套装1"), true, (HideFlags)52, val31, 512113, true); GameObject val83 = UPool.MyPool.AddObject("霓虹公用鞋1", val.LoadAsset<GameObject>("合适的协助1"), true, (HideFlags)52, val31, 512114, true); GameObject val84 = UPool.MyPool.AddObject("霓虹装甲护腿1", val.LoadAsset<GameObject>("庄家护腿3r"), true, (HideFlags)52, val31, 512115, true); GameObject val85 = UPool.MyPool.AddObject("霓虹头盔2345", val.LoadAsset<GameObject>("暴恐机动队头盔321"), true, (HideFlags)52, val31, 512116, true); GameObject val86 = UPool.MyPool.AddObject("霓虹头盔2678", val.LoadAsset<GameObject>("头盔3243245"), true, (HideFlags)52, val31, 512117, true); GameObject val87 = UPool.MyPool.AddObject("霓虹hi加3", val.LoadAsset<GameObject>("护甲1243"), true, (HideFlags)52, val31, 512118, true); GameObject val88 = UPool.MyPool.AddObject("霓虹hRGSDFGRT", val.LoadAsset<GameObject>("霓虹共用毛23"), true, (HideFlags)52, val31, 512119, true); GameObject val89 = UPool.MyPool.AddObject("霓虹测试服34", val.LoadAsset<GameObject>("fghaesdryj"), true, (HideFlags)52, val31, 512120, true); val.LoadAsset<GameObject>("siwangxiaoguo").AddComponent<烧血风扇>(); GameObject val90 = val.LoadAsset<GameObject>("nengliangpaofd"); val90.AddComponent<持续烧血效果>().cd = 0.1f; GameObject val91 = val.LoadAsset<GameObject>("chuansonmsdnxs"); val91.AddComponent<向前传送效果i>().传送距离 = 70f; val60.AddComponent<粒子该345>().redmaterial = (Material[])(object)new Material[1] { new Material(val.LoadAsset<Material>("redt1")) }; val60.GetComponentInChildren<粒子该345>().bullmaterial = (Material[])(object)new Material[1] { new Material(val.LoadAsset<Material>("bullt1")) }; val61.AddComponent<网格改色>().redmaterials = redmaterials; val61.GetComponentInChildren<网格改色>().bullmasss = bullmasss; GameObject val92 = val.LoadAsset<GameObject>("leitaucfid"); GameObject val93 = val.LoadAsset<GameObject>("qiongdidfgbdse"); GameObject val94 = val.LoadAsset<GameObject>("jiamyilefdsdf"); Transform transform = val94.transform; transform.localScale *= 1.5f; ((Component)val93.transform.Find("leidiahsdf")).gameObject.AddComponent<粒子害脚本>().gameObject1 = gameObject2; val61.AddComponent<生成擂台12332>().擂台模型 = val92; val61.GetComponentInChildren<生成擂台12332>().爆炸 = val.LoadAsset<GameObject>("leitaibaixc"); val61.GetComponentInChildren<AddForce>().force.y = 0.75f; val61.GetComponentInChildren<AddForce>().force.z *= 1.5f; val61.GetComponentInChildren<Compensation>().rangePow = 1f; val92.AddComponent<网格改色>().redmaterials = redmaterials2; val92.GetComponentInChildren<网格改色>().bullmasss = bullmasss2; val92.GetComponentInChildren<AudioSource>().spread = 15f; val92.GetComponentInChildren<AudioSource>().spatialBlend = 0.95f; val94.AddComponent<网格改色>().redmaterials = redmaterials2; val94.GetComponentInChildren<网格改色>().bullmasss = bullmasss2; val.LoadAsset<GameObject>("zuizhonglengjingzidan").AddComponent<最终冷静丢啊>(); val.LoadAsset<GameObject>("zuizhonglengjingzidan").AddComponent<粒子害脚本>().gameObject1 = gameObject; val62.GetComponentInChildren<Compensation>().rangePow = 0f; val62.GetComponentInChildren<ProjectileHit>().damage = 12f; val63.GetComponentInChildren<Compensation>().rangePow = 0f; val63.GetComponentInChildren<RemoveAfterSeconds>().seconds = 0.02f; ((Component)val65.transform.Find("toghdfifd")).gameObject.AddComponent<粒子该345子对象>().redmaterial = (Material[])(object)new Material[1] { new Material(val.LoadAsset<Material>("redt1")) }; ((Component)val65.transform.Find("toghdfifd")).gameObject.GetComponentInChildren<粒子该345子对象>().bullmaterial = (Material[])(object)new Material[1] { new Material(val.LoadAsset<Material>("bullt1")) }; val62.AddComponent<粒子该345t拖尾>().redtartymaterial = val.LoadAsset<Material>("redt1"); val62.GetComponentInChildren<粒子该345t拖尾>().bulltarymaterial = val.LoadAsset<Material>("bullt1"); val63.AddComponent<粒子该345>().redmaterial = (Material[])(object)new Material[1] { new Material(val.LoadAsset<Material>("redt1")) }; val63.GetComponentInChildren<粒子该345>().bullmaterial = (Material[])(object)new Material[1] { new Material(val.LoadAsset<Material>("bullt1")) }; Explosion componentInChildren = val66.GetComponentInChildren<Explosion>(); componentInChildren.force *= 2f; GameObject val95 = UPool.MyPool.AddObject("激光风暴45", val.LoadAsset<GameObject>("zuizhonglengjingzidan"), true, (HideFlags)52, val31, 512121, true); GameObject 物体 = val.LoadAsset<GameObject>("chuansongbaoz"); val50.AddComponent<武器跟随4756>(); val50.GetComponentInChildren<RangeWeapon>().ObjectToSpawn = val65; val51.GetComponentInChildren<RangeWeapon>().ObjectToSpawn = val60; ((Weapon)val51.GetComponentInChildren<RangeWeapon>()).maxRange = 99999f; ((Component)val52.transform.Find("W_AKSU").Find("dfsvxcdv")).gameObject.AddComponent<最终棱镜颜色材质>(); val53.GetComponentInChildren<RangeWeapon>().ObjectToSpawn = val61; RangeWeapon componentInChildren2 = val53.GetComponentInChildren<RangeWeapon>(); ((Weapon)componentInChildren2).maxRange = ((Weapon)componentInChildren2).maxRange * 1.5f; ((Weapon)val53.GetComponentInChildren<RangeWeapon>()).internalCooldown = 15f; ((Weapon)val54.GetComponentInChildren<MeleeWeapon>()).maxRange = 9999f; MeleeWeapon componentInChildren3 = val54.GetComponentInChildren<MeleeWeapon>(); componentInChildren3.curveForce *= 10f; Transform transform2 = val56.transform; transform2.localScale *= 1.3f; val56.GetComponentInChildren<CollisionWeapon>().onImpactForce = 5E+12f; val56.GetComponentInChildren<CollisionWeapon>().massCap = 1.4E+12f; val56.GetComponentInChildren<MeleeWeapon>().forceCurve = new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0.1f, 2f), new Keyframe(0.2f, 0f) }); ((Weapon)val56.GetComponentInChildren<MeleeWeapon>()).maxRange = 5f; val58.GetComponentInChildren<RangeWeapon>().magSize = 5; val58.GetComponentInChildren<RangeWeapon>().ObjectToSpawn = val63; val55.GetComponentInChildren<RangeWeapon>().ObjectToSpawn = val62; val49.AddComponent<dd秒后趋势>().计时器 = 7f; TeamColor[] componentsInChildren = val49.GetComponentsInChildren<TeamColor>(); foreach (TeamColor val96 in componentsInChildren) { val96.redMaterial = val.LoadAsset<Material>("redt2"); val96.blueMaterial = val.LoadAsset<Material>("bullt2"); } val67.AddComponent<dd秒后趋势>().计时器 = 7f; val68.AddComponent<生成物体2435>().物体1 = val93; val70.AddComponent<半血生成物体2435>().物体1 = val94; val69.AddComponent<生成物体2435>().物体1 = 物体; val69.GetComponentInChildren<生成物体2435>().rggdfr = new Vector3(0f, 1f, 0f); val47.UnitBase = unitBase; val47.RightWeapon = rightWeapon; val47.health = 9000f; val40.UnitBase = unitBase2; val40.RightWeapon = val50; val40.health = 890f; val43.RightWeapon = val51; val43.m_props = (GameObject[])(object)new GameObject[6] { val85, val84, val78, val80, val81, val83 }; val42.UnitBase = unitBase3; val42.RightWeapon = val53; val46.RightWeapon = val52; val46.m_props = (GameObject[])(object)new GameObject[5] { val77, val79, val81, val83, val88 }; val46.health = 650f; val48.RightWeapon = val54; val48.LeftWeapon = val54; val48.health = 9999999f; val48.UnitBase = val49; val39.health = 400f; val39.RightWeapon = val55; val39.m_props = (GameObject[])(object)new GameObject[6] { val87, val77, val79, val81, val83, val88 }; val41.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[1] { val68 }; val41.RightWeapon = (GameObject)SLMALoader.SDic["weapons"]["Neon_TeslaCannon"]; val41.m_props = (GameObject[])(object)new GameObject[6] { val75, val77, val79, val81, val83, val85 }; val41.health = 450f; val44.RightWeapon = val56; val44.LeftWeapon = val56; val44.health = 2000f; val44.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[1] { val70 }; val44.m_props = (GameObject[])(object)new GameObject[4] { val71, val72, val73, val74 }; val44.sizeMultiplier = 1.3f; val44.massMultiplier *= 7f; val35.RightWeapon = val58; val35.m_props = (GameObject[])(object)new GameObject[7] { val84, val78, val80, val81, val83, val87, val86 }; val35.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[1] { (GameObject)SLMALoader.SDic["moves"]["Shogun_Dodge"] }; val38.RightWeapon = rightWeapon2; val38.m_props = (GameObject[])(object)new GameObject[7] { val85, val84, val78, val80, val81, val83, val87 }; val36.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[1] { val69 }; val36.RightWeapon = rightWeapon6; val36.LeftWeapon = leftWeapon; val36.health = 1200f; val36.m_props = (GameObject[])(object)new GameObject[7] { val85, val84, val78, val80, val81, val83, val87 }; val34.RightWeapon = rightWeapon3; val34.m_props = (GameObject[])(object)new GameObject[7] { val88, val77, val76, val80, val82, val81, val83 }; val34.health = 110f; val34.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[1] { (GameObject)SLMALoader.SDic["moves"]["BlockNeon"] }; val37.massMultiplier *= 9f; val37.RightWeapon = rightWeapon4; val37.sizeMultiplier *= 1.4f; val37.health = 1499f; val37.m_props = (GameObject[])(object)new GameObject[7] { val88, val77, val78, val80, val82, val81, val83 }; val45.RightWeapon = rightWeapon5; val45.health = 900f; val45.massMultiplier *= 60f; val45.m_props = (GameObject[])(object)new GameObject[6] { val85, val77, val78, val80, val81, val83 }; val61.GetComponentInChildren<生成擂台12332>().unit4 = val48; } } public static class Utilities { private static readonly string[] sanitizationFilter; private static readonly Dictionary<GearType, string[]> boneDictionary; public static readonly Quaternion blenderToUnity; public static readonly string rootPath; public static Dictionary<string, string> language; public static readonly ContentDatabase fullDatabase; public static readonly LandfallContentDatabase database; public static Explosion[] explosions; public static UnitEffectBase[] effects; public static Sprite[] sprites; public static readonly ModExplosion unitSpawner; public static readonly ModFaction baseFaction; static Utilities() { //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Expected O, but got Unknown //IL_046e: Unknown result type (might be due to invalid IL or missing references) //IL_0473: Unknown result type (might be due to invalid IL or missing references) sanitizationFilter = new string[33] { "Icon_Legacy_", "Icons_128x128_", "Icons_", "Icon_", "CP_", "P_", "E_", " Prefabs_VB", " Effects_VB", "_1", "_2", "_3", " (1)", " (2)", " (3)", " (4)", " (5)", " (6)", "B_", "Move_", "Leg_", "1_", "12_", "15_", "6__", "7_", "14_", "2_", "8_", "10_", "16_", "5_", "3_" }; boneDictionary = new Dictionary<GearType, string[]> { { (GearType)0, new string[1] { "M_Head" } }, { (GearType)1, new string[1] { "M_Neck" } }, { (GearType)2, new string[2] { "M_Shoulder_Right", "M_Shoulder_Left" } }, { (GearType)3, new string[1] { "M_Torso" } }, { (GearType)4, new string[2] { "M_Arm_Right", "M_Arm_Left" } }, { (GearType)5, new string[2] { "M_Wrist_Right", "M_Wrist_Left" } }, { (GearType)7, new string[1] { "M_Waist" } }, { (GearType)8, new string[2] { "M_Leg_Right", "M_Leg_Left" } }, { (GearType)9, new string[2] { "M_Foot_Right", "M_Foot_Left" } } }; blenderToUnity = Quaternion.Euler(-90f, 0f, 0f); rootPath = Directory.GetParent(Assembly.GetExecutingAssembly().Location)?.ToString(); language = Localizer.GetLanguage((Language)0); fullDatabase = ContentDatabase.Instance(); database = ContentDatabase.Instance().LandfallContentDatabase; explosions = Resources.FindObjectsOfTypeAll<Explosion>(); effects = Resources.FindObjectsOfTypeAll<UnitEffectBase>(); sprites = Resources.FindObjectsOfTypeAll<Sprite>(); unitSpawner = new ModExplosion(Mod.PoolObject(new GameObject("UnitSpawner", new Type[1] { typeof(UnitSpawner) }))); List<string> source = (from z in (from z in language group z by z.Value into z where z.Count() > 1 select z).SelectMany((IGrouping<string, KeyValuePair<string, string>> z) => z) select z.Key).ToList(); Dictionary<string, int> dictionary = new Dictionary<string, int>(); foreach (string item in source.Where((string v) => language[v] != null && language[v] != string.Empty)) { if (!dictionary.ContainsKey(language[item])) { dictionary.Add(language[item], 1); continue; } dictionary[language[item]]++; language[item] = language[item] + " " + dictionary[language[item]]; } Faction val = Object.Instantiate<Faction>(GetFaction("Medieval")); val.Entity.GenerateNewID(); val.Entity.Name = "Base Faction"; val.Units = Array.Empty<UnitBlueprint>(); val.index = database.GetFactions().ToList().Count; val.m_FactionColor = HexColor("#888888"); val.m_displayFaction = false; AddFactionToDatabase(val); baseFaction = new ModFaction(val); if (Mod.DEV_MODE) { string text = Path.Combine(rootPath, "MFDPrints"); if (!Directory.Exists(text)) { Directory.CreateDirectory(text); } string contents = string.Join(Environment.NewLine, from GameObject weapon in database.GetWeapons() where (Object)(object)weapon != (Object)null select GetProperName(((CharacterItem)weapon.GetComponentInChildren<WeaponItem>()).Entity.Name)); File.WriteAllText(Path.Combine(text, "weapons.txt"), contents); string contents2 = string.Join(Environment.NewLine, from GameObject unitBase in database.GetUnitBases() where (Object)(object)unitBase != (Object)null select GetProperName(unitBase.GetComponentInChildren<Unit>().Entity.Name)); File.WriteAllText(Path.Combine(text, "bases.txt"), contents2); string contents3 = string.Join(Environment.NewLine, from GameObject clothing in database.GetCharacterProps() where (Object)(object)clothing != (Object)null select GetProperName(((CharacterItem)clothing.GetComponentInChildren<PropItem>()).Entity.Name)); File.WriteAllText(Path.Combine(text, "clothing.txt"), contents3); string contents4 = string.Join(Environment.NewLine, from IDatabaseEntity unit in database.GetUnitBlueprints() select GetProperName(unit.Entity.Name)); File.WriteAllText(Path.Combine(text, "unit.txt"), contents4); string contents5 = string.Join(Environment.NewLine, from IDatabaseEntity faction in database.GetFactions() select GetProperName(faction.Entity.Name)); File.WriteAllText(Path.Combine(text, "factions.txt"), contents5); string contents6 = string.Join(Environment.NewLine, from Explosion explosion in explosions where (Object)(object)explosion != (Object)null select GetProperName(((Object)((Component)explosion).gameObject).name)); File.WriteAllText(Path.Combine(text, "explosions.txt"), contents6); string contents7 = string.Join(Environment.NewLine, from UnitEffectBase effect in effects where (Object)(object)effect != (Object)null select GetProperName(((Object)((Component)effect).gameObject).name)); File.WriteAllText(Path.Combine(text, "effects.txt"), contents7); string contents8 = string.Join(Environment.NewLine, from GameObject projectile in database.GetProjectiles() select GetProperName(projectile.GetComponentInChildren<ProjectileEntity>().Entity.Name)); File.WriteAllText(Path.Combine(text, "projectiles.txt"), contents8); string contents9 = string.Join(Environment.NewLine, from GameObject move in database.GetCombatMoves() select GetProperName(((CharacterItem)move.GetComponentInChildren<SpecialAbility>()).Entity.Name)); File.WriteAllText(Path.Combine(text, "moves.txt"), contents9); string contents10 = string.Join(Environment.NewLine, from FactionIcon icon in fullDatabase.GetFactionIcons() select GetProperName(icon.Entity.Name)); File.WriteAllText(Path.Combine(text, "icons.txt"), contents10); string contents11 = string.Join(Environment.NewLine, from Sprite icon in Resources.FindObjectsOfTypeAll<Sprite>() select GetProperName(((Object)icon).name)); File.WriteAllText(Path.Combine(text, "iconsExtra.txt"), contents11); } } public static object CallMethod(this object o, string methodName, params object[] args) { MethodInfo method = o.GetType().GetMethod(methodName, (BindingFlags)(-1)); if (method != null) { return method.Invoke(o, args); } Debug.Log((object)("Call Method " + methodName + " nulled")); return null; } public static object GetField<T>(this T instance, string fieldName, BindingFlags flags = (BindingFlags)(-1)) { FieldInfo field = typeof(T).GetField(fieldName, flags); try { field.GetValue(instance); } catch { Debug.Log((object)$"(GetField) Failed to get field '{fieldName}' for object '{typeof(T)}'. Try using manual BindingFlags."); } return field.GetValue(instance); } public static void SetField<T>(this T instance, string fieldName, object newValue, BindingFlags flags = (BindingFlags)(-1)) { FieldInfo field = typeof(T).GetField(fieldName, flags); Debug.Log((object)field); try { field.SetValue(instance, newValue); } catch { Debug.Log((object)$"(SetField) Failed to set field '{fieldName}' for object '{typeof(T)}'. Try using manual BindingFlags."); } } public static Transform SetHideFlagsChildren(this Transform t, HideFlags hf = 52) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)((Component)t).gameObject)) { ((Object)((Component)t).gameObject).hideFlags = hf; } if (t.childCount > 0) { for (int i = 0; i < t.childCount; i++) { t.GetChild(i).SetHideFlagsChildren(hf); } } return t; } public static Sprite CreateSprite(string path) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) if (string.IsNullOrEmpty(path)) { return null; } if (!File.Exists(path)) { return null; } byte[] array = File.ReadAllBytes(path); Texture2D val = new Texture2D(1, 1); ImageConversion.LoadImage(val, array); ((Texture)val).filterMode = (FilterMode)0; return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0f, 0f), 1f); } public static bool NullCheck(this object self, string flag = "Object") { Debug.Log((object)("[NULLCHECK] " + flag + " is " + ((self == null) ? "NULL" : "REAL") + "!")); return self == null; } public static T GetResourcesObj<T>(string obj) { Object[] source = Resources.FindObjectsOfTypeAll(typeof(T)); return (T)(object)((IEnumerable<Object>)source).FirstOrDefault((Func<Object, bool>)((Object x) => x.name.Contains(obj))); } public static string IncrementName(string name) { return name.Contains(";") ? (name.Split(new char[1] { ';' })[0] + int.Parse(name.Split(new char[1] { ';' })[1]) + 1) : (name + ";1"); } public static void ForEach<T>(this IEnumerable<T> collection, Action<T> action) { foreach (T item in collection) { action(item); } } public static void ForEach<T>(this T[] array, Action<T> action) { foreach (T obj in array) { action(obj); } } public static Dictionary<V, U> Reverse<U, V>(this Dictionary<U, V> self) { Dictionary<V, U> dictionary = new Dictionary<V, U>(); foreach (U key in self.Keys) { dictionary[self[key]] = key; } return dictionary; } public static Color HexColor(string hexCode) { //IL_002c: 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_0030: Unknown result type (might be due to invalid IL or missing references) hexCode = (hexCode.StartsWith("#") ? hexCode : ("#" + hexCode)).ToUpper(); Color result = default(Color); ColorUtility.TryParseHtmlString(hexCode, ref result); return result; } public static T FindVanillaObject<T>(IEnumerable<T> source, string name, Func<T, string> getName) { return source.FirstOrDefault((T o) => name == GetProperName(getName(o))); } public static string GetProperName(string name) { string text = null; if (language.ContainsKey(name)) { text = language[name]; } else { text = name; string[] array = sanitizationFilter; foreach (string oldValue in array) { text = text.Replace(oldValue, ""); } } return text; } public static string DeepString(this GameObject self) { string text = "\nGameObject '" + ((Object)self).name + "':\n{\n\tComponents:\n\t{\n"; text = string.Concat(text, string.Concat(from Component component in self.GetComponents<Component>() select "\t\t" + ((object)component).GetType().Name + "\n")); text += "\t}\n"; if (self.transform.childCount > 0) { text += "\tChildren:\n\t{\n"; text = string.Concat(text, string.Concat(from Transform child in (IEnumerable)self.transform select ((Component)child).gameObject.DeepString().Replace("\n", "\n\t\t"))); text += "\n\t}\n"; } return text + "}\n"; } public static void PlaceMeshOnBone(SkinnedMeshRenderer renderer, GameObject mesh, GearType gearType) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) string text = boneDictionary[gearType][0]; Transform[] bones = renderer.bones; foreach (Transform val in bones) { if (((Object)val).name == text) { mesh.transform.parent = ((Component)val).transform; mesh.transform.localPosition = Vector3.zero; mesh.transform.localRotation = Quaternion.Euler(-90f, 0f, 0f); } } } public static void SetMeshRenderers(GameObject gameObject, bool enabled) { Renderer[] componentsInChildren = gameObject.GetComponentsInChildren<Renderer>(); for (int i = 0; i < componentsInChildren.Length; i++) { Type type = ((object)componentsInChildren[i]).GetType(); if (type == typeof(MeshRenderer) || type == typeof(SkinnedMeshRenderer)) { componentsInChildren[i].enabled = enabled; } } } public static void SetObjectColor(GameObject colorObject, int index, Color color, float glow) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) Renderer[] bestRenderers = GetBestRenderers(colorObject); Renderer bestRenderer = GetBestRenderer(colorObject); bool flag = (Object)(object)colorObject.GetComponentInChildren<LODGroup>() != (Object)null; Dictionary<Color, Material> dictionary = new Dictionary<Color, Material>(); Material[] materials = bestRenderer.materials; Material val = new Material(Shader.Find("Standard")); val.color = color; if (glow > 0f) { val.EnableKeyword("_EMISSION"); val.SetColor("_EmissionColor", val.color * glow); } val.SetFloat("_Glossiness", 0f); if (!Object.op_Implicit((Object)(object)bestRenderer)) { return; } for (int j = 0; j < materials.Length; j++) { if (j == index) { dictionary[materials[j].color] = val; } } if (bestRenderers == null || bestRenderers.Length == 0) { return; } if (flag) { Renderer[] array = bestRenderers; foreach (Renderer val2 in array) { List<TeamColor> source = ((Component)val2).GetComponents<TeamColor>().ToList(); List<TeamColor> removed = new List<TeamColor>(); Material[] materials2 = val2.materials; List<Material> list = new List<Material>(); int i; for (i = 0; i < materials2.Length; i++) { Material val3 = null; if (dictionary.ContainsKey(materials2[i].color)) { val3 = dictionary[materials2[i].color]; } if ((Object)(object)val3 != (Object)null) { list.Add(val3); foreach (TeamColor item in source.Where((TeamColor tc) => !removed.Contains(tc) && tc.materialID == i)) { removed.Add(item); Object.DestroyImmediate((Object)(object)item); } } else { list.Add(materials2[i]); } } val2.materials = list.ToArray(); } return; } int num = 0; Renderer[] array2 = bestRenderers; foreach (Renderer val4 in array2) { Material[] materials3 = val4.materials; List<TeamColor> list2 = ((Component)val4).GetComponents<TeamColor>().ToList(); for (int m = 0; m < materials3.Length; m++) { if (num + m != index) { continue; } materials3[m] = val; foreach (TeamColor item2 in list2) { if (item2.materialID == m) { Object.DestroyImmediate((Object)(object)item2); } } } num++; val4.materials = materials3; } } public static void SetClothScale(ModClothing clothing, Vector3 scale) { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) GameObject internalObject = clothing.internalObject; if ((Object)(object)internalObject.GetComponentInChildren<MeshRenderer>() != (Object)null) { MeshRenderer[] componentsInChildren = internalObject.GetComponentsInChildren<MeshRenderer>(); foreach (MeshRenderer val in componentsInChildren) { ((Component)val).transform.localScale = scale; } } if (!((Object)(object)internalObject.GetComponentInChildren<SkinnedMeshRenderer>() != (Object)null)) { return; } Vector3 localScale = internalObject.transform.localScale; SkinnedMeshRenderer[] componentsInChildren2 = internalObject.GetComponentsInChildren<SkinnedMeshRenderer>(); foreach (SkinnedMeshRenderer val2 in componentsInChildren2) { val2.sharedMesh = Object.Instantiate<Mesh>(val2.sharedMesh); Mesh sharedMesh = val2.sharedMesh; ((Object)sharedMesh).name = clothing.Name + "sharedmesh"; Vector3[] vertices = sharedMesh.vertices; if (vertices == null) { vertices = sharedMesh.vertices; } Debug.Log((object)("baseVertices " + vertices.Length)); Vector3[] array = (Vector3[])(object)new Vector3[vertices.Length]; for (int k = 0; k < array.Length; k++) { Vector3 val3 = vertices[k]; val3.x /= localScale.x; val3.y /= localScale.y; val3.z /= localScale.z; val3.x *= scale.x; val3.y *= scale.y; val3.z *= scale.z; array[k] = val3; } internalObject.transform.localScale = scale; sharedMesh.vertices = array; sharedMesh.RecalculateBounds(); val2.sharedMesh = sharedMesh; } } public static Renderer GetBestRenderer(GameObject gameObject, Type rendererType = null) { if (rendererType == null) { rendererType = typeof(Renderer); } else if (!rendererType.IsSubclassOf(typeof(Renderer))) { return null; } Renderer val = null; Renderer[] componentsInChildren = gameObject.GetComponentsInChildren<Renderer>(); bool flag = false; Renderer[] array = componentsInChildren; foreach (Renderer val2 in array) { if (((object)val2).GetType() == rendererType || rendererType == typeof(Renderer)) { string name = ((Object)((Component)val2).gameObject).name; if (name.Contains("LOD0")) { val = val2; flag = true; } else if (name.Contains("CP_") && !flag) { val = val2; flag = true; } else if (name.ToLower().Contains(((Object)gameObject.gameObject).name.ToLower()) && !flag) { val = val2; } else if (!Object.op_Implicit((Object)(object)val) && name != "RightHand" && name != "LeftHand" && !flag) { val = val2; } } } return val; } public static Renderer[] GetBestRenderers(GameObject gameObject, Type rendererType = null) { if (rendererType == null) { rendererType = typeof(Renderer); } else if (!rendererType.IsSubclassOf(typeof(Renderer))) { return null; } Renderer[] componentsInChildren = gameObject.GetComponentsInChildren<Renderer>(); List<Renderer> list = new List<Renderer>(); bool flag = false; LODGroup componentInChildren = gameObject.GetComponentInChildren<LODGroup>(); if (Object.op_Implicit((Object)(object)componentInChildren)) { flag = true; list.AddRange(componentInChildren.GetLODs().SelectMany((LOD lod) => lod.renderers)); } Renderer[] array = componentsInChildren; foreach (Renderer val in array) { if (!list.Contains(val) && (((object)val).GetType() == rendererType || rendererType == typeof(Renderer))) { string name = ((Object)gameObject).name; if (name.Contains("LOD") && ((Object)((Component)val).transform.parent).name.ToLower().Contains("base")) { list.Add(val); flag = true; } else if (name.Contains("LOD")) { list.Add(val); flag = true; } else if (name.Contains("CP_") && !flag) { list.Add(val); flag = true; } else if (name.ToLower().Contains(((Object)gameObject).name.ToLower()) && !flag) { list.Add(val); } else if (list.Count <= 0 && name != "RightHand" && name != "LeftHand" && !flag) { list.Add(val); } } } return list.ToArray(); } public static GameObject GetUnitBase(string name) { return FindVanillaObject(database.GetUnitBases(), name, (GameObject ub) => ub.GetComponentInChildren<Unit>().Entity.Name); } public static GameObject GetClothing(string name) { return FindVanillaObject(database.GetCharacterProps(), name, (GameObject c) => ((CharacterItem)c.GetComponentInChildren<PropItem>()).Entity.Name); } public static GameObject GetWeapon(string name) { return FindVanillaObject(database.GetWeapons(), name, (GameObject w) => ((CharacterItem)w.GetComponentInChildren<WeaponItem>()).Entity.Name); } public static GameObject GetMove(string name) { return FindVanillaObject(database.GetCombatMoves(), name, (GameObject m) => ((CharacterItem)m.GetComponentInChildren<SpecialAbility>()).Entity.Name); } public static GameObject GetProjectile(string name) { GameObject gameObject = FindVanillaObject(database.GetProjectiles(), name, (GameObject p) => p.GetComponent<ProjectileEntity>().Entity.Name).gameObject; return ((Object)(object)gameObject != (Object)null) ? gameObject.gameObject : null; } public static GameObject GetExplosion(string name) { Explosion val = FindVanillaObject(explosions, name, (Explosion e) => ((Object)((Component)e).gameObject).name); return ((Object)(object)val != (Object)null) ? ((Component)val).gameObject : null; } public static UnitEffectBase GetEffect(string name) { return FindVanillaObject(effects, name, (UnitEffectBase e) => ((Object)((Component)e).gameObject).name); } public static Sprite GetIcon(string name) { FactionIcon val = FindVanillaObject(fullDatabase.GetFactionIcons(), name, (FactionIcon i) => i.Entity.Name); if ((Object)(object)val != (Object)null) { return val.Entity.SpriteIcon; } Sprite val2 = FindVanillaObject(AssetImporter.Sprites, name, (Sprite s) => ((Object)s).name); if ((Object)(object)val2 != (Object)null) { return val2; } return FindVanillaObject(sprites, name, (Sprite s) => ((Object)s).name); } public static UnitBlueprint GetUnit(string name) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) UnitBlueprint val = FindVanillaObject(database.GetUnitBlueprints(), name, (UnitBlueprint u) => u.Entity.Name); return ((Object)(object)val != (Object)null) ? database.GetUnitBlueprint(val.Entity.GUID) : null; } public static Faction GetFaction(string name) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) Faction val = FindVanillaObject(database.GetFactions(), name, (Faction f) => f.Entity.Name); return ((Object)(object)val != (Object)null) ? database.GetFaction(val.Entity.GUID) : null; } public static void AddUnitToDatabase(UnitBlueprint unit) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) Dictionary<DatabaseID, Object> dictionary = (Dictionary<DatabaseID, Object>)typeof(AssetLoader).GetField("m_nonStreamableAssets", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(fullDatabase.AssetLoader); Dictionary<DatabaseID, UnitBlueprint> dictionary2 = (Dictionary<DatabaseID, UnitBlueprint>)typeof(LandfallContentDatabase).GetField("m_unitBlueprints", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(database); if (!dictionary2.ContainsKey(unit.Entity.GUID)) { dictionary2.Add(unit.Entity.GUID, unit); dictionary.Add(unit.Entity.GUID, (Object)(object)unit); } typeof(LandfallContentDatabase).GetField("m_unitBlueprints", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(database, dictionary2); typeof(AssetLoader).GetField("m_nonStreamableAssets", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(fullDatabase.AssetLoader, dictionary); } public static void AddFactionToDatabase(Faction faction) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) Dictionary<DatabaseID, Object> dictionary = (Dictionary<DatabaseID, Object>)typeof(AssetLoader).GetField("m_nonStreamableAssets", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(fullDatabase.AssetLoader); Dictionary<DatabaseID, Faction> dictionary2 = (Dictionary<DatabaseID, Faction>)typeof(LandfallContentDatabase).GetField("m_factions", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(database); if (!dictionary2.ContainsKey(faction.Entity.GUID)) { dictionary2.Add(faction.Entity.GUID, faction); dictionary.Add(faction.Entity.GUID, (Object)(object)faction); } typeof(LandfallContentDatabase).GetField("m_factions", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(database, dictionary2); typeof(AssetLoader).GetField("m_nonStreamableAssets", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(fullDatabase.AssetLoader, dictionary); } public static GameObject GetModel(string name) { GameObject val = FindVanillaObject(AssetImporter.Models, name, (GameObject m) => ((Object)m.gameObject).name); return ((Object)(object)val != (Object)null) ? val.gameObject : null; } public static void SetFlagsChildren(Transform child, HideFlags flag) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) ((Object)((Component)child).gameObject).hideFlags = flag; for (int i = 0; i < child.childCount; i++) { SetFlagsChildren(child.GetChild(i), flag); } } } } namespace ModdingForDummies.TABSSimp { public abstract class Mod { private const string KEY_BASES = "bases"; private const string KEY_UNITS = "units"; private const string KEY_FACTIONS = "factions"; private const string KEY_WEAPONS = "weapons"; private const string KEY_CLOTHES = "clothes"; private const string KEY_PROJECTILES = "projectiles"; private const string KEY_MOVES = "moves"; private const string KEY_EXPLOSIONS = "explosions"; private const string KEY_ICONS = "icons"; private const string KEY_EFFECTS = "effects"; private const string KEY_MODELS = "models"; private static Dictionary<string, Dictionary<string, object>> vanilla; private static Dictionary<string, Dictionary<string, object>> modified; private static GameObject pool; public static bool DEV_MODE { get; protected set; } static Mod() { //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Expected O, but got Unknown DEV_MODE = true; vanilla = new Dictionary<string, Dictionary<string, object>>(); modified = new Dictionary<string, Dictionary<string, object>>(); vanilla["bases"] = new Dictionary<string, object>(); vanilla["units"] = new Dictionary<string, object>(); vanilla["factions"] = new Dictionary<string, object>(); vanilla["weapons"] = new Dictionary<string, object>(); vanilla["clothes"] = new Dictionary<string, object>(); vanilla["projectiles"] = new Dictionary<string, object>(); vanilla["moves"] = new Dictionary<string, object>(); vanilla["explosions"] = new Dictionary<string, object>(); vanilla["icons"] = new Dictionary<string, object>(); vanilla["effects"] = new Dictionary<string, object>(); vanilla["models"] = new Dictionary<string, object>(); modified["bases"] = new Dictionary<string, object>(); modified["units"] = new Dictionary<string, object>(); modified["factions"] = new Dictionary<string, object>(); modified["weapons"] = new Dictionary<string, object>(); modified["clothes"] = new Dictionary<string, object>(); modified["projectiles"] = new Dictionary<string, object>(); modified["moves"] = new Dictionary<string, object>(); modified["explosions"] = new Dictionary<string, object>(); modified["icons"] = new Dictionary<string, object>(); modified["effects"] = new Dictionary<string, object>(); modified["models"] = new Dictionary<string, object>(); GameObject val = new GameObject("Pool") { hideFlags = (HideFlags)61 }; val.transform.position = Vector3.down * -1000f; pool = val; pool.SetActive(false); } public static GameObject PoolObject(GameObject gameObject) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) gameObject.transform.parent = pool.transform; gameObject.transform.localPosition = Vector3.zero; pool.transform.SetHideFlagsChildren((HideFlags)61); return gameObject; } public static GameObject CloneAndPoolObject(GameObject obj) { GameObject val = Object.Instantiate<GameObject>(obj, pool.transform); PoolObject(val); return val; } private static M CreateObject<M>(string key, Func<string, M> query, Action<M> processClone, string name, string originalName) where M : ModdingClass<M> { M val = null; M val2 = query(originalName); if (val2 != null) { val = val2.Clone(); processClone?.Invoke(val); val.Name = name; modified[key][name] = val; } return val; } private static M GetObject<M, R>(string key, Func<string, R> query, Func<R, M> generate, string name) { M val = default(M); if (modified[key].ContainsKey(name)) { val = (M)modified[key][name]; } else if (vanilla[key].ContainsKey(name)) { val = (M)vanilla[key][name]; } else { R val2 = query(name); if (val2 != null) { val = generate(val2); vanilla[key][name] = val; } } if (val == null) { Debug.LogError((object)("[MFD] Could not find '" + name + "' in '" + key + "'.")); } return val; } public static ModUnit GetUnit(string name) { return GetObject("units", Utilities.GetUnit, (UnitBlueprint u) => new ModUnit(u), name); } public static ModUnit CreateUnit(string name, string originalName = null) { return CreateObject("units", GetUnit, delegate(ModUnit mu) { if (originalName == null) { mu.Clothes.Clear(); } }, name, (originalName == null) ? "Peasant" : originalName); } public static ModFaction GetFaction(string name) { return GetObject("factions", Utilities.GetFaction, (Faction f) => new ModFaction(f), name); } public static ModFaction CreateFaction(string name, string originalName = null) { return CreateObject("factions", GetFaction, delegate(ModFaction mf) { mf.Units.Clear(); mf.Visible = true; }, name, (originalName == null) ? "Base Faction" : originalName); } public static ModWeapon GetWeapon(string name) { return GetObject("weapons", Utilities.GetWeapon, (GameObject w) => new ModWeapon(w), name); } public static ModWeapon CreateWeapon(string name, string originalName) { return CreateObject("weapons", GetWeapon, null, name, originalName); } public static ModClothing GetClothing(string name) { return GetObject("clothes", Utilities.GetClothing, (GameObject c) => new ModClothing(c), name); } public static ModClothing CreateClothing(string name, string originalName) { return CreateObject("clothes", GetClothing, null, name, originalName); } public static ModMove GetMove(string name) { return GetObject("moves", Utilities.GetMove, (GameObject m) => new ModMove(m), name); } public static ModMove CreateMove(string name, string originalName) { return CreateObject("moves", GetMove, null, name, originalName); } public static ModProjectile GetProjectile(string name) { return GetObject("projectiles", Utilities.GetProjectile, (GameObject p) => new ModProjectile(p), name); } public static ModProjectile CreateProjectile(string name, string originalName) { return CreateObject("projectiles", GetProjectile, null, name, originalName); } public static ModExplosion GetExplosion(string name) { return GetObject("explosions", Utilities.GetExplosion, (GameObject e) => new ModExplosion(e), name); } public static ModExplosion CreateExplosion(string name, string originalName) { return CreateObject("explosions", GetExplosion, null, name, originalName); } public static ModEffect GetEffect(string name) { return GetObject("effects", Utilities.GetEffect, (UnitEffectBase e) => new ModEffect(e), name); } public static ModEffect CreateEffect(string name, string originalName) { return CreateObject("effects", GetEffect, null, name, originalName); } public static ModBase GetBase(string name) { return GetObject("bases", Utilities.GetUnitBase, (GameObject b) => new ModBase(b), name); } public static ModBase CreateBase(string name, string originalName) { return CreateObject("bases", GetBase, null, name, originalName); } public static ModModel GetModel(string name) { return GetObject("models", Utilities.GetModel, (GameObject m) => new ModModel(m), name); } public static ModModel CreateModel(string name, string originalName) { return CreateObject("models", GetModel, null, name, originalName); } public static Sprite GetIcon(string name) { return GetObject("icons", Utilities.GetIcon, (Sprite s) => s, name); } } public class ModBase : ModdingClass<ModBase> { public GameObject internalObject { get; private set; } public override string Name { get { return ((Object)internalObject.gameObject).name; } set { ((Object)internalObject.gameObject).name = value; } } public override void ColorInternal(int index, Color color, float glow = 0f) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) Utilities.SetObjectColor(internalObject, index, color, glow); } public ModBase(GameObject unitBase) { internalObject = unitBase; } public override ModBase Clone() { GameObject unitBase = Mod.CloneAndPoolObject(internalObject); return new ModBase(unitBase); } public override void Separate() { } } public enum ClothingType { Static, Skinned } public class ModClothing : ModdingClass<ModClothing> { private PropItem item; private SkinnedMeshRenderer renderer; private ModModel model; public GameObject internalObject { get; private set; } public ClothingType Type { get; private set; } public override string Name { get { return ((CharacterItem)item).Entity.Name; } set { ((CharacterItem)item).Entity.Name = value; } } public ModModel Model { get { return model; } set { //IL_0065: 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_00c2: Unknown result type (might be due to invalid IL or missing references) if (value != null) { Utilities.SetMeshRenderers(internalObject, enabled: false); model = value.Clone(); if (Type == ClothingType.Static) { model.internalObject.transform.parent = internalObject.transform; model.internalObject.transform.localPosition = Vector3.zero; model.internalObject.transform.localRotation = Quaternion.Euler(-90f, 0f, 0f); } else if (Type == ClothingType.Skinned) { Utilities.PlaceMeshOnBone(renderer, model.internalObject, ((CharacterItem)item).GearT); } } else { if (model != null) { Utilities.SetMeshRenderers(internalObject, enabled: true); } model = null; } } } public float Size { get { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) Vector3 localScale = internalObject.transform.localScale; return (localScale.x + localScale.y + localScale.z) / 3f; } set { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) Utilities.SetClothScale(this, Vector3.one * value); } } public Vector3 Scale { get { //IL_000b: Unknown result type (might be due to invalid IL or missing references) return internalObject.transform.localScale; } set { //IL_0001: Unknown result type (might be due to invalid IL or missing references) Utilities.SetClothScale(this, value); } } public override void ColorInternal(int index, Color color, float glow = 0f) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (model == null) { Utilities.SetObjectColor(internalObject, index, color, glow); } else { model.Color(index, color, glow); } } public ModClothing(GameObject prop) { internalObject = Mod.CloneAndPoolObject(prop); renderer = internalObject.GetComponentInChildren<SkinnedMeshRenderer>(); Type = (((Object)(object)renderer != (Object)null) ? ClothingType.Skinned : ClothingType.Static); item = internalObject.GetComponentInChildren<PropItem>(); } public override ModClothing Clone() { ModClothing modClothing = new ModClothing(internalObject) { Model = Model }; modClothing.Separate(); return modClothing; } public override void Separate() { } } public abstract class ModdingClass<T> where T : ModdingClass<T> { public abstract string Name { get; set; } public abstract T Clone(); public abstract void Separate(); public abstract void ColorInternal(int index, Color color, float glow = 0f); public void Color(Color color, float glow = 0f) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) ColorInternal(0, color, glow); } public void Color(string color, float glow = 0f) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) Color(0, Utilities.HexColor(color), glow); } public void Color(int index, Color color, float glow = 0f) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) ColorInternal(index, color, glow); } public void Color(int index, string color, float glow = 0f) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) Color(index, Utilities.HexColor(color), glow); } public void Colors(params Color[] colors) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < colors.Length; i++) { Color(i, colors[i]); } } public void Colors(params string[] colors) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < colors.Length; i++) { Color(i, Utilities.HexColor(colors[i])); } } public void Colors(params (Color color, float glow)[] colors) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < colors.Length; i++) { Color(i, colors[i].color, colors[i].glow); } } public void Colors(params (string color, float glow)[] colors) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < colors.Length; i++) { Color(i, Utilities.HexColor(colors[i].color), colors[i].glow); } } } public class ModEffect : ModdingClass<ModEffect> { public UnitEffectBase internalObject { get; private set; } public override string Name { get { return ((Object)((Component)internalObject).gameObject).name; } set { ((Object)((Component)internalObject).gameObject).name = value; } } public override void ColorInternal(int index, Color color, float glow = 0f) { } public ModEffect(UnitEffectBase effect) { internalObject = effect; } public override ModEffect Clone() { GameObject val = Mod.CloneAndPoolObject(((Component)internalObject).gameObject); return new ModEffect(val.GetComponent<UnitEffectBase>()); } public override void Separate() { } } public class ModExplosion : ModdingClass<ModExplosion> { private Explosion explosion; private ExplosionAddEffect addEffect; private ModEffect effect; public GameObject internalObject { get; private set; } public override string Name { get { return ((Object)internalObject).name; } set { ((Object)internalObject).name = value; } } public float Damage { get { if (Object.op_Implicit((Object)(object)explosion)) { return explosion.damage; } return 0f; } set { if (Object.op_Implicit((Object)(object)explosion)) { explosion.damage = value; } } } public float Force { get { if (Object.op_Implicit((Object)(object)explosion)) { return explosion.force; } return 0f; } set { if (Object.op_Implicit((Object)(object)explosion)) { explosion.force = value; } } } public ForceDirection ForceDirection { get { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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) if (Object.op_Implicit((Object)(object)explosion)) { return explosion.forceDirection; } return (ForceDirection)0; } set { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)explosion)) { explosion.forceDirection = value; } } } public float Radius { get { if (Object.op_Implicit((Object)(object)explosion)) { return explosion.radius; } return 0f; } set { if (Object.op_Implicit((Object)(object)explosion)) { explosion.radius = value; } } } public ModEffect Effect { get { return effect; } set { effect = value; if (!Object.op_Implicit((Object)(object)addEffect)) { addEffect = internalObject.AddComponent<ExplosionAddEffect>(); } if (value != null) { addEffect.EffectPrefab = value.internalObject; } else { addEffect.EffectPrefab = null; } } } public float Size { get { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) Vector3 localScale = internalObject.transform.localScale; return (localScale.x + localScale.y + localScale.z) / 3f; } set { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) internalObject.transform.localScale = Vector3.one * value; } } public Vector3 Scale { get { //IL_000b: Unknown result type (might be due to invalid IL or missing references) return internalObject.transform.localScale; } set { //IL_000b: Unknown result type (might be due to invalid IL or missing references) internalObject.transform.localScale = value; } } public override void ColorInternal(int index, Color color, float glow = 0f) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) Utilities.SetObjectColor(internalObject, index, color, glow); } public ModExplosion(GameObject explosionObject) { internalObject = explosionObject; explosion = internalObject.GetComponentInChildren<Explosion>(); addEffect = internalObject.GetComponentInChildren<ExplosionAddEffect>(); } public override ModExplosion Clone() { GameObject explosionObject = Mod.CloneAndPoolObject(internalObject); ModExplosion modExplosion = new ModExplosion(explosionObject); if (Effect != null) { modExplosion.Effect = Effect; } return modExplosion; } public override void Separate() { if (Effect != null) { Effect = Effect.Clone(); } } } public class ModFaction : ModdingClass<ModFaction> { public Faction internalObject { get; private set; } public WrapperDelineation<ModUnit> Units { get; private set; } public UnitBlueprint[] Blueprints => Units.List.Select((ModUnit w) => w.internalObject).ToArray(); public override string Name { get { return internalObject.Entity.Name; } set { internalObject.Entity.Name = value; } } public bool Visible { get { return internalObject.m_displayFaction; } set { internalObject.m_displayFaction = value; } } public Sprite Icon { get { return internalObject.Entity.SpriteIcon; } set { internalObject.Entity.SetSpriteIcon(value); } } private void UpdateBlueprints(List<ModUnit> units) { internalObject.Units = (from ModUnit unit in units select unit.internalObject).ToArray(); } public ModUnit NewUnit(string name, string originalName = null) { ModUnit modUnit = Mod.CreateUnit(name, originalName); Units.Add(modUnit); return modUnit; } public override void ColorInternal(int index, Color color, float glow = 0f) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) internalObject.m_FactionColor = color; } public ModFaction(Faction faction) { internalObject = faction; Units = new WrapperDelineation<ModUnit>(UpdateBlueprints, Mod.GetUnit) { List = (from UnitBlueprint blueprint in internalObject.Units select new ModUnit(blueprint)).ToList() }; } public override ModFaction Clone() { Faction val = Object.Instantiate<Faction>(internalObject); val.Entity.GenerateNewID(); val.Entity.Name = Utilities.IncrementName(Name); val.Units = Array.Empty<UnitBlueprint>(); val.index = Utilities.database.GetFactions().ToList().Count; Utilities.AddFactionToDatabase(val); ModFaction modFaction = new ModFaction(val); modFaction.Separate(); return modFaction; } public override void Separate() { Units.List = (from ModUnit unit in Units.List select unit.Clone()).ToList(); } } public class ModModel : ModdingClass<ModModel> { private Vector3 position; private Quaternion rotation; public GameObject internalObject { get; private set; } public override string Name { get { return ((Object)internalObject.gameObject).name; } set { ((Object)internalObject.gameObject).name = value; } } public Vector3 Position { get { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return position; } set { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) position = value; internalObject.transform.localPosition = position; } } public Quaternion Rotation { get { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return rotation; } set { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0013: 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_001e: Unknown result type (might be due to invalid IL or missing references) rotation = value; internalObject.transform.localRotation = Utilities.blenderToUnity * rotation; } } public override void ColorInternal(int index, Color color, float glow = 0f) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) Utilities.SetObjectColor(internalObject, index, color, glow); } public ModModel(GameObject model) { internalObject = model; } public override ModModel Clone() { GameObject model = Mod.CloneAndPoolObject(internalObject); return new ModModel(model); } public override void Separate() { } } public class ModMove : ModdingClass<ModMove> { private SpecialAbility specialAbility; public GameObject internalObject { get; private set; } public override string Name { get { return ((CharacterItem)specialAbility).Entity.Name; } set { ((CharacterItem)specialAbility).Entity.Name = value; } } public override void ColorInternal(int index, Color color, float glow = 0f) { } public ModMove(GameObject move) { internalObject = move; specialAbility = move.GetComponentInChildren<SpecialAbility>(); } public override ModMove Clone() { GameObject move = Mod.CloneAndPoolObject(internalObject); return new ModMove(move); } public override void Separate() { } } public enum ProjectileType { Regular, Physical, Other } public class ModProjectile : ModdingClass<ModProjectile> { private ProjectileEntity projectileEntity; private ProjectileHit rHit; private MoveTransform rMoveTransform; private ProjectileHitAddEffect rAddEffect; private CollisionWeapon pCollision; private AddForce pAddForce; private MeleeWeaponAddEffect pAddEffect; private MeleeWeaponSpawn pSpawner; private ModModel model; private ModEffect effect; private ModUnit unit; public GameObject internalObject { get; private set; } public override string Name { get { return projectileEntity.Entity.Name; } set { projectileEntity.Entity.Name = value; } } public ProjectileType Type { get; private set; } public ModModel Model { get { return model; } set { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) if (value != null) { Utilities.SetMeshRenderers(internalObject, enabled: false); model = value.Clone(); model.internalObject.transform.parent = internalObject.transform; model.internalObject.transform.localPosition = Vector3.zero; model.internalObject.transform.localRotation = Quaternion.Euler(-90f, 0f, 0f); } else { if (model != null) { Utilities.SetMeshRenderers(internalObject, enabled: true); } model = null; } } } public ModEffect Effect { get { return effect; } set { effect = value; if (Type == ProjectileType.Regular) { if (!Object.op_Implicit((Object)(object)rAddEffect)) { rAddEffect = ((Component)rHit).gameObject.AddComponent<ProjectileHitAddEffect>(); } rAddEffect.EffectPrefab = value?.internalObject; } else if (Type == ProjectileType.Physical) { if (!Object.op_Implicit((Object)(object)pAddEffect)) { pAddEffect = ((Component)pCollision).gameObject.AddComponent<MeleeWeaponAddEffect>(); } pAddEffect.EffectPrefab = value?.internalObject; } } } public WrapperDelineation<ModExplosion> Explosions { get; private set; } public ModExplosion Explosion { get { ModExplosion result = null; if (Explosions.List.Count > 0) { result = Explosions.List[0]; } return result; } set { Explosions.Clear(); if (value != null) { Explosions.Add(value); } } } public ModUnit Unit { get { return unit; } set { unit = value; Explosions.Clear(); ModExplosion modExplosion = Utilities.unitSpawner.Clone(); modExplosion.internalObject.GetComponent<UnitSpawner>().unitBlueprint = unit.internalObject; Explosions.Add(modExplosion); } } public float Damage { get { if (Type == ProjectileType.Regular) { return rHit.damage; } if (Type == ProjectileType.Physical) { return pCollision.damage; } return 0f; } set { if (Type == ProjectileType.Regular) { rHit.damage = value; } else if (Type == ProjectileType.Physical) { pCollision.damage = value; } } } public float Force { get { if (Type == ProjectileType.Regular) { return rHit.force; } if (Type == ProjectileType.Physical) { return pCollision.onImpactForce; } return 0f; } set { if (Type == ProjectileType.Regular) { rHit.force = value; } else if (Type == ProjectileType.Physical) { pCollision.onImpactForce = value; } } } public float Speed { get { if (Type == ProjectileType.Regular) { return rMoveTransform.selfImpulse.z; } if (Type == ProjectileType.Physical) { return pAddForce.force.z; } return 0f; } set { if (Type == ProjectileType.Regular) { rMoveTransform.selfImpulse.z = value; } else if (Type == ProjectileType.Physical) { pAddForce.force.z = value; } } } public float Size { get { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) Vector3 localScale = internalObject.transform.localScale; return (localScale.x + localScale.y + localScale.z) / 3f; } set { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) internalObject.transform.localScale = Vector3.one * value; } } public Vector3 Scale { get { //IL_000b: Unknown result type (might be due to invalid IL or missing references) return internalObject.transform.localScale; } set { //IL_000b: Unknown result type (might be due to invalid IL or missing references) internalObject.transform.localScale = value; } } public void UpdateImpact(List<ModExplosion> explosions) { if (Type == ProjectileType.Regular) { rHit.objectsToSpawn = explosions.Cast<ModExplosion>().Select((Func<ModExplosion, ObjectToSpawn>)((ModExplosion explosion) => new ObjectToSpawn { objectToSpawn = explosion.internalObject })).ToArray(); } else if (Type == ProjectileType.Physical && explosions.Count > 0) { if (Object.op_Implicit((Object)(object)pSpawner)) { pSpawner.objectToSpawn = explosions[0].internalObject; return; } pSpawner = ((Component)pCollision).gameObject.AddComponent<MeleeWeaponSpawn>(); pSpawner.objectToSpawn = explosions[0].internalObject; } } public override void ColorInternal(int index, Color color, float glow = 0f) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) Utilities.SetObjectColor(internalObject, index, color, glow); } public ModProjectile(GameObject projectile, bool isClone = false) { internalObject = projectile; projectileEntity = internalObject.GetComponentInChildren<ProjectileEntity>(); rHit = internalObject.GetComponentInChildren<ProjectileHit>(); rMoveTransform = internalObject.GetComponentInChildren<MoveTransform>(); rAddEffect = internalObject.GetComponentInChildren<ProjectileHitAddEffect>(); pCollision = internalObject.GetComponentInChildren<CollisionWeapon>(); pAddForce = internalObject.GetComponentInChildren<AddForce>(); pAddEffect = internalObject.GetComponentInChildren<MeleeWeaponAddEffect>(); pSpawner = internalObject.GetComponentInChildren<MeleeWeaponSpawn>(); Explosions = new WrapperDelineation<ModExplosion>(UpdateImpact, Mod.GetExplosion); if (Object.op_Implicit((Object)(object)rHit)) { Type = ProjectileType.Regular; } else if (Object.op_Implicit((Object)(object)pCollision)) { Type = ProjectileType.Physical; } else { Type = ProjectileType.Other; } if (Type == ProjectileType.Regular) { ObjectToSpawn[] objectsToSpawn = rHit.objectsToSpawn; foreach (ObjectToSpawn val in objectsToSpawn) { if (val != null) { Explosions.Add(new ModExplosion(val.objectToSpawn)); } } if (Object.op_Implicit((Object)(object)rAddEffect) && Object.op_Implicit((Object)(object)rAddEffect.EffectPrefab) && !isClone) { effect = new ModEffect(rAddEffect.EffectPrefab); } } else if (Type == ProjectileType.Physical) { if (Object.op_Implicit((Object)(object)pSpawner) && Object.op_Implicit((Object)(object)pSpawner.objectToSpawn)) { Explosions.Add(new ModExplosion(pSpawner.objectToSpawn)); } if (Object.op_Implicit((Object)(object)pAddEffect) && Object.op_Implicit((Object)(object)pAddEffect.EffectPrefab) && !isClone) { effect = new ModEffect(pAddEffect.EffectPrefab); } } } public override ModProjectile Clone() { GameObject projectile = Mod.CloneAndPoolObject(internalObject); ModProjectile modProjectile = new ModProjectile(projectile, isClone: true); modProjectile.Explosions.List = Explosions.List; modProjectile.Model = Model; ModProjectile modProjectile2 = modProjectile; string name = Utilities.IncrementName(modProjectile2.projectileEntity.Entity.Name); modProjectile2.projectileEntity.Entity.Name = name; ((Object)modProjectile2.internalObject).name = name; if (Effect != null) { modProjectile2.Effect = Effect; } modProjectile2.Separate(); return modProjectile2; } public override void Separate() { if (Effect != null) { Effect = Effect.Clone(); } Explosions.List = (from ModExplosion explosion in Explosions.List select explosion.Clone()).ToList(); } } public class ModUnit : ModdingClass<ModUnit> { public class ModVoice { public UnitBlueprint internalObject { get; private set; } public string Death { get { return internalObject.voiceBundle.DeathRef; } set { internalObject.voiceBundle.DeathRef = value; } } public string Alive { get { return internalObject.voiceBundle.VocalRef; } set { internalObject.voiceBundle.VocalRef = value; } } public float Pitch { get { return internalObject.VoicePitch; } set { internalObject.VoicePitch = value; } } public ModVoice(UnitBlueprint blueprint) { internalObject = blueprint; internalObject.voiceBundle = ScriptableObject.CreateInstance<VoiceBundle>(); } } public UnitBlueprint internalObject; private ModWeapon rightWeapon; private ModWeapon leftWeapon; private ModBase unitBase; private ModUnit rider; public WrapperDelineation<ModClothing> Clothes { get; private set; } public WrapperDelineation<ModMove> Moves { get; private set; } public ModVoice Voice { get; private set; } public override string Name { get { return internalObject.Entity.Name; } set { internalObject.Entity.Name = value; } } public Sprite Icon { get { return internalObject.Entity.SpriteIcon; } set { internalObject.Entity.SetSpriteIcon(value); } } public float Health { get { return internalObject.health; } set { internalObject.health = value; } } public float Speed { get { return internalObject.movementSpeedMuiltiplier; } set { internalObject.movementSpeedMuiltiplier = value; } } public float TurnSpeed { get { return internalObject.TurnSpeed; } set { if ((Object)(object)internalObject.turningData != (Object)null) { internalObject.turningData.TurnSpeed = value; } internalObject.turnSpeed = value; } } public float Mass { get { return internalObject.massMultiplier; } set { internalObject.massMultiplier = value; } } public float Balance { get { return internalObject.balanceMultiplier; } set { internalObject.balanceMultiplier = value; } } public float BalanceStrength { get { return internalObject.balanceForceMultiplier; } set { internalObject.balanceForceMultiplier = value; } } public float Priority { get { return internalObject.targetingPriorityMultiplier; } set { internalObject.targetingPriorityMultiplier = value; } } public float Size { get { return internalObject.sizeMultiplier; } set { internalObject.sizeMultiplier = value; } } public bool TwoHanded { get { return internalObject.holdinigWithTwoHands; } set { internalObject.holdinigWithTwoHands = value; } } public int Cost { get { return (int)internalObject.GetUnitCost(true); } set { internalObject.useCustomCost = true; internalObject.customCost = value; } } public ModWeapon RightWeapon { get { return rightWeapon; } set { if (value != null) { rightWeapon = value; internalObject.RightWeapon = rightWeapon.internalObject; } } } public ModWeapon LeftWeapon { get { return leftWeapon; } set { if (value != null) { leftWeapon = value; internalObject.LeftWeapon = leftWeapon.internalObject; } } } public ModBase Base { get { return unitBase; } set { unitBase = value; internalObject.UnitBase = unitBase.internalObject; } } public Vector2 SizeRange { get { //IL_0016: Unknown result type (might be due to invalid IL or missing references) return new Vector2(internalObject.minSizeRandom, internalObject.maxSizeRandom); } set { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) internalObject.minSizeRandom = value.x; internalObject.maxSizeRandom = value.y; } } public ModUnit Rider { get { return rider; } set { rider = value; if (rider != null) { internalObject.SetField<UnitBlueprint>("Riders", new UnitBlueprint[1] { rider.internalObject }); } else { internalObject.SetField<UnitBlueprint>("Riders", Array.Empty<UnitBlueprint>()); } } } private void UpdateClothing(List<ModClothing> list) { internalObject.m_props = (from ModClothing clothing in list select clothing.internalObject).ToArray(); } private void UpdateMoves(List<ModMove> list) { internalObject.objectsToSpawnAsChildren = (from ModMove move in list select move.internalObject).ToArray(); } public override void ColorInternal(int index, Color color, float glow = 0f) { } public ModUnit(UnitBlueprint blueprint) { internalObject = blueprint; Clothes = new WrapperDelineation<ModClothing>(UpdateClothing, Mod.GetClothing); Moves = new WrapperDelineation<ModMove>(UpdateMoves, Mod.GetMove); Voice = new ModVoice(blueprint); if (internalObject.m_props != null) { Clothes.List = (from GameObject prop in internalObject.m_props where (Object)(object)prop != (Object)null select new ModClothing(prop)).ToList(); } else { internalObject.m_props = Array.Empty<GameObject>(); } if (Object.op_Implicit((Object)(object)internalObject.RightWeapon)) { RightWeapon = new ModWeapon(internalObject.RightWeapon); } if (Object.op_Implicit((Object)(object)internalObject.LeftWeapon)) { LeftWeapon = new ModWeapon(internalObject.LeftWeapon); } } public override ModUnit Clone() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) string name = Utilities.IncrementName(Name); UnitBlueprint val = Object.Instantiate<UnitBlueprint>(internalObject); val.Entity.GUID = DatabaseID.NewID(); val.Entity.Name = name; Utilities.AddUnitToDatabase(val); ModUnit modUnit = new ModUnit(val); modUnit.Clothes.List = Clothes.List; modUnit.Moves.List = Moves.List; modUnit.Rider = Rider; modUnit.Cost = Cost; ModUnit modUnit2 = modUnit; modUnit2.Separate(); return modUnit2; } public override void Separate() { if (RightWeapon != null) { RightWeapon = RightWeapon.Clone(); } if (LeftWeapon != null) { LeftWeapon = LeftWeapon.Clone(); } Clothes.List = (from ModClothing clothing in Clothes.List select clothing.Clone()).ToList(); Moves.List = (from ModMove move in Moves.List select move.Clone()).ToList(); } } public enum WeaponType { Melee, Ranged } public class ModWeapon : ModdingClass<ModWeapon> { public class ModMelee { private readonly ModWeapon internalWeapon; public float SwingSpeed { get { return (internalWeapon.Type == WeaponType.Melee) ? internalWeapon.internalMelee.curveForce : 0f; } set { if (internalWeapon.Type == WeaponType.Melee) { internalWeapon.internalMelee.curveForce = value; } } } public Vector3 SwingDirection { get { //IL_001f: 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) return (internalWeapon.Type == WeaponType.Melee) ? internalWeapon.internalMelee.swingDirection : Vector3.zero; } set { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) if (internalWeapon.Type == WeaponType.Melee) { internalWeapon.internalMelee.swingDirection = value; } } } public float Impact { get { return (internalWeapon.Type == WeaponType.Melee) ? internalWeapon.mCollision.impactMultiplier : 0f; } set { if (internalWeapon.Type == WeaponType.Melee) { internalWeapon.mCollision.impactMultiplier = value; } } } public ModMelee(ModWeapon weapon) { internalWeapon = weapon; } } public class ModRanged { private readonly ModWeapon internalWeapon; public ModProjectile Projectile { get { return internalWeapon.projectile; } set { if (internalWeapon.Type == WeaponType.Ranged) { internalWeapon.projectile = value; internalWeapon.internalRanged.ObjectToSpawn = internalWeapon.projectile.internalObject; } } } public ModUnit UnitProjectile { get { return internalWeapon.unit; } set { internalWeapon.unit = value; if (internalWeapon.Type == WeaponType.Ranged) { Projectile = null; internalWeapon.internalRa