using System;
using System.Collections.Generic;
using System.Diagnostics;
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 BepInEx.Logging;
using HarmonyLib;
using Jotunn.Configs;
using Jotunn.Entities;
using Jotunn.Managers;
using Jotunn.Utils;
using UnityEngine;
using shawcape;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("Shawesomes_Infinte_Multiverse")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Shawesomes_Infinte_Multiverse")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("e0e26f8d-a8f0-41a7-a502-951624fa6f31")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
public class Patches : MonoBehaviour
{
[HarmonyPatch(typeof(Player), "SetControls")]
[HarmonyPrefix]
private static void PrefixSetControlsforShip(Player __instance, ref bool jump, ref bool crouch, ref bool attack, ref bool secondaryAttack, ref bool block)
{
Ship controlledShip = __instance.GetControlledShip();
ShipDrive shipDrive = default(ShipDrive);
if (!((Object)(object)controlledShip == (Object)null) && ((Component)controlledShip).gameObject.TryGetComponent<ShipDrive>(ref shipDrive))
{
shipDrive.drive(ref jump, ref crouch, ref attack, ref secondaryAttack, ref block);
}
}
[HarmonyPatch(typeof(Ship), "CustomFixedUpdate")]
[HarmonyPrefix]
private static void PrefixSHipUpdate(Ship __instance)
{
ShipDrive shipDrive = default(ShipDrive);
if (((Component)__instance).gameObject.TryGetComponent<ShipDrive>(ref shipDrive))
{
shipDrive.fixedUpdate();
}
}
}
public class ShipDrive : MonoBehaviour
{
private enum wheeltype
{
awd,
rwd,
fwd,
motorcycle
}
private Ship ship;
private Rigidbody rb;
private wheeltype wt = wheeltype.awd;
public float wheeltorque = 50f;
public float turntorque = 1f;
private List<Transform> steeringObjects;
private List<Rigidbody> wheels;
public Vector3 steeringoffset = new Vector3(0f, 90f, 0f);
public Vector3 wheeltorqueDir = new Vector3(0f, 0f, 1f);
public ForceMode fmode = (ForceMode)1;
public bool relative = true;
public float carForce = 140f;
public float turnForce = 12.4f;
private float forwardAmt = 0f;
public float boostForce = 3f;
private float backforce = 50f;
private Vector3[] projectileForce = (Vector3[])(object)new Vector3[3]
{
new Vector3(0f, 0f, 30f),
new Vector3(0f, 0f, 150f),
new Vector3(0f, 0f, -10f)
};
public Vector3[] projectileLoc = (Vector3[])(object)new Vector3[3]
{
new Vector3(0f, 3.6f, -3f),
new Vector3(1.5f, 3.9f, -6f),
new Vector3(0f, 3f, -10f)
};
private float[] projectileCooldown = new float[3] { 16f, 11f, 0.1f };
private float[] lastProjectile = new float[3];
private int[] AmtBeforeRecharge = new int[3] { 4, 10, 0 };
private int[] AmtInChamber = new int[3] { 4, 10, 0 };
public void Awake()
{
hasShip();
}
private void getWheels(GameObject ship)
{
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Expected O, but got Unknown
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Invalid comparison between Unknown and I4
Component[] componentsInChildren = (Component[])(object)ship.GetComponentsInChildren<ConfigurableJoint>();
Component[] array = componentsInChildren;
steeringObjects = new List<Transform>();
wheels = new List<Rigidbody>();
Component[] array2 = array;
for (int i = 0; i < array2.Length; i++)
{
ConfigurableJoint val = (ConfigurableJoint)array2[i];
if ((int)val.angularZMotion == 2)
{
wheels.Add(((Component)val).GetComponent<Rigidbody>());
}
}
steeringObjects.Add(ship.transform.Find("Wheel FR_vis"));
steeringObjects.Add(ship.transform.Find("Wheel FL_vis"));
}
public void fixedUpdate()
{
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: 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)
foreach (Transform steeringObject in steeringObjects)
{
steeringObject.localEulerAngles = new Vector3(steeringObject.localEulerAngles.x, steeringObject.localEulerAngles.y, ((Component)wheels[2]).transform.localEulerAngles.z);
}
}
private bool hasShip()
{
if (Object.op_Implicit((Object)(object)ship))
{
return true;
}
ship = ((Component)this).gameObject.GetComponent<Ship>();
if (Object.op_Implicit((Object)(object)ship))
{
rb = ship.m_body;
getWheels(((Component)this).gameObject);
if (Object.op_Implicit((Object)(object)rb))
{
return true;
}
return false;
}
return false;
}
public void drive(ref bool jump, ref bool crouch, ref bool attack, ref bool secondaryattack, ref bool block)
{
//IL_0218: Unknown result type (might be due to invalid IL or missing references)
//IL_021d: Unknown result type (might be due to invalid IL or missing references)
//IL_0222: Unknown result type (might be due to invalid IL or missing references)
//IL_0227: Unknown result type (might be due to invalid IL or missing references)
//IL_0228: Unknown result type (might be due to invalid IL or missing references)
//IL_0229: Unknown result type (might be due to invalid IL or missing references)
//IL_023a: Unknown result type (might be due to invalid IL or missing references)
//IL_023f: 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_04b1: Unknown result type (might be due to invalid IL or missing references)
//IL_04bb: Unknown result type (might be due to invalid IL or missing references)
//IL_02e6: Unknown result type (might be due to invalid IL or missing references)
//IL_031a: Unknown result type (might be due to invalid IL or missing references)
//IL_032a: Unknown result type (might be due to invalid IL or missing references)
//IL_0336: Unknown result type (might be due to invalid IL or missing references)
//IL_033b: Unknown result type (might be due to invalid IL or missing references)
//IL_0340: Unknown result type (might be due to invalid IL or missing references)
//IL_0350: Unknown result type (might be due to invalid IL or missing references)
//IL_0380: 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_0391: Unknown result type (might be due to invalid IL or missing references)
//IL_0396: Unknown result type (might be due to invalid IL or missing references)
//IL_0133: Unknown result type (might be due to invalid IL or missing references)
//IL_0143: Unknown result type (might be due to invalid IL or missing references)
//IL_0150: Unknown result type (might be due to invalid IL or missing references)
//IL_0166: 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_0175: Unknown result type (might be due to invalid IL or missing references)
//IL_0185: Unknown result type (might be due to invalid IL or missing references)
//IL_051f: Unknown result type (might be due to invalid IL or missing references)
//IL_0524: Unknown result type (might be due to invalid IL or missing references)
//IL_0529: Unknown result type (might be due to invalid IL or missing references)
//IL_0534: Unknown result type (might be due to invalid IL or missing references)
//IL_0539: Unknown result type (might be due to invalid IL or missing references)
//IL_053e: Unknown result type (might be due to invalid IL or missing references)
//IL_05d4: Unknown result type (might be due to invalid IL or missing references)
//IL_05df: Unknown result type (might be due to invalid IL or missing references)
//IL_05ef: Unknown result type (might be due to invalid IL or missing references)
//IL_05fa: Unknown result type (might be due to invalid IL or missing references)
//IL_062f: Unknown result type (might be due to invalid IL or missing references)
//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
//IL_01de: Unknown result type (might be due to invalid IL or missing references)
//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
//IL_0559: Unknown result type (might be due to invalid IL or missing references)
//IL_0569: Unknown result type (might be due to invalid IL or missing references)
//IL_0573: Unknown result type (might be due to invalid IL or missing references)
//IL_057e: Unknown result type (might be due to invalid IL or missing references)
//IL_0589: Unknown result type (might be due to invalid IL or missing references)
//IL_0590: Unknown result type (might be due to invalid IL or missing references)
//IL_0596: Unknown result type (might be due to invalid IL or missing references)
//IL_065c: Unknown result type (might be due to invalid IL or missing references)
//IL_0661: Unknown result type (might be due to invalid IL or missing references)
//IL_0663: Unknown result type (might be due to invalid IL or missing references)
//IL_0668: Unknown result type (might be due to invalid IL or missing references)
//IL_068c: Unknown result type (might be due to invalid IL or missing references)
//IL_0694: Unknown result type (might be due to invalid IL or missing references)
//IL_0699: Unknown result type (might be due to invalid IL or missing references)
//IL_069e: Unknown result type (might be due to invalid IL or missing references)
//IL_06d8: Unknown result type (might be due to invalid IL or missing references)
//IL_06e0: Unknown result type (might be due to invalid IL or missing references)
//IL_06e5: Unknown result type (might be due to invalid IL or missing references)
//IL_06ea: Unknown result type (might be due to invalid IL or missing references)
//IL_071a: Unknown result type (might be due to invalid IL or missing references)
//IL_072b: Unknown result type (might be due to invalid IL or missing references)
//IL_0730: Unknown result type (might be due to invalid IL or missing references)
//IL_073a: Unknown result type (might be due to invalid IL or missing references)
//IL_073f: Unknown result type (might be due to invalid IL or missing references)
//IL_076a: Unknown result type (might be due to invalid IL or missing references)
//IL_076f: Unknown result type (might be due to invalid IL or missing references)
//IL_0774: Unknown result type (might be due to invalid IL or missing references)
//IL_077b: Unknown result type (might be due to invalid IL or missing references)
//IL_0780: Unknown result type (might be due to invalid IL or missing references)
if (!hasShip())
{
Shawesomes_Divine_Armaments.logger.LogWarning((object)"Does not have ship");
return;
}
float time = Time.time;
if (attack | secondaryattack | block)
{
Container component = ((Component)this).gameObject.GetComponent<Container>();
if ((Object)(object)component != (Object)null)
{
int num = (block ? 1 : 0);
if (time > lastProjectile[num] + projectileCooldown[num])
{
List<DropData> drops = component.m_defaultItems.m_drops;
GameObject item = drops[num].m_item;
if ((Object)(object)item != (Object)null)
{
if (AmtBeforeRecharge[num] > 0)
{
if (--AmtInChamber[num] <= 0)
{
AmtInChamber[num] = AmtBeforeRecharge[num];
lastProjectile[num] = time;
}
}
else
{
lastProjectile[num] = time;
}
for (int i = 0; i <= num; i++)
{
GameObject val = Object.Instantiate<GameObject>(item, ((Component)this).gameObject.transform.position + ((Component)this).gameObject.transform.rotation * Vector3.Scale(projectileLoc[num], new Vector3((float)(1 - 2 * i), 1f, 1f)), ((Component)this).gameObject.transform.rotation);
Projectile component2 = val.GetComponent<Projectile>();
if (Object.op_Implicit((Object)(object)component2))
{
Shawesomes_Divine_Armaments.logger.LogWarning((object)((!block) ? "attempt to attack primary1" : "attempt to attack secondary2"));
component2.m_vel = ((Component)this).gameObject.transform.rotation * projectileForce[num];
}
}
}
}
}
attack = false;
secondaryattack = false;
}
Vector3 val2 = rb.rotation * Vector3.forward;
float num2 = Vector3.Dot(val2, Vector3.up);
float num3 = Vector3.Dot(rb.velocity, val2);
float num4 = 1f;
if (jump)
{
jump = false;
}
if (ZInput.GetButton("Jump") || ZInput.GetButtonDown("JoyJump"))
{
num4 = boostForce;
forwardAmt += 0.8f;
Container component3 = ((Component)this).gameObject.GetComponent<Container>();
try
{
if ((Object)(object)component3 != (Object)null && time > lastProjectile[2] + projectileCooldown[2])
{
List<DropData> drops2 = component3.m_defaultItems.m_drops;
GameObject item2 = drops2[2].m_item;
if ((Object)(object)item2 != (Object)null)
{
lastProjectile[2] = time;
GameObject val3 = Object.Instantiate<GameObject>(item2, ((Component)this).gameObject.transform.position + ((Component)this).gameObject.transform.rotation * projectileLoc[2], ((Component)this).gameObject.transform.rotation);
Projectile component4 = val3.GetComponent<Projectile>();
if (Object.op_Implicit((Object)(object)component4))
{
component4.m_vel = ((Component)this).gameObject.transform.rotation * projectileForce[2];
}
}
}
}
catch (Exception ex)
{
Shawesomes_Divine_Armaments.logger.LogWarning((object)("err=" + ex.Message));
}
}
if (ZInput.GetButton("Forward"))
{
forwardAmt += 0.4f;
}
if (ZInput.GetButton("Backward"))
{
forwardAmt -= 0.2f;
}
if (forwardAmt > 1f)
{
forwardAmt = 1f;
}
else if (forwardAmt < -1f)
{
forwardAmt = -1f;
}
forwardAmt *= num4;
float rudderValue = ship.m_rudderValue;
for (int j = 0; j < steeringObjects.Count; j++)
{
steeringObjects[j].localEulerAngles = new Vector3(steeringoffset.x, steeringoffset.y + rudderValue * 20f, ((Component)wheels[j + 2]).transform.localEulerAngles.z);
}
if (forwardAmt * forwardAmt > 0.04f)
{
foreach (Rigidbody wheel in wheels)
{
float num5 = ((Vector3.Dot(wheel.rotation * Vector3.forward, rb.rotation * Vector3.right) > 0f) ? 1 : (-1));
wheel.AddRelativeTorque(wheeltorqueDir * rb.mass * 450f * forwardAmt * wheeltorque * num5, fmode);
}
rb.AddRelativeForce(new Vector3(0f, -0.1f, 0.4f) * forwardAmt * rb.mass * carForce);
rb.AddRelativeTorque(new Vector3((0f - backforce) * rb.mass * forwardAmt, 0f, 0.5f));
num3 = Mathf.Min(Math.Abs(num3), 5f) * (float)((num3 > 0f) ? 1 : (-1));
int num6 = 0;
Vector3 zero = Vector3.zero;
Vector3 zero2 = Vector3.zero;
((Joint)((Component)wheels[2]).gameObject.GetComponent<ConfigurableJoint>()).GetCurrentForces(ref zero, ref zero2);
num6 += ((Vector3.Dot(zero, rb.rotation * Vector3.up) < 0f) ? 1 : 0);
((Joint)((Component)wheels[3]).gameObject.GetComponent<ConfigurableJoint>()).GetCurrentForces(ref zero, ref zero2);
num6 += ((Vector3.Dot(zero, rb.rotation * Vector3.up) < 0f) ? 1 : 0);
if (num6 > 0)
{
Vector3 val4 = (steeringObjects[0].position + steeringObjects[1].position) / 2f;
float num7 = (float)num6 * rudderValue * rb.mass * turnForce * num3;
rb.AddForceAtPosition(rb.rotation * Vector3.right * num7, val4);
}
}
ship.m_rudderValue += 0.02f * (Mathf.Max(Mathf.Abs(num3) - 4f, 0f) * (float)((!(ship.m_rudderValue > 0f)) ? 1 : (-1)));
forwardAmt *= 0.9f;
}
}
public static class Utils2
{
private const BindingFlags bindingFlags = BindingFlags.Public;
public static T GetCopyOf<T>(this Component comp, T other) where T : Component
{
Type type = ((object)comp).GetType();
if (type != ((object)other).GetType())
{
return default(T);
}
List<Type> list = new List<Type>();
Type baseType = type.BaseType;
while (baseType != null && !(baseType == typeof(MonoBehaviour)))
{
list.Add(baseType);
baseType = baseType.BaseType;
}
IEnumerable<PropertyInfo> enumerable = type.GetProperties(BindingFlags.Public);
foreach (Type item in list)
{
enumerable = enumerable.Concat(item.GetProperties(BindingFlags.Public));
}
enumerable = from property in enumerable
where !(type == typeof(Rigidbody)) || !(property.Name == "inertiaTensor")
where !property.CustomAttributes.Any((CustomAttributeData attribute) => attribute.AttributeType == typeof(ObsoleteAttribute))
select property;
foreach (PropertyInfo pinfo in enumerable)
{
if (pinfo.CanWrite && !enumerable.Any((PropertyInfo e) => e.Name == $"shared{char.ToUpper(pinfo.Name[0])}{pinfo.Name.Substring(1)}"))
{
try
{
pinfo.SetValue(comp, pinfo.GetValue(other, null), null);
}
catch
{
}
}
}
IEnumerable<FieldInfo> enumerable2 = type.GetFields(BindingFlags.Public);
foreach (FieldInfo finfo in enumerable2)
{
foreach (Type item2 in list)
{
if (!enumerable2.Any((FieldInfo e) => e.Name == $"shared{char.ToUpper(finfo.Name[0])}{finfo.Name.Substring(1)}"))
{
enumerable2 = enumerable2.Concat(item2.GetFields(BindingFlags.Public));
}
}
}
foreach (FieldInfo item3 in enumerable2)
{
item3.SetValue(comp, item3.GetValue(other));
}
enumerable2 = enumerable2.Where((FieldInfo field) => field.CustomAttributes.Any((CustomAttributeData attribute) => attribute.AttributeType == typeof(ObsoleteAttribute)));
foreach (FieldInfo item4 in enumerable2)
{
item4.SetValue(comp, item4.GetValue(other));
}
return (T)(object)((comp is T) ? comp : null);
}
public static T AddComponent<T>(this GameObject go, T toAdd) where T : Component
{
return go.AddComponent(((object)toAdd).GetType()).GetCopyOf(toAdd);
}
public static void updateSKMesh(Transform parent, SkinnedMeshRenderer skmesh)
{
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
List<ParticleSystem> list = ((Component)parent).GetComponentsInChildren<ParticleSystem>().ToList();
foreach (ParticleSystem item in list)
{
ShapeModule shape = item.shape;
if (!Object.op_Implicit((Object)(object)((ShapeModule)(ref shape)).skinnedMeshRenderer))
{
ShapeModule shape2 = item.shape;
((ShapeModule)(ref shape2)).skinnedMeshRenderer = skmesh;
}
}
}
public static SkinnedMeshRenderer createSkMeshRen(Transform objectTrans, Transform attach_skin)
{
SkinnedMeshRenderer val = default(SkinnedMeshRenderer);
if (!((Component)objectTrans).gameObject.TryGetComponent<SkinnedMeshRenderer>(ref val))
{
val = ((Component)objectTrans).gameObject.AddComponent<SkinnedMeshRenderer>();
}
val.rootBone = attach_skin.Find("Armature").Find("Hips");
return val;
}
public static Mesh createBonedMesh(Mesh newmesh, Mesh copymesh, Vector3 pos, Vector3 rot, Vector3 scale, bool stretch = true)
{
//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_0004: Unknown result type (might be due to invalid IL or missing references)
Mesh newmesh2 = AlignedSkinMesh(newmesh, pos, rot, scale);
return copyBoneWeights(newmesh2, copymesh, stretch);
}
public static Mesh AlignedSkinMesh(Mesh meshtomodify, Vector3 pos, Vector3 rot, Vector3 scale)
{
//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)
//IL_002d: 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_005d: 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_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_006e: 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_0076: 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)
//IL_0083: Unknown result type (might be due to invalid IL or missing references)
//IL_008a: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
Mesh val = Object.Instantiate<Mesh>(meshtomodify);
List<Vector3> list = new List<Vector3>();
for (int i = 0; i < meshtomodify.vertices.Count(); i++)
{
Vector3 val2 = Quaternion.Euler(rot) * new Vector3(meshtomodify.vertices[i].x * scale.x, meshtomodify.vertices[i].y * scale.y, meshtomodify.vertices[i].z * scale.z);
list.Add(new Vector3(val2.x + pos.x, val2.y + pos.y, val2.z + pos.z));
}
val.SetVertices(list);
((Object)val).name = "copymesh";
return val;
}
public static Mesh copyBoneWeights(Mesh newmesh, Mesh copymesh, bool stretch = true)
{
//IL_006b: 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_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_0087: Unknown result type (might be due to invalid IL or missing references)
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_002c: 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_00d1: Unknown result type (might be due to invalid IL or missing references)
//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
BoneWeight[] array = (BoneWeight[])(object)new BoneWeight[newmesh.vertexCount];
newmesh.bindposes = copymesh.bindposes;
if (stretch)
{
for (int i = 0; i < newmesh.vertexCount; i++)
{
int closestVert = getClosestVert(newmesh.vertices[i], copymesh.vertices);
array[i] = copymesh.boneWeights[closestVert];
}
}
else
{
Vector3 val = Vector3.zero;
for (int j = 0; j < newmesh.vertexCount; j++)
{
val += newmesh.vertices[j];
}
int closestVert2 = getClosestVert(val / (float)newmesh.vertexCount, copymesh.vertices);
for (int k = 0; k < newmesh.vertexCount; k++)
{
array[k] = copymesh.boneWeights[closestVert2];
}
}
newmesh.boneWeights = array;
return newmesh;
}
public static int getClosestVert(Vector3 vert, Vector3[] basemesh)
{
//IL_000e: 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)
float num = 99999f;
int result = -1;
for (int i = 0; i < basemesh.Length; i++)
{
float num2 = Vector3.Distance(vert, basemesh[i]);
if (num2 < num)
{
num = num2;
result = i;
}
}
return result;
}
public static void alignMeshAllChidren(Transform objectTrans, Transform basetransform)
{
//IL_001a: 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)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: 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_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: 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_004f: 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_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: 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_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_0069: 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_006d: 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_0077: 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_00b5: 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)
MeshFilter[] componentsInChildren = ((Component)objectTrans).GetComponentsInChildren<MeshFilter>();
for (int i = 0; i < componentsInChildren.Length; i++)
{
Transform val = ((Component)componentsInChildren[i]).transform;
Vector3 val2 = val.localPosition;
Vector3 val3 = ((Component)val).transform.localEulerAngles;
Vector3 val4 = ((Component)val).transform.localScale;
for (int j = 0; j < 20; j++)
{
if (!((Object)(object)val.parent != (Object)(object)objectTrans))
{
break;
}
val = val.parent;
val4 = Vector3.Scale(val4, val.localScale);
val2 = Vector3.Scale(val4, val2) + val.localPosition;
val3 += val.localEulerAngles;
}
SkinnedMeshRenderer val5 = createSkMeshRen(((Component)componentsInChildren[i]).transform, basetransform);
val5.sharedMesh = AlignedSkinMesh(val5.sharedMesh, val2, val3, val4);
}
}
public static void boneMeshAllChidren(Transform objectTrans, Transform basetransform, Mesh baseMesh, bool stretch = true)
{
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: 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_004f: 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_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_006b: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: 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_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: 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_0083: 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_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: 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_00bc: 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_00d3: Unknown result type (might be due to invalid IL or missing references)
//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
Transform val = basetransform.Find("Armature").Find("Hips");
MeshFilter[] componentsInChildren = ((Component)objectTrans).GetComponentsInChildren<MeshFilter>();
for (int i = 0; i < componentsInChildren.Length; i++)
{
Transform val2 = ((Component)componentsInChildren[i]).transform;
Vector3 val3 = val2.localPosition;
Vector3 val4 = ((Component)val2).transform.localEulerAngles;
Vector3 val5 = ((Component)val2).transform.localScale;
for (int j = 0; j < 20; j++)
{
if (!((Object)(object)val2.parent != (Object)(object)objectTrans))
{
break;
}
val2 = val2.parent;
val5 = Vector3.Scale(val5, val2.localScale);
val3 = Vector3.Scale(val5, val3) + val2.localPosition;
val4 += val2.localEulerAngles;
}
val3 += new Vector3(0f, 0f - val.localPosition.y, 0f - val.localPosition.z);
SkinnedMeshRenderer val6 = createSkMeshRen(((Component)componentsInChildren[i]).transform, basetransform);
val6.sharedMesh = createBonedMesh(val6.sharedMesh, baseMesh, val3, val4, val5, stretch);
}
}
public static void setStyleTex(Material mat, Texture2D styles)
{
mat.EnableKeyword("_USESTYLES_ON");
mat.SetFloat("_Style", 0f);
mat.SetFloat("_UseStyles", 1f);
mat.SetTexture("_StyleTex", (Texture)(object)styles);
}
public static Mesh createScaledCape(Mesh originalMesh, Vector3 scaleTop, Vector3 scaleBot, Vector3 offset = default(Vector3))
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//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)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: 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)
//IL_0034: 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_0046: 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_0058: 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_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_0083: 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_0095: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
//IL_00ea: 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_00f6: Unknown result type (might be due to invalid IL or missing references)
//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0104: Unknown result type (might be due to invalid IL or missing references)
//IL_010c: Unknown result type (might be due to invalid IL or missing references)
//IL_0112: Unknown result type (might be due to invalid IL or missing references)
//IL_011e: Unknown result type (might be due to invalid IL or missing references)
//IL_0125: Unknown result type (might be due to invalid IL or missing references)
//IL_012b: Unknown result type (might be due to invalid IL or missing references)
//IL_0131: Unknown result type (might be due to invalid IL or missing references)
//IL_0138: Unknown result type (might be due to invalid IL or missing references)
//IL_013f: 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_014d: 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_016c: Unknown result type (might be due to invalid IL or missing references)
//IL_0173: Unknown result type (might be due to invalid IL or missing references)
//IL_017a: Unknown result type (might be due to invalid IL or missing references)
//IL_0181: Unknown result type (might be due to invalid IL or missing references)
//IL_0188: Unknown result type (might be due to invalid IL or missing references)
//IL_018f: Unknown result type (might be due to invalid IL or missing references)
//IL_0196: Unknown result type (might be due to invalid IL or missing references)
Vector3 zero = Vector3.zero;
Vector3 one = Vector3.one;
Mesh val = Object.Instantiate<Mesh>(originalMesh);
List<Vector3> list = new List<Vector3>();
for (int i = 0; i < originalMesh.vertices.Count(); i++)
{
Vector3 val2 = originalMesh.vertices[i];
((Vector3)(ref zero))..ctor(Mathf.Max(zero.x, val2.x), Mathf.Max(zero.y, val2.y), Mathf.Max(zero.z, val2.z));
((Vector3)(ref one))..ctor(Mathf.Min(one.x, val2.x), Mathf.Min(one.y, val2.y), Mathf.Min(one.z, val2.z));
}
Vector3 val4 = default(Vector3);
for (int j = 0; j < originalMesh.vertices.Count(); j++)
{
Vector3 val3 = originalMesh.vertices[j];
float num = val3.x * (scaleBot.x + (scaleTop.x - scaleBot.x) * (val3.z - one.z) / (zero.z - one.z));
float num2 = val3.y * (scaleBot.y + (scaleTop.y - scaleBot.y) * (val3.z - one.z) / (zero.z - one.z));
((Vector3)(ref val4))..ctor(num, num2, val3.z);
list.Add(new Vector3(val4.x + offset.x, val4.y + offset.y, val4.z + offset.z));
}
val.SetVertices(list);
((Object)val).name = "scaled_" + ((Object)val).name;
return val;
}
public static void resolveMocksinChildren(Transform parentTrans)
{
//IL_0062: 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_007c: Unknown result type (might be due to invalid IL or missing references)
for (int num = parentTrans.childCount - 1; num >= 0; num--)
{
Transform child = parentTrans.GetChild(num);
if (((Object)child).name.StartsWith("ATmock_"))
{
GameObject val = getmockGo(((Object)child).name, parentTrans);
if (Object.op_Implicit((Object)(object)val))
{
Transform val2 = Shawesomes_Divine_Armaments.CopyIntoParent<Transform>(val.transform, parentTrans);
val2.localPosition = child.localPosition;
val2.localEulerAngles = child.localEulerAngles;
val2.localScale = child.localScale;
((Object)val2).name = ((Object)child).name.Split(new char[1] { '.' })[0];
child.parent = null;
}
}
}
}
public static GameObject getmockGo(string mockname, Transform newParent)
{
string[] array = mockname.Split(new char[1] { '.' });
if (!array[0].StartsWith("ATmock_"))
{
return null;
}
Transform transform;
try
{
transform = PrefabManager.Instance.GetPrefab(array[0].Replace("ATmock_", "")).transform;
}
catch
{
return null;
}
for (int i = 1; i < array.Length; i++)
{
try
{
transform = ((Component)transform.Find(array[i])).transform;
}
catch
{
}
}
return ((Component)transform).gameObject;
}
}
public class ActiveClothMesh : MonoBehaviour
{
public Mesh clothmesh = new Mesh();
public Cloth clothref;
public float roughness = 0.001f;
private float lastTime = 0f;
public List<ParticleSystem> partsys;
private void Start()
{
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_009e: 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_00ba: Unknown result type (might be due to invalid IL or missing references)
if (!Object.op_Implicit((Object)(object)clothref))
{
clothref = ((Component)((Component)this).transform.parent).GetComponentInChildren<Cloth>();
}
((Object)clothmesh).name = "ClothMesh";
clothmesh.vertices = clothref.vertices;
clothmesh.normals = clothref.normals;
partsys = ((Component)this).gameObject.GetComponentsInChildren<ParticleSystem>().ToList();
foreach (ParticleSystem partsy in partsys)
{
ShapeModule shape = partsy.shape;
if (!Object.op_Implicit((Object)(object)((ShapeModule)(ref shape)).skinnedMeshRenderer))
{
ShapeModule shape2 = partsy.shape;
((ShapeModule)(ref shape2)).skinnedMeshRenderer = ((Component)this).gameObject.GetComponent<SkinnedMeshRenderer>();
}
}
}
private void Update()
{
if (Time.time - lastTime > roughness)
{
if (Object.op_Implicit((Object)(object)clothref))
{
clothmesh.vertices = clothref.vertices;
clothmesh.normals = clothref.normals;
}
else
{
clothref = ((Component)((Component)this).transform.parent).GetComponentInChildren<Cloth>();
}
lastTime = Time.time;
}
}
}
namespace shawcape;
[BepInPlugin("IDshawesome4u3", "Shawesomes_Awesome_Wagons", "1.0.3")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Shawesomes_Divine_Armaments : BaseUnityPlugin
{
public Harmony harmony;
public static GameObject Root;
public string version = "1.0.0";
public static ManualLogSource logger;
public static ManualLogSource harmonyLog;
private static AssetBundle Shawcassets;
public static Sprite FreezingIcon;
[HarmonyPostfix]
[HarmonyPatch(typeof(ItemStyle), "Setup")]
private static void PostfixIDropStart(ItemStyle __instance, int style)
{
//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
//IL_00da: Unknown result type (might be due to invalid IL or missing references)
//IL_0133: Unknown result type (might be due to invalid IL or missing references)
//IL_0138: 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_0141: Unknown result type (might be due to invalid IL or missing references)
//IL_0172: 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_01a1: Unknown result type (might be due to invalid IL or missing references)
//IL_01a6: 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_0194: 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)
IEquipmentVisual[] componentsInChildren = ((Component)((Component)__instance).transform.parent).GetComponentsInChildren<IEquipmentVisual>();
for (int i = 0; i < componentsInChildren.Length; i++)
{
if (((object)componentsInChildren[i]).GetType() != typeof(ItemStyle))
{
continue;
}
IEquipmentVisual obj = componentsInChildren[i];
MonoBehaviour val = (MonoBehaviour)(object)((obj is MonoBehaviour) ? obj : null);
if (!Object.op_Implicit((Object)(object)val))
{
continue;
}
Material material = ((Component)val).GetComponent<Renderer>().material;
material.SetFloat("_Style", (float)style);
Color[] colorArray = material.GetColorArray("_StyleColors");
Color[] colorArray2 = material.GetColorArray("_StyleTints");
if (colorArray != null)
{
material.SetColor("_Color", colorArray[Math.Min(colorArray.Length - 1, style)]);
}
if (colorArray2 != null)
{
material.SetColor("_TintColor", colorArray2[Math.Min(colorArray2.Length - 1, style)]);
}
Color[] colorArray3 = material.GetColorArray("_StyleGradient0");
Color[] colorArray4 = material.GetColorArray("_StyleGradient1");
if (colorArray3 == null && colorArray4 == null)
{
continue;
}
ParticleSystem component = ((Component)val).GetComponent<ParticleSystem>();
if (Object.op_Implicit((Object)(object)component))
{
ColorOverLifetimeModule colorOverLifetime = component.colorOverLifetime;
MinMaxGradient color = ((ColorOverLifetimeModule)(ref colorOverLifetime)).color;
GradientColorKey[] array = (GradientColorKey[])((MinMaxGradient)(ref color)).gradient.colorKeys.Clone();
if (colorArray3 != null)
{
array[0].color = colorArray3[style];
}
if (colorArray4 != null)
{
array[1].color = colorArray4[style];
}
color = ((ColorOverLifetimeModule)(ref colorOverLifetime)).color;
Gradient gradient = ((MinMaxGradient)(ref color)).gradient;
gradient.colorKeys = array;
((ColorOverLifetimeModule)(ref colorOverLifetime)).color = new MinMaxGradient(gradient);
}
}
}
public void Awake()
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Expected O, but got Unknown
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Expected O, but got Unknown
logger = ((BaseUnityPlugin)this).Logger;
harmony = new Harmony("IDshawesome4u3");
Root = new GameObject("Shaw Root");
Object.DontDestroyOnLoad((Object)(object)Root);
harmony.PatchAll(typeof(Patches));
harmonyLog = ((BaseUnityPlugin)this).Logger;
((object)ItemManager.Instance).ToString();
Shawcassets = AssetUtils.LoadAssetBundleFromResources("shaw_aw", Assembly.GetExecutingAssembly());
PrefabManager.OnVanillaPrefabsAvailable += additems;
IEnumerable<MethodBase> patchedMethods = harmony.GetPatchedMethods();
foreach (MethodBase item in patchedMethods)
{
}
}
public static void additems()
{
AddshawesomeWagon();
Addhwagon();
Addshawhelcycle();
Addshawmc();
Addshawhalocart();
PrefabManager.OnVanillaPrefabsAvailable -= additems;
}
public static void Addshawhelcycle()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Expected O, but got Unknown
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Expected O, but got Unknown
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Expected O, but got Unknown
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: Expected O, but got Unknown
//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
//IL_00f7: Expected O, but got Unknown
PieceConfig val = new PieceConfig();
val.PieceTable = PieceTables.Hammer;
val.CraftingStation = CraftingStations.Workbench;
val.Category = PieceCategories.Misc;
val.AddRequirement(new RequirementConfig("SaddleAsksvin", 1, 0, false));
val.AddRequirement(new RequirementConfig("QueenDrop", 6, 0, false));
val.AddRequirement(new RequirementConfig("AsksvinCarrionRibcage", 1, 0, false));
val.AddRequirement(new RequirementConfig("AsksvinCarrionSkull", 1, 0, false));
GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeWagons/ShawHelCycle.prefab");
ShipDrive shipDrive = val2.AddComponent<ShipDrive>();
shipDrive.carForce = 100f;
shipDrive.boostForce = 5f;
shipDrive.turnForce = 20f;
shipDrive.wheeltorque = 100f;
shipDrive.projectileLoc[2] = new Vector3(0f, 1f, -3f);
logger.LogWarning((object)"post add cycle");
CustomPiece val3 = new CustomPiece(val2, true, val);
PieceManager.Instance.AddPiece(val3);
}
public static void Addshawmc()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Expected O, but got Unknown
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Expected O, but got Unknown
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Expected O, but got Unknown
//IL_0073: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Expected O, but got Unknown
//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
//IL_00ca: Expected O, but got Unknown
PieceConfig val = new PieceConfig();
val.PieceTable = PieceTables.Hammer;
val.CraftingStation = CraftingStations.Workbench;
val.Category = PieceCategories.Misc;
val.AddRequirement(new RequirementConfig("CelestialFeather", 4, 0, false));
val.AddRequirement(new RequirementConfig("ElderBark", 50, 0, false));
val.AddRequirement(new RequirementConfig("BlackMetal", 50, 0, false));
val.AddRequirement(new RequirementConfig("FlametalNew", 40, 0, false));
GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeWagons/ShawMasterCycle.prefab");
ShipDrive shipDrive = val2.AddComponent<ShipDrive>();
shipDrive.carForce = 100f;
shipDrive.boostForce = 5f;
shipDrive.turnForce = 20f;
shipDrive.wheeltorque = 100f;
CustomPiece val3 = new CustomPiece(val2, true, val);
PieceManager.Instance.AddPiece(val3);
}
public static void Addshawhalocart()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: Expected O, but got Unknown
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Expected O, but got Unknown
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Expected O, but got Unknown
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_0081: Expected O, but got Unknown
//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
//IL_00b8: Expected O, but got Unknown
PieceConfig val = new PieceConfig();
val.PieceTable = PieceTables.Hammer;
val.CraftingStation = CraftingStations.Workbench;
val.Category = PieceCategories.Misc;
val.AddRequirement(new RequirementConfig("Coins", 6000, 0, false));
val.AddRequirement(new RequirementConfig("ElderBark", 50, 0, false));
val.AddRequirement(new RequirementConfig("BlackMetal", 50, 0, false));
val.AddRequirement(new RequirementConfig("FlametalNew", 50, 0, false));
GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeGOW/shawhalocart.prefab");
ShipDrive shipDrive = val2.AddComponent<ShipDrive>();
shipDrive.carForce = 120f;
shipDrive.boostForce = 2.8f;
CustomPiece val3 = new CustomPiece(val2, true, val);
PieceManager.Instance.AddPiece(val3);
}
public static void Addhwagon()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: Expected O, but got Unknown
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: Expected O, but got Unknown
//IL_0065: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Expected O, but got Unknown
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0087: Expected O, but got Unknown
//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Expected O, but got Unknown
PieceConfig val = new PieceConfig();
val.PieceTable = PieceTables.Hammer;
val.CraftingStation = CraftingStations.Workbench;
val.Category = PieceCategories.Misc;
val.AddRequirement(new RequirementConfig("FineWood", 200, 0, false));
val.AddRequirement(new RequirementConfig("IronNails", 400, 0, false));
val.AddRequirement(new RequirementConfig("Silver", 100, 0, false));
val.AddRequirement(new RequirementConfig("Coins", 7000, 0, false));
GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeWagons/Shaw_H_Wagon.prefab");
ShipDrive shipDrive = val2.AddComponent<ShipDrive>();
shipDrive.carForce = 70f;
shipDrive.boostForce = 2f;
CustomPiece val3 = new CustomPiece(val2, true, val);
PieceManager.Instance.AddPiece(val3);
}
public static void AddshawesomeWagon()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: Expected O, but got Unknown
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: Expected O, but got Unknown
//IL_0065: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Expected O, but got Unknown
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0087: Expected O, but got Unknown
//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Expected O, but got Unknown
PieceConfig val = new PieceConfig();
val.PieceTable = PieceTables.Hammer;
val.CraftingStation = CraftingStations.Workbench;
val.Category = PieceCategories.Misc;
val.AddRequirement(new RequirementConfig("FineWood", 200, 0, false));
val.AddRequirement(new RequirementConfig("IronNails", 400, 0, false));
val.AddRequirement(new RequirementConfig("Silver", 100, 0, false));
val.AddRequirement(new RequirementConfig("Coins", 4000, 0, false));
GameObject val2 = Shawcassets.LoadAsset<GameObject>("Assets/ShawesomeWagons/ShawSGCart.prefab");
ShipDrive shipDrive = val2.AddComponent<ShipDrive>();
shipDrive.carForce = 70f;
shipDrive.boostForce = 1f;
CustomPiece val3 = new CustomPiece(val2, true, val);
PieceManager.Instance.AddPiece(val3);
}
public static T CopyIntoParent<T>(T go, T parent) where T : Component
{
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
T val = Object.Instantiate<T>(go);
((Object)(object)val).name = ((Object)(object)go).name;
((Component)val).transform.parent = ((Component)parent).transform;
((Component)val).transform.localPosition = new Vector3(0f, 0f, 0f);
return val;
}
}