using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using EntityStates;
using EntityStates.Merc;
using KinematicCharacterController;
using R2API;
using R2API.Utils;
using Rewired.ComponentControls.Effects;
using RoR2;
using RoR2.Navigation;
using RoR2.Skills;
using RoR2.UI;
using TMPro;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Animations;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.UI;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("Renekton")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Renekton")]
[assembly: AssemblyTitle("Renekton")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Renekton;
internal class Assets
{
public static AssetBundle MainAssetBundle;
public static T Load<T>(string name) where T : Object
{
return MainAssetBundle.LoadAsset<T>(name);
}
public static void PopulateAssets()
{
Assembly executingAssembly = Assembly.GetExecutingAssembly();
if ((Object)(object)MainAssetBundle == (Object)null)
{
using Stream stream = executingAssembly.GetManifestResourceStream("Renekton.AssetBundle." + "Renekton".ToLower() + "assets");
MainAssetBundle = AssetBundle.LoadFromStream(stream);
}
using Stream stream2 = executingAssembly.GetManifestResourceStream("Renekton.Renekton.bnk");
byte[] array = new byte[stream2.Length];
stream2.Read(array, 0, array.Length);
SoundBanks.Add(array);
}
}
internal class Behaviour : NetworkBehaviour
{
public bool canExecute = true;
public float pushForce = 25f;
public CharacterBody body;
public TextMeshProUGUI currentBar;
public TextMeshProUGUI fullBar;
public Image barImage;
public float stepMult = 6f;
[SyncVar]
public float barValue = 0f;
public int maxBarValue = 1;
public bool passiveCharge;
public bool recast;
private float stopwatch;
public float rageMult => (body.healthComponent.combinedHealth < body.healthComponent.fullCombinedHealth * 0.5f) ? 1.5f : 1f;
internal bool maxBar => barValue >= (float)maxBarValue;
private void FixedUpdate()
{
if (!recast)
{
stopwatch = 0f;
return;
}
stopwatch += Time.fixedDeltaTime;
if (stopwatch >= 1.5f)
{
stopwatch = 0f;
recast = false;
body.skillLocator.utility.UnsetSkillOverride((object)((Component)this).gameObject, MainPlugin.utilityRecast, (SkillOverridePriority)4);
}
}
private void OnEnable()
{
body = ((Component)this).GetComponent<CharacterBody>();
}
[ClientRpc]
public void RpcAddBar(float value)
{
AddBar(value);
}
public void AddBar(float value)
{
if (Util.HasEffectiveAuthority(((Component)this).gameObject) && !(barValue >= (float)maxBarValue))
{
barValue = Math.Min(barValue + value * rageMult, 1f);
if (barValue >= (float)maxBarValue)
{
AkSoundEngine.PostEvent("Play_sfx_Renekton_RenektonRageReady_OnBuffActivate", ((Component)this).gameObject);
}
UpdateValues();
}
}
public void ConsumeBarBar(float value)
{
barValue = Math.Max(barValue - value, 0f);
UpdateValues();
}
private void UpdateValues()
{
if (Object.op_Implicit((Object)(object)barImage))
{
barImage.fillAmount = barValue / (float)maxBarValue;
}
if (Object.op_Implicit((Object)(object)currentBar))
{
((TMP_Text)currentBar).text = Mathf.FloorToInt(barValue / (float)maxBarValue * 100f).ToString();
}
}
}
internal class HUDTracker : MonoBehaviour
{
public GameObject barRoot;
public Image bar;
public TextMeshProUGUI currentText;
public TextMeshProUGUI fullText;
public HUD hud;
private Behaviour behaviour;
private void Awake()
{
hud = ((Component)this).GetComponent<HUD>();
}
private void FixedUpdate()
{
if (!Object.op_Implicit((Object)(object)behaviour))
{
if (Object.op_Implicit((Object)(object)hud) && Object.op_Implicit((Object)(object)hud.targetBodyObject))
{
behaviour = hud.targetBodyObject.GetComponent<Behaviour>();
if (Object.op_Implicit((Object)(object)behaviour))
{
barRoot.gameObject.SetActive(true);
behaviour.currentBar = currentText;
behaviour.fullBar = fullText;
behaviour.barImage = bar;
}
}
if (barRoot.activeInHierarchy)
{
barRoot.gameObject.SetActive(false);
}
}
else if (!barRoot.activeInHierarchy)
{
barRoot.gameObject.SetActive(true);
}
}
}
internal class ParticleScale : MonoBehaviour
{
public float scale = 1f;
private ParticleSystem[] particles;
private DestroyOnTimer timer;
private void Awake()
{
particles = ((Component)this).GetComponentsInChildren<ParticleSystem>();
timer = ((Component)this).GetComponent<DestroyOnTimer>();
}
private void Start()
{
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
ParticleSystem[] array = particles;
foreach (ParticleSystem val in array)
{
MainModule main = val.main;
((MainModule)(ref main)).simulationSpeed = ((MainModule)(ref main)).simulationSpeed * scale;
}
DestroyOnTimer obj = timer;
obj.duration /= scale;
}
}
internal class Hook
{
internal static void Hooks()
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Expected O, but got Unknown
GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt;
RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients);
}
private static void GlobalEventManager_onServerDamageDealt(DamageReport damageReport)
{
//IL_0070: 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_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_0049: Invalid comparison between Unknown and I4
//IL_00bd: 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_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)damageReport.victimBody) && Object.op_Implicit((Object)(object)damageReport.attacker) && Object.op_Implicit((Object)(object)damageReport.attacker.GetComponent<Behaviour>()) && (int)DamageTypeCombo.op_Implicit(damageReport.damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)2)) > 0)
{
damageReport.victimBody.AddTimedBuff(Prefabs.armorReduction, 4f);
}
if (DamageAPI.HasModdedDamageType(damageReport.damageInfo, Prefabs.furyHit) && Object.op_Implicit((Object)(object)damageReport.attackerBody))
{
damageReport.attackerBody.healthComponent.Heal(damageReport.damageDealt * 0.07f, default(ProcChainMask), true);
}
if (DamageAPI.HasModdedDamageType(damageReport.damageInfo, Prefabs.lowHeal) && Object.op_Implicit((Object)(object)damageReport.attackerBody))
{
damageReport.attackerBody.healthComponent.Heal(damageReport.damageDealt * 0.05f, default(ProcChainMask), true);
}
}
private static void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
{
if (sender.HasBuff(Prefabs.armorReduction))
{
args.armorAdd -= 20f;
}
if (sender.HasBuff(Prefabs.ultBuff))
{
float num = 0.25f;
args.healthMultAdd += num;
args.moveSpeedMultAdd += num;
}
}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.Dragonyck.Renekton", "Renekton", "1.0.0")]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
public class MainPlugin : BaseUnityPlugin
{
public const string MODUID = "com.Dragonyck.Renekton";
public const string MODNAME = "Renekton";
public const string VERSION = "1.0.0";
public const string SURVIVORNAME = "Renekton";
public const string SURVIVORNAMEKEY = "RENEKTON";
public static GameObject characterPrefab;
public static readonly Color characterColor = Color32.op_Implicit(new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue));
internal static SkillDef utilityRecast;
private void Awake()
{
Assets.PopulateAssets();
Prefabs.CreatePrefabs();
CreatePrefab();
RegisterStates();
RegisterCharacter();
Hook.Hooks();
}
internal static void CreatePrefab()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
//IL_00c6: Expected O, but got Unknown
//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
//IL_0102: Unknown result type (might be due to invalid IL or missing references)
//IL_0113: Unknown result type (might be due to invalid IL or missing references)
//IL_011d: Unknown result type (might be due to invalid IL or missing references)
//IL_012d: Unknown result type (might be due to invalid IL or missing references)
//IL_0133: Expected O, but got Unknown
//IL_015a: Unknown result type (might be due to invalid IL or missing references)
//IL_016b: Unknown result type (might be due to invalid IL or missing references)
//IL_017c: Unknown result type (might be due to invalid IL or missing references)
//IL_019f: Unknown result type (might be due to invalid IL or missing references)
//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
//IL_022b: Unknown result type (might be due to invalid IL or missing references)
//IL_035c: Unknown result type (might be due to invalid IL or missing references)
//IL_0396: Unknown result type (might be due to invalid IL or missing references)
//IL_039b: Unknown result type (might be due to invalid IL or missing references)
//IL_0431: Unknown result type (might be due to invalid IL or missing references)
//IL_0436: Unknown result type (might be due to invalid IL or missing references)
//IL_0463: Unknown result type (might be due to invalid IL or missing references)
//IL_0468: Unknown result type (might be due to invalid IL or missing references)
//IL_0514: Unknown result type (might be due to invalid IL or missing references)
//IL_0534: Unknown result type (might be due to invalid IL or missing references)
//IL_0541: Unknown result type (might be due to invalid IL or missing references)
//IL_05c5: Unknown result type (might be due to invalid IL or missing references)
//IL_05cf: Expected O, but got Unknown
//IL_06e2: Unknown result type (might be due to invalid IL or missing references)
//IL_06ff: Unknown result type (might be due to invalid IL or missing references)
//IL_071c: Unknown result type (might be due to invalid IL or missing references)
//IL_0739: Unknown result type (might be due to invalid IL or missing references)
//IL_0756: Unknown result type (might be due to invalid IL or missing references)
//IL_0773: Unknown result type (might be due to invalid IL or missing references)
//IL_0790: Unknown result type (might be due to invalid IL or missing references)
//IL_07ad: Unknown result type (might be due to invalid IL or missing references)
//IL_07ca: Unknown result type (might be due to invalid IL or missing references)
//IL_07e8: Unknown result type (might be due to invalid IL or missing references)
//IL_0806: Unknown result type (might be due to invalid IL or missing references)
//IL_0824: Unknown result type (might be due to invalid IL or missing references)
//IL_0842: Unknown result type (might be due to invalid IL or missing references)
//IL_0860: Unknown result type (might be due to invalid IL or missing references)
//IL_087e: Unknown result type (might be due to invalid IL or missing references)
//IL_08f0: Unknown result type (might be due to invalid IL or missing references)
//IL_095b: Unknown result type (might be due to invalid IL or missing references)
//IL_096f: Unknown result type (might be due to invalid IL or missing references)
//IL_0985: Unknown result type (might be due to invalid IL or missing references)
//IL_098f: Unknown result type (might be due to invalid IL or missing references)
//IL_0994: Unknown result type (might be due to invalid IL or missing references)
//IL_099e: Unknown result type (might be due to invalid IL or missing references)
//IL_09c3: Unknown result type (might be due to invalid IL or missing references)
//IL_09d7: Unknown result type (might be due to invalid IL or missing references)
//IL_0ac9: Unknown result type (might be due to invalid IL or missing references)
//IL_0ace: Unknown result type (might be due to invalid IL or missing references)
//IL_0af1: Unknown result type (might be due to invalid IL or missing references)
//IL_0af6: Unknown result type (might be due to invalid IL or missing references)
//IL_0b24: Unknown result type (might be due to invalid IL or missing references)
//IL_0b29: Unknown result type (might be due to invalid IL or missing references)
GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Merc/MercBody.prefab").WaitForCompletion();
characterPrefab = PrefabAPI.InstantiateClone(val, "RenektonBody", true);
characterPrefab.AddComponent<Behaviour>();
characterPrefab.GetComponent<NetworkIdentity>().localPlayerAuthority = true;
Object.Destroy((Object)(object)((Component)characterPrefab.transform.Find("ModelBase")).gameObject);
Object.Destroy((Object)(object)((Component)characterPrefab.transform.Find("CameraPivot")).gameObject);
Object.Destroy((Object)(object)((Component)characterPrefab.transform.Find("AimOrigin")).gameObject);
GameObject val2 = Assets.MainAssetBundle.LoadAsset<GameObject>("RenektonMdl");
val2.AddComponent<AnimationEvents>().soundCenter = val2;
GameObject val3 = new GameObject("ModelBase");
val3.transform.parent = characterPrefab.transform;
val3.transform.localPosition = new Vector3(0f, -0.94f, 0f);
val3.transform.localRotation = Quaternion.identity;
val3.transform.localScale = Vector3.one * 2.5f;
GameObject val4 = new GameObject("AimOrigin");
val4.transform.parent = val3.transform;
val4.transform.localPosition = new Vector3(0f, 1.4f, 0f);
val4.transform.localRotation = Quaternion.identity;
val4.transform.localScale = Vector3.one;
Transform transform = val2.transform;
transform.parent = val3.transform;
transform.localPosition = Vector3.zero;
transform.localScale = Vector3.one;
transform.localRotation = Quaternion.identity;
CharacterDirection component = characterPrefab.GetComponent<CharacterDirection>();
component.targetTransform = val3.transform;
component.modelAnimator = val2.GetComponentInChildren<Animator>();
component.turnSpeed = 720f;
CharacterBody component2 = characterPrefab.GetComponent<CharacterBody>();
((Object)component2).name = "RenektonBody";
component2.baseNameToken = "RENEKTON_NAME";
component2.subtitleNameToken = "RENEKTON_SUBTITLE";
component2.bodyFlags = (BodyFlags)16;
component2.rootMotionInMainState = false;
component2.mainRootSpeed = 0f;
component2.baseMaxHealth = 160f;
component2.levelMaxHealth = 35f;
component2.baseRegen = 2.5f;
component2.levelRegen = 0.2f;
component2.baseMaxShield = 0f;
component2.levelMaxShield = 0f;
component2.baseMoveSpeed = 7f;
component2.levelMoveSpeed = 0f;
component2.baseAcceleration = 110f;
component2.baseJumpPower = 15f;
component2.levelJumpPower = 0f;
component2.baseDamage = 15f;
component2.levelDamage = 2.4f;
component2.baseAttackSpeed = 1f;
component2.levelAttackSpeed = 0f;
component2.baseCrit = 1f;
component2.levelCrit = 0f;
component2.baseArmor = 20f;
component2.levelArmor = 0f;
component2.baseJumpCount = 1;
component2.sprintingSpeedMultiplier = 1.45f;
component2.wasLucky = false;
component2.hideCrosshair = false;
component2.aimOriginTransform = val4.transform;
component2.hullClassification = (HullClassification)0;
component2.portraitIcon = (Texture)(object)Assets.MainAssetBundle.LoadAsset<Sprite>("portrait").texture;
component2.isChampion = false;
component2.currentVehicle = null;
component2.skinIndex = 0u;
component2.bodyColor = characterColor;
HealthComponent component3 = characterPrefab.GetComponent<HealthComponent>();
component3.health = component2.baseMaxHealth;
component3.shield = 0f;
component3.barrier = 0f;
CharacterMotor component4 = characterPrefab.GetComponent<CharacterMotor>();
component4.walkSpeedPenaltyCoefficient = 1f;
component4.characterDirection = component;
component4.muteWalkMotion = false;
component4.mass = 300f;
component4.airControl = 0.25f;
component4.disableAirControlUntilCollision = false;
component4.generateParametersOnAwake = true;
InputBankTest component5 = characterPrefab.GetComponent<InputBankTest>();
component5.moveVector = Vector3.zero;
CameraTargetParams component6 = characterPrefab.GetComponent<CameraTargetParams>();
component6.cameraParams = val.GetComponent<CameraTargetParams>().cameraParams;
component6.cameraPivotTransform = null;
component6.recoil = Vector2.zero;
component6.dontRaycastToPivot = false;
ModelLocator component7 = characterPrefab.GetComponent<ModelLocator>();
component7.modelTransform = transform;
component7.modelBaseTransform = val3.transform;
component7.dontReleaseModelOnDeath = false;
component7.autoUpdateModelTransform = true;
component7.dontDetatchFromParent = false;
component7.noCorpse = false;
component7.normalizeToFloor = false;
component7.preserveModel = false;
ChildLocator component8 = val2.GetComponent<ChildLocator>();
CharacterModel val5 = val2.AddComponent<CharacterModel>();
Renderer[] componentsInChildren = val2.GetComponentsInChildren<Renderer>();
List<RendererInfo> list = new List<RendererInfo>();
foreach (Renderer val6 in componentsInChildren)
{
val6.material = Utils.InstantiateMaterial(val6.material.mainTexture);
list.Add(new RendererInfo
{
renderer = val6,
defaultMaterial = val6.material,
defaultShadowCastingMode = (ShadowCastingMode)1,
ignoreOverlays = false
});
if (((Object)val6).name != "base")
{
((Component)val6).gameObject.SetActive(false);
}
}
RendererInfo[] array = list.ToArray();
val5.body = component2;
val5.baseRendererInfos = array;
val5.autoPopulateLightInfos = true;
val5.invisibilityCount = 0;
val5.temporaryOverlays = new List<TemporaryOverlayInstance>();
val5.mainSkinnedMeshRenderer = (SkinnedMeshRenderer)componentsInChildren[0];
LanguageAPI.Add("RENEKTONBODY_DEFAULT_SKIN_NAME", "Default");
LanguageAPI.Add("RENEKTONBODY_SKIN01_NAME", "Galactic");
LanguageAPI.Add("RENEKTONBODY_SKIN02_NAME", "Outback");
LanguageAPI.Add("RENEKTONBODY_SKIN03_NAME", "Bloodfury");
LanguageAPI.Add("RENEKTONBODY_SKIN04_NAME", "Rune Wars");
LanguageAPI.Add("RENEKTONBODY_SKIN05_NAME", "Scorched Earth");
LanguageAPI.Add("RENEKTONBODY_SKIN06_NAME", "Pool Party");
LanguageAPI.Add("RENEKTONBODY_SKIN07_NAME", "Prehistoric");
LanguageAPI.Add("RENEKTONBODY_SKIN08_NAME", "SKT T1");
LanguageAPI.Add("RENEKTONBODY_SKIN09_NAME", "Renektoy");
LanguageAPI.Add("RENEKTONBODY_SKIN17_NAME", "Hextech");
LanguageAPI.Add("RENEKTONBODY_SKIN18_NAME", "Blackfrost");
LanguageAPI.Add("RENEKTONBODY_SKIN26_NAME", "PROJECT");
LanguageAPI.Add("RENEKTONBODY_SKIN33_NAME", "Dawnbringer");
LanguageAPI.Add("RENEKTONBODY_SKIN42_NAME", "Worlds 2023");
ModelSkinController val7 = val2.AddComponent<ModelSkinController>();
val7.skins = (SkinDef[])(object)new SkinDef[15]
{
Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "RENEKTONBODY_DEFAULT_SKIN_NAME", "base", array)),
Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "RENEKTONBODY_SKIN01_NAME", "skin01", array)),
Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "RENEKTONBODY_SKIN02_NAME", "skin02", array)),
Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "RENEKTONBODY_SKIN03_NAME", "skin03", array)),
Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "RENEKTONBODY_SKIN04_NAME", "skin04", array)),
Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "RENEKTONBODY_SKIN05_NAME", "skin05", array)),
Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "RENEKTONBODY_SKIN06_NAME", "skin06", array)),
Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "RENEKTONBODY_SKIN07_NAME", "skin07", array)),
Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "RENEKTONBODY_SKIN08_NAME", "skin08", array)),
Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "RENEKTONBODY_SKIN09_NAME", "skin09", array)),
Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "RENEKTONBODY_SKIN17_NAME", "skin17", array)),
Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "RENEKTONBODY_SKIN18_NAME", "skin18", array)),
Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "RENEKTONBODY_SKIN26_NAME", "skin26", array)),
Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "RENEKTONBODY_SKIN33_NAME", "skin33", array)),
Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "RENEKTONBODY_SKIN42_NAME", "skin42", array))
};
Collider[] componentsInChildren2 = val2.GetComponentsInChildren<Collider>();
HurtBoxGroup val8 = val2.AddComponent<HurtBoxGroup>();
List<HurtBox> list2 = new List<HurtBox>();
Collider[] array2 = componentsInChildren2;
foreach (Collider val9 in array2)
{
HurtBox val10 = ((Component)val9).gameObject.AddComponent<HurtBox>();
((Component)val10).gameObject.layer = LayerIndex.entityPrecise.intVal;
val10.healthComponent = component3;
val10.isBullseye = true;
val10.damageModifier = (DamageModifier)0;
val10.hurtBoxGroup = val8;
val10.indexInGroup = 0;
val8.mainHurtBox = val10;
val8.bullseyeCount = 1;
list2.Add(val10);
}
val8.hurtBoxes = list2.ToArray();
Utils.CreateHitbox("Slash", val2.transform, new Vector3(3f, 3f, 6f), new Vector3(0f, 0.7f, 2.2f));
Utils.CreateHitbox("Spin", val2.transform, Vector3.one * 7f, Vector3.up * 0.7f);
Utils.CreateHitbox("Dash", val2.transform, new Vector3(3.5f, 3.5f, 4.5f), new Vector3(0f, 0.7f, 1f));
KinematicCharacterMotor component9 = characterPrefab.GetComponent<KinematicCharacterMotor>();
component9.CharacterController = (ICharacterController)(object)component4;
component9.playerCharacter = true;
characterPrefab.GetComponent<Interactor>().maxInteractionDistance = 3f;
characterPrefab.GetComponent<InteractionDriver>().highlightInteractor = true;
SfxLocator component10 = characterPrefab.GetComponent<SfxLocator>();
component10.deathSound = "Play_ui_player_death";
component10.barkSound = "";
component10.openSound = "";
component10.landingSound = "Play_char_land";
component10.fallDamageSound = "Play_char_land_fall_damage";
component10.aliveLoopStart = "";
component10.aliveLoopStop = "";
characterPrefab.GetComponent<Rigidbody>().mass = component4.mass;
FootstepHandler val11 = val2.AddComponent<FootstepHandler>();
val11.baseFootstepString = "Play_player_footstep";
val11.sprintFootstepOverrideString = "";
val11.enableFootstepDust = true;
val11.footstepDustPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/VFX/GenericFootstepDust.prefab").WaitForCompletion();
EntityStateMachine component11 = ((Component)component2).GetComponent<EntityStateMachine>();
component11.mainStateType = new SerializableEntityStateType(typeof(CharacterMain));
CharacterDeathBehavior component12 = characterPrefab.GetComponent<CharacterDeathBehavior>();
component12.deathStateMachine = characterPrefab.GetComponent<EntityStateMachine>();
component12.deathState = new SerializableEntityStateType(typeof(GenericCharacterDeath));
Utils.NewStateMachine<Idle>(characterPrefab, "Ult");
NetworkStateMachine component13 = ((Component)component2).GetComponent<NetworkStateMachine>();
component13.stateMachines = ((Component)component2).GetComponents<EntityStateMachine>();
ContentAddition.AddBody(characterPrefab);
}
private void RegisterCharacter()
{
//IL_0088: 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)
string text = " <style=cSub>\r\n\r\n< ! > \r\n\r\n< ! > \r\n\r\n< ! > \r\n\r\n< ! > \r\n\r\n";
string text2 = "..and so he left.";
string text3 = "..and so he vanished.";
string text4 = "";
LanguageAPI.Add("RENEKTON_NAME", "Renekton");
LanguageAPI.Add("RENEKTON_DESCRIPTION", text);
LanguageAPI.Add("RENEKTON_SUBTITLE", "Butcher Of The Sands");
LanguageAPI.Add("RENEKTON_OUTRO", text2);
LanguageAPI.Add("RENEKTON_FAIL", text3);
SurvivorDef val = ScriptableObject.CreateInstance<SurvivorDef>();
val.cachedName = "RENEKTON_NAME";
val.unlockableDef = null;
val.descriptionToken = "RENEKTON_DESCRIPTION";
val.primaryColor = characterColor;
val.bodyPrefab = characterPrefab;
val.displayPrefab = Utils.NewDisplayModel(((Component)characterPrefab.GetComponent<ModelLocator>().modelBaseTransform).gameObject, "RenektonDisplay");
val.outroFlavorToken = "RENEKTON_OUTRO";
val.desiredSortPosition = 22f;
val.mainEndingEscapeFailureFlavorToken = "RENEKTON_FAIL";
ContentAddition.AddSurvivorDef(val);
SkillSetup();
GameObject val2 = PrefabAPI.InstantiateClone(Prefabs.Load<GameObject>("RoR2/Base/Merc/MercMonsterMaster.prefab"), "RenektonMaster", true);
ContentAddition.AddMaster(val2);
CharacterMaster component = val2.GetComponent<CharacterMaster>();
component.bodyPrefab = characterPrefab;
}
private void RegisterStates()
{
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: 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_0043: Unknown result type (might be due to invalid IL or missing references)
bool flag = default(bool);
ContentAddition.AddEntityState<RenektonState>(ref flag);
ContentAddition.AddEntityState<Primary>(ref flag);
ContentAddition.AddEntityState<Secondary>(ref flag);
ContentAddition.AddEntityState<Utility>(ref flag);
ContentAddition.AddEntityState<UtilityRecast>(ref flag);
ContentAddition.AddEntityState<Special>(ref flag);
ContentAddition.AddEntityState<CharacterMain>(ref flag);
ContentAddition.AddEntityState<MeleeSkillState>(ref flag);
ContentAddition.AddEntityState<BasicMeleeSkillState>(ref flag);
}
private void SkillSetup()
{
GenericSkill[] componentsInChildren = characterPrefab.GetComponentsInChildren<GenericSkill>();
foreach (GenericSkill val in componentsInChildren)
{
Object.DestroyImmediate((Object)(object)val);
}
PassiveSetup();
PrimarySetup();
SecondarySetup();
UtilitySetup();
SpecialSetup();
}
private void PassiveSetup()
{
SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
LanguageAPI.Add("RENEKTON_PASSIVE_NAME", "Reign of Anger");
LanguageAPI.Add("RENEKTON_PASSIVE_DESCRIPTION", "Renekton can generate <color=#c80000>rage</color>. While Renekton has at least <color=#c80000>50 Fury</color>, his next <style=cIsDamage>damaging skill</style> consumes <color=#c80000>50 Fury</color> to deal an additional <style=cIsDamage>50% damage</style> and <style=cIsHealing>heal</style> for <style=cIsHealing>7%</style> of the damage dealt. Renekton generates <color=#c80000>50% bonus Fury</color> from all sources while below <style=cIsHealth>50% maximum health</style>.");
component.passiveSkill.enabled = true;
component.passiveSkill.skillNameToken = "RENEKTON_PASSIVE_NAME";
component.passiveSkill.skillDescriptionToken = "RENEKTON_PASSIVE_DESCRIPTION";
component.passiveSkill.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("passive");
}
private void PrimarySetup()
{
SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
LanguageAPI.Add("RENEKTON_M1", "Ruthless Predator");
LanguageAPI.Add("RENEKTON_M1_DESCRIPTION", "Renekton performs a slicing combo forward for <style=cIsDamage>145% damage</style>, finishing with multiple strikes for <style=cIsDamage>200% damage</style>. Generates <color=#c80000>5 Fury</color> on hit.");
SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Primary), "Weapon", 0, 0f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: true, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: false, cancelSprintingOnActivation: true, 0, 0, 0, Assets.MainAssetBundle.LoadAsset<Sprite>("primary"), "RENEKTON_M1_DESCRIPTION", "RENEKTON_M1", Array.Empty<string>());
component.primary = Utils.NewGenericSkill(characterPrefab, skill);
}
private void SecondarySetup()
{
SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
LanguageAPI.Add("RENEKTON_M2", "Cull the Meek");
LanguageAPI.Add("RENEKTON_M2_DESCRIPTION", "Renekton cleaves around himself, dealing <style=cIsDamage>420% damage</style>. Generates <color=#c80000>5 Fury</color> for each hit. <style=cIsHealing>Heal</style> for <style=cIsHealing>5%</style> of the damage dealt.");
SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Secondary), "Weapon", 1, 3f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("secondary"), "RENEKTON_M2_DESCRIPTION", "RENEKTON_M2", Array.Empty<string>());
component.secondary = Utils.NewGenericSkill(characterPrefab, skill);
}
private void UtilitySetup()
{
SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
LanguageAPI.Add("RENEKTON_UTIL", "Slice");
LanguageAPI.Add("RENEKTON_UTIL_DESCRIPTION", "Renekton dashes forward, dealing <style=cIsDamage>265% damage</style>. Generates <color=#c80000>5 Fury</color> for each hit. If Renekton hits an enemy, he can cast <style=cIsDamage>Dice</style> within <style=cIsUtility>1.5s</style>.");
SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Utility), "Body", 1, 4f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Prefabs.utility, "RENEKTON_UTIL_DESCRIPTION", "RENEKTON_UTIL", Array.Empty<string>());
component.utility = Utils.NewGenericSkill(characterPrefab, skill);
LanguageAPI.Add("RENEKTON_UTIL2", "Dice");
LanguageAPI.Add("RENEKTON_UTIL2_DESCRIPTION", "Renekton dashes forward, dealing <style=cIsDamage>265% damage</style>, <style=cIsDamage>ignores armor</style> and reduces <style=cIsDamage>armor</style> by <style=cIsDamage>20</style> for <style=cIsUtility>4s</style>. Generates <color=#c80000>5 Fury</color> for each hit.");
skill = (utilityRecast = Utils.NewSkillDef<SkillDef>(typeof(UtilityRecast), "Body", 1, 4f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: true, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Prefabs.utility2, "RENEKTON_UTIL2_DESCRIPTION", "RENEKTON_UTIL2", Array.Empty<string>()));
}
private void SpecialSetup()
{
SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
LanguageAPI.Add("RENEKTON_SPEC", "Dominus");
LanguageAPI.Add("RENEKTON_SPEC_DESCRIPTION", "Renekton empowers himself for <style=cIsUtility>15s</style>, gaining 25% <style=cIsHealth>health</style>, <style=cIsUtility>movement speed</style> and 40% <style=cIsUtility>size</style>.During this time, he deals <style=cIsDamage>200% damage</style> and generates <color=#c80000>5 Fury</color> per second.");
SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Special), "Ult", 1, 15f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Prefabs.special, "RENEKTON_SPEC_DESCRIPTION", "RENEKTON_SPEC", Array.Empty<string>());
component.special = Utils.NewGenericSkill(characterPrefab, skill);
}
}
internal class Prefabs
{
internal static GameObject primaryHit;
internal static GameObject primaryFinisherHit;
internal static GameObject secondaryHit;
internal static GameObject slashEffect;
internal static GameObject slash2Effect;
internal static GameObject ultEffect;
internal static GameObject dashEffect;
internal static GameObject dashRageEffect;
internal static GameObject spinEffect;
internal static GameObject spinRageEffect;
internal static GameObject stunSlashEffect;
internal static GameObject stunSlashRageEffect;
internal static BuffDef ultBuff;
internal static BuffDef armorReduction;
internal static Sprite utility;
internal static Sprite utility2;
internal static Sprite special;
internal static ModdedDamageType furyHit;
internal static ModdedDamageType lowHeal;
internal static void CreatePrefabs()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
//IL_0104: Unknown result type (might be due to invalid IL or missing references)
//IL_0144: Unknown result type (might be due to invalid IL or missing references)
//IL_014e: Unknown result type (might be due to invalid IL or missing references)
//IL_017d: Unknown result type (might be due to invalid IL or missing references)
//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0207: 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_0251: Unknown result type (might be due to invalid IL or missing references)
//IL_0291: Unknown result type (might be due to invalid IL or missing references)
//IL_029b: Unknown result type (might be due to invalid IL or missing references)
//IL_02db: Unknown result type (might be due to invalid IL or missing references)
//IL_02e5: Unknown result type (might be due to invalid IL or missing references)
//IL_03fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0406: Unknown result type (might be due to invalid IL or missing references)
//IL_040b: Unknown result type (might be due to invalid IL or missing references)
//IL_041d: Unknown result type (might be due to invalid IL or missing references)
//IL_042f: Unknown result type (might be due to invalid IL or missing references)
//IL_0471: Unknown result type (might be due to invalid IL or missing references)
//IL_0478: Expected O, but got Unknown
//IL_047f: Unknown result type (might be due to invalid IL or missing references)
//IL_0486: Expected O, but got Unknown
//IL_0492: Unknown result type (might be due to invalid IL or missing references)
//IL_0497: Unknown result type (might be due to invalid IL or missing references)
//IL_04a4: Unknown result type (might be due to invalid IL or missing references)
//IL_04b1: Unknown result type (might be due to invalid IL or missing references)
//IL_04c8: Unknown result type (might be due to invalid IL or missing references)
//IL_04d5: Unknown result type (might be due to invalid IL or missing references)
//IL_04e2: Unknown result type (might be due to invalid IL or missing references)
//IL_0504: Unknown result type (might be due to invalid IL or missing references)
//IL_0509: Unknown result type (might be due to invalid IL or missing references)
furyHit = DamageAPI.ReserveDamageType();
lowHeal = DamageAPI.ReserveDamageType();
special = Assets.MainAssetBundle.LoadAsset<Sprite>("special");
ultBuff = Utils.NewBuffDef("Dominus", stack: false, hidden: false, special, Color.white);
armorReduction = Utils.NewBuffDef("Dice", stack: false, hidden: false, Load<Sprite>("RoR2/Base/ArmorReductionOnHit/texBuffPulverizeIcon.tif"), Color.white);
utility = Assets.MainAssetBundle.LoadAsset<Sprite>("utility");
utility2 = Assets.MainAssetBundle.LoadAsset<Sprite>("utility2");
slashEffect = Instantiate(Assets.Load<GameObject>("SlashEffect"), "SlashEffect");
slashEffect.transform.localScale = Vector3.one * 2f;
Utils.RegisterEffect(slashEffect, 0.42f, addParticleScale: true);
slash2Effect = Instantiate(Assets.Load<GameObject>("Slash2Effect"), "Slash2Effect");
slash2Effect.transform.localScale = Vector3.one * 2f;
Utils.RegisterEffect(slash2Effect, 0.42f, addParticleScale: true);
ultEffect = Instantiate(Assets.Load<GameObject>("UltEffect"), "UltEffect");
ultEffect.transform.localScale = Vector3.one * 4f;
dashEffect = Instantiate(Assets.Load<GameObject>("DashEffect"), "DashEffect");
dashEffect.transform.localScale = Vector3.one;
Utils.RegisterEffect(dashEffect, 0.62f, addParticleScale: true);
dashRageEffect = Instantiate(Assets.Load<GameObject>("DashRageEffect"), "DashRageEffect");
dashRageEffect.transform.localScale = Vector3.one;
Utils.RegisterEffect(dashRageEffect, 0.62f, addParticleScale: true);
spinEffect = Instantiate(Assets.Load<GameObject>("SpinEffect"), "SpinEffect");
spinEffect.transform.localScale = Vector3.one * 2f;
Utils.RegisterEffect(spinEffect, 0.44f, addParticleScale: true);
spinRageEffect = Instantiate(Assets.Load<GameObject>("SpinRageEffect"), "SpinRageEffect");
spinRageEffect.transform.localScale = Vector3.one * 2f;
Utils.RegisterEffect(spinRageEffect, 0.44f, addParticleScale: true);
stunSlashEffect = Instantiate(Assets.Load<GameObject>("StunSlashEffect"), "StunSlashEffect");
stunSlashEffect.transform.localScale = Vector3.one * 2f;
Utils.RegisterEffect(stunSlashEffect, 0.77f, addParticleScale: true);
stunSlashRageEffect = Instantiate(Assets.Load<GameObject>("StunSlashRageEffect"), "StunSlashRageEffect");
stunSlashRageEffect.transform.localScale = Vector3.one * 2f;
Utils.RegisterEffect(stunSlashRageEffect, 1.3f, addParticleScale: true);
primaryHit = Instantiate("RoR2/Base/Common/VFX/OmniImpactVFX.prefab", "PrimaryHit");
Utils.RegisterEffect(primaryHit, -1f, "Play_sfx_Renekton_RenektonBasicAttack_OnHit");
primaryFinisherHit = Instantiate("RoR2/Base/Common/VFX/OmniImpactVFXLarge.prefab", "PrimaryFinisherHit");
Utils.RegisterEffect(primaryFinisherHit, -1f, "Play_sfx_Renekton_RenektonExecute_OnHit");
secondaryHit = Instantiate("RoR2/Base/Common/VFX/OmniImpactVFXLarge.prefab", "PrimaryFinisherHit");
Utils.RegisterEffect(secondaryHit, -1f, "Play_sfx_Renekton_RenektonCleave_OnHit");
GameObject val = Load<GameObject>("RoR2/Base/UI/HUDSimple.prefab");
Object.DontDestroyOnLoad((Object)(object)val);
HUDScaleController component = val.GetComponent<HUDScaleController>();
HUDTracker hUDTracker = val.AddComponent<HUDTracker>();
Transform val2 = val.GetComponent<ChildLocator>().FindChild("BottomLeftCluster");
GameObject gameObject = ((Component)((Component)val2).GetComponentInChildren<HealthBar>()).gameObject;
GameObject val3 = Object.Instantiate<GameObject>(gameObject);
((Object)val3).name = "BarRoot";
val3.transform.SetParent(gameObject.transform.parent);
val3.transform.localPosition = Vector2.op_Implicit(Vector2.one * 6f);
val3.transform.localRotation = Quaternion.identity;
val3.transform.localScale = Vector3.one;
HealthBar component2 = val3.GetComponent<HealthBar>();
RectTransform barContainer = component2.barContainer;
GameObject val4 = new GameObject("Bar", new Type[2]
{
typeof(RectTransform),
typeof(Image)
});
RectTransform val5 = (RectTransform)val4.transform;
((Transform)val5).SetParent((Transform)(object)barContainer);
((Transform)val5).localPosition = Vector2.op_Implicit(Vector2.zero);
((Transform)val5).localRotation = Quaternion.identity;
((Transform)val5).localScale = Vector3.one;
val5.sizeDelta = new Vector2(12f, 2f);
val5.anchorMin = Vector2.zero;
val5.anchorMax = Vector2.one;
Image component3 = val4.GetComponent<Image>();
((Graphic)component3).color = Color32.op_Implicit(new Color32((byte)200, (byte)0, (byte)0, byte.MaxValue));
component3.sprite = Load<Sprite>("RoR2/Base/UI/texUIMainHealthbar.png");
component3.type = (Type)3;
component3.fillMethod = (FillMethod)0;
component3.fillAmount = 0f;
hUDTracker.barRoot = val3;
hUDTracker.bar = component3;
hUDTracker.currentText = component2.currentHealthText;
((TMP_Text)hUDTracker.currentText).text = "100";
((Component)((TMP_Text)hUDTracker.currentText).transform.parent).gameObject.SetActive(true);
hUDTracker.fullText = component2.fullHealthText;
((TMP_Text)hUDTracker.fullText).text = "100";
Object.Destroy((Object)(object)component2);
val3.SetActive(false);
}
internal static T Load<T>(string path)
{
//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)
return Addressables.LoadAssetAsync<T>((object)path).WaitForCompletion();
}
internal static GameObject Instantiate(string path, string name, bool registerNetwork = false)
{
return PrefabAPI.InstantiateClone(Load<GameObject>(path), name, registerNetwork);
}
internal static GameObject Instantiate(GameObject obj, string name, bool registerNetwork = false)
{
return PrefabAPI.InstantiateClone(obj, name, registerNetwork);
}
}
internal class BasicMeleeSkillState : BaseSkillState
{
private float duration = 0.2f;
private Vector3 dir;
private OverlapAttack attack;
private float damageCoefficient = 4.2f;
private GameObject hitEffectPrefab = null;
private bool parried;
public Animator animator;
private uint ID;
private string hitboxGroupName = "";
public override void OnEnter()
{
((BaseState)this).OnEnter();
animator = ((EntityState)this).GetModelAnimator();
if (!animator.GetBool("slide"))
{
((BaseState)this).StartAimMode(1f, true);
}
((EntityState)this).PlayAnimation("LeftArm, Override", "MeleeAttack");
AkSoundEngine.PostEvent(ID, ((EntityState)this).gameObject);
attack = ((BaseState)this).InitMeleeOverlap(damageCoefficient, hitEffectPrefab, ((EntityState)this).GetModelTransform(), hitboxGroupName);
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
if (((EntityState)this).isAuthority)
{
attack.Fire((List<HurtBox>)null);
}
if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
public override void OnExit()
{
((EntityState)this).OnExit();
}
public override InterruptPriority GetMinimumInterruptPriority()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (InterruptPriority)1;
}
}
internal class CharacterMain : GenericCharacterMain
{
}
internal class MeleeSkillState : RenektonState
{
public float attackDuration;
private bool hopped;
public bool hasSwung;
public bool isInHitPause;
public float hitPauseDuration;
public float hopVelocity;
public float hitPauseTimer;
public float stopwatch;
private bool newAttack = true;
public HitStopCachedState hitStopCachedState;
public OverlapAttack overlapAttack;
public bool hasHit;
private bool hasAnimParameter;
private float attackSpeedScaling;
public Animator animator;
private bool barAdded;
private List<HurtBox> hitList = new List<HurtBox>();
private bool addFuryHit;
private bool spawnedEffect;
public virtual float baseAttackDuration => 0f;
public virtual float earlyExitDurationPercentage => 0f;
public virtual float damageCoefficient => 0f;
public virtual float forceMagnitude => 440f;
public virtual float rootMotionSpeed => 25f;
public virtual float baseHopVelocity => 4f;
public virtual string layerName => "Gesture, Override";
public virtual string animationStateName => "";
public virtual string animParameter => "M1";
public virtual string hitBoxGroupName => "";
public virtual string hitBoxActiveParameter => "Curve";
public virtual string swingMuzzle => animationStateName + "Muzzle";
public virtual GameObject swingEffectPrefab => null;
public virtual bool hopOnHit => true;
public virtual bool rootMotion => false;
public virtual bool rootMotionWhileHitting => false;
public virtual string swingSound => "";
public virtual DamageType damageType => DamageTypeCombo.op_Implicit(DamageTypeCombo.GenericPrimary);
public virtual DamageColorIndex damageColor => (DamageColorIndex)0;
public virtual Vector3 bonusForce => Vector3.zero;
public virtual GameObject hitEffectPrefab => null;
public virtual bool addBar => true;
public virtual bool multiHit => false;
public virtual bool canEmpower => true;
public virtual bool noAttackSpeedScaling => false;
public virtual float barValueAdd => 0.05f;
public override void OnEnter()
{
base.OnEnter();
attackSpeedScaling = Math.Min(((BaseState)this).attackSpeedStat, 6f);
attackDuration = (noAttackSpeedScaling ? baseAttackDuration : (baseAttackDuration / attackSpeedScaling));
hitPauseDuration = GroundLight.hitPauseDuration / attackSpeedScaling;
hopVelocity = baseHopVelocity / attackSpeedScaling;
animator = ((EntityState)this).GetModelAnimator();
animator.SetFloat(hitBoxActiveParameter, 0f);
CastEmpowered();
NewAttack();
hasAnimParameter = !Utility.IsNullOrWhiteSpace(animParameter);
if (hasAnimParameter && !Utility.IsNullOrWhiteSpace(animationStateName))
{
((EntityState)this).PlayAnimation(layerName, animationStateName, animParameter, attackDuration, 0f);
}
}
public void CastEmpowered()
{
if (empowered && canEmpower)
{
behaviour.ConsumeBarBar(0.5f);
addFuryHit = true;
}
}
public virtual void NewAttack()
{
//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_005c: Unknown result type (might be due to invalid IL or missing references)
overlapAttack = ((BaseState)this).InitMeleeOverlap(damageCoefficient, hitEffectPrefab, ((EntityState)this).GetModelTransform(), hitBoxGroupName);
overlapAttack.pushAwayForce = 1f;
overlapAttack.damageType = DamageTypeCombo.op_Implicit(damageType);
if (addFuryHit)
{
DamageAPI.AddModdedDamageType(overlapAttack, Prefabs.furyHit);
}
}
public virtual Vector3 rootMotionDirection()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
return ((EntityState)this).characterDirection.forward;
}
public override void FixedUpdate()
{
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0180: Unknown result type (might be due to invalid IL or missing references)
//IL_0185: Unknown result type (might be due to invalid IL or missing references)
//IL_018e: Unknown result type (might be due to invalid IL or missing references)
//IL_0193: Unknown result type (might be due to invalid IL or missing references)
//IL_019b: Unknown result type (might be due to invalid IL or missing references)
//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
//IL_01af: Unknown result type (might be due to invalid IL or missing references)
((EntityState)this).FixedUpdate();
if (((EntityState)this).isAuthority)
{
bool flag = FireMeleeAttack(overlapAttack, animator, hitBoxActiveParameter, forceMagnitude, bonusForce);
hasHit |= flag;
if (hasHit)
{
if (!barAdded && addBar)
{
barAdded = true;
if (multiHit)
{
foreach (HurtBox hit in hitList)
{
behaviour.AddBar(barValueAdd);
}
}
else
{
behaviour.AddBar(barValueAdd);
}
}
if (hopOnHit && !((EntityState)this).characterMotor.isGrounded && !hopped)
{
((BaseState)this).SmallHop(((EntityState)this).characterMotor, hopVelocity);
hopped = true;
}
if (!rootMotionWhileHitting && !isInHitPause && hasAnimParameter)
{
isInHitPause = true;
}
}
if (animator.GetFloat(hitBoxActiveParameter) > 0.1f && rootMotion && !isInHitPause)
{
Vector3 val = rootMotionDirection();
CharacterMotor characterMotor = ((EntityState)this).characterMotor;
characterMotor.rootMotion += val * rootMotionSpeed * Time.fixedDeltaTime;
}
if (hitPauseTimer >= hitPauseDuration && isInHitPause)
{
isInHitPause = false;
animator.speed = 1f;
}
if (!isInHitPause)
{
stopwatch += Time.fixedDeltaTime;
}
else
{
hitPauseTimer += Time.fixedDeltaTime;
if (!rootMotion)
{
}
animator.speed = 0f;
}
if (stopwatch >= attackDuration * earlyExitDurationPercentage)
{
if (((EntityState)this).inputBank.skill1.down)
{
SetState();
}
if (stopwatch >= attackDuration)
{
BaseSkillState val2 = StateOverride();
if (val2 != null)
{
((EntityState)this).outer.SetNextState((EntityState)(object)val2);
}
else
{
((EntityState)this).outer.SetNextStateToMain();
}
return;
}
}
}
if (animator.GetFloat(hitBoxActiveParameter) == 0f && !newAttack)
{
newAttack = true;
hasSwung = false;
barAdded = false;
NewAttack();
}
else
{
if (!(animator.GetFloat(hitBoxActiveParameter) >= 0.11f) || hasSwung)
{
return;
}
AkSoundEngine.PostEvent(swingSound, ((EntityState)this).gameObject);
if (!spawnedEffect && Object.op_Implicit((Object)(object)swingEffectPrefab) && !Utility.IsNullOrWhiteSpace(swingMuzzle))
{
spawnedEffect = true;
if (!noAttackSpeedScaling)
{
swingEffectPrefab.GetComponent<ParticleScale>().scale = ((BaseState)this).attackSpeedStat;
}
EffectManager.SimpleMuzzleFlash(swingEffectPrefab, ((EntityState)this).gameObject, swingMuzzle, false);
}
newAttack = false;
hasSwung = true;
}
}
public bool FireMeleeAttack(OverlapAttack attack, Animator animator, string mecanimHitboxActiveParameter, float forceMagnitude, Vector3 bonusForce)
{
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
bool result = false;
if (Object.op_Implicit((Object)(object)animator) && animator.GetFloat(mecanimHitboxActiveParameter) > 0.1f)
{
attack.forceVector = (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) ? ((EntityState)this).characterDirection.forward : (((EntityState)this).transform.forward * forceMagnitude + bonusForce));
result = attack.Fire(hitList);
}
return result;
}
public virtual void SetState()
{
}
public virtual BaseSkillState StateOverride()
{
return null;
}
public override InterruptPriority GetMinimumInterruptPriority()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (InterruptPriority)1;
}
}
internal class Primary : MeleeSkillState
{
public int attackIndex = 1;
private PositionConstraint constraint;
private ChildLocator childLocator;
private bool cancel;
private bool finisher => attackIndex == 3;
public override float baseAttackDuration => (!finisher) ? 0.85f : (empowered ? 1.45f : 1f);
public override float earlyExitDurationPercentage => 0.85f;
public override string layerName => "Gesture, Override";
public override string animationStateName => (!finisher) ? ("Attack" + attackIndex) : (empowered ? "AttackStunRage" : "AttackStun");
public override string hitBoxGroupName => "Slash";
public override float forceMagnitude => 250f;
public override float damageCoefficient => (!finisher) ? 1.45f : (empowered ? 3f : 2f);
public override bool addBar
{
get
{
if (empowered && finisher)
{
return false;
}
return true;
}
}
public override string swingSound
{
get
{
string result = "";
switch (attackIndex)
{
case 1:
case 2:
result = "Play_sfx_Renekton_RenektonBasicAttack_OnCast";
break;
case 3:
if (!hasSwung)
{
result = (empowered ? "Play_sfx_Renekton_RenektonSuperExecute_OnCast" : "Play_sfx_Renekton_RenektonBasicAttack_OnCast");
}
break;
}
return result;
}
}
public override float baseHopVelocity => 6f;
public override GameObject hitEffectPrefab => Prefabs.primaryHit;
public override GameObject swingEffectPrefab => finisher ? (empowered ? Prefabs.stunSlashRageEffect : Prefabs.stunSlashEffect) : ((attackIndex == 2) ? Prefabs.slash2Effect : Prefabs.slashEffect);
public override DamageType damageType => DamageTypeCombo.op_Implicit(finisher ? (DamageTypeCombo.GenericPrimary | DamageTypeCombo.op_Implicit((DamageType)32)) : DamageTypeCombo.GenericPrimary);
public override bool canEmpower => finisher;
public override void OnSerialize(NetworkWriter writer)
{
((BaseSkillState)this).OnSerialize(writer);
writer.Write(attackIndex);
}
public override void OnDeserialize(NetworkReader reader)
{
((BaseSkillState)this).OnDeserialize(reader);
attackIndex = reader.ReadInt32();
}
public override void OnEnter()
{
//IL_0038: 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)
base.OnEnter();
childLocator = ((EntityState)this).GetModelChildLocator();
constraint = ((Component)childLocator.FindChild("weapon")).GetComponent<PositionConstraint>();
PositionConstraint obj = constraint;
ConstraintSource val = default(ConstraintSource);
((ConstraintSource)(ref val)).sourceTransform = childLocator.FindChild((attackIndex == 1) ? "hand.l" : "hand.r");
((ConstraintSource)(ref val)).weight = 1f;
obj.SetSource(0, val);
if (!finisher)
{
}
}
public override void Update()
{
((EntityState)this).Update();
if (((EntityState)this).isAuthority && !((EntityState)this).inputBank.skill1.down)
{
cancel = true;
}
}
public override void SetState()
{
if (!(cancel & finisher) && !finisher)
{
Primary primary = new Primary();
primary.attackIndex = attackIndex + 1;
((EntityState)this).outer.SetNextState((EntityState)(object)primary);
}
}
public override void OnExit()
{
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
PositionConstraint obj = constraint;
ConstraintSource val = default(ConstraintSource);
((ConstraintSource)(ref val)).sourceTransform = childLocator.FindChild("hand.r");
((ConstraintSource)(ref val)).weight = 1f;
obj.SetSource(0, val);
((EntityState)this).OnExit();
}
public override InterruptPriority GetMinimumInterruptPriority()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (InterruptPriority)1;
}
}
internal class RenektonState : BaseSkillState
{
public Behaviour behaviour;
public bool empowered;
public override void OnEnter()
{
((BaseState)this).OnEnter();
behaviour = ((EntityState)this).GetComponent<Behaviour>();
empowered = behaviour.barValue >= 0.5f;
}
}
internal class Secondary : MeleeSkillState
{
public override float baseAttackDuration => 0.65f;
public override float earlyExitDurationPercentage => 0.85f;
public override string layerName => "FullBody, Override";
public override string animationStateName => "Spin";
public override string animParameter => "M2";
public override string hitBoxGroupName => "Spin";
public override float forceMagnitude => 250f;
public override float damageCoefficient => empowered ? 6.2999997f : 4.2f;
public override string swingSound => "Play_sfx_Renekton_RenektonCleave_OnCast";
public override float baseHopVelocity => 6f;
public override bool rootMotion => true;
public override bool multiHit => true;
public override bool rootMotionWhileHitting => true;
public override GameObject hitEffectPrefab => Prefabs.secondaryHit;
public override GameObject swingEffectPrefab => empowered ? Prefabs.spinRageEffect : Prefabs.spinEffect;
public override DamageType damageType => DamageTypeCombo.op_Implicit(DamageTypeCombo.GenericSecondary);
public override InterruptPriority GetMinimumInterruptPriority()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (InterruptPriority)2;
}
public override void NewAttack()
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
base.NewAttack();
DamageAPI.AddModdedDamageType(overlapAttack, Prefabs.lowHeal);
}
public override void OnEnter()
{
base.OnEnter();
((BaseState)this).SmallHop(((EntityState)this).characterMotor, 10f);
}
}
internal class Special : RenektonState
{
private float duration = 15f;
private float startup = 0.5f;
private Transform modelTransform;
private uint ID;
private float stopwatch = 1f;
private BlastAttack blastAttack;
private float radius = 8f;
private float blastDamageCoefficient = 1f;
private GameObject ultEffect;
private AimRequest request;
public override void OnEnter()
{
//IL_0135: Unknown result type (might be due to invalid IL or missing references)
//IL_013a: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_0092: Unknown result type (might be due to invalid IL or missing references)
//IL_009e: Unknown result type (might be due to invalid IL or missing references)
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
//IL_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_00d6: Unknown result type (might be due to invalid IL or missing references)
//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
//IL_00de: Unknown result type (might be due to invalid IL or missing references)
//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
//IL_0101: 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_010d: Unknown result type (might be due to invalid IL or missing references)
//IL_0112: Unknown result type (might be due to invalid IL or missing references)
//IL_0119: Unknown result type (might be due to invalid IL or missing references)
//IL_011e: Unknown result type (might be due to invalid IL or missing references)
//IL_0128: Expected O, but got Unknown
base.OnEnter();
modelTransform = ((EntityState)this).GetModelTransform();
((EntityState)this).PlayAnimation("Gesture, Override", "Ult", "Special", startup, 0f);
AkSoundEngine.PostEvent("Play_sfx_Renekton_RenektonReignOfTheTyrant_OnCast", ((EntityState)this).gameObject);
ID = AkSoundEngine.PostEvent("Play_sfx_Renekton_RenektonReignOfTheTyrant_OnBuffActivate", ((EntityState)this).gameObject);
if (NetworkServer.active)
{
((EntityState)this).characterBody.AddTimedBuff(Prefabs.ultBuff, duration);
}
if (((EntityState)this).isAuthority)
{
blastAttack = new BlastAttack
{
attacker = ((EntityState)this).gameObject,
attackerFiltering = (AttackerFiltering)2,
falloffModel = (FalloffModel)0,
baseDamage = blastDamageCoefficient * ((BaseState)this).damageStat,
crit = ((BaseState)this).RollCrit(),
damageType = DamageTypeCombo.GenericSpecial,
damageColorIndex = (DamageColorIndex)10,
inflictor = ((EntityState)this).gameObject,
procCoefficient = 0.25f,
radius = radius,
teamIndex = ((EntityState)this).teamComponent.teamIndex,
position = ((EntityState)this).characterBody.corePosition
};
}
ultEffect = Object.Instantiate<GameObject>(Prefabs.ultEffect, ((EntityState)this).transform.position, Quaternion.identity, ((EntityState)this).transform);
request = ((EntityState)this).cameraTargetParams.RequestAimType((AimType)2);
}
public override void FixedUpdate()
{
//IL_008c: 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_00c0: Unknown result type (might be due to invalid IL or missing references)
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00af: 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_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
((EntityState)this).FixedUpdate();
if (((EntityState)this).isAuthority)
{
stopwatch += Time.fixedDeltaTime;
if (stopwatch >= 0.5f)
{
stopwatch = 0f;
blastAttack.position = ((EntityState)this).characterBody.corePosition;
blastAttack.Fire();
}
}
behaviour.AddBar(0.05f * Time.fixedDeltaTime);
modelTransform.localScale = Vector3.Lerp(modelTransform.localScale, (((EntityState)this).fixedAge >= duration + 2f) ? (Vector3.one * 2.5f) : (Vector3.one * 3.5f), 4.5f * Time.fixedDeltaTime);
if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
public override void OnExit()
{
//IL_005e: 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)
if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams))
{
request.Dispose();
}
if (Object.op_Implicit((Object)(object)ultEffect))
{
EntityState.Destroy((Object)(object)ultEffect);
}
AkSoundEngine.PostEvent("Play_sfx_Renekton_RenektonReignOfTheTyrant_OnBuffDeactivate", ((EntityState)this).gameObject);
AkSoundEngine.StopPlayingID(ID);
modelTransform.localScale = Vector3.one * 2.5f;
((EntityState)this).OnExit();
}
public override InterruptPriority GetMinimumInterruptPriority()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (InterruptPriority)7;
}
}
internal class UtilityRecast : Utility
{
public override bool recast => true;
public override DamageType damageType => DamageTypeCombo.op_Implicit(DamageTypeCombo.GenericUtility | DamageTypeCombo.op_Implicit((DamageType)2));
}
internal class Utility : MeleeSkillState
{
public int attackIndex = 1;
private bool overridden;
private Vector3 dir;
private int layer;
private AnimationCurve curve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
public virtual bool recast => false;
public override float baseAttackDuration => 0.65f;
public override float earlyExitDurationPercentage => 0.85f;
public override string layerName => "Body";
public override string animationStateName => "Utility";
public override string animParameter => "Utility";
public override string hitBoxGroupName => "Dash";
public override float forceMagnitude => 250f;
public override string swingMuzzle => "base";
public override float damageCoefficient => empowered ? 3.9750001f : 2.65f;
public override string swingSound => "";
public override float baseHopVelocity => 0f;
public override bool rootMotion => true;
public override bool rootMotionWhileHitting => true;
public override float rootMotionSpeed => 40f * (((BaseState)this).moveSpeedStat / ((EntityState)this).characterBody.baseMoveSpeed);
public override GameObject hitEffectPrefab => Prefabs.secondaryHit;
public override GameObject swingEffectPrefab => empowered ? Prefabs.dashRageEffect : Prefabs.dashEffect;
public override DamageType damageType => DamageTypeCombo.op_Implicit(DamageTypeCombo.GenericUtility);
public override bool noAttackSpeedScaling => true;
public override bool multiHit => true;
public override Vector3 rootMotionDirection()
{
//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_000a: Unknown result type (might be due to invalid IL or missing references)
return dir;
}
public override void OnEnter()
{
//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_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_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)
((EntityState)this).PlayAnimation("Gesture, Override", "BufferEmpty");
((EntityState)this).PlayAnimation("FullBody, Override", "BufferEmpty");
base.OnEnter();
((EntityState)this).characterBody.isSprinting = true;
AkSoundEngine.PostEvent("Play_sfx_Renekton_RenektonSliceAndDice_OnCast", ((EntityState)this).gameObject);
ResetYVelocity();
Ray aimRay = ((BaseState)this).GetAimRay();
dir = ((Ray)(ref aimRay)).direction;
layer = ((EntityState)this).gameObject.layer;
((EntityState)this).gameObject.layer = LayerIndex.GetAppropriateFakeLayerForTeam(((EntityState)this).teamComponent.teamIndex).intVal;
((BaseCharacterController)((EntityState)this).characterMotor).Motor.RebuildCollidableLayers();
}
private void ResetYVelocity()
{
//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)
((EntityState)this).characterMotor.velocity = new Vector3(((EntityState)this).characterMotor.velocity.x, Mathf.Max(((EntityState)this).characterMotor.velocity.y, 0f), ((EntityState)this).characterMotor.velocity.z);
}
public override void Update()
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
((EntityState)this).Update();
((EntityState)this).characterDirection.forward = Utils.GetForwardDirection(dir);
if (animator.GetFloat(hitBoxActiveParameter) >= 0.11f)
{
((EntityState)this).characterMotor.velocity = Vector3.zero;
}
}
public override void FixedUpdate()
{
base.FixedUpdate();
((EntityState)this).characterBody.isSprinting = true;
if (!overridden && hasHit)
{
overridden = true;
behaviour.recast = true;
((EntityState)this).skillLocator.utility.SetSkillOverride((object)((EntityState)this).gameObject, MainPlugin.utilityRecast, (SkillOverridePriority)4);
}
}
public override void SetState()
{
if (hasHit && attackIndex != 2 && !recast)
{
}
}
public override void OnExit()
{
((EntityState)this).gameObject.layer = layer;
((BaseCharacterController)((EntityState)this).characterMotor).Motor.RebuildCollidableLayers();
if (recast)
{
((EntityState)this).skillLocator.utility.UnsetSkillOverride((object)((EntityState)this).gameObject, MainPlugin.utilityRecast, (SkillOverridePriority)4);
}
((EntityState)this).OnExit();
}
public override InterruptPriority GetMinimumInterruptPriority()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (InterruptPriority)2;
}
}
internal static class Extensions
{
public static GameObject NewSyringe(this GameObject g, params Material[] m)
{
((Renderer)g.GetComponentsInChildren<MeshRenderer>(false)[0]).material = m[0];
((Renderer)g.GetComponent<TrailRenderer>()).material = m[1];
((Renderer)g.GetComponent<ParticleSystemRenderer>()).material = m[2];
return g;
}
public static Material SwapTexture(this Material m, Texture2D t)
{
m.mainTexture = (Texture)(object)t;
return m;
}
public static GameObject SwapMaterials(this GameObject g, Material[] m)
{
Renderer[] componentsInChildren = g.GetComponentsInChildren<Renderer>();
for (int i = 0; i < componentsInChildren.Length; i++)
{
if (Object.op_Implicit((Object)(object)m[i]))
{
componentsInChildren[i].material = m[i];
}
}
return g;
}
public static float Mult(this float f, float mult = 100f)
{
return f * mult;
}
public static Color ToRGB255(this Color c, string title, string body)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: 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)
return new Color(c.r / 255f, c.g / 255f, c.b / 255f);
}
public static void SetStrings(this TooltipProvider t, string title, string body)
{
t.overrideTitleText = title;
t.overrideBodyText = body;
}
}
internal class Utils
{
public static Vector3 FindNearestNodePosition(Vector3 targetPosition, GraphType nodeGraphType)
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: 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_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Expected O, but got Unknown
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Expected O, but got Unknown
//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_0084: 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_0089: Unknown result type (might be due to invalid IL or missing references)
SpawnCard val = ScriptableObject.CreateInstance<SpawnCard>();
val.hullSize = (HullClassification)1;
val.nodeGraphType = nodeGraphType;
val.prefab = Prefabs.Load<GameObject>("RoR2/Base/Common/DirectorSpawnProbeHelperPrefab.prefab");
Vector3 result = targetPosition;
GameObject val2 = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(val, new DirectorPlacementRule
{
placementMode = (PlacementMode)3,
position = targetPosition
}, RoR2Application.rng));
if (Object.op_Implicit((Object)(object)val2))
{
result = val2.transform.position;
}
if (Object.op_Implicit((Object)(object)val2))
{
Object.Destroy((Object)(object)val2);
}
Object.Destroy((Object)(object)val);
return result;
}
public static Vector3 GetForwardDirection(Vector3 dir)
{
//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_0041: 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_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0045: Unknown result type (might be due to invalid IL or missing references)
Vector2 val = Util.Vector3XZToVector2XY(dir);
if (val != Vector2.zero)
{
((Vector2)(ref val)).Normalize();
Vector3 val2 = new Vector3(val.x, 0f, val.y);
return ((Vector3)(ref val2)).normalized;
}
return dir;
}
public static void PlayAnimation(GameObject g, string layerName, string animationStateName)
{
Animator component = g.GetComponent<Animator>();
if (Object.op_Implicit((Object)(object)component))
{
int layerIndex = component.GetLayerIndex(layerName);
component.speed = 1f;
component.Update(0f);
component.PlayInFixedTime(animationStateName, layerIndex, 0f);
}
}
public static void PlayAnimation(GameObject g, string layerName, string animationStateName, string playbackRateParam, float duration)
{
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
Animator component = g.GetComponent<Animator>();
if (Object.op_Implicit((Object)(object)component))
{
component.speed = 1f;
component.Update(0f);
int layerIndex = component.GetLayerIndex(layerName);
component.SetFloat(playbackRateParam, 1f);
component.PlayInFixedTime(animationStateName, layerIndex, 0f);
component.Update(0f);
AnimatorStateInfo currentAnimatorStateInfo = component.GetCurrentAnimatorStateInfo(layerIndex);
float length = ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).length;
component.SetFloat(playbackRateParam, length / duration);
}
}
public static void AnimatorPlayAnimation(Animator modelAnimator, string layerName, string animationStateName)
{
int layerIndex = modelAnimator.GetLayerIndex(layerName);
modelAnimator.speed = 1f;
modelAnimator.Update(0f);
modelAnimator.PlayInFixedTime(animationStateName, layerIndex, 0f);
}
public static void AnimatorPlayAnimation(Animator modelAnimator, string layerName, string animationStateName, string playbackRateParam, float duration)
{
//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)
modelAnimator.speed = 1f;
modelAnimator.Update(0f);
int layerIndex = modelAnimator.GetLayerIndex(layerName);
modelAnimator.SetFloat(playbackRateParam, 1f);
modelAnimator.PlayInFixedTime(animationStateName, layerIndex, 0f);
modelAnimator.Update(0f);
AnimatorStateInfo currentAnimatorStateInfo = modelAnimator.GetCurrentAnimatorStateInfo(layerIndex);
float length = ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).length;
modelAnimator.SetFloat(playbackRateParam, length / duration);
}
public static SkillDef NewSkillDef<T>(Type activationState, string activationStateMachineName, int baseMaxStock, float baseRechargeInterval, bool beginSkillCooldownOnSkillEnd, bool canceledFromSprinting, bool fullRestockOnAssign, InterruptPriority interruptPriority, bool isCombatSkill, bool mustKeyPress, bool cancelSprintingOnActivation, int rechargeStock, int requiredStock, int stockToConsume, Sprite icon, string skillDescriptionToken, string skillName, params string[] keywordTokens) where T : SkillDef
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0069: 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)
T val = ScriptableObject.CreateInstance<T>();
((SkillDef)val).activationState = new SerializableEntityStateType(activationState);
((SkillDef)val).activationStateMachineName = activationStateMachineName;
((SkillDef)val).baseMaxStock = baseMaxStock;
((SkillDef)val).baseRechargeInterval = baseRechargeInterval;
((SkillDef)val).beginSkillCooldownOnSkillEnd = beginSkillCooldownOnSkillEnd;
((SkillDef)val).canceledFromSprinting = canceledFromSprinting;
((SkillDef)val).fullRestockOnAssign = fullRestockOnAssign;
((SkillDef)val).interruptPriority = interruptPriority;
((SkillDef)val).isCombatSkill = isCombatSkill;
((SkillDef)val).mustKeyPress = mustKeyPress;
((SkillDef)val).cancelSprintingOnActivation = cancelSprintingOnActivation;
((SkillDef)val).rechargeStock = rechargeStock;
((SkillDef)val).requiredStock = requiredStock;
((SkillDef)val).stockToConsume = stockToConsume;
((SkillDef)val).icon = icon;
((SkillDef)val).skillDescriptionToken = skillDescriptionToken;
((SkillDef)val).skillName = skillName;
((SkillDef)val).skillNameToken = ((SkillDef)val).skillName;
((SkillDef)val).keywordTokens = keywordTokens;
ContentAddition.AddSkillDef((SkillDef)(object)val);
return (SkillDef)(object)val;
}
public static Color HexTo10(string hexColor)
{
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
char[] array = hexColor.ToCharArray();
return new Color((float)(array[0] + array[1]), (float)(array[2] + array[3]), (float)(array[4] + array[5]), 255f) / 255f;
}
public static EntityStateMachine NewStateMachine<T>(GameObject obj, string customName) where T : EntityState
{
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_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)
SerializableEntityStateType val = default(SerializableEntityStateType);
((SerializableEntityStateType)(ref val))..ctor(typeof(T));
EntityStateMachine val2 = obj.AddComponent<EntityStateMachine>();
val2.customName = customName;
val2.initialStateType = val;
val2.mainStateType = val;
return val2;
}
public static GenericSkill NewGenericSkill(GameObject obj, SkillDef skill)
{
//IL_0031: 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: Expected O, but got Unknown
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
GenericSkill val = obj.AddComponent<GenericSkill>();
SkillFamily val2 = ScriptableObject.CreateInstance<SkillFamily>();
val2.variants = (Variant[])(object)new Variant[1];
val._skillFamily = val2;
SkillFamily skillFamily = val.skillFamily;
Variant[] variants = skillFamily.variants;
Variant val3 = new Variant
{
skillDef = skill
};
((Variant)(ref val3)).viewableNode = new Node(skill.skillNameToken, false, (Node)null);
variants[0] = val3;
ContentAddition.AddSkillFamily(skillFamily);
return val;
}
public static void AddAlt(SkillFamily skillFamily, SkillDef SkillDef)
{
//IL_0029: 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_004b: Expected O, but got Unknown
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1);
Variant[] variants = skillFamily.variants;
int num = skillFamily.variants.Length - 1;
Variant val = new Variant
{
skillDef = SkillDef
};
((Variant)(ref val)).viewableNode = new Node(SkillDef.skillNameToken, false, (Node)null);
variants[num] = val;
}
public static BuffDef NewBuffDef(string name, bool stack, bool hidden, Sprite sprite, Color color)
{
//IL_0025: 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)
BuffDef val = ScriptableObject.CreateInstance<BuffDef>();
((Object)val).name = name;
val.canStack = stack;
val.isHidden = hidden;
val.iconSprite = sprite;
val.buffColor = color;
ContentAddition.AddBuffDef(val);
return val;
}
public static ObjectScaleCurve AddScaleComponent(GameObject target, float timeMax)
{
ObjectScaleCurve val = target.AddComponent<ObjectScaleCurve>();
val.useOverallCurveOnly = true;
val.timeMax = timeMax;
val.overallCurve = AnimationCurve.Linear(0f, 0f, 1f, 1f);
return val;
}
public static RotateAroundAxis AddRotationComponent(GameObject target, float speed, RotationAxis axis)
{
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
RotateAroundAxis val = target.AddComponent<RotateAroundAxis>();
val.speed = (Speed)2;
val.fastRotationSpeed = speed;
val.rotateAroundAxis = axis;
return val;
}
public static GameObject NewDisplayModel(GameObject model, string name)
{
//IL_0010: 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_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Expected O, but got Unknown
GameObject val = PrefabAPI.InstantiateClone(model, name, false);
val.transform.localScale = Vector3.one * 1.6f;
Animator componentInChildren = val.GetComponentInChildren<Animator>();
componentInChildren.runtimeAnimatorController = Assets.Load<RuntimeAnimatorController>("displayAnimator");
((Behaviour)val.GetComponentInChildren<CharacterModel>()).enabled = false;
SkinnedMeshRenderer[] componentsInChildren = val.GetComponentsInChildren<SkinnedMeshRenderer>(true);
foreach (SkinnedMeshRenderer val2 in componentsInChildren)
{
((Renderer)val2).material = new Material(((Renderer)val2).material);
((Renderer)val2).material.DisableKeyword("DITHER");
}
return val;
}
public static AnimateShaderAlpha AddShaderAlphaComponent(GameObject target, float timeMax, AnimationCurve curve, bool destroyOnEnd = true, bool disableOnEnd = false)
{
AnimateShaderAlpha val = target.AddComponent<AnimateShaderAlpha>();
val.timeMax = timeMax;
val.alphaCurve = curve;
val.destroyOnEnd = destroyOnEnd;
val.disableOnEnd = disableOnEnd;
return val;
}
internal static Sprite CreateSprite(Texture2D tex)
{
//IL_001a: 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)
return Sprite.Create(tex, new Rect(0f, 0f, (float)((Texture)tex).width, (float)((Texture)tex).height), new Vector2(0.5f, 0.5f), 128f);
}
internal static SkinDefInfo CreateNewSkinDefInfo(Renderer[] childList, GameObject rootObject, string skinName, string objectToEnable, RendererInfo[] rendererInfos, UnlockableDef unlockableDef = null)
{
//IL_0003: 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_006c: 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_0071: 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_00db: 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)
SkinDefInfo result = default(SkinDefInfo);
result.BaseSkins = Array.Empty<SkinDef>();
result.MinionSkinReplacements = (MinionSkinReplacement[])(object)new MinionSkinReplacement[0];
result.ProjectileGhostReplacements = (ProjectileGhostReplacement[])(object)new ProjectileGhostReplacement[0];
List<GameObjectActivation> list = new List<GameObjectActivation>();
foreach (Renderer val in childList)
{
GameObjectActivation val2 = default(GameObjectActivation);
val2.gameObject = ((Component)val).gameObject;
val2.shouldActivate = ((Object)val).name.Contains(objectToEnable);
GameObjectActivation item = val2;
list.Add(item);
}
result.GameObjectActivations = list.ToArray();
result.Icon = Assets.MainAssetBundle.LoadAsset<Sprite>(objectToEnable);
result.MeshReplacements = (MeshReplacement[])(object)new MeshReplacement[0];
result.Name = skinName;
result.NameToken = skinName;
result.RendererInfos = rendererInfos;
result.RootObject = rootObject;
result.UnlockableDef = unlockableDef;
return result;
}
internal static T CopyComponent<T>(T original, GameObject destination) where T : Component
{
Type type = ((object)original).GetType();
Component val = destination.AddComponent(type);
FieldInfo[] fields = type.GetFields();
FieldInfo[] array = fields;
foreach (FieldInfo fieldInfo in array)
{
fieldInfo.SetValue(val, fieldInfo.GetValue(original));
}
return (T)(object)((val is T) ? val : null);
}
public static Sprite CreateSpriteFromTexture(Texture2D texture)
{
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)texture))
{
return Sprite.Create(texture, new Rect(0f, 0f, (float)((Texture)texture).width, (float)((Texture)texture).height), new Vector2(0.5f, 0.5f));
}
return null;
}
public static GameObject FindInActiveObjectByName(string name)
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Invalid comparison between Unknown and I4
Transform[] array = Resources.FindObjectsOfTypeAll<Transform>();
for (int i = 0; i < array.Length; i++)
{
if ((int)((Object)array[i]).hideFlags == 0 && ((Object)array[i]).name == name)
{
return ((Component)array[i]).gameObject;
}
}
return null;
}
public static void CreateHitboxes(string name, Transform parent, Vector3[] sizes, Vector3[] positions)
{
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Expected O, but got Unknown
//IL_004f: 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_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_0082: Unknown result type (might be due to invalid IL or missing references)
HitBoxGroup val = ((Component)parent).gameObject.AddComponent<HitBoxGroup>();
val.groupName = name;
List<HitBox> list = new List<HitBox>();
for (int i = 0; i < sizes.Length; i++)
{
GameObject val2 = new GameObject(name + (i + 1));
val2.transform.SetParent(parent);
val2.transform.localPosition = positions[i];
val2.transform.localRotation = Quaternion.Euler(Vector3.forward * 45f);
val2.transform.localScale = sizes[i];
HitBox item = val2.AddComponent<HitBox>();
val2.layer = LayerIndex.projectile.intVal;
list.Add(item);
}
val.hitBoxes = list.ToArray();
}
public static GameObject CreateHitbox(string name, Transform parent, Vector3 scale, Vector3 localPosition)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
//IL_001b: 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_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_0048: Unknown result type (might be due to invalid IL or missing references)
GameObject val = new GameObject(name);
val.transform.SetParent(parent);
val.transform.localPosition = localPosition;
val.transform.localRotation = Quaternion.Euler(Vector3.forward * 45f);
val.transform.localScale = scale;
HitBoxGroup val2 = ((Component)parent).gameObject.AddComponent<HitBoxGroup>();
HitBox val3 = val.AddComponent<HitBox>();
val.layer = LayerIndex.projectile.intVal;
val2.hitBoxes = (HitBox[])(object)new HitBox[1] { val3 };
val2.groupName = name;
return val;
}
internal static EffectComponent RegisterEffect(GameObject effect, float duration, bool addParticleScale)
{
//IL_00b7: 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)
EffectComponent val = effect.GetComponent<EffectComponent>();
if (!Object.op_Implicit((Object)(object)val))
{
val = effect.AddComponent<EffectComponent>();
}
if (addParticleScale)
{
effect.AddComponent<ParticleScale>();
}
if (duration != -1f)
{
DestroyOnTimer component = effect.GetComponent<DestroyOnTimer>();
if (!Object.op_Implicit((Object)(object)component))
{
effect.AddComponent<DestroyOnTimer>().duration = duration;
}
else
{
component.duration = duration;
}
}
if (!Object.op_Implicit((Object)(object)effect.GetComponent<NetworkIdentity>()))
{
effect.AddComponent<NetworkIdentity>();
}
if (!Object.op_Implicit((Object)(object)effect.GetComponent<VFXAttributes>()))
{
effect.AddComponent<VFXAttributes>().vfxPriority = (VFXPriority)2;
}
val.applyScale = false;
val.effectIndex = (EffectIndex)(-1);
val.parentToReferencedTransform = true;
val.positionAtReferencedTransform = true;
val.soundName = "";
ContentAddition.AddEffect(effect);
return val;
}
internal static EffectComponent RegisterEffect(GameObject effect, float duration, string soundName = "", bool applyScale = false, bool parentToReferencedTransform = true, bool positionAtReferencedTransform = true)
{
//IL_00a6: 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)
EffectComponent val = effect.GetComponent<EffectComponent>();
if (!Object.op_Implicit((Object)(object)val))
{
val = effect.AddComponent<EffectComponent>();
}
if (duration != -1f)
{
DestroyOnTimer component = effect.GetComponent<DestroyOnTimer>();
if (!Object.op_Implicit((Object)(object)component))
{
effect.AddComponent<DestroyOnTimer>().duration = duration;
}
else
{
component.duration = duration;
}
}
if (!Object.op_Implicit((Object)(object)effect.GetComponent<NetworkIdentity>()))
{
effect.AddComponent<NetworkIdentity>();
}
if (!Object.op_Implicit((Object)(object)effect.GetComponent<VFXAttributes>()))
{
effect.AddComponent<VFXAttributes>().vfxPriority = (VFXPriority)2;
}
val.applyScale = applyScale;
val.effectIndex = (EffectIndex)(-1);
val.parentToReferencedTransform = parentToReferencedTransform;
val.positionAtReferencedTransform = positionAtReferencedTransform;
val.soundName = soundName;
ContentAddition.AddEffect(effect);
return val;
}
public static Material InstantiateMaterial(Texture tex)
{
//IL_0022: 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)
Material val = Object.Instantiate<Material>(Prefabs.Load<Material>("RoR2/Base/Commando/matCommandoDualies.mat"));
if (Object.op_Implicit((Object)(object)val))
{
val.SetColor("_Color", Color.white);
val.SetTexture("_MainTex", tex);
val.SetColor("_EmColor", Color.black);
val.SetFloat("_EmPower", 0f);
val.SetTexture("_EmTex", (Texture)null);
val.SetFloat("_NormalStrength", 1f);
val.SetTexture("_NormalTex", (Texture)null);
return val;
}
return val;
}
public static Material InstantiateMaterial(Color color, Texture tex, Color emColor, float emPower, Texture emTex, float normStr, Texture normTex)
{
//IL_0037: 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)
Material val = Object.Instantiate<Material>(LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/CommandoBody").GetComponentInChildren<CharacterModel>().baseRendererInfos[0].defaultMaterial);
if (Object.op_Implicit((Object)(object)val))
{
val.SetColor("_Color", color);
val.SetTexture("_MainTex", tex);
val.SetColor("_EmColor", emColor);
val.SetFloat("_EmPower", emPower);
val.SetTexture("_EmTex", emTex);
val.SetFloat("_NormalStrength", 1f);
val.SetTexture("_NormalTex", normTex);
return val;
}
return val;
}
public static Material FindMaterial(string name)
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Invalid comparison between Unknown and I4
Material[] array = Resources.FindObjectsOfTypeAll<Material>();
for (int i = 0; i < array.Length; i++)
{
if ((int)((Object)array[i]).hideFlags == 0 && ((Object)array[i]).name == name)
{
return array[i];
}
}
return null;
}
}