using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using DM;
using HarmonyLib;
using Landfall.TABS;
using SLMA;
using Unity.Mathematics;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.SceneManagement;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("Show1")]
[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 BulletproofSkills
{
public static class UManager
{
public static string modname;
public static string modder;
private static string com;
public static AssetBundle bundle;
static UManager()
{
modname = "Show1";
modder = "FhpSlime";
}
public static void SetRiders(UnitBlueprint me, UnitBlueprint[] riders)
{
s.SetField<UnitBlueprint>(me, "Riders", (object)riders);
}
public static void EditBlueprint(UnitBlueprint unit, LandfallContentDatabase db)
{
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Expected O, but got Unknown
//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
//IL_016d: Unknown result type (might be due to invalid IL or missing references)
//IL_0199: Unknown result type (might be due to invalid IL or missing references)
//IL_019f: Expected O, but got Unknown
if (unit.Entity.Name == "M16")
{
ChineseLibrary.注册(unit, 90f, 1f, 1.4f, 8f, 1f, "M16", (移动类型)2);
UPool.MyPool.AddObject("M16", (GameObject)SLMALoader.SDic["weapons"]["M16 - Automatic"], true, (HideFlags)52, (Sprite)null, 456767852, true);
ChineseLibrary.武器设置(unit, true, UPool.MyPool.GetObject("M16"), (GameObject)null);
ChineseLibrary.远程武器(unit.RightWeapon, 1.2f, 0f, 0.3f, 1, 2f);
ChineseLibrary.设置子弹(unit.RightWeapon, UPool.MyPool.AddObject("P_GatlingGunNeon", ((GameObject)SLMALoader.SDic["weapons"]["M16"]).GetComponent<RangeWeapon>().ObjectToSpawn, true, (HideFlags)52, (Sprite)null, 455141, true));
unit.RightWeapon.GetComponent<RangeWeapon>().reloadTime = -1f;
unit.RightWeapon.GetComponentInChildren<Compensation>().rangePow = -0.1f;
unit.RightWeapon.GetComponentInChildren<ProjectileStick>().minWeight = -100f;
unit.RightWeapon.GetComponentInChildren<ProjectileHit>().force = 1.2f;
ChineseLibrary.颜色设置(unit.RightWeapon.GetComponent<RangeWeapon>().ObjectToSpawn, new Color(1.1f, 1.2f, 0.3f));
ChineseLibrary.技能设置(unit, (GameObject[])(object)new GameObject[1] { (GameObject)SLMALoader.SDic["moves"]["BarrelArmor_Torso"] });
unit.forceCost = 3000u;
}
}
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)
{
}
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_0050: Expected O, but got Unknown
//IL_0050: Expected O, but got Unknown
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_0107: Unknown result type (might be due to invalid IL or missing references)
//IL_011b: Expected O, but got Unknown
//IL_013f: Unknown result type (might be due to invalid IL or missing references)
//IL_0153: Expected O, but got Unknown
//IL_0177: Unknown result type (might be due to invalid IL or missing references)
//IL_018b: Expected O, but got Unknown
//IL_01af: Unknown result type (might be due to invalid IL or missing references)
//IL_01c3: Expected O, but got Unknown
//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
//IL_01fb: Expected O, but got Unknown
//IL_021f: Unknown result type (might be due to invalid IL or missing references)
//IL_0233: Expected O, but got Unknown
//IL_0257: Unknown result type (might be due to invalid IL or missing references)
//IL_026b: Expected O, but got Unknown
//IL_028f: Unknown result type (might be due to invalid IL or missing references)
//IL_02a3: Expected O, but got Unknown
//IL_02c7: Unknown result type (might be due to invalid IL or missing references)
//IL_02db: Expected O, but got Unknown
//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
//IL_0313: Expected O, but got Unknown
//IL_0325: Unknown result type (might be due to invalid IL or missing references)
//IL_0339: Unknown result type (might be due to invalid IL or missing references)
//IL_0354: Unknown result type (might be due to invalid IL or missing references)
//IL_0368: Unknown result type (might be due to invalid IL or missing references)
//IL_038c: Unknown result type (might be due to invalid IL or missing references)
//IL_03a2: Unknown result type (might be due to invalid IL or missing references)
//IL_03ac: Unknown result type (might be due to invalid IL or missing references)
SLMATool.CreateUnit("M16", (UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SUBUNITS_TANKRIDERBACK"], (Faction)SLMALoader.SDic["factions"]["Legacy"], GetSprite("Rifleman.png"));
List<UnitBlueprint> list = new List<UnitBlueprint>();
UnitBlueprint[] units = ((Faction)SLMALoader.SDic["factions"]["Legacy"]).Units;
foreach (UnitBlueprint item in units)
{
list.Add(item);
}
list.Sort((UnitBlueprint unit1, UnitBlueprint unit2) => unit1.GetUnitCost(true).CompareTo(unit2.GetUnitCost(true)));
((Faction)SLMALoader.SDic["factions"]["Legacy"]).Units = list.ToArray();
UPool.MyPool.AddObject("bt-Head/头", (GameObject)SLMALoader.SDic["moves"]["BarrelArmor_Head"], true, (HideFlags)52, (Sprite)null, 645478111, true);
UPool.MyPool.AddObject("bt-Torso/躯干", (GameObject)SLMALoader.SDic["moves"]["BarrelArmor_Torso"], true, (HideFlags)52, (Sprite)null, 85478111, true);
UPool.MyPool.AddObject("bt-Hip/臀部", (GameObject)SLMALoader.SDic["moves"]["BarrelArmor_Hip"], true, (HideFlags)52, (Sprite)null, 9478111, true);
UPool.MyPool.AddObject("bt-KneeLeft/左膝", (GameObject)SLMALoader.SDic["moves"]["BarrelArmor_KneeLeft"], true, (HideFlags)52, (Sprite)null, 575478851, true);
UPool.MyPool.AddObject("bt-KneeRight/右膝", (GameObject)SLMALoader.SDic["moves"]["BarrelArmor_KneeRight"], true, (HideFlags)52, (Sprite)null, 515478111, true);
UPool.MyPool.AddObject("bt-ArmLeft/左臂", (GameObject)SLMALoader.SDic["moves"]["BarrelArmor_ArmLeft"], true, (HideFlags)52, (Sprite)null, 875478851, true);
UPool.MyPool.AddObject("bt-ArmRight/右臂", (GameObject)SLMALoader.SDic["moves"]["BarrelArmor_ArmRight"], true, (HideFlags)52, (Sprite)null, 974478111, true);
UPool.MyPool.AddObject("bt-LegLeft/左腿", (GameObject)SLMALoader.SDic["moves"]["BarrelArmor_LegLeft"], true, (HideFlags)52, (Sprite)null, 565478111, true);
UPool.MyPool.AddObject("bt-LegRight/右腿", (GameObject)SLMALoader.SDic["moves"]["BarrelArmor_LegRight"], true, (HideFlags)52, (Sprite)null, 78544511, true);
GameObject val = UPool.MyPool.AddObject("bt-face/脸", (GameObject)SLMALoader.SDic["moves"]["BarrelArmor_Head"], true, (HideFlags)52, (Sprite)null, 745478111, true);
((Component)val.GetComponentInChildren<BoxCollider>()).transform.position = STool.AddV3(val.transform.position, 0f, 0.2f, 0.16f);
((Component)val.GetComponentInChildren<BoxCollider>()).transform.localScale = STool.AddV3(val.transform.localScale, 0.7f, 0.2f, -0.4f);
((Component)val.GetComponentInChildren<BoxCollider>()).transform.Rotate(new Vector3(10f, -10f, 0f));
Transform transform = ((Component)val.GetComponentInChildren<BoxCollider>()).transform;
transform.localScale *= 0.2f;
s.SetHideFlags<GameObject>(val, (HideFlags)52);
}
public static void EditWeapons(GameObject weapon, Team team, Unit unit, MeleeWeapon melee, RangeWeapon range, LandfallContentDatabase db)
{
}
public static void TryChangeColorbyindex(this GameObject gameObject, Color color, int index)
{
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Expected O, but got Unknown
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
Material val = new Material(Shader.Find("Standard"));
val.SetColor("_Color", color);
val.SetFloat("_Mode", 3f);
val.SetInt("_SrcBlend", 5);
val.SetInt("_DstBlend", 10);
val.EnableKeyword("_ALPHABLEND_ON");
val.renderQueue = 3000;
if (Object.op_Implicit((Object)(object)gameObject.GetComponentInChildren<TeamColor>()))
{
Object.Destroy((Object)(object)gameObject.GetComponentInChildren<TeamColor>());
}
Renderer[] componentsInChildren = gameObject.GetComponentsInChildren<Renderer>();
for (int i = 0; i < componentsInChildren.Length; i++)
{
Material[] materials = componentsInChildren[i].materials;
int num = 0;
if (num < materials.Length)
{
componentsInChildren[i].materials[num] = val;
break;
}
}
}
public static Sprite GetSprite(string name)
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Expected O, but got Unknown
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(name);
Texture2D val = new Texture2D(4, 4);
byte[] array = new byte[stream.Length];
stream.Read(array, 0, (int)stream.Length);
ImageConversion.LoadImage(val, array);
return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f));
}
public static void DestoryAll<T>(this GameObject game) where T : Object
{
if (Object.op_Implicit((Object)(object)game.GetComponentInChildren<T>()))
{
T[] componentsInChildren = game.GetComponentsInChildren<T>();
for (int i = 0; i < componentsInChildren.Length; i++)
{
Object.Destroy((Object)(object)componentsInChildren[i]);
}
}
}
public static GameObject CreateNewMove(string name, int id = 0)
{
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Expected O, but got Unknown
GameObject obj = UPool.MyPool.AddObject(name, (GameObject)SLMALoader.SDic["moves"]["Halfling_Jump"], true, (HideFlags)52, (Sprite)null, id, false);
obj.DestoryAll<DodgeMove>();
((UnityEventBase)obj.GetComponentInChildren<ConditionalEvent>().events[0].turnOnEvent).RemoveAllListeners();
((UnityEventBase)obj.GetComponentInChildren<ConditionalEvent>().events[0].continuousEvent).RemoveAllListeners();
return obj;
}
public static void SetMoveConditionalValue(this ConditionalEventInstance gameObject, ConditionType type, ValueType valuet, float value)
{
//IL_0012: 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)
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: 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_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_0065: Expected O, but got Unknown
bool flag = false;
EventCondition[] conditions = gameObject.conditions;
foreach (EventCondition val in conditions)
{
if (val.conditionType == type)
{
val.valueType = valuet;
val.value = value;
flag = true;
}
}
if (!flag)
{
List<EventCondition> list = gameObject.conditions.ToList();
list.Add(new EventCondition
{
conditionType = type,
valueType = valuet,
value = value
});
gameObject.conditions = list.ToArray();
}
}
private static void InitSp(LandfallContentDatabase db)
{
}
}
[BepInPlugin("show", "fhp.cc.show", "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 AddpParticle : MonoBehaviour
{
public GameObject copy;
public Vector3 vector3;
public Vector3 scale;
public Color color;
private void Start()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Expected O, but got Unknown
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_0078: Unknown result type (might be due to invalid IL or missing references)
GameObject val = new GameObject("poolp");
val.transform.SetParent(((Component)this).transform);
ParticleSystemRenderer[] componentsInChildren = copy.GetComponentsInChildren<ParticleSystemRenderer>();
for (int i = 0; i < componentsInChildren.Length; i++)
{
GameObject obj = Object.Instantiate<GameObject>(((Component)componentsInChildren[i]).gameObject, ((Component)this).transform.position, ((Component)this).transform.rotation, val.transform);
obj.transform.localScale = scale;
obj.GetComponentInChildren<ParticleSystem>().loop = true;
obj.GetComponentInChildren<ParticleSystem>().startColor = color;
}
}
}
public static class STool
{
public static void RendererColorChanger(Renderer[] renderers, Color color)
{
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
for (int i = 0; i < renderers.Length; i++)
{
Material[] materials = renderers[i].materials;
for (int j = 0; j < materials.Length; j++)
{
materials[j].color = color;
}
}
}
public static List<T> ToList<T>(T[] ts)
{
List<T> list = new List<T>();
foreach (T item in ts)
{
list.Add(item);
}
return list;
}
public static void RendererColorChanger(MeshRenderer[] renderers, Color color)
{
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
for (int i = 0; i < renderers.Length; i++)
{
Material[] materials = ((Renderer)renderers[i]).materials;
for (int j = 0; j < materials.Length; j++)
{
materials[j].color = color;
}
}
}
public static void RendererColorChanger(SkinnedMeshRenderer[] renderers, Color color)
{
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
for (int i = 0; i < renderers.Length; i++)
{
Material[] materials = ((Renderer)renderers[i]).materials;
for (int j = 0; j < materials.Length; j++)
{
materials[j].color = color;
}
}
}
public static void RendererColorChanger(Renderer[] renderers, Material[] color)
{
for (int i = 0; i < renderers.Length; i++)
{
renderers[i].materials = color;
}
}
public static void RendererColorChanger(MeshRenderer[] renderers, Material[] color)
{
for (int i = 0; i < renderers.Length; i++)
{
((Renderer)renderers[i]).materials = color;
}
}
public static void RendererColorChanger(SkinnedMeshRenderer[] renderers, Material[] color)
{
for (int i = 0; i < renderers.Length; i++)
{
((Renderer)renderers[i]).materials = color;
}
}
public static Vector3 AddV3(Vector3 vector3, float x, float y, float z)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: 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)
return new Vector3(vector3.x + x, vector3.y + y, vector3.z + z);
}
}
public class SycMove : Move
{
private ShootPosition[] swordPoints;
private List<SpookySword> swords = new List<SpookySword>();
public GameObject sourceSword;
public float followSpeed = 12f;
private float counter;
private DataHandler data;
private bool done;
private float attackspeedMulti = 4f;
private void Awake()
{
swordPoints = ((Component)this).GetComponentsInChildren<ShootPosition>();
}
public override void DoMove(Rigidbody enemyWeapon, Rigidbody enemyTorso, DataHandler targetData)
{
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: Unknown result type (might be due to invalid IL or missing references)
//IL_009d: Unknown result type (might be due to invalid IL or missing references)
//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
data = ((Component)((Component)this).transform.root).GetComponentInChildren<DataHandler>();
List<Renderer> list = new List<Renderer>();
SpookySword val = CreateNewSword(((Component)swordPoints[(swords.Count >= swordPoints.Length) ? (swords.Count % swordPoints.Length) : swords.Count]).transform.position + Vector3.up * (2f + (float)(swords.Count / swordPoints.Length)), quaternion.op_Implicit(Quaternion.Euler(0f, 90f, 90f)));
val.gameObject.AddComponent<SycRotate>();
val.gameObject.AddComponent<SycC>().owner = ((Component)this).GetComponentInParent<Unit>();
Renderer[] componentsInChildren = val.gameObject.GetComponentsInChildren<Renderer>();
if (componentsInChildren != null && componentsInChildren.Length != 0)
{
list.AddRange(componentsInChildren);
}
swords.Add(val);
if ((Object)(object)data != (Object)null && (Object)(object)data.unit != (Object)null)
{
data.unit.AddRenderersToShowHide(list.ToArray(), data.unit.IsSpawnedInBlindPlacement);
}
}
private void Start()
{
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
Transform transform = ((Component)((Component)swordPoints[0]).transform.parent).gameObject.transform;
transform.localScale *= 3f;
((Component)((Component)swordPoints[0]).transform.parent).gameObject.transform.localPosition = STool.AddV3(((Component)((Component)swordPoints[0]).transform.parent).gameObject.transform.localPosition, 0f, -0.55f, 0f);
}
private void Update()
{
//IL_0114: Unknown result type (might be due to invalid IL or missing references)
//IL_012f: Unknown result type (might be due to invalid IL or missing references)
//IL_0134: Unknown result type (might be due to invalid IL or missing references)
//IL_0152: Unknown result type (might be due to invalid IL or missing references)
//IL_0157: Unknown result type (might be due to invalid IL or missing references)
//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
if (done)
{
return;
}
if (Object.op_Implicit((Object)(object)data) && data.Dead)
{
done = true;
}
float num = Mathf.Clamp(Time.deltaTime, 0f, 0.02f);
for (int i = 0; i < swords.Count; i++)
{
if (!((Object)(object)swords[i].gameObject == (Object)null))
{
SpookySword obj = swords[i];
obj.sinceSpawn += num;
if (i >= swordPoints.Length)
{
swords[i].move.velocity = (((Component)swordPoints[i % swordPoints.Length]).transform.position - swords[i].gameObject.transform.position) * (followSpeed * (1f + (float)swords.Count));
break;
}
swords[i].move.velocity = (((Component)swordPoints[i]).transform.position - swords[i].gameObject.transform.position) * (followSpeed * (1f + (float)swords.Count));
}
}
}
private void OnDestroy()
{
((MonoBehaviour)this).StopAllCoroutines();
for (int i = 0; i < swords.Count; i++)
{
if ((Object)(object)swords[i].gameObject != (Object)null)
{
Object.Destroy((Object)(object)swords[i].gameObject);
}
}
}
private SpookySword CreateNewSword(Vector3 pos, quaternion rot)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: 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)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: 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)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Expected O, but got Unknown
SpookySword val = new SpookySword
{
gameObject = Object.Instantiate<GameObject>(sourceSword, pos, quaternion.op_Implicit(rot))
};
val.move = val.gameObject.GetComponent<MoveTransform>();
GameObjectExtensions.FetchComponent<TeamHolder>(val.gameObject).team = data.team;
return val;
}
}
public class SycRotate : MonoBehaviour
{
private Rigidbody rb;
private void FixedUpdate()
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: 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_0028: 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_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
Quaternion rotation = ((Component)this).transform.rotation;
Quaternion val = Quaternion.Euler(0f, ((Quaternion)(ref rotation)).eulerAngles.y + 10f, 0f);
((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, val, 2000f);
}
private void Start()
{
rb = ((Component)this).GetComponent<Rigidbody>();
rb.angularDrag = 0.25f;
rb.drag = 0.5f;
}
}
public class SycC : MonoBehaviour
{
public Unit owner;
public void Start()
{
}
public void Update()
{
}
private void OnCollisionEnter(Collision col)
{
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
Unit val = default(Unit);
if (!owner.dead && Object.op_Implicit((Object)(object)col.rigidbody) && ((Component)col.transform.root).TryGetComponent<Unit>(ref val) && !val.data.Dead && val.data.team != owner.Team)
{
((Damagable)val.data.healthHandler).TakeDamage(85f, ((Component)this).GetComponentInChildren<Rigidbody>().velocity, owner, (DamageType)2);
((Component)this).GetComponentInChildren<CollisionSound>().DoEffect(col.transform, col, 1f);
((Component)this).GetComponentInChildren<ParticleSystem>().Play();
}
}
}
public class Swing : MonoBehaviour
{
public void Update()
{
if (((Component)this).GetComponentInChildren<MeleeWeapon>().isSwinging)
{
((Component)this).GetComponentInChildren<TrailRenderer>().emitting = true;
}
else
{
((Component)this).GetComponentInChildren<TrailRenderer>().emitting = false;
}
}
}
public class NewParry : MonoBehaviour
{
private ConditionalEvent conditionalEvent;
private ParticleSystem part;
private Rigidbody ownWeapon;
public string soundRef;
public float parryPower = 1f;
public float force;
private void Start()
{
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Expected O, but got Unknown
part = ((Component)this).GetComponentInChildren<ParticleSystem>();
conditionalEvent = ((Component)this).GetComponent<ConditionalEvent>();
((Component)this).GetComponentInChildren<ConditionalEvent>().events[0].continuousEvent.AddListener((UnityAction)delegate
{
((Component)this).GetComponentInChildren<NewParry>().DoParry();
});
if (Object.op_Implicit((Object)(object)conditionalEvent.data.weaponHandler))
{
if (Object.op_Implicit((Object)(object)conditionalEvent.data.weaponHandler.rightWeapon) && Object.op_Implicit((Object)(object)conditionalEvent.data.weaponHandler.rightWeapon.rigidbody))
{
ownWeapon = conditionalEvent.data.weaponHandler.rightWeapon.rigidbody;
}
else if (Object.op_Implicit((Object)(object)conditionalEvent.data.weaponHandler.leftWeapon) && Object.op_Implicit((Object)(object)conditionalEvent.data.weaponHandler.leftWeapon.rigidbody))
{
ownWeapon = conditionalEvent.data.weaponHandler.leftWeapon.rigidbody;
}
}
}
public void DoParry()
{
((MonoBehaviour)this).StartCoroutine(ExecuteParry(conditionalEvent.cachedEnemyWeapon));
}
private IEnumerator ExecuteParry(Rigidbody enemyWeapon)
{
yield return (object)new WaitForSeconds(0.1f);
if (!Object.op_Implicit((Object)(object)enemyWeapon))
{
yield break;
}
MeleeWeapon component = ((Component)enemyWeapon).GetComponent<MeleeWeapon>();
if (Object.op_Implicit((Object)(object)component) && !(component.requiredPowerToParry > parryPower))
{
component.StopSwing();
Vector3 val = ((Component)enemyWeapon).transform.position - conditionalEvent.data.mainRig.position;
enemyWeapon.AddForce(((Vector3)(ref val)).normalized * force, (ForceMode)2);
Rigidbody obj = ownWeapon;
val = ((Component)enemyWeapon).transform.position - conditionalEvent.data.mainRig.position;
obj.AddForce(((Vector3)(ref val)).normalized * force * -1f, (ForceMode)2);
Vector3 val2 = (enemyWeapon.position + ((Component)ownWeapon).transform.position) * 0.5f;
if (Object.op_Implicit((Object)(object)part) && Object.op_Implicit((Object)(object)ownWeapon))
{
((Component)part).transform.position = val2;
part.Play();
}
ServiceLocator.GetService<SoundPlayer>().PlaySoundEffect(soundRef, 1f, val2, (MaterialType)3, (Transform)null, 1f);
}
}
}
[ExecuteInEditMode]
[RequireComponent(typeof(Camera))]
public class BlackAndWhiteEffect : MonoBehaviour
{
public Shader blackAndWhiteShader;
private Material effectMaterial;
private void OnRenderImage(RenderTexture source, RenderTexture destination)
{
if ((Object)(object)effectMaterial != (Object)null)
{
Graphics.Blit((Texture)(object)source, destination, effectMaterial);
}
else
{
Graphics.Blit((Texture)(object)source, destination);
}
}
private void OnEnable()
{
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Expected O, but got Unknown
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: Expected O, but got Unknown
Camera component = ((Component)this).GetComponent<Camera>();
if ((Object)(object)blackAndWhiteShader != (Object)null && (Object)(object)component != (Object)null)
{
effectMaterial = new Material(blackAndWhiteShader);
component.targetTexture = new RenderTexture(Screen.width, Screen.height, 24);
}
else
{
((Behaviour)this).enabled = false;
}
}
private void OnDisable()
{
if ((Object)(object)effectMaterial != (Object)null)
{
Object.DestroyImmediate((Object)(object)effectMaterial);
}
Camera component = ((Component)this).GetComponent<Camera>();
if ((Object)(object)component != (Object)null)
{
component.targetTexture = null;
}
}
}
namespace BulletproofSkills
{
public class BlackAndWhiteManager : MonoBehaviour
{
public Shader blackAndWhiteShader;
private void Start()
{
SceneManager.sceneLoaded += OnSceneLoaded;
ApplyEffectToCameras();
}
private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
{
ApplyEffectToCameras();
}
private void ApplyEffectToCameras()
{
Camera[] array = Object.FindObjectsOfType<Camera>();
foreach (Camera val in array)
{
if ((Object)(object)((Component)val).GetComponent<BlackAndWhiteEffect>() == (Object)null)
{
((Component)val).gameObject.AddComponent<BlackAndWhiteEffect>().blackAndWhiteShader = blackAndWhiteShader;
}
}
}
}
}