using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using AK.Wwise;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.Bandit2;
using EntityStates.Barrel;
using EntityStates.BossGroupHealNovaController;
using EntityStates.BrotherMonster;
using EntityStates.CaptainSupplyDrop;
using EntityStates.Drifter;
using EntityStates.Engi.Mine;
using EntityStates.FalseSon;
using EntityStates.FalseSonBoss;
using EntityStates.FriendUnit;
using EntityStates.GoldGat;
using EntityStates.GolemMonster;
using EntityStates.Halcyonite;
using EntityStates.Headstompers;
using EntityStates.ImpBossMonster;
using EntityStates.JellyfishMonster;
using EntityStates.JunkCube;
using EntityStates.LaserTurbine;
using EntityStates.Mage;
using EntityStates.MinePod;
using EntityStates.Missions.Goldshores;
using EntityStates.MushroomShield;
using EntityStates.ParentMonster;
using EntityStates.QuestVolatileBattery;
using EntityStates.ScavMonster;
using EntityStates.Seeker;
using EntityStates.SharedSufferingOrb;
using EntityStates.SolusAmalgamator;
using EntityStates.SurvivorPod.BatteryPanel;
using EntityStates.TimedChest;
using EntityStates.VagrantMonster;
using EntityStates.VagrantNovaItem;
using EntityStates.Vehicles;
using HG;
using HG.Coroutines;
using HG.GeneralSerializer;
using HG.Reflection;
using IL.EntityStates;
using IL.EntityStates.Bandit2;
using IL.EntityStates.BrotherMonster;
using IL.EntityStates.CaptainSupplyDrop;
using IL.EntityStates.Chef;
using IL.EntityStates.Drifter;
using IL.EntityStates.Drone.DroneBombardment;
using IL.EntityStates.Drone.DroneJunk;
using IL.EntityStates.FalseSon;
using IL.EntityStates.FalseSonBoss;
using IL.EntityStates.GoldGat;
using IL.EntityStates.GolemMonster;
using IL.EntityStates.Halcyonite;
using IL.EntityStates.Headstompers;
using IL.EntityStates.ImpBossMonster;
using IL.EntityStates.JellyfishMonster;
using IL.EntityStates.JunkCube;
using IL.EntityStates.Mage;
using IL.EntityStates.ParentMonster;
using IL.EntityStates.RoboBallBoss.Weapon;
using IL.EntityStates.ScavMonster;
using IL.EntityStates.Seeker;
using IL.EntityStates.SolusAmalgamator;
using IL.EntityStates.TimedChest;
using IL.EntityStates.VagrantMonster;
using IL.EntityStates.VagrantNovaItem;
using IL.RoR2;
using IL.RoR2.Items;
using IL.RoR2.Orbs;
using IL.RoR2.Projectile;
using IL.RoR2.Stats;
using IL.RoR2.UI;
using IL.RoR2.UI.LogBook;
using IL.RoR2.VoidRaidCrab;
using ItemQualities;
using ItemQualities.Buffs;
using ItemQualities.Config;
using ItemQualities.ContentManagement;
using ItemQualities.Equipments;
using ItemQualities.Extensions;
using ItemQualities.Items;
using ItemQualities.ModCompatibility;
using ItemQualities.Networking;
using ItemQualities.Orbs;
using ItemQualities.Utilities;
using ItemQualities.Utilities.Extensions;
using KinematicCharacterController;
using Mono.Cecil;
using Mono.Cecil.Cil;
using Mono.Collections.Generic;
using MonoMod.Cil;
using MonoMod.RuntimeDetour;
using MonoMod.Utils;
using On.EntityStates.Drifter;
using On.EntityStates.FalseSon;
using On.EntityStates.LaserTurbine;
using On.EntityStates.Missions.Goldshores;
using On.EntityStates.SurvivorPod.BatteryPanel;
using On.EntityStates.TimedChest;
using On.RoR2;
using On.RoR2.Artifacts;
using On.RoR2.Items;
using On.RoR2.Orbs;
using On.RoR2.Projectile;
using On.RoR2.SolusWingGrid;
using On.RoR2.Stats;
using On.RoR2.UI;
using On.RoR2.UI.LogBook;
using R2API;
using R2API.Networking;
using R2API.Networking.Interfaces;
using R2API.Utils;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using RoR2.Artifacts;
using RoR2.Audio;
using RoR2.CharacterAI;
using RoR2.ContentManagement;
using RoR2.DirectionalSearch;
using RoR2.EntitlementManagement;
using RoR2.ExpansionManagement;
using RoR2.HudOverlay;
using RoR2.Items;
using RoR2.Navigation;
using RoR2.Orbs;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.SolusWingGrid;
using RoR2.UI;
using RoR2.UI.LogBook;
using RoR2.VoidRaidCrab;
using RoR2BepInExPack.GameAssetPaths.Version_1_39_0;
using RoR2BepInExPack.GameAssetPathsBetter;
using RoR2BepInExPack.Utilities;
using ShaderSwapper;
using TMPro;
using Unity;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Events;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.ResourceManagement.AsyncOperations;
using UnityEngine.Serialization;
using UnityEngine.UI;
using VultureHunter;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: NetworkCompatibility(/*Could not decode attribute arguments.*/)]
[assembly: OptIn]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace EntityStates.SprintArmorDash
{
public sealed class SprintArmorDashBounce : EntityState
{
private static readonly SphereSearch _dashSphereSearch = new SphereSearch();
private static EffectIndex _hitEffectIndex = (EffectIndex)(-1);
private CharacterBody _attachedBody;
[NonSerialized]
public Vector3 dashDirection;
[NonSerialized]
public Vector3 attackPos;
[SystemInitializer(new Type[] { typeof(EffectCatalogUtils) })]
private static void Init()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Invalid comparison between Unknown and I4
_hitEffectIndex = EffectCatalogUtils.FindEffectIndex("OmniImpactVFX");
if ((int)_hitEffectIndex == -1)
{
Log.Warning("Failed to find hit effect index", "D:\\Git\\RoR2\\ItemQualities\\ItemQualities\\Assets\\ItemQualities\\Scripts\\EntityStates\\SprintArmorDash\\SprintArmorDashBounce.cs", "Init", 33);
}
}
public override void OnSerialize(NetworkWriter writer)
{
//IL_0009: 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)
((EntityState)this).OnSerialize(writer);
writer.Write(dashDirection);
writer.Write(attackPos);
}
public override void OnDeserialize(NetworkReader reader)
{
//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_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)
((EntityState)this).OnDeserialize(reader);
dashDirection = reader.ReadVector3();
attackPos = reader.ReadVector3();
}
public override void OnEnter()
{
//IL_00df: 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_00f0: Unknown result type (might be due to invalid IL or missing references)
//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
//IL_0104: Unknown result type (might be due to invalid IL or missing references)
//IL_0109: Unknown result type (might be due to invalid IL or missing references)
//IL_0144: Unknown result type (might be due to invalid IL or missing references)
//IL_0149: Unknown result type (might be due to invalid IL or missing references)
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
//IL_01c6: Invalid comparison between Unknown and I4
//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0207: Unknown result type (might be due to invalid IL or missing references)
//IL_0218: Unknown result type (might be due to invalid IL or missing references)
//IL_0224: 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_0231: Unknown result type (might be due to invalid IL or missing references)
//IL_0236: Unknown result type (might be due to invalid IL or missing references)
//IL_023b: Unknown result type (might be due to invalid IL or missing references)
//IL_024c: Unknown result type (might be due to invalid IL or missing references)
//IL_0254: Unknown result type (might be due to invalid IL or missing references)
//IL_025b: 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_0265: Expected O, but got Unknown
//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
//IL_01e1: Expected O, but got Unknown
//IL_01ea: 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_0293: Unknown result type (might be due to invalid IL or missing references)
//IL_0298: Unknown result type (might be due to invalid IL or missing references)
//IL_027a: Unknown result type (might be due to invalid IL or missing references)
//IL_027f: Unknown result type (might be due to invalid IL or missing references)
((EntityState)this).OnEnter();
NetworkedBodyAttachment component = ((EntityState)this).GetComponent<NetworkedBodyAttachment>();
if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component.attachedBody))
{
return;
}
_attachedBody = component.attachedBody;
if (((EntityState)this).isAuthority)
{
IPhysMotor obj;
if (!Object.op_Implicit((Object)(object)_attachedBody.characterMotor))
{
obj = ((Component)_attachedBody).GetComponent<IPhysMotor>();
}
else
{
IPhysMotor characterMotor = (IPhysMotor)(object)_attachedBody.characterMotor;
obj = characterMotor;
}
if (obj != null)
{
PhysForceInfo val = default(PhysForceInfo);
((PhysForceInfo)(ref val)).resetVelocity = true;
val.force = new Vector3((0f - dashDirection.x) * 20f, 20f, (0f - dashDirection.z) * 20f);
((PhysForceInfo)(ref val)).ignoreGroundStick = true;
((PhysForceInfo)(ref val)).massIsOne = true;
obj.ApplyForceImpulse(ref val);
}
base.outer.SetNextStateToMain();
}
if (!NetworkServer.active)
{
return;
}
List<HurtBox> list = default(List<HurtBox>);
DisposableRental<HurtBox, List<HurtBox>> val2 = CollectionPool<HurtBox, List<HurtBox>>.RentCollection(ref list);
try
{
_dashSphereSearch.origin = _attachedBody.corePosition;
_dashSphereSearch.mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask;
_dashSphereSearch.radius = _attachedBody.radius + 12f;
_dashSphereSearch.RefreshCandidates();
_dashSphereSearch.FilterCandidatesByHurtBoxTeam(TeamMask.GetUnprotectedTeams(_attachedBody.teamComponent.teamIndex));
_dashSphereSearch.FilterCandidatesByDistinctHurtBoxEntities();
_dashSphereSearch.GetHurtBoxes(list);
_dashSphereSearch.ClearCandidates();
SetStateOnHurt val5 = default(SetStateOnHurt);
foreach (HurtBox item in list)
{
if (Object.op_Implicit((Object)(object)item) && Object.op_Implicit((Object)(object)item.healthComponent) && Object.op_Implicit((Object)(object)item.healthComponent.body))
{
if ((int)_hitEffectIndex != -1)
{
EffectData val3 = new EffectData
{
origin = ((Component)item).transform.position
};
val3.SetHurtBoxReference(item);
EffectManager.SpawnEffect(_hitEffectIndex, val3, true);
}
DamageInfo val4 = new DamageInfo
{
damage = 0f,
attacker = ((Component)_attachedBody).gameObject,
inflictor = ((EntityState)this).gameObject,
procCoefficient = 0f,
position = attackPos,
crit = _attachedBody.RollCrit(),
inflictedHurtbox = item,
canRejectForce = false,
physForceFlags = (PhysForceFlags)15
};
if (item.healthComponent.body.isChampion)
{
val4.force = Vector3.zero;
}
else
{
val4.force = dashDirection * 50f;
}
item.healthComponent.TakeDamageForce(val4, false, false);
GlobalEventManager.instance.OnHitEnemy(val4, ((Component)item.healthComponent).gameObject);
GlobalEventManager.instance.OnHitAll(val4, ((Component)item.healthComponent).gameObject);
if (((Component)item.healthComponent).TryGetComponent<SetStateOnHurt>(ref val5) && val5.canBeStunned)
{
val5.SetStun(1f);
Crowbar.HandleDelayedHit(((Component)_attachedBody).gameObject, ((Component)item).gameObject);
}
ItemQualityCounts itemCountsEffective = _attachedBody.inventory.GetItemCountsEffective(ItemQualitiesContent.ItemQualityGroups.SprintArmor);
float num = itemCountsEffective.UncommonCount * 3 + itemCountsEffective.RareCount * 6 + itemCountsEffective.EpicCount * 9 + itemCountsEffective.LegendaryCount * 12;
item.healthComponent.body.AddTimedBuff(ItemQualitiesContent.Buffs.SprintArmorWeaken, num);
}
}
}
finally
{
val2.Dispose();
}
}
}
public sealed class SprintArmorDashDashingState : EntityState
{
private static readonly SphereSearch _dashSphereSearch = new SphereSearch();
private static EffectIndex _blinkEffectIndex;
private CharacterBody _attachedBody;
private IPhysMotor _motor;
private Vector3 _dashDirection;
private bool _stoppedDash;
[SystemInitializer(new Type[] { typeof(EffectCatalogUtils) })]
private static void Init()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Invalid comparison between Unknown and I4
_blinkEffectIndex = EffectCatalogUtils.FindEffectIndex("HuntressBlinkEffect");
if ((int)_blinkEffectIndex == -1)
{
Log.Warning("Failed to find blink effect index", "D:\\Git\\RoR2\\ItemQualities\\ItemQualities\\Assets\\ItemQualities\\Scripts\\EntityStates\\SprintArmorDash\\SprintArmorDashDashingState.cs", "Init", 29);
}
}
public override void OnEnter()
{
//IL_003b: 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_0120: Unknown result type (might be due to invalid IL or missing references)
//IL_0126: Expected O, but got Unknown
//IL_0128: Unknown result type (might be due to invalid IL or missing references)
//IL_012d: Unknown result type (might be due to invalid IL or missing references)
//IL_0132: Unknown result type (might be due to invalid IL or missing references)
//IL_013e: Unknown result type (might be due to invalid IL or missing references)
//IL_0148: Unknown result type (might be due to invalid IL or missing references)
((EntityState)this).OnEnter();
NetworkedBodyAttachment component = ((EntityState)this).GetComponent<NetworkedBodyAttachment>();
if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component.attachedBody))
{
return;
}
_attachedBody = component.attachedBody;
_dashDirection = _attachedBody.inputBank.aimDirection;
IPhysMotor motor;
if (!Object.op_Implicit((Object)(object)_attachedBody.characterMotor))
{
motor = ((Component)_attachedBody).GetComponent<IPhysMotor>();
}
else
{
IPhysMotor characterMotor = (IPhysMotor)(object)_attachedBody.characterMotor;
motor = characterMotor;
}
_motor = motor;
if (((EntityState)this).isAuthority)
{
_attachedBody.isSprinting = true;
}
if (NetworkServer.active)
{
int num = _attachedBody.inventory.GetItemCountsEffective(ItemQualitiesContent.ItemQualityGroups.SprintArmor).HighestQuality switch
{
QualityTier.Uncommon => 20,
QualityTier.Rare => 15,
QualityTier.Epic => 10,
QualityTier.Legendary => 5,
_ => 30,
};
for (int i = 0; i < num; i++)
{
_attachedBody.AddTimedBuff(ItemQualitiesContent.Buffs.SprintArmorDashCooldown, (float)i);
}
_attachedBody.AddBuff(Buffs.IgnoreFallDamage);
}
EffectData val = new EffectData();
val.rotation = Util.QuaternionSafeLookRotation(_dashDirection);
val.origin = _attachedBody.corePosition;
EffectManager.SpawnEffect(_blinkEffectIndex, val, false);
}
public override void OnExit()
{
if (NetworkServer.active && Object.op_Implicit((Object)(object)_attachedBody))
{
_attachedBody.RemoveBuff(Buffs.IgnoreFallDamage);
_attachedBody.AddTimedBuff(Buffs.IgnoreFallDamage, 0.2f);
}
((EntityState)this).OnExit();
}
public override void FixedUpdate()
{
//IL_006a: 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_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_009c: Unknown result type (might be due to invalid IL or missing references)
//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
//IL_00e2: 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)
((EntityState)this).FixedUpdate();
if (!Object.op_Implicit((Object)(object)_attachedBody))
{
if (((EntityState)this).isAuthority)
{
base.outer.SetNextStateToMain();
}
return;
}
if (NetworkServer.active)
{
_attachedBody.isSprinting = true;
}
if (_attachedBody.hasEffectiveAuthority && _motor != null)
{
PhysForceInfo val;
if (((EntityState)this).fixedAge < 0.1f)
{
IPhysMotor motor = _motor;
val = default(PhysForceInfo);
((PhysForceInfo)(ref val)).resetVelocity = true;
val.force = _dashDirection * (Time.deltaTime * _attachedBody.moveSpeed * 1000f);
((PhysForceInfo)(ref val)).ignoreGroundStick = true;
((PhysForceInfo)(ref val)).massIsOne = true;
motor.ApplyForceImpulse(ref val);
}
else if (!_stoppedDash)
{
_stoppedDash = true;
IPhysMotor motor2 = _motor;
val = default(PhysForceInfo);
((PhysForceInfo)(ref val)).resetVelocity = true;
val.force = _dashDirection * (_attachedBody.moveSpeed * 3f);
((PhysForceInfo)(ref val)).ignoreGroundStick = true;
((PhysForceInfo)(ref val)).massIsOne = true;
motor2.ApplyForceImpulse(ref val);
}
}
if (((EntityState)this).isAuthority)
{
if (((EntityState)this).fixedAge > 0.2f)
{
base.outer.SetNextStateToMain();
}
tryAttack();
}
}
private void tryAttack()
{
//IL_0002: 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_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_0027: 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_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_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_00ba: 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)
List<HurtBox> list = default(List<HurtBox>);
DisposableRental<HurtBox, List<HurtBox>> val = CollectionPool<HurtBox, List<HurtBox>>.RentCollection(ref list);
try
{
_dashSphereSearch.origin = _attachedBody.corePosition;
_dashSphereSearch.mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask;
_dashSphereSearch.radius = _attachedBody.radius + 3f;
_dashSphereSearch.RefreshCandidates();
_dashSphereSearch.FilterCandidatesByHurtBoxTeam(TeamMask.GetUnprotectedTeams(_attachedBody.teamComponent.teamIndex));
_dashSphereSearch.FilterCandidatesByDistinctHurtBoxEntities();
_dashSphereSearch.GetHurtBoxes(list);
_dashSphereSearch.ClearCandidates();
if (list.Count > 0)
{
SprintArmorDashBounce sprintArmorDashBounce = new SprintArmorDashBounce();
sprintArmorDashBounce.attackPos = _attachedBody.corePosition;
sprintArmorDashBounce.dashDirection = _dashDirection;
base.outer.SetNextState((EntityState)(object)sprintArmorDashBounce);
}
}
finally
{
val.Dispose();
}
}
}
public sealed class SprintArmorDashIdle : EntityState
{
public static float DoubleTapWindow;
private float _lastValidInputTime = float.NegativeInfinity;
private CharacterBody _attachedBody;
public override void OnEnter()
{
((EntityState)this).OnEnter();
NetworkedBodyAttachment component = ((EntityState)this).GetComponent<NetworkedBodyAttachment>();
if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.attachedBody))
{
_attachedBody = component.attachedBody;
}
}
public override void Update()
{
((EntityState)this).Update();
if (Object.op_Implicit((Object)(object)_attachedBody) && ((EntityState)this).isAuthority)
{
UpdateAuthority();
}
}
private void UpdateAuthority()
{
if (!_attachedBody.HasBuff(ItemQualitiesContent.Buffs.SprintArmorDashCooldown) && ((ButtonState)(ref _attachedBody.inputBank.rawMoveUp)).justPressed)
{
if (((EntityState)this).age - _lastValidInputTime <= DoubleTapWindow)
{
base.outer.SetNextState((EntityState)(object)new SprintArmorDashDashingState());
}
_lastValidInputTime = ((EntityState)this).age;
}
}
}
}
namespace EntityStates.SharedSufferingOrb
{
public sealed class SharedSufferingOrbDeath : EntityState
{
private static GameObject _deathEffectPrefab;
public static float ExplosionDamageCoefficient;
public static float ExplosionForce;
[ContentInitializer]
private static IEnumerator LoadContent(ContentInitializerArgs args)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
AsyncOperationHandle<GameObject> handle = AddressableUtil.LoadTempAssetAsync<GameObject>(RoR2_Base_WeeklyRun.TimeCrystalDeath_prefab);
handle.OnSuccess(delegate(GameObject timeCrystalDeath)
{
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Expected O, but got Unknown
_deathEffectPrefab = PrefabAPI.InstantiateClone(timeCrystalDeath, "SharedSufferingOrbDeathEffect", false);
args.ContentPack.effectDefs.Add<EffectDef>(new EffectDef(_deathEffectPrefab));
});
return handle.AsProgressCoroutine<GameObject, ReadableProgress<float>>(args.ProgressReceiver);
}
public override void OnEnter()
{
((EntityState)this).OnEnter();
explode();
}
private void explode()
{
//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_0095: Unknown result type (might be due to invalid IL or missing references)
//IL_009f: Unknown result type (might be due to invalid IL or missing references)
//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
//IL_00b7: Expected O, but got Unknown
//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_010d: 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_0159: Unknown result type (might be due to invalid IL or missing references)
//IL_0187: 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_0199: Unknown result type (might be due to invalid IL or missing references)
//IL_019e: Unknown result type (might be due to invalid IL or missing references)
//IL_01a5: 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_01b9: Unknown result type (might be due to invalid IL or missing references)
//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0205: Unknown result type (might be due to invalid IL or missing references)
//IL_020a: 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)
//IL_0211: Unknown result type (might be due to invalid IL or missing references)
//IL_0215: 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_022a: 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_0234: 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: Expected O, but got Unknown
//IL_0247: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)((EntityState)this).modelLocator))
{
if (Object.op_Implicit((Object)(object)((EntityState)this).modelLocator.modelBaseTransform))
{
EntityState.Destroy((Object)(object)((Component)((EntityState)this).modelLocator.modelBaseTransform).gameObject);
}
if (Object.op_Implicit((Object)(object)((EntityState)this).modelLocator.modelTransform))
{
EntityState.Destroy((Object)(object)((Component)((EntityState)this).modelLocator.modelTransform).gameObject);
}
}
SharedSufferingOrbController component = ((EntityState)this).GetComponent<SharedSufferingOrbController>();
float num = (Object.op_Implicit((Object)(object)component) ? component.BlastRadius : 0f);
if (Object.op_Implicit((Object)(object)_deathEffectPrefab))
{
EffectManager.SpawnEffect(_deathEffectPrefab, new EffectData
{
origin = ((EntityState)this).transform.position,
scale = num,
rotation = Quaternion.identity
}, false);
}
if (NetworkServer.active)
{
GenericOwnership component2 = ((EntityState)this).GetComponent<GenericOwnership>();
GameObject val = (Object.op_Implicit((Object)(object)component2) ? component2.ownerObject : null);
CharacterBody val2 = (Object.op_Implicit((Object)(object)val) ? val.GetComponent<CharacterBody>() : null);
TeamIndex val3 = (TeamIndex)((!Object.op_Implicit((Object)(object)val2)) ? (-1) : ((int)val2.teamComponent.teamIndex));
Vector3 position = ((EntityState)this).transform.position;
float damage = ExplosionDamageCoefficient * (Object.op_Implicit((Object)(object)val2) ? val2.damage : Run.instance.teamlessDamageCoefficient);
foreach (CharacterBody readOnlyInstances in CharacterBody.readOnlyInstancesList)
{
if (FriendlyFireManager.ShouldSplashHitProceed(readOnlyInstances.healthComponent, val3) && !((Object)(object)readOnlyInstances == (Object)(object)val2) && !((Object)(object)readOnlyInstances == (Object)(object)((EntityState)this).characterBody) && !(Vector3.Distance(readOnlyInstances.corePosition, position) >= num))
{
DamageInfo val4 = new DamageInfo
{
attacker = val,
inflictor = ((EntityState)this).gameObject,
damage = damage,
crit = (Object.op_Implicit((Object)(object)val2) && val2.RollCrit()),
damageType = DamageTypeCombo.op_Implicit((DamageType)131072),
damageColorIndex = (DamageColorIndex)16,
procCoefficient = 0f,
position = position
};
float explosionForce = ExplosionForce;
Vector3 val5 = readOnlyInstances.corePosition - position;
val4.force = explosionForce * ((Vector3)(ref val5)).normalized + ExplosionForce * 0.5f * Vector3.up;
DamageInfo val6 = val4;
DamageAPI.AddModdedDamageType(ref val6.damageType, DamageTypes.ForceAddToSharedSuffering);
readOnlyInstances.healthComponent.TakeDamage(val6);
GlobalEventManager.instance.OnHitEnemy(val6, ((Component)readOnlyInstances).gameObject);
GlobalEventManager.instance.OnHitAll(val6, ((Component)readOnlyInstances).gameObject);
}
}
}
EntityState.Destroy((Object)(object)((EntityState)this).gameObject);
}
public override InterruptPriority GetMinimumInterruptPriority()
{
return (InterruptPriority)9;
}
}
}
namespace EntityStates.QuestVolatileBattery
{
public class QuestVolatileBatteryQualityMonitor : QuestVolatileBatteryBaseState
{
[NonSerialized]
public static GameObject qualityBatteryPreDet;
private GameObject _vfxInstance;
[ContentInitializer]
private static IEnumerator LoadContent(ContentInitializerArgs args)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
AsyncOperationHandle<GameObject> handle = AddressableUtil.LoadTempAssetAsync<GameObject>(RoR2_Base_QuestVolatileBattery.VolatileBatteryPreDetonation_prefab);
handle.OnSuccess(delegate(GameObject VolatileBatteryPreDetPrefab)
{
//IL_017c: 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_0191: 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)
qualityBatteryPreDet = PrefabAPI.InstantiateClone(VolatileBatteryPreDetPrefab, "QualityVolatileBatteryPreDet", false);
ShakeEmitter val = default(ShakeEmitter);
if (qualityBatteryPreDet.TryGetComponent<ShakeEmitter>(ref val))
{
Object.Destroy((Object)(object)val);
}
LoopSound val2 = default(LoopSound);
if (qualityBatteryPreDet.TryGetComponent<LoopSound>(ref val2))
{
Object.Destroy((Object)(object)val2);
}
Transform val3 = qualityBatteryPreDet.transform.Find("PP");
if (Object.op_Implicit((Object)(object)val3))
{
Object.Destroy((Object)(object)((Component)val3).gameObject);
}
Transform val4 = qualityBatteryPreDet.transform.Find("LightShafts");
if (Object.op_Implicit((Object)(object)val4))
{
Object.Destroy((Object)(object)((Component)val4).gameObject);
}
Transform val5 = qualityBatteryPreDet.transform.Find("Pulse");
if (Object.op_Implicit((Object)(object)val5))
{
Object.Destroy((Object)(object)((Component)val5).gameObject);
}
if (Object.op_Implicit((Object)(object)qualityBatteryPreDet.transform.Find("Lightning")))
{
Object.Destroy((Object)(object)((Component)val5).gameObject);
}
if (Object.op_Implicit((Object)(object)qualityBatteryPreDet.transform.Find("Flames")))
{
Object.Destroy((Object)(object)((Component)val5).gameObject);
}
if (Object.op_Implicit((Object)(object)qualityBatteryPreDet.transform.Find("ShakeEmitter")))
{
Object.Destroy((Object)(object)((Component)val5).gameObject);
}
if (Object.op_Implicit((Object)(object)qualityBatteryPreDet.transform.Find("Mesh Pulse")))
{
Object.Destroy((Object)(object)((Component)val5).gameObject);
}
Transform val6 = qualityBatteryPreDet.transform.Find("Sparks, Trail");
ParticleSystem val7 = default(ParticleSystem);
if (Object.op_Implicit((Object)(object)val6) && ((Component)val6).TryGetComponent<ParticleSystem>(ref val7))
{
MainModule main = val7.main;
((MainModule)(ref main)).simulationSpeed = 0.5f;
EmissionModule emission = val7.emission;
((EmissionModule)(ref emission)).rateOverTimeMultiplier = 10f;
}
args.ContentPack.prefabs.Add<GameObject>(qualityBatteryPreDet);
});
return handle.AsProgressCoroutine<GameObject, ReadableProgress<float>>(args.ProgressReceiver);
}
public override void OnEnter()
{
//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_004b: 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)
((QuestVolatileBatteryBaseState)this).OnEnter();
_vfxInstance = Object.Instantiate<GameObject>(qualityBatteryPreDet, ((QuestVolatileBatteryBaseState)this).networkedBodyAttachment.attachedBody.transform);
_vfxInstance.transform.SetLocalPositionAndRotation(Vector3.zero, Quaternion.identity);
_vfxInstance.transform.localScale = Vector3.one * ((QuestVolatileBatteryBaseState)this).networkedBodyAttachment.attachedBody.bestFitActualRadius;
}
public override void OnExit()
{
((EntityState)this).OnExit();
if (Object.op_Implicit((Object)(object)_vfxInstance))
{
EntityState.Destroy((Object)(object)_vfxInstance);
}
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
if (NetworkServer.active)
{
FixedUpdateServer();
}
}
private void FixedUpdateServer()
{
if (Object.op_Implicit((Object)(object)((QuestVolatileBatteryBaseState)this).attachedHealthComponent) && ((QuestVolatileBatteryBaseState)this).attachedHealthComponent.combinedHealthFraction <= 0.5f)
{
((EntityState)this).outer.SetNextState((EntityState)(object)new QuestVolatileBatteryQualityCountDown());
}
}
}
public class QuestVolatileBatteryQualityCountDown : QuestVolatileBatteryBaseState
{
public static float duration;
public static float explosionRadius;
private GameObject _vfxInstance;
[NonSerialized]
public static GameObject vfxPrefab;
[SystemInitializer(new Type[] { })]
private static void Init()
{
//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)
AsyncOperationHandle<GameObject> handle = AddressableUtil.LoadAssetAsync<GameObject>(RoR2_Base_QuestVolatileBattery.VolatileBatteryPreDetonation_prefab, (AsyncReferenceHandleUnloadType)2);
handle.OnSuccess(delegate(GameObject VolatileBatteryPreDetonation)
{
vfxPrefab = VolatileBatteryPreDetonation;
});
}
public override void OnEnter()
{
//IL_0046: 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_0066: 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)
((QuestVolatileBatteryBaseState)this).OnEnter();
if (Object.op_Implicit((Object)(object)vfxPrefab) && Object.op_Implicit((Object)(object)((QuestVolatileBatteryBaseState)this).networkedBodyAttachment.attachedBody))
{
GameObject val = Object.Instantiate<GameObject>(vfxPrefab, ((QuestVolatileBatteryBaseState)this).networkedBodyAttachment.attachedBody.transform);
val.transform.localPosition = Vector3.zero;
val.transform.localRotation = Quaternion.identity;
val.transform.localScale = Vector3.one * ((QuestVolatileBatteryBaseState)this).networkedBodyAttachment.attachedBody.bestFitActualRadius;
_vfxInstance = val;
}
}
public override void OnExit()
{
if (Object.op_Implicit((Object)(object)_vfxInstance))
{
EntityState.Destroy((Object)(object)_vfxInstance);
}
((EntityState)this).OnExit();
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
if (NetworkServer.active)
{
FixedUpdateServer();
}
}
private void FixedUpdateServer()
{
if (((EntityState)this).fixedAge >= duration)
{
ItemQualities.Equipments.QuestVolatileBattery.Detonate(((EntityState)this).gameObject, isPickup: false);
}
}
}
}
namespace EntityStates.MushroomShield
{
public abstract class MushroomBubbleBaseState : EntityState
{
[NonSerialized]
public float EffectRadius;
public override void OnSerialize(NetworkWriter writer)
{
((EntityState)this).OnSerialize(writer);
writer.Write(EffectRadius);
}
public override void OnDeserialize(NetworkReader reader)
{
((EntityState)this).OnDeserialize(reader);
EffectRadius = reader.ReadSingle();
}
public override void ModifyNextState(EntityState nextState)
{
((EntityState)this).ModifyNextState(nextState);
if (nextState is MushroomBubbleBaseState mushroomBubbleBaseState)
{
mushroomBubbleBaseState.EffectRadius = EffectRadius;
}
}
public abstract void Undeploy(bool immediate);
}
public sealed class MushroomBubbleDeploy : MushroomBubbleBaseState
{
public static string StartSoundString;
private CharacterBody _ownerBody;
private float _startMoveStopwatchValue;
private float _undeployLifetime;
public override void OnEnter()
{
//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
//IL_0102: Unknown result type (might be due to invalid IL or missing references)
((EntityState)this).OnEnter();
Util.PlaySound(StartSoundString, ((EntityState)this).gameObject);
GenericOwnership component = ((EntityState)this).GetComponent<GenericOwnership>();
if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component.ownerObject))
{
return;
}
_ownerBody = component.ownerObject.GetComponent<CharacterBody>();
if (Object.op_Implicit((Object)(object)_ownerBody) && Object.op_Implicit((Object)(object)_ownerBody.inventory))
{
ItemQualityCounts itemCountsEffective = _ownerBody.inventory.GetItemCountsEffective(ItemQualitiesContent.ItemQualityGroups.Mushroom);
_undeployLifetime = itemCountsEffective.UncommonCount + 3 * itemCountsEffective.RareCount + 6 * itemCountsEffective.EpicCount + 12 * itemCountsEffective.LegendaryCount;
float num = 30f;
switch (itemCountsEffective.HighestQuality)
{
case QualityTier.Uncommon:
num = 30f;
break;
case QualityTier.Rare:
num = 25f;
break;
case QualityTier.Epic:
num = 20f;
break;
case QualityTier.Legendary:
num = 15f;
break;
}
EffectRadius = num;
((EntityState)this).transform.localScale = Vector3.one * (num / 20f);
_startMoveStopwatchValue = _ownerBody.notMovingStopwatch;
}
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
if (((EntityState)this).isAuthority && (!Object.op_Implicit((Object)(object)_ownerBody) || !Object.op_Implicit((Object)(object)_ownerBody.healthComponent) || !_ownerBody.healthComponent.alive || _ownerBody.notMovingStopwatch < _startMoveStopwatchValue))
{
Undeploy(immediate: false);
}
}
public override void Undeploy(bool immediate)
{
if (((EntityState)this).isAuthority)
{
if (immediate)
{
((EntityState)this).outer.SetNextState((EntityState)(object)new MushroomBubbleFlashOut());
return;
}
((EntityState)this).outer.SetNextState((EntityState)(object)new MushroomBubbleUndeploy
{
Duration = _undeployLifetime
});
}
}
}
public sealed class MushroomBubbleFlashOut : MushroomBubbleBaseState
{
private static EffectIndex _bubbleShieldEndEffect = (EffectIndex)(-1);
public static string EndSoundString;
public static float Duration;
private BeginRapidlyActivatingAndDeactivating _blinkController;
[SystemInitializer(new Type[] { typeof(EffectCatalogUtils) })]
private static void Init()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Invalid comparison between Unknown and I4
_bubbleShieldEndEffect = EffectCatalogUtils.FindEffectIndex("BubbleShieldEndEffect");
if ((int)_bubbleShieldEndEffect == -1)
{
Log.Warning("Failed to find charge effect index", "D:\\Git\\RoR2\\ItemQualities\\ItemQualities\\Assets\\ItemQualities\\Scripts\\EntityStates\\MushroomShield\\MushroomBubbleFlashOut.cs", "Init", 16);
}
}
public override void OnEnter()
{
((EntityState)this).OnEnter();
_blinkController = ((EntityState)this).GetComponent<BeginRapidlyActivatingAndDeactivating>();
if (Object.op_Implicit((Object)(object)_blinkController))
{
_blinkController.delayBeforeBeginningBlinking = 0f;
_blinkController.fixedAge = 0f;
((Behaviour)_blinkController).enabled = true;
}
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= Duration)
{
EntityState.Destroy((Object)(object)((EntityState)this).gameObject);
}
}
public override void OnExit()
{
//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_0010: 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_0021: 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_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Expected O, but got Unknown
((EntityState)this).OnExit();
EffectManager.SpawnEffect(_bubbleShieldEndEffect, new EffectData
{
origin = ((EntityState)this).transform.position,
rotation = ((EntityState)this).transform.rotation,
scale = EffectRadius
}, false);
Util.PlaySound(EndSoundString, ((EntityState)this).gameObject);
if (Object.op_Implicit((Object)(object)_blinkController))
{
((Behaviour)_blinkController).enabled = false;
}
}
public override void Undeploy(bool immediate)
{
}
}
public sealed class MushroomBubbleUndeploy : MushroomBubbleBaseState
{
[NonSerialized]
public float Duration;
public override void OnSerialize(NetworkWriter writer)
{
base.OnSerialize(writer);
writer.Write(Duration);
}
public override void OnDeserialize(NetworkReader reader)
{
base.OnDeserialize(reader);
Duration = reader.ReadSingle();
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= Duration - MushroomBubbleFlashOut.Duration)
{
Undeploy(immediate: true);
}
}
public override void Undeploy(bool immediate)
{
if (((EntityState)this).isAuthority && immediate)
{
((EntityState)this).outer.SetNextState((EntityState)(object)new MushroomBubbleFlashOut());
}
}
}
}
namespace EntityStates.FriendUnit
{
public sealed class FriendUnitPunt : BaseState
{
public static float BaseVelocity;
public static float MaxLockOnAngle;
public static float MaxDistance;
public static float LaunchHorizontalSpeedMultiplier;
public static string PuntSound;
[NonSerialized]
public GameObject Punter;
[NonSerialized]
public Ray AimRay;
public override void OnSerialize(NetworkWriter writer)
{
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
((EntityState)this).OnSerialize(writer);
writer.Write(Punter);
writer.Write(AimRay);
}
public override void OnDeserialize(NetworkReader reader)
{
//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)
((EntityState)this).OnDeserialize(reader);
Punter = reader.ReadGameObject();
AimRay = reader.ReadRay();
}
public override void OnEnter()
{
//IL_0041: 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_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_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_0068: 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_0076: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0088: 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_0095: 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_009c: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
//IL_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_00b2: Unknown result type (might be due to invalid IL or missing references)
//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
//IL_00f7: 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_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_0133: 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_00f6: Unknown result type (might be due to invalid IL or missing references)
//IL_0152: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0174: Unknown result type (might be due to invalid IL or missing references)
//IL_0197: 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_01a1: Unknown result type (might be due to invalid IL or missing references)
//IL_01da: Unknown result type (might be due to invalid IL or missing references)
//IL_01e4: Expected O, but got Unknown
if (((EntityState)this).isAuthority)
{
((EntityState)this).characterBody.isSprinting = true;
}
((BaseState)this).OnEnter();
if (((EntityState)this).isAuthority)
{
CharacterBody val = (Object.op_Implicit((Object)(object)Punter) ? Punter.GetComponent<CharacterBody>() : null);
BullseyeSearch val2 = new BullseyeSearch
{
searchOrigin = ((Ray)(ref AimRay)).origin,
searchDirection = ((Ray)(ref AimRay)).direction,
viewer = val,
filterByLoS = true,
filterByDistinctEntity = true,
maxAngleFilter = MaxLockOnAngle,
maxDistanceFilter = MaxDistance,
sortMode = (SortMode)2,
queryTriggerInteraction = (QueryTriggerInteraction)1,
teamMaskFilter = TeamMask.GetEnemyTeams(TeamComponent.GetObjectTeam(Punter))
};
val2.RefreshCandidates();
IPhysMotor val3 = null;
if (Object.op_Implicit((Object)(object)val))
{
IPhysMotor obj;
if (!Object.op_Implicit((Object)(object)val.characterMotor))
{
obj = ((Component)val).GetComponent<IPhysMotor>();
}
else
{
IPhysMotor characterMotor = (IPhysMotor)(object)val.characterMotor;
obj = characterMotor;
}
val3 = obj;
}
Vector3 val4 = Vector3.zero;
if (val3 != null)
{
val4 = val3.velocity;
}
Vector3 val5 = val4;
val5.y = 0f;
float num = ((Vector3)(ref val5)).magnitude + BaseVelocity + base.moveSpeedStat * LaunchHorizontalSpeedMultiplier;
Vector3 force = ((Ray)(ref AimRay)).direction * num;
using (IEnumerator<HurtBox> enumerator = val2.GetResults().GetEnumerator())
{
if (enumerator.MoveNext())
{
HurtBox current = enumerator.Current;
force = Trajectory.CalculateInitialVelocityFromHSpeed(((EntityState)this).transform.position, ((Component)current).transform.position, num, 0f, float.PositiveInfinity);
}
}
CharacterMotor characterMotor2 = ((EntityState)this).characterMotor;
PhysForceInfo val6 = new PhysForceInfo
{
force = force
};
((PhysForceInfo)(ref val6)).massIsOne = true;
((PhysForceInfo)(ref val6)).disableAirControlUntilCollision = true;
((PhysForceInfo)(ref val6)).resetVelocity = true;
((PhysForceInfo)(ref val6)).ignoreGroundStick = true;
characterMotor2.ApplyForceImpulse(ref val6);
((EntityState)this).characterMotor.onMovementHit += new MovementHitDelegate(onMovementHit);
}
Util.PlaySound(PuntSound, ((EntityState)this).gameObject);
}
public override void OnExit()
{
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Expected O, but got Unknown
((EntityState)this).OnExit();
if (((EntityState)this).isAuthority)
{
((EntityState)this).characterBody.isSprinting = false;
((EntityState)this).characterMotor.onMovementHit -= new MovementHitDelegate(onMovementHit);
}
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
if (((EntityState)this).isAuthority)
{
((EntityState)this).characterBody.isSprinting = true;
}
}
private void onMovementHit(ref MovementHitInfo movementHitInfo)
{
//IL_0019: 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)
//IL_002a: 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)
((EntityState)this).outer.SetNextState((EntityState)(object)new FriendUnitPuntImpact
{
Punter = Punter,
ImpactPoint = movementHitInfo.hitPoint,
ImpactNormal = movementHitInfo.hitNormal,
ImpactVelocity = movementHitInfo.velocity,
DamageMultiplierFromSpeed = Mathf.Max(1f, ((Vector3)(ref movementHitInfo.velocity)).magnitude / base.moveSpeedStat)
});
}
public override InterruptPriority GetMinimumInterruptPriority()
{
return (InterruptPriority)7;
}
}
public sealed class FriendUnitPuntImpact : BaseState
{
private static EffectIndex _explosionEffectIndex = (EffectIndex)(-1);
public static float ImpactBounciness;
public static string ImpactSoundString;
public static float ReturnVelocityMaxAngleDelta;
public static float ReturnVelocityMaxMagnitudeMultiplier = 1f;
[NonSerialized]
public GameObject Punter;
[NonSerialized]
public Vector3 ImpactPoint;
[NonSerialized]
public Vector3 ImpactNormal;
[NonSerialized]
public Vector3 ImpactVelocity;
[NonSerialized]
public float DamageMultiplierFromSpeed;
[SystemInitializer(new Type[] { typeof(EffectCatalogUtils) })]
private static void Init()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Invalid comparison between Unknown and I4
_explosionEffectIndex = EffectCatalogUtils.FindEffectIndex("OmniExplosionVFXRoboBallDeath");
if ((int)_explosionEffectIndex == -1)
{
Log.Error("Failed to find explosion effect index", "D:\\Git\\RoR2\\ItemQualities\\ItemQualities\\Assets\\ItemQualities\\Scripts\\EntityStates\\FriendUnit\\FriendUnitPuntImpact.cs", "Init", 21);
}
}
public override void OnSerialize(NetworkWriter writer)
{
//IL_0015: 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_002d: Unknown result type (might be due to invalid IL or missing references)
((EntityState)this).OnSerialize(writer);
writer.Write(Punter);
writer.Write(ImpactPoint);
writer.Write(ImpactNormal);
writer.Write(ImpactVelocity);
writer.Write(DamageMultiplierFromSpeed);
}
public override void OnDeserialize(NetworkReader reader)
{
//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_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_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
((EntityState)this).OnDeserialize(reader);
Punter = reader.ReadGameObject();
ImpactPoint = reader.ReadVector3();
ImpactNormal = reader.ReadVector3();
ImpactVelocity = reader.ReadVector3();
DamageMultiplierFromSpeed = reader.ReadSingle();
}
public override void OnEnter()
{
//IL_022e: Unknown result type (might be due to invalid IL or missing references)
//IL_0234: 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_0250: Unknown result type (might be due to invalid IL or missing references)
//IL_0255: Unknown result type (might be due to invalid IL or missing references)
//IL_0273: Unknown result type (might be due to invalid IL or missing references)
//IL_0278: Unknown result type (might be due to invalid IL or missing references)
//IL_0268: Unknown result type (might be due to invalid IL or missing references)
//IL_026d: Unknown result type (might be due to invalid IL or missing references)
//IL_02be: Unknown result type (might be due to invalid IL or missing references)
//IL_02c9: Unknown result type (might be due to invalid IL or missing references)
//IL_02ce: Unknown result type (might be due to invalid IL or missing references)
//IL_028a: Unknown result type (might be due to invalid IL or missing references)
//IL_0290: Unknown result type (might be due to invalid IL or missing references)
//IL_0295: Unknown result type (might be due to invalid IL or missing references)
//IL_02af: Unknown result type (might be due to invalid IL or missing references)
//IL_02b4: Unknown result type (might be due to invalid IL or missing references)
//IL_0135: Unknown result type (might be due to invalid IL or missing references)
//IL_013a: Unknown result type (might be due to invalid IL or missing references)
//IL_013c: Unknown result type (might be due to invalid IL or missing references)
//IL_0141: Unknown result type (might be due to invalid IL or missing references)
//IL_0146: 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_0162: Unknown result type (might be due to invalid IL or missing references)
//IL_0165: Unknown result type (might be due to invalid IL or missing references)
//IL_016c: Unknown result type (might be due to invalid IL or missing references)
//IL_0171: Unknown result type (might be due to invalid IL or missing references)
//IL_0176: Unknown result type (might be due to invalid IL or missing references)
//IL_0182: Unknown result type (might be due to invalid IL or missing references)
//IL_0393: Unknown result type (might be due to invalid IL or missing references)
//IL_039b: Unknown result type (might be due to invalid IL or missing references)
//IL_039d: Unknown result type (might be due to invalid IL or missing references)
//IL_02e6: Unknown result type (might be due to invalid IL or missing references)
//IL_02f6: 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_0315: Unknown result type (might be due to invalid IL or missing references)
//IL_0332: Unknown result type (might be due to invalid IL or missing references)
//IL_0337: Unknown result type (might be due to invalid IL or missing references)
//IL_0379: Unknown result type (might be due to invalid IL or missing references)
//IL_037b: Unknown result type (might be due to invalid IL or missing references)
//IL_037d: Unknown result type (might be due to invalid IL or missing references)
//IL_0384: Unknown result type (might be due to invalid IL or missing references)
//IL_0389: Unknown result type (might be due to invalid IL or missing references)
//IL_0345: Unknown result type (might be due to invalid IL or missing references)
//IL_0347: Unknown result type (might be due to invalid IL or missing references)
//IL_0349: Unknown result type (might be due to invalid IL or missing references)
//IL_034e: Unknown result type (might be due to invalid IL or missing references)
//IL_0370: Unknown result type (might be due to invalid IL or missing references)
//IL_0372: Unknown result type (might be due to invalid IL or missing references)
//IL_0377: Unknown result type (might be due to invalid IL or missing references)
//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
//IL_01af: 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_01b6: Unknown result type (might be due to invalid IL or missing references)
//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
//IL_01bd: 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_01cf: Unknown result type (might be due to invalid IL or missing references)
//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
//IL_01dd: Expected O, but got Unknown
//IL_01df: Unknown result type (might be due to invalid IL or missing references)
//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
//IL_01eb: Invalid comparison between Unknown and I4
//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
//IL_0204: Unknown result type (might be due to invalid IL or missing references)
//IL_0217: Expected O, but got Unknown
((BaseState)this).OnEnter();
if (NetworkServer.active)
{
CharacterMaster master = ((EntityState)this).characterBody.master;
ItemQualityCounts itemQualityCounts = default(ItemQualityCounts);
if (Object.op_Implicit((Object)(object)master) && Object.op_Implicit((Object)(object)master.minionOwnership.ownerMaster) && Object.op_Implicit((Object)(object)master.minionOwnership.ownerMaster.inventory))
{
itemQualityCounts = master.minionOwnership.ownerMaster.inventory.GetItemCountsEffective(ItemQualitiesContent.ItemQualityGroups.PhysicsProjectile);
}
if (itemQualityCounts.TotalQualityCount == 0)
{
itemQualityCounts.UncommonCount = 1;
}
float num;
switch (itemQualityCounts.HighestQuality)
{
case QualityTier.Uncommon:
num = 4f;
break;
case QualityTier.Rare:
num = 6f;
break;
case QualityTier.Epic:
num = 8f;
break;
case QualityTier.Legendary:
num = 10f;
break;
default:
Log.Error($"Quality tier {itemQualityCounts.HighestQuality} is not implemented", "D:\\Git\\RoR2\\ItemQualities\\ItemQualities\\Assets\\ItemQualities\\Scripts\\EntityStates\\FriendUnit\\FriendUnitPuntImpact.cs", "OnEnter", 101);
num = 1f;
break;
}
float radius = 10f * (float)itemQualityCounts.UncommonCount + 15f * (float)itemQualityCounts.RareCount + 25f * (float)itemQualityCounts.EpicCount + 35f * (float)itemQualityCounts.LegendaryCount;
radius = ExplodeOnDeath.GetExplosionRadius(radius, ((EntityState)this).characterBody);
BlastAttack val = new BlastAttack
{
position = ImpactPoint,
radius = radius,
baseDamage = num * base.damageStat * DamageMultiplierFromSpeed,
damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)32), (DamageTypeExtended)0, (DamageSource)1),
crit = ((BaseState)this).RollCrit(),
attacker = (Object.op_Implicit((Object)(object)Punter) ? Punter : ((EntityState)this).gameObject),
inflictor = ((EntityState)this).gameObject,
attackerFiltering = (AttackerFiltering)2,
damageColorIndex = (DamageColorIndex)3,
falloffModel = (FalloffModel)3,
procCoefficient = 1f,
teamIndex = ((BaseState)this).GetTeam()
};
val.Fire();
if ((int)_explosionEffectIndex != -1)
{
EffectManager.SpawnEffect(_explosionEffectIndex, new EffectData
{
origin = val.position,
scale = val.radius
}, true);
}
}
Util.PlaySound(ImpactSoundString, ((EntityState)this).gameObject);
EffectManager.SimpleImpactEffect(KineticAura.knockbackEffectPrefab, ImpactPoint, -ImpactNormal, false);
if (!((EntityState)this).isAuthority)
{
return;
}
if (ImpactVelocity == Vector3.zero)
{
ImpactVelocity = ((EntityState)this).characterMotor.velocity;
}
Vector3 val3;
if (ImpactNormal != Vector3.zero)
{
Vector3 val2 = Vector3.Reflect(((Vector3)(ref ImpactVelocity)).normalized, ImpactNormal);
float num2 = ((Vector3)(ref ImpactVelocity)).magnitude * ImpactBounciness;
val3 = val2 * num2;
}
else
{
val3 = ((EntityState)this).characterMotor.velocity * (0f - ImpactBounciness);
}
if (Object.op_Implicit((Object)(object)Punter))
{
Vector3 val4 = Trajectory.CalculateInitialVelocityFromHSpeed(((EntityState)this).transform.position, Punter.transform.position, ((Vector3)(ref ImpactVelocity)).magnitude, 0f, float.PositiveInfinity);
float num3 = Mathf.Min(((Vector3)(ref val4)).magnitude / ((Vector3)(ref val3)).magnitude, ReturnVelocityMaxMagnitudeMultiplier);
Quaternion val5 = Quaternion.identity;
if (ReturnVelocityMaxAngleDelta > 0f)
{
val5 = Quaternion.FromToRotation(val3, val4);
Vector3 val6 = default(Vector3);
float num4 = default(float);
((Quaternion)(ref val5)).ToAngleAxis(ref num4, ref val6);
num4 = Mathf.MoveTowardsAngle(0f, num4, ReturnVelocityMaxAngleDelta);
val5 = Quaternion.AngleAxis(num4, val6);
}
val3 = val5 * val3 * num3;
}
CharacterMotor characterMotor = ((EntityState)this).characterMotor;
PhysForceInfo val7 = new PhysForceInfo
{
force = val3
};
((PhysForceInfo)(ref val7)).resetVelocity = true;
((PhysForceInfo)(ref val7)).disableAirControlUntilCollision = true;
((PhysForceInfo)(ref val7)).ignoreGroundStick = true;
((PhysForceInfo)(ref val7)).massIsOne = true;
characterMotor.ApplyForceImpulse(ref val7);
((EntityState)this).outer.SetNextStateToMain();
}
}
}
namespace EntityStates.BossGroupHealNovaController
{
public sealed class BossGroupHealNovaPulse : EntityState
{
private sealed class HealPulse
{
private readonly HashSet<HealthComponent> _healedTargets = new HashSet<HealthComponent>();
private readonly SphereSearch _sphereSearch;
private readonly float _duration;
private readonly float _finalRadius;
private readonly float _healFractionValue;
private readonly TeamMask _teamMask;
private readonly List<HurtBox> _hurtBoxesList = new List<HurtBox>();
private float _timeElapsed;
public HealPulse(Vector3 origin, float finalRadius, float healFractionValue, float duration, TeamIndex teamIndex)
{
//IL_001d: 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_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_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: 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_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Expected O, but got Unknown
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_0078: Unknown result type (might be due to invalid IL or missing references)
_sphereSearch = new SphereSearch
{
mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask,
origin = origin,
queryTriggerInteraction = (QueryTriggerInteraction)2,
radius = 0f
};
_finalRadius = finalRadius;
_healFractionValue = healFractionValue;
_duration = duration;
_teamMask = default(TeamMask);
((TeamMask)(ref _teamMask)).AddTeam(teamIndex);
}
public void Update(float deltaTime)
{
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
_timeElapsed += deltaTime;
float num = Mathf.Clamp01(_timeElapsed / _duration);
_sphereSearch.radius = _finalRadius * NovaRadiusCurve.Evaluate(num);
_sphereSearch.RefreshCandidates().FilterCandidatesByHurtBoxTeam(_teamMask).FilterCandidatesByDistinctHurtBoxEntities()
.GetHurtBoxes(_hurtBoxesList);
foreach (HurtBox hurtBoxes in _hurtBoxesList)
{
if (_healedTargets.Add(hurtBoxes.healthComponent))
{
healTarget(hurtBoxes.healthComponent);
}
}
_hurtBoxesList.Clear();
}
private void healTarget(HealthComponent target)
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
target.HealFraction(_healFractionValue, default(ProcChainMask));
Util.PlaySound("Play_item_proc_TPhealingNova_hitPlayer", ((Component)target).gameObject);
}
}
public static AnimationCurve NovaRadiusCurve;
public static float GrowDuration;
public static float LingerDuration;
private float _totalDuration;
private Transform _effectTransform;
private HealPulse _healPulse;
private float _radius;
public override void OnEnter()
{
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
((EntityState)this).OnEnter();
_totalDuration = GrowDuration + LingerDuration;
BossGroupHealNovaSpawner bossGroupHealNovaSpawner = default(BossGroupHealNovaSpawner);
if (Object.op_Implicit((Object)(object)((EntityState)this).transform.parent) && ((Component)((EntityState)this).transform.parent).TryGetComponent<BossGroupHealNovaSpawner>(ref bossGroupHealNovaSpawner))
{
_radius = bossGroupHealNovaSpawner.NovaRadius;
}
TeamFilter component = ((EntityState)this).GetComponent<TeamFilter>();
TeamIndex teamIndex = (TeamIndex)((!Object.op_Implicit((Object)(object)component)) ? (-1) : ((int)component.teamIndex));
if (NetworkServer.active)
{
_healPulse = new HealPulse(((EntityState)this).transform.position, _radius, 0.5f, GrowDuration, teamIndex);
}
_effectTransform = ((EntityState)this).transform.Find("PulseEffect");
if (Object.op_Implicit((Object)(object)_effectTransform))
{
((Component)_effectTransform).gameObject.SetActive(true);
}
}
public override void OnExit()
{
if (Object.op_Implicit((Object)(object)_effectTransform))
{
((Component)_effectTransform).gameObject.SetActive(false);
}
((EntityState)this).OnExit();
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
if (NetworkServer.active)
{
_healPulse.Update(((EntityState)this).GetDeltaTime());
if (((EntityState)this).fixedAge >= _totalDuration)
{
EntityState.Destroy((Object)(object)((Component)base.outer).gameObject);
}
}
}
public override void Update()
{
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)_effectTransform))
{
float num = _radius * NovaRadiusCurve.Evaluate(Mathf.Clamp01(((EntityState)this).fixedAge / GrowDuration));
_effectTransform.localScale = new Vector3(num, num, num);
}
}
}
public sealed class BossGroupHealNovaWindup : EntityState
{
private static EffectIndex _chargeEffectIndex = (EffectIndex)(-1);
public static float Duration;
[SystemInitializer(new Type[] { typeof(EffectCatalogUtils) })]
private static void Init()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Invalid comparison between Unknown and I4
_chargeEffectIndex = EffectCatalogUtils.FindEffectIndex("ChargeTPHealingNova");
if ((int)_chargeEffectIndex == -1)
{
Log.Warning("Failed to find charge effect index", "D:\\Git\\RoR2\\ItemQualities\\ItemQualities\\Assets\\ItemQualities\\Scripts\\EntityStates\\BossGroupHealNovaController\\BossGroupHealNovaWindup.cs", "Init", 16);
}
}
public override void OnEnter()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Invalid comparison between Unknown and I4
//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_0018: 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_002f: Expected O, but got Unknown
((EntityState)this).OnEnter();
if ((int)_chargeEffectIndex != -1)
{
EffectManager.SpawnEffect(_chargeEffectIndex, new EffectData
{
origin = ((EntityState)this).transform.position
}, false);
}
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= Duration)
{
base.outer.SetNextStateToMain();
}
}
}
}
namespace System.Runtime.CompilerServices
{
internal static class IsExternalInit
{
}
}
namespace ItemQualities
{
internal static class AnimationEffectSetExplosionScalePatch
{
private const int ExplosionInfoBitOffset = 8;
private const int ExplosionInfoBitMask = 65280;
public static void SetEncodedExplosionIndex(AnimationEvent evnt, ExplosionInfoIndex explosionInfoIndex)
{
evnt.intParameter = EncodeExplosionIndex(evnt.intParameter, explosionInfoIndex);
}
public static int EncodeExplosionIndex(int intParameter, ExplosionInfoIndex explosionInfoIndex)
{
if (explosionInfoIndex >= (ExplosionInfoIndex)255)
{
Log.Error($"Cannot encode explosion index larger than 255 ({explosionInfoIndex})", "D:\\Git\\RoR2\\ItemQualities\\ItemQualities\\Assets\\ItemQualities\\Scripts\\AnimationEffectSetExplosionScalePatch.cs", "EncodeExplosionIndex", 26);
return intParameter;
}
return (intParameter & -65281) | (((int)(explosionInfoIndex + 1) << 8) & 0xFF00);
}
public static ExplosionInfoIndex GetExplosionIndex(AnimationEvent evnt)
{
int intParameter = evnt.intParameter;
DecodeExplosionIndex(ref intParameter, out var explosionInfoIndex);
evnt.intParameter = intParameter;
return explosionInfoIndex;
}
public static void DecodeExplosionIndex(ref int intParameter, out ExplosionInfoIndex explosionInfoIndex)
{
explosionInfoIndex = (ExplosionInfoIndex)(((intParameter & 0xFF00) >> 8) - 1);
if (explosionInfoIndex < ExplosionInfoIndex.None || (int)explosionInfoIndex > ExplosionInfoCatalog.ExplosionInfoDefCount)
{
Log.Error($"Out of bounds explosion index encoded in intParameter, likely data overlap (param={intParameter}, explosionIndex={explosionInfoIndex})", "D:\\Git\\RoR2\\ItemQualities\\ItemQualities\\Assets\\ItemQualities\\Scripts\\AnimationEffectSetExplosionScalePatch.cs", "DecodeExplosionIndex", 47);
explosionInfoIndex = ExplosionInfoIndex.None;
}
intParameter &= -65281;
}
[SystemInitializer(new Type[] { })]
private static void Init()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Expected O, but got Unknown
AnimationEvents.CreateEffect += new Manipulator(AnimationEvents_CreateEffect);
}
private static void AnimationEvents_CreateEffect(ILContext il)
{
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Expected O, but got Unknown
//IL_0051: 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_00dc: 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_00fa: Unknown result type (might be due to invalid IL or missing references)
if (!((MethodReference)(object)il.Method).TryFindParameter<AnimationEvent>(out var parameter))
{
Log.Error("Failed to find AnimationEvent parameter", "D:\\Git\\RoR2\\ItemQualities\\ItemQualities\\Assets\\ItemQualities\\Scripts\\AnimationEffectSetExplosionScalePatch.cs", "AnimationEvents_CreateEffect", 64);
return;
}
ILCursor val = new ILCursor(il);
VariableDefinition val2 = il.AddVariable<ExplosionInfoIndex>();
val.Emit(OpCodes.Ldarg, parameter);
val.EmitDelegate<Func<AnimationEvent, ExplosionInfoIndex>>((Func<AnimationEvent, ExplosionInfoIndex>)GetExplosionIndex);
val.Emit(OpCodes.Stloc, val2);
VariableDefinition effectDataVar = null;
if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[2]
{
(Instruction x) => ILPatternMatchingExt.MatchNewobj<EffectData>(x),
(Instruction x) => x.MatchStloc(typeof(EffectData), il, out effectDataVar)
}))
{
Log.Error("Failed to find patch location", "D:\\Git\\RoR2\\ItemQualities\\ItemQualities\\Assets\\ItemQualities\\Scripts\\AnimationEffectSetExplosionScalePatch.cs", "AnimationEvents_CreateEffect", 81);
return;
}
val.Emit(OpCodes.Ldarg_0);
val.Emit(OpCodes.Ldloc, effectDataVar);
val.Emit(OpCodes.Ldloc, val2);
val.EmitDelegate<Action<AnimationEvents, EffectData, ExplosionInfoIndex>>((Action<AnimationEvents, EffectData, ExplosionInfoIndex>)tryApplyExplosionScale);
static void tryApplyExplosionScale(AnimationEvents self, EffectData effectData, ExplosionInfoIndex explosionInfoIndex)
{
if (explosionInfoIndex != ExplosionInfoIndex.None)
{
float defaultRange = ExplosionInfoCatalog.GetExplosionInfoDef(explosionInfoIndex).GetDefaultRange();
GameObject val3 = (Object.op_Implicit((Object)(object)self) ? self.bodyObject : null);
CharacterBody val4 = (Object.op_Implicit((Object)(object)val3) ? val3.GetComponent<CharacterBody>() : null);
effectData.scale = (Object.op_Implicit((Object)(object)val4) ? ExplodeOnDeath.GetExplosionRadius(defaultRange, val4) : defaultRange);
}
}
}
}
internal static class AnimationPrefabSetOwnershipPatch
{
[SystemInitializer(new Type[] { })]
private static void Init()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Expected O, but got Unknown
AnimationEvents.CreatePrefab += new Manipulator(AnimationEvents_CreatePrefab);
}
private static void AnimationEvents_CreatePrefab(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_000c: 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)
ILCursor val = new ILCursor(il);
int num = 0;
MethodReference val2 = default(MethodReference);
while (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, ref val2) && val2 != null && ((MemberReference)val2).Name?.StartsWith("<CreatePrefab>g__DoSpawnEffect|") == true
}))
{
val.Emit(OpCodes.Dup);
val.Emit(OpCodes.Ldarg_0);
val.EmitDelegate<Action<Transform, AnimationEvents>>((Action<Transform, AnimationEvents>)onPrefabSpawned);
num++;
}
if (num == 0)
{
Log.Error("Failed to find patch location", "D:\\Git\\RoR2\\ItemQualities\\ItemQualities\\Assets\\ItemQualities\\Scripts\\AnimationPrefabSetOwnershipPatch.cs", "AnimationEvents_CreatePrefab", 58);
}
static void onPrefabSpawned(Transform prefabTransform, AnimationEvents animationEvents)
{
LocalEffectOwnership localEffectOwnership = default(LocalEffectOwnership);
if (Object.op_Implicit((Object)(object)prefabTransform) && ((Component)prefabTransform).TryGetComponent<LocalEffectOwnership>(ref localEffectOwnership))
{
GameObject ownerObject = (Object.op_Implicit((Object)(object)animationEvents.bodyObject) ? animationEvents.bodyObject : ((!Object.op_Implicit((Object)(object)animationEvents.entityLocator)) ? ((Component)animationEvents).gameObject : animationEvents.entityLocator.entity));
localEffectOwnership.OwnerObject = ownerObject;
}
}
}
}
[DefaultExecutionOrder(-1000)]
public sealed class AssignAddressableReferences : MonoBehaviour, IAsyncContentLoadCallback
{
[Serializable]
public sealed class ComponentFieldAddressableAssignment
{
[Tooltip("The object to assign the field on")]
[SerializeField]
[FormerlySerializedAs("TargetObject")]
private Object _targetObject;
[SerializeField]
[HideInInspector]
private Component _targetObjectComponent;
[Tooltip("If set, the first component of this type will be located on the Target Object and used as the field instance")]
[RequiredBaseType(typeof(Component))]
public SerializableSystemType TargetObjectComponentType;
[Tooltip("The name of the field or property to set")]
public string FieldName;
[Tooltip("Address of the asset to load")]
public AssetReferenceT<Object> AssetReference = new AssetReferenceT<Object>(string.Empty);
[Tooltip("Determines what type is used to load the asset, if not set, the type of the field/property is used")]
[RequiredBaseType(typeof(Object))]
public SerializableSystemType AssetTypeOverride;
public Object TargetObject
{
get
{
if (!Object.op_Implicit((Object)(object)_targetObjectComponent))
{
return _targetObject;
}
return (Object)(object)_targetObjectComponent;
}
}
public void OnValidate()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
_targetObjectComponent = null;
Type type = (Type)TargetObjectComponentType;
if (!(type != null) || !Object.op_Implicit(_targetObject))
{
return;
}
Object targetObject = _targetObject;
GameObject val = (GameObject)(object)((targetObject is GameObject) ? targetObject : null);
if (val == null)
{
Component val2 = (Component)(object)((targetObject is Component) ? targetObject : null);
if (val2 != null)
{
_targetObjectComponent = val2.GetComponent(type);
}
}
else
{
_targetObjectComponent = val.GetComponent(type);
}
}
}
public ComponentFieldAddressableAssignment[] FieldAssignments = Array.Empty<ComponentFieldAddressableAssignment>();
[SerializeField]
[HideInInspector]
private bool _hasLoaded;
public bool HasLoaded => _hasLoaded;
private void Awake()
{
if (!_hasLoaded)
{
Log.Warning(Util.GetGameObjectHierarchyName(((Component)this).gameObject) + ": Addressable references were not assigned to prefab during init, loading assets now", "D:\\Git\\RoR2\\ItemQualities\\ItemQualities\\Assets\\ItemQualities\\Scripts\\AssignAddressableReferences.cs", "Awake", 32);
IEnumerator enumerator = AssignFieldsAsync<IProgress<float>>();
while (enumerator.MoveNext())
{
}
}
}
IEnumerator IAsyncContentLoadCallback.OnContentLoad<TProgress>(TProgress progressReceiver)
{
return AssignFieldsAsync(progressReceiver);
}
public IEnumerator AssignFieldsAsync<TProgress>(TProgress progressReceiver = default(TProgress)) where TProgress : IProgress<float>
{
if (FieldAssignments.Length != 0)
{
if (progressReceiver != null)
{
ParallelProgressCoroutine val = new ParallelProgressCoroutine((IProgress<float>)progressReceiver);
ComponentFieldAddressableAssignment[] fieldAssignments = FieldAssignments;
foreach (ComponentFieldAddressableAssignment componentFieldAssignment in fieldAssignments)
{
ReadableProgress<float> val2 = new ReadableProgress<float>();
val.Add(assignComponentFieldAsync<ReadableProgress<float>>(componentFieldAssignment, val2), val2);
}
yield return val;
}
else
{
ParallelCoroutine val3 = new ParallelCoroutine();
ComponentFieldAddressableAssignment[] fieldAssignments = FieldAssignments;
foreach (ComponentFieldAddressableAssignment componentFieldAssignment2 in fieldAssignments)
{
val3.Add(assignComponentFieldAsync<IProgress<float>>(componentFieldAssignment2));
}
yield return val3;
}
}
_hasLoaded = true;
((Behaviour)this).enabled = false;
}
private IEnumerator assignComponentFieldAsync<TProgress>(ComponentFieldAddressableAssignment componentFieldAssignment, TProgress progressReceiver = default(TProgress)) where TProgress : IProgress<float>
{
if (!Object.op_Implicit(componentFieldAssignment.TargetObject))
{
yield break;
}
Type type = ((object)componentFieldAssignment.TargetObject).GetType();
Type memberType;
MemberInfo targetMember = findTargetMember(type, componentFieldAssignment.FieldName, out memberType);
if (targetMember == null)
{
Log.Error($"Failed to find field '{componentFieldAssignment.FieldName}' on component {componentFieldAssignment.TargetObject}", "D:\\Git\\RoR2\\ItemQualities\\ItemQualities\\Assets\\ItemQualities\\Scripts\\AssignAddressableReferences.cs", "assignComponentFieldAsync", 89);
yield break;
}
Type assetType = ((Type)componentFieldAssignment.AssetTypeOverride) ?? memberType;
AsyncOperationHandle assetLoadHandle = AddressableUtil.LoadAssetAsync((AssetReference)(object)componentFieldAssignment.AssetReference, assetType, (AsyncReferenceHandleUnloadType)2);
try
{
yield return assetLoadHandle.AsProgressCoroutine(progressReceiver);
AssignAddressableReferences assignAddressableReferences = this;
object result = ((AsyncOperationHandle)(ref assetLoadHandle)).Result;
assignAddressableReferences.applyFieldValue(componentFieldAssignment, targetMember, (Object)((result is Object) ? result : null));
}
finally
{
AddressableUtil.UnloadAsset((AssetReference)(object)componentFieldAssignment.AssetReference, assetType);
}
}
private void applyFieldValue(ComponentFieldAddressableAssignment componentFieldAssignment, MemberInfo member, Object value)
{
Type type = ((object)componentFieldAssignment.TargetObject).GetType();
object runtimeKey = ((AssetReference)componentFieldAssignment.AssetReference).RuntimeKey;
if (!Object.op_Implicit(value))
{
Log.Warning($"{Util.GetGameObjectHierarchyName(((Component)this).gameObject)} ({type.FullName}.{componentFieldAssignment.FieldName}): Null asset loaded for asset {runtimeKey}", "D:\\Git\\RoR2\\ItemQualities\\ItemQualities\\Assets\\ItemQualities\\Scripts\\AssignAddressableReferences.cs", "applyFieldValue", 115);
}
try
{
if (!(member is FieldInfo fieldInfo))
{
if (member is PropertyInfo propertyInfo)
{
propertyInfo.SetValue(componentFieldAssignment.TargetObject, value);
}
}
else
{
fieldInfo.SetValue(componentFieldAssignment.TargetObject, value);
}
}
catch (Exception ex)
{
Log.Error_NoCallerPrefix($"{Util.GetGameObjectHierarchyName(((Component)this).gameObject)}: Failed to set field {type.FullName}.{componentFieldAssignment.FieldName} to asset {value} from {runtimeKey}: {ex}");
}
}
private void OnValidate()
{
//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
ComponentFieldAddressableAssignment[] fieldAssignments = FieldAssignments;
foreach (ComponentFieldAddressableAssignment componentFieldAddressableAssignment in fieldAssignments)
{
componentFieldAddressableAssignment.OnValidate();
if (!Object.op_Implicit(componentFieldAddressableAssignment.TargetObject))
{
continue;
}
Type type = ((object)componentFieldAddressableAssignment.TargetObject).GetType();
if (findTargetMember(type, componentFieldAddressableAssignment.FieldName, out var memberType) == null)
{
Debug.LogWarning((object)("Field or property '" + componentFieldAddressableAssignment.FieldName + "' does not exist in type " + type.FullName), (Object)(object)this);
continue;
}
if (!typeof(Object).IsAssignableFrom(memberType))
{
Debug.LogWarning((object)("Invalid type " + memberType.FullName + " on field " + type.FullName + "." + componentFieldAddressableAssignment.FieldName + " (must be UnityEngine.Object)"), (Object)(object)this);
}
Type type2 = (Type)componentFieldAddressableAssignment.AssetTypeOverride;
if (type2 != null && !memberType.IsAssignableFrom(type2))
{
Debug.LogWarning((object)("Asset type " + type2.FullName + " cannot be assigned to field of type " + memberType.FullName + " (" + type.FullName + "." + componentFieldAddressableAssignment.FieldName + ")"), (Object)(object)this);
}
}
}
private static MemberInfo findTargetMember(Type componentType, string fieldName, out Type memberType)
{
FieldInfo field = componentType.GetField(fieldName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
if (field != null)
{
memberType = field.FieldType;
return field;
}
PropertyInfo property = componentType.GetProperty(fieldName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
if (property != null)
{
memberType = property.PropertyType;
return property;
}
memberType = null;
return null;
}
}
internal static class AttackCollisionHooks
{
[SystemInitializer(new Type[] { })]
private static void Init()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Expected O, but got Unknown
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Expected O, but got Unknown
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Expected O, but got Unknown
BulletAttack.DefaultFilterCallbackImplementation += new hook_DefaultFilterCallbackImplementation(BulletAttack_DefaultFilterCallbackImplementation);
OverlapAttack.HurtBoxPassesFilter += new hook_HurtBoxPassesFilter(OverlapAttack_HurtBoxPassesFilter);
BlastAttack.CollectHits += new Manipulator(BlastAttack_CollectHits);
}
private static bool BulletAttack_DefaultFilterCallbackImplementation(orig_DefaultFilterCallbackImplementation orig, BulletAttack bulletAttack, ref BulletHit hitInfo)
{
if (!orig.Invoke(bulletAttack, ref hitInfo))
{
return false;
}
try
{
if (Object.op_Implicit((Object)(object)bulletAttack.owner) && bulletAttack.owner.TryGetComponentCached<ObjectCollisionManager>(out ObjectCollisionManager component) && component.IgnoresCollisionsWith(hitInfo.collider))
{
return false;
}
}
catch (Exception ex)
{
Log.Error_NoCallerPrefix(ex.ToString());
}
return true;
}
private static bool OverlapAttack_HurtBoxPassesFilter(orig_HurtBoxPassesFilter orig, OverlapAttack self, HurtBox hurtBox)
{
if (!orig.Invoke(self, hurtBox))
{
return false;
}
try
{
if (Object.op_Implicit((Object)(object)hurtBox) && Object.op_Implicit((Object)(object)self.attacker) && self.attacker.TryGetComponentCached<ObjectCollisionManager>(out ObjectCollisionManager component) && component.IgnoresCollisionsWith(hurtBox.collider))
{
return false;
}
}
catch (Exception ex)
{
Log.Error_NoCallerPrefix(ex.ToString());
}
return true;
}
private static void BlastAttack_CollectHits(ILContext il)
{
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Expected O, but got Unknown
//IL_008e: 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_00bf: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
VariableDefinition hurtBoxVar = null;
ILLabel hurtBoxInvalidLabel = null;
if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[3]
{
(Instruction x) => x.MatchLdloc(typeof(HurtBox), il, out hurtBoxVar),
(Instruction x) => x.MatchImplicitConversion<Object, bool>(),
(Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref hurtBoxInvalidLabel)
}))
{
Log.Error("Failed to find patch location", "D:\\Git\\RoR2\\ItemQualities\\ItemQualities\\Assets\\ItemQualities\\Scripts\\AttackCollisionHooks.cs", "BlastAttack_CollectHits", 72);
return;
}
val.Emit(OpCodes.Ldarg_0);
val.Emit(OpCodes.Ldloc, hurtBoxVar);
val.EmitDelegate<Func<BlastAttack, HurtBox, bool>>((Func<BlastAttack, HurtBox, bool>)attackerIgnoresCollisionWith);
val.Emit(OpCodes.Brtrue, (object)hurtBoxInvalidLabel);
static bool attackerIgnoresCollisionWith(BlastAttack blastAttack, HurtBox hurtBox)
{
if (Object.op_Implicit((Object)(object)hurtBox) && Object.op_Implicit((Object)(object)hurtBox.collider) && blastAttack != null && Object.op_Implicit((Object)(object)blastAttack.attacker) && blastAttack.attacker.TryGetComponentCached<ObjectCollisionManager>(out ObjectCollisionManager component) && component.IgnoresCollisionsWith(hurtBox.collider))
{
return true;
}
return false;
}
}
}
public sealed class AxisBillboard : MonoBehaviour
{
public Vector3 Axis = Vector3.up;
private void OnEnable()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Expected O, but got Unknown
SceneCamera.onSceneCameraPreCull += new SceneCameraDelegate(onSceneCameraPreCull);
}
private void OnDisable()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Expected O, but got Unknown
SceneCamera.onSceneCameraPreCull -= new SceneCameraDelegate(onSceneCameraPreCull);
}
private void onSceneCameraPreCull(SceneCamera sceneCamera)
{
//IL_0006: 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_001d: 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_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_0034: 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_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)
Vector3 val = Vector3.ProjectOnPlane(((Component)this).transform.position, Axis);
Vector3 val2 = Vector3.ProjectOnPlane(((Component)sceneCamera).transform.position, Axis);
Transform transform = ((Component)this).transform;
Vector3 val3 = val2 - val;
transform.rotation = Util.QuaternionSafeLookRotation(((Vector3)(ref val3)).normalized);
}
}
public sealed class BarrierPickup : MonoBehaviour
{
[Tooltip("The base object to destroy when this pickup is consumed.")]
public GameObject BaseObject;
[Tooltip("The team filter object which determines who can pick up this pack.")]
public TeamFilter TeamFilter;
public GameObject PickupEffect;
public float FlatAmount;
public float FractionalAmount;
private bool _alive = true;
private void OnTriggerStay(Collider other)
{
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0084: Unknown result type (might be due to invalid IL or missing references)
//IL_0094: Expected O, but got Unknown
if (!NetworkServer.active || !_alive || TeamComponent.GetObjectTeam(((Component)other).gameObject) != TeamFilter.teamIndex)
{
return;
}
CharacterBody component = ((Component)other).GetComponent<CharacterBody>();
if (!Object.op_Implicit((Object)(object)component))
{
return;
}
HealthComponent healthComponent = component.healthComponent;
if (Object.op_Implicit((Object)(object)healthComponent))
{
healthComponent.AddBarrier(FlatAmount + healthComponent.fullBarrier * FractionalAmount);
if (Object.op_Implicit((Object)(object)PickupEffect))
{
EffectManager.SpawnEffect(PickupEffect, new EffectData
{
origin = ((Component)this).transform.position
}, true);
}
}
Object.Destroy((Object)(object)BaseObject);
_alive = false;
}
}
[RequireComponent(typeof(NetworkedBodyAttachment))]
public sealed class BodyAttachmentVFXController : MonoBehaviour, INetworkedBodyAttachmentListener
{
public enum RadiusMode
{
Constant,
BodyRadius,
BodyBestFitRadius,
BodyBestFitActualRadius
}
[SerializeField]
private InstantiateAddressablePrefab _bodyVFXInstantiator;
[SerializeField]
private RadiusMode _radiusMode = RadiusMode.BodyRadius;
[SerializeField]
[Min(0f)]
private float _radiusMultiplier = 1f;
private NetworkedBodyAttachment _bodyAttachment;
private void Awake()
{
_bodyAttachment = ((Component)this).GetComponent<NetworkedBodyAttachment>();
_bodyVFXInstantiator.OnInstantiated += onVFXInstantiated;
}
private void OnDestroy()
{
_bodyVFXInstantiator.OnInstantiated -= onVFXInstantiated;
}
private void onVFXInstantiated(GameObject vfx)
{
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
TemporaryVisualEffect val = default(TemporaryVisualEffect);
if (!vfx.TryGetComponent<TemporaryVisualEffect>(ref val))
{
return;
}
CharacterBody attachedBody = _bodyAttachment.attachedBody;
if (Object.op_Implicit((Object)(object)attachedBody))
{
float num = _radiusMode switch
{
RadiusMode.Constant => 1f,
RadiusMode.BodyRadius => attachedBody.radius,
RadiusMode.BodyBestFitRadius => attachedBody.bestFitRadius,
RadiusMode.BodyBestFitActualRadius => attachedBody.bestFitActualRadius,
_ => throw new NotImplementedException($"Radius mode {_radiusMode} is not implemented"),
};
val.parentTransform = attachedBody.coreTransform;
val.visualState = (VisualState)0;
val.healthComponent = attachedBody.healthComponent;
val.radius = num * _radiusMultiplier;
LocalCameraEffect val2 = default(LocalCameraEffect);
if (((Component)val).TryGetComponent<LocalCameraEffect>(ref val2))
{
val2.targetCharacter = ((Component)attachedBody).gameObject;
}
}
}
void INetworkedBodyAttachmentListener.OnAttachedBodyDiscovered(NetworkedBodyAttachment networkedBodyAttachment, CharacterBody attachedBody)
{
_bodyVFXInstantiator.InstantiatePrefab();
}
}
internal static class BoomerangProjectileHooks
{
[SystemInitializer(new Type[] { })]
private static void Init()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Expected O, but got Unknown
BoomerangProjectile.FixedUpdate += new hook_FixedUpdate(BoomerangProjectile_FixedUpdate);
}
private static void BoomerangProjectile_FixedUpdate(orig_FixedUpdate orig, BoomerangProjectile self)
{
if (!Object.op_Implicit((Object)(object)self) || !((Component)(object)self).TryGetComponentCached<BoomerangProjectileQualityController>(out BoomerangProjectileQualityController component) || !component.IsInHitPause)
{
orig.Invoke(self);
}
}
}
[RequireComponent(typeof(BoomerangProjectile))]
public sealed class BoomerangProjectileQualityController : MonoBehaviour
{
public float HitPauseDuration;
private BoomerangProjectile _boomerangProjectile;
private bool _hasStartedHitPause;
private float _hitPauseTimer;
public bool IsInHitPause => _hitPauseTi