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 KinematicCharacterController;
using R2API;
using R2API.Utils;
using Rewired.ComponentControls.Effects;
using RoR2;
using RoR2.Navigation;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using ThreeEyedGames;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering;
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("Lucian")]
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: AssemblyProduct("Lucian")]
[assembly: AssemblyTitle("Lucian")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Lucian;
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("Lucian.AssetBundle." + "Lucian".ToLower() + "assets");
MainAssetBundle = AssetBundle.LoadFromStream(stream);
}
using Stream stream2 = executingAssembly.GetManifestResourceStream("Lucian.Lucian.bnk");
byte[] array = new byte[stream2.Length];
stream2.Read(array, 0, array.Length);
SoundBanks.Add(array);
}
}
internal class Behaviour : NetworkBehaviour
{
public bool alt = true;
private CharacterBody body;
public bool castBeam = true;
private float stopwatch;
private static int kRpcRpcDeductUtilityCD;
private void Awake()
{
body = ((Component)this).GetComponent<CharacterBody>();
}
private void FixedUpdate()
{
if (!castBeam)
{
stopwatch += Time.fixedDeltaTime;
if (stopwatch >= 3f / body.attackSpeed)
{
stopwatch = 0f;
castBeam = true;
}
}
}
[ClientRpc]
public void RpcDeductUtilityCD(float seconds)
{
if (Object.op_Implicit((Object)(object)body))
{
body.skillLocator.utility.RunRecharge(seconds);
}
}
private void UNetVersion()
{
}
protected static void InvokeRpcRpcDeductUtilityCD(NetworkBehaviour obj, NetworkReader reader)
{
if (!NetworkClient.active)
{
Debug.LogError((object)"RPC RpcDeductUtilityCD called on server.");
}
else
{
((Behaviour)(object)obj).RpcDeductUtilityCD(reader.ReadSingle());
}
}
public void CallRpcDeductUtilityCD(float seconds)
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Expected O, but got Unknown
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
if (!NetworkServer.active)
{
Debug.LogError((object)"RPC Function RpcDeductUtilityCD called on client.");
return;
}
NetworkWriter val = new NetworkWriter();
val.Write((short)0);
val.Write((short)2);
val.WritePackedUInt32((uint)kRpcRpcDeductUtilityCD);
val.Write(((Component)this).GetComponent<NetworkIdentity>().netId);
val.Write(seconds);
((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcDeductUtilityCD");
}
static Behaviour()
{
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Expected O, but got Unknown
kRpcRpcDeductUtilityCD = -79197161;
NetworkBehaviour.RegisterRpcDelegate(typeof(Behaviour), kRpcRpcDeductUtilityCD, new CmdDelegate(InvokeRpcRpcDeductUtilityCD));
NetworkCRC.RegisterBehaviour("Behaviour", 0);
}
public override bool OnSerialize(NetworkWriter writer, bool forceAll)
{
bool result = default(bool);
return result;
}
public override void OnDeserialize(NetworkReader reader, bool initialState)
{
}
}
internal class eeeee : MonoBehaviour
{
private Tracer tracer;
private Vector3 beamPos;
private Transform beamTransform;
private Transform beamChildTransform;
public Vector3 beamScale = new Vector3(0.92f, 0.15f, 0.15f);
public Vector3 beamChildScale = Vector3.one * 0.35f;
public float forwardPos = 17f;
private void Start()
{
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: 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_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
tracer = ((Component)this).GetComponent<Tracer>();
Vector3 localPosition = tracer.beamObject.transform.localPosition;
beamPos = new Vector3(localPosition.x, localPosition.y, localPosition.z + forwardPos);
beamTransform = tracer.beamObject.transform;
beamChildTransform = beamTransform.GetChild(0);
}
private void Update()
{
//IL_0008: 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)
beamTransform.localScale = beamScale;
beamChildTransform.localScale = beamChildScale;
}
}
[DefaultExecutionOrder(20)]
internal class ModelBehaviour : MonoBehaviour
{
private CharacterModel model;
private Animator animator;
public SkinnedMeshRenderer[] renderers;
public float stopwatch = 1f;
public float delay = 0.1f;
public bool afterImageOn;
public float speedStopwatch = 1f;
public float speedDelay = 0.035f;
public bool speedAfterImageOn;
private ParticleSystem speedParticles;
private void Awake()
{
animator = ((Component)this).GetComponent<Animator>();
}
private void Start()
{
model = ((Component)this).GetComponent<CharacterModel>();
renderers = ((Component)this).GetComponentsInChildren<SkinnedMeshRenderer>();
speedParticles = ((Component)((Component)this).GetComponent<ChildLocator>().FindChild("speedTrails")).GetComponent<ParticleSystem>();
}
private void FixedUpdate()
{
if (Object.op_Implicit((Object)(object)model) && Object.op_Implicit((Object)(object)model.body))
{
if (model.body.HasBuff(Prefabs.speedBuff))
{
speedStopwatch += Time.fixedDeltaTime;
if (speedStopwatch >= speedDelay)
{
speedStopwatch = 0f;
SpawnAfterImage(Prefabs.speedAfterImageBase);
}
if (!speedParticles.isPlaying)
{
speedParticles.Play(true);
}
}
else if (speedParticles.isPlaying)
{
speedStopwatch = 1f;
speedParticles.Stop(true);
}
}
if (!afterImageOn)
{
stopwatch = 1f;
}
else if (afterImageOn)
{
stopwatch += Time.fixedDeltaTime;
if (stopwatch >= delay)
{
stopwatch = 0f;
SpawnAfterImage(Prefabs.afterImageBase);
}
}
}
private void SpawnAfterImage(GameObject source)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
//IL_0022: 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_003a: 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)
for (int i = 0; i < renderers.Length; i++)
{
Mesh val = new Mesh();
renderers[i].BakeMesh(val);
Vector3 position = ((Component)this).transform.position;
Quaternion rotation = ((Component)this).transform.rotation;
GameObject val2 = Object.Instantiate<GameObject>(source, position, Quaternion.Euler(90f, ((Quaternion)(ref rotation)).eulerAngles.y, 0f));
val2.GetComponent<MeshFilter>().mesh = val;
}
}
public void Fire(string s)
{
animator.SetBool(s, true);
}
}
internal class Hook
{
internal static void Hooks()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients);
GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt;
}
private static void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
{
if (sender.HasBuff(Prefabs.speedBuff))
{
args.moveSpeedMultAdd += 0.35f;
args.attackSpeedMultAdd += 0.35f;
}
if (sender.HasBuff(Prefabs.speedDebuff))
{
args.armorAdd -= 15f;
}
}
private static void GlobalEventManager_onServerDamageDealt(DamageReport damageReport)
{
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
//IL_0107: Unknown result type (might be due to invalid IL or missing references)
//IL_010c: Unknown result type (might be due to invalid IL or missing references)
if (!Object.op_Implicit((Object)(object)damageReport.victimBody))
{
return;
}
bool flag = Object.op_Implicit((Object)(object)damageReport.attackerBody) && damageReport.attackerBody.baseNameToken == "LUCIAN_NAME";
if (flag && DamageAPI.HasModdedDamageType(damageReport.damageInfo, Prefabs.CDReduction))
{
((Component)damageReport.attackerBody).GetComponent<Behaviour>().CallRpcDeductUtilityCD((!damageReport.victimBody.isBoss) ? 1 : 2);
}
if (damageReport.victimBody.HasBuff(Prefabs.speedDebuff) && flag)
{
damageReport.attackerBody.AddTimedBuff(Prefabs.speedBuff, 1f);
}
if (DamageTypeCombo.op_Implicit(damageReport.damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)2)) != 0 && flag)
{
damageReport.victimBody.AddTimedBuff(Prefabs.speedDebuff, 3f);
Transform coreTransform = damageReport.victimBody.coreTransform;
if (Object.op_Implicit((Object)(object)coreTransform))
{
GameObject val = Object.Instantiate<GameObject>(Prefabs.passiveMark, coreTransform.position, Quaternion.identity);
val.transform.parent = coreTransform;
NetworkServer.Spawn(val);
}
}
}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.Dragonyck.Lucian", "Lucian", "1.0.0")]
[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.*/)]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
internal class MainPlugin : BaseUnityPlugin
{
internal const string MODUID = "com.Dragonyck.Lucian";
internal const string MODNAME = "Lucian";
internal const string VERSION = "1.0.0";
internal const string SURVIVORNAME = "Lucian";
internal const string SURVIVORNAMEKEY = "LUCIAN";
internal static GameObject characterPrefab;
internal static readonly Color characterColor = Color32.op_Implicit(new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue));
internal static SkillDef passive;
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_00c7: Unknown result type (might be due to invalid IL or missing references)
//IL_00cd: Expected O, but got Unknown
//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
//IL_0109: Unknown result type (might be due to invalid IL or missing references)
//IL_0129: Unknown result type (might be due to invalid IL or missing references)
//IL_0139: Unknown result type (might be due to invalid IL or missing references)
//IL_013f: Expected O, but got Unknown
//IL_0166: Unknown result type (might be due to invalid IL or missing references)
//IL_0177: Unknown result type (might be due to invalid IL or missing references)
//IL_0188: Unknown result type (might be due to invalid IL or missing references)
//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
//IL_0237: Unknown result type (might be due to invalid IL or missing references)
//IL_0368: Unknown result type (might be due to invalid IL or missing references)
//IL_03a2: Unknown result type (might be due to invalid IL or missing references)
//IL_03a7: Unknown result type (might be due to invalid IL or missing references)
//IL_043d: Unknown result type (might be due to invalid IL or missing references)
//IL_0442: Unknown result type (might be due to invalid IL or missing references)
//IL_046f: Unknown result type (might be due to invalid IL or missing references)
//IL_0474: Unknown result type (might be due to invalid IL or missing references)
//IL_0520: Unknown result type (might be due to invalid IL or missing references)
//IL_0540: Unknown result type (might be due to invalid IL or missing references)
//IL_054d: Unknown result type (might be due to invalid IL or missing references)
//IL_06cc: Unknown result type (might be due to invalid IL or missing references)
//IL_06e9: Unknown result type (might be due to invalid IL or missing references)
//IL_0706: Unknown result type (might be due to invalid IL or missing references)
//IL_0723: Unknown result type (might be due to invalid IL or missing references)
//IL_0740: Unknown result type (might be due to invalid IL or missing references)
//IL_075d: Unknown result type (might be due to invalid IL or missing references)
//IL_077a: Unknown result type (might be due to invalid IL or missing references)
//IL_0797: Unknown result type (might be due to invalid IL or missing references)
//IL_07b4: Unknown result type (might be due to invalid IL or missing references)
//IL_07d2: Unknown result type (might be due to invalid IL or missing references)
//IL_07f0: Unknown result type (might be due to invalid IL or missing references)
//IL_080e: Unknown result type (might be due to invalid IL or missing references)
//IL_082c: Unknown result type (might be due to invalid IL or missing references)
//IL_089e: Unknown result type (might be due to invalid IL or missing references)
//IL_09d6: Unknown result type (might be due to invalid IL or missing references)
//IL_09db: Unknown result type (might be due to invalid IL or missing references)
//IL_09fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0a03: Unknown result type (might be due to invalid IL or missing references)
//IL_0a31: Unknown result type (might be due to invalid IL or missing references)
//IL_0a36: Unknown result type (might be due to invalid IL or missing references)
GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/CommandoBody.prefab").WaitForCompletion();
characterPrefab = PrefabAPI.InstantiateClone(val, "LucianBody", 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>("lucianMdl");
val2.AddComponent<AnimationEvents>().soundCenter = val2;
val2.AddComponent<ModelBehaviour>();
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 = new Vector3(1f, 1f, 1f);
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 = "LucianBody";
component2.baseNameToken = "LUCIAN_NAME";
component2.subtitleNameToken = "LUCIAN_SUBTITLE";
component2.bodyFlags = (BodyFlags)16;
component2.rootMotionInMainState = false;
component2.mainRootSpeed = 0f;
component2.baseMaxHealth = 110f;
component2.levelMaxHealth = 35f;
component2.baseRegen = 1.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 = 12f;
component2.levelDamage = 2.4f;
component2.baseAttackSpeed = 1f;
component2.levelAttackSpeed = 0f;
component2.baseCrit = 1f;
component2.levelCrit = 0f;
component2.baseArmor = 0f;
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 = 90f;
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>();
SkinnedMeshRenderer[] componentsInChildren = val2.GetComponentsInChildren<SkinnedMeshRenderer>();
List<RendererInfo> list = new List<RendererInfo>();
foreach (SkinnedMeshRenderer val6 in componentsInChildren)
{
((Renderer)val6).material = Utils.InstantiateMaterial(((Renderer)val6).material.mainTexture);
list.Add(new RendererInfo
{
renderer = (Renderer)(object)val6,
defaultMaterial = ((Renderer)val6).material,
defaultShadowCastingMode = (ShadowCastingMode)1,
ignoreOverlays = false
});
if (!((Object)val6).name.Contains("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 = componentsInChildren[0];
LanguageAPI.Add("LUCIANBODY_DEFAULT_SKIN_NAME", "Default");
LanguageAPI.Add("LUCIANBODY_SKIN01_NAME", "Hired Gun");
LanguageAPI.Add("LUCIANBODY_SKIN02_NAME", "Striker");
LanguageAPI.Add("LUCIANBODY_SKIN06_NAME", "PROJECT");
LanguageAPI.Add("LUCIANBODY_SKIN07_NAME", "Heartseeker");
LanguageAPI.Add("LUCIANBODY_SKIN08_NAME", "High Noon");
LanguageAPI.Add("LUCIANBODY_SKIN09_NAME", "Demacia Vice");
LanguageAPI.Add("LUCIANBODY_SKIN18_NAME", "Pulsefire");
LanguageAPI.Add("LUCIANBODY_SKIN19_NAME", "Prestige Pulsefire");
LanguageAPI.Add("LUCIANBODY_SKIN25_NAME", "Victorious");
LanguageAPI.Add("LUCIANBODY_SKIN31_NAME", "Arcana");
LanguageAPI.Add("LUCIANBODY_SKIN40_NAME", "Strike Paladin");
LanguageAPI.Add("LUCIANBODY_SKIN52_NAME", "Winterblessed");
ModelSkinController val7 = val2.AddComponent<ModelSkinController>();
val7.skins = (SkinDef[])(object)new SkinDef[13]
{
Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "LUCIANBODY_DEFAULT_SKIN_NAME", "base", array)),
Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "LUCIANBODY_SKIN01_NAME", "skin01", array)),
Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "LUCIANBODY_SKIN02_NAME", "skin02", array)),
Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "LUCIANBODY_SKIN06_NAME", "skin06", array)),
Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "LUCIANBODY_SKIN07_NAME", "skin07", array)),
Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "LUCIANBODY_SKIN08_NAME", "skin08", array)),
Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "LUCIANBODY_SKIN09_NAME", "skin09", array)),
Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "LUCIANBODY_SKIN18_NAME", "skin18", array)),
Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "LUCIANBODY_SKIN19_NAME", "skin19", array)),
Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "LUCIANBODY_SKIN25_NAME", "skin25", array)),
Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "LUCIANBODY_SKIN31_NAME", "skin31", array)),
Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "LUCIANBODY_SKIN40_NAME", "skin40", array)),
Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "LUCIANBODY_SKIN52_NAME", "skin52", 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();
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));
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("LUCIAN_NAME", "Lucian");
LanguageAPI.Add("LUCIAN_DESCRIPTION", text);
LanguageAPI.Add("LUCIAN_SUBTITLE", "Purifier");
LanguageAPI.Add("LUCIAN_OUTRO", text2);
LanguageAPI.Add("LUCIAN_FAIL", text3);
SurvivorDef val = ScriptableObject.CreateInstance<SurvivorDef>();
val.cachedName = "LUCIAN_NAME";
val.unlockableDef = null;
val.descriptionToken = "LUCIAN_DESCRIPTION";
val.primaryColor = characterColor;
val.bodyPrefab = characterPrefab;
val.displayPrefab = Utils.NewDisplayModel(((Component)characterPrefab.GetComponent<ModelLocator>().modelBaseTransform).gameObject, "LucianDisplay");
val.outroFlavorToken = "LUCIAN_OUTRO";
val.desiredSortPosition = 22f;
val.mainEndingEscapeFailureFlavorToken = "LUCIAN_FAIL";
ContentAddition.AddSurvivorDef(val);
SkillSetup();
GameObject val2 = PrefabAPI.InstantiateClone(Prefabs.Load<GameObject>("RoR2/Base/Commando/CommandoMonsterMaster.prefab"), "LucianMaster", 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)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
bool flag = default(bool);
ContentAddition.AddEntityState<BaseLucianState>(ref flag);
ContentAddition.AddEntityState<BaseFire>(ref flag);
ContentAddition.AddEntityState<Primary>(ref flag);
ContentAddition.AddEntityState<PrimarySelect>(ref flag);
ContentAddition.AddEntityState<Passive>(ref flag);
ContentAddition.AddEntityState<Beam>(ref flag);
ContentAddition.AddEntityState<Secondary>(ref flag);
ContentAddition.AddEntityState<Utility>(ref flag);
ContentAddition.AddEntityState<Special>(ref flag);
ContentAddition.AddEntityState<CharacterMain>(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("LUCIAN_PASSIVE_NAME", "Lightslinger");
LanguageAPI.Add("LUCIAN_PASSIVE_DESCRIPTION", "After casting an ability, Lucian's next <style=cIsDamage>Piercing Light</style> fires an additional shot, and each hit will reduce <style=cIsDamage>Relentless Pursuit</style> cooldown by <style=cIsUtility>1s</style>.");
component.passiveSkill.enabled = true;
component.passiveSkill.skillNameToken = "LUCIAN_PASSIVE_NAME";
component.passiveSkill.skillDescriptionToken = "LUCIAN_PASSIVE_DESCRIPTION";
component.passiveSkill.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("passive");
}
private void PrimarySetup()
{
SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
LanguageAPI.Add("LUCIAN_M1", "Piercing Light");
LanguageAPI.Add("LUCIAN_M1_DESCRIPTION", "Lucian fires alternating shots with his guns for <style=cIsDamage>210% damage</style>. By holding down the ability, fire a <style=cIsDamage>piercing</style> laser in a line that deals <style=cIsDamage>250% damage</style>.");
SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(PrimarySelect), "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"), "LUCIAN_M1_DESCRIPTION", "LUCIAN_M1", Array.Empty<string>());
component.primary = Utils.NewGenericSkill(characterPrefab, skill);
LanguageAPI.Add("LUCIAN_M1_PASSIVE", "Lightslinger");
LanguageAPI.Add("LUCIAN_M1_PASSIVE_DESCRIPTION", "Lucian quickly fires two shots with his guns for <style=cIsDamage>210% damage</style>.");
passive = Utils.NewSkillDef<SkillDef>(typeof(Passive), "Weapon", 1, 9f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: true, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: false, cancelSprintingOnActivation: true, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("passive"), "LUCIAN_M1_PASSIVE_DESCRIPTION", "LUCIAN_M1_PASSIVE", Array.Empty<string>());
}
private void SecondarySetup()
{
SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
LanguageAPI.Add("LUCIAN_M2", "Ardent Blaze");
LanguageAPI.Add("LUCIAN_M2_DESCRIPTION", "Lucian fires a missile that explodes in a cross pattern dealing <style=cIsDamage>450% damage</style>. Enemies hit are marked for <style=cIsUtility>6s</style>, hitting marked enemies grant <style=cIsDamage>35%</style> <style=cIsDamage>attack speed</style> and <style=cIsUtility>movement speed</style>.");
SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Secondary), "Weapon", 1, 5f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("secondary"), "LUCIAN_M2_DESCRIPTION", "LUCIAN_M2", Array.Empty<string>());
component.secondary = Utils.NewGenericSkill(characterPrefab, skill);
}
private void UtilitySetup()
{
SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
LanguageAPI.Add("LUCIAN_UTIL", "Relentless Pursuit");
LanguageAPI.Add("LUCIAN_UTIL_DESCRIPTION", "Lucian dashes forward a short distance.");
SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Utility), "Slide", 1, 5f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("utility"), "LUCIAN_UTIL_DESCRIPTION", "LUCIAN_UTIL", Array.Empty<string>());
component.utility = Utils.NewGenericSkill(characterPrefab, skill);
}
private void SpecialSetup()
{
SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
LanguageAPI.Add("LUCIAN_SPEC", "The Culling");
LanguageAPI.Add("LUCIAN_SPEC_DESCRIPTION", "Lucian fires rapidly up to <style=cIsDamage>22 + (1x10% crit/attack speed)</style> shots for <style=cIsDamage>150% damage</style> each.");
SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Special), "Weapon", 1, 12f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("special"), "LUCIAN_SPEC_DESCRIPTION", "LUCIAN_SPEC", Array.Empty<string>());
component.special = Utils.NewGenericSkill(characterPrefab, skill);
}
}
internal class Prefabs
{
internal static GameObject projectileGhost;
internal static GameObject projectile;
internal static GameObject projectileExplosion;
internal static GameObject muzzleFlash;
internal static GameObject muzzleFlashUlt;
internal static GameObject primaryHit;
internal static GameObject passiveHit;
internal static GameObject passiveMark;
internal static GameObject beamHit;
internal static GameObject tracerUlt;
internal static GameObject beamTracer;
internal static GameObject afterImageBase;
internal static GameObject speedAfterImageBase;
internal static BuffDef speedBuff;
internal static BuffDef speedDebuff;
internal static ModdedDamageType CDReduction;
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 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_001c: 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_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Expected O, but got Unknown
//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
//IL_00e7: Expected O, but got Unknown
//IL_0182: Unknown result type (might be due to invalid IL or missing references)
//IL_0187: Unknown result type (might be due to invalid IL or missing references)
//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
//IL_0221: Unknown result type (might be due to invalid IL or missing references)
//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
//IL_022f: Unknown result type (might be due to invalid IL or missing references)
//IL_0339: Unknown result type (might be due to invalid IL or missing references)
//IL_033e: Unknown result type (might be due to invalid IL or missing references)
//IL_044c: Unknown result type (might be due to invalid IL or missing references)
//IL_0451: Unknown result type (might be due to invalid IL or missing references)
//IL_0562: Unknown result type (might be due to invalid IL or missing references)
//IL_056c: Expected O, but got Unknown
//IL_058b: Unknown result type (might be due to invalid IL or missing references)
//IL_0600: Unknown result type (might be due to invalid IL or missing references)
//IL_060a: Unknown result type (might be due to invalid IL or missing references)
//IL_062b: Unknown result type (might be due to invalid IL or missing references)
//IL_0669: Unknown result type (might be due to invalid IL or missing references)
//IL_06a7: Unknown result type (might be due to invalid IL or missing references)
//IL_06ac: Unknown result type (might be due to invalid IL or missing references)
//IL_06f8: Unknown result type (might be due to invalid IL or missing references)
//IL_06fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0727: Unknown result type (might be due to invalid IL or missing references)
//IL_072c: Unknown result type (might be due to invalid IL or missing references)
CDReduction = DamageAPI.ReserveDamageType();
speedBuff = Utils.NewBuffDef("Lightslinger", stack: false, hidden: false, Assets.Load<Sprite>("secondary_buff"), Color.white);
speedDebuff = Utils.NewBuffDef("Lightslinger", stack: false, hidden: false, Assets.Load<Sprite>("secondary_debuff"), Color.white);
afterImageBase = Instantiate(Assets.Load<GameObject>("AfterImageBase"), "AfterImageBase");
Material val = new Material(Load<Material>("RoR2/Base/Captain/matCaptainTazerCore.mat"));
val.SetTexture("_MainTex", (Texture)null);
val.SetFloat("_AlphaBoost", 1.05f);
((Renderer)afterImageBase.GetComponent<MeshRenderer>()).material = val;
AnimateShaderAlpha val2 = afterImageBase.AddComponent<AnimateShaderAlpha>();
val2.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
val2.destroyOnEnd = true;
val2.timeMax = 0.4f;
Material val3 = new Material(val);
val3.SetFloat("_AlphaBoost", 0.65f);
speedAfterImageBase = Instantiate(afterImageBase, "SpeedAfterImageBase");
((Renderer)speedAfterImageBase.GetComponent<MeshRenderer>()).material = val3;
AnimateShaderAlpha component = speedAfterImageBase.GetComponent<AnimateShaderAlpha>();
component.timeMax = 0.15f;
component.alphaCurve.AddKey(0.65f, 0f);
tracerUlt = Instantiate(Load<GameObject>("RoR2/Base/Drones/TracerCommandoBoost.prefab"), "TracerUlt");
LineRenderer component2 = tracerUlt.GetComponent<LineRenderer>();
component2.startColor = Color32.op_Implicit(new Color32((byte)0, (byte)165, (byte)242, byte.MaxValue));
component2.endColor = Color32.op_Implicit(new Color32((byte)0, (byte)122, byte.MaxValue, byte.MaxValue));
component2.startWidth = 0.3f;
component2.endWidth = 0f;
((Renderer)component2).material = Load<Material>("RoR2/Base/Commando/matCommandoShotgunTracerCore.mat");
GameObject val4 = Instantiate("RoR2/Base/LunarSkillReplacements/LunarNeedleGhost.prefab", "tracerUltFX");
ParticleSystemRenderer[] componentsInChildren = val4.GetComponentsInChildren<ParticleSystemRenderer>();
Material material = Load<Material>("RoR2/Base/Captain/matCaptainTazerCore.mat");
for (int i = 0; i < componentsInChildren.Length; i++)
{
((Renderer)componentsInChildren[i]).material = material;
((Component)componentsInChildren[i]).transform.localScale = Vector3.one * (float)((i == 0) ? 4 : 3);
}
((Component)val4.GetComponentInChildren<TrailRenderer>()).gameObject.SetActive(false);
Object.Destroy((Object)(object)val4.GetComponent<ProjectileGhostController>());
Object.Destroy((Object)(object)val4.GetComponent<VFXAttributes>());
val4.transform.parent = tracerUlt.transform.GetChild(0);
val4.transform.localPosition = Vector3.zero;
ContentAddition.AddEffect(tracerUlt);
muzzleFlash = Instantiate(Load<GameObject>("RoR2/Base/Commando/MuzzleflashFMJ.prefab"), "MuzzleFlash");
muzzleFlash.GetComponent<EffectComponent>().soundName = "";
ContentAddition.AddEffect(muzzleFlash);
muzzleFlashUlt = Instantiate(Load<GameObject>("RoR2/Base/Captain/CaptainChargeTazer.prefab"), "MuzzleFlashUlt");
muzzleFlashUlt.GetComponent<EffectComponent>().soundName = "";
ParticleSystem[] componentsInChildren2 = muzzleFlashUlt.GetComponentsInChildren<ParticleSystem>();
foreach (ParticleSystem val5 in componentsInChildren2)
{
MainModule main = val5.main;
((MainModule)(ref main)).simulationSpeed = ((MainModule)(ref main)).simulationSpeed * 2f;
}
ContentAddition.AddEffect(muzzleFlashUlt);
passiveMark = Instantiate(Assets.Load<GameObject>("PassiveMarkEffect"), "PassiveMarkEffect");
passiveMark.AddComponent<NetworkIdentity>();
PrefabAPI.RegisterNetworkPrefab(passiveMark);
projectileExplosion = Instantiate(Assets.Load<GameObject>("CrossExplosion"), "ProjectileExplosion");
Utils.RegisterEffect(projectileExplosion, 0.5f, "Play_sfx_Lucian_LucianWBlowup_buffdeactivate");
projectileGhost = Instantiate(Assets.Load<GameObject>("CrossProjectile"), "ProjectileGhost");
projectileGhost.AddComponent<ProjectileGhostController>();
GameObject gameObject = ((Component)projectileGhost.transform.GetChild(0)).gameObject;
Utils.AddScaleComponent(gameObject, 0.12f);
Utils.AddRotationComponent(gameObject, 65f, (RotationAxis)2);
projectile = Instantiate(Load<GameObject>("RoR2/Base/LemurianBruiser/LemurianBigFireball.prefab"), "Projectile", registerNetwork: true);
projectile.GetComponent<ProjectileDamage>().damageType = DamageTypeCombo.op_Implicit((DamageType)2);
ProjectileController component3 = projectile.GetComponent<ProjectileController>();
component3.ghostPrefab = projectileGhost;
component3.startSound = "";
projectile.GetComponent<ProjectileImpactExplosion>().impactEffect = projectileExplosion;
ContentAddition.AddProjectile(projectile);
primaryHit = Instantiate(Load<GameObject>("RoR2/Base/LunarWisp/LunarWispMinigunHitspark.prefab"), "PrimaryHit");
primaryHit.GetComponent<EffectComponent>().soundName = "Play_sfx_Lucian_LucianBasicAttack_OnHit";
ContentAddition.AddEffect(primaryHit);
passiveHit = Instantiate(primaryHit, "PassiveHit");
passiveHit.GetComponent<EffectComponent>().soundName = "Play_sfx_Lucian_LucianPassiveShot_OnHit";
ContentAddition.AddEffect(passiveHit);
beamHit = Instantiate("RoR2/DLC1/VoidBarnacle/OmniExplosionVFXVoidBarnacle.prefab", "BeamHit");
beamHit.GetComponent<EffectComponent>().soundName = "Play_sfx_Lucian_LucianQTar_hit";
Object.Destroy((Object)(object)beamHit.GetComponent<OmniEffect>());
ParticleSystemRenderer[] componentsInChildren3 = beamHit.GetComponentsInChildren<ParticleSystemRenderer>();
foreach (ParticleSystemRenderer val6 in componentsInChildren3)
{
((Renderer)val6).material = new Material(((Renderer)val6).material);
((Renderer)val6).material.DisableKeyword("DISABLEKEYWORD");
((Renderer)val6).material.SetColor("_TintColor", Color.blue);
}
ContentAddition.AddEffect(beamHit);
beamTracer = Instantiate("RoR2/DLC1/VoidRaidCrab/TracerVoidRaidCrabTripleBeam.prefab", "TracerEffect");
beamTracer.AddComponent<eeeee>();
beamTracer.GetComponentsInChildren<LineRenderer>()[1].widthMultiplier = 0.5f;
Tracer component4 = beamTracer.GetComponent<Tracer>();
((Component)component4).transform.GetChild(0).localScale = Vector3.one * 0.5f;
((Component)component4).transform.localScale = new Vector3(-1f, 0.5f, 0.5f);
beamTracer.GetComponent<EffectComponent>().soundName = "";
Object.Destroy((Object)(object)((Component)beamTracer.GetComponentInChildren<Decal>()).gameObject);
beamTracer.GetComponentInChildren<Light>().color = Color.cyan;
((Renderer)Array.Find(beamTracer.GetComponentsInChildren<LineRenderer>(), (LineRenderer element) => ((Object)element).name == "Beam1")).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Junk/Mage/matMageLightningLaser.mat").WaitForCompletion();
ParticleSystemRenderer[] componentsInChildren4 = beamTracer.GetComponentsInChildren<ParticleSystemRenderer>();
foreach (ParticleSystemRenderer val7 in componentsInChildren4)
{
string name = ((Object)val7).name;
if (name == "BeamParticles, Rings")
{
((Renderer)val7).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/VFX/matLightningArm.mat").WaitForCompletion();
}
if (name == "BeamParticles, Small")
{
((Renderer)val7).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/LunarGolem/matLunarGolemMuzzleFlash.mat").WaitForCompletion();
}
}
ContentAddition.AddEffect(beamTracer);
}
}
internal class BaseFire : BaseLucianState
{
private float duration;
public bool crit;
public virtual float baseDuration => 0f;
public virtual float damageCoefficient => 0f;
public virtual float maxDistance => 0f;
public virtual string animationName => "";
public virtual string playBackParam => "M1";
public virtual bool alternate => false;
public virtual bool alternateOnFire => false;
public virtual string soundID => "";
public virtual GameObject muzzleEffect => null;
public virtual GameObject tracerEffect => null;
public virtual GameObject hitEffect => null;
public virtual DamageType damageType => DamageTypeCombo.op_Implicit(DamageTypeCombo.GenericPrimary);
public virtual bool moddedDamageType => false;
public override void OnEnter()
{
base.OnEnter();
if (baseDuration != 0f)
{
duration = baseDuration / ((BaseState)this).attackSpeedStat;
}
crit = ((BaseState)this).RollCrit();
if (alternate)
{
Behaviour obj = behaviour;
obj.alt = !obj.alt;
}
PlayAnim();
}
public virtual void PlayAnim()
{
((EntityState)this).PlayAnimation("Gesture, Override", animationName, playBackParam, duration, 0f);
if (((BaseState)this).isGrounded && !animator.GetBool("isMoving"))
{
((EntityState)this).PlayAnimation("FullBody, Override", animationName, playBackParam, duration, 0f);
}
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
bool flag = false;
string text = "";
bool @bool = animator.GetBool("gunR");
bool bool2 = animator.GetBool("gunL");
bool bool3 = animator.GetBool("both");
flag = bool3 || @bool || bool2;
text = (@bool ? "gunR" : ((!bool2) ? "both" : "gunL"));
if (flag)
{
animator.SetBool(text, false);
Fire(text);
EffectManager.SimpleMuzzleFlash(muzzleEffect, ((EntityState)this).gameObject, text, true);
}
if (((EntityState)this).isAuthority && duration != 0f && ((EntityState)this).fixedAge >= duration)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
public virtual void Fire(string fireString)
{
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_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_007c: Unknown result type (might be due to invalid IL or missing references)
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0080: Unknown result type (might be due to invalid IL or missing references)
//IL_0091: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_009e: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
//IL_0101: Unknown result type (might be due to invalid IL or missing references)
//IL_0108: Unknown result type (might be due to invalid IL or missing references)
//IL_011b: 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_0139: Unknown result type (might be due to invalid IL or missing references)
//IL_0140: Unknown result type (might be due to invalid IL or missing references)
//IL_014c: Unknown result type (might be due to invalid IL or missing references)
//IL_0158: Unknown result type (might be due to invalid IL or missing references)
//IL_0163: Unknown result type (might be due to invalid IL or missing references)
//IL_016a: Unknown result type (might be due to invalid IL or missing references)
//IL_016c: Unknown result type (might be due to invalid IL or missing references)
//IL_0171: Unknown result type (might be due to invalid IL or missing references)
//IL_0176: Unknown result type (might be due to invalid IL or missing references)
//IL_017d: Expected O, but got Unknown
//IL_018c: Unknown result type (might be due to invalid IL or missing references)
AkSoundEngine.PostEvent(soundID, ((EntityState)this).gameObject);
if (((EntityState)this).isAuthority)
{
float num = 0.8f;
((BaseState)this).AddRecoil(-1f * num, -1.5f * num, -0.25f * num, 0.25f * num);
((EntityState)this).characterBody.AddSpreadBloom(num);
bool flag = fireString == "both";
Ray aimRay = ((BaseState)this).GetAimRay();
BulletAttack val = new BulletAttack
{
maxDistance = maxDistance,
stopperMask = (flag ? ((LayerIndex)(ref LayerIndex.world)).mask : BulletAttack.defaultStopperMask),
falloffModel = (FalloffModel)((!flag) ? 1 : 0),
radius = (flag ? 1f : 0.25f),
owner = ((EntityState)this).gameObject,
weapon = ((EntityState)this).gameObject,
origin = ((Ray)(ref aimRay)).origin,
aimVector = ((Ray)(ref aimRay)).direction,
minSpread = 0f,
maxSpread = 0f,
bulletCount = 1u,
damage = ((BaseState)this).damageStat * damageCoefficient,
force = damageCoefficient * 100f,
tracerEffectPrefab = tracerEffect,
muzzleName = fireString,
hitEffectPrefab = hitEffect,
isCrit = crit,
procCoefficient = 1f,
smartCollision = true,
damageType = DamageTypeCombo.op_Implicit(damageType)
};
if (moddedDamageType)
{
DamageAPI.AddModdedDamageType(val, Prefabs.CDReduction);
}
val.Fire();
}
if (alternateOnFire)
{
Behaviour obj = behaviour;
obj.alt = !obj.alt;
}
}
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 BaseLucianState : BaseSkillState
{
public Animator animator;
public ChildLocator childLocator;
public Behaviour behaviour;
public ModelBehaviour modelBehaviour;
public override void OnEnter()
{
((BaseState)this).OnEnter();
animator = ((EntityState)this).GetModelAnimator();
animator.SetBool("gunR", false);
animator.SetBool("gunL", false);
animator.SetBool("both", false);
childLocator = ((Component)animator).GetComponent<ChildLocator>();
behaviour = ((EntityState)this).GetComponent<Behaviour>();
modelBehaviour = ((Component)animator).GetComponent<ModelBehaviour>();
}
public void SetOverride()
{
((EntityState)this).skillLocator.primary.SetSkillOverride((object)((EntityState)this).gameObject, MainPlugin.passive, (SkillOverridePriority)4);
((Component)((BaseState)this).FindModelChild("passiveEffectL")).GetComponent<ParticleSystem>().Play();
((Component)((BaseState)this).FindModelChild("passiveEffectR")).GetComponent<ParticleSystem>().Play();
}
public void UnsetOverride()
{
((EntityState)this).skillLocator.primary.UnsetSkillOverride((object)((EntityState)this).gameObject, MainPlugin.passive, (SkillOverridePriority)4);
((Component)((BaseState)this).FindModelChild("passiveEffectL")).GetComponent<ParticleSystem>().Stop();
((Component)((BaseState)this).FindModelChild("passiveEffectR")).GetComponent<ParticleSystem>().Stop();
}
}
internal class CharacterMain : GenericCharacterMain
{
}
internal class Primary : BaseFire
{
public override float baseDuration => 0.45f;
public override float damageCoefficient => 2.1f;
public override float maxDistance => 250f;
public override string soundID => "Play_sfx_Lucian_LucianBasicAttack_OnMissileCast";
public override string animationName
{
get
{
string text = (behaviour.alt ? "Attack2" : "Attack1");
if (crit)
{
text += "Crit";
}
return text;
}
}
public override bool alternate => true;
public override GameObject muzzleEffect => Prefabs.muzzleFlash;
public override GameObject tracerEffect => Prefabs.Load<GameObject>("RoR2/Base/Commando/TracerCommandoShotgun.prefab");
public override GameObject hitEffect => Prefabs.primaryHit;
}
internal class Passive : BaseFire
{
public override float baseDuration => 0.6f;
public override float damageCoefficient => 2.1f;
public override float maxDistance => 250f;
public override string animationName => crit ? "Passive" : "PassiveCrit";
public override string soundID => "Play_sfx_Lucian_LucianPassiveShot_OnMissileCast";
public override bool alternateOnFire => true;
public override GameObject muzzleEffect => Prefabs.muzzleFlash;
public override GameObject tracerEffect => Prefabs.Load<GameObject>("RoR2/Base/Commando/TracerCommandoShotgun.prefab");
public override GameObject hitEffect => Prefabs.passiveHit;
public override bool moddedDamageType => true;
public override void OnExit()
{
UnsetOverride();
base.OnExit();
}
}
internal class Beam : BaseFire
{
public override float baseDuration => 0.88f;
public override float damageCoefficient => 2.5f;
public override float maxDistance => 250f;
public override string soundID => "Play_sfx_Lucian_LucianQ_OnCast";
public override string animationName => "Spell1";
public override bool alternate => true;
public override GameObject muzzleEffect => Prefabs.muzzleFlashUlt;
public override GameObject tracerEffect => Prefabs.beamTracer;
public override GameObject hitEffect => Prefabs.beamHit;
}
internal class PrimarySelect : BaseLucianState
{
private float duration = 0.25f;
public override void OnEnter()
{
base.OnEnter();
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
if (((EntityState)this).isAuthority)
{
if (!((EntityState)this).inputBank.skill1.down)
{
((EntityState)this).outer.SetNextState((EntityState)(object)new Primary());
}
else if (((EntityState)this).fixedAge >= duration)
{
((EntityState)this).outer.SetNextState((EntityState)(object)new Beam());
}
}
}
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 Secondary : BaseFire
{
public override float baseDuration => 0.35f;
public override float damageCoefficient => 4.5f;
public override float maxDistance => 250f;
public override string animationName => "Spell2";
public override string playBackParam => "M2";
public override GameObject muzzleEffect => Prefabs.Load<GameObject>("RoR2/Base/Commando/MuzzleflashFMJ.prefab");
public override DamageType damageType => DamageTypeCombo.op_Implicit(DamageTypeCombo.GenericSecondary);
public override void OnEnter()
{
base.OnEnter();
SetOverride();
AkSoundEngine.PostEvent("Play_sfx_Lucian_LucianW_OnCast", ((EntityState)this).gameObject);
}
public override void Fire(string s)
{
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: 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)
float num = 2f;
((BaseState)this).AddRecoil(-1f * num, -1.5f * num, -0.25f * num, 0.25f * num);
((EntityState)this).characterBody.AddSpreadBloom(num);
Ray aimRay = ((BaseState)this).GetAimRay();
ProjectileManager.instance.FireProjectile(Prefabs.projectile, ((Ray)(ref aimRay)).origin, Quaternion.LookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, ((BaseState)this).damageStat * base.damageCoefficient, 640f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, 135f, (DamageTypeCombo?)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 Special : BaseFire
{
private int fireCount;
private int maxFireCount;
public override float damageCoefficient => 1.5f;
public override float maxDistance => 250f;
public override bool alternateOnFire => true;
public override string soundID => "Play_sfx_Lucian_LucianRMis_cast";
public override GameObject muzzleEffect => Prefabs.muzzleFlashUlt;
public override GameObject tracerEffect => Prefabs.tracerUlt;
public override GameObject hitEffect => Prefabs.Load<GameObject>("RoR2/Base/LunarWisp/LunarWispMinigunHitspark.prefab");
public override DamageType damageType => DamageTypeCombo.op_Implicit(DamageTypeCombo.GenericSpecial);
public override void OnEnter()
{
base.OnEnter();
animator.SetFloat("inUlt", 1f);
animator.SetFloat("Special", 1.5f * ((BaseState)this).attackSpeedStat);
SetOverride();
maxFireCount = 22 + (int)((((BaseState)this).attackSpeedStat - 1f) * 10f) + Mathf.FloorToInt(((BaseState)this).critStat);
AkSoundEngine.PostEvent("Play_sfx_Lucian_LucianR_OnCast", ((EntityState)this).gameObject);
}
public override void PlayAnim()
{
}
public override void Fire(string s)
{
fireCount++;
base.Fire(s);
if (fireCount >= maxFireCount)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
public override void FixedUpdate()
{
base.FixedUpdate();
if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= 0.25f && ((ButtonState)(ref ((EntityState)this).inputBank.skill4)).justPressed)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
public override void OnExit()
{
animator.SetFloat("inUlt", 0f);
base.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 Utility : BaseLucianState
{
private float duration = 0.35f;
private Vector3 dir;
public override void OnEnter()
{
//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)
base.OnEnter();
dir = ((EntityState)this).characterDirection.forward;
((EntityState)this).PlayAnimation("Body", "Dash", "Utility", duration, 0f);
SetOverride();
AkSoundEngine.PostEvent("Play_sfx_Lucian_LucianE_OnCast", ((EntityState)this).gameObject);
modelBehaviour.afterImageOn = true;
((Component)((BaseState)this).FindModelChild("dashParticles")).GetComponent<ParticleSystem>().Play(true);
}
public override void Update()
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
((EntityState)this).Update();
((EntityState)this).characterDirection.forward = dir;
}
public override void FixedUpdate()
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: 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_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Unknown result type (might be due to invalid IL or missing references)
((EntityState)this).FixedUpdate();
((EntityState)this).characterDirection.forward = dir;
if (((EntityState)this).isAuthority)
{
((EntityState)this).characterMotor.velocity = Vector3.zero;
CharacterMotor characterMotor = ((EntityState)this).characterMotor;
characterMotor.rootMotion += dir * Util.Remap(((BaseState)this).moveSpeedStat, 3f, 30f, 1f, 8f) * 14f * Time.fixedDeltaTime;
}
if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
public override void OnExit()
{
modelBehaviour.afterImageOn = false;
((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 Sounds
{
public static readonly uint Sound1;
public static readonly uint Sound2;
public static readonly uint Sound3;
public static readonly uint Sound4;
}
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_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Expected O, but got Unknown
GameObject val = PrefabAPI.InstantiateClone(model, name, false);
val.GetComponentInChildren<Animator>().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(SkinnedMeshRenderer[] 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_00f9: Unknown result type (might be due to invalid IL or missing references)
//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
//IL_00fe: 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 (SkinnedMeshRenderer val in childList)
{
string name = ((Object)val).name;
bool shouldActivate = name.Contains(objectToEnable);
if (name.Contains("DemonForm"))
{
shouldActivate = false;
}
GameObjectActivation val2 = default(GameObjectActivation);
val2.gameObject = ((Component)val).gameObject;
val2.shouldActivate = shouldActivate;
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, 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;
}
}