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 BepInEx;
using DM;
using Landfall.TABS;
using Landfall.TABS.UnitEditor;
using Landfall.TABS.Workshop;
using UnityEngine;
using UnityEngine.Events;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("Tabs Poof Mod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Tabs Poof Mod")]
[assembly: AssemblyCopyright("Copyright © 2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("8aad4f38-2ad4-4206-bf0b-7d28fb6d5c2e")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace TraversalJump;
public enum iliketomoveitkind
{
launch,
pull,
freeze
}
public class abilitydef
{
public string name;
public int localid;
public iliketomoveitkind kind;
public float howmuchforward;
public float howmuchup;
public float howlongfreeze;
public float cooldown;
public float range;
public Type themovetypeeee;
}
public abstract class abilitybaseeee : Move
{
public abstract float cooldownnn { get; }
public abstract float rangeee { get; }
public virtual bool triggeredbygettinghitt => false;
}
public class thegenerics : Move
{
public iliketomoveitkind kind;
public float howmuchforward = 25f;
public float howmuchup = 12f;
public float howlongfreeze = 2f;
public float range = 8f;
public float cooldown = 3f;
public float howlongramp = 0.15f;
public float ppgdampeningboxreal = 6f;
private float nextfiretimee;
private DataHandler dadada;
private RigidbodyHolder holddarigs;
private void Awake()
{
dadada = ((Component)((Component)this).transform.root).GetComponentInChildren<DataHandler>();
holddarigs = ((Component)((Component)this).transform.root).GetComponentInChildren<RigidbodyHolder>();
}
public override void DoMove(Rigidbody weapondeenemy, Rigidbody torsoofenemy, DataHandler dataofenemy)
{
if ((Object)(object)dadada == (Object)null)
{
dadada = ((Component)((Component)this).transform.root).GetComponentInChildren<DataHandler>();
}
if ((Object)(object)holddarigs == (Object)null)
{
holddarigs = ((Component)((Component)this).transform.root).GetComponentInChildren<RigidbodyHolder>();
}
if ((Object)(object)dadada == (Object)null || (Object)(object)dadada.torso == (Object)null)
{
return;
}
Rigidbody component = ((Component)dadada.torso).GetComponent<Rigidbody>();
if ((Object)(object)component != (Object)null)
{
if (kind == iliketomoveitkind.launch)
{
Rigidbody hiprig = (((Object)(object)dadada.hip != (Object)null) ? ((Component)dadada.hip).GetComponent<Rigidbody>() : null);
((MonoBehaviour)this).StartCoroutine(dolaunch(component, hiprig, torsoofenemy));
}
else if (kind == iliketomoveitkind.pull)
{
dopull(component, torsoofenemy);
}
else if (kind == iliketomoveitkind.freeze)
{
((MonoBehaviour)this).StartCoroutine(dofreeze());
}
}
}
public void TriggerFromEvent()
{
if (Time.time < nextfiretimee)
{
return;
}
Rigidbody val = null;
if (kind == iliketomoveitkind.launch || kind == iliketomoveitkind.pull)
{
val = nearestotorso(range);
if ((Object)(object)val == (Object)null)
{
return;
}
}
nextfiretimee = Time.time + cooldown;
((Move)this).DoMove((Rigidbody)null, val, (DataHandler)null);
}
private Rigidbody nearestotorso(float searchradius)
{
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_009c: Unknown result type (might be due to invalid IL or missing references)
//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)dadada == (Object)null || (Object)(object)dadada.torso == (Object)null)
{
return null;
}
Vector3 position = dadada.torso.position;
Collider[] array = Physics.OverlapSphere(position, searchradius);
Unit component = ((Component)((Component)this).transform.root).GetComponent<Unit>();
Rigidbody result = null;
float num = float.MaxValue;
for (int i = 0; i < array.Length; i++)
{
Unit componentInParent = ((Component)array[i]).GetComponentInParent<Unit>();
if ((Object)(object)componentInParent == (Object)null || (Object)(object)componentInParent == (Object)(object)component)
{
continue;
}
DataHandler componentInChildren = ((Component)componentInParent).GetComponentInChildren<DataHandler>();
if ((Object)(object)componentInChildren != (Object)null && (Object)(object)componentInChildren.torso != (Object)null)
{
float num2 = Vector3.Distance(position, componentInChildren.torso.position);
if (num2 < num)
{
num = num2;
result = ((Component)componentInChildren.torso).GetComponent<Rigidbody>();
}
}
}
return result;
}
private IEnumerator dolaunch(Rigidbody torsorig, Rigidbody hiprig, Rigidbody torsoofenemy)
{
Vector3 val = (((Object)(object)torsoofenemy != (Object)null) ? torsoofenemy.position : (torsorig.position + ((Component)torsorig).transform.forward)) - torsorig.position;
val.y = 0f;
if (((Vector3)(ref val)).sqrMagnitude > 0.001f)
{
Quaternion rotation = Quaternion.LookRotation(((Vector3)(ref val)).normalized);
((Component)torsorig).transform.rotation = rotation;
if ((Object)(object)hiprig != (Object)null)
{
((Component)hiprig).transform.rotation = rotation;
}
}
Vector3 wantvel = ((Component)torsorig).transform.forward * howmuchforward + Vector3.up * howmuchup;
float rampclock = 0f;
while (rampclock < howlongramp)
{
if ((Object)(object)torsorig == (Object)null)
{
yield break;
}
float num = Mathf.Sin(Mathf.Clamp01(rampclock / howlongramp) * (float)Math.PI * 0.5f);
torsorig.velocity = wantvel * num;
if ((Object)(object)hiprig != (Object)null)
{
hiprig.velocity = wantvel * num;
}
rampclock += Time.fixedDeltaTime;
yield return (object)new WaitForFixedUpdate();
}
if ((Object)(object)torsorig != (Object)null)
{
torsorig.velocity = wantvel;
}
if ((Object)(object)hiprig != (Object)null)
{
hiprig.velocity = wantvel;
}
if ((Object)(object)dadada != (Object)null)
{
dadada.cantFallForSeconds = Mathf.Max(dadada.cantFallForSeconds, 0.4f);
}
}
private void dopull(Rigidbody elrig, Rigidbody torsoofenemy)
{
if ((Object)(object)torsoofenemy != (Object)null)
{
((MonoBehaviour)this).StartCoroutine(pulltowardsgood(torsoofenemy, elrig, howmuchforward, 0.5f, 1.5f));
}
}
private IEnumerator pulltowardsgood(Rigidbody target, Rigidbody anchor, float speed, float duration, float stopdist)
{
for (float howlongitisbe = 0f; howlongitisbe < duration; howlongitisbe += Time.fixedDeltaTime)
{
if ((Object)(object)target == (Object)null)
{
break;
}
if ((Object)(object)anchor == (Object)null)
{
break;
}
Vector3 val = anchor.position - target.position;
if (((Vector3)(ref val)).magnitude <= stopdist)
{
target.velocity = Vector3.zero;
break;
}
Vector3 val2 = ((Vector3)(ref val)).normalized * speed;
if (howlongitisbe < howlongramp)
{
float num = Mathf.Clamp01(howlongitisbe / howlongramp);
target.velocity = val2 * Mathf.Sin(num * (float)Math.PI * 0.5f);
}
else
{
target.velocity = val2;
}
yield return (object)new WaitForFixedUpdate();
}
}
private IEnumerator dofreeze()
{
List<Rigidbody> list = new List<Rigidbody>();
if ((Object)(object)holddarigs != (Object)null && holddarigs.AllRigs != null)
{
list.AddRange(holddarigs.AllRigs);
}
WeaponHandler componentInChildren = ((Component)((Component)this).transform.root).GetComponentInChildren<WeaponHandler>();
if ((Object)(object)componentInChildren != (Object)null)
{
if ((Object)(object)componentInChildren.rightWeapon != (Object)null && (Object)(object)componentInChildren.rightWeapon.rigidbody != (Object)null)
{
list.Add(componentInChildren.rightWeapon.rigidbody);
}
if ((Object)(object)componentInChildren.leftWeapon != (Object)null && (Object)(object)componentInChildren.leftWeapon.rigidbody != (Object)null)
{
list.Add(componentInChildren.leftWeapon.rigidbody);
}
}
if (list.Count == 0 && (Object)(object)dadada != (Object)null && (Object)(object)dadada.torso != (Object)null)
{
Rigidbody component = ((Component)dadada.torso).GetComponent<Rigidbody>();
if ((Object)(object)component != (Object)null)
{
list.Add(component);
}
}
List<Rigidbody> actuallyfroze = new List<Rigidbody>();
for (int i = 0; i < list.Count; i++)
{
Rigidbody val = list[i];
if ((Object)(object)val != (Object)null && !val.isKinematic)
{
val.velocity = Vector3.zero;
val.angularVelocity = Vector3.zero;
val.isKinematic = true;
actuallyfroze.Add(val);
}
}
yield return (object)new WaitForSeconds(howlongfreeze);
for (int j = 0; j < actuallyfroze.Count; j++)
{
if ((Object)(object)actuallyfroze[j] != (Object)null)
{
actuallyfroze[j].isKinematic = false;
}
}
}
}
public class projethrowa : abilitybaseeee
{
private string whatprojectileeee = "fireball";
private float howfastlaunchhh = 25f;
private float howfarupppp = 1f;
private DataHandler mydatahandlerrr;
private GameObject cachedprojecfabbb;
public override float cooldownnn => 6f;
public override float rangeee => 20f;
public override void DoMove(Rigidbody weapondeenemy, Rigidbody torsoofenemy, DataHandler dataofenemy)
{
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_0065: Unknown result type (might be due to invalid IL or missing references)
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
//IL_00c3: 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_00c9: Unknown result type (might be due to invalid IL or missing references)
//IL_00ce: 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_00ec: Unknown result type (might be due to invalid IL or missing references)
//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
//IL_0116: Unknown result type (might be due to invalid IL or missing references)
//IL_011b: Unknown result type (might be due to invalid IL or missing references)
//IL_0151: Unknown result type (might be due to invalid IL or missing references)
//IL_0158: Unknown result type (might be due to invalid IL or missing references)
//IL_015d: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)mydatahandlerrr == (Object)null)
{
mydatahandlerrr = ((Component)((Component)this).transform.root).GetComponentInChildren<DataHandler>();
}
if ((Object)(object)mydatahandlerrr == (Object)null || (Object)(object)mydatahandlerrr.torso == (Object)null || (Object)(object)torsoofenemy == (Object)null || ((Object)(object)dataofenemy != (Object)null && dataofenemy.team == mydatahandlerrr.team))
{
return;
}
if ((Object)(object)cachedprojecfabbb == (Object)null)
{
cachedprojecfabbb = findtheprojeee(whatprojectileeee);
}
if ((Object)(object)cachedprojecfabbb == (Object)null)
{
return;
}
Vector3 val = mydatahandlerrr.torso.position + Vector3.up * howfarupppp;
Vector3 val2 = torsoofenemy.position - val;
if (!(((Vector3)(ref val2)).sqrMagnitude < 0.0001f))
{
((Vector3)(ref val2)).Normalize();
GameObject val3 = Object.Instantiate<GameObject>(cachedprojecfabbb, val, Quaternion.LookRotation(val2));
TeamHolder val4 = val3.GetComponent<TeamHolder>();
if ((Object)(object)val4 == (Object)null)
{
val4 = val3.AddComponent<TeamHolder>();
}
val4.team = mydatahandlerrr.team;
val4.spawner = ((Component)((Component)this).transform.root).gameObject;
val4.target = torsoofenemy;
MoveTransform componentInChildren = val3.GetComponentInChildren<MoveTransform>();
if ((Object)(object)componentInChildren != (Object)null)
{
componentInChildren.worldImpulse = val2 * howfastlaunchhh;
}
}
}
private GameObject findtheprojeee(string namehassss)
{
foreach (GameObject projectile in ContentDatabase.Instance().LandfallContentDatabase.GetProjectiles())
{
if (!((Object)(object)projectile == (Object)null))
{
ProjectileEntity component = projectile.GetComponent<ProjectileEntity>();
string text = (((Object)(object)component != (Object)null && component.Entity != null) ? component.DisplayName : ((Object)projectile).name);
if (!string.IsNullOrEmpty(text) && text.ToLowerInvariant().Contains(namehassss.ToLowerInvariant()))
{
return projectile;
}
}
}
return null;
}
}
public class blinkbehindenemyy : abilitybaseeee
{
private float howfarbehindenemyyy = 1.5f;
private float howfarupppp = 1f;
private DataHandler mydatahandlerrr;
private RigidbodyHolder myrigholderrr;
public override float cooldownnn => 8f;
public override float rangeee => 15f;
public override bool triggeredbygettinghitt => true;
public override void DoMove(Rigidbody weapondeenemy, Rigidbody torsoofenemy, DataHandler dataofenemy)
{
//IL_007e: Unknown result type (might be due to invalid IL or missing references)
//IL_008e: Unknown result type (might be due to invalid IL or missing references)
//IL_0093: Unknown result type (might be due to invalid IL or missing references)
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
//IL_00c1: 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_00d2: 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)
//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
//IL_0101: Unknown result type (might be due to invalid IL or missing references)
//IL_0106: Unknown result type (might be due to invalid IL or missing references)
//IL_010b: Unknown result type (might be due to invalid IL or missing references)
//IL_0161: 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)
if ((Object)(object)mydatahandlerrr == (Object)null)
{
mydatahandlerrr = ((Component)((Component)this).transform.root).GetComponentInChildren<DataHandler>();
}
if ((Object)(object)myrigholderrr == (Object)null)
{
myrigholderrr = ((Component)((Component)this).transform.root).GetComponentInChildren<RigidbodyHolder>();
}
if ((Object)(object)mydatahandlerrr == (Object)null || (Object)(object)mydatahandlerrr.torso == (Object)null)
{
return;
}
Rigidbody val = findattackertorsooo(weapondeenemy, torsoofenemy);
if ((Object)(object)val == (Object)null)
{
return;
}
Vector3 val2 = val.position - mydatahandlerrr.torso.position;
val2.y = 0f;
if (((Vector3)(ref val2)).sqrMagnitude < 0.0001f)
{
return;
}
((Vector3)(ref val2)).Normalize();
Vector3 val3 = val.position + val2 * howfarbehindenemyyy;
val3.y += howfarupppp;
Transform root = ((Component)this).transform.root;
root.position += val3 - mydatahandlerrr.torso.position;
Physics.SyncTransforms();
if ((Object)(object)myrigholderrr != (Object)null && myrigholderrr.AllRigs != null)
{
Rigidbody[] allRigs = myrigholderrr.AllRigs;
foreach (Rigidbody val4 in allRigs)
{
if ((Object)(object)val4 != (Object)null && !val4.isKinematic)
{
val4.velocity = Vector3.zero;
val4.angularVelocity = Vector3.zero;
}
}
}
mydatahandlerrr.cantFallForSeconds = Mathf.Max(mydatahandlerrr.cantFallForSeconds, 0.5f);
}
private Rigidbody findattackertorsooo(Rigidbody weapondeenemy, Rigidbody torsoofenemy)
{
if ((Object)(object)weapondeenemy != (Object)null)
{
Unit componentInParent = ((Component)weapondeenemy).GetComponentInParent<Unit>();
if ((Object)(object)componentInParent != (Object)null && (Object)(object)componentInParent.data != (Object)null && (Object)(object)componentInParent.data.mainRig != (Object)null)
{
return componentInParent.data.mainRig;
}
}
return torsoofenemy;
}
}
public class onewiththespaghetti : abilitybaseeee
{
private float howthinnnn = 0.1f;
public override float cooldownnn => 0f;
public override float rangeee => 0f;
private void Update()
{
//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_0022: 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)
Vector3 localScale = ((Component)this).transform.root.localScale;
((Component)this).transform.root.localScale = new Vector3(howthinnnn, localScale.y, howthinnnn);
}
public override void DoMove(Rigidbody weapondeenemy, Rigidbody torsoofenemy, DataHandler dataofenemy)
{
}
}
public class letsaswapaplacess : abilitybaseeee
{
private DataHandler mydatahandlerrr;
public override float cooldownnn => 8f;
public override float rangeee => 40f;
public override void DoMove(Rigidbody weapondeenemy, Rigidbody torsoofenemy, DataHandler dataofenemy)
{
//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
//IL_0105: Unknown result type (might be due to invalid IL or missing references)
//IL_010a: Unknown result type (might be due to invalid IL or missing references)
//IL_010f: Unknown result type (might be due to invalid IL or missing references)
//IL_0111: 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_0119: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)mydatahandlerrr == (Object)null)
{
mydatahandlerrr = ((Component)((Component)this).transform.root).GetComponentInChildren<DataHandler>();
}
if (!((Object)(object)mydatahandlerrr == (Object)null) && !((Object)(object)mydatahandlerrr.mainRig == (Object)null) && !((Object)(object)torsoofenemy == (Object)null))
{
Unit componentInChildren = ((Component)((Component)this).transform.root).GetComponentInChildren<Unit>();
Unit componentInChildren2 = ((Component)((Component)torsoofenemy).transform.root).GetComponentInChildren<Unit>();
if (!((Object)(object)componentInChildren == (Object)null) && !((Object)(object)componentInChildren2 == (Object)null) && !((Object)(object)componentInChildren == (Object)(object)componentInChildren2) && !((Object)(object)componentInChildren.data == (Object)null) && !((Object)(object)componentInChildren2.data == (Object)null) && !componentInChildren.data.Dead && !componentInChildren2.data.Dead && !((Object)(object)componentInChildren.data.mainRig == (Object)null) && !((Object)(object)componentInChildren2.data.mainRig == (Object)null))
{
Vector3 val = componentInChildren2.data.mainRig.position - componentInChildren.data.mainRig.position;
moveunitttt(componentInChildren, val);
moveunitttt(componentInChildren2, -val);
Physics.SyncTransforms();
}
}
}
private static void moveunitttt(Unit theunitttt, Vector3 deltaaa)
{
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: 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)
RigidbodyHolder componentInChildren = ((Component)theunitttt).GetComponentInChildren<RigidbodyHolder>();
if ((Object)(object)componentInChildren == (Object)null || componentInChildren.AllRigs == null)
{
return;
}
Rigidbody[] allRigs = componentInChildren.AllRigs;
foreach (Rigidbody val in allRigs)
{
if ((Object)(object)val != (Object)null)
{
val.position += deltaaa;
}
}
}
}
public class onlyifequip : MonoBehaviour
{
private void Awake()
{
recheck();
}
private void OnEnable()
{
recheck();
}
private void recheck()
{
bool enabled = (Object)(object)((Component)((Component)this).transform.root).GetComponent<Unit>() != (Object)null;
thegenerics component = ((Component)this).GetComponent<thegenerics>();
ConditionalEvent component2 = ((Component)this).GetComponent<ConditionalEvent>();
abilitybaseeee component3 = ((Component)this).GetComponent<abilitybaseeee>();
if ((Object)(object)component != (Object)null)
{
((Behaviour)component).enabled = enabled;
}
if ((Object)(object)component2 != (Object)null)
{
((Behaviour)component2).enabled = enabled;
}
if ((Object)(object)component3 != (Object)null)
{
((Behaviour)component3).enabled = enabled;
}
}
}
public class reepwingzstabalot : MonoBehaviour
{
public string swingsfxnaem;
public string hitsfxnaem;
public AnimationCurve reachcurvee;
public AnimationCurve backtoholdcurv;
public AnimationCurve backtoholdfolcurv;
public AnimationCurve curvofthrow;
public Renderer[] armrendrz;
private Transform tgttransfrm;
private List<AttackArm> allthestabarms = new List<AttackArm>();
private float followrigamt;
private Unit mydudee;
private float stabtimerr;
private float snapspedd;
private void Start()
{
//IL_000d: 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_0033: 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_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: 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)
//IL_0086: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: Expected O, but got Unknown
for (int i = 0; i < ((Component)this).transform.childCount; i++)
{
allthestabarms.Add(new AttackArm
{
targetObj = ((Component)((Component)this).transform.GetChild(i).Find("Target")).gameObject,
restPosObj = ((Component)((Component)this).transform.GetChild(i).Find("RestPos")).gameObject,
lerpSpeed = Random.Range(0.5f, 1.5f),
smoothTargetPos = ((Component)this).transform.position,
targetPos = ((Component)this).transform.position
});
}
mydudee = ((Component)((Component)this).transform.root).GetComponent<Unit>();
if (armrendrz != null && (Object)(object)mydudee != (Object)null)
{
mydudee.AddRenderersToShowHide(armrendrz);
}
tgttransfrm = ((Component)mydudee.data.mainRig).transform;
((Component)this).transform.SetParent((Transform)null);
}
private void Update()
{
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_013a: 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_0147: Unknown result type (might be due to invalid IL or missing references)
//IL_014c: Unknown result type (might be due to invalid IL or missing references)
//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
//IL_0109: Unknown result type (might be due to invalid IL or missing references)
//IL_010e: Unknown result type (might be due to invalid IL or missing references)
//IL_0114: Unknown result type (might be due to invalid IL or missing references)
//IL_0115: Unknown result type (might be due to invalid IL or missing references)
//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
//IL_016b: Unknown result type (might be due to invalid IL or missing references)
//IL_0180: Unknown result type (might be due to invalid IL or missing references)
//IL_018b: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)tgttransfrm == (Object)null || mydudee.data.Dead)
{
Object.Destroy((Object)(object)((Component)this).gameObject);
return;
}
((Component)this).transform.SetPositionAndRotation(tgttransfrm.position, Quaternion.Lerp(((Component)this).transform.rotation, tgttransfrm.rotation, Time.deltaTime * 2.5f));
stabtimerr += Time.deltaTime;
for (int i = 0; i < allthestabarms.Count; i++)
{
AttackArm val = allthestabarms[i];
val.counter += Time.deltaTime;
Vector3 val2 = Vector3.Lerp(val.smoothTargetPos, val.targetPos, Time.deltaTime * 10f);
if ((int)val.armState == 0)
{
val.targetPos = Vector3.Lerp(val.targetPos, val.restPosObj.transform.position + wigglewobbl(val.lerpSpeed) * 2f, Time.deltaTime * 3f * val.lerpSpeed);
val.smoothTargetPos = val2;
snapspedd = 0f;
}
else
{
snapspedd += Time.deltaTime;
val.smoothTargetPos = Vector3.Lerp(val2, val.targetPos, snapspedd);
}
if ((Object)(object)val.heldUnit != (Object)null)
{
val.targetObj.transform.position = Vector3.Lerp(val.smoothTargetPos, val.heldUnit.data.mainRig.position, followrigamt);
}
else
{
val.targetObj.transform.position = val.smoothTargetPos;
}
}
if (allthestabarms.Count > 0)
{
triestabbin(allthestabarms[Random.Range(0, allthestabarms.Count)]);
}
}
private void FixedUpdate()
{
stabtimerr += Time.deltaTime;
for (int i = 0; i < allthestabarms.Count; i++)
{
holdnkillem(allthestabarms[i]);
}
}
private void holdnkillem(AttackArm onestabarm)
{
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_0074: 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_008e: Unknown result type (might be due to invalid IL or missing references)
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_0103: 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)
if ((Object)(object)onestabarm.heldUnit == (Object)null || (Object)(object)onestabarm.heldUnit.data.mainRig == (Object)null)
{
return;
}
if (!onestabarm.heldUnit.dead)
{
((Damagable)onestabarm.heldUnit.data.healthHandler).TakeDamage(1000f, Vector3.up, (Unit)null, (DamageType)0);
}
if (onestabarm.counter <= 0.1f)
{
return;
}
onestabarm.heldUnit.data.mainRig.AddForce((onestabarm.smoothTargetPos - onestabarm.heldUnit.data.mainRig.position) * 500f, (ForceMode)5);
Rigidbody mainRig = onestabarm.heldUnit.data.mainRig;
mainRig.velocity *= 0.7f;
for (int i = 0; i < onestabarm.heldUnit.data.allRigs.AllRigs.Length; i++)
{
if ((Object)(object)onestabarm.heldUnit.data.allRigs.AllRigs[i] != (Object)null)
{
Rigidbody obj = onestabarm.heldUnit.data.allRigs.AllRigs[i];
obj.velocity *= 0.8f;
}
}
onestabarm.heldUnit.data.sinceGrounded = 0f;
}
private void triestabbin(AttackArm onestabarm)
{
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Invalid comparison between Unknown and I4
if (!(stabtimerr < 0.7f) && !(onestabarm.counter < 10f) && (int)onestabarm.armState != 1 && Object.op_Implicit((Object)(object)mydudee.data.targetData) && !(mydudee.data.distanceToTarget > 5f))
{
stabtimerr = 0f;
onestabarm.counter = 0f;
((MonoBehaviour)this).StartCoroutine(stabbaroo(onestabarm, mydudee.data.targetData.unit));
}
}
private IEnumerator stabbaroo(AttackArm onestabarm, Unit thepoorguy)
{
onestabarm.armState = (ArmState)1;
float elapsdd = 0f;
float lenthh = AnimationCurveFunctions.GetAnimLength(reachcurvee);
if (swingsfxnaem != "")
{
ServiceLocator.GetService<SoundPlayer>().PlaySoundEffect(swingsfxnaem, 1f, ((Component)this).transform.position, (MaterialType)0, (Transform)null, 1f);
}
while (elapsdd < lenthh && Object.op_Implicit((Object)(object)thepoorguy) && Object.op_Implicit((Object)(object)thepoorguy.data.mainRig))
{
onestabarm.targetPos = onestabarm.restPosObj.transform.position + (thepoorguy.data.mainRig.position - onestabarm.restPosObj.transform.position) * reachcurvee.Evaluate(elapsdd);
elapsdd += Time.deltaTime;
yield return null;
}
elapsdd = 0f;
lenthh = AnimationCurveFunctions.GetAnimLength(backtoholdcurv);
onestabarm.heldUnit = thepoorguy;
onestabarm.counter = 0f;
if (Object.op_Implicit((Object)(object)thepoorguy) && hitsfxnaem != "")
{
ServiceLocator.GetService<SoundPlayer>().PlaySoundEffect(hitsfxnaem, 1f, ((Component)this).transform.position, (MaterialType)0, (Transform)null, 1f);
}
while (elapsdd < lenthh && Object.op_Implicit((Object)(object)thepoorguy) && Object.op_Implicit((Object)(object)thepoorguy.data.mainRig))
{
onestabarm.targetPos = onestabarm.restPosObj.transform.position + (thepoorguy.data.mainRig.position - onestabarm.restPosObj.transform.position) * backtoholdcurv.Evaluate(elapsdd);
elapsdd += Time.deltaTime;
followrigamt = backtoholdfolcurv.Evaluate(elapsdd);
yield return null;
}
onestabarm.armState = (ArmState)0;
}
private Vector3 wigglewobbl(float wobblspeed)
{
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
wobblspeed *= 0.2f;
Vector3 result = default(Vector3);
((Vector3)(ref result))..ctor(0f, 0f, 0f);
result.x += Mathf.PerlinNoise(Time.time * wobblspeed, 0f);
result.y += Mathf.PerlinNoise(Time.time * wobblspeed, Time.time * wobblspeed);
result.z += Mathf.PerlinNoise(0f, Time.time * wobblspeed);
result.x -= 0.5f;
result.y -= 0.5f;
result.z -= 0.5f;
return result;
}
}
[BepInPlugin("bayturtleking.traversaljump", "Mobility Abilities", "1.2.1")]
public class thejumpmod : BaseUnityPlugin
{
private List<abilitydef> abilitydefs = new List<abilitydef>
{
new abilitydef
{
name = "Long Jump",
localid = 738201455,
kind = iliketomoveitkind.launch,
howmuchforward = 60f,
howmuchup = 30f,
cooldown = 3f,
range = 6f
},
new abilitydef
{
name = "Small Dash",
localid = 738201456,
kind = iliketomoveitkind.launch,
howmuchforward = 40f,
howmuchup = 5f,
cooldown = 2f,
range = 5f
},
new abilitydef
{
name = "Backstep",
localid = 738201457,
kind = iliketomoveitkind.launch,
howmuchforward = -40f,
howmuchup = 8f,
cooldown = 3f,
range = 5f
},
new abilitydef
{
name = "Updraft",
localid = 738201458,
kind = iliketomoveitkind.launch,
howmuchforward = 0f,
howmuchup = 45f,
cooldown = 4f,
range = 4f
},
new abilitydef
{
name = "Grapple Pull",
localid = 738201459,
kind = iliketomoveitkind.pull,
howmuchforward = 40f,
cooldown = 4f,
range = 8f
},
new abilitydef
{
name = "Shove!!!!",
localid = 738201460,
kind = iliketomoveitkind.pull,
howmuchforward = -40f,
cooldown = 3f,
range = 3f
},
new abilitydef
{
name = "Anchor",
localid = 738201461,
kind = iliketomoveitkind.freeze,
howlongfreeze = 2f,
cooldown = 6f,
range = 3f
},
new abilitydef
{
name = "Fireball Summon",
localid = 738201462,
themovetypeeee = typeof(projethrowa)
},
new abilitydef
{
name = "Teleport Dodge",
localid = 738201463,
themovetypeeee = typeof(blinkbehindenemyy)
},
new abilitydef
{
name = "Become Spaghetti",
localid = 738201464,
themovetypeeee = typeof(onewiththespaghetti)
},
new abilitydef
{
name = "Swap Places",
localid = 738201465,
themovetypeeee = typeof(letsaswapaplacess)
}
};
private List<GameObject> sleepyabilitiesss = new List<GameObject>();
private void Awake()
{
((MonoBehaviour)this).StartCoroutine(addwhenre());
}
private IEnumerator addwhenre()
{
while (ContentDatabase.Instance() == null)
{
yield return null;
}
foreach (abilitydef abilitydef in abilitydefs)
{
addability(abilitydef);
}
addstabwingz();
while ((Object)(object)ServiceLocator.GetService<GlobalSettingsHandler>() == (Object)null || ServiceLocator.GetService<GlobalSettingsHandler>().GetSettingsInstance("GAMEPLAY_FLIP_COLORS") == null)
{
yield return null;
}
foreach (GameObject item in sleepyabilitiesss)
{
item.SetActive(true);
}
}
private void addability(abilitydef def)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: 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)
//IL_0082: Unknown result type (might be due to invalid IL or missing references)
//IL_008f: Expected O, but got Unknown
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: 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_0123: Unknown result type (might be due to invalid IL or missing references)
//IL_012a: Expected O, but got Unknown
//IL_0138: Unknown result type (might be due to invalid IL or missing references)
//IL_0142: Expected O, but got Unknown
//IL_0144: Unknown result type (might be due to invalid IL or missing references)
//IL_014e: Expected O, but got Unknown
//IL_0150: Unknown result type (might be due to invalid IL or missing references)
//IL_015a: Expected O, but got Unknown
//IL_0164: Unknown result type (might be due to invalid IL or missing references)
//IL_0169: Unknown result type (might be due to invalid IL or missing references)
//IL_016b: 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_0177: 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_018a: Unknown result type (might be due to invalid IL or missing references)
//IL_0197: Expected O, but got Unknown
//IL_0199: Unknown result type (might be due to invalid IL or missing references)
//IL_019e: Unknown result type (might be due to invalid IL or missing references)
//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
//IL_01c7: Expected O, but got Unknown
//IL_01db: Unknown result type (might be due to invalid IL or missing references)
//IL_01e5: Expected O, but got Unknown
//IL_0229: Unknown result type (might be due to invalid IL or missing references)
//IL_0235: Unknown result type (might be due to invalid IL or missing references)
GameObject val = new GameObject(def.name);
val.SetActive(false);
Object.DontDestroyOnLoad((Object)(object)val);
((Object)val).hideFlags = (HideFlags)52;
SpecialAbility obj = val.AddComponent<SpecialAbility>();
CharacterItem component = val.GetComponent<CharacterItem>();
if ((Object)(object)component != (Object)null)
{
component.tags = new List<Tag>
{
new Tag
{
tagType = (TagType)0,
value = "Mobility Abilities"
}
};
}
DatabaseEntity val2 = new DatabaseEntity((WorkshopContentType)4)
{
GUID = new DatabaseID(738201400, def.localid),
Name = def.name
};
doprivstuff(obj, "m_entity", val2);
if (def.themovetypeeee != null)
{
attachthecustomabilityyy(val, def);
}
else
{
thegenerics thegenerics2 = val.AddComponent<thegenerics>();
thegenerics2.kind = def.kind;
thegenerics2.howmuchforward = def.howmuchforward;
thegenerics2.howmuchup = def.howmuchup;
thegenerics2.howlongfreeze = def.howlongfreeze;
thegenerics2.range = def.range;
thegenerics2.cooldown = def.cooldown;
((Behaviour)thegenerics2).enabled = false;
ConditionalEvent val3 = val.AddComponent<ConditionalEvent>();
((Behaviour)val3).enabled = false;
ConditionalEventInstance val4 = new ConditionalEventInstance();
val4.delay = 0f;
val4.turnOnEvent = new UnityEvent();
val4.turnOffEvent = new UnityEvent();
val4.continuousEvent = new UnityEvent();
val4.conditions = (EventCondition[])(object)new EventCondition[2]
{
new EventCondition
{
conditionType = (ConditionType)0,
startOnCD = true,
alwaysResetCounter = true,
value = def.cooldown,
counter = def.cooldown
},
new EventCondition
{
conditionType = (ConditionType)1,
whichRange = (WhichRange)0,
valueType = (ValueType)1,
value = def.range,
startOnCD = true
}
};
val4.turnOnEvent.AddListener(new UnityAction(thegenerics2.TriggerFromEvent));
val3.events = (ConditionalEventInstance[])(object)new ConditionalEventInstance[1] { val4 };
}
val.AddComponent<onlyifequip>();
LandfallContentDatabase landfallContentDatabase = ContentDatabase.Instance().LandfallContentDatabase;
Dictionary<DatabaseID, Object> dictionary = getprivatefield<Dictionary<DatabaseID, Object>>(ContentDatabase.Instance().AssetLoader, "m_nonStreamableAssets");
Dictionary<DatabaseID, GameObject> dictionary2 = getprivatefield<Dictionary<DatabaseID, GameObject>>(landfallContentDatabase, "m_combatMoves");
dictionary[val2.GUID] = (Object)(object)val;
dictionary2[val2.GUID] = val;
sleepyabilitiesss.Add(val);
((BaseUnityPlugin)this).Logger.LogInfo((object)(def.name + " is now an ability cuz of turtle's abilities mod"));
}
private void addstabwingz()
{
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_0080: Expected O, but got Unknown
//IL_00e7: 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)
//IL_0101: 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_01f9: Unknown result type (might be due to invalid IL or missing references)
//IL_020d: Unknown result type (might be due to invalid IL or missing references)
LandfallContentDatabase landfallContentDatabase = ContentDatabase.Instance().LandfallContentDatabase;
GameObject val = null;
foreach (GameObject combatMove in landfallContentDatabase.GetCombatMoves())
{
if ((Object)(object)combatMove != (Object)null && (Object)(object)combatMove.GetComponentInChildren<ReaperWings>(true) != (Object)null)
{
val = combatMove;
break;
}
}
if ((Object)(object)val == (Object)null)
{
((BaseUnityPlugin)this).Logger.LogWarning((object)"no find reaperwings in the abilitys so no stab all :(");
return;
}
GameObject val2 = new GameObject("daturtabilitypoe");
val2.SetActive(false);
Object.DontDestroyOnLoad((Object)(object)val2);
((Object)val2).hideFlags = (HideFlags)52;
GameObject val3 = Object.Instantiate<GameObject>(val, val2.transform);
((Object)val3).name = "Reaper Wings (Stab All)";
CharacterItem componentInChildren = val3.GetComponentInChildren<CharacterItem>(true);
if ((Object)(object)componentInChildren == (Object)null)
{
Object.Destroy((Object)(object)val3);
Object.Destroy((Object)(object)val2);
((BaseUnityPlugin)this).Logger.LogWarning((object)"reaper wings thing has no char item :(");
return;
}
componentInChildren.tags = new List<Tag>
{
new Tag
{
tagType = (TagType)0,
value = "Mobility Abilities"
}
};
componentInChildren.Entity.Name = "Reaper Wings (Stab All)";
componentInChildren.Entity.GUID = new DatabaseID(738201400, 738201466);
ReaperWings[] componentsInChildren = val3.GetComponentsInChildren<ReaperWings>(true);
foreach (ReaperWings val4 in componentsInChildren)
{
reepwingzstabalot obj = ((Component)val4).gameObject.AddComponent<reepwingzstabalot>();
obj.swingsfxnaem = val4.swingRef;
obj.hitsfxnaem = val4.hitRef;
obj.reachcurvee = val4.reachCurve;
obj.backtoholdcurv = val4.goBackToHoldCurve;
obj.backtoholdfolcurv = val4.goBackToHoldCurveFollowMainRigAmount;
obj.curvofthrow = val4.throwCurve;
obj.armrendrz = getprivatefield<Renderer[]>(val4, "armRenderers");
Object.DestroyImmediate((Object)(object)val4);
}
Dictionary<DatabaseID, Object> dictionary = getprivatefield<Dictionary<DatabaseID, Object>>(ContentDatabase.Instance().AssetLoader, "m_nonStreamableAssets");
Dictionary<DatabaseID, GameObject> dictionary2 = getprivatefield<Dictionary<DatabaseID, GameObject>>(landfallContentDatabase, "m_combatMoves");
dictionary[componentInChildren.Entity.GUID] = (Object)(object)val3;
dictionary2[componentInChildren.Entity.GUID] = val3;
((BaseUnityPlugin)this).Logger.LogInfo((object)"Reaper Wings (Stab All) is now an ability cuz of turtle's abilities mod, it stabs everyone now");
}
private void attachthecustomabilityyy(GameObject val, abilitydef def)
{
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_005c: 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)
//IL_0063: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006a: 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)
//IL_007b: Unknown result type (might be due to invalid IL or missing references)
//IL_0087: Expected O, but got Unknown
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: 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_0094: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
//IL_00af: Unknown result type (might be due to invalid IL or missing references)
//IL_00c0: Expected O, but got Unknown
//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
//IL_00d3: Expected O, but got Unknown
//IL_00df: Unknown result type (might be due to invalid IL or missing references)
//IL_00e9: Expected O, but got Unknown
//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
//IL_00f4: Expected O, but got Unknown
//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ff: Expected O, but got Unknown
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Expected O, but got Unknown
abilitybaseeee abilitybaseeee2 = (abilitybaseeee)(object)val.AddComponent(def.themovetypeeee);
((Behaviour)abilitybaseeee2).enabled = false;
if (!(abilitybaseeee2.cooldownnn <= 0f) || !(abilitybaseeee2.rangeee <= 0f))
{
List<EventCondition> list = new List<EventCondition>();
if (abilitybaseeee2.triggeredbygettinghitt)
{
list.Add(new EventCondition
{
conditionType = (ConditionType)3
});
}
list.Add(new EventCondition
{
conditionType = (ConditionType)1,
whichRange = (WhichRange)0,
valueType = (ValueType)1,
value = abilitybaseeee2.rangeee,
startOnCD = true
});
list.Add(new EventCondition
{
conditionType = (ConditionType)0,
startOnCD = !abilitybaseeee2.triggeredbygettinghitt,
value = abilitybaseeee2.cooldownnn,
counter = abilitybaseeee2.cooldownnn
});
ConditionalEvent obj = val.AddComponent<ConditionalEvent>();
((Behaviour)obj).enabled = false;
ConditionalEventInstance val2 = new ConditionalEventInstance();
val2.delay = 0f;
val2.turnOnEvent = new UnityEvent();
val2.turnOffEvent = new UnityEvent();
val2.continuousEvent = new UnityEvent();
val2.conditions = list.ToArray();
obj.events = (ConditionalEventInstance[])(object)new ConditionalEventInstance[1] { val2 };
}
}
private static void doprivstuff(object obj, string fieldname, object value)
{
getanyfieldd(obj.GetType(), fieldname)?.SetValue(obj, value);
}
private static T getprivatefield<T>(object obj, string fieldname)
{
FieldInfo fieldInfo = getanyfieldd(obj.GetType(), fieldname);
if (fieldInfo == null)
{
return default(T);
}
return (T)fieldInfo.GetValue(obj);
}
private static FieldInfo getanyfieldd(Type t, string fieldname)
{
while (t != null)
{
FieldInfo field = t.GetField(fieldname, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
if (field != null)
{
return field;
}
t = t.BaseType;
}
return null;
}
}