using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using DM;
using HarmonyLib;
using Landfall.TABS;
using Landfall.TABS.GameMode;
using Landfall.TABS.GameState;
using SLMA;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("Mod name")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("made in SFT by FhpSlime")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("3a45c3cf-230c-4310-952f-0887d4266a22")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Tiaoguan_Mod
{
public static class UManager
{
public static string modname;
public static string modder;
private static string com;
static UManager()
{
modname = "SFT";
modder = "FhpSlime";
}
public static void SetRiders(UnitBlueprint me, UnitBlueprint[] riders)
{
s.SetField<UnitBlueprint>(me, "Riders", (object)riders);
}
public static void EditBlueprint(UnitBlueprint unit, LandfallContentDatabase db)
{
}
public static void EditClothes(GameObject cloth, CharacterItem item, PropItemData data, Unit unit, int index, LandfallContentDatabase db)
{
}
public static void EditProjectiles(GameObject proj, ProjectileHit projhit, Unit unit, LandfallContentDatabase db)
{
}
public static void EditCombatMoves(GameObject move, int index, Unit unit, LandfallContentDatabase db)
{
if (unit.unitBlueprint.Entity.Name == "unit name")
{
Object.op_Implicit((Object)(object)move.GetComponentInChildren<DodgeMove>());
}
}
public static void CodeAfterSpawn(Unit unit, LandfallContentDatabase db)
{
}
public static void Init(LandfallContentDatabase db)
{
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_0064: Expected O, but got Unknown
//IL_0064: Expected O, but got Unknown
//IL_0064: Expected O, but got Unknown
//IL_0087: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: Expected O, but got Unknown
//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
//IL_00da: Expected O, but got Unknown
UnitBlueprint obj = SLMATool.CreateUnit("鸡兵", (UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_RENAISSANCE_HALBERD"], (Faction)SLMALoader.SDic["factions"]["Renaissance"], (Sprite)SLMALoader.SDic["sprites"]["Icons_128x128_Halberd"]);
GameObject val = UPool.MyPool.AddObject("飞雷神(切勿兵编内测试用)", (GameObject)SLMALoader.SDic["moves"]["Head_up"], true, (HideFlags)52, (Sprite)null, 981563, true);
val.AddComponent<趋势技能>();
GameObject val2 = UPool.MyPool.AddObject("嗦血", (GameObject)SLMALoader.SDic["moves"]["Head_up"], true, (HideFlags)52, (Sprite)null, 981564, true);
val2.AddComponent<嗦血>();
ChineseLibrary.技能设置(obj, (GameObject[])(object)new GameObject[2] { val, val2 });
}
public static void EditWeapons(GameObject weapon, Team team, Unit unit, MeleeWeapon melee, RangeWeapon range, LandfallContentDatabase db)
{
}
}
[BepInPlugin("tIAOGUANmOD", "tIAOgUANmOD", "1.0.0")]
internal class Loader : BaseUnityPlugin
{
private void Awake()
{
((MonoBehaviour)this).StartCoroutine("call");
}
private IEnumerator call()
{
yield return (object)new WaitUntil((Func<bool>)(() => (Object)(object)Object.FindObjectOfType<ServiceLocator>() != (Object)null));
yield return (object)new WaitUntil((Func<bool>)(() => ServiceLocator.GetService<ISaveLoaderService>() != null));
yield return (object)new WaitForSecondsRealtime(0.3f);
SLMALoader.GetInstance();
LandfallContentDatabase landfallContentDatabase = ContentDatabase.Instance().LandfallContentDatabase;
UManager.Init(landfallContentDatabase);
new Harmony(UManager.modname).PatchAll();
GOSLMA.EditWeapons = ((GOSLMA.EditWeapons == null) ? new Action<GameObject, Team, Unit, MeleeWeapon, RangeWeapon, LandfallContentDatabase>(UManager.EditWeapons) : ((Action<GameObject, Team, Unit, MeleeWeapon, RangeWeapon, LandfallContentDatabase>)Delegate.Combine(new Action<GameObject, Team, Unit, MeleeWeapon, RangeWeapon, LandfallContentDatabase>(UManager.EditWeapons), GOSLMA.EditWeapons)));
GOSLMA.EditClothes = ((GOSLMA.EditClothes == null) ? new Action<GameObject, CharacterItem, PropItemData, Unit, int, LandfallContentDatabase>(UManager.EditClothes) : ((Action<GameObject, CharacterItem, PropItemData, Unit, int, LandfallContentDatabase>)Delegate.Combine(new Action<GameObject, CharacterItem, PropItemData, Unit, int, LandfallContentDatabase>(UManager.EditClothes), GOSLMA.EditClothes)));
GOSLMA.EditCombatMoves = ((GOSLMA.EditCombatMoves == null) ? new Action<GameObject, int, Unit, LandfallContentDatabase>(UManager.EditCombatMoves) : ((Action<GameObject, int, Unit, LandfallContentDatabase>)Delegate.Combine(new Action<GameObject, int, Unit, LandfallContentDatabase>(UManager.EditCombatMoves), GOSLMA.EditCombatMoves)));
GOSLMA.CodeAfterSpawn = ((GOSLMA.CodeAfterSpawn == null) ? new Action<Unit, LandfallContentDatabase>(UManager.CodeAfterSpawn) : ((Action<Unit, LandfallContentDatabase>)Delegate.Combine(new Action<Unit, LandfallContentDatabase>(UManager.CodeAfterSpawn), GOSLMA.CodeAfterSpawn)));
GOSLMA.EditProjectiles = ((GOSLMA.EditProjectiles == null) ? new Action<GameObject, ProjectileHit, Unit, LandfallContentDatabase>(UManager.EditProjectiles) : ((Action<GameObject, ProjectileHit, Unit, LandfallContentDatabase>)Delegate.Combine(new Action<GameObject, ProjectileHit, Unit, LandfallContentDatabase>(UManager.EditProjectiles), GOSLMA.EditProjectiles)));
UnitBlueprint[] array = Resources.FindObjectsOfTypeAll<UnitBlueprint>();
for (int i = 0; i < array.Length; i++)
{
UManager.EditBlueprint(array[i], landfallContentDatabase);
}
Debug.Log((object)("Loaded " + UManager.modname + " Successfully"));
Debug.Log((object)(UManager.modname + "is made in SFT by FhpSlime"));
Debug.Log((object)(UManager.modder + "wished you a pleasant trip"));
}
}
}
public class Item : MonoBehaviour
{
public enum kind
{
Weapon,
Cloth,
Skill,
Unit,
Projectile,
Other
}
public string name;
public kind Kind;
}
namespace Tiaoguan_Mod
{
public class MyModItems : MonoBehaviour
{
private static Dictionary<string, Item> items;
private static MyModItems instance { get; set; }
public static MyModItems GetInstance()
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)instance == (Object)null)
{
instance = new GameObject("MyModItems").AddComponent<MyModItems>();
Object.DontDestroyOnLoad((Object)(object)instance);
}
return instance;
}
public void AddItem(Item item)
{
items.Add(item.name, item);
}
public Item GetItem(string name)
{
Item value = new Item
{
name = null,
Kind = Item.kind.Other
};
items.TryGetValue(name, out value);
return value;
}
}
public class 趋势技能 : GameStateListener
{
private Unit unit;
private GameModeService gameModeService;
private float 计数器;
public float 时间;
private bool 战斗中判断;
private bool 判断;
public string 弹窗;
private void Start()
{
unit = ((Component)((Component)this).transform.root).GetComponent<Unit>();
gameModeService = ServiceLocator.GetService<GameModeService>();
战斗中判断 = true;
计数器 = 0f;
弹窗 = "Destroy";
判断 = true;
}
private void Update()
{
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
计数器 += Time.deltaTime;
Unit val = unit.data.targetData.unit;
if ((Object)(object)val != (Object)null && (double)计数器 > 0.05)
{
计数器 = 0f;
unit.data.mainRig.position = val.data.mainRig.position;
Object.Destroy((Object)(object)((Component)val).gameObject);
}
if (战斗中判断 && (double)计数器 > 0.06)
{
战斗中判断 = false;
gameModeService.CurrentGameMode.WinConditionPropagator.ClearAllWinConditions();
gameModeService.CurrentGameMode.OnWinnerDecided(unit.Team, 弹窗);
gameModeService.CurrentGameMode.DecideWinner(unit.Team, 弹窗);
}
}
public override void OnEnterBattleState()
{
}
public override void OnEnterPlacementState()
{
}
}
public class 嗦血 : MonoBehaviour
{
private Unit unit;
private void Start()
{
((Component)((Component)this).transform.root).GetComponent<Unit>().data.immunityForSeconds = 9999999f;
}
}
}