using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using On.RoR2;
using On.RoR2.Projectile;
using R2API;
using R2API.Utils;
using RainrotSharedUtils.Components;
using RainrotSharedUtils.Frost;
using RainrotSharedUtils.Shelters;
using RoR2;
using RoR2.Projectile;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.ResourceManagement.AsyncOperations;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("RainrotSharedUtils")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("RainrotSharedUtils")]
[assembly: AssemblyTitle("RainrotSharedUtils")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: UnverifiableCode]
namespace RainrotSharedUtils
{
public static class Assets
{
public const int maxNebulaBoosterStackCount = 5;
public static float nebulaBoosterBuffDuration = 5f;
public static float nebulaBoosterBuffRadius = 50f;
public static GameObject sparkBoosterObject;
public static Color32 sparkBoosterColor = new Color32((byte)35, (byte)115, byte.MaxValue, byte.MaxValue);
public static BuffDef sparkBoosterBuff;
public static float sparkBoosterDuration = 8f;
public static float sparkBoosterAspdBonus = 0.25f;
internal static GameObject iceDelayBlastPrefab;
public static GameObject iceNovaEffectStrong;
public static GameObject iceNovaEffectWeak;
public static GameObject iceNovaEffectLowPriority;
public static Texture2D iceNovaRamp;
public static Texture2D iceNovaRampPersistent;
public static EffectDef RegisterEffect(GameObject effect)
{
//IL_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_0094: Unknown result type (might be due to invalid IL or missing references)
//IL_009c: Unknown result type (might be due to invalid IL or missing references)
//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
//IL_00c7: Expected O, but got Unknown
if ((Object)(object)effect == (Object)null)
{
Debug.LogError((object)"Effect prefab was null");
return null;
}
EffectComponent component = effect.GetComponent<EffectComponent>();
if ((Object)(object)component == (Object)null)
{
Debug.LogErrorFormat("Effect prefab: \"{0}\" does not have an EffectComponent.", new object[1] { ((Object)effect).name });
return null;
}
VFXAttributes component2 = effect.GetComponent<VFXAttributes>();
if ((Object)(object)component2 == (Object)null)
{
Debug.LogErrorFormat("Effect prefab: \"{0}\" does not have a VFXAttributes component.", new object[1] { ((Object)effect).name });
return null;
}
ContentAddition.AddEffect(effect);
return new EffectDef
{
prefab = effect,
prefabEffectComponent = component,
prefabVfxAttributes = component2,
prefabName = ((Object)effect).name,
spawnSoundEventName = component.soundName
};
}
private static Texture2D CreateNewRampTex(Gradient grad)
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Expected O, but got Unknown
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_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)
Texture2D val = new Texture2D(256, 8, (TextureFormat)4, false);
Color[] array = (Color[])(object)new Color[8];
for (int i = 0; i < 256; i++)
{
Color val2 = grad.Evaluate((float)i / 255f);
for (int j = 0; j < 8; j++)
{
array[j] = val2;
}
val.SetPixels(i, 0, 1, 8, array);
}
((Texture)val).wrapMode = (TextureWrapMode)1;
val.Apply();
return val;
}
public static void Init()
{
CreateFrostNovaAssets();
CreateSparkPickup();
}
private static void CreateSparkPickup()
{
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Expected O, but got Unknown
sparkBoosterBuff = ScriptableObject.CreateInstance<BuffDef>();
((Object)sparkBoosterBuff).name = "bdSparkBoost";
sparkBoosterBuff.buffColor = Color32.op_Implicit(sparkBoosterColor);
sparkBoosterBuff.canStack = true;
AsyncOperationHandle<Sprite> val = Addressables.LoadAssetAsync<Sprite>((object)"1597fa78f3a39cc4c9c58e8ed2cd42f0");
val.Completed += delegate(AsyncOperationHandle<Sprite> ctx)
{
sparkBoosterBuff.iconSprite = ctx.Result;
};
ContentAddition.AddBuffDef(sparkBoosterBuff);
sparkBoosterObject = NewNebulaBooster("SparkBoosterPickup", sparkBoosterBuff, sparkBoosterColor, sparkBoosterDuration, 0.8f, 1.8f);
RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(SparkBoosterStats);
}
private static void SparkBoosterStats(CharacterBody sender, StatHookEventArgs args)
{
int buffCount = sender.GetBuffCount(sparkBoosterBuff);
if (buffCount > 0)
{
args.attackSpeedMultAdd += sparkBoosterAspdBonus * (float)buffCount;
}
}
private static GameObject NewNebulaBooster(string boosterName, BuffDef boosterBuff, Color32 boosterColor, float boosterDuration, float antiGravity = 1f, float pickupRangeMultiplier = 3f)
{
//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_0042: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: 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_0170: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_0092: Unknown result type (might be due to invalid IL or missing references)
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
//IL_0113: Unknown result type (might be due to invalid IL or missing references)
//IL_0115: Unknown result type (might be due to invalid IL or missing references)
//IL_0319: Unknown result type (might be due to invalid IL or missing references)
//IL_0320: Unknown result type (might be due to invalid IL or missing references)
GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"7f9217d45f824f245862e65716abc746").WaitForCompletion();
GameObject val2 = PrefabAPI.InstantiateClone(val, boosterName, true);
ParticleSystemRenderer[] componentsInChildren = val2.GetComponentsInChildren<ParticleSystemRenderer>();
foreach (ParticleSystemRenderer val3 in componentsInChildren)
{
string name = ((Object)((Component)val3).gameObject).name;
Color32 val4 = Color32.op_Implicit(Color.white);
string text = "";
if (name == "Core")
{
text = "matSparkPickupCore";
val4 = boosterColor;
}
if (name == "Trail")
{
text = "matSparkPickupTrail";
val4 = Color32.op_Implicit(Color.clear);
}
if (name == "Pulseglow")
{
text = "matSparkPickupGlow";
val4 = boosterColor;
}
if (text != "")
{
Material val6 = (((Renderer)val3).material = Object.Instantiate<Material>(((Renderer)val3).material));
((Object)val6).name = text;
val6.DisableKeyword("VERTEXCOLOR");
val6.SetFloat("_VertexColorOn", 0f);
val6.SetColor("_TintColor", Color32.op_Implicit(val4));
}
}
VelocityRandomOnStart component = val2.GetComponent<VelocityRandomOnStart>();
if ((Object)(object)component != (Object)null)
{
component.minSpeed = 15f;
component.maxSpeed = 25f;
component.coneAngle = 360f;
component.directionMode = (DirectionMode)0;
}
else
{
Debug.Log((object)(boosterName + " HAS NO VROS????"));
}
DestroyOnTimer component2 = val2.GetComponent<DestroyOnTimer>();
if ((Object)(object)component2 != (Object)null)
{
component2.duration = boosterDuration;
}
else
{
Debug.Log((object)(boosterName + " HAS NO DOT????"));
}
BeginRapidlyActivatingAndDeactivating component3 = val2.GetComponent<BeginRapidlyActivatingAndDeactivating>();
if ((Object)(object)component3 != (Object)null)
{
component3.delayBeforeBeginningBlinking = boosterDuration - 2f;
component3.blinkFrequency = 5f;
}
else
{
Debug.Log((object)(boosterName + " HAS NO BRAAD????"));
}
if (antiGravity != 0f)
{
Rigidbody component4 = val2.GetComponent<Rigidbody>();
if (antiGravity == 1f)
{
component4.useGravity = true;
}
else
{
AntiGravityForce val7 = val2.AddComponent<AntiGravityForce>();
val7.rb = component4;
val7.antiGravityCoefficient = antiGravity;
}
}
HealthPickup componentInChildren = val2.GetComponentInChildren<HealthPickup>();
NebulaPickup nebulaPickup = ((Component)componentInChildren).gameObject.AddComponent<NebulaPickup>();
nebulaPickup.pickupEffect = componentInChildren.pickupEffect;
nebulaPickup.baseObject = componentInChildren.baseObject;
nebulaPickup.teamFilter = val2.GetComponent<TeamFilter>();
if ((Object)(object)boosterBuff != (Object)null)
{
nebulaPickup.buffDef = boosterBuff;
}
else
{
Debug.Log((object)(boosterName + "BOOSTER BUFFDEF WAS NULL"));
}
GravitatePickup componentInChildren2 = val2.GetComponentInChildren<GravitatePickup>();
if ((Object)(object)componentInChildren2 != (Object)null)
{
componentInChildren2.acceleration = 2f;
componentInChildren2.maxSpeed = 50f;
Collider component5 = ((Component)componentInChildren2).gameObject.GetComponent<Collider>();
if (component5.isTrigger)
{
Transform transform = ((Component)component5).transform;
transform.localScale *= pickupRangeMultiplier;
}
}
else
{
Debug.Log((object)(boosterName + " HAS NO GRAVITATION????"));
}
Object.Destroy((Object)(object)componentInChildren);
ContentAddition.AddNetworkedObject(val2);
return val2;
}
private static void CreateFrostNovaAssets()
{
iceNovaRamp = GetIceRemap(1.1f, 0f);
iceNovaRampPersistent = GetIceRemap(0.4f, 0.1f);
iceNovaEffectStrong = CreateSingleIceNova(iceNovaRamp, "Strong", 1.2f);
iceNovaEffectWeak = CreateSingleIceNova(iceNovaRamp, "Weak", 0.85f);
iceNovaEffectLowPriority = CreateSingleIceNova(iceNovaRamp, "LowPriority", 0.3f);
iceDelayBlastPrefab = CreateIceDelayBlastPrefab();
static Texture2D GetIceRemap(float alphaMod, float alphaAdd)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0074: Unknown result type (might be due to invalid IL or missing references)
//IL_0079: Unknown result type (might be due to invalid IL or missing references)
//IL_008e: Unknown result type (might be due to invalid IL or missing references)
//IL_0093: Unknown result type (might be due to invalid IL or missing references)
//IL_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_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
//IL_010a: Unknown result type (might be due to invalid IL or missing references)
//IL_0114: Unknown result type (might be due to invalid IL or missing references)
//IL_0119: 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_013f: Unknown result type (might be due to invalid IL or missing references)
//IL_0144: Unknown result type (might be due to invalid IL or missing references)
//IL_0160: Unknown result type (might be due to invalid IL or missing references)
//IL_016a: 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_018b: Unknown result type (might be due to invalid IL or missing references)
//IL_0195: Unknown result type (might be due to invalid IL or missing references)
//IL_019a: Unknown result type (might be due to invalid IL or missing references)
//IL_01b6: 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_01c5: Unknown result type (might be due to invalid IL or missing references)
//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
//IL_01f0: 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_0216: Unknown result type (might be due to invalid IL or missing references)
//IL_021b: Unknown result type (might be due to invalid IL or missing references)
//IL_0237: Unknown result type (might be due to invalid IL or missing references)
//IL_0241: Unknown result type (might be due to invalid IL or missing references)
//IL_0246: Unknown result type (might be due to invalid IL or missing references)
Gradient val = new Gradient();
val.mode = (GradientMode)0;
val.alphaKeys = (GradientAlphaKey[])(object)new GradientAlphaKey[8]
{
new GradientAlphaKey(0f * alphaMod + alphaAdd, 0f),
new GradientAlphaKey(0f * alphaMod + alphaAdd, 0.14f),
new GradientAlphaKey(0.22f * alphaMod + alphaAdd, 0.46f),
new GradientAlphaKey(0.22f * alphaMod + alphaAdd, 0.61f),
new GradientAlphaKey(0.72f * alphaMod + alphaAdd, 0.63f),
new GradientAlphaKey(0.72f * alphaMod + alphaAdd, 0.8f),
new GradientAlphaKey(0.87f * alphaMod + alphaAdd, 0.81f),
new GradientAlphaKey(0.87f * alphaMod + alphaAdd, 1f)
};
val.colorKeys = (GradientColorKey[])(object)new GradientColorKey[8]
{
new GradientColorKey(new Color(0f + alphaAdd, 0f + alphaAdd, 0f + alphaAdd), 0f),
new GradientColorKey(new Color(0f + alphaAdd, 0f + alphaAdd, 0f + alphaAdd), 0.14f),
new GradientColorKey(new Color(0.179f + alphaAdd, 0.278f + alphaAdd, 0.25f + alphaAdd), 0.46f),
new GradientColorKey(new Color(0.179f + alphaAdd, 0.278f + alphaAdd, 0.25f + alphaAdd), 0.61f),
new GradientColorKey(new Color(0.5f + alphaAdd, 0.8f + alphaAdd, 0.75f + alphaAdd), 0.63f),
new GradientColorKey(new Color(0.5f + alphaAdd, 0.8f + alphaAdd, 0.75f + alphaAdd), 0.8f),
new GradientColorKey(new Color(0.6f + alphaAdd, 0.9f + alphaAdd, 0.85f + alphaAdd), 0.81f),
new GradientColorKey(new Color(0.6f + alphaAdd, 0.9f + alphaAdd, 0.85f + alphaAdd), 1f)
};
Gradient grad = val;
return CreateNewRampTex(grad);
}
}
private static GameObject CreateSingleIceNova(Texture2D remapTex, string s, float alphaMod)
{
//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_006a: Unknown result type (might be due to invalid IL or missing references)
GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/ImpactEffects/AffixWhiteExplosion"), "IceExplosion" + s, false);
ParticleSystemRenderer component = ((Component)val.transform.Find("Nova Sphere")).GetComponent<ParticleSystemRenderer>();
Material val2 = Object.Instantiate<Material>(((Renderer)component).material);
val2.SetTexture("_RemapTex", (Texture)(object)remapTex);
Color color = val2.GetColor("_TintColor");
color.a *= alphaMod;
val2.SetColor("_TintColor", color);
((Renderer)component).material = val2;
RegisterEffect(val);
return val;
}
private static GameObject CreateIceDelayBlastPrefab()
{
//IL_003d: 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)
GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/NetworkedObjects/GenericDelayBlast"), "IceDelayBlast", false);
DelayBlast component = val.GetComponent<DelayBlast>();
component.crit = false;
component.procCoefficient = 1f;
component.maxTimer = 0.2f;
component.falloffModel = (FalloffModel)0;
component.explosionEffect = iceNovaEffectWeak;
component.delayEffect = CreateIceDelayEffect();
component.damageType = DamageTypeCombo.op_Implicit((DamageType)256);
component.baseForce = 250f;
ProjectileController val2 = val.AddComponent<ProjectileController>();
ContentAddition.AddProjectile(val);
return val;
}
private static GameObject CreateIceDelayEffect()
{
GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/AffixWhiteDelayEffect"), "iceDelay", false);
val.GetComponent<DestroyOnTimer>().duration = 0.2f;
ParticleSystemRenderer component = ((Component)val.transform.Find("Nova Sphere")).GetComponent<ParticleSystemRenderer>();
Material val2 = Object.Instantiate<Material>(((Renderer)component).material);
val2.SetTexture("_RemapTex", (Texture)(object)iceNovaRamp);
((Renderer)component).material = val2;
RegisterEffect(val);
return val;
}
}
public static class Hooks
{
public static void DoHooks()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Expected O, but got Unknown
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Expected O, but got Unknown
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: Expected O, but got Unknown
IcicleAuraController.Awake += new hook_Awake(AuraControllerFix);
BuffWard.BuffTeam += new hook_BuffTeam(ApplyDotWard);
ProjectileOverlapLimitHits.CountOverlapHits += new hook_CountOverlapHits(DecayProjectileOverlapDamage);
ProjectileOverlapLimitHits.OnEnable += new hook_OnEnable(DecayProjectileRecordInitialDamage);
}
private static void DecayProjectileRecordInitialDamage(orig_OnEnable orig, ProjectileOverlapLimitHits self)
{
orig.Invoke(self);
if (self is ProjectileOverlapDecayDamage)
{
(self as ProjectileOverlapDecayDamage).initialDamageCoefficient = self.projectileOverlapAttack.damageCoefficient;
(self as ProjectileOverlapDecayDamage).initialProcCoefficient = self.projectileOverlapAttack.overlapProcCoefficient;
}
}
private static void DecayProjectileOverlapDamage(orig_CountOverlapHits orig, ProjectileOverlapLimitHits self)
{
orig.Invoke(self);
if (self is ProjectileOverlapDecayDamage)
{
ProjectileOverlapDecayDamage projectileOverlapDecayDamage = self as ProjectileOverlapDecayDamage;
if (self.hitCount < self.hitLimit)
{
self.projectileOverlapAttack.damageCoefficient = projectileOverlapDecayDamage.initialDamageCoefficient * projectileOverlapDecayDamage.firstHitDamageMultiplier * Mathf.Pow(projectileOverlapDecayDamage.onHitDamageMultiplier, (float)(self.hitCount - 1));
self.projectileOverlapAttack.overlapProcCoefficient = projectileOverlapDecayDamage.initialProcCoefficient * projectileOverlapDecayDamage.firstHitDamageMultiplier * Mathf.Pow(projectileOverlapDecayDamage.onHitDamageMultiplier, (float)(self.hitCount - 1));
}
}
}
private static void AuraControllerFix(orig_Awake orig, IcicleAuraController self)
{
orig.Invoke(self);
if (Object.op_Implicit((Object)(object)self.buffWard) && self.buffWard is DotWard dotWard)
{
dotWard.ownerObject = self.cachedOwnerInfo.gameObject;
dotWard.ownerBody = self.cachedOwnerInfo.characterBody;
}
}
private static void ApplyDotWard(orig_BuffTeam orig, BuffWard self, IEnumerable<TeamComponent> recipients, float radiusSqr, Vector3 currentPosition)
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: Invalid comparison between Unknown and I4
//IL_0084: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: Unknown result type (might be due to invalid IL or missing references)
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
//IL_0093: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Invalid comparison between Unknown and I4
//IL_010c: Unknown result type (might be due to invalid IL or missing references)
//IL_0150: Unknown result type (might be due to invalid IL or missing references)
//IL_0155: Unknown result type (might be due to invalid IL or missing references)
//IL_0167: Unknown result type (might be due to invalid IL or missing references)
//IL_0169: Unknown result type (might be due to invalid IL or missing references)
if (!(self is DotWard dotWard))
{
orig.Invoke(self, recipients, radiusSqr, currentPosition);
}
else
{
if (!NetworkServer.active || (int)dotWard.dotIndex == -1)
{
return;
}
GameObject ownerObject = dotWard.ownerObject;
CharacterBody ownerBody = dotWard.ownerBody;
Inventory ownerInventory = dotWard.ownerInventory;
foreach (TeamComponent recipient in recipients)
{
Vector3 val = ((Component)recipient).transform.position - currentPosition;
if ((int)self.shape == 1)
{
val.y = 0f;
}
if (!(((Vector3)(ref val)).sqrMagnitude <= radiusSqr))
{
continue;
}
CharacterBody component = ((Component)recipient).GetComponent<CharacterBody>();
if (Object.op_Implicit((Object)(object)component) && (!self.requireGrounded || !Object.op_Implicit((Object)(object)component.characterMotor) || component.characterMotor.isGrounded))
{
InflictDotInfo val2 = default(InflictDotInfo);
val2.attackerObject = ownerObject;
val2.victimObject = ((Component)component).gameObject;
val2.totalDamage = dotWard.damageCoefficient * ownerBody.damage;
val2.damageMultiplier = 1f;
val2.dotIndex = dotWard.dotIndex;
val2.maxStacksFromAttacker = null;
InflictDotInfo val3 = val2;
if ((Object)(object)ownerInventory != (Object)null)
{
StrengthenBurnUtils.CheckDotForUpgrade(ownerInventory, ref val3);
}
DotController.InflictDot(ref val3);
}
}
}
}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.RiskOfBrainrot.RainrotSharedUtils", "RainrotSharedUtils", "1.0.5")]
[R2APISubmoduleDependency(new string[] { "LanguageAPI" })]
public class SharedUtilsPlugin : BaseUnityPlugin
{
public const string guid = "com.RiskOfBrainrot.RainrotSharedUtils";
public const string teamName = "RiskOfBrainrot";
public const string modName = "RainrotSharedUtils";
public const string version = "1.0.5";
public const string shelterKeywordToken = "2R4R_SHELTER_KEYWORD";
public const string executeKeywordToken = "2R4R_EXECUTION_KEYWORD";
public const string noAttackSpeedKeywordToken = "2R4R_NOATTACKSPEED_KEYWORD";
public const string sparkPickupKeywordToken = "2R4R_SPARKPICKUP_KEYWORD";
public const float survivorExecuteThreshold = 0.15f;
public static PluginInfo PInfo { get; private set; }
public void Awake()
{
Assets.Init();
ShelterUtilsModule.Init();
FrostUtilsModule.Init();
Hooks.DoHooks();
LanguageAPI.Add("2R4R_EXECUTION_KEYWORD", "<style=cKeywordName>Finisher</style><style=cSub>Enemies targeted by this skill can be <style=cIsHealth>instantly killed</style> if below " + $"<style=cIsHealth>{15.000001f}% health</style>.</style>");
LanguageAPI.Add("2R4R_NOATTACKSPEED_KEYWORD", "<style=cKeywordName>Exacting</style><style=cSub>This skill <style=cIsHealth>does not gain attack speed bonuses</style>. Instead, attack speed <style=cIsDamage>increases total damage</style>.</style>");
LanguageAPI.Add("2R4R_SHELTER_KEYWORD", "<style=cKeywordName>Shelter</style><style=cSub>Protects from storms and fog.</style>");
LanguageAPI.Add("2R4R_SPARKPICKUP_KEYWORD", "<style=cKeywordName>Energizing Sparks</style><style=cSub>Creates <style=cIsDamage>spark pickups</style> that increase the " + $"<style=cIsDamage>attack speed</style> of all allies within <style=cIsDamage>{Assets.nebulaBoosterBuffRadius}m</style> " + $"by <style=cIsDamage>{Assets.sparkBoosterAspdBonus * 100f}%</style> for {Assets.nebulaBoosterBuffDuration} seconds. " + $"Can stack up to {5} times.</style>");
}
}
}
namespace RainrotSharedUtils.Shelters
{
public class ShelterProviderBehavior : MonoBehaviour
{
private static List<ShelterProviderBehavior> instancesList = new List<ShelterProviderBehavior>();
public static ReadOnlyCollection<ShelterProviderBehavior> readOnlyInstancesList = new ReadOnlyCollection<ShelterProviderBehavior>(instancesList);
internal bool isSuperShelter = false;
public float fallbackRadius;
public IZone zoneBehavior;
public bool IsInBounds(Vector3 position, float radius = 0f)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_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_001c: 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_0022: 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_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: 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_007b: Unknown result type (might be due to invalid IL or missing references)
//IL_0080: Unknown result type (might be due to invalid IL or missing references)
Vector3 val = position;
if (radius > 0f)
{
Vector3 val2 = position - ((Component)this).transform.position;
val = position - ((Vector3)(ref val2)).normalized * radius;
}
if (zoneBehavior != null)
{
return zoneBehavior.IsInBounds(val);
}
if (fallbackRadius < 1f)
{
return false;
}
Vector3 val3 = val - ((Component)this).transform.position;
return ((Vector3)(ref val3)).sqrMagnitude <= fallbackRadius * fallbackRadius;
}
private void OnEnable()
{
instancesList.Add(this);
}
private void OnDisable()
{
instancesList.Remove(this);
}
}
public static class ShelterUtilsModule
{
public static bool useShelterBuff;
public static bool IsBodySuperSheltered(CharacterBody body, float radius = 0f)
{
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
foreach (ShelterProviderBehavior readOnlyInstances in ShelterProviderBehavior.readOnlyInstancesList)
{
if (!readOnlyInstances.isSuperShelter || !readOnlyInstances.IsInBounds(body.corePosition, radius))
{
continue;
}
return true;
}
return false;
}
public static bool IsPositionSuperSheltered(Vector3 position, float radius = 0f)
{
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
foreach (ShelterProviderBehavior readOnlyInstances in ShelterProviderBehavior.readOnlyInstancesList)
{
if (!readOnlyInstances.isSuperShelter || !readOnlyInstances.IsInBounds(position, radius))
{
continue;
}
return true;
}
return false;
}
public static bool IsBodySheltered(CharacterBody body, float radius = 0f)
{
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
foreach (ShelterProviderBehavior readOnlyInstances in ShelterProviderBehavior.readOnlyInstancesList)
{
if (readOnlyInstances.IsInBounds(body.corePosition, radius))
{
return true;
}
}
return false;
}
public static bool IsPositionSheltered(Vector3 position, float radius = 0f)
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
foreach (ShelterProviderBehavior readOnlyInstances in ShelterProviderBehavior.readOnlyInstancesList)
{
if (readOnlyInstances.IsInBounds(position, radius))
{
return true;
}
}
return false;
}
public static void Init()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Expected O, but got Unknown
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Expected O, but got Unknown
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: Expected O, but got Unknown
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: Expected O, but got Unknown
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Expected O, but got Unknown
TeleporterInteraction.Awake += new hook_Awake(SheltersOnTeleporterAwake);
HoldoutZoneController.Awake += new hook_Awake(SheltersOnHoldoutAwake);
SphereZone.OnEnable += new hook_OnEnable(SheltersOnSphereZoneEnable);
VerticalTubeZone.OnEnable += new hook_OnEnable(SheltersOnTubeZoneEnable);
FogDamageController.GetAffectedBodiesOnTeam += new hook_GetAffectedBodiesOnTeam(ShelterProtectFromFog2);
FogDamageController.EvaluateTeam += new hook_EvaluateTeam(ShelterProtectFromFog);
Run.onRunDestroyGlobal += SheltersOnRunDestroy;
}
private static void ShelterProtectFromFog(orig_EvaluateTeam orig, FogDamageController self, TeamIndex teamIndex)
{
//IL_002c: 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)
if (ShelterProviderBehavior.readOnlyInstancesList.Count == self.safeZones.Count)
{
orig.Invoke(self, teamIndex);
return;
}
foreach (TeamComponent teamMember in TeamComponent.GetTeamMembers(teamIndex))
{
CharacterBody body = teamMember.body;
bool flag = self.characterBodyToStacks.ContainsKey(body);
bool flag2 = IsBodySheltered(body);
bool flag3 = body.HasBuff(Buffs.VoidFogStackCooldown);
if (flag2)
{
if (flag)
{
self.characterBodyToStacks.Remove(body);
if (flag3)
{
body.RemoveOldestTimedBuff(Buffs.VoidFogStackCooldown);
}
}
}
else if (!flag)
{
self.characterBodyToStacks.Add(body, 1);
self.DumpArenaDamageInfo(body);
body.AddTimedBuff(Buffs.VoidFogStackCooldown, self.healthFractionRampIncreaseCooldown);
}
else if (!flag3)
{
self.characterBodyToStacks[body]++;
self.DumpArenaDamageInfo(body);
body.AddTimedBuff(Buffs.VoidFogStackCooldown, self.healthFractionRampIncreaseCooldown);
}
}
}
private static IEnumerable<CharacterBody> ShelterProtectFromFog2(orig_GetAffectedBodiesOnTeam orig, FogDamageController self, TeamIndex teamIndex)
{
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
IEnumerable<CharacterBody> source = orig.Invoke(self, teamIndex);
return source.Where((CharacterBody body) => !IsBodySheltered(body));
}
private static ShelterProviderBehavior AddShelterProvider(GameObject obj, IZone zone)
{
ShelterProviderBehavior shelterProviderBehavior = obj.GetComponent<ShelterProviderBehavior>();
if (!Object.op_Implicit((Object)(object)shelterProviderBehavior))
{
shelterProviderBehavior = obj.AddComponent<ShelterProviderBehavior>();
}
shelterProviderBehavior.zoneBehavior = zone;
return shelterProviderBehavior;
}
private static void SheltersOnRunDestroy(Run obj)
{
ReadOnlyCollection<ShelterProviderBehavior> readOnlyInstancesList = ShelterProviderBehavior.readOnlyInstancesList;
for (int num = readOnlyInstancesList.Count - 1; num >= 0; num--)
{
if (Object.op_Implicit((Object)(object)readOnlyInstancesList[num]))
{
Object.Destroy((Object)(object)((Component)readOnlyInstancesList[num]).gameObject);
}
}
}
private static void SheltersOnTeleporterAwake(orig_Awake orig, TeleporterInteraction self)
{
orig.Invoke(self);
ShelterProviderBehavior shelterProviderBehavior = AddShelterProvider(((Component)self).gameObject, (IZone)(object)self.holdoutZoneController);
shelterProviderBehavior.isSuperShelter = true;
}
private static void SheltersOnTubeZoneEnable(orig_OnEnable orig, VerticalTubeZone self)
{
orig.Invoke(self);
AddShelterProvider(((Component)self).gameObject, (IZone)(object)self);
}
private static void SheltersOnSphereZoneEnable(orig_OnEnable orig, SphereZone self)
{
orig.Invoke(self);
AddShelterProvider(((Component)self).gameObject, (IZone)(object)self);
}
private static void SheltersOnHoldoutAwake(orig_Awake orig, HoldoutZoneController self)
{
orig.Invoke(self);
AddShelterProvider(((Component)self).gameObject, (IZone)(object)self);
}
}
}
namespace RainrotSharedUtils.Frost
{
public static class FrostUtilsModule
{
public static int maxIceExplosionsPerSecond = 4;
public static int iceExplosionsThisSecond = 0;
public const int chillStacksMax = 6;
public const float chillProcDuration = 6f;
private static float iceExplosionTrackerTimer = 0f;
public static GameObject iceExplosion => Assets.iceDelayBlastPrefab;
public static void Init()
{
FixSnapfreeze();
}
public static void FixedUpdate()
{
if (maxIceExplosionsPerSecond <= 0 || iceExplosionsThisSecond <= 0)
{
iceExplosionsThisSecond = 0;
iceExplosionTrackerTimer = 1 / maxIceExplosionsPerSecond;
return;
}
iceExplosionTrackerTimer -= Time.fixedDeltaTime;
while (iceExplosionTrackerTimer < 0f)
{
iceExplosionTrackerTimer += 1 / maxIceExplosionsPerSecond;
iceExplosionsThisSecond--;
}
}
public static void FixSnapfreeze()
{
//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)
GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"65d14128d015b6946b0dec7981dfe63a").WaitForCompletion();
ProjectileImpactExplosion componentInChildren = val.GetComponentInChildren<ProjectileImpactExplosion>();
if (Object.op_Implicit((Object)(object)componentInChildren))
{
componentInChildren.destroyOnEnemy = false;
}
}
public static void CreateIceBlast(CharacterBody attackerBody, float baseForce, float damage, float procCoefficient, float radius, bool crit, Vector3 blastPosition, bool isStrongBlast = false, DamageSource damageSource = 0)
{
//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_001b: 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_0031: Expected O, but got Unknown
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Expected O, but got Unknown
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Unknown result type (might be due to invalid IL or missing references)
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: 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_009e: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
if (NetworkServer.active)
{
EffectManager.SpawnEffect(GetIceBlastEffect(isStrongBlast), new EffectData
{
origin = blastPosition,
scale = radius
}, true);
BlastAttack val = new BlastAttack();
val.radius = radius;
val.procCoefficient = procCoefficient;
val.position = blastPosition;
val.attacker = ((Component)attackerBody).gameObject;
val.crit = crit;
val.baseDamage = damage;
val.falloffModel = (FalloffModel)0;
val.baseForce = baseForce;
val.teamIndex = attackerBody.teamComponent.teamIndex;
val.attackerFiltering = (AttackerFiltering)2;
val.damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)int.MinValue), (DamageTypeExtended)0, damageSource);
val.Fire();
}
}
public static GameObject GetIceBlastEffect(bool isStrongBlast)
{
if (isStrongBlast)
{
return Assets.iceNovaEffectStrong;
}
iceExplosionsThisSecond++;
if (iceExplosionsThisSecond < maxIceExplosionsPerSecond)
{
return Assets.iceNovaEffectWeak;
}
return Assets.iceNovaEffectLowPriority;
}
public static void ApplyChillSphere(Vector3 origin, float radius, TeamIndex teamIndex, float duration = 6f, float chillCount = 3f)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Expected O, but got Unknown
//IL_0019: 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_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_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
if (!NetworkServer.active)
{
return;
}
SphereSearch val = new SphereSearch();
val.origin = origin;
val.mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask;
val.radius = radius;
val.RefreshCandidates();
val.FilterCandidatesByHurtBoxTeam(TeamMask.GetUnprotectedTeams(teamIndex));
val.FilterCandidatesByDistinctHurtBoxEntities();
val.OrderCandidatesByDistance();
List<HurtBox> list = new List<HurtBox>();
val.GetHurtBoxes(list);
val.ClearCandidates();
for (int i = 0; i < list.Count; i++)
{
HurtBox val2 = list[i];
CharacterBody val3 = val2.healthComponent?.body;
if (Object.op_Implicit((Object)(object)val3))
{
bool flag = val3.HasBuff(Buffs.FreezeImmune);
bool isInFrozenState = val3.healthComponent.isInFrozenState;
if (!flag && !isInFrozenState)
{
ApplyChillStacks(val3, 100f, chillCount, duration);
}
}
}
list.Clear();
}
public static void ApplyChillStacks(CharacterMaster attackerMaster, CharacterBody vBody, float procChance, float chillCount = 1f, float chillDuration = 6f)
{
ApplyChillStacks(vBody, procChance, chillCount, chillDuration, Object.op_Implicit((Object)(object)attackerMaster) ? attackerMaster.luck : 1f);
}
public static void ApplyChillStacks(CharacterBody vBody, float procChance, float totalChillToApply = 1f, float chillDuration = 6f, float luck = 1f)
{
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
int buffCount = vBody.GetBuffCount(Buffs.Frost);
int num = 0;
int num2 = 10 - 3 * num;
if (buffCount > num2)
{
return;
}
totalChillToApply = Mathf.Min(totalChillToApply, (float)(num2 - buffCount));
for (int i = 0; (float)i < totalChillToApply; i++)
{
if (Util.CheckRoll(procChance, luck, (CharacterMaster)null))
{
vBody.AddTimedBuff(Buffs.Frost.buffIndex, chillDuration);
}
}
}
}
}
namespace RainrotSharedUtils.Components
{
public class DotWard : BuffWard
{
public DotIndex dotIndex = (DotIndex)(-1);
public float damageCoefficient = 1f;
private ProjectileController _projectileController;
private GameObject _ownerObject;
private CharacterBody _ownerBody;
private Inventory _ownerInventory;
public ProjectileController projectileController
{
get
{
if ((Object)(object)_projectileController == (Object)null)
{
_projectileController = ((Component)this).GetComponent<ProjectileController>();
}
return _projectileController;
}
set
{
_projectileController = value;
}
}
public GameObject ownerObject
{
get
{
if ((Object)(object)_ownerObject == (Object)null && (Object)(object)projectileController != (Object)null)
{
_ownerObject = projectileController.owner;
}
return _ownerObject;
}
set
{
_ownerObject = value;
}
}
public CharacterBody ownerBody
{
get
{
if ((Object)(object)_ownerBody == (Object)null && (Object)(object)ownerObject != (Object)null)
{
_ownerBody = ownerObject.GetComponent<CharacterBody>();
}
return _ownerBody;
}
set
{
_ownerBody = value;
}
}
public Inventory ownerInventory
{
get
{
if ((Object)(object)_ownerInventory == (Object)null && (Object)(object)ownerBody != (Object)null)
{
_ownerInventory = ownerBody.inventory;
}
return _ownerInventory;
}
set
{
_ownerInventory = value;
}
}
}
public class NebulaPickup : MonoBehaviour
{
public BuffDef buffDef;
[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;
private bool alive = true;
private void OnTriggerStay(Collider other)
{
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_0081: Expected O, but got Unknown
if ((Object)(object)other != (Object)null && NetworkServer.active && alive && TeamComponent.GetObjectTeam(((Component)other).gameObject) == teamFilter.teamIndex)
{
CharacterBody component = ((Component)other).GetComponent<CharacterBody>();
if (Object.op_Implicit((Object)(object)component))
{
ApplyNebulaBooster(buffDef, component);
EffectManager.SpawnEffect(pickupEffect, new EffectData
{
origin = ((Component)this).transform.position
}, true);
Object.Destroy((Object)(object)baseObject);
}
}
}
public static void ApplyNebulaBooster(BuffDef buffDef, CharacterBody targetBody)
{
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_0073: Unknown result type (might be due to invalid IL or missing references)
//IL_0079: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: Unknown result type (might be due to invalid IL or missing references)
//IL_0083: Unknown result type (might be due to invalid IL or missing references)
if (!NetworkServer.active || !Object.op_Implicit((Object)(object)buffDef))
{
return;
}
Debug.Log((object)"giving booster buffs");
AddBoosterBuff(buffDef, targetBody);
IEnumerable<TeamComponent> teamMembers = TeamComponent.GetTeamMembers(targetBody.teamComponent.teamIndex);
foreach (TeamComponent item in teamMembers)
{
if (!((Object)(object)item != (Object)(object)targetBody.teamComponent))
{
continue;
}
Vector3 val = ((Component)item).transform.position - targetBody.corePosition;
if (((Vector3)(ref val)).sqrMagnitude <= Assets.nebulaBoosterBuffRadius * Assets.nebulaBoosterBuffRadius)
{
CharacterBody body = item.body;
if (Object.op_Implicit((Object)(object)body))
{
AddBoosterBuff(buffDef, body);
}
}
}
}
public static void AddBoosterBuff(BuffDef buffDef, CharacterBody body)
{
body.AddTimedBuff(buffDef, Assets.nebulaBoosterBuffDuration, 5);
}
public static void CreateBoosterPickup(Vector3 spawnPoint, TeamIndex team, GameObject boosterPrefab, int boosterCount = 1)
{
//IL_0021: 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_0033: 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_0074: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)boosterPrefab != (Object)null))
{
return;
}
for (int i = 0; i < boosterCount; i++)
{
Debug.Log((object)"Spawning booster pickup");
GameObject val = Object.Instantiate<GameObject>(boosterPrefab, spawnPoint, Random.rotation);
val.GetComponent<TeamFilter>().teamIndex = team;
VelocityRandomOnStart component = val.GetComponent<VelocityRandomOnStart>();
if ((Object)(object)component != (Object)null)
{
component.baseDirection = new Vector3((float)Random.Range(-1, 1), Random.Range(-0.6f, 0.2f), (float)Random.Range(-1, 1));
}
NetworkServer.Spawn(val);
}
}
}
public class NebulaGravitate : GravitatePickup
{
private void FixedUpdate()
{
//IL_001d: 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_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)base.gravitateTarget))
{
Rigidbody rigidbody = base.rigidbody;
Vector3 velocity = base.rigidbody.velocity;
Vector3 val = ((Component)base.gravitateTarget).transform.position - ((Component)this).transform.position;
rigidbody.velocity = Vector3.MoveTowards(velocity, ((Vector3)(ref val)).normalized * base.maxSpeed, base.acceleration);
}
}
}
[RequireComponent(typeof(ProjectileDamage))]
public class ProjectileIncreaseDamageAfterDistance : MonoBehaviour
{
private ProjectileDamage projectileDamage;
public float requiredDistance = 21f;
public float damageMultiplierOnIncrease = 1f;
public GameObject effectPrefab;
private Vector3 initialPosition;
private bool damageIncreased;
private float requiredDistanceSqr => requiredDistance * requiredDistance;
private void OnEnable()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
initialPosition = ((Component)this).transform.position;
projectileDamage = ((Component)this).GetComponent<ProjectileDamage>();
}
private void FixedUpdate()
{
//IL_0027: 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_0037: 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)
//IL_008a: Unknown result type (might be due to invalid IL or missing references)
//IL_0091: Unknown result type (might be due to invalid IL or missing references)
//IL_009e: Expected O, but got Unknown
if (!NetworkServer.active || damageIncreased)
{
return;
}
Vector3 val = ((Component)this).transform.position - initialPosition;
float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude;
if (sqrMagnitude >= requiredDistanceSqr)
{
damageIncreased = true;
ProjectileDamage obj = projectileDamage;
obj.damage *= damageMultiplierOnIncrease;
if ((Object)(object)effectPrefab != (Object)null)
{
EffectData val2 = new EffectData
{
origin = ((Component)this).transform.position
};
EffectManager.SpawnEffect(effectPrefab, val2, true);
}
}
}
}
public class ProjectileOverlapDecayDamage : ProjectileOverlapLimitHits
{
internal float initialDamageCoefficient = 1f;
internal float initialProcCoefficient = 1f;
public float firstHitDamageMultiplier = 1f;
public float onHitDamageMultiplier = 1f;
}
}