Decompiled source of FireSpreads v3.0.2

plugins\FireSpreads.dll

Decompiled a day ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using Jotunn;
using Jotunn.Configs;
using Jotunn.Entities;
using Jotunn.Managers;
using Jotunn.Utils;
using UnityEngine;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("FireSpreads")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FireSpreads")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("e3243d22-4307-4008-ba36-9f326008cde5")]
[assembly: AssemblyFileVersion("0.0.1.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.1.0")]
namespace FireSpreads
{
	public static class CodeMatcherExtensions
	{
		public static CodeMatcher GetPosition(this CodeMatcher codeMatcher, out int position)
		{
			position = codeMatcher.Pos;
			return codeMatcher;
		}

		public static CodeMatcher AddLabel(this CodeMatcher codeMatcher, out Label label)
		{
			label = default(Label);
			codeMatcher.AddLabels((IEnumerable<Label>)new Label[1] { label });
			return codeMatcher;
		}

		public static CodeMatcher GetOperand(this CodeMatcher codeMatcher, out object operand)
		{
			operand = codeMatcher.Operand;
			return codeMatcher;
		}

		public static bool IsCall(this CodeInstruction i, string declaringType, string name)
		{
			if ((i.opcode == OpCodes.Callvirt || i.opcode == OpCodes.Call) && i.operand is MethodInfo methodInfo && methodInfo.DeclaringType?.Name == declaringType)
			{
				return methodInfo.Name == name;
			}
			return false;
		}

		public static bool CallReturns(this CodeInstruction i, Type returnType)
		{
			if ((i.opcode == OpCodes.Callvirt || i.opcode == OpCodes.Call) && i.operand is MethodInfo methodInfo)
			{
				return methodInfo.ReturnType == returnType;
			}
			return false;
		}

		public static CodeMatcher SaveInstruction(this CodeMatcher matcher, int offset, out CodeInstruction instruction)
		{
			instruction = matcher.InstructionAt(offset);
			return matcher;
		}

		public static CodeMatcher SaveInstructions(this CodeMatcher matcher, int offset, out List<CodeInstruction> instructions)
		{
			instructions = matcher.InstructionsInRange(0, offset - 1);
			return matcher;
		}
	}
	[HarmonyPatch(typeof(ClutterSystem), "Awake")]
	internal class ClutterSystem_Awake_Postfix
	{
		private static void Postfix(ref ClutterSystem __instance)
		{
			__instance.m_distance = FireSpreads.ClutterDistanceConfig.Value;
		}
	}
	[HarmonyPatch(typeof(Fire), "Awake")]
	internal class Fire_Awake_Postfix
	{
		private static void Postfix(ref Fire __instance)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			FireController.TintClutter(((Component)__instance).transform.position);
		}
	}
	[HarmonyPatch(typeof(Fire), "DoDamage")]
	internal class Fire_DoDamage_Prefix
	{
		private static bool Prefix(IDestructible toHit, Collider collider, ref Fire __instance)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: 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_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Invalid comparison between Unknown and I4
			//IL_003e: 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_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Expected O, but got Unknown
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: 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_00f6: 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_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)
			if (!FireSpreads.AdoptVanillaFireConfig.Value)
			{
				return true;
			}
			Vector3 position = ((Component)__instance).transform.position;
			Vector3 val = default(Vector3);
			Biome val2 = default(Biome);
			BiomeArea val3 = default(BiomeArea);
			Heightmap val4 = default(Heightmap);
			ZoneSystem.instance.GetGroundData(ref position, ref val, ref val2, ref val3, ref val4);
			Biome val5 = val2;
			if ((Object)(object)val4 != (Object)null)
			{
				val5 = val4.GetBiome(position, 0.02f, false);
			}
			if ((int)val5 == 32 && FireSpreads.KeepAshlandFireVanillaConfig.Value)
			{
				return true;
			}
			GameObject gameObject = ((Component)FireController.GetTopmostTransform(((Component)collider).transform)).gameObject;
			if (((Object)gameObject).name.StartsWith("Fire"))
			{
				return false;
			}
			if (!FireController.IsBurnable(gameObject))
			{
				return true;
			}
			HitData val6 = new HitData();
			val6.m_hitCollider = collider;
			val6.m_damage.m_fire = 10f;
			val6.m_toolTier = __instance.m_toolTier;
			val6.m_dodgeable = false;
			val6.m_blockable = false;
			val6.m_hitType = (HitType)20;
			EffectList hitEffect = __instance.m_hitEffect;
			Vector3 position2 = ((Component)__instance).transform.position;
			Bounds bounds = collider.bounds;
			hitEffect.Create((position2 + ((Bounds)(ref bounds)).center) * 0.5f, Quaternion.identity, (Transform)null, 1f, -1);
			toHit.Damage(val6);
			return false;
		}
	}
	public class Scaler_AshlandsBranch3 : ScalerTreeLogHalfBig
	{
		public Scaler_AshlandsBranch3(GameObject go)
			: base(go)
		{
		}

		public override void ApplyScale(Transform transform, Vector3 scale)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			float y = scale.y;
			scale.y = scale.z;
			scale.z = y;
			base.ApplyScale(transform, scale);
			transform.localEulerAngles = Vector3.zero;
		}
	}
	public class Scaler_AshlandsBranch1 : ScalerTreeLogHalfBig
	{
		public Scaler_AshlandsBranch1(GameObject go)
			: base(go)
		{
		}

		public override void ApplyScale(Transform transform, Vector3 scale)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			float y = scale.y;
			scale.y = scale.z;
			scale.z = y;
			base.ApplyScale(transform, scale);
			transform.localEulerAngles = Vector3.zero;
		}
	}
	public class Scaler_AshlandsTree6_big : ScalerTreeMeshEmit
	{
		public Scaler_AshlandsTree6_big(GameObject go)
			: base(go)
		{
		}

		public override void ApplyScale(Transform transform, Vector3 scale)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0035: 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_0048: 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_005b: 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_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_008a: Unknown result type (might be due to invalid IL or missing references)
			base.ApplyScale(transform, scale);
			EmissionModule emission = m_flamesPS.emission;
			((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(200f);
			MainModule main = m_flamesPS.main;
			MinMaxCurve val = ((MainModule)(ref main)).startSizeX;
			((MainModule)(ref main)).startSizeX = MinMaxCurve.op_Implicit(((MinMaxCurve)(ref val)).constant * 0.85f);
			val = ((MainModule)(ref main)).startSizeY;
			((MainModule)(ref main)).startSizeY = MinMaxCurve.op_Implicit(((MinMaxCurve)(ref val)).constant * 0.85f);
			val = ((MainModule)(ref main)).startSizeZ;
			((MainModule)(ref main)).startSizeZ = MinMaxCurve.op_Implicit(((MinMaxCurve)(ref val)).constant * 0.85f);
		}
	}
	public class Scaler_AshlandsTree6 : ScalerTreeMeshEmit
	{
		public Scaler_AshlandsTree6(GameObject go)
			: base(go)
		{
		}

		public override void ApplyScale(Transform transform, Vector3 scale)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0035: 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_0048: 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_005b: 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_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_008a: Unknown result type (might be due to invalid IL or missing references)
			base.ApplyScale(transform, scale);
			EmissionModule emission = m_flamesPS.emission;
			((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(150f);
			MainModule main = m_flamesPS.main;
			MinMaxCurve val = ((MainModule)(ref main)).startSizeX;
			((MainModule)(ref main)).startSizeX = MinMaxCurve.op_Implicit(((MinMaxCurve)(ref val)).constant * 0.85f);
			val = ((MainModule)(ref main)).startSizeY;
			((MainModule)(ref main)).startSizeY = MinMaxCurve.op_Implicit(((MinMaxCurve)(ref val)).constant * 0.85f);
			val = ((MainModule)(ref main)).startSizeZ;
			((MainModule)(ref main)).startSizeZ = MinMaxCurve.op_Implicit(((MinMaxCurve)(ref val)).constant * 0.85f);
		}
	}
	public class Scaler_piece_hexagonal_door : ScalerDestructible
	{
		public Scaler_piece_hexagonal_door(GameObject go)
			: base(go)
		{
		}

		public override void ApplyScale(Transform transform, Vector3 scale)
		{
			//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_002c: 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_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: 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)
			Vector3 localPosition = transform.localPosition;
			localPosition.x = -1f;
			localPosition.y = -1f;
			localPosition.z = 0f;
			transform.localPosition = localPosition;
			Vector3 localScale = transform.localScale;
			localScale.x = 3.5f;
			transform.localScale = localScale;
			MainModule main = m_flamesPS.main;
			((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(2f);
		}
	}
	public class Scaler_darkwood_gate : ScalerDestructible
	{
		public Scaler_darkwood_gate(GameObject go)
			: base(go)
		{
		}

		public override void ApplyScale(Transform transform, Vector3 scale)
		{
			//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_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: 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)
			Vector3 localScale = transform.localScale;
			localScale.x = 2f;
			transform.localScale = localScale;
			MainModule main = m_flamesPS.main;
			((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(3.5f);
		}
	}
	public class Scaler_ashwood_door : ScalerDestructible
	{
		public Scaler_ashwood_door(GameObject go)
			: base(go)
		{
		}

		public override void ApplyScale(Transform transform, Vector3 scale)
		{
			//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_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			Vector3 localScale = transform.localScale;
			localScale.x = 2f;
			transform.localScale = localScale;
			Vector3 localPosition = transform.localPosition;
			localPosition.x = -1f;
			transform.localPosition = localPosition;
			MainModule main = m_flamesPS.main;
			((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(2.5f);
		}
	}
	public class Scaler_Oak1 : ScalerTreeMeshEmit
	{
		public Scaler_Oak1(GameObject go)
			: base(go)
		{
		}

		public override void ApplyScale(Transform transform, Vector3 scale)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0038: Unknown result type (might be due to invalid IL or missing references)
			base.ApplyScale(transform, scale);
			MainModule main = m_flamesPS.main;
			((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(1f);
			EmissionModule emission = m_flamesPS.emission;
			((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(175f);
		}
	}
	public class Scaler_SwampTree1 : ScalerTreeMeshEmit
	{
		public Scaler_SwampTree1(GameObject go)
			: base(go)
		{
		}

		public override void ApplyScale(Transform transform, Vector3 scale)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			base.ApplyScale(transform, scale);
			EmissionModule emission = m_flamesPS.emission;
			((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(40f);
		}
	}
	public class Scaler_Pinetree_01 : ScalerTreeMeshEmit
	{
		public Scaler_Pinetree_01(GameObject go)
			: base(go)
		{
		}

		public override void ApplyScale(Transform transform, Vector3 scale)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			base.ApplyScale(transform, scale);
			MainModule main = m_flamesPS.main;
			((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(1f);
		}
	}
	public class Scaler_FirTree_oldLog : ScalerDestructible
	{
		public Scaler_FirTree_oldLog(GameObject go)
			: base(go)
		{
		}
	}
	public class Scaler_yggashoot_log : ScalerMeshEmit
	{
		public Scaler_yggashoot_log(GameObject go)
			: base(go)
		{
		}

		public override void ApplyScale(Transform transform, Vector3 scale)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			base.ApplyScale(transform, scale);
			ShapeModule shape = m_flamesPS.shape;
			((ShapeModule)(ref shape)).scale = new Vector3(0.5f, 0.5f, 0.5f);
		}
	}
	public class Scaler_AshlandsTreeLog1 : ScalerMeshEmit
	{
		public Scaler_AshlandsTreeLog1(GameObject go)
			: base(go)
		{
		}

		public override void ApplyScale(Transform transform, Vector3 scale)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			base.ApplyScale(transform, scale);
			ShapeModule shape = m_flamesPS.shape;
			((ShapeModule)(ref shape)).scale = new Vector3(0.5f, 0.5f, 0.5f);
		}
	}
	public class Scaler_hops_plant : ScalerDestructible
	{
		public Scaler_hops_plant(GameObject go)
			: base(go)
		{
		}

		public override void ApplyScale(Transform transform, Vector3 scale)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: 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_004e: 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_0077: Unknown result type (might be due to invalid IL or missing references)
			base.ApplyScale(transform, scale);
			MainModule main = m_flamesPS.main;
			((MainModule)(ref main)).startSizeX = MinMaxCurve.op_Implicit(0.35f);
			((MainModule)(ref main)).startSizeY = MinMaxCurve.op_Implicit(1f);
			((MainModule)(ref main)).startSizeZ = MinMaxCurve.op_Implicit(1f);
			((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(0.35f);
			((MainModule)(ref main)).simulationSpeed = 0.05f;
			EmissionModule emission = m_flamesPS.emission;
			((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(75f);
		}
	}
	public class Scaler_AshlandsTreeStump3 : Scaler_AshlandsTreeStump1
	{
		public Scaler_AshlandsTreeStump3(GameObject go)
			: base(go)
		{
		}

		public override void ApplyScale(Transform transform, Vector3 scale)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			base.ApplyScale(transform, scale);
			Vector3 localPosition = transform.localPosition;
			localPosition.x = 1.5f;
			transform.localPosition = localPosition;
			EmissionModule emission = m_flamesPS.emission;
			((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(70f);
		}
	}
	public class Scaler_AshlandsTreeStump2 : Scaler_AshlandsTreeStump1
	{
		public Scaler_AshlandsTreeStump2(GameObject go)
			: base(go)
		{
		}
	}
	public class Scaler_AshlandsTreeStump1 : ScalerDestructible
	{
		public Scaler_AshlandsTreeStump1(GameObject go)
			: base(go)
		{
		}

		public override void ApplyScale(Transform transform, Vector3 scale)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			scale.y = 2f;
			base.ApplyScale(transform, scale);
		}
	}
	public class Scaler_Oak_log : ScalerTreeLog
	{
		public Scaler_Oak_log(GameObject go)
			: base(go)
		{
		}
	}
	public class Scaler_Beech1 : ScalerTreeMeshEmit
	{
		public Scaler_Beech1(GameObject go)
			: base(go)
		{
		}

		public override void Init()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			base.Init();
			m_bounds_factor = new Vector3(0.65f, 1f, 0.65f);
		}

		public override void ApplyScale(Transform transform, Vector3 scale)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0038: 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_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: 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_006a: 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_0083: 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)
			base.ApplyScale(transform, scale);
			MainModule main = m_flamesPS.main;
			((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(1f);
			EmissionModule emission = m_flamesPS.emission;
			((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(300f);
			emission = m_smokePS.emission;
			((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(5f);
			main = m_smokePS.main;
			((MainModule)(ref main)).startSizeX = MinMaxCurve.op_Implicit(30f);
			((MainModule)(ref main)).startSizeY = MinMaxCurve.op_Implicit(30f);
			((MainModule)(ref main)).startSizeZ = MinMaxCurve.op_Implicit(30f);
		}
	}
	public class Scaler_FirTree_small_dead : ScalerDestructible
	{
		public Scaler_FirTree_small_dead(GameObject go)
			: base(go)
		{
		}

		public override void Init()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			base.Init();
			m_bounds_factor = new Vector3(0.5f, 1f, 0.5f);
		}

		public override void ApplyScale(Transform transform, Vector3 scale)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			base.ApplyScale(transform, scale);
			MainModule main = m_flamesPS.main;
			((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(0.2f);
		}
	}
	public class Scaler_FirTree_small : ScalerDestructible
	{
		public Scaler_FirTree_small(GameObject go)
			: base(go)
		{
		}

		public override void Init()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			base.Init();
			m_bounds_factor = new Vector3(1.5f, 1.8f, 1.5f);
		}

		public override void ApplyScale(Transform transform, Vector3 scale)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			base.ApplyScale(transform, scale);
			MainModule main = m_flamesPS.main;
			((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(0.3f);
		}
	}
	public class Scaler_ashwood_beam_2m : ScalerWNT
	{
		public Scaler_ashwood_beam_2m(GameObject go)
			: base(go)
		{
		}

		public override void ApplyScale(Transform transform, Vector3 scale)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			base.ApplyScale(transform, scale);
			Vector3 localPosition = transform.localPosition;
			localPosition.y -= 1f;
			transform.localPosition = localPosition;
		}
	}
	public class Scaler_bell_church : ScalerDestructible
	{
		public Scaler_bell_church(GameObject go)
			: base(go)
		{
		}

		public override void ApplyScale(Transform transform, Vector3 scale)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_015f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//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_0030: 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_0052: 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_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)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: 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)
			//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_00d6: 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_00e8: 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_018a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			Vector3 one = Vector3.one;
			Vector3 localPosition = transform.localPosition;
			ParticleSystem component = ((Component)transform).GetComponent<ParticleSystem>();
			if ((Object)(object)component != (Object)null)
			{
				MainModule main = component.main;
				one.x *= scale.x;
				one.z *= scale.y;
				one.y *= scale.z;
				one.y = 4f;
				one.x = 4f;
				one.z = 4f;
				MinMaxCurve val = ((MainModule)(ref main)).startSizeX;
				((MainModule)(ref main)).startSizeX = MinMaxCurve.op_Implicit(((MinMaxCurve)(ref val)).constant / scale.x);
				val = ((MainModule)(ref main)).startSizeY;
				((MainModule)(ref main)).startSizeY = MinMaxCurve.op_Implicit(((MinMaxCurve)(ref val)).constant / scale.z);
				val = ((MainModule)(ref main)).startSizeZ;
				((MainModule)(ref main)).startSizeZ = MinMaxCurve.op_Implicit(((MinMaxCurve)(ref val)).constant / scale.y);
				EmissionModule emission = component.emission;
				if (((Object)transform).name.Equals("flames (1)"))
				{
					((MainModule)(ref main)).simulationSpeed = ((MainModule)(ref main)).simulationSpeed * 0.1f;
					((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(40f);
				}
				if (((Object)transform).name.Equals("sparcs (1)"))
				{
					((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1;
					((MainModule)(ref main)).simulationSpeed = ((MainModule)(ref main)).simulationSpeed * 1.5f;
				}
			}
			else
			{
				one.x *= scale.x;
				one.y *= scale.y;
				one.z *= scale.z;
			}
			transform.localScale = one;
			transform.localPosition = localPosition;
		}
	}
	public class Scaler_bell : ScalerDestructible
	{
		public Scaler_bell(GameObject go)
			: base(go)
		{
		}

		public override void ApplyScale(Transform transform, Vector3 scale)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_016f: 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_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: 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)
			//IL_00a0: 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_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)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: 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_00e6: 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_00f8: 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_019a: 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_012c: Unknown result type (might be due to invalid IL or missing references)
			Vector3 one = Vector3.one;
			Vector3 localPosition = transform.localPosition;
			localPosition.y -= 4f;
			ParticleSystem component = ((Component)transform).GetComponent<ParticleSystem>();
			if ((Object)(object)component != (Object)null)
			{
				MainModule main = component.main;
				one.x *= scale.x;
				one.z *= scale.y;
				one.y *= scale.z;
				one.y = 2f;
				one.x = 2f;
				one.z = 2f;
				MinMaxCurve val = ((MainModule)(ref main)).startSizeX;
				((MainModule)(ref main)).startSizeX = MinMaxCurve.op_Implicit(((MinMaxCurve)(ref val)).constant / scale.x);
				val = ((MainModule)(ref main)).startSizeY;
				((MainModule)(ref main)).startSizeY = MinMaxCurve.op_Implicit(((MinMaxCurve)(ref val)).constant / scale.z);
				val = ((MainModule)(ref main)).startSizeZ;
				((MainModule)(ref main)).startSizeZ = MinMaxCurve.op_Implicit(((MinMaxCurve)(ref val)).constant / scale.y);
				EmissionModule emission = component.emission;
				if (((Object)transform).name.Equals("flames (1)"))
				{
					((MainModule)(ref main)).simulationSpeed = ((MainModule)(ref main)).simulationSpeed * 0.1f;
					((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(20f);
				}
				if (((Object)transform).name.Equals("sparcs (1)"))
				{
					((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1;
					((MainModule)(ref main)).simulationSpeed = ((MainModule)(ref main)).simulationSpeed * 1.5f;
				}
			}
			else
			{
				one.x *= scale.x;
				one.y *= scale.y;
				one.z *= scale.z;
			}
			transform.localScale = one;
			transform.localPosition = localPosition;
		}
	}
	public class Scaler_stubbe : ScalerDestructible
	{
		public Scaler_stubbe(GameObject go)
			: base(go)
		{
		}

		public override void ApplyScale(Transform transform, Vector3 scale)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: 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_0048: 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_005b: 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_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_008a: 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)
			base.ApplyScale(transform, scale);
			EmissionModule emission = m_flamesPS.emission;
			MainModule main = m_flamesPS.main;
			((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(0.2f);
			MinMaxCurve val = ((MainModule)(ref main)).startSizeX;
			((MainModule)(ref main)).startSizeX = MinMaxCurve.op_Implicit(((MinMaxCurve)(ref val)).constant * 1.1f);
			val = ((MainModule)(ref main)).startSizeY;
			((MainModule)(ref main)).startSizeY = MinMaxCurve.op_Implicit(((MinMaxCurve)(ref val)).constant * 1.1f);
			val = ((MainModule)(ref main)).startSizeZ;
			((MainModule)(ref main)).startSizeZ = MinMaxCurve.op_Implicit(((MinMaxCurve)(ref val)).constant * 1.1f);
			((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(70f);
		}
	}
	public class ScalerStub : ScalerDestructible
	{
		public ScalerStub(GameObject go)
			: base(go)
		{
		}

		public override void ApplyScale(Transform transform, Vector3 scale)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: 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_005a: 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_0080: 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)
			base.ApplyScale(transform, scale);
			EmissionModule emission = m_flamesPS.emission;
			MainModule main = m_flamesPS.main;
			((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(10f);
			MinMaxCurve rateOverTime;
			if (((Object)transform).name.Equals("sparcs (1)"))
			{
				rateOverTime = ((EmissionModule)(ref emission)).rateOverTime;
				((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(((MinMaxCurve)(ref rateOverTime)).constant / 2f);
			}
			else if (((Object)transform).name.Equals("smoke (1)"))
			{
				rateOverTime = ((EmissionModule)(ref emission)).rateOverTime;
				((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(((MinMaxCurve)(ref rateOverTime)).constant / 10f);
			}
			else if (((Object)transform).name.Equals("flames (1)"))
			{
				((MainModule)(ref main)).simulationSpeed = ((MainModule)(ref main)).simulationSpeed * 3f;
			}
		}
	}
	public class ScalerDestructible : Scaler
	{
		public ScalerDestructible(GameObject go)
			: base(go)
		{
		}

		public override void ApplyScale(Transform transform, Vector3 scale)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//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_0030: 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_0052: 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_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: 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_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//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)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: 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)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: 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)
			Vector3 one = Vector3.one;
			Vector3 localPosition = transform.localPosition;
			ParticleSystem component = ((Component)transform).GetComponent<ParticleSystem>();
			if ((Object)(object)component != (Object)null)
			{
				MainModule main = component.main;
				one.x *= scale.x;
				one.z *= scale.y;
				one.y *= scale.z;
				MinMaxCurve val = ((MainModule)(ref main)).startSizeX;
				((MainModule)(ref main)).startSizeX = MinMaxCurve.op_Implicit(2f * (((MinMaxCurve)(ref val)).constant / scale.x));
				val = ((MainModule)(ref main)).startSizeY;
				((MainModule)(ref main)).startSizeY = MinMaxCurve.op_Implicit(2f * (((MinMaxCurve)(ref val)).constant / scale.z));
				val = ((MainModule)(ref main)).startSizeZ;
				((MainModule)(ref main)).startSizeZ = MinMaxCurve.op_Implicit(2f * (((MinMaxCurve)(ref val)).constant / scale.y));
				EmissionModule emission = component.emission;
				if (((Object)transform).name.Equals("flames (1)"))
				{
					((MainModule)(ref main)).simulationSpeed = ((MainModule)(ref main)).simulationSpeed * 0.1f;
					((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(50f);
				}
				if (((Object)transform).name.Equals("sparcs (1)"))
				{
					((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1;
					((MainModule)(ref main)).simulationSpeed = ((MainModule)(ref main)).simulationSpeed * 1.5f;
				}
			}
			else
			{
				one.x *= scale.x;
				one.y *= scale.y;
				one.z *= scale.z;
			}
			transform.localScale = one;
			transform.localPosition = localPosition;
		}
	}
	public class ScalerMeshEmit : Scaler
	{
		public ScalerMeshEmit(GameObject go)
			: base(go)
		{
		}

		public override void ApplyScale(Transform transform, Vector3 scale)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_027c: Unknown result type (might be due to invalid IL or missing references)
			//IL_028d: Unknown result type (might be due to invalid IL or missing references)
			//IL_029e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: 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_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_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_0092: 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)
			//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: Unknown result type (might be due to invalid IL or missing references)
			//IL_0220: Unknown result type (might be due to invalid IL or missing references)
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_025e: 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_018e: 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_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_026a: Unknown result type (might be due to invalid IL or missing references)
			Vector3 one = Vector3.one;
			Vector3 localPosition = transform.localPosition;
			ParticleSystem component = ((Component)transform).GetComponent<ParticleSystem>();
			float num = scale.x * scale.y * scale.z;
			if ((Object)(object)component != (Object)null)
			{
				MainModule main = component.main;
				EmissionModule emission = component.emission;
				ShapeModule shape = component.shape;
				((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)6;
				((ShapeModule)(ref shape)).mesh = m_go.GetComponentInChildren<MeshFilter>().sharedMesh;
				localPosition = ((Component)m_go.GetComponentInChildren<MeshFilter>()).transform.localPosition;
				Vector3 localEulerAngles = ((Component)m_go.GetComponentInChildren<MeshFilter>()).transform.localEulerAngles;
				if (((Object)transform).name.Equals("flames (1)"))
				{
					((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(100f);
					ShapeModule shape2 = component.shape;
					((ShapeModule)(ref shape2)).sphericalDirectionAmount = 1f;
					float y = localEulerAngles.y;
					localEulerAngles.y = localEulerAngles.z;
					localEulerAngles.z = y;
					localEulerAngles.x = 0f;
				}
				else if (((Object)transform).name.Equals("smoke (1)"))
				{
					((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(Mathf.Lerp(5f, 15f, num / 10000f));
				}
				if (!((Object)transform).name.Equals("sparcs (1)"))
				{
					float num2 = Mathf.Lerp(1f, 5f, num / 10000f);
					float num3 = Mathf.Lerp(5f, 15f, num / 10000f);
					((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(2f);
					((MainModule)(ref main)).startSizeX = new MinMaxCurve(num2, num3);
					((MainModule)(ref main)).startSizeY = new MinMaxCurve(num2, num3);
					((MainModule)(ref main)).startSizeZ = new MinMaxCurve(num2, num3);
					((MainModule)(ref main)).simulationSpeed = Mathf.Lerp(0.25f, 0.75f, num / 10000f);
				}
				else
				{
					float num4 = Mathf.Lerp(0.25f, 1f, num / 10000f);
					float num5 = Mathf.Lerp(0.25f, 1f, num / 10000f);
					((MainModule)(ref main)).startSizeX = new MinMaxCurve(num4, num5);
					((MainModule)(ref main)).startSizeY = new MinMaxCurve(num4, num5);
					((MainModule)(ref main)).startSizeZ = new MinMaxCurve(num4, num5);
					((MainModule)(ref main)).simulationSpeed = 1f;
					((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(Mathf.Lerp(10f, 350f, num / 10000f));
				}
				((ShapeModule)(ref shape)).rotation = localEulerAngles;
			}
			else
			{
				one.x *= scale.x;
				one.z *= scale.z;
				one.y *= scale.y;
			}
			transform.localScale = one;
			transform.localPosition = localPosition;
		}
	}
	public class ScalerTreeLogBig : ScalerTreeLog
	{
		public ScalerTreeLogBig(GameObject go)
			: base(go)
		{
		}

		public override void ApplyScale(Transform transform, Vector3 scale)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//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_0045: 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_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			base.ApplyScale(transform, scale);
			EmissionModule emission = m_flamesPS.emission;
			RotationOverLifetimeModule rotationOverLifetime = m_flamesPS.rotationOverLifetime;
			MainModule main = m_flamesPS.main;
			if (((Object)transform).name.Equals("flames (1)"))
			{
				((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(200f);
				((RotationOverLifetimeModule)(ref rotationOverLifetime)).enabled = true;
				((RotationOverLifetimeModule)(ref rotationOverLifetime)).x = MinMaxCurve.op_Implicit(10f);
				((RotationOverLifetimeModule)(ref rotationOverLifetime)).y = MinMaxCurve.op_Implicit(10f);
				((RotationOverLifetimeModule)(ref rotationOverLifetime)).z = MinMaxCurve.op_Implicit(10f);
				((MainModule)(ref main)).startSizeX = MinMaxCurve.op_Implicit(0.7f);
			}
		}
	}
	public class ScalerTreeLogHalfBig : ScalerTreeLogHalf
	{
		public ScalerTreeLogHalfBig(GameObject go)
			: base(go)
		{
		}

		public override void ApplyScale(Transform transform, Vector3 scale)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: 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_0031: 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_0052: 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)
			base.ApplyScale(transform, scale);
			if (((Object)transform).name.Equals("flames (1)"))
			{
				MainModule main = m_flamesPS.main;
				EmissionModule emission = m_flamesPS.emission;
				((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1;
				((MainModule)(ref main)).startSizeX = MinMaxCurve.op_Implicit(1f);
				((MainModule)(ref main)).startSizeY = MinMaxCurve.op_Implicit(2f);
				((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(200f);
			}
		}
	}
	public class ScalerTreeMeshEmit : Scaler
	{
		public ScalerTreeMeshEmit(GameObject go)
			: base(go)
		{
		}

		public override void Init()
		{
			base.Init();
		}

		public override void CalculateBounds()
		{
			base.CalculateBounds();
		}

		public override void ScalePrefab()
		{
			//IL_0012: 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_003a: Unknown result type (might be due to invalid IL or missing references)
			base.ScalePrefab();
			m_burn.localScale = Vector3.Scale(m_burn.localScale, new Vector3(FireSpreads.TreeBurnRadiusFactorConfig.Value, FireSpreads.TreeBurnRadiusFactorConfig.Value, FireSpreads.TreeBurnRadiusFactorConfig.Value));
			((Component)m_smokeSpawner).GetComponent<SmokeSpawner>().m_smokePrefab = FireSpreads.m_smokeballTree;
		}

		public override void ApplyScale(Transform transform, Vector3 scale)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: 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_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_02db: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: 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_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_021f: Unknown result type (might be due to invalid IL or missing references)
			//IL_022f: Unknown result type (might be due to invalid IL or missing references)
			//IL_025d: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_029b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0289: Unknown result type (might be due to invalid IL or missing references)
			//IL_028e: Unknown result type (might be due to invalid IL or missing references)
			Vector3 one = Vector3.one;
			Vector3 localPosition = transform.localPosition;
			ParticleSystem component = ((Component)transform).GetComponent<ParticleSystem>();
			float num = scale.x * scale.y * scale.z;
			if ((Object)(object)component != (Object)null)
			{
				MainModule main = component.main;
				EmissionModule emission = component.emission;
				ShapeModule shape = component.shape;
				((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)6;
				TreeBase component2 = m_go.GetComponent<TreeBase>();
				if ((Object)(object)component2 != (Object)null && (Object)(object)component2.m_trunk != (Object)null && Object.op_Implicit((Object)(object)component2.m_trunk.GetComponentInChildren<MeshFilter>()))
				{
					((ShapeModule)(ref shape)).mesh = component2.m_trunk.GetComponentInChildren<MeshFilter>().sharedMesh;
					((ShapeModule)(ref shape)).scale = component2.m_trunk.transform.localScale;
					if (((Object)transform).name.Equals("flames (1)"))
					{
						((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(Mathf.Lerp(100f, 500f, num / 10000f));
					}
					else if (((Object)transform).name.Equals("smoke (1)"))
					{
						((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(Mathf.Lerp(50f, 200f, num / 10000f));
					}
					if (!((Object)transform).name.Equals("sparcs (1)"))
					{
						float num2 = Mathf.Lerp(1f, 3f, num / 10000f);
						float num3 = Mathf.Lerp(3f, 10f, num / 10000f);
						((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(0.8f);
						((MainModule)(ref main)).startSizeX = new MinMaxCurve(num2, num3);
						((MainModule)(ref main)).startSizeY = new MinMaxCurve(num2, num3);
						((MainModule)(ref main)).startSizeZ = new MinMaxCurve(num2, num3);
						((MainModule)(ref main)).simulationSpeed = Mathf.Lerp(0.3f, 0.5f, num / 10000f);
					}
					else
					{
						float num4 = Mathf.Lerp(0.25f, 1f, num / 10000f);
						float num5 = Mathf.Lerp(0.25f, 1f, num / 10000f);
						((MainModule)(ref main)).startSizeX = new MinMaxCurve(num4, num5);
						((MainModule)(ref main)).startSizeY = new MinMaxCurve(num4, num5);
						((MainModule)(ref main)).startSizeZ = new MinMaxCurve(num4, num5);
						((MainModule)(ref main)).simulationSpeed = 2.5f;
						((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(Mathf.Lerp(20f, 100f, num / 10000f));
					}
					if (((Object)transform).name.Equals("sparcs (1)"))
					{
						transform.localRotation = Quaternion.Euler(new Vector3(90f, 0f, 0f));
					}
					else
					{
						transform.localRotation = Quaternion.identity;
					}
				}
			}
			else
			{
				one.x *= scale.x;
				one.z *= scale.z;
				one.y *= scale.y;
			}
			transform.localScale = one;
			transform.localPosition = localPosition;
		}
	}
	public class ScalerTreeLogHalf : Scaler
	{
		public ScalerTreeLogHalf(GameObject go)
			: base(go)
		{
		}

		public override void ApplyScale(Transform transform, Vector3 scale)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0045: 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_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: 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_0239: Unknown result type (might be due to invalid IL or missing references)
			//IL_0240: 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_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: 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_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: 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_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: 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_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0214: Unknown result type (might be due to invalid IL or missing references)
			//IL_021a: Unknown result type (might be due to invalid IL or missing references)
			//IL_021f: Unknown result type (might be due to invalid IL or missing references)
			//IL_022e: Unknown result type (might be due to invalid IL or missing references)
			Vector3 one = Vector3.one;
			Vector3 localPosition = transform.localPosition;
			ParticleSystem component = ((Component)transform).GetComponent<ParticleSystem>();
			Quaternion rotation = m_go.transform.rotation;
			float x = ((Quaternion)(ref rotation)).eulerAngles.x;
			rotation = m_go.transform.rotation;
			float y = ((Quaternion)(ref rotation)).eulerAngles.y;
			rotation = m_go.transform.rotation;
			transform.localRotation = Quaternion.Euler(x, y, ((Quaternion)(ref rotation)).eulerAngles.z + 90f);
			if ((Object)(object)component != (Object)null)
			{
				ShapeModule shape = component.shape;
				MainModule main = component.main;
				((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1;
				((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)8;
				float num = Mathf.Max(new float[3] { scale.x, scale.y, scale.z });
				float num2 = Mathf.Min(new float[3] { scale.x, scale.y, scale.z });
				one.x *= num;
				one.y *= num2;
				one.z *= num2;
				localPosition.z = (0f - num2) / 2f;
				MinMaxCurve val;
				if (((Object)transform).name.Equals("flames (1)"))
				{
					((MainModule)(ref main)).simulationSpeed = ((MainModule)(ref main)).simulationSpeed * 0.5f;
					EmissionModule emission = component.emission;
					((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(100f);
					val = ((MainModule)(ref main)).startSizeX;
					((MainModule)(ref main)).startSizeX = MinMaxCurve.op_Implicit(((MinMaxCurve)(ref val)).constant / num * 2f);
					val = ((MainModule)(ref main)).startSizeY;
					((MainModule)(ref main)).startSizeY = MinMaxCurve.op_Implicit(((MinMaxCurve)(ref val)).constant / num2 * 2f);
					val = ((MainModule)(ref main)).startSizeZ;
					((MainModule)(ref main)).startSizeZ = MinMaxCurve.op_Implicit(((MinMaxCurve)(ref val)).constant / num2 * 2f);
				}
				if (((Object)transform).name.Equals("sparcs (1)"))
				{
					((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1;
					((MainModule)(ref main)).simulationSpeed = ((MainModule)(ref main)).simulationSpeed * 2f;
					EmissionModule emission2 = component.emission;
					val = ((EmissionModule)(ref emission2)).rateOverTime;
					((EmissionModule)(ref emission2)).rateOverTime = MinMaxCurve.op_Implicit(((MinMaxCurve)(ref val)).constant * 0.5f);
				}
			}
			transform.localScale = one;
			transform.localPosition = localPosition;
		}
	}
	public class ScalerWNT : Scaler
	{
		public ScalerWNT(GameObject go)
			: base(go)
		{
		}

		public override Vector3 GetRefScale()
		{
			//IL_000d: 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_0037: 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_005f: 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_00c1: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = default(Vector3);
			((Vector3)(ref val))..ctor(((Bounds)(ref m_bounds.m_bounds)).size.x, ((Bounds)(ref m_bounds.m_bounds)).size.y, ((Bounds)(ref m_bounds.m_bounds)).size.z);
			if (val.x < 1f)
			{
				val.x = 1f;
			}
			if (val.y < 1f)
			{
				val.y = 1f;
			}
			if (val.z < 1f)
			{
				val.z = 1f;
			}
			val.x *= 1.2f;
			val.y *= 1.2f;
			val.z *= 1.2f;
			return val;
		}

		public override void ApplyScale(Transform transform, Vector3 scale)
		{
			//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_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: 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)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: 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_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: 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_007c: 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_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: 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_00e6: 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_010f: 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_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: 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_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			Vector3 localScale = transform.localScale;
			ParticleSystem component = ((Component)transform).GetComponent<ParticleSystem>();
			if ((Object)(object)component != (Object)null)
			{
				ShapeModule shape = component.shape;
				if (scale.y > 6f)
				{
					MainModule main = component.main;
					((MainModule)(ref main)).simulationSpeed = ((MainModule)(ref main)).simulationSpeed * (localScale.y / scale.y);
					localScale.x *= scale.x;
					localScale.z *= scale.z;
					localScale.y *= scale.y;
				}
				else if ((double)scale.x >= 1.5 || (double)scale.z >= 1.5)
				{
					if ((Object)(object)component != (Object)null)
					{
						Vector3 scale2 = ((ShapeModule)(ref shape)).scale;
						scale2.x *= scale.x;
						scale2.y *= scale.z;
						((ShapeModule)(ref shape)).scale = scale2;
					}
				}
				else if (scale.y >= 2f && (Object)(object)component != (Object)null)
				{
					MainModule main2 = component.main;
					MinMaxCurve startLifetime = ((MainModule)(ref main2)).startLifetime;
					((MinMaxCurve)(ref startLifetime)).constantMax = ((MinMaxCurve)(ref startLifetime)).constantMax * scale.y;
					((MainModule)(ref main2)).startLifetime = startLifetime;
					Vector3 scale3 = ((ShapeModule)(ref shape)).scale;
					scale3.z *= scale.y;
					((ShapeModule)(ref shape)).scale = scale3;
				}
			}
			else
			{
				localScale.x *= scale.x;
				localScale.z *= scale.z;
				localScale.y *= scale.y;
			}
			transform.localScale = localScale;
		}
	}
	public class ScalerTreeLog : Scaler
	{
		public ScalerTreeLog(GameObject go)
			: base(go)
		{
		}

		public override void ScalePrefab()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: 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)
			base.ScalePrefab();
			Vector3 one = Vector3.one;
			((Component)m_fire).transform.localScale = one;
		}

		public override void ApplyScale(Transform transform, Vector3 scale)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0174: 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_0196: Unknown result type (might be due to invalid IL or missing references)
			//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_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: 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_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: 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_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: 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_015f: Unknown result type (might be due to invalid IL or missing references)
			Vector3 one = Vector3.one;
			Vector3 localPosition = transform.localPosition;
			ParticleSystem component = ((Component)transform).GetComponent<ParticleSystem>();
			if ((Object)(object)component != (Object)null)
			{
				ShapeModule shape = component.shape;
				MainModule main = component.main;
				_ = component.rotationOverLifetime;
				EmissionModule emission = component.emission;
				((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)8;
				float num = Mathf.Max(new float[3] { scale.x, scale.y, scale.z });
				float num2 = Mathf.Min(new float[3] { scale.x, scale.y, scale.z });
				one.x *= num2;
				one.y *= num2;
				one.z *= 2f * num / 3f;
				localPosition.y = (0f - num) / 2f;
				((MainModule)(ref main)).simulationSpeed = ((MainModule)(ref main)).simulationSpeed * 0.1f;
				if (((Object)transform).name.Equals("sparcs (1)"))
				{
					((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1;
					((MainModule)(ref main)).simulationSpeed = ((MainModule)(ref main)).simulationSpeed * 20f;
				}
				if (((Object)transform).name.Equals("flames (1)"))
				{
					((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(100f);
					MinMaxCurve startSizeX = ((MainModule)(ref main)).startSizeX;
					((MainModule)(ref main)).startSizeX = MinMaxCurve.op_Implicit(Mathf.Clamp(((MinMaxCurve)(ref startSizeX)).constant, 0.1f, 1.5f));
				}
			}
			else
			{
				one.x *= scale.x;
				one.z *= scale.z;
				one.y *= scale.y;
			}
			transform.localScale = one;
			transform.localPosition = localPosition;
			transform.localScale = one;
			transform.localPosition = localPosition;
		}
	}
	public abstract class Scaler
	{
		protected GameObject m_go;

		protected Transform m_fire;

		protected PrefabBounds m_bounds;

		protected Transform m_particles;

		protected Transform m_flames;

		protected Transform m_sparcs;

		protected Transform m_smokeSpawner;

		protected Transform m_warmth;

		protected Transform m_burn;

		protected Transform m_smoke;

		protected ParticleSystem m_flamesPS;

		protected ParticleSystem m_smokePS;

		protected Vector3 m_bounds_factor = new Vector3(1f, 1f, 1f);

		public Scaler(GameObject go)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			m_go = go;
			Init();
			CalculateBounds();
		}

		public virtual void Init()
		{
		}

		public void SetFireChild(GameObject go)
		{
			//IL_001c: 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)
			go.transform.parent = m_go.transform;
			go.transform.localPosition = Vector3.zero;
			go.transform.localRotation = Quaternion.identity;
			m_fire = go.transform;
			m_particles = ((Component)m_fire).transform.Find("Particles");
			m_flames = ((Component)m_particles).transform.Find("flames (1)");
			m_flamesPS = ((Component)m_flames).GetComponent<ParticleSystem>();
			m_sparcs = ((Component)m_particles).transform.Find("sparcs (1)");
			m_smokeSpawner = ((Component)m_fire).transform.Find("SmokeSpawner");
			m_warmth = ((Component)m_fire).transform.Find("FireWarmth");
			m_burn = ((Component)m_fire).transform.Find("FireBurn");
			m_smoke = ((Component)m_particles).transform.Find("smoke (1)");
			m_smokePS = ((Component)m_smoke).GetComponent<ParticleSystem>();
		}

		public abstract void ApplyScale(Transform transform, Vector3 scale);

		public virtual void ApplyScaleRuntime(Transform transform, Vector3 scale)
		{
			//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_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_0029: 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_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: 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_0064: 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_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: 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_008d: 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_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: 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)
			ParticleSystem component = ((Component)transform).GetComponent<ParticleSystem>();
			Vector3 one = Vector3.one;
			if ((Object)(object)component != (Object)null)
			{
				MainModule main = component.main;
				one.x *= scale.x;
				one.y *= scale.y;
				one.z *= scale.z;
				MinMaxCurve val = ((MainModule)(ref main)).startSizeX;
				((MainModule)(ref main)).startSizeX = MinMaxCurve.op_Implicit(((MinMaxCurve)(ref val)).constant / scale.x);
				val = ((MainModule)(ref main)).startSizeY;
				((MainModule)(ref main)).startSizeY = MinMaxCurve.op_Implicit(((MinMaxCurve)(ref val)).constant / scale.y);
				val = ((MainModule)(ref main)).startSizeZ;
				((MainModule)(ref main)).startSizeZ = MinMaxCurve.op_Implicit(((MinMaxCurve)(ref val)).constant / scale.z);
			}
		}

		public virtual Vector3 GetRefScale()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: 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_003f: Unknown result type (might be due to invalid IL or missing references)
			return new Vector3(((Bounds)(ref m_bounds.m_bounds)).size.x, ((Bounds)(ref m_bounds.m_bounds)).size.y, ((Bounds)(ref m_bounds.m_bounds)).size.z);
		}

		public static Texture2D ScaleTexture(Texture texture, int width, int height)
		{
			//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_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Expected O, but got Unknown
			RenderTexture val = (RenderTexture.active = RenderTexture.GetTemporary(texture.width, texture.height));
			Graphics.Blit(texture, val);
			Texture2D val2 = new Texture2D(texture.width, texture.height);
			val2.ReadPixels(new Rect(0f, 0f, (float)texture.width, (float)texture.height), 0, 0);
			val2.Apply();
			Texture2D result = ScaleTextureInt(val2, width, height);
			RenderTexture.ReleaseTemporary(val);
			return result;
		}

		private static Texture2D ScaleTextureInt(Texture2D source, int targetWidth, int targetHeight)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Expected O, but got Unknown
			//IL_0047: 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)
			Texture2D val = new Texture2D(targetWidth, targetHeight, source.format, true);
			Color[] pixels = val.GetPixels(0);
			float num = 1f / (float)targetWidth;
			float num2 = 1f / (float)targetHeight;
			for (int i = 0; i < pixels.Length; i++)
			{
				pixels[i] = source.GetPixelBilinear(num * ((float)i % (float)targetWidth), num2 * Mathf.Floor((float)(i / targetWidth)));
			}
			val.SetPixels(pixels, 0);
			val.Apply();
			return val;
		}

		public static Scaler GetScaler(GameObject go)
		{
			Type type = Type.GetType("FireSpreads.Scaler_" + Utils.GetPrefabName(go));
			if (type != null)
			{
				ConstructorInfo constructor = type.GetConstructor(new Type[1] { typeof(GameObject) });
				if (constructor != null)
				{
					return (Scaler)constructor.Invoke(new object[1] { go });
				}
				MonoBehaviour.print((object)("Class does not have the required constructor: " + type));
			}
			if ((Object)(object)go.GetComponent<TreeLog>() != (Object)null)
			{
				if ((Object)(object)go.GetComponent<TreeLog>().m_subLogPrefab != (Object)null)
				{
					return new ScalerMeshEmit(go);
				}
				if (((Object)go).name.StartsWith("beech") || ((Object)go).name.StartsWith("yggashoot"))
				{
					return new ScalerTreeLogHalfBig(go);
				}
				return new ScalerTreeLogHalf(go);
			}
			if ((Object)(object)go.GetComponent<TreeBase>() != (Object)null)
			{
				return new ScalerTreeMeshEmit(go);
			}
			if ((Object)(object)go.GetComponent<WearNTear>() != (Object)null)
			{
				return new ScalerWNT(go);
			}
			if (((Object)go).name.ToUpper().Contains("LOG"))
			{
				return new ScalerTreeLog(go);
			}
			if (Utils.GetPrefabName(go).EndsWith("Stub"))
			{
				return new ScalerStub(go);
			}
			return new ScalerDestructible(go);
		}

		public virtual void ScalePrefab()
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: 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_0058: 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_0069: 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_0098: 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)
			Vector3 refScale = GetRefScale();
			m_bounds.m_firescale = refScale;
			float num = Mathf.Min(refScale.x, Mathf.Min(refScale.x, refScale.z));
			Vector3 scale = default(Vector3);
			((Vector3)(ref scale))..ctor(num, num, num);
			ApplyScale(m_flames, refScale);
			m_bounds.m_firescale = ((Component)m_flames).transform.localScale;
			ApplyScale(m_smokeSpawner, refScale);
			((Component)m_burn).GetComponent<Aoe>().m_damageSelf = 0f;
			ApplyScale(m_burn, scale);
			ApplyScale(m_smoke, refScale);
			ApplyScale(m_sparcs, refScale);
		}

		public virtual void CalculateBounds()
		{
			//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_0023: 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)
			//IL_003e: 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_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: 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_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: 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)
			Bounds bounds = FireSpreads.CalculateCombinedBounds(m_go.transform);
			m_bounds = new PrefabBounds();
			m_bounds.m_bounds = bounds;
			m_bounds.m_rotation = m_go.transform.rotation;
			m_bounds.m_offset = m_go.transform.position - ((Bounds)(ref bounds)).center;
			if (FireController.ContainsFireSource(m_go))
			{
				m_bounds.m_firesource = FireSpreads.CalculateFireSourcePrefabBounds(m_go);
			}
			((Bounds)(ref m_bounds.m_bounds)).extents = Vector3.Scale(((Bounds)(ref m_bounds.m_bounds)).extents, m_bounds_factor);
		}

		public PrefabBounds GetBounds()
		{
			return m_bounds;
		}
	}
	public class Debug
	{
		public static void DrawWireframeCube(GameObject go, Bounds cubeBounds, Quaternion rotation, string name)
		{
			//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_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_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Expected O, but got Unknown
			//IL_0044: 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_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: 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_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//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_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: 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_00cf: 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_00de: 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_00f1: 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_0100: 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_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: 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_0159: 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_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: 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_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0191: 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_01a2: 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_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("DebugLineRenderer" + name);
			val.transform.parent = go.transform;
			Color blue = Color.blue;
			LineRenderer val2 = val.AddComponent<LineRenderer>();
			((Renderer)val2).material = new Material(Shader.Find("Sprites/Default"));
			Color startColor = (val2.endColor = blue);
			val2.startColor = startColor;
			float startWidth = (val2.endWidth = 0.05f);
			val2.startWidth = startWidth;
			Vector3[] array = (Vector3[])(object)new Vector3[8];
			Vector3 center = ((Bounds)(ref cubeBounds)).center;
			Vector3 extents = ((Bounds)(ref cubeBounds)).extents;
			array[0] = new Vector3(extents.x, extents.y, extents.z);
			array[1] = new Vector3(0f - extents.x, extents.y, extents.z);
			array[2] = new Vector3(0f - extents.x, 0f - extents.y, extents.z);
			array[3] = new Vector3(extents.x, 0f - extents.y, extents.z);
			array[4] = new Vector3(extents.x, extents.y, 0f - extents.z);
			array[5] = new Vector3(0f - extents.x, extents.y, 0f - extents.z);
			array[6] = new Vector3(0f - extents.x, 0f - extents.y, 0f - extents.z);
			array[7] = new Vector3(extents.x, 0f - extents.y, 0f - extents.z);
			for (int i = 0; i < array.Length; i++)
			{
				array[i] = rotation * array[i] + center;
			}
			val2.positionCount = array.Length;
			val2.SetPositions(array);
			val2.loop = true;
		}

		public static void SaveSpriteAsImage(Sprite sprite, string filePath)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Expected O, but got Unknown
			Texture2D texture = sprite.texture;
			Texture2D val = new Texture2D(((Texture)texture).width, ((Texture)texture).height);
			val.SetPixels(texture.GetPixels());
			val.Apply();
			byte[] bytes = ImageConversion.EncodeToPNG(val);
			File.WriteAllBytes(filePath, bytes);
		}
	}
	public class FireController : MonoBehaviour
	{
		public class FireStateDestructible : FireState
		{
			public Destructible m_destructible { get; private set; }

			public override bool InitComponent(MonoBehaviour component)
			{
				//IL_001d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0027: Expected O, but got Unknown
				if (!IsBurnable(((Component)component).gameObject))
				{
					return false;
				}
				m_gameObject = ((Component)component).gameObject;
				m_destructible = (Destructible)component;
				base.m_nview = m_destructible.m_nview;
				if (!Init(((Component)m_destructible).gameObject))
				{
					return false;
				}
				return true;
			}

			public override void ApplyDamage(float damage)
			{
				//IL_0081: Unknown result type (might be due to invalid IL or missing references)
				//IL_0087: Expected O, but got Unknown
				if (!((Object)(object)base.m_nview == (Object)null) && base.m_nview.IsValid())
				{
					float @float = base.m_nview.GetZDO().GetFloat(ZDOVars.s_health, m_destructible.m_health);
					damage = Instance.ApplyEnvironmentModifier(damage);
					if ((@float - damage) / m_destructible.m_health <= FireSpreads.StopBurningConfig.Value)
					{
						float num = m_destructible.m_health * FireSpreads.StopBurningConfig.Value;
						damage = @float - num;
					}
					HitData val = new HitData();
					val.m_damage.m_chop = damage;
					val.m_toolTier = 10;
					m_destructible.Damage(val);
				}
			}

			public override void SetFire(float damage)
			{
				Instance.SetFire(base.m_nview, damage);
				if (Instance.IsBurning(base.m_nview) && Instance.GetFireState(m_gameObject) == null)
				{
					Instance.Ignite(base.m_nview);
				}
			}

			public override float GetHealthPercentage()
			{
				if ((Object)(object)base.m_nview == (Object)null || !base.m_nview.IsValid() || base.m_nview.GetZDO() == null)
				{
					return 1f;
				}
				return base.m_nview.GetZDO().GetFloat(ZDOVars.s_health, m_destructible.m_health) / m_destructible.m_health;
			}

			protected override void SetQuality()
			{
				m_quality = Mathf.Clamp(m_quality, 0, 5);
				((Component)m_PointLight).gameObject.SetActive(m_quality < 1);
				((Component)m_SmokeSpawner).gameObject.SetActive(m_quality < 2);
				((Component)m_SFX).gameObject.SetActive(m_quality < 2);
				((Component)m_Smoke).gameObject.SetActive(m_quality < 3);
				((Component)m_Sparks).gameObject.SetActive(m_quality < 4);
				((Component)m_Flare).gameObject.SetActive(false);
			}
		}

		public class FireStateTreeLog : FireState
		{
			public TreeLog m_treeLog { get; private set; }

			public override bool InitComponent(MonoBehaviour component)
			{
				//IL_001d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0027: Expected O, but got Unknown
				if (!IsBurnable(((Component)component).gameObject))
				{
					return false;
				}
				m_gameObject = ((Component)component).gameObject;
				m_treeLog = (TreeLog)component;
				base.m_nview = m_treeLog.m_nview;
				if (!Init(((Component)m_treeLog).gameObject))
				{
					return false;
				}
				m_burnStartHealth = 999999f;
				return true;
			}

			protected override void SetQuality()
			{
				m_quality = Mathf.Clamp(m_quality, 0, 5);
				((Component)m_PointLight).gameObject.SetActive(m_quality < 1);
				((Component)m_SmokeSpawner).gameObject.SetActive(m_quality < 2);
				((Component)m_SFX).gameObject.SetActive(m_quality < 2);
				((Component)m_Smoke).gameObject.SetActive(false);
				((Component)m_Sparks).gameObject.SetActive(m_quality < 4);
				((Component)m_Flare).gameObject.SetActive(false);
			}

			public override void ApplyDamage(float damage)
			{
				//IL_0081: Unknown result type (might be due to invalid IL or missing references)
				//IL_0087: Expected O, but got Unknown
				if (!((Object)(object)base.m_nview == (Object)null) && base.m_nview.IsValid())
				{
					float @float = base.m_nview.GetZDO().GetFloat(ZDOVars.s_health, m_treeLog.m_health);
					damage = Instance.ApplyEnvironmentModifier(damage);
					if ((@float - damage) / m_treeLog.m_health <= FireSpreads.StopBurningConfig.Value)
					{
						float num = m_treeLog.m_health * FireSpreads.StopBurningConfig.Value;
						damage = @float - num;
					}
					HitData val = new HitData();
					val.m_damage.m_chop = damage;
					val.m_toolTier = 10;
					m_treeLog.Damage(val);
				}
			}

			public override void SetFire(float damage)
			{
				Instance.SetFire<TreeLog>(m_treeLog, m_treeLog.m_nview, damage, eternalFlame: false);
				if (Instance.IsBurning(base.m_nview) && Instance.GetFireState(m_gameObject) == null)
				{
					Instance.Ignite(base.m_nview);
				}
			}

			public override float GetHealthPercentage()
			{
				if ((Object)(object)base.m_nview == (Object)null || base.m_nview.GetZDO() == null)
				{
					return 1f;
				}
				return base.m_nview.GetZDO().GetFloat(ZDOVars.s_health, m_treeLog.m_health) / m_treeLog.m_health;
			}
		}

		public class FireStateTreeBase : FireState
		{
			public TreeBase m_treeBase { get; private set; }

			public override bool InitComponent(MonoBehaviour component)
			{
				//IL_001d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0027: Expected O, but got Unknown
				if (!IsBurnable(((Component)component).gameObject))
				{
					return false;
				}
				m_gameObject = ((Component)component).gameObject;
				m_treeBase = (TreeBase)component;
				base.m_nview = m_treeBase.m_nview;
				if (!Init(((Component)m_treeBase).gameObject))
				{
					return false;
				}
				return true;
			}

			protected override void SetQuality()
			{
				m_quality = Mathf.Clamp(m_quality, 0, 5);
				((Component)m_PointLight).gameObject.SetActive(m_quality < 1);
				((Component)m_SFX).gameObject.SetActive(m_quality < 2);
				((Component)m_Smoke).gameObject.SetActive(m_quality < 2);
				((Component)m_Sparks).gameObject.SetActive(m_quality < 3);
				((Component)m_Flare).gameObject.SetActive(m_quality < 4);
				(