using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.Engi.EngiMissilePainter;
using EntityStates.Mage.Weapon;
using On.EntityStates.Engi.EngiMissilePainter;
using On.EntityStates.Mage.Weapon;
using On.RoR2;
using On.RoR2.Skills;
using R2API;
using R2API.Utils;
using RoR2;
using RoR2.Navigation;
using RoR2.Orbs;
using RoR2.Skills;
using Smite_Items.Artifact;
using Smite_Items.Equipment;
using Smite_Items.Equipment.EliteEquipment;
using Smite_Items.Items;
using Smite_Items.Utils;
using Smite_Items.Utils.Components;
using TMPro;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.UI;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Smite Items")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+3372acf34ce13d6ccdb11eb3f2aba8a0524f8e93")]
[assembly: AssemblyProduct("Smite Items")]
[assembly: AssemblyTitle("Smite Items")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Smite_Items
{
[BepInPlugin("com.irule4567.SmiteItems", "Smite Items", "1.1.0")]
[BepInDependency("com.bepis.r2api", "5.3.0")]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
public class Main : BaseUnityPlugin
{
public const string ModGuid = "com.irule4567.SmiteItems";
public const string ModName = "Smite Items";
public const string ModVer = "1.1.0";
public static AssetBundle MainAssets;
public static Dictionary<string, string> ShaderLookup = new Dictionary<string, string> { { "stubbed hopoo games/deferred/standard", "shaders/deferred/hgstandard" } };
public List<ArtifactBase> Artifacts = new List<ArtifactBase>();
public List<ItemBase> Items = new List<ItemBase>();
public List<EquipmentBase> Equipments = new List<EquipmentBase>();
public List<EliteEquipmentBase> EliteEquipments = new List<EliteEquipmentBase>();
public static ManualLogSource ModLogger;
private void Awake()
{
ModLogger = ((BaseUnityPlugin)this).Logger;
using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Smite_Items.smiteitemsassets"))
{
MainAssets = AssetBundle.LoadFromStream(stream);
}
using (Stream stream2 = Assembly.GetExecutingAssembly().GetManifestResourceStream("Smite_Items.SmiteItems.bnk"))
{
byte[] array = new byte[stream2.Length];
stream2.Read(array, 0, array.Length);
SoundBanks.Add(array);
}
ShaderConversion(MainAssets);
foreach (Type item in from type in Assembly.GetExecutingAssembly().GetTypes()
where !type.IsAbstract && type.IsSubclassOf(typeof(ArtifactBase))
select type)
{
ArtifactBase artifactBase = (ArtifactBase)Activator.CreateInstance(item);
if (ValidateArtifact(artifactBase, Artifacts))
{
artifactBase.Init(((BaseUnityPlugin)this).Config);
}
}
foreach (Type item2 in from type in Assembly.GetExecutingAssembly().GetTypes()
where !type.IsAbstract && type.IsSubclassOf(typeof(ItemBase))
select type)
{
ItemBase itemBase = (ItemBase)Activator.CreateInstance(item2);
if (ValidateItem(itemBase, Items))
{
itemBase.Init(((BaseUnityPlugin)this).Config);
}
}
foreach (Type item3 in from type in Assembly.GetExecutingAssembly().GetTypes()
where !type.IsAbstract && type.IsSubclassOf(typeof(EquipmentBase))
select type)
{
EquipmentBase equipmentBase = (EquipmentBase)Activator.CreateInstance(item3);
if (ValidateEquipment(equipmentBase, Equipments))
{
equipmentBase.Init(((BaseUnityPlugin)this).Config);
}
}
foreach (Type item4 in from type in Assembly.GetExecutingAssembly().GetTypes()
where !type.IsAbstract && type.IsSubclassOf(typeof(EliteEquipmentBase))
select type)
{
EliteEquipmentBase eliteEquipmentBase = (EliteEquipmentBase)Activator.CreateInstance(item4);
if (ValidateEliteEquipment(eliteEquipmentBase, EliteEquipments))
{
eliteEquipmentBase.Init(((BaseUnityPlugin)this).Config);
}
}
}
public static void ShaderConversion(AssetBundle assets)
{
foreach (Material item in from material in assets.LoadAllAssets<Material>()
where ((Object)material.shader).name.StartsWith("stubbed")
select material)
{
Shader val = LegacyResourcesAPI.Load<Shader>(ShaderLookup[((Object)item.shader).name.ToLowerInvariant()]);
if (Object.op_Implicit((Object)(object)val))
{
item.shader = val;
}
}
}
public bool ValidateArtifact(ArtifactBase artifact, List<ArtifactBase> artifactList)
{
bool value = ((BaseUnityPlugin)this).Config.Bind<bool>("Artifact: " + artifact.ArtifactName, "Enable Artifact?", true, "Should this artifact appear for selection?").Value;
if (value)
{
artifactList.Add(artifact);
}
return value;
}
public bool ValidateItem(ItemBase item, List<ItemBase> itemList)
{
string text = item.ItemName.Replace("'", string.Empty);
Debug.Log((object)("name in main: " + text));
bool value = ((BaseUnityPlugin)this).Config.Bind<bool>("Item: " + item.ItemName, "Enable Item?", true, "Should this item appear in runs?").Value;
bool value2 = ((BaseUnityPlugin)this).Config.Bind<bool>("Item: " + item.ItemName, "Blacklist Item from AI Use?", false, "Should the AI not be able to obtain this item?").Value;
if (value)
{
itemList.Add(item);
if (value2)
{
item.AIBlacklisted = true;
}
}
return value;
}
public bool ValidateEquipment(EquipmentBase equipment, List<EquipmentBase> equipmentList)
{
if (((BaseUnityPlugin)this).Config.Bind<bool>("Equipment: " + equipment.EquipmentName, "Enable Equipment?", true, "Should this equipment appear in runs?").Value)
{
equipmentList.Add(equipment);
return true;
}
return false;
}
public bool ValidateEliteEquipment(EliteEquipmentBase eliteEquipment, List<EliteEquipmentBase> eliteEquipmentList)
{
if (((BaseUnityPlugin)this).Config.Bind<bool>("Equipment: " + eliteEquipment.EliteEquipmentName, "Enable Elite Equipment?", true, "Should this elite equipment appear in runs? If disabled, the associated elite will not appear in runs either.").Value)
{
eliteEquipmentList.Add(eliteEquipment);
return true;
}
return false;
}
}
}
namespace Smite_Items.Utils
{
public static class ItemHelpers
{
public static RendererInfo[] ItemDisplaySetup(GameObject obj, bool debugmode = false)
{
//IL_0065: Unknown result type (might be due to invalid IL or missing references)
//IL_00af: Unknown result type (might be due to invalid IL or missing references)
//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
List<Renderer> list = new List<Renderer>();
MeshRenderer[] componentsInChildren = obj.GetComponentsInChildren<MeshRenderer>();
if (componentsInChildren.Length != 0)
{
list.AddRange((IEnumerable<Renderer>)(object)componentsInChildren);
}
SkinnedMeshRenderer[] componentsInChildren2 = obj.GetComponentsInChildren<SkinnedMeshRenderer>();
if (componentsInChildren2.Length != 0)
{
list.AddRange((IEnumerable<Renderer>)(object)componentsInChildren2);
}
RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[list.Count];
for (int i = 0; i < list.Count; i++)
{
if (debugmode)
{
((Component)list[i]).gameObject.AddComponent<MaterialControllerComponents.HGControllerFinder>().Renderer = list[i];
}
array[i] = new RendererInfo
{
defaultMaterial = ((list[i] is SkinnedMeshRenderer) ? list[i].sharedMaterial : list[i].material),
renderer = list[i],
defaultShadowCastingMode = (ShadowCastingMode)1,
ignoreOverlays = false
};
}
return array;
}
public static string OrderManifestLoreFormatter(string deviceName, string estimatedDelivery, string sentTo, string trackingNumber, string devicePickupDesc, string shippingMethod, string orderDetails)
{
string[] value = new string[19]
{
"<align=left>Estimated Delivery:<indent=70%>Sent To:</indent></align>",
"<align=left>" + estimatedDelivery + "<indent=70%>" + sentTo + "</indent></align>",
"",
"<indent=1%><style=cIsDamage><size=125%><u> Shipping Details:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0</u></size></style></indent>",
"",
"<indent=2%>-Order: <style=cIsUtility>" + deviceName + "</style></indent>",
"<indent=4%><style=cStack>Tracking Number: " + trackingNumber + "</style></indent>",
"",
"<indent=2%>-Order Description: " + devicePickupDesc + "</indent>",
"",
"<indent=2%>-Shipping Method: <style=cIsHealth>" + shippingMethod + "</style></indent>",
"",
"",
"",
"<indent=2%>-Order Details: " + orderDetails + "</indent>",
"",
"",
"",
"<style=cStack>Delivery being brought to you by the brand new </style><style=cIsUtility>Orbital Drop-Crate System (TM)</style>. <style=cStack><u>No refunds.</u></style>"
};
return string.Join("\n", value);
}
public static void RefreshTimedBuffs(CharacterBody body, BuffDef buffDef, float duration)
{
//IL_002a: 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)
if (!Object.op_Implicit((Object)(object)body) || body.GetBuffCount(buffDef) <= 0)
{
return;
}
foreach (TimedBuff timedBuff in body.timedBuffs)
{
if (buffDef.buffIndex == timedBuff.buffIndex)
{
timedBuff.timer = duration;
}
}
}
public static void RefreshTimedBuffs(CharacterBody body, BuffDef buffDef, float taperStart, float taperDuration)
{
//IL_002c: 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)
if (!Object.op_Implicit((Object)(object)body) || body.GetBuffCount(buffDef) <= 0)
{
return;
}
int num = 0;
foreach (TimedBuff timedBuff in body.timedBuffs)
{
if (buffDef.buffIndex == timedBuff.buffIndex)
{
timedBuff.timer = taperStart + (float)num * taperDuration;
num++;
}
}
}
public static DotIndex FindAssociatedDotForBuff(BuffDef buff)
{
return (DotIndex)Array.FindIndex(DotController.dotDefs, (DotDef dotDef) => (Object)(object)dotDef.associatedBuff == (Object)(object)buff);
}
}
public static class MathHelpers
{
public static string FloatToPercentageString(float number, float numberBase = 100f)
{
return (number * numberBase).ToString("##0") + "%";
}
public static Vector3 ClosestPointOnSphereToPoint(Vector3 origin, float radius, Vector3 targetPosition)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//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_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: 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_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
Vector3 val = targetPosition - origin;
val = Vector3.Normalize(val);
val *= radius;
return origin + val;
}
public static List<Vector3> DistributePointsEvenlyAroundSphere(int points, float radius, Vector3 origin)
{
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_006b: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: 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_0076: Unknown result type (might be due to invalid IL or missing references)
List<Vector3> list = new List<Vector3>();
double num = Math.PI * (3.0 - Math.Sqrt(5.0));
for (int i = 0; i < points; i++)
{
int num2 = 1 - i / (points - 1) * 2;
double num3 = Math.Sqrt(1 - num2 * num2);
double num4 = num * (double)i;
float num5 = (float)(Math.Cos(num4) * num3);
float num6 = (float)(Math.Sin(num4) * num3);
Vector3 val = origin + new Vector3(num5, (float)num2, num6);
list.Add(val * radius);
}
return list;
}
public static List<Vector3> DistributePointsEvenlyAroundCircle(int points, float radius, Vector3 origin, float angleOffset = 0f)
{
//IL_0028: 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_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
List<Vector3> list = new List<Vector3>();
Vector3 item = default(Vector3);
for (int i = 0; i < points; i++)
{
double num = Math.PI * 2.0 / (double)points * (double)i + (double)angleOffset;
((Vector3)(ref item))..ctor((float)((double)radius * Math.Cos(num) + (double)origin.x), origin.y, (float)((double)radius * Math.Sin(num) + (double)origin.z));
list.Add(item);
}
return list;
}
public static Vector3 GetPointOnUnitSphereCap(Quaternion targetDirection, float angle)
{
//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_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_002d: 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_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
float num = Random.Range(0f, angle) * (MathF.PI / 180f);
Vector2 insideUnitCircle = Random.insideUnitCircle;
Vector2 val = ((Vector2)(ref insideUnitCircle)).normalized * Mathf.Sin(num);
Vector3 val2 = default(Vector3);
((Vector3)(ref val2))..ctor(val.x, val.y, Mathf.Cos(num));
return targetDirection * val2;
}
public static Vector3 GetPointOnUnitSphereCap(Vector3 targetDirection, float angle)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0001: 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)
return GetPointOnUnitSphereCap(Quaternion.LookRotation(targetDirection), angle);
}
public static Vector3 RandomPointOnCircle(Vector3 origin, float radius, Xoroshiro128Plus random)
{
//IL_0011: 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_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
float num = random.RangeFloat(0f, MathF.PI * 2f);
return origin + new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num)) * radius;
}
public static float InverseHyperbolicScaling(float baseValue, float additionalValue, float maxValue, int itemCount)
{
return baseValue + (maxValue - baseValue) * (1f - 1f / (1f + additionalValue * (float)(itemCount - 1)));
}
}
public static class MiscUtils
{
public static Vector3? RaycastToDirection(Vector3 position, float maxDistance, Vector3 direction, int layer)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//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_0015: Unknown result type (might be due to invalid IL or missing references)
RaycastHit val = default(RaycastHit);
if (Physics.Raycast(new Ray(position, direction), ref val, maxDistance, layer, (QueryTriggerInteraction)1))
{
return ((RaycastHit)(ref val)).point;
}
return null;
}
public static IEnumerable<T> Shuffle<T>(this IEnumerable<T> toShuffle, Xoroshiro128Plus random)
{
List<T> list = new List<T>();
foreach (T item in toShuffle)
{
list.Insert(random.RangeInt(0, list.Count + 1), item);
}
return list;
}
public static Vector3 FindClosestNodeToPosition(Vector3 position, HullClassification hullClassification, bool checkAirNodes = false)
{
//IL_001b: 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_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: 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_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: 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)
NodeGraph val = (checkAirNodes ? SceneInfo.instance.airNodes : SceneInfo.instance.groundNodes);
NodeIndex val2 = val.FindClosestNode(position, hullClassification, float.PositiveInfinity);
if (val2 != NodeIndex.invalid)
{
Vector3 result = default(Vector3);
val.GetNodePosition(val2, ref result);
return result;
}
Main.ModLogger.LogInfo((object)$"No closest node to be found for XYZ: {position}, returning 0,0,0");
return Vector3.zero;
}
public static bool TeleportBody(CharacterBody characterBody, GameObject target, GameObject teleportEffect, HullClassification hullClassification, Xoroshiro128Plus rng, float minDistance = 20f, float maxDistance = 45f, bool teleportAir = false)
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: 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_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_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Expected O, but got Unknown
//IL_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_0074: Expected O, but got Unknown
//IL_0084: 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_00a4: Unknown result type (might be due to invalid IL or missing references)
if (!Object.op_Implicit((Object)(object)characterBody))
{
return false;
}
SpawnCard val = ScriptableObject.CreateInstance<SpawnCard>();
val.hullSize = hullClassification;
val.nodeGraphType = (GraphType)(teleportAir ? 1 : 0);
val.prefab = Resources.Load<GameObject>("SpawnCards/HelperPrefab");
GameObject val2 = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(val, new DirectorPlacementRule
{
placementMode = (PlacementMode)1,
position = target.transform.position,
minDistance = minDistance,
maxDistance = maxDistance
}, rng));
if (Object.op_Implicit((Object)(object)val2))
{
TeleportHelper.TeleportBody(characterBody, val2.transform.position);
if (Object.op_Implicit((Object)(object)teleportEffect))
{
EffectManager.SimpleEffect(teleportEffect, val2.transform.position, Quaternion.identity, true);
}
Object.Destroy((Object)(object)val2);
Object.Destroy((Object)(object)val);
return true;
}
Object.Destroy((Object)(object)val);
return false;
}
public static Vector3? AboveTargetVectorFromDamageInfo(DamageInfo damageInfo, float distanceAboveTarget)
{
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: 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_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
//IL_0062: 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_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
//IL_0078: Unknown result type (might be due to invalid IL or missing references)
//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0101: Unknown result type (might be due to invalid IL or missing references)
//IL_0106: Unknown result type (might be due to invalid IL or missing references)
//IL_0108: Unknown result type (might be due to invalid IL or missing references)
//IL_010b: Unknown result type (might be due to invalid IL or missing references)
//IL_0115: 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_013e: 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_0131: Unknown result type (might be due to invalid IL or missing references)
if (damageInfo.rejected || !Object.op_Implicit((Object)(object)damageInfo.attacker))
{
return null;
}
CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
if (Object.op_Implicit((Object)(object)component))
{
TeamMask enemyTeams = TeamMask.GetEnemyTeams(component.teamComponent.teamIndex);
HurtBox val = new SphereSearch
{
radius = 1f,
mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask,
origin = damageInfo.position
}.RefreshCandidates().FilterCandidatesByHurtBoxTeam(enemyTeams).OrderCandidatesByDistance()
.FilterCandidatesByDistinctHurtBoxEntities()
.GetHurtBoxes()
.FirstOrDefault();
if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.healthComponent) && Object.op_Implicit((Object)(object)val.healthComponent.body))
{
CharacterBody body = val.healthComponent.body;
Vector3 val2 = body.mainHurtBox.collider.ClosestPointOnBounds(body.transform.position + new Vector3(0f, 10000f, 0f));
Vector3? val3 = RaycastToDirection(val2, distanceAboveTarget, Vector3.up, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask));
if (val3.HasValue)
{
return val3.Value;
}
return val2 + Vector3.up * distanceAboveTarget;
}
}
return null;
}
public static Vector3? AboveTargetBody(CharacterBody body, float distanceAbove)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: 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_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_0080: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: 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)
if (!Object.op_Implicit((Object)(object)body))
{
return null;
}
Vector3 val = body.mainHurtBox.collider.ClosestPointOnBounds(body.transform.position + new Vector3(0f, 10000f, 0f));
Vector3? val2 = RaycastToDirection(val, distanceAbove, Vector3.up, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask));
if (val2.HasValue)
{
return val2.Value;
}
return val + Vector3.up * distanceAbove;
}
public static Dictionary<string, Vector3> GetAimSurfaceAlignmentInfo(Ray ray, int layerMask, float distance)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: 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_0080: 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)
Dictionary<string, Vector3> dictionary = new Dictionary<string, Vector3>();
RaycastHit val = default(RaycastHit);
if (!Physics.Raycast(ray, ref val, distance, layerMask, (QueryTriggerInteraction)1))
{
Main.ModLogger.LogInfo((object)$"GetAimSurfaceAlignmentInfo did not hit anything in the aim direction on the specified layer ({layerMask}).");
return null;
}
Vector3 point = ((RaycastHit)(ref val)).point;
Vector3 val2 = Vector3.Cross(((Ray)(ref ray)).direction, Vector3.up);
Vector3 val3 = Vector3.ProjectOnPlane(((RaycastHit)(ref val)).normal, val2);
Vector3 value = Vector3.Cross(val2, val3);
dictionary.Add("Position", point);
dictionary.Add("Right", val2);
dictionary.Add("Forward", value);
dictionary.Add("Up", val3);
return dictionary;
}
}
public static class NetworkingHelpers
{
public static T GetObjectFromNetIdValue<T>(uint netIdValue)
{
//IL_0026: 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)
NetworkInstanceId key = default(NetworkInstanceId);
((NetworkInstanceId)(ref key))..ctor(netIdValue);
NetworkIdentity value = null;
if (NetworkServer.active)
{
NetworkServer.objects.TryGetValue(key, out value);
}
else
{
ClientScene.objects.TryGetValue(key, out value);
}
if (Object.op_Implicit((Object)(object)value))
{
T component = ((Component)value).GetComponent<T>();
if (component != null)
{
return component;
}
}
return default(T);
}
}
}
namespace Smite_Items.Utils.Components
{
public class MaterialControllerComponents
{
public class HGControllerFinder : MonoBehaviour
{
public Renderer Renderer;
public Material Material;
public void Start()
{
if (Object.op_Implicit((Object)(object)Renderer))
{
Material = Renderer.materials[0];
if (Object.op_Implicit((Object)(object)Material))
{
switch (((Object)Material.shader).name)
{
case "Hopoo Games/Deferred/Standard":
{
HGStandardController hGStandardController = ((Component)this).gameObject.AddComponent<HGStandardController>();
hGStandardController.Material = Material;
hGStandardController.Renderer = Renderer;
break;
}
case "Hopoo Games/FX/Cloud Remap":
{
HGCloudRemapController hGCloudRemapController = ((Component)this).gameObject.AddComponent<HGCloudRemapController>();
hGCloudRemapController.Material = Material;
hGCloudRemapController.Renderer = Renderer;
break;
}
case "Hopoo Games/FX/Cloud Intersection Remap":
{
HGIntersectionController hGIntersectionController = ((Component)this).gameObject.AddComponent<HGIntersectionController>();
hGIntersectionController.Material = Material;
hGIntersectionController.Renderer = Renderer;
break;
}
}
}
}
Object.Destroy((Object)(object)this);
}
}
public class HGStandardController : MonoBehaviour
{
public enum _RampInfoEnum
{
TwoTone = 0,
SmoothedTwoTone = 1,
Unlitish = 3,
Subsurface = 4,
Grass = 5
}
public enum _DecalLayerEnum
{
Default,
Environment,
Character,
Misc
}
public enum _CullEnum
{
Off,
Front,
Back
}
public enum _PrintDirectionEnum
{
BottomUp = 0,
TopDown = 1,
BackToFront = 3
}
public Material Material;
public Renderer Renderer;
public string MaterialName;
public bool _EnableCutout;
public Color _Color;
public Texture _MainTex;
public Vector2 _MainTexScale;
public Vector2 _MainTexOffset;
[Range(0f, 5f)]
public float _NormalStrength;
public Texture _NormalTex;
public Vector2 _NormalTexScale;
public Vector2 _NormalTexOffset;
public Color _EmColor;
public Texture _EmTex;
[Range(0f, 10f)]
public float _EmPower;
[Range(0f, 1f)]
public float _Smoothness;
public bool _IgnoreDiffuseAlphaForSpeculars;
public _RampInfoEnum _RampChoice;
public _DecalLayerEnum _DecalLayer;
[Range(0f, 1f)]
public float _SpecularStrength;
[Range(0.1f, 20f)]
public float _SpecularExponent;
public _CullEnum _Cull_Mode;
public bool _EnableDither;
[Range(0f, 1f)]
public float _FadeBias;
public bool _EnableFresnelEmission;
public Texture _FresnelRamp;
[Range(0.1f, 20f)]
public float _FresnelPower;
public Texture _FresnelMask;
[Range(0f, 20f)]
public float _FresnelBoost;
public bool _EnablePrinting;
[Range(-25f, 25f)]
public float _SliceHeight;
[Range(0f, 10f)]
public float _PrintBandHeight;
[Range(0f, 1f)]
public float _PrintAlphaDepth;
public Texture _PrintAlphaTexture;
public Vector2 _PrintAlphaTextureScale;
public Vector2 _PrintAlphaTextureOffset;
[Range(0f, 10f)]
public float _PrintColorBoost;
[Range(0f, 4f)]
public float _PrintAlphaBias;
[Range(0f, 1f)]
public float _PrintEmissionToAlbedoLerp;
public _PrintDirectionEnum _PrintDirection;
public Texture _PrintRamp;
[Range(-10f, 10f)]
public float _EliteBrightnessMin;
[Range(-10f, 10f)]
public float _EliteBrightnessMax;
public bool _EnableSplatmap;
public bool _UseVertexColorsInstead;
[Range(0f, 1f)]
public float _BlendDepth;
public Texture _SplatmapTex;
public Vector2 _SplatmapTexScale;
public Vector2 _SplatmapTexOffset;
[Range(0f, 20f)]
public float _SplatmapTileScale;
public Texture _GreenChannelTex;
public Texture _GreenChannelNormalTex;
[Range(0f, 1f)]
public float _GreenChannelSmoothness;
[Range(-2f, 5f)]
public float _GreenChannelBias;
public Texture _BlueChannelTex;
public Texture _BlueChannelNormalTex;
[Range(0f, 1f)]
public float _BlueChannelSmoothness;
[Range(-2f, 5f)]
public float _BlueChannelBias;
public bool _EnableFlowmap;
public Texture _FlowTexture;
public Texture _FlowHeightmap;
public Vector2 _FlowHeightmapScale;
public Vector2 _FlowHeightmapOffset;
public Texture _FlowHeightRamp;
public Vector2 _FlowHeightRampScale;
public Vector2 _FlowHeightRampOffset;
[Range(-1f, 1f)]
public float _FlowHeightBias;
[Range(0.1f, 20f)]
public float _FlowHeightPower;
[Range(0.1f, 20f)]
public float _FlowEmissionStrength;
[Range(0f, 15f)]
public float _FlowSpeed;
[Range(0f, 5f)]
public float _MaskFlowStrength;
[Range(0f, 5f)]
public float _NormalFlowStrength;
[Range(0f, 10f)]
public float _FlowTextureScaleFactor;
public bool _EnableLimbRemoval;
public void Start()
{
GrabMaterialValues();
}
public void GrabMaterialValues()
{
//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_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_0063: Unknown result type (might be due to invalid IL or missing references)
//IL_0074: Unknown result type (might be due to invalid IL or missing references)
//IL_0079: Unknown result type (might be due to invalid IL or missing references)
//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
//IL_00cc: 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_00e7: 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_02df: Unknown result type (might be due to invalid IL or missing references)
//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
//IL_03e8: Unknown result type (might be due to invalid IL or missing references)
//IL_03ed: Unknown result type (might be due to invalid IL or missing references)
//IL_03fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0403: Unknown result type (might be due to invalid IL or missing references)
//IL_051c: Unknown result type (might be due to invalid IL or missing references)
//IL_0521: Unknown result type (might be due to invalid IL or missing references)
//IL_0532: Unknown result type (might be due to invalid IL or missing references)
//IL_0537: Unknown result type (might be due to invalid IL or missing references)
//IL_055e: Unknown result type (might be due to invalid IL or missing references)
//IL_0563: Unknown result type (might be due to invalid IL or missing references)
//IL_0574: Unknown result type (might be due to invalid IL or missing references)
//IL_0579: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)Material))
{
_EnableCutout = Material.IsKeywordEnabled("CUTOUT");
_Color = Material.GetColor("_Color");
_MainTex = Material.GetTexture("_MainTex");
_MainTexScale = Material.GetTextureScale("_MainTex");
_MainTexOffset = Material.GetTextureOffset("_MainTex");
_NormalStrength = Material.GetFloat("_NormalStrength");
_NormalTex = Material.GetTexture("_NormalTex");
_NormalTexScale = Material.GetTextureScale("_NormalTex");
_NormalTexOffset = Material.GetTextureOffset("_NormalTex");
_EmColor = Material.GetColor("_EmColor");
_EmTex = Material.GetTexture("_EmTex");
_EmPower = Material.GetFloat("_EmPower");
_Smoothness = Material.GetFloat("_Smoothness");
_IgnoreDiffuseAlphaForSpeculars = Material.IsKeywordEnabled("FORCE_SPEC");
_RampChoice = (_RampInfoEnum)Material.GetFloat("_RampInfo");
_DecalLayer = (_DecalLayerEnum)Material.GetFloat("_DecalLayer");
_SpecularStrength = Material.GetFloat("_SpecularStrength");
_SpecularExponent = Material.GetFloat("_SpecularExponent");
_Cull_Mode = (_CullEnum)Material.GetFloat("_Cull");
_EnableDither = Material.IsKeywordEnabled("DITHER");
_FadeBias = Material.GetFloat("_FadeBias");
_EnableFresnelEmission = Material.IsKeywordEnabled("FRESNEL_EMISSION");
_FresnelRamp = Material.GetTexture("_FresnelRamp");
_FresnelPower = Material.GetFloat("_FresnelPower");
_FresnelMask = Material.GetTexture("_FresnelMask");
_FresnelBoost = Material.GetFloat("_FresnelBoost");
_EnablePrinting = Material.IsKeywordEnabled("PRINT_CUTOFF");
_SliceHeight = Material.GetFloat("_SliceHeight");
_PrintBandHeight = Material.GetFloat("_SliceBandHeight");
_PrintAlphaDepth = Material.GetFloat("_SliceAlphaDepth");
_PrintAlphaTexture = Material.GetTexture("_SliceAlphaTex");
_PrintAlphaTextureScale = Material.GetTextureScale("_SliceAlphaTex");
_PrintAlphaTextureOffset = Material.GetTextureOffset("_SliceAlphaTex");
_PrintColorBoost = Material.GetFloat("_PrintBoost");
_PrintAlphaBias = Material.GetFloat("_PrintBias");
_PrintEmissionToAlbedoLerp = Material.GetFloat("_PrintEmissionToAlbedoLerp");
_PrintDirection = (_PrintDirectionEnum)Material.GetFloat("_PrintDirection");
_PrintRamp = Material.GetTexture("_PrintRamp");
_EliteBrightnessMin = Material.GetFloat("_EliteBrightnessMin");
_EliteBrightnessMax = Material.GetFloat("_EliteBrightnessMax");
_EnableSplatmap = Material.IsKeywordEnabled("SPLATMAP");
_UseVertexColorsInstead = Material.IsKeywordEnabled("USE_VERTEX_COLORS");
_BlendDepth = Material.GetFloat("_Depth");
_SplatmapTex = Material.GetTexture("_SplatmapTex");
_SplatmapTexScale = Material.GetTextureScale("_SplatmapTex");
_SplatmapTexOffset = Material.GetTextureOffset("_SplatmapTex");
_SplatmapTileScale = Material.GetFloat("_SplatmapTileScale");
_GreenChannelTex = Material.GetTexture("_GreenChannelTex");
_GreenChannelNormalTex = Material.GetTexture("_GreenChannelNormalTex");
_GreenChannelSmoothness = Material.GetFloat("_GreenChannelSmoothness");
_GreenChannelBias = Material.GetFloat("_GreenChannelBias");
_BlueChannelTex = Material.GetTexture("_BlueChannelTex");
_BlueChannelNormalTex = Material.GetTexture("_BlueChannelNormalTex");
_BlueChannelSmoothness = Material.GetFloat("_BlueChannelSmoothness");
_BlueChannelBias = Material.GetFloat("_BlueChannelBias");
_EnableFlowmap = Material.IsKeywordEnabled("FLOWMAP");
_FlowTexture = Material.GetTexture("_FlowTex");
_FlowHeightmap = Material.GetTexture("_FlowHeightmap");
_FlowHeightmapScale = Material.GetTextureScale("_FlowHeightmap");
_FlowHeightmapOffset = Material.GetTextureOffset("_FlowHeightmap");
_FlowHeightRamp = Material.GetTexture("_FlowHeightRamp");
_FlowHeightRampScale = Material.GetTextureScale("_FlowHeightRamp");
_FlowHeightRampOffset = Material.GetTextureOffset("_FlowHeightRamp");
_FlowHeightBias = Material.GetFloat("_FlowHeightBias");
_FlowHeightPower = Material.GetFloat("_FlowHeightPower");
_FlowEmissionStrength = Material.GetFloat("_FlowEmissionStrength");
_FlowSpeed = Material.GetFloat("_FlowSpeed");
_MaskFlowStrength = Material.GetFloat("_FlowMaskStrength");
_NormalFlowStrength = Material.GetFloat("_FlowNormalStrength");
_FlowTextureScaleFactor = Material.GetFloat("_FlowTextureScaleFactor");
_EnableLimbRemoval = Material.IsKeywordEnabled("LIMBREMOVAL");
MaterialName = ((Object)Material).name;
}
}
public void Update()
{
//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_00bd: Unknown result type (might be due to invalid IL or missing references)
//IL_011f: 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_015e: Unknown result type (might be due to invalid IL or missing references)
//IL_03cd: Unknown result type (might be due to invalid IL or missing references)
//IL_03e3: Unknown result type (might be due to invalid IL or missing references)
//IL_0535: Unknown result type (might be due to invalid IL or missing references)
//IL_054b: Unknown result type (might be due to invalid IL or missing references)
//IL_0729: Unknown result type (might be due to invalid IL or missing references)
//IL_073f: Unknown result type (might be due to invalid IL or missing references)
//IL_078b: Unknown result type (might be due to invalid IL or missing references)
//IL_07a1: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)Material))
{
if (((Object)Material).name != MaterialName && Object.op_Implicit((Object)(object)Renderer))
{
GrabMaterialValues();
PutMaterialIntoMeshRenderer(Renderer, Material);
}
SetShaderKeywordBasedOnBool(_EnableCutout, Material, "CUTOUT");
Material.SetColor("_Color", _Color);
if (Object.op_Implicit((Object)(object)_MainTex))
{
Material.SetTexture("_MainTex", _MainTex);
Material.SetTextureScale("_MainTex", _MainTexScale);
Material.SetTextureOffset("_MainTex", _MainTexOffset);
}
else
{
Material.SetTexture("_MainTex", (Texture)null);
}
Material.SetFloat("_NormalStrength", _NormalStrength);
if (Object.op_Implicit((Object)(object)_NormalTex))
{
Material.SetTexture("_NormalTex", _NormalTex);
Material.SetTextureScale("_NormalTex", _NormalTexScale);
Material.SetTextureOffset("_NormalTex", _NormalTexOffset);
}
else
{
Material.SetTexture("_NormalTex", (Texture)null);
}
Material.SetColor("_EmColor", _EmColor);
if (Object.op_Implicit((Object)(object)_EmTex))
{
Material.SetTexture("_EmTex", _EmTex);
}
else
{
Material.SetTexture("_EmTex", (Texture)null);
}
Material.SetFloat("_EmPower", _EmPower);
Material.SetFloat("_Smoothness", _Smoothness);
SetShaderKeywordBasedOnBool(_IgnoreDiffuseAlphaForSpeculars, Material, "FORCE_SPEC");
Material.SetFloat("_RampInfo", Convert.ToSingle(_RampChoice));
Material.SetFloat("_DecalLayer", Convert.ToSingle(_DecalLayer));
Material.SetFloat("_SpecularStrength", _SpecularStrength);
Material.SetFloat("_SpecularExponent", _SpecularExponent);
Material.SetFloat("_Cull", Convert.ToSingle(_Cull_Mode));
SetShaderKeywordBasedOnBool(_EnableDither, Material, "DITHER");
Material.SetFloat("_FadeBias", _FadeBias);
SetShaderKeywordBasedOnBool(_EnableFresnelEmission, Material, "FRESNEL_EMISSION");
if (Object.op_Implicit((Object)(object)_FresnelRamp))
{
Material.SetTexture("_FresnelRamp", _FresnelRamp);
}
else
{
Material.SetTexture("_FresnelRamp", (Texture)null);
}
Material.SetFloat("_FresnelPower", _FresnelPower);
if (Object.op_Implicit((Object)(object)_FresnelMask))
{
Material.SetTexture("_FresnelMask", _FresnelMask);
}
else
{
Material.SetTexture("_FresnelMask", (Texture)null);
}
Material.SetFloat("_FresnelBoost", _FresnelBoost);
SetShaderKeywordBasedOnBool(_EnablePrinting, Material, "PRINT_CUTOFF");
Material.SetFloat("_SliceHeight", _SliceHeight);
Material.SetFloat("_SliceBandHeight", _PrintBandHeight);
Material.SetFloat("_SliceAlphaDepth", _PrintAlphaDepth);
if (Object.op_Implicit((Object)(object)_PrintAlphaTexture))
{
Material.SetTexture("_SliceAlphaTex", _PrintAlphaTexture);
Material.SetTextureScale("_SliceAlphaTex", _PrintAlphaTextureScale);
Material.SetTextureOffset("_SliceAlphaTex", _PrintAlphaTextureOffset);
}
else
{
Material.SetTexture("_SliceAlphaTex", (Texture)null);
}
Material.SetFloat("_PrintBoost", _PrintColorBoost);
Material.SetFloat("_PrintBias", _PrintAlphaBias);
Material.SetFloat("_PrintEmissionToAlbedoLerp", _PrintEmissionToAlbedoLerp);
Material.SetFloat("_PrintDirection", Convert.ToSingle(_PrintDirection));
if (Object.op_Implicit((Object)(object)_PrintRamp))
{
Material.SetTexture("_PrintRamp", _PrintRamp);
}
else
{
Material.SetTexture("_PrintRamp", (Texture)null);
}
Material.SetFloat("_EliteBrightnessMin", _EliteBrightnessMin);
Material.SetFloat("_EliteBrightnessMax", _EliteBrightnessMax);
SetShaderKeywordBasedOnBool(_EnableSplatmap, Material, "SPLATMAP");
SetShaderKeywordBasedOnBool(_UseVertexColorsInstead, Material, "USE_VERTEX_COLORS");
Material.SetFloat("_Depth", _BlendDepth);
if (Object.op_Implicit((Object)(object)_SplatmapTex))
{
Material.SetTexture("_SplatmapTex", _SplatmapTex);
Material.SetTextureScale("_SplatmapTex", _SplatmapTexScale);
Material.SetTextureOffset("_SplatmapTex", _SplatmapTexOffset);
}
else
{
Material.SetTexture("_SplatmapTex", (Texture)null);
}
Material.SetFloat("_SplatmapTileScale", _SplatmapTileScale);
if (Object.op_Implicit((Object)(object)_GreenChannelTex))
{
Material.SetTexture("_GreenChannelTex", _GreenChannelTex);
}
else
{
Material.SetTexture("_GreenChannelTex", (Texture)null);
}
if (Object.op_Implicit((Object)(object)_GreenChannelNormalTex))
{
Material.SetTexture("_GreenChannelNormalTex", _GreenChannelNormalTex);
}
else
{
Material.SetTexture("_GreenChannelNormalTex", (Texture)null);
}
Material.SetFloat("_GreenChannelSmoothness", _GreenChannelSmoothness);
Material.SetFloat("_GreenChannelBias", _GreenChannelBias);
if (Object.op_Implicit((Object)(object)_BlueChannelTex))
{
Material.SetTexture("_BlueChannelTex", _BlueChannelTex);
}
else
{
Material.SetTexture("_BlueChannelTex", (Texture)null);
}
if (Object.op_Implicit((Object)(object)_BlueChannelNormalTex))
{
Material.SetTexture("_BlueChannelNormalTex", _BlueChannelNormalTex);
}
else
{
Material.SetTexture("_BlueChannelNormalTex", (Texture)null);
}
Material.SetFloat("_BlueChannelSmoothness", _BlueChannelSmoothness);
Material.SetFloat("_BlueChannelBias", _BlueChannelBias);
SetShaderKeywordBasedOnBool(_EnableFlowmap, Material, "FLOWMAP");
if (Object.op_Implicit((Object)(object)_FlowTexture))
{
Material.SetTexture("_FlowTex", _FlowTexture);
}
else
{
Material.SetTexture("_FlowTex", (Texture)null);
}
if (Object.op_Implicit((Object)(object)_FlowHeightmap))
{
Material.SetTexture("_FlowHeightmap", _FlowHeightmap);
Material.SetTextureScale("_FlowHeightmap", _FlowHeightmapScale);
Material.SetTextureOffset("_FlowHeightmap", _FlowHeightmapOffset);
}
else
{
Material.SetTexture("_FlowHeightmap", (Texture)null);
}
if (Object.op_Implicit((Object)(object)_FlowHeightRamp))
{
Material.SetTexture("_FlowHeightRamp", _FlowHeightRamp);
Material.SetTextureScale("_FlowHeightRamp", _FlowHeightRampScale);
Material.SetTextureOffset("_FlowHeightRamp", _FlowHeightRampOffset);
}
else
{
Material.SetTexture("_FlowHeightRamp", (Texture)null);
}
Material.SetFloat("_FlowHeightBias", _FlowHeightBias);
Material.SetFloat("_FlowHeightPower", _FlowHeightPower);
Material.SetFloat("_FlowEmissionStrength", _FlowEmissionStrength);
Material.SetFloat("_FlowSpeed", _FlowSpeed);
Material.SetFloat("_FlowMaskStrength", _MaskFlowStrength);
Material.SetFloat("_FlowNormalStrength", _NormalFlowStrength);
Material.SetFloat("_FlowTextureScaleFactor", _FlowTextureScaleFactor);
SetShaderKeywordBasedOnBool(_EnableLimbRemoval, Material, "LIMBREMOVAL");
}
}
}
public class HGCloudRemapController : MonoBehaviour
{
public enum _SrcBlendFloatEnum
{
Zero,
One,
DstColor,
SrcColor,
OneMinusDstColor,
SrcAlpha,
OneMinusSrcColor,
DstAlpha,
OneMinusDstAlpha,
SrcAlphaSaturate,
OneMinusSrcAlpha
}
public enum _DstBlendFloatEnum
{
Zero,
One,
DstColor,
SrcColor,
OneMinusDstColor,
SrcAlpha,
OneMinusSrcColor,
DstAlpha,
OneMinusDstAlpha,
SrcAlphaSaturate,
OneMinusSrcAlpha
}
public enum _CullEnum
{
Off,
Front,
Back
}
public enum _ZTestEnum
{
Disabled,
Never,
Less,
Equal,
LessEqual,
Greater,
NotEqual,
GreaterEqual,
Always
}
public Material Material;
public Renderer Renderer;
public string MaterialName;
public _SrcBlendFloatEnum _Source_Blend_Mode;
public _DstBlendFloatEnum _Destination_Blend_Mode;
public int _InternalSimpleBlendMode;
public Color _Tint;
public bool _DisableRemapping;
public Texture _MainTex;
public Vector2 _MainTexScale;
public Vector2 _MainTexOffset;
public Texture _RemapTex;
public Vector2 _RemapTexScale;
public Vector2 _RemapTexOffset;
[Range(0f, 2f)]
public float _SoftFactor;
[Range(1f, 20f)]
public float _BrightnessBoost;
[Range(0f, 20f)]
public float _AlphaBoost;
[Range(0f, 1f)]
public float _AlphaBias;
public bool _UseUV1;
public bool _FadeWhenNearCamera;
[Range(0f, 1f)]
public float _FadeCloseDistance;
public _CullEnum _Cull_Mode;
public _ZTestEnum _ZTest_Mode;
[Range(-10f, 10f)]
public float _DepthOffset;
public bool _CloudRemapping;
public bool _DistortionClouds;
[Range(-2f, 2f)]
public float _DistortionStrength;
public Texture _Cloud1Tex;
public Vector2 _Cloud1TexScale;
public Vector2 _Cloud1TexOffset;
public Texture _Cloud2Tex;
public Vector2 _Cloud2TexScale;
public Vector2 _Cloud2TexOffset;
public Vector4 _CutoffScroll;
public bool _VertexColors;
public bool _LuminanceForVertexAlpha;
public bool _LuminanceForTextureAlpha;
public bool _VertexOffset;
public bool _FresnelFade;
public bool _SkyboxOnly;
[Range(-20f, 20f)]
public float _FresnelPower;
[Range(0f, 3f)]
public float _VertexOffsetAmount;
public void Start()
{
GrabMaterialValues();
}
public void GrabMaterialValues()
{
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: 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_00b9: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
//IL_0100: Unknown result type (might be due to invalid IL or missing references)
//IL_0247: 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_025d: Unknown result type (might be due to invalid IL or missing references)
//IL_0262: Unknown result type (might be due to invalid IL or missing references)
//IL_0289: Unknown result type (might be due to invalid IL or missing references)
//IL_028e: Unknown result type (might be due to invalid IL or missing references)
//IL_029f: Unknown result type (might be due to invalid IL or missing references)
//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
//IL_02b5: Unknown result type (might be due to invalid IL or missing references)
//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)Material))
{
_Source_Blend_Mode = (_SrcBlendFloatEnum)Material.GetFloat("_SrcBlend");
_Destination_Blend_Mode = (_DstBlendFloatEnum)Material.GetFloat("_DstBlend");
_InternalSimpleBlendMode = (int)Material.GetFloat("_InternalSimpleBlendMode");
_Tint = Material.GetColor("_TintColor");
_DisableRemapping = Material.IsKeywordEnabled("DISABLEREMAP");
_MainTex = Material.GetTexture("_MainTex");
_MainTexScale = Material.GetTextureScale("_MainTex");
_MainTexOffset = Material.GetTextureOffset("_MainTex");
_RemapTex = Material.GetTexture("_RemapTex");
_RemapTexScale = Material.GetTextureScale("_RemapTex");
_RemapTexOffset = Material.GetTextureOffset("_RemapTex");
_SoftFactor = Material.GetFloat("_InvFade");
_BrightnessBoost = Material.GetFloat("_Boost");
_AlphaBoost = Material.GetFloat("_AlphaBoost");
_AlphaBias = Material.GetFloat("_AlphaBias");
_UseUV1 = Material.IsKeywordEnabled("USE_UV1");
_FadeWhenNearCamera = Material.IsKeywordEnabled("FADECLOSE");
_FadeCloseDistance = Material.GetFloat("_FadeCloseDistance");
_Cull_Mode = (_CullEnum)Material.GetFloat("_Cull");
_ZTest_Mode = (_ZTestEnum)Material.GetFloat("_ZTest");
_DepthOffset = Material.GetFloat("_DepthOffset");
_CloudRemapping = Material.IsKeywordEnabled("USE_CLOUDS");
_DistortionClouds = Material.IsKeywordEnabled("CLOUDOFFSET");
_DistortionStrength = Material.GetFloat("_DistortionStrength");
_Cloud1Tex = Material.GetTexture("_Cloud1Tex");
_Cloud1TexScale = Material.GetTextureScale("_Cloud1Tex");
_Cloud1TexOffset = Material.GetTextureOffset("_Cloud1Tex");
_Cloud2Tex = Material.GetTexture("_Cloud2Tex");
_Cloud2TexScale = Material.GetTextureScale("_Cloud2Tex");
_Cloud2TexOffset = Material.GetTextureOffset("_Cloud2Tex");
_CutoffScroll = Material.GetVector("_CutoffScroll");
_VertexColors = Material.IsKeywordEnabled("VERTEXCOLOR");
_LuminanceForVertexAlpha = Material.IsKeywordEnabled("VERTEXALPHA");
_LuminanceForTextureAlpha = Material.IsKeywordEnabled("CALCTEXTUREALPHA");
_VertexOffset = Material.IsKeywordEnabled("VERTEXOFFSET");
_FresnelFade = Material.IsKeywordEnabled("FRESNEL");
_SkyboxOnly = Material.IsKeywordEnabled("SKYBOX_ONLY");
_FresnelPower = Material.GetFloat("_FresnelPower");
_VertexOffsetAmount = Material.GetFloat("_OffsetAmount");
MaterialName = ((Object)Material).name;
}
}
public void Update()
{
//IL_00af: Unknown result type (might be due to invalid IL or missing references)
//IL_00fe: 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_0160: 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_02f4: Unknown result type (might be due to invalid IL or missing references)
//IL_030a: Unknown result type (might be due to invalid IL or missing references)
//IL_0356: Unknown result type (might be due to invalid IL or missing references)
//IL_036c: Unknown result type (might be due to invalid IL or missing references)
//IL_0395: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)Material))
{
if (((Object)Material).name != MaterialName && Object.op_Implicit((Object)(object)Renderer))
{
GrabMaterialValues();
PutMaterialIntoMeshRenderer(Renderer, Material);
}
Material.SetFloat("_SrcBlend", Convert.ToSingle(_Source_Blend_Mode));
Material.SetFloat("_DstBlend", Convert.ToSingle(_Destination_Blend_Mode));
Material.SetFloat("_InternalSimpleBlendMode", (float)_InternalSimpleBlendMode);
Material.SetColor("_TintColor", _Tint);
SetShaderKeywordBasedOnBool(_DisableRemapping, Material, "DISABLEREMAP");
if (Object.op_Implicit((Object)(object)_MainTex))
{
Material.SetTexture("_MainTex", _MainTex);
Material.SetTextureScale("_MainTex", _MainTexScale);
Material.SetTextureOffset("_MainTex", _MainTexOffset);
}
else
{
Material.SetTexture("_MainTex", (Texture)null);
}
if (Object.op_Implicit((Object)(object)_RemapTex))
{
Material.SetTexture("_RemapTex", _RemapTex);
Material.SetTextureScale("_RemapTex", _RemapTexScale);
Material.SetTextureOffset("_RemapTex", _RemapTexOffset);
}
else
{
Material.SetTexture("_RemapTex", (Texture)null);
}
Material.SetFloat("_InvFade", _SoftFactor);
Material.SetFloat("_Boost", _BrightnessBoost);
Material.SetFloat("_AlphaBoost", _AlphaBoost);
Material.SetFloat("_AlphaBias", _AlphaBias);
SetShaderKeywordBasedOnBool(_UseUV1, Material, "USE_UV1");
SetShaderKeywordBasedOnBool(_FadeWhenNearCamera, Material, "FADECLOSE");
Material.SetFloat("_FadeCloseDistance", _FadeCloseDistance);
Material.SetFloat("_Cull", Convert.ToSingle(_Cull_Mode));
Material.SetFloat("_ZTest", Convert.ToSingle(_ZTest_Mode));
Material.SetFloat("_DepthOffset", _DepthOffset);
SetShaderKeywordBasedOnBool(_CloudRemapping, Material, "USE_CLOUDS");
SetShaderKeywordBasedOnBool(_DistortionClouds, Material, "CLOUDOFFSET");
Material.SetFloat("_DistortionStrength", _DistortionStrength);
if (Object.op_Implicit((Object)(object)_Cloud1Tex))
{
Material.SetTexture("_Cloud1Tex", _Cloud1Tex);
Material.SetTextureScale("_Cloud1Tex", _Cloud1TexScale);
Material.SetTextureOffset("_Cloud1Tex", _Cloud1TexOffset);
}
else
{
Material.SetTexture("_Cloud1Tex", (Texture)null);
}
if (Object.op_Implicit((Object)(object)_Cloud2Tex))
{
Material.SetTexture("_Cloud2Tex", _Cloud2Tex);
Material.SetTextureScale("_Cloud2Tex", _Cloud2TexScale);
Material.SetTextureOffset("_Cloud2Tex", _Cloud2TexOffset);
}
else
{
Material.SetTexture("_Cloud2Tex", (Texture)null);
}
Material.SetVector("_CutoffScroll", _CutoffScroll);
SetShaderKeywordBasedOnBool(_VertexColors, Material, "VERTEXCOLOR");
SetShaderKeywordBasedOnBool(_LuminanceForVertexAlpha, Material, "VERTEXALPHA");
SetShaderKeywordBasedOnBool(_LuminanceForTextureAlpha, Material, "CALCTEXTUREALPHA");
SetShaderKeywordBasedOnBool(_VertexOffset, Material, "VERTEXOFFSET");
SetShaderKeywordBasedOnBool(_FresnelFade, Material, "FRESNEL");
SetShaderKeywordBasedOnBool(_SkyboxOnly, Material, "SKYBOX_ONLY");
Material.SetFloat("_FresnelPower", _FresnelPower);
Material.SetFloat("_OffsetAmount", _VertexOffsetAmount);
}
}
}
public class HGIntersectionController : MonoBehaviour
{
public enum _SrcBlendFloatEnum
{
Zero,
One,
DstColor,
SrcColor,
OneMinusDstColor,
SrcAlpha,
OneMinusSrcColor,
DstAlpha,
OneMinusDstAlpha,
SrcAlphaSaturate,
OneMinusSrcAlpha
}
public enum _DstBlendFloatEnum
{
Zero,
One,
DstColor,
SrcColor,
OneMinusDstColor,
SrcAlpha,
OneMinusSrcColor,
DstAlpha,
OneMinusDstAlpha,
SrcAlphaSaturate,
OneMinusSrcAlpha
}
public enum _CullEnum
{
Off,
Front,
Back
}
public Material Material;
public Renderer Renderer;
public string MaterialName;
public _SrcBlendFloatEnum _Source_Blend_Mode;
public _DstBlendFloatEnum _Destination_Blend_Mode;
public Color _Tint;
public Texture _MainTex;
public Vector2 _MainTexScale;
public Vector2 _MainTexOffset;
public Texture _Cloud1Tex;
public Vector2 _Cloud1TexScale;
public Vector2 _Cloud1TexOffset;
public Texture _Cloud2Tex;
public Vector2 _Cloud2TexScale;
public Vector2 _Cloud2TexOffset;
public Texture _RemapTex;
public Vector2 _RemapTexScale;
public Vector2 _RemapTexOffset;
public Vector4 _CutoffScroll;
[Range(0f, 30f)]
public float _SoftFactor;
[Range(0.1f, 20f)]
public float _SoftPower;
[Range(0f, 5f)]
public float _BrightnessBoost;
[Range(0.1f, 20f)]
public float _RimPower;
[Range(0f, 5f)]
public float _RimStrength;
[Range(0f, 20f)]
public float _AlphaBoost;
[Range(0f, 20f)]
public float _IntersectionStrength;
public _CullEnum _Cull_Mode;
public bool _FadeFromVertexColorsOn;
public bool _EnableTriplanarProjectionsForClouds;
public void Start()
{
GrabMaterialValues();
}
public void GrabMaterialValues()
{
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_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_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0091: Unknown result type (might be due to invalid IL or missing references)
//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
//IL_0110: 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_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_0152: Unknown result type (might be due to invalid IL or missing references)
//IL_0157: Unknown result type (might be due to invalid IL or missing references)
//IL_0168: Unknown result type (might be due to invalid IL or missing references)
//IL_016d: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)Material))
{
_Source_Blend_Mode = (_SrcBlendFloatEnum)Material.GetFloat("_SrcBlendFloat");
_Destination_Blend_Mode = (_DstBlendFloatEnum)Material.GetFloat("_DstBlendFloat");
_Tint = Material.GetColor("_TintColor");
_MainTex = Material.GetTexture("_MainTex");
_MainTexScale = Material.GetTextureScale("_MainTex");
_MainTexOffset = Material.GetTextureOffset("_MainTex");
_Cloud1Tex = Material.GetTexture("_Cloud1Tex");
_Cloud1TexScale = Material.GetTextureScale("_Cloud1Tex");
_Cloud1TexOffset = Material.GetTextureOffset("_Cloud1Tex");
_Cloud2Tex = Material.GetTexture("_Cloud2Tex");
_Cloud2TexScale = Material.GetTextureScale("_Cloud2Tex");
_Cloud2TexOffset = Material.GetTextureOffset("_Cloud2Tex");
_RemapTex = Material.GetTexture("_RemapTex");
_RemapTexScale = Material.GetTextureScale("_RemapTex");
_RemapTexOffset = Material.GetTextureOffset("_RemapTex");
_CutoffScroll = Material.GetVector("_CutoffScroll");
_SoftFactor = Material.GetFloat("_InvFade");
_SoftPower = Material.GetFloat("_SoftPower");
_BrightnessBoost = Material.GetFloat("_Boost");
_RimPower = Material.GetFloat("_RimPower");
_RimStrength = Material.GetFloat("_RimStrength");
_AlphaBoost = Material.GetFloat("_AlphaBoost");
_IntersectionStrength = Material.GetFloat("_IntersectionStrength");
_Cull_Mode = (_CullEnum)Material.GetFloat("_Cull");
_FadeFromVertexColorsOn = Material.IsKeywordEnabled("FADE_FROM_VERTEX_COLORS");
_EnableTriplanarProjectionsForClouds = Material.IsKeywordEnabled("TRIPLANAR");
MaterialName = ((Object)Material).name;
}
}
public void Update()
{
//IL_0098: 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_00e7: 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_0149: 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_01ab: 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_020d: 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)
if (Object.op_Implicit((Object)(object)Material))
{
if (((Object)Material).name != MaterialName && Object.op_Implicit((Object)(object)Renderer))
{
GrabMaterialValues();
PutMaterialIntoMeshRenderer(Renderer, Material);
}
Material.SetFloat("_SrcBlendFloat", Convert.ToSingle(_Source_Blend_Mode));
Material.SetFloat("_DstBlendFloat", Convert.ToSingle(_Destination_Blend_Mode));
Material.SetColor("_TintColor", _Tint);
if (Object.op_Implicit((Object)(object)_MainTex))
{
Material.SetTexture("_MainTex", _MainTex);
Material.SetTextureScale("_MainTex", _MainTexScale);
Material.SetTextureOffset("_MainTex", _MainTexOffset);
}
else
{
Material.SetTexture("_MainTex", (Texture)null);
}
if (Object.op_Implicit((Object)(object)_Cloud1Tex))
{
Material.SetTexture("_Cloud1Tex", _Cloud1Tex);
Material.SetTextureScale("_Cloud1Tex", _Cloud1TexScale);
Material.SetTextureOffset("_Cloud1Tex", _Cloud1TexOffset);
}
else
{
Material.SetTexture("_Cloud1Tex", (Texture)null);
}
if (Object.op_Implicit((Object)(object)_Cloud2Tex))
{
Material.SetTexture("_Cloud2Tex", _Cloud2Tex);
Material.SetTextureScale("_Cloud2Tex", _Cloud2TexScale);
Material.SetTextureOffset("_Cloud2Tex", _Cloud2TexOffset);
}
else
{
Material.SetTexture("_Cloud2Tex", (Texture)null);
}
if (Object.op_Implicit((Object)(object)_RemapTex))
{
Material.SetTexture("_RemapTex", _RemapTex);
Material.SetTextureScale("_RemapTex", _RemapTexScale);
Material.SetTextureOffset("_RemapTex", _RemapTexOffset);
}
else
{
Material.SetTexture("_RemapTex", (Texture)null);
}
Material.SetVector("_CutoffScroll", _CutoffScroll);
Material.SetFloat("_InvFade", _SoftFactor);
Material.SetFloat("_SoftPower", _SoftPower);
Material.SetFloat("_Boost", _BrightnessBoost);
Material.SetFloat("_RimPower", _RimPower);
Material.SetFloat("_RimStrength", _RimStrength);
Material.SetFloat("_AlphaBoost", _AlphaBoost);
Material.SetFloat("_IntersectionStrength", _IntersectionStrength);
Material.SetFloat("_Cull", Convert.ToSingle(_Cull_Mode));
SetShaderKeywordBasedOnBool(_FadeFromVertexColorsOn, Material, "FADE_FROM_VERTEX_COLORS");
SetShaderKeywordBasedOnBool(_EnableTriplanarProjectionsForClouds, Material, "TRIPLANAR");
}
}
}
public static void SetShaderKeywordBasedOnBool(bool enabled, Material material, string keyword)
{
if (!Object.op_Implicit((Object)(object)material))
{
return;
}
if (enabled)
{
if (!material.IsKeywordEnabled(keyword))
{
material.EnableKeyword(keyword);
}
}
else if (material.IsKeywordEnabled(keyword))
{
material.DisableKeyword(keyword);
}
}
public static void PutMaterialIntoMeshRenderer(Renderer renderer, Material material)
{
if (Object.op_Implicit((Object)(object)material) && Object.op_Implicit((Object)(object)renderer))
{
renderer.materials[0] = material;
}
}
}
}
namespace Smite_Items.Items
{
public abstract class ItemBase<T> : ItemBase where T : ItemBase<T>
{
public static T instance { get; private set; }
public ItemBase()
{
if (instance != null)
{
throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting ItemBase was instantiated twice");
}
instance = this as T;
}
}
public abstract class ItemBase
{
public ItemDef ItemDef;
public abstract string ItemName { get; }
public abstract string ItemLangTokenName { get; }
public abstract string ItemPickupDesc { get; }
public abstract string ItemFullDescription { get; }
public abstract string ItemLore { get; }
public abstract ItemTier Tier { get; }
public virtual ItemTag[] ItemTags { get; set; } = (ItemTag[])(object)new ItemTag[0];
public abstract GameObject ItemModel { get; }
public abstract Sprite ItemIcon { get; }
public virtual bool CanRemove { get; } = true;
public virtual bool AIBlacklisted { get; set; }
public abstract void Init(ConfigFile config);
public virtual void CreateConfig(ConfigFile config)
{
}
protected virtual void CreateLang()
{
LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_NAME", ItemName);
LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_PICKUP", ItemPickupDesc);
LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_DESCRIPTION", ItemFullDescription);
LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_LORE", ItemLore);
}
public abstract ItemDisplayRuleDict CreateItemDisplayRules();
protected void CreateItem()
{
//IL_0111: Unknown result type (might be due to invalid IL or missing references)
//IL_0116: Unknown result type (might be due to invalid IL or missing references)
//IL_0141: Unknown result type (might be due to invalid IL or missing references)
//IL_014b: Expected O, but got Unknown
if (AIBlacklisted)
{
ItemTags = new List<ItemTag>(ItemTags) { (ItemTag)4 }.ToArray();
}
ItemDef = ScriptableObject.CreateInstance<ItemDef>();
((Object)ItemDef).name = "ITEM_" + ItemLangTokenName;
ItemDef.nameToken = "ITEM_" + ItemLangTokenName + "_NAME";
ItemDef.pickupToken = "ITEM_" + ItemLangTokenName + "_PICKUP";
ItemDef.descriptionToken = "ITEM_" + ItemLangTokenName + "_DESCRIPTION";
ItemDef.loreToken = "ITEM_" + ItemLangTokenName + "_LORE";
ItemDef.pickupModelPrefab = ItemModel;
ItemDef.pickupIconSprite = ItemIcon;
ItemDef.hidden = false;
ItemDef.canRemove = CanRemove;
ItemDef.deprecatedTier = Tier;
if (ItemTags.Length != 0)
{
ItemDef.tags = ItemTags;
}
ItemAPI.Add(new CustomItem(ItemDef, CreateItemDisplayRules()));
}
public virtual void Hooks()
{
}
public int GetCount(CharacterBody body)
{
if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory))
{
return 0;
}
return body.inventory.GetItemCount(ItemDef);
}
public int GetCount(CharacterMaster master)
{
if (!Object.op_Implicit((Object)(object)master) || !Object.op_Implicit((Object)(object)master.inventory))
{
return 0;
}
return master.inventory.GetItemCount(ItemDef);
}
public int GetCountSpecific(CharacterBody body, ItemDef itemDef)
{
if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory))
{
return 0;
}
return body.inventory.GetItemCount(itemDef);
}
}
public class GluttonousGrimoire : ItemBase<GluttonousGrimoire>
{
public ConfigEntry<float> PercentHealingConverted;
public ConfigEntry<float> PercentHealingConvertedAtMax;
public static BuffDef storedBonusDamage;
private Dictionary<CharacterBody, float> cachedHealingConverted = new Dictionary<CharacterBody, float>();
private Dictionary<CharacterBody, float> cachedHealingConvertedAtMax = new Dictionary<CharacterBody, float>();
private Dictionary<CharacterBody, float> lastPrimaryUseTime = new Dictionary<CharacterBody, float>();
private const float PRIMARY_SKILL_WINDOW = 0.5f;
public override string ItemName => "Gluttonous Grimoire";
public override string ItemLangTokenName => "GLUTTONOUS_GRIMOIRE_ITEM";
public override string ItemPickupDesc => "Convert healing to bonus damage.";
public override string ItemFullDescription => $"<style=cIsHealing>Convert {PercentHealingConverted.Value * 100f}%</style> <style=cStack>(+{PercentHealingConverted.Value * 100f}% per stack hyperbolically)</style> of healing or <style=cIsHealing>{PercentHealingConvertedAtMax.Value * 100f}%</style> <style=cStack>(+{PercentHealingConvertedAtMax.Value * 100f}% per stack hyperbolically)</style> of healing at <style=cIsHealing>full health</style> into a stored <style=cIsDamage>damage</style> bonus on the next hit of your <style=cIsUtility>primary skill</style>.";
public override string ItemLore => "Item taken from Smite 2.";
public override ItemTier Tier => (ItemTier)3;
public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[2]
{
(ItemTag)2,
(ItemTag)1
};
public override GameObject ItemModel => Main.MainAssets.LoadAsset<GameObject>("GluttonousGrimoireModel.prefab");
public override Sprite ItemIcon => Main.MainAssets.LoadAsset<Sprite>("Gluttonous Grimoire Icon.png");
public override void Init(ConfigFile config)
{
CreateConfig(config);
CreateLang();
CreateItem();
CreateBuff();
Hooks();
}
public void CreateBuff()
{
storedBonusDamage = ScriptableObject.CreateInstance<BuffDef>();
storedBonusDamage.canStack = true;
storedBonusDamage.isDebuff = false;
((Object)storedBonusDamage).name = "storedBonusDamage";
storedBonusDamage.isCooldown = false;
storedBonusDamage.iconSprite = Main.MainAssets.LoadAsset<Sprite>("Gluttonous Grimoire Icon.png");
ContentAddition.AddBuffDef(storedBonusDamage);
}
public override void CreateConfig(ConfigFile config)
{
PercentHealingConverted = config.Bind<float>("Item: " + ItemName, "Percent healing converted", 0.25f, "What percentage of healing is converted to bonus damage on next primary skill hit?");
PercentHealingConvertedAtMax = config.Bind<float>("Item: " + ItemName, "Percent healing converted while at max health", 0.4f, "What percentage of healing is converted to bonus damage on next primary skill hit while at maximum health?");
}
public override ItemDisplayRuleDict CreateItemDisplayRules()
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Expected O, but got Unknown
//IL_0032: 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_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Expected O, but got Unknown
//IL_0082: 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_00da: Unknown result type (might be due to invalid IL or missing references)
//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_00f8: Unknown result type (might be due to invalid IL or missing references)
//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0107: Unknown result type (might be due to invalid IL or missing references)
//IL_010d: Expected O, but got Unknown
ModelPanelParameters obj = ItemModel.AddComponent<ModelPanelParameters>();
GameObject val = new GameObject("FocusPoint");
val.transform.SetParent(ItemModel.transform);
val.transform.localPosition = Vector3.zero;
val.transform.localRotation = Quaternion.identity;
GameObject val2 = new GameObject("CameraPosition");
val2.transform.SetParent(ItemModel.transform);
val2.transform.localPosition = new Vector3(1f, 0f, 0f);
val2.transform.localRotation = Quaternion.identity;
obj.focusPointTransform = val.transform;
obj.cameraPositionTransform = val2.transform;
obj.minDistance = 100f;
obj.maxDistance = 200f;
obj.modelRotation = Quaternion.Euler(new Vector3(0f, 90f, 0f));
obj.modelPositionOffset = new Vector3(0f, 50f, 0f);
return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
}
public override void Hooks()
{
//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
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Expected O, but got Unknown
CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(AdjustHealingConversion);
HealthComponent.Heal += new hook_Heal(HandleHealingConversion);
CharacterBody.OnSkillActivated += new hook_OnSkillActivated(TrackPrimarySkillUse);
HealthComponent.TakeDamage += new hook_TakeDamage(GrimoireDamageBonus);
GlobalEventManager.onCharacterDeathGlobal += CleanupDictionaries;
}
private void CleanupDictionaries(DamageReport report)
{
if (Object.op_Implicit((Object)(object)report.victimBody))
{
CharacterBody victimBody = report.victimBody;
lastPrimaryUseTime.Remove(victimBody);
cachedHealingConverted.Remove(victimBody);
cachedHealingConvertedAtMax.Remove(victimBody);
}
}
private void GrimoireDamageBonus(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
{
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
orig.Invoke(self, damageInfo);
if (!Object.op_Implicit((Object)(object)damageInfo.attacker) || !Object.op_Implicit((Object)(object)damageInfo.attacker.GetComponent<CharacterBody>()))
{
return;
}
CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
if (Object.op_Implicit((Object)(object)component.inventory) && GetCount(component) > 0)
{
bool flag = false;
if (lastPrimaryUseTime.ContainsKey(component))
{
flag = Time.time - lastPrimaryUseTime[component] < 0.5f;
}
if (component.HasBuff(storedBonusDamage) && flag)
{
int buffCount = component.GetBuffCount(storedBonusDamage);
damageInfo.damage = buffCount;
damageInfo.damageColorIndex = (DamageColorIndex)3;
damageInfo.procCoefficient = 0f;
damageInfo.crit = false;
damageInfo.inflictor = damageInfo.attacker;
component.SetBuffCount(storedBonusDamage.buffIndex, 0);
self.TakeDamage(damageInfo);
}
}
}
private void TrackPrimarySkillUse(orig_OnSkillActivated orig, CharacterBody self, GenericSkill skill)
{
orig.Invoke(self, skill);
if (Object.op_Implicit((Object)(object)self.skillLocator.primary) && Object.op_Implicit((Object)(object)skill) && (Object)(object)self.skillLocator.primary.skillDef == (Object)(object)skill.skillDef)
{
lastPrimaryUseTime[self] = Time.time;
}
}
private void AdjustHealingConversion(orig_OnInventoryChanged orig, CharacterBody self)
{
orig.Invoke(self);
int count = GetCount(self);
if (count > 0)
{
cachedHealingConverted[self] = 1f - 1f / (1f + PercentHealingConverted.Value * (float)count);
cachedHealingConvertedAtMax[self] = 1f - 1f / (1f + PercentHealingConvertedAtMax.Value * (float)count);
}
else
{
cachedHealingConverted.Remove(self);
cachedHealingConvertedAtMax.Remove(self);
}
}
private float HandleHealingConversion(orig_Heal orig, HealthComponent self, float amount, ProcChainMask procChainMask, bool nonRegen)
{
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_0129: Unknown result type (might be due to invalid IL or missing references)
//IL_010c: Unknown result type (might be due to invalid IL or missing references)
//IL_011c: Unknown result type (might be due to invalid IL or missing references)
if (!NetworkServer.active)
{
return orig.Invoke(self, amount, procChainMask, nonRegen);
}
if (Object.op_Implicit((Object)(object)self) && self.alive && Object.op_Implicit((Object)(object)self.body) && Object.op_Implicit((Object)(object)self.body.inventory) && GetCount(self.body) > 0 && nonRegen)
{
float num;
int num2;
if (self.health >= self.fullHealth)
{
num = amount * (1f - cachedHealingConvertedAtMax.GetValueOrDefault(self.body, 0f));
num2 = Mathf.RoundToInt(amount * cachedHealingConvertedAtMax.GetValueOrDefault(self.body, 0f));
}
else
{
num = amount * (1f - cachedHealingConverted.GetValueOrDefault(self.body, 0f));
num2 = Mathf.RoundToInt(amount * cachedHealingConverted.GetValueOrDefault(self.body, 0f));
}
int buffCount = self.body.GetBuffCount(storedBonusDamage);
self.body.SetBuffCount(storedBonusDamage.buffIndex, num2 + buffCount);
return orig.Invoke(self, num, procChainMask, nonRegen);
}
return orig.Invoke(self, amount, procChainMask, nonRegen);
}
}
public class SacrificialShroud : ItemBase<SacrificialShroud>
{
public ConfigEntry<float> SkillBonusDamage;
public ConfigEntry<float> SkillBonusDamagePerStack;
public ConfigEntry<float> PercentHealthCostPerSecond;
public ConfigEntry<float> PercentHealthCostPerSecondPerStack;
public override string ItemName => "Sacrificial Shroud";
public override string ItemLangTokenName => "SACRIFICIAL_SHROUD_ITEM";
public override string ItemPickupDesc => "Skills deal bonus damage...<style=cIsHealth> BUT cost health to use.</style>";
public override string ItemFullDescription => $"All <style=cIsUtility>non-Primary skills</style> deal <style=cIsDamage>{SkillBonusDamage.Value * 100f}%</style> <style=cStack>(+{SkillBonusDamagePerStack.Value * 100f}% per stack)</style> <style=cIsDamage>bonus damage</style>. Activating a <style=cIsUtility>non-Primary skill</style> deals <style=cIsDamage>{PercentHealthCostPerSecond.Value * 100f}%</style> <style=cStack>(+{PercentHealthCostPerSecondPerStack.Value * 100f}% per stack)</style> of your max health per second of the skill's base cooldown to you.";
public override string ItemLore => "Item taken from Smite 1.";
public override ItemTier Tier => (ItemTier)3;
public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 };
public override GameObject ItemModel => Main.MainAssets.LoadAsset<GameObject>("SacrificialShroudModel.prefab");
public override Sprite ItemIcon => Main.MainAssets.LoadAsset<Sprite>("Sacrificial Shroud Icon.png");
public override void Init(ConfigFile config)
{
CreateConfig(config);
CreateLang();
CreateItem();
Hooks();
}
public override void CreateConfig(ConfigFile config)
{
SkillBonusDamage = config.Bind<float>("Item: " + ItemName, "Percent skill bonus damage", 0.5f, "By what percent is skill damage increased by?");
SkillBonusDamagePerStack = config.Bind<float>("Item: " + ItemName, "Percent skill bonus damage per item stack", 0.5f, "By what percent is skill damage increased by per additional item stack?");
PercentHealthCostPerSecond = config.Bind<float>("Item: " + ItemName, "Percent maximum health cost per skill cooldown second", 0.01f, "What percentage of maximum health is taken as damage per second of cooldown of a skill?");
PercentHealthCostPerSecondPerStack = config.Bind<float>("Item: " + ItemName, "Additional percent maximum health cost per skill cooldown second per item stack", 0.01f, "What percentage of maximum health is taken as damage per second of cooldown of a skill per additional stack of the item?");
}
public override ItemDisplayRuleDict CreateItemDisplayRules()
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Expected O, but got Unknown
//IL_0032: 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_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Expected O, but got Unknown
//IL_0082: 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_00da: Unknown result type (might be due to invalid IL or missing references)
//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_00f8: Unknown result type (might be due to invalid IL or missing references)
//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0107: Unknown result type (might be due to invalid IL or missing references)
//IL_010d: Expected O, but got Unknown
ModelPanelParameters obj = ItemModel.AddComponent<ModelPanelParameters>();
GameObject val = new GameObject("FocusPoint");
val.transform.SetParent(ItemModel.transform);
val.transform.localPosition = Vector3.zero;
val.transform.localRotation = Quaternion.identity;
GameObject val2 = new GameObject("CameraPosition");
val2.transform.SetParent(ItemModel.transform);
val2.transform.localPosition = new Vector3(1f, 0f, 0f);
val2.transform.localRotation = Quaternion.identity;
obj.focusPointTransform = val.transform;
obj.cameraPositionTransform = val2.transform;
obj.minDistance = 100f;
obj.maxDistance = 200f;
obj.modelRotation = Quaternion.Euler(new Vector3(0f, 90f, 0f));
obj.modelPositionOffset = new Vector3(0f, 50f, 0f);
return new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
}
public override void Hooks()
{
//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
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Expected O, but got Unknown
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Expected O, but got Unknown
GenericSkill.DeductStock += new hook_DeductStock(ApplySacrificeSelfDamageStock);
SkillDef.OnExecute += new hook_OnExecute(ApplySacrificeSelfDamage);
PrepWall.OnExit += new hook_OnExit(ApplySacrificeSelfDamageOnIceWall);
Fire.FireMissile += new hook_FireMissile(ApplySacrificeSelfDamageOnHarpoon);
HealthComponent.TakeDamage += new hook_TakeDamage(ApplySacrificeBonusDamage);
}
private void ApplySacrificeSelfDamageOnHarpoon(orig_FireMissile orig, Fire self, HurtBox target, Vector3 position)
{
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Expected O, but got Unknown
//IL_006f: 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_0086: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_009e: Unknown result type (might be due to invalid IL or missing references)
orig.Invoke(self, target, position);
int count = GetCount(((EntityState)self).characterBody);
if (count > 0)
{
GenericSkill utilityBonusStockSkill = ((EntityState)self).skillLocator.utilityBonusStockSkill;
float damage = ((EntityState)self).characterBody.maxHealth * 2f * (PercentHealthCostPerSecond.Value + PercentHealthCostPerSecondPerStack.Value * (float)(count - 1)) * utilityBonusStockSkill.baseRechargeInterval;
DamageInfo val = new DamageInfo();
val.damage = damage;
val.damageColorIndex = (DamageColorIndex)3;
val.procCoefficient = 0f;
val.damageType = DamageTypeCombo.op_Implicit((DamageType)1);
val.crit = false;
val.position = ((EntityState)self).characterBody.corePosition;
val.inflictor = ((Component)((EntityState)self).characterBody).gameObject;
val.attacker = ((Component)((EntityState)self).characterBody).gameObject;
((EntityState)self).characterBody.healthComponent.TakeDamage(val);
}
}
private void ApplySacrificeSelfDamageOnIceWall(orig_OnExit orig, PrepWall self)
{
//IL_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: Expected O, but got Unknown
//IL_0080: 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_00aa: Unknown result type (might be due to invalid IL or missing references)
//IL_00af: Unknown result type (might be due to invalid IL or missing references)
if (self.goodPlacement && Object.op_Implicit((Object)(object)((EntityState)self).characterBody))
{
int count = GetCount(((EntityState)self).characterBody);
if (count > 0)
{
GenericSkill utilityBonusStockSkill = ((EntityState)self).skillLocator.utilityBonusStockSkill;
float damage = ((EntityState)self).characterBody.maxHealth * 2f * (PercentHealthCostPerSecond.Value + PercentHealthCostPerSecondPerStack.Value * (float)(count - 1)) * utilityBonusStockSkill.baseRechargeInterval;
DamageInfo val = new DamageInfo();
val.damage = damage;
val.damageColorIndex = (DamageColorIndex)3;
val.procCoefficient = 0f;
val.damageType = DamageTypeCombo.op_Implicit((DamageType)1);
val.crit = false;
val.position = ((EntityState)self).characterBody.corePosition;
val.inflictor = ((Component)((EntityState)self).characterBody).gameObject;
val.attacker = ((Component)((EntityState)self).characterBody).gameObject;
((EntityState)self).characterBody.healthComponent.TakeDamage(val);
}
}
orig.Invoke(self);
}
private void ApplySacrificeSelfDamage(orig_OnExecute orig, SkillDef self, GenericSkill skillSlot)
{
//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
//IL_00eb: Expected O, but got Unknown
//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
//IL_0106: Unknown result type (might be due to invalid IL or missing references)
//IL_010b: Unknown result type (might be due to invalid IL or missing references)
//IL_011e: Unknown result type (might be due to invalid IL or missing references)
//IL_0123: Unknown result type (might be due to invalid IL or missing references)
orig.Invoke(self, skillSlot);
int count = GetCount(skillSlot.characterBody);
if (self.stockToConsume >= 1 && count > 0 && !((Object)(object)skillSlot.characterBody.skillLocator.primary.skillDef == (Object)(object)skillSlot.skillDef) && self.baseRechargeInterval > 0f && (skillSlot.cooldownRemaining > 0f || skillSlot.stock < skillSlot.maxStock) && skillSlot.skillDef.skillNameToken != "MAGE_UTILITY_ICE_NAME" && skillSlot.skillDef.skillNameToken != "ENGI_SKILL_HARPOON_NAME")
{
float damage = skillSlot.characterBody.maxHealth * 2f * (PercentHealthCostPerSecond.Value + PercentHealthCostPerSecondPerStack.Value * (float)(count - 1)) * self.baseRechargeInterval;
DamageInfo val = new DamageInfo();
val.damage = damage;
val.damageColorIndex = (DamageColorIndex)3;
val.procCoefficient = 0f;
val.damageType = DamageTypeCombo.op_Implicit((DamageType)1);
val.crit = false;
val.position = skillSlot.characterBody.corePosition;
val.inflictor = ((Component)skillSlot.characterBody).gameObject;
val.attacker = ((Component)skillSlot.characterBody).gameObject;
skillSlot.characterBody.healthComponent.TakeDamage(val);
}
}
private void ApplySacrificeSelfDamageStock(orig_DeductStock orig, GenericSkill self, int count)
{
//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
//IL_00df: Expected O, but got Unknown
//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)
//IL_00ff: 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_0117: Unknown result type (might be due to invalid IL or missing references)
orig.Invoke(self, count);
int count2 = GetCount(self.characterBody);
if (count2 > 0 && !((Object)(object)self.characterBody.skillLocator.primary.skillDef == (Object)(object)self.skillDef) && self.baseRechargeInterval > 0f && (self.cooldownRemaining > 0f || self.stock < self.maxStock) && self.skillDef.skillNameToken != "MAGE_UTILITY_ICE_NAME" && self.skillDef.skillNameToken != "ENGI_SKILL_HARPOON_NAME")
{
float damage = self.characterBody.maxHealth * 2f * (PercentHealthCostPerSecond.Value + PercentHealthCostPerSecondPerStack.Value * (float)(count2 - 1)) * self.baseRechargeInterval;
DamageInfo val = new DamageInfo();
val.damage = damage;
val.damageColorIndex = (DamageColorIndex)3;
val.procCoefficient = 0f;
val.damageType = DamageTypeCombo.op_Implicit((DamageType)1);
val.crit = false;
val.position = self.characterBody.corePosition;
val.inflictor = ((Component)self.characterBody).gameObject;
val.attacker = ((Component)self.characterBody).gameObject;
self.characterBody.healthComponent.TakeDamage(val);
}
}
private void ApplySacrificeBonusDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
{
//IL_0040: 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)
if (Object.op_Implicit((Object)(object)damageInfo.attacker))
{
CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.inventory))
{
int count = GetCount(component);
if (count > 0 && (damageInfo.damageType.damageSource & 0xE) != 0)
{
damageInfo.damage *= 1f + (SkillBonusDamage.Value + SkillBonusDamagePerStack.Value * (float)(count - 1));
}
}
}
orig.Invoke(self, damageInfo);
}
}
public class BladedBoomerang : ItemBase<BladedBoomerang>
{
public class BladePickup : MonoBehaviour
{
public GameObject baseObject;
private void OnTriggerEnter(Collider other)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
if (NetworkServer.active && Object.op_Implicit((Object)(object)((Component)this).GetComponent<TeamFilter>()) && Object.op_Implicit((Object)(object)other) && TeamComponent.GetObjectTeam(((Component)other).gameObject) == ((Component)this).GetComponent<TeamFilter>().teamIndex)
{
CharacterBody component = ((Component)other).GetComponent<CharacterBody>();
if ((Object)(object)component != (Object)null)
{
AddBladeBuff(component);
Object.Destroy((Object)(object)((Component)this).gameObject);
}
}
}
}
public static class PickupSpawner
{
private static GameObject _pickupPrefab;
public static void Init()
{
}
public static void SpawnPickupAt(Vector3 position, TeamIndex team)
{
//IL_001d: 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_0038: Unknown result type (might be due to invalid IL or missing references)
_pickupPrefab = CreatePickupPrefab();
if (!((Object)(object)_pickupPrefab == (Object)null))
{
TeamFilter component = Object.Instantiate<GameObject>(_pickupPrefab, position, Quaternion.identity).GetComponent<TeamFilter>();
if ((Object)(object)component != (Object)null)
{
component.teamIndex = team;
}
}
}
}
public ConfigEntry<float> CritChanceBuff;
public ConfigEntry<float> BonusCritChanceBuffPerStack;
public ConfigEntry<int> MaxBuffStacks;
public ConfigEntry<float> BuffDuration;
public ConfigEntry<float> BladeCooldown;
public ConfigEntry<float> BladeDropLifetime;
public static Dictionary<CharacterBody, float> bladeRechargeTimers = new Dictionary<CharacterBody, float>();
public static BuffDef bladedBoomerangCritChance;
public static BuffDef bladedBoomerangReady;
public static GameObject bladeDropPrefab;
public override string ItemName => "Bladed Boomerang";
public override string ItemLangTokenName => "BLADED_BOOMERANG_ITEM";
public override string ItemPickupDesc => "Hitting enemies spawns pickups that grant critical strike chance.";
public override string ItemFullDescription => $"Once every <style=cIsUtility>{BladeCooldown.Value}</style> seconds, hitting an enemy spawns a <style=cIsDamage>blade</style> that when picked up grants <style=cIsDamage>+{CritChanceBuff.Value}%</style> <style=cStack>(+{BonusCritChanceBuffPerStack.Value}% per stack)</style> <style=cIsDamage>critical strike chance</style> up to <style=cIsUtility>{MaxBuffStacks.Value} times</style>. Lasts {BuffDuration.Value} seconds.";
public override string ItemLore => "Item taken from Smite 1.";
public override ItemTier Tier => (ItemTier)0;
public override GameObject ItemModel => Main.MainAssets.LoadAsset<GameObject>("BladedBoomerangModel.prefab");
public override Sprite ItemIcon => Main.MainAssets.LoadAsset<Sprite>("Bladed Boomerang Icon.png");
public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 };
public override void Init(ConfigFile config)
{
CreateConfig(config);
CreateLang();
CreateBuff();
CreateItem();
Hooks();
}
public override void CreateConfig(ConfigFile config)
{
CritChanceBuff = config.Bind<float>("Item: " + ItemName, "Bonus Crit Chance from Buff", 6f, "How much crit chance does each stack of the bladed bo