using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using Assets.Scripts.Actors;
using Assets.Scripts.Actors.Enemies;
using Assets.Scripts.Actors.Player;
using Assets.Scripts.Game.Combat;
using Assets.Scripts.Inventory__Items__Pickups;
using Assets.Scripts.Inventory__Items__Pickups.Weapons;
using Assets.Scripts.Inventory__Items__Pickups.Weapons.Attacks;
using Assets.Scripts.Managers;
using Assets.Scripts.Menu.Shop;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
using Il2CppSystem.Collections.Generic;
using Microsoft.CodeAnalysis;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("GutsCharacter")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("GutsCharacter")]
[assembly: AssemblyTitle("GutsCharacter")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace Gravewolf
{
[BepInPlugin("gravewolf.character", "Guts Character", "1.8.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Plugin : BasePlugin
{
public const string Guid = "gravewolf.character";
public const uint UID = 1477013666u;
internal static ManualLogSource L;
internal static ConfigEntry<float> SlamRadius;
internal static ConfigEntry<float> ImpactTime;
internal static ConfigEntry<float> CurseDuration;
internal static ConfigEntry<float> CurseBurstDamage;
internal static ConfigEntry<float> CurseTickDamage;
internal static ConfigEntry<float> CurseMaxHpPercent;
internal static ConfigEntry<float> CurseSpreadRange;
internal static ConfigEntry<float> ImpactOffset;
internal static ConfigEntry<float> TargetRange;
internal static ConfigEntry<float> SliceTime;
internal static ConfigEntry<float> SliceRange;
internal static ConfigEntry<float> SliceWidth;
internal static ConfigEntry<float> SliceDamage;
public override void Load()
{
//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
L = ((BasePlugin)this).Log;
SlamRadius = ((BasePlugin)this).Config.Bind<float>("Gravefang", "ImpactAoeRadius", 7f, "Radius of the somersault impact AoE (scaled by weapon Size).");
ImpactOffset = ((BasePlugin)this).Config.Bind<float>("Gravefang", "ImpactForwardOffset", 1.2f, "How far in front of you the impact AoE is centred (scaled by Size).");
ImpactTime = ((BasePlugin)this).Config.Bind<float>("Gravefang", "ImpactTime", 0.77f, "Seconds after the somersault starts that the blade lands.");
TargetRange = ((BasePlugin)this).Config.Bind<float>("Gravefang", "TargetRange", 30f, "Range of the auto-targeting used to aim the somersault and the slice.");
SliceTime = ((BasePlugin)this).Config.Bind<float>("Gravefang", "SliceTime", 1.2f, "Seconds after the somersault starts that the follow-up vertical slice lands.");
SliceRange = ((BasePlugin)this).Config.Bind<float>("Gravefang", "SliceRange", 14f, "Length of the vertical slice wave (scaled by Size).");
SliceWidth = ((BasePlugin)this).Config.Bind<float>("Gravefang", "SliceWidth", 1.3f, "Half-width of the vertical slice wave (scaled by Size).");
SliceDamage = ((BasePlugin)this).Config.Bind<float>("Gravefang", "SliceDamageMultiplier", 1.6f, "Slice damage x Gravefang damage.");
CurseDuration = ((BasePlugin)this).Config.Bind<float>("Cursed", "Duration", 6f, "How long an enemy stays Cursed (seconds). Re-hits refresh it.");
CurseBurstDamage = ((BasePlugin)this).Config.Bind<float>("Cursed", "BurstDamageMultiplier", 1.5f, "Instant damage when cursed, x Gravefang damage.");
CurseTickDamage = ((BasePlugin)this).Config.Bind<float>("Cursed", "TickDamageMultiplier", 0.3f, "Damage every 0.5s while cursed, x Gravefang damage.");
CurseMaxHpPercent = ((BasePlugin)this).Config.Bind<float>("Cursed", "TickMaxHpPercent", 0.02f, "Extra tick damage as a fraction of the enemy's max HP (bosses get 1/10).");
CurseSpreadRange = ((BasePlugin)this).Config.Bind<float>("Cursed", "SpreadRange", 7f, "When a cursed enemy dies the curse jumps to the nearest enemy in this range (0 = off).");
((BasePlugin)this).AddComponent<GravewolfRunner>();
new Harmony("gravewolf.character").PatchAll(typeof(Patches));
L.LogInfo((object)"Guts loaded: somersault slam + CURSED ready.");
}
internal static bool IsGravewolf()
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Invalid comparison between Unknown and I4
MyPlayer instance = MyPlayer.Instance;
if ((Object)(object)instance != (Object)null)
{
return (int)instance.character == 1477013666;
}
return false;
}
}
internal static class Patches
{
private static bool _logged;
private static bool IsGravefang(WeaponBase w)
{
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Invalid comparison between Unknown and I4
WeaponData val = ((w != null) ? w.weaponData : null);
if ((Object)(object)val != (Object)null)
{
return (int)val.eWeapon == 1477013666;
}
return false;
}
[HarmonyPatch(typeof(WeaponUtility), "WeaponAttack")]
[HarmonyPrefix]
private static bool WeaponAttackPrefix(WeaponBase weapon)
{
try
{
if (!IsGravefang(weapon))
{
return true;
}
if (!_logged)
{
_logged = true;
Plugin.L.LogInfo((object)"Gravefang attack intercepted -> somersault slam");
}
GravewolfRunner.Instance?.StartSlam(weapon);
return false;
}
catch (Exception ex)
{
Plugin.L.LogError((object)("WeaponAttack: " + ex));
return true;
}
}
[HarmonyPatch(typeof(WeaponAttack), "SetAttack")]
[HarmonyPrefix]
private static bool SetAttackPrefix(WeaponAttack __instance, WeaponBase weaponBase)
{
try
{
if (!IsGravefang(weaponBase))
{
return true;
}
Plugin.L.LogWarning((object)"Gravefang SetAttack reached (WeaponAttack hook missed) - slamming instead");
GravewolfRunner.Instance?.StartSlam(weaponBase);
((Component)__instance).gameObject.SetActive(false);
return false;
}
catch (Exception ex)
{
Plugin.L.LogError((object)("SetAttack: " + ex));
return true;
}
}
[HarmonyPatch(typeof(WeaponBase), "Use")]
[HarmonyPrefix]
private static bool WeaponUse(WeaponBase __instance)
{
try
{
if (!IsGravefang(__instance))
{
return true;
}
GravewolfRunner.Instance?.StartSlam(__instance);
__instance.usedWeaponAtTime = Time.time;
return false;
}
catch (Exception ex)
{
Plugin.L.LogError((object)("WeaponUse: " + ex));
return true;
}
}
[HarmonyPatch(typeof(PlayerHealth), "DamagePlayer")]
[HarmonyPostfix]
private static void DamagePlayer(Enemy enemy)
{
try
{
if ((Object)(object)enemy != (Object)null && Plugin.IsGravewolf())
{
GravewolfRunner.Instance?.Curse(enemy, burst: true);
}
}
catch (Exception ex)
{
Plugin.L.LogError((object)("DamagePlayer: " + ex));
}
}
[HarmonyPatch(typeof(PlayerHealth), "DamagePlayerExternal")]
[HarmonyPostfix]
private static void DamagePlayerExternal(Enemy enemy)
{
try
{
if ((Object)(object)enemy != (Object)null && Plugin.IsGravewolf())
{
GravewolfRunner.Instance?.Curse(enemy, burst: true);
}
}
catch (Exception ex)
{
Plugin.L.LogError((object)("DamagePlayerExternal: " + ex));
}
}
}
public class GravewolfRunner : MonoBehaviour
{
private class CurseState
{
public Enemy enemy;
public float until;
public float nextTick;
public GameObject fx;
}
private class Wave
{
public GameObject go;
public float t0;
public float radius;
public Material mat;
}
private class Slice
{
public GameObject root;
public GameObject scar;
public readonly List<Material> mats = new List<Material>();
public readonly List<Color> baseCols = new List<Color>();
public Material sm;
public Vector3 origin;
public Vector3 dir;
public float t0;
public float len;
public float size;
public float nextGhost;
public bool burst;
}
private class Ghost
{
public GameObject go;
public List<Material> mats;
public List<Color> cols;
public float t0;
}
private class Spark
{
public GameObject go;
public Material m;
public Vector3 vel;
public float t0;
public float life;
}
private class Radial
{
public GameObject root;
public readonly List<Material> mats = new List<Material>();
public readonly List<Color> cols = new List<Color>();
public Vector3 center;
public Vector3 dir;
public float t0;
public float radius;
public float size;
public float roll;
public float scale;
}
public static GravewolfRunner Instance;
private readonly Dictionary<uint, CurseState> _cursed = new Dictionary<uint, CurseState>();
private readonly List<uint> _remove = new List<uint>();
private float _slamImpactAt = -1f;
private float _sliceAt = -1f;
private float _slamEndAt = -1f;
private float _lastDamageValue = 24f;
private WeaponBase _slamWeapon;
private Animator _anim;
private bool _animLogged;
private Vector3 _aimDir = Vector3.forward;
private const float SlamLength = 1.8666667f;
private static Material _fxMat;
private static readonly Color CurseColor = new Color(0.85f, 0.04f, 0.05f, 0.85f);
private readonly List<Wave> _waves = new List<Wave>();
private readonly List<Slice> _slices = new List<Slice>();
private readonly List<Ghost> _ghosts = new List<Ghost>();
private readonly List<Spark> _sparks = new List<Spark>();
private static readonly Color SlashOuter = new Color(0.9f, 0.03f, 0.04f, 0.92f);
private static readonly Color SlashCore = new Color(1f, 0.62f, 0.4f, 0.97f);
private static readonly Color ScarColor = new Color(0.65f, 0.01f, 0.02f, 0.85f);
private const float SliceTravel = 0.35f;
private const float SliceFall = 0.22f;
private const float SliceLife = 0.8f;
private const float SlashRadius = 2.6f;
private const int ArcSegs = 16;
private readonly List<Radial> _radials = new List<Radial>();
private const float RadialTravel = 0.3f;
private const float RadialLife = 0.45f;
public GravewolfRunner(IntPtr ptr)
: base(ptr)
{
}//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
private void Awake()
{
Instance = this;
}
private Animator FindAnimator()
{
MyPlayer instance = MyPlayer.Instance;
if ((Object)(object)instance == (Object)null)
{
return null;
}
if ((Object)(object)_anim != (Object)null && (Object)(object)((Component)_anim).gameObject != (Object)null)
{
return _anim;
}
PlayerRenderer playerRenderer = instance.playerRenderer;
_anim = (((Object)(object)playerRenderer != (Object)null) ? playerRenderer.animator : null);
if ((Object)(object)_anim == (Object)null)
{
_anim = ((Component)instance).GetComponentInChildren<Animator>();
}
return _anim;
}
private Transform Facing()
{
MyPlayer instance = MyPlayer.Instance;
PlayerRenderer playerRenderer = instance.playerRenderer;
if ((Object)(object)playerRenderer != (Object)null && (Object)(object)playerRenderer.rendererObject != (Object)null)
{
return playerRenderer.rendererObject.transform;
}
return ((Component)instance).transform;
}
public void StartSlam(WeaponBase w)
{
if (!(_slamImpactAt > 0f) && !(_sliceAt > 0f))
{
_slamWeapon = w;
float num = 1.3f;
try
{
num = Mathf.Max(0.2f, w.GetCooldown());
}
catch
{
}
float num2 = Mathf.Clamp(1.8666667f / num, 1f, 3f);
Animator val = FindAnimator();
if ((Object)(object)val != (Object)null)
{
val.speed = num2;
val.SetTrigger("slam");
}
if (!_animLogged)
{
_animLogged = true;
Plugin.L.LogInfo((object)(((Object)(object)val == (Object)null) ? "Slam: no Animator found on player!" : $"Slam: animator '{((Object)((Component)val).gameObject).name}' controller='{(((Object)(object)val.runtimeAnimatorController != (Object)null) ? ((Object)val.runtimeAnimatorController).name : "null")}' speed={num2:0.00}"));
}
AimAtTarget();
_slamImpactAt = Time.time + Plugin.ImpactTime.Value / num2;
_sliceAt = Time.time + Plugin.SliceTime.Value / num2;
_slamEndAt = Time.time + 1.8666667f / num2;
}
}
private bool AimAtTarget()
{
//IL_0019: 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_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: Unknown result type (might be due to invalid IL or missing references)
//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
MyPlayer instance = MyPlayer.Instance;
if ((Object)(object)instance == (Object)null)
{
return false;
}
Enemy val = null;
try
{
val = EnemyTargeting.GetEnemy(((Component)instance).transform.position, Plugin.TargetRange.Value, 0, false, (GameObject)null);
}
catch (Exception ex)
{
Plugin.L.LogWarning((object)("targeting: " + ex.Message));
}
Vector3 val2;
if ((Object)(object)val != (Object)null && !val.IsDeadOrDyingNextFrame())
{
val2 = ((Component)val).transform.position - ((Component)instance).transform.position;
val2.y = 0f;
}
else
{
val2 = Facing().forward;
val2.y = 0f;
}
if (((Vector3)(ref val2)).sqrMagnitude < 0.01f)
{
return (Object)(object)val != (Object)null;
}
_aimDir = ((Vector3)(ref val2)).normalized;
try
{
PlayerRenderer playerRenderer = instance.playerRenderer;
if (playerRenderer != null)
{
playerRenderer.ForceRotation(_aimDir);
}
}
catch
{
}
return (Object)(object)val != (Object)null;
}
private float Size(WeaponBase w)
{
return Mathf.Max(0.3f, w.GetValue((EStat)9));
}
private void HitEnemy(Enemy e, float dmg, float kb, Vector3 dir, string src)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
DamageContainer playerDamage = DamageUtility.GetPlayerDamage(dmg, kb, dir, e, src, (DcFlags)0);
e.DamageFromPlayerWeapon(playerDamage);
}
private List<Enemy> LiveEnemies()
{
List<Enemy> list = new List<Enemy>();
Enumerator<uint, Enemy> enumerator = EnemyManager.Instance.enemies.GetEnumerator();
while (enumerator.MoveNext())
{
Enemy value = enumerator.Current.Value;
if ((Object)(object)value != (Object)null && !value.IsDeadOrDyingNextFrame())
{
list.Add(value);
}
}
return list;
}
private void DoSlamImpact()
{
//IL_005e: 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_0076: 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_0089: 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_00be: 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_00c5: 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_0101: Unknown result type (might be due to invalid IL or missing references)
//IL_0106: Unknown result type (might be due to invalid IL or missing references)
//IL_010b: Unknown result type (might be due to invalid IL or missing references)
//IL_0120: Unknown result type (might be due to invalid IL or missing references)
MyPlayer instance = MyPlayer.Instance;
WeaponBase slamWeapon = _slamWeapon;
if ((Object)(object)instance == (Object)null || slamWeapon == null || (Object)(object)EnemyManager.Instance == (Object)null)
{
return;
}
float value = slamWeapon.GetValue((EStat)12);
float value2 = slamWeapon.GetValue((EStat)24);
float num = Size(slamWeapon);
_lastDamageValue = value;
float num2 = Plugin.SlamRadius.Value * num;
Vector3 val = ((Component)instance).transform.position + _aimDir * (Plugin.ImpactOffset.Value * num);
SpawnRadialSlashes(((Component)instance).transform.position, num2, num);
foreach (Enemy item in LiveEnemies())
{
Vector3 val2 = ((Component)item).transform.position - val;
val2.y *= 0.5f;
if (!(((Vector3)(ref val2)).magnitude > num2 + item.collider.radius))
{
Vector3 val3 = ((Component)item).transform.position - ((Component)instance).transform.position;
val3.y = 0f;
HitEnemy(item, value, value2, ((Vector3)(ref val3)).normalized, "Gravefang");
}
}
}
private void DoSlice()
{
//IL_0078: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0087: 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_009a: 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_00cf: Unknown result type (might be due to invalid IL or missing references)
//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
//IL_00e4: 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_010f: Unknown result type (might be due to invalid IL or missing references)
//IL_0112: Unknown result type (might be due to invalid IL or missing references)
//IL_0119: Unknown result type (might be due to invalid IL or missing references)
//IL_011e: Unknown result type (might be due to invalid IL or missing references)
//IL_0123: Unknown result type (might be due to invalid IL or missing references)
//IL_0143: Unknown result type (might be due to invalid IL or missing references)
MyPlayer instance = MyPlayer.Instance;
WeaponBase slamWeapon = _slamWeapon;
if ((Object)(object)instance == (Object)null || slamWeapon == null || (Object)(object)EnemyManager.Instance == (Object)null)
{
return;
}
AimAtTarget();
float dmg = slamWeapon.GetValue((EStat)12) * Plugin.SliceDamage.Value;
float value = slamWeapon.GetValue((EStat)24);
float num = Size(slamWeapon);
float num2 = Plugin.SliceRange.Value * num;
float num3 = Plugin.SliceWidth.Value * num;
Vector3 position = ((Component)instance).transform.position;
position.y = ((Component)instance).transform.position.y;
SpawnSliceWave(position, _aimDir, num2, num);
foreach (Enemy item in LiveEnemies())
{
Vector3 val = ((Component)item).transform.position - position;
val.y = 0f;
float num4 = Vector3.Dot(val, _aimDir);
if (!(num4 < -0.5f) && !(num4 > num2 + item.collider.radius))
{
Vector3 val2 = val - _aimDir * num4;
if (!(((Vector3)(ref val2)).magnitude > num3 + item.collider.radius))
{
HitEnemy(item, dmg, value, _aimDir, "Gravefang");
}
}
}
}
public void Curse(Enemy e, bool burst)
{
if (!((Object)(object)e == (Object)null) && !e.IsDeadOrDyingNextFrame())
{
uint id = e.id;
if (!_cursed.TryGetValue(id, out var value))
{
value = new CurseState
{
enemy = e,
nextTick = Time.time + 0.5f,
fx = MakeCurseFx(e)
};
_cursed[id] = value;
}
value.until = Time.time + Plugin.CurseDuration.Value;
if (burst)
{
Hurt(e, _lastDamageValue * Plugin.CurseBurstDamage.Value);
}
}
}
private void Hurt(Enemy e, float amount)
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)e == (Object)null) && !e.IsDeadOrDyingNextFrame())
{
DamageContainer playerDamage = DamageUtility.GetPlayerDamage(amount, 0f, Vector3.zero, e, "Cursed", (DcFlags)0);
playerDamage.damageEffect = (EDamageEffect)7;
e.DamageFromPlayerOther(playerDamage);
}
}
private void Update()
{
try
{
if (_slamImpactAt > 0f && Time.time >= _slamImpactAt)
{
_slamImpactAt = -1f;
DoSlamImpact();
}
if (_sliceAt > 0f && Time.time >= _sliceAt)
{
_sliceAt = -1f;
DoSlice();
}
if (_slamEndAt > 0f && Time.time >= _slamEndAt)
{
_slamEndAt = -1f;
Animator val = FindAnimator();
if ((Object)(object)val != (Object)null)
{
val.speed = 1f;
}
}
TickCurses();
}
catch (Exception ex)
{
Plugin.L.LogError((object)("Gravewolf Update: " + ex));
_slamImpactAt = (_sliceAt = (_slamEndAt = -1f));
}
}
private void TickCurses()
{
//IL_009f: 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_00e8: 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_00f7: Unknown result type (might be due to invalid IL or missing references)
//IL_020c: Unknown result type (might be due to invalid IL or missing references)
if (_cursed.Count == 0)
{
return;
}
if ((Object)(object)MyPlayer.Instance == (Object)null)
{
ClearAll();
return;
}
float time = Time.time;
_remove.Clear();
Vector3? val = null;
foreach (KeyValuePair<uint, CurseState> item in _cursed)
{
CurseState value = item.Value;
Enemy enemy = value.enemy;
bool flag = (Object)(object)enemy == (Object)null || enemy.IsDeadOrDyingNextFrame();
if (flag || time > value.until)
{
if (flag && (Object)(object)enemy != (Object)null)
{
val = ((Component)enemy).transform.position;
}
_remove.Add(item.Key);
continue;
}
if ((Object)(object)value.fx != (Object)null)
{
value.fx.transform.position = ((Component)enemy).transform.position + Vector3.up * 1.2f;
}
if (time >= value.nextTick)
{
value.nextTick = time + 0.5f;
float num = Plugin.CurseMaxHpPercent.Value * ((enemy.IsBoss() || enemy.IsStageBoss()) ? 0.1f : 1f);
Hurt(enemy, _lastDamageValue * Plugin.CurseTickDamage.Value + enemy.maxHp * num);
}
}
foreach (uint item2 in _remove)
{
if (_cursed.TryGetValue(item2, out var value2) && (Object)(object)value2.fx != (Object)null)
{
Object.Destroy((Object)(object)value2.fx);
}
_cursed.Remove(item2);
}
if (val.HasValue && Plugin.CurseSpreadRange.Value > 0f)
{
Spread(val.Value);
}
}
private void Spread(Vector3 from)
{
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)EnemyManager.Instance == (Object)null)
{
return;
}
Enemy val = null;
float num = Plugin.CurseSpreadRange.Value;
Enumerator<uint, Enemy> enumerator = EnemyManager.Instance.enemies.GetEnumerator();
while (enumerator.MoveNext())
{
Enemy value = enumerator.Current.Value;
if (!((Object)(object)value == (Object)null) && !value.IsDeadOrDyingNextFrame() && !_cursed.ContainsKey(value.id))
{
float num2 = Vector3.Distance(from, ((Component)value).transform.position);
if (num2 < num)
{
num = num2;
val = value;
}
}
}
if ((Object)(object)val != (Object)null)
{
Curse(val, burst: false);
}
}
private void ClearAll()
{
foreach (CurseState value in _cursed.Values)
{
if ((Object)(object)value.fx != (Object)null)
{
Object.Destroy((Object)(object)value.fx);
}
}
_cursed.Clear();
}
private static Material FxMat(Color c)
{
//IL_0050: 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_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: Expected O, but got Unknown
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Expected O, but got Unknown
if ((Object)(object)_fxMat == (Object)null)
{
Shader val = Shader.Find("Sprites/Default");
if ((Object)(object)val == (Object)null)
{
val = Shader.Find("Unlit/Color");
}
if ((Object)(object)val == (Object)null)
{
val = Shader.Find("Standard");
}
_fxMat = new Material(val);
}
return new Material(_fxMat)
{
color = c
};
}
private static GameObject Prim(PrimitiveType t, string name, Color c)
{
//IL_0000: 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)
GameObject obj = GameObject.CreatePrimitive(t);
((Object)obj).name = name;
Collider component = obj.GetComponent<Collider>();
if ((Object)(object)component != (Object)null)
{
Object.Destroy((Object)(object)component);
}
obj.GetComponent<Renderer>().material = FxMat(c);
return obj;
}
private GameObject MakeCurseFx(Enemy e)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: 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_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_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)
try
{
GameObject obj = Prim((PrimitiveType)0, "GravewolfCurseFx", CurseColor);
obj.transform.localScale = Vector3.one * 0.55f;
obj.transform.position = ((Component)e).transform.position + Vector3.up * 1.2f;
return obj;
}
catch (Exception ex)
{
Plugin.L.LogWarning((object)("curse fx: " + ex.Message));
return null;
}
}
private void SpawnShockwave(Vector3 center, float radius)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: 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_0027: 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)
try
{
GameObject val = Prim((PrimitiveType)2, "GravefangShockwave", CurseColor);
val.transform.position = center + Vector3.up * 0.1f;
val.transform.localScale = new Vector3(0.5f, 0.03f, 0.5f);
_waves.Add(new Wave
{
go = val,
t0 = Time.time,
radius = radius,
mat = val.GetComponent<Renderer>().material
});
}
catch (Exception ex)
{
Plugin.L.LogWarning((object)("shockwave fx: " + ex.Message));
}
}
private static void BuildArc(Transform parent, float r, float thick, float width, float a0Deg, float a1Deg, Color c, List<Material> mats, List<Color> cols)
{
//IL_0082: Unknown result type (might be due to invalid IL or missing references)
//IL_008e: Unknown result type (might be due to invalid IL or missing references)
//IL_0093: Unknown result type (might be due to invalid IL or missing references)
//IL_00bf: 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_0104: 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_0116: 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_014f: Unknown result type (might be due to invalid IL or missing references)
//IL_0164: Unknown result type (might be due to invalid IL or missing references)
float num = (a1Deg - a0Deg) / 16f;
Vector3 val = default(Vector3);
for (int i = 0; i < 16; i++)
{
float num2 = ((float)i + 0.5f) / 16f;
float num3 = (float)Math.PI / 180f * (a0Deg + num * ((float)i + 0.5f));
float num4 = Mathf.Pow(Mathf.Sin((float)Math.PI * Mathf.Pow(num2, 0.75f)), 0.8f);
((Vector3)(ref val))..ctor(0f, Mathf.Sin(num3), Mathf.Cos(num3));
Vector3 val2 = new Vector3(0f, 0f - Mathf.Cos(num3), Mathf.Sin(num3)) * Mathf.Sign(0f - num);
GameObject obj = GameObject.CreatePrimitive((PrimitiveType)3);
((Object)obj).name = "SlashSeg";
Collider component = obj.GetComponent<Collider>();
if ((Object)(object)component != (Object)null)
{
Object.Destroy((Object)(object)component);
}
Material val3 = FxMat(c);
obj.GetComponent<Renderer>().material = val3;
obj.transform.SetParent(parent, false);
float num5 = Mathf.Max(0.02f, thick * num4);
obj.transform.localPosition = val * (r - num5 * 0.5f);
obj.transform.localRotation = Quaternion.LookRotation(val2, val);
float num6 = r * Mathf.Abs(num) * ((float)Math.PI / 180f) * 1.25f;
obj.transform.localScale = new Vector3(Mathf.Max(0.02f, width * num4), num5, num6);
mats.Add(val3);
cols.Add(c);
}
}
private void SpawnSliceWave(Vector3 origin, Vector3 dir, float len, float size)
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Expected O, but got Unknown
//IL_0018: 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_0020: 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_007a: 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_00af: 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_00ec: Expected O, but got Unknown
try
{
GameObject val = new GameObject("GravefangFallingSlash");
Slice slice = new Slice
{
root = val,
origin = origin,
dir = dir,
t0 = Time.time,
len = len,
size = size
};
BuildArc(val.transform, 1f, 0.36f, 0.55f, 165f, -25f, SlashOuter, slice.mats, slice.baseCols);
GameObject val2 = new GameObject("SlashCore");
val2.transform.SetParent(val.transform, false);
BuildArc(val2.transform, 1.03f, 0.12f, 0.3f, 150f, -15f, SlashCore, slice.mats, slice.baseCols);
_slices.Add(slice);
PoseSlice(slice, 0f);
ManualLogSource l = Plugin.L;
bool flag = default(bool);
BepInExDebugLogInterpolatedStringHandler val3 = new BepInExDebugLogInterpolatedStringHandler(30, 2, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("slash spawned: ");
((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<int>(slice.mats.Count);
((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" segments, len ");
((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<float>(len, "0.0");
}
l.LogDebug(val3);
}
catch (Exception ex)
{
Plugin.L.LogWarning((object)("slice fx: " + ex));
}
}
private static void PoseSlice(Slice s, float t)
{
//IL_008d: 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_00a8: 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_00c3: Unknown result type (might be due to invalid IL or missing references)
//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
//IL_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_00f2: Unknown result type (might be due to invalid IL or missing references)
//IL_0107: Unknown result type (might be due to invalid IL or missing references)
//IL_010d: 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_0153: Unknown result type (might be due to invalid IL or missing references)
//IL_0158: Unknown result type (might be due to invalid IL or missing references)
//IL_0189: Unknown result type (might be due to invalid IL or missing references)
float num = Mathf.Clamp01(t / 0.35f);
float num2 = s.len * (1f - (1f - num) * (1f - num));
float num3 = Mathf.Clamp01(t / 0.22f);
num3 = num3 * num3 * (3f - 2f * num3);
float num4 = 2.6f * s.size;
float num5 = Mathf.Lerp(-70f, 22f, num3);
float num6 = Mathf.Lerp(3.2f, 1.55f, num3) * s.size;
s.root.transform.rotation = Quaternion.LookRotation(s.dir, Vector3.up) * Quaternion.Euler(num5, 0f, 0f);
s.root.transform.position = s.origin + s.dir * (1.2f * s.size + num2) + Vector3.up * num6;
s.root.transform.localScale = Vector3.one * num4 * Mathf.Lerp(0.85f, 1.15f, num);
float num7 = 1f - Mathf.Clamp01((t - 0.28f) / 0.52f);
for (int i = 0; i < s.mats.Count; i++)
{
Color color = s.baseCols[i];
color.a *= num7;
if ((Object)(object)s.mats[i] != (Object)null)
{
s.mats[i].color = color;
}
}
}
private void SpawnGhost(Slice s)
{
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
GameObject val = Object.Instantiate<GameObject>(s.root);
((Object)val).name = "SlashGhost";
Ghost ghost = new Ghost
{
go = val,
mats = new List<Material>(),
cols = new List<Color>(),
t0 = Time.time
};
foreach (Renderer componentsInChild in val.GetComponentsInChildren<Renderer>())
{
Material material = componentsInChild.material;
ghost.mats.Add(material);
ghost.cols.Add(material.color);
}
_ghosts.Add(ghost);
}
private void SpawnSparks(Vector3 at, Vector3 dir, int n, float size)
{
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: 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_0035: 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_0041: 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_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: 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_0096: 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_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_00af: Unknown result type (might be due to invalid IL or missing references)
//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
for (int i = 0; i < n; i++)
{
GameObject val = Prim((PrimitiveType)3, "SlashSpark", (i % 3 == 0) ? SlashCore : SlashOuter);
val.transform.position = at + Random.insideUnitSphere * 0.5f * size;
val.transform.rotation = Random.rotation;
val.transform.localScale = Vector3.one * Random.Range(0.12f, 0.25f) * size;
Vector3 vel = (dir * Random.Range(2f, 6f) + Random.insideUnitSphere * 5f + Vector3.up * Random.Range(2f, 6f)) * size;
_sparks.Add(new Spark
{
go = val,
m = val.GetComponent<Renderer>().material,
vel = vel,
t0 = Time.time,
life = Random.Range(0.3f, 0.55f)
});
}
}
private void SpawnEndBurst(Vector3 at, float size)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: 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_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: 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_003b: 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_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
SpawnSparks(at + Vector3.up * 0.5f, Vector3.up, 14, size);
GameObject val = Prim((PrimitiveType)2, "SlashPillar", SlashOuter);
val.transform.position = at + Vector3.up * 2f * size;
val.transform.localScale = new Vector3(0.9f * size, 2f * size, 0.9f * size);
Ghost item = new Ghost
{
go = val,
mats = new List<Material> { val.GetComponent<Renderer>().material },
cols = new List<Color> { SlashOuter },
t0 = Time.time
};
_ghosts.Add(item);
}
private void SpawnRadialSlashes(Vector3 center, float radius, float size)
{
//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_01b7: Unknown result type (might be due to invalid IL or missing references)
//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
//IL_01c1: 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_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_0051: 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_0068: Expected O, but got Unknown
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: 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_00fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0119: Unknown result type (might be due to invalid IL or missing references)
//IL_011e: Unknown result type (might be due to invalid IL or missing references)
//IL_0154: Unknown result type (might be due to invalid IL or missing references)
try
{
for (int i = 0; i < 2; i++)
{
int num = ((i == 0) ? 10 : 8);
float num2 = Random.Range(0f, 360f);
for (int j = 0; j < num; j++)
{
float num3 = num2 + 360f * (float)j / (float)num;
Vector3 dir = Quaternion.Euler(0f, num3, 0f) * Vector3.forward;
Radial radial = new Radial
{
root = new GameObject("GravefangRadialSlash"),
center = center,
dir = dir,
t0 = Time.time + (float)i * 0.07f,
radius = radius * ((i == 0) ? 1f : 0.7f),
size = size,
roll = Random.Range(-55f, 55f),
scale = ((i == 0) ? 1.5f : 1.1f) * size
};
BuildArc(radial.root.transform, 1f, 0.34f, 0.5f, 150f, -10f, SlashOuter, radial.mats, radial.cols);
GameObject val = new GameObject("RadialCore");
val.transform.SetParent(radial.root.transform, false);
BuildArc(val.transform, 1.03f, 0.11f, 0.28f, 135f, 0f, SlashCore, radial.mats, radial.cols);
radial.root.SetActive(i == 0);
_radials.Add(radial);
PoseRadial(radial, 0f);
}
}
SpawnSparks(center + Vector3.up * 0.6f, Vector3.up, 16, size);
}
catch (Exception ex)
{
Plugin.L.LogWarning((object)("radial fx: " + ex));
}
}
private static void PoseRadial(Radial r, float t)
{
//IL_0059: 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_0063: Unknown result type (might be due to invalid IL or missing references)
//IL_0074: Unknown result type (might be due to invalid IL or missing references)
//IL_0079: Unknown result type (might be due to invalid IL or missing references)
//IL_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: Unknown result type (might be due to invalid IL or missing references)
//IL_00a0: 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_00b6: 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_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_00f0: Unknown result type (might be due to invalid IL or missing references)
//IL_0121: Unknown result type (might be due to invalid IL or missing references)
//IL_0126: Unknown result type (might be due to invalid IL or missing references)
//IL_0157: Unknown result type (might be due to invalid IL or missing references)
float num = Mathf.Clamp01(t / 0.3f);
float num2 = 1f - (1f - num) * (1f - num);
float num3 = Mathf.Lerp(0.6f * r.size, r.radius, num2);
float num4 = Mathf.Lerp(-45f, 25f, num2);
r.root.transform.rotation = Quaternion.LookRotation(r.dir, Vector3.up) * Quaternion.Euler(num4, 0f, r.roll);
r.root.transform.position = r.center + r.dir * num3 + Vector3.up * (1.1f * r.size);
r.root.transform.localScale = Vector3.one * r.scale * Mathf.Lerp(0.6f, 1.2f, num2);
float num5 = 1f - Mathf.Clamp01((t - 0.21000001f) / 0.23999998f);
for (int i = 0; i < r.mats.Count; i++)
{
Color color = r.cols[i];
color.a *= num5;
if ((Object)(object)r.mats[i] != (Object)null)
{
r.mats[i].color = color;
}
}
}
private void UpdateRadials(float now)
{
for (int num = _radials.Count - 1; num >= 0; num--)
{
Radial radial = _radials[num];
float num2 = now - radial.t0;
if ((Object)(object)radial.root == (Object)null || num2 >= 0.45f)
{
if ((Object)(object)radial.root != (Object)null)
{
Object.Destroy((Object)(object)radial.root);
}
_radials.RemoveAt(num);
}
else if (!(num2 < 0f))
{
if (!radial.root.activeSelf)
{
radial.root.SetActive(true);
}
PoseRadial(radial, num2);
}
}
}
private void UpdateSlices(float now)
{
//IL_00ae: 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_00bd: 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_00d2: 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_00dd: Unknown result type (might be due to invalid IL or missing references)
//IL_0107: Unknown result type (might be due to invalid IL or missing references)
//IL_010d: Unknown result type (might be due to invalid IL or missing references)
//IL_0125: Unknown result type (might be due to invalid IL or missing references)
//IL_012a: Unknown result type (might be due to invalid IL or missing references)
//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
//IL_02b6: Unknown result type (might be due to invalid IL or missing references)
//IL_02bb: Unknown result type (might be due to invalid IL or missing references)
//IL_02c5: Unknown result type (might be due to invalid IL or missing references)
//IL_02cb: Unknown result type (might be due to invalid IL or missing references)
//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
//IL_02d5: Unknown result type (might be due to invalid IL or missing references)
//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
//IL_02ee: Unknown result type (might be due to invalid IL or missing references)
//IL_02f4: Unknown result type (might be due to invalid IL or missing references)
//IL_02f9: Unknown result type (might be due to invalid IL or missing references)
//IL_0310: Unknown result type (might be due to invalid IL or missing references)
//IL_0322: Unknown result type (might be due to invalid IL or missing references)
//IL_0333: Unknown result type (might be due to invalid IL or missing references)
//IL_0338: Unknown result type (might be due to invalid IL or missing references)
//IL_0350: Unknown result type (might be due to invalid IL or missing references)
//IL_020d: Unknown result type (might be due to invalid IL or missing references)
float deltaTime = Time.deltaTime;
UpdateRadials(now);
for (int num = _slices.Count - 1; num >= 0; num--)
{
Slice slice = _slices[num];
float num2 = now - slice.t0;
if ((Object)(object)slice.root == (Object)null || num2 >= 0.8f)
{
if ((Object)(object)slice.root != (Object)null)
{
Object.Destroy((Object)(object)slice.root);
}
_slices.RemoveAt(num);
}
else
{
PoseSlice(slice, num2);
if (num2 < 0.35f && now >= slice.nextGhost)
{
slice.nextGhost = now + 0.045f;
SpawnGhost(slice);
SpawnSparks(slice.root.transform.position - Vector3.up * 2.6f * slice.size * 0.6f, slice.dir, 2, slice.size);
}
if (!slice.burst && num2 >= 0.35f)
{
slice.burst = true;
SpawnEndBurst(slice.origin + slice.dir * (1.2f * slice.size + slice.len), slice.size);
}
}
}
for (int num3 = _ghosts.Count - 1; num3 >= 0; num3--)
{
Ghost ghost = _ghosts[num3];
float num4 = (now - ghost.t0) / 0.25f;
if ((Object)(object)ghost.go == (Object)null || num4 >= 1f)
{
if ((Object)(object)ghost.go != (Object)null)
{
Object.Destroy((Object)(object)ghost.go);
}
_ghosts.RemoveAt(num3);
}
else
{
for (int i = 0; i < ghost.mats.Count; i++)
{
Color color = ghost.cols[i];
color.a *= 0.55f * (1f - num4);
if ((Object)(object)ghost.mats[i] != (Object)null)
{
ghost.mats[i].color = color;
}
}
}
}
for (int num5 = _sparks.Count - 1; num5 >= 0; num5--)
{
Spark spark = _sparks[num5];
float num6 = (now - spark.t0) / spark.life;
if ((Object)(object)spark.go == (Object)null || num6 >= 1f)
{
if ((Object)(object)spark.go != (Object)null)
{
Object.Destroy((Object)(object)spark.go);
}
_sparks.RemoveAt(num5);
}
else
{
spark.vel += Vector3.down * 14f * deltaTime;
Transform transform = spark.go.transform;
transform.position += spark.vel * deltaTime;
Transform transform2 = spark.go.transform;
transform2.localScale *= 1f - 1.5f * deltaTime;
Color color2 = spark.m.color;
color2.a = 1f - num6;
spark.m.color = color2;
}
}
}
private void LateUpdate()
{
//IL_00be: 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_00ea: 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_0153: Unknown result type (might be due to invalid IL or missing references)
float time = Time.time;
UpdateSlices(time);
for (int num = _waves.Count - 1; num >= 0; num--)
{
Wave wave = _waves[num];
float num2 = (time - wave.t0) / 0.4f;
if ((Object)(object)wave.go == (Object)null || num2 >= 1f)
{
if ((Object)(object)wave.go != (Object)null)
{
Object.Destroy((Object)(object)wave.go);
}
_waves.RemoveAt(num);
}
else
{
float num3 = Mathf.Lerp(0.5f, wave.radius * 2f, 1f - (1f - num2) * (1f - num2));
wave.go.transform.localScale = new Vector3(num3, 0.03f, num3);
Color curseColor = CurseColor;
curseColor.a = 0.85f * (1f - num2);
wave.mat.color = curseColor;
}
}
float num4 = 0.45f + 0.15f * Mathf.Sin(time * 8f);
foreach (CurseState value in _cursed.Values)
{
if ((Object)(object)value.fx != (Object)null)
{
value.fx.transform.localScale = Vector3.one * num4;
}
}
}
}
}