Decompiled source of ImpostorMod v0.5.0
ImpostorMod.dll
Decompiled a year ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; 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 BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using EntityStates.Commando; using EntityStates.Commando.CommandoWeapon; using HG; using HG.BlendableTypes; using ImpostorMod.Modules; using ImpostorMod.Modules.Characters; using ImpostorMod.Modules.Survivors; using ImpostorMod.SkillStates; using ImpostorMod.SkillStates.BaseStates; using On.RoR2; using R2API; using R2API.Utils; using RoR2; using RoR2.Achievements; using RoR2.Audio; using RoR2.ContentManagement; using RoR2.Projectile; using RoR2.Skills; using UnityEngine; using UnityEngine.Networking; using UnityEngine.Rendering; [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.0", FrameworkDisplayName = "")] [assembly: AssemblyCompany("ImpostorMod")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("ImpostorMod")] [assembly: AssemblyTitle("ImpostorMod")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: UnverifiableCode] namespace ImpostorMod { [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.resyntax.impostor", "ImpostorMod", "0.4.5")] [R2APISubmoduleDependency(new string[] { "PrefabAPI", "LanguageAPI", "SoundAPI", "UnlockableAPI" })] public class ImpostorPlugin : BaseUnityPlugin { public const string MODUID = "com.resyntax.impostor"; public const string MODNAME = "ImpostorMod"; public const string MODVERSION = "0.4.5"; public const string DEVELOPER_PREFIX = "RESYNTAX"; public static ImpostorPlugin instance; private void Awake() { instance = this; Log.Init(((BaseUnityPlugin)this).Logger); Assets.Initialize(); Config.ReadConfig(); States.RegisterStates(); Buffs.RegisterBuffs(); Projectiles.RegisterProjectiles(); Tokens.AddTokens(); ItemDisplays.PopulateDisplays(); new MyCharacter().Initialize(); new ContentPacks().Initialize(); Hook(); } private void Hook() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats); } private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self) { orig.Invoke(self); if (Object.op_Implicit((Object)(object)self) && self.HasBuff(Buffs.armorBuff)) { self.armor += 300f; } } } internal static class Log { internal static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void Debug(object data) { _logSource.LogDebug(data); } internal static void Error(object data) { _logSource.LogError(data); } internal static void Fatal(object data) { _logSource.LogFatal(data); } internal static void Info(object data) { _logSource.LogInfo(data); } internal static void Message(object data) { _logSource.LogMessage(data); } internal static void Warning(object data) { _logSource.LogWarning(data); } } } namespace ImpostorMod.SkillStates { public class Roll : BaseSkillState { public static float duration = 1.5f; public static float initialSpeedCoefficient = 3f; public static float finalSpeedCoefficient = 2.5f; public static string dodgeSoundString = "HenryRoll"; public static float dodgeFOV = DodgeState.dodgeFOV; private float rollSpeed; private Vector3 forwardDirection; private Animator animator; private Vector3 previousPosition; public override void OnEnter() { //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) //IL_0098: 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_0069: 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) //IL_009d: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: 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_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0147: 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_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); animator = ((EntityState)this).GetModelAnimator(); if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { Vector3 val = ((((EntityState)this).inputBank.moveVector == Vector3.zero) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).inputBank.moveVector); forwardDirection = ((Vector3)(ref val)).normalized; } Vector3 val2 = (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) ? ((EntityState)this).characterDirection.forward : forwardDirection); Vector3 val3 = Vector3.Cross(Vector3.up, val2); float num = Vector3.Dot(forwardDirection, val2); float num2 = Vector3.Dot(forwardDirection, val3); RecalculateRollSpeed(); if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { ((EntityState)this).characterMotor.velocity.y = 0f; ((EntityState)this).characterMotor.velocity = forwardDirection * rollSpeed; } Vector3 val4 = (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) ? ((EntityState)this).characterMotor.velocity : Vector3.zero); previousPosition = ((EntityState)this).transform.position - val4; ((EntityState)this).PlayAnimation("FullBody, Override", "Roll", "Roll.playbackRate", duration); Util.PlaySound(dodgeSoundString, ((EntityState)this).gameObject); if (NetworkServer.active) { ((EntityState)this).characterBody.AddTimedBuff(Buffs.armorBuff, 3f * duration); ((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, 0.5f * duration); } } private void RecalculateRollSpeed() { rollSpeed = ((BaseState)this).moveSpeedStat * Mathf.Lerp(initialSpeedCoefficient, finalSpeedCoefficient, ((EntityState)this).fixedAge / duration); } public override void FixedUpdate() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); RecalculateRollSpeed(); if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { ((EntityState)this).characterDirection.forward = forwardDirection; } if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams)) { ((EntityState)this).cameraTargetParams.fovOverride = Mathf.Lerp(dodgeFOV, 60f, ((EntityState)this).fixedAge / duration); } Vector3 val = ((EntityState)this).transform.position - previousPosition; Vector3 normalized = ((Vector3)(ref val)).normalized; if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) && normalized != Vector3.zero) { Vector3 val2 = normalized * rollSpeed; float num = Mathf.Max(Vector3.Dot(val2, forwardDirection), 0f); val2 = forwardDirection * num; val2.y = 0f; ((EntityState)this).characterMotor.velocity = val2; } previousPosition = ((EntityState)this).transform.position; if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams)) { ((EntityState)this).cameraTargetParams.fovOverride = -1f; } ((EntityState)this).OnExit(); ((EntityState)this).characterMotor.disableAirControlUntilCollision = false; } public override void OnSerialize(NetworkWriter writer) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) ((BaseSkillState)this).OnSerialize(writer); writer.Write(forwardDirection); } public override void OnDeserialize(NetworkReader reader) { //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) ((BaseSkillState)this).OnDeserialize(reader); forwardDirection = reader.ReadVector3(); } } public class Shoot : BaseSkillState { public static float damageCoefficient = 4.2f; public static float procCoefficient = 1f; public static float baseDuration = 0.6f; public static float force = 800f; public static float recoil = 3f; public static float range = 256f; public static GameObject tracerEffectPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/Tracers/TracerGoldGat"); private float duration; private float fireTime; private bool hasFired; private string muzzleString; public override void OnEnter() { ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; fireTime = 0.2f * duration; ((EntityState)this).characterBody.SetAimTimer(2f); muzzleString = "Muzzle"; ((EntityState)this).PlayAnimation("LeftArm, Override", "ShootGun", "ShootGun.playbackRate", 1.8f); } public override void OnExit() { ((EntityState)this).OnExit(); } private void Fire() { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_009b: 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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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_00db: 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_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: 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_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0121: 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_0145: 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_0152: 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_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0175: 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_017b: 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_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: 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) if (!hasFired) { hasFired = true; ((EntityState)this).characterBody.AddSpreadBloom(1.5f); EffectManager.SimpleMuzzleFlash(FirePistol2.muzzleEffectPrefab, ((EntityState)this).gameObject, muzzleString, false); Util.PlaySound("HenryShootPistol", ((EntityState)this).gameObject); if (((EntityState)this).isAuthority) { Ray aimRay = ((BaseState)this).GetAimRay(); ((BaseState)this).AddRecoil(-1f * recoil, -2f * recoil, -0.5f * recoil, 0.5f * recoil); new BulletAttack { bulletCount = 1u, aimVector = ((Ray)(ref aimRay)).direction, origin = ((Ray)(ref aimRay)).origin, damage = damageCoefficient * ((BaseState)this).damageStat, damageColorIndex = (DamageColorIndex)0, damageType = (DamageType)0, falloffModel = (FalloffModel)1, maxDistance = range, force = force, hitMask = CommonMasks.bullet, minSpread = 0f, maxSpread = 0f, isCrit = ((BaseState)this).RollCrit(), owner = ((EntityState)this).gameObject, muzzleName = muzzleString, smartCollision = false, procChainMask = default(ProcChainMask), procCoefficient = procCoefficient, radius = 0.75f, sniper = false, stopperMask = CommonMasks.bullet, weapon = null, tracerEffectPrefab = tracerEffectPrefab, spreadPitchScale = 0f, spreadYawScale = 0f, queryTriggerInteraction = (QueryTriggerInteraction)0, hitEffectPrefab = FirePistol2.hitEffectPrefab }.Fire(); } } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= fireTime) { Fire(); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } 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 class SlashCombo : BaseMeleeAttack { public override void OnEnter() { //IL_000e: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) hitboxName = "Sword"; damageType = (DamageType)0; damageCoefficient = 2.5f; procCoefficient = 1f; pushForce = 100f; bonusForce = Vector3.zero; baseDuration = 1f; attackStartTime = 0.1f; attackEndTime = 0.3f; baseEarlyExitTime = 0.7f; hitStopDuration = 0.012f; attackRecoil = 1f; hitHopVelocity = 2f; swingSoundString = "HenrySwordSwing"; hitSoundString = ""; muzzleString = ((swingIndex % 2 == 0) ? "SwingLeft" : "SwingRight"); swingEffectPrefab = Assets.swordSwingEffect; hitEffectPrefab = Assets.swordHitImpactEffect; impactSound = Assets.swordHitSoundEvent.index; base.OnEnter(); } protected override void PlayAttackAnimation() { base.PlayAttackAnimation(); } protected override void PlaySwingEffect() { base.PlaySwingEffect(); } protected override void OnHitEnemyAuthority() { base.OnHitEnemyAuthority(); } protected override void SetNextState() { int num = ((swingIndex == 0) ? 1 : 0); ((EntityState)this).outer.SetNextState((EntityState)(object)new SlashCombo { swingIndex = num }); } public override void OnExit() { base.OnExit(); } } public class ThrowBomb : BaseMeleeAttack { public override void OnEnter() { //IL_000e: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) hitboxName = "Sword"; damageType = (DamageType)0; damageCoefficient = 69f; procCoefficient = 1f; pushForce = 100f; bonusForce = Vector3.zero; baseDuration = 2f; attackStartTime = 0.2f; attackEndTime = 0.6f; baseEarlyExitTime = 1.7f; hitStopDuration = 0.012f; attackRecoil = 1f; hitHopVelocity = 2f; swingSoundString = "HenrySwordSwing"; hitSoundString = ""; muzzleString = ((swingIndex % 2 == 0) ? "SwingLeft" : "SwingRight"); swingEffectPrefab = Assets.swordSwingEffect; hitEffectPrefab = Assets.swordHitImpactEffect; impactSound = Assets.swordHitSoundEvent.index; base.OnEnter(); } protected override void PlayAttackAnimation() { base.PlayAttackAnimation(); } protected override void PlaySwingEffect() { base.PlaySwingEffect(); } protected override void OnHitEnemyAuthority() { base.OnHitEnemyAuthority(); } protected override void SetNextState() { int num = ((swingIndex == 0) ? 1 : 0); ((EntityState)this).outer.SetNextState((EntityState)(object)new SlashCombo { swingIndex = num }); } public override void OnExit() { base.OnExit(); } } } namespace ImpostorMod.SkillStates.BaseStates { public class BaseMeleeAttack : BaseSkillState { public int swingIndex; protected string hitboxName = "Sword"; protected DamageType damageType = (DamageType)0; protected float damageCoefficient = 3.5f; protected float procCoefficient = 1f; protected float pushForce = 300f; protected Vector3 bonusForce = Vector3.zero; protected float baseDuration = 1f; protected float attackStartTime = 0.2f; protected float attackEndTime = 0.4f; protected float baseEarlyExitTime = 0.4f; protected float hitStopDuration = 0.012f; protected float attackRecoil = 0.75f; protected float hitHopVelocity = 4f; protected bool cancelled = false; protected string swingSoundString = ""; protected string hitSoundString = ""; protected string muzzleString = "SwingCenter"; protected GameObject swingEffectPrefab; protected GameObject hitEffectPrefab; protected NetworkSoundEventIndex impactSound; private float earlyExitTime; public float duration; private bool hasFired; private float hitPauseTimer; private OverlapAttack attack; protected bool inHitPause; private bool hasHopped; protected float stopwatch; protected Animator animator; private HitStopCachedState hitStopCachedState; private Vector3 storedVelocity; public override void OnEnter() { //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Expected O, but got Unknown //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_013b: 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_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; earlyExitTime = baseEarlyExitTime / ((BaseState)this).attackSpeedStat; hasFired = false; animator = ((EntityState)this).GetModelAnimator(); ((BaseState)this).StartAimMode(0.5f + duration, false); ((EntityState)this).characterBody.outOfCombatStopwatch = 0f; animator.SetBool("attacking", true); HitBoxGroup hitBoxGroup = null; Transform modelTransform = ((EntityState)this).GetModelTransform(); if (Object.op_Implicit((Object)(object)modelTransform)) { hitBoxGroup = Array.Find(((Component)modelTransform).GetComponents<HitBoxGroup>(), (HitBoxGroup element) => element.groupName == hitboxName); } PlayAttackAnimation(); attack = new OverlapAttack(); attack.damageType = damageType; attack.attacker = ((EntityState)this).gameObject; attack.inflictor = ((EntityState)this).gameObject; attack.teamIndex = ((BaseState)this).GetTeam(); attack.damage = damageCoefficient * ((BaseState)this).damageStat; attack.procCoefficient = procCoefficient; attack.hitEffectPrefab = hitEffectPrefab; attack.forceVector = bonusForce; attack.pushAwayForce = pushForce; attack.hitBoxGroup = hitBoxGroup; attack.isCrit = ((BaseState)this).RollCrit(); attack.impactSound = impactSound; } protected virtual void PlayAttackAnimation() { ((EntityState)this).PlayCrossfade("Gesture, Override", "Slash" + (1 + swingIndex), "Slash.playbackRate", duration, 0.05f); } public override void OnExit() { if (!hasFired && !cancelled) { FireAttack(); } ((EntityState)this).OnExit(); animator.SetBool("attacking", false); } protected virtual void PlaySwingEffect() { EffectManager.SimpleMuzzleFlash(swingEffectPrefab, ((EntityState)this).gameObject, muzzleString, true); } protected virtual void OnHitEnemyAuthority() { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) Util.PlaySound(hitSoundString, ((EntityState)this).gameObject); if (!hasHopped) { if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded && hitHopVelocity > 0f) { ((BaseState)this).SmallHop(((EntityState)this).characterMotor, hitHopVelocity); } hasHopped = true; } if (!inHitPause && hitStopDuration > 0f) { storedVelocity = ((EntityState)this).characterMotor.velocity; hitStopCachedState = ((BaseState)this).CreateHitStopCachedState(((EntityState)this).characterMotor, animator, "Slash.playbackRate"); hitPauseTimer = hitStopDuration / ((BaseState)this).attackSpeedStat; inHitPause = true; } } private void FireAttack() { if (!hasFired) { hasFired = true; Util.PlayAttackSpeedSound(swingSoundString, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat); if (((EntityState)this).isAuthority) { PlaySwingEffect(); ((BaseState)this).AddRecoil(-1f * attackRecoil, -2f * attackRecoil, -0.5f * attackRecoil, 0.5f * attackRecoil); } } if (((EntityState)this).isAuthority && attack.Fire((List<HurtBox>)null)) { OnHitEnemyAuthority(); } } protected virtual void SetNextState() { int num = ((swingIndex == 0) ? 1 : 0); ((EntityState)this).outer.SetNextState((EntityState)(object)new BaseMeleeAttack { swingIndex = num }); } public override void FixedUpdate() { //IL_0037: 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) //IL_0061: 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) ((EntityState)this).FixedUpdate(); hitPauseTimer -= Time.fixedDeltaTime; if (hitPauseTimer <= 0f && inHitPause) { ((BaseState)this).ConsumeHitStopCachedState(hitStopCachedState, ((EntityState)this).characterMotor, animator); inHitPause = false; ((EntityState)this).characterMotor.velocity = storedVelocity; } if (!inHitPause) { stopwatch += Time.fixedDeltaTime; } else { if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } if (Object.op_Implicit((Object)(object)animator)) { animator.SetFloat("Swing.playbackRate", 0f); } } if (stopwatch >= duration * attackStartTime && stopwatch <= duration * attackEndTime) { FireAttack(); } if (stopwatch >= duration - earlyExitTime && ((EntityState)this).isAuthority && ((EntityState)this).inputBank.skill1.down) { if (!hasFired) { FireAttack(); } SetNextState(); } else if (stopwatch >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } 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; } public override void OnSerialize(NetworkWriter writer) { ((BaseSkillState)this).OnSerialize(writer); writer.Write(swingIndex); } public override void OnDeserialize(NetworkReader reader) { ((BaseSkillState)this).OnDeserialize(reader); swingIndex = reader.ReadInt32(); } } public class BaseTimedSkillState : BaseSkillState { public static float TimedBaseDuration; public static float TimedBaseCastStartTime; public static float TimedBaseCastEndTime; protected float duration; protected float castStartTime; protected float castEndTime; protected bool hasFired; protected bool isFiring; protected bool hasExited; protected virtual void InitDurationValues(float baseDuration, float baseCastStartTime, float baseCastEndTime = 1f) { TimedBaseDuration = baseDuration; TimedBaseCastStartTime = baseCastStartTime; TimedBaseCastEndTime = baseCastEndTime; duration = TimedBaseDuration / ((BaseState)this).attackSpeedStat; castStartTime = baseCastStartTime * duration; castEndTime = baseCastEndTime * duration; } protected virtual void OnCastEnter() { } protected virtual void OnCastFixedUpdate() { } protected virtual void OnCastUpdate() { } protected virtual void OnCastExit() { } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!hasFired && ((EntityState)this).fixedAge > castStartTime) { hasFired = true; OnCastEnter(); } bool flag = ((EntityState)this).fixedAge >= castStartTime; bool flag2 = ((EntityState)this).fixedAge >= castEndTime; isFiring = false; if ((flag && !flag2) || (flag && flag2 && !hasFired)) { isFiring = true; OnCastFixedUpdate(); } if (flag2 && !hasExited) { hasExited = true; OnCastExit(); } if (((EntityState)this).fixedAge > duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void Update() { ((EntityState)this).Update(); if (isFiring) { OnCastUpdate(); } } } public class ExampleTimedSkillState : BaseTimedSkillState { public static float SkillBaseDuration = 1.5f; public static float SkillStartTime = 0.2f; public static float SkillEndTime = 0.9f; public override void OnEnter() { ((BaseState)this).OnEnter(); InitDurationValues(SkillBaseDuration, SkillStartTime, SkillEndTime); } protected override void OnCastEnter() { } protected override void OnCastFixedUpdate() { } protected override void OnCastExit() { } } public class ExampleDelayedSkillState : BaseTimedSkillState { public static float SkillBaseDuration = 1.5f; public static float SkillStartTime = 0.2f; public override void OnEnter() { ((BaseState)this).OnEnter(); InitDurationValues(SkillBaseDuration, SkillStartTime); } protected override void OnCastEnter() { } } } namespace ImpostorMod.Modules { internal static class Assets { internal static AssetBundle mainAssetBundle; internal static GameObject swordSwingEffect; internal static GameObject swordHitImpactEffect; internal static GameObject bombExplosionEffect; internal static NetworkSoundEventDef swordHitSoundEvent; internal static Shader hotpoo = LegacyResourcesAPI.Load<Shader>("Shaders/Deferred/HGStandard"); internal static Material commandoMat; private static string[] assetNames = new string[0]; private const string assetbundleName = "impostorassets_new"; private const string csProjName = "ImpostorMod"; internal static void Initialize() { LoadAssetBundle(); LoadSoundbank(); PopulateAssets(); } internal static void LoadAssetBundle() { try { if ((Object)(object)mainAssetBundle == (Object)null) { using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("ImpostorMod.impostorassets_new"); mainAssetBundle = AssetBundle.LoadFromStream(stream); } } catch (Exception ex) { Log.Error("Failed to load assetbundle. Make sure your assetbundle name is setup correctly\n" + ex); return; } assetNames = mainAssetBundle.GetAllAssetNames(); } internal static void LoadSoundbank() { using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("ImpostorMod.HenryBank.bnk"); byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); SoundBanks.Add(array); } internal static void PopulateAssets() { //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)mainAssetBundle)) { Log.Error("There is no AssetBundle to load assets from."); return; } swordHitSoundEvent = CreateNetworkSoundEventDef("HenrySwordHit"); bombExplosionEffect = LoadEffect("BombExplosionEffect", "HenryBombExplosion"); if (Object.op_Implicit((Object)(object)bombExplosionEffect)) { ShakeEmitter val = bombExplosionEffect.AddComponent<ShakeEmitter>(); val.amplitudeTimeDecay = true; val.duration = 0.5f; val.radius = 200f; val.scaleShakeRadiusWithLocalScale = false; val.wave = new Wave { amplitude = 1f, frequency = 40f, cycleOffset = 0f }; } swordSwingEffect = LoadEffect("HenrySwordSwingEffect", parentToTransform: true); swordHitImpactEffect = LoadEffect("ImpactHenrySlash"); } private static GameObject CreateTracer(string originalTracerName, string newTracerName) { if ((Object)(object)LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/Tracers/" + originalTracerName) == (Object)null) { return null; } GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/Tracers/" + originalTracerName), newTracerName, true); if (!Object.op_Implicit((Object)(object)val.GetComponent<EffectComponent>())) { val.AddComponent<EffectComponent>(); } if (!Object.op_Implicit((Object)(object)val.GetComponent<VFXAttributes>())) { val.AddComponent<VFXAttributes>(); } if (!Object.op_Implicit((Object)(object)val.GetComponent<NetworkIdentity>())) { val.AddComponent<NetworkIdentity>(); } val.GetComponent<Tracer>().speed = 250f; val.GetComponent<Tracer>().length = 50f; AddNewEffectDef(val); return val; } internal static NetworkSoundEventDef CreateNetworkSoundEventDef(string eventName) { NetworkSoundEventDef val = ScriptableObject.CreateInstance<NetworkSoundEventDef>(); val.akId = AkSoundEngine.GetIDFromString(eventName); val.eventName = eventName; Content.AddNetworkSoundEventDef(val); return val; } internal static void ConvertAllRenderersToHopooShader(GameObject objectToConvert) { if (!Object.op_Implicit((Object)(object)objectToConvert)) { return; } Renderer[] componentsInChildren = objectToConvert.GetComponentsInChildren<Renderer>(); foreach (Renderer val in componentsInChildren) { if (val != null) { val.material?.SetHopooMaterial(); } } } internal static RendererInfo[] SetupRendererInfos(GameObject obj) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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) MeshRenderer[] componentsInChildren = obj.GetComponentsInChildren<MeshRenderer>(); RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[componentsInChildren.Length]; for (int i = 0; i < componentsInChildren.Length; i++) { array[i] = new RendererInfo { defaultMaterial = ((Renderer)componentsInChildren[i]).material, renderer = (Renderer)(object)componentsInChildren[i], defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false }; } return array; } public static GameObject LoadSurvivorModel(string modelName) { GameObject val = mainAssetBundle.LoadAsset<GameObject>(modelName); if ((Object)(object)val == (Object)null) { Log.Error("Trying to load a null model- check to see if the name in your code matches the name of the object in Unity"); return null; } return PrefabAPI.InstantiateClone(val, ((Object)val).name, false); } internal static Texture LoadCharacterIconGeneric(string characterName) { return mainAssetBundle.LoadAsset<Texture>("tex" + characterName + "Icon"); } internal static GameObject LoadCrosshair(string crosshairName) { if ((Object)(object)LegacyResourcesAPI.Load<GameObject>("Prefabs/Crosshair/" + crosshairName + "Crosshair") == (Object)null) { return LegacyResourcesAPI.Load<GameObject>("Prefabs/Crosshair/StandardCrosshair"); } return LegacyResourcesAPI.Load<GameObject>("Prefabs/Crosshair/" + crosshairName + "Crosshair"); } private static GameObject LoadEffect(string resourceName) { return LoadEffect(resourceName, "", parentToTransform: false); } private static GameObject LoadEffect(string resourceName, string soundName) { return LoadEffect(resourceName, soundName, parentToTransform: false); } private static GameObject LoadEffect(string resourceName, bool parentToTransform) { return LoadEffect(resourceName, "", parentToTransform); } private static GameObject LoadEffect(string resourceName, string soundName, bool parentToTransform) { //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) bool flag = false; for (int i = 0; i < assetNames.Length; i++) { if (assetNames[i].Contains(resourceName.ToLowerInvariant())) { flag = true; i = assetNames.Length; } } if (!flag) { Log.Error("Failed to load effect: " + resourceName + " because it does not exist in the AssetBundle"); return null; } GameObject val = mainAssetBundle.LoadAsset<GameObject>(resourceName); val.AddComponent<DestroyOnTimer>().duration = 12f; val.AddComponent<NetworkIdentity>(); val.AddComponent<VFXAttributes>().vfxPriority = (VFXPriority)2; EffectComponent val2 = val.AddComponent<EffectComponent>(); val2.applyScale = false; val2.effectIndex = (EffectIndex)(-1); val2.parentToReferencedTransform = parentToTransform; val2.positionAtReferencedTransform = true; val2.soundName = soundName; AddNewEffectDef(val, soundName); return val; } private static void AddNewEffectDef(GameObject effectPrefab) { AddNewEffectDef(effectPrefab, ""); } private static void AddNewEffectDef(GameObject effectPrefab, string soundName) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown EffectDef val = new EffectDef(); val.prefab = effectPrefab; val.prefabEffectComponent = effectPrefab.GetComponent<EffectComponent>(); val.prefabName = ((Object)effectPrefab).name; val.prefabVfxAttributes = effectPrefab.GetComponent<VFXAttributes>(); val.spawnSoundEventName = soundName; Content.AddEffectDef(val); } } public static class Buffs { internal static BuffDef armorBuff; internal static void RegisterBuffs() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) armorBuff = AddNewBuff("HenryArmorBuff", LegacyResourcesAPI.Load<Sprite>("Textures/BuffIcons/texBuffGenericShield"), Color.white, canStack: false, isDebuff: false); } internal static BuffDef AddNewBuff(string buffName, Sprite buffIcon, Color buffColor, bool canStack, bool isDebuff) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) BuffDef val = ScriptableObject.CreateInstance<BuffDef>(); ((Object)val).name = buffName; val.buffColor = buffColor; val.canStack = canStack; val.isDebuff = isDebuff; val.eliteDef = null; val.iconSprite = buffIcon; Content.AddBuffDef(val); return val; } } public static class Config { public static void ReadConfig() { } public static ConfigEntry<bool> CharacterEnableConfig(string characterName, string description = "Set to false to disable this character", bool enabledDefault = true) { return ((BaseUnityPlugin)ImpostorPlugin.instance).Config.Bind<bool>("General", "Enable " + characterName, enabledDefault, description); } } internal class ContentPacks : IContentPackProvider { internal ContentPack contentPack = new ContentPack(); public static List<GameObject> bodyPrefabs = new List<GameObject>(); public static List<GameObject> masterPrefabs = new List<GameObject>(); public static List<GameObject> projectilePrefabs = new List<GameObject>(); public static List<SurvivorDef> survivorDefs = new List<SurvivorDef>(); public static List<UnlockableDef> unlockableDefs = new List<UnlockableDef>(); public static List<SkillFamily> skillFamilies = new List<SkillFamily>(); public static List<SkillDef> skillDefs = new List<SkillDef>(); public static List<Type> entityStates = new List<Type>(); public static List<BuffDef> buffDefs = new List<BuffDef>(); public static List<EffectDef> effectDefs = new List<EffectDef>(); public static List<NetworkSoundEventDef> networkSoundEventDefs = new List<NetworkSoundEventDef>(); public string identifier => "com.resyntax.impostor"; public void Initialize() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(ContentManager_collectContentPackProviders); } private void ContentManager_collectContentPackProviders(AddContentPackProviderDelegate addContentPackProvider) { addContentPackProvider.Invoke((IContentPackProvider)(object)this); } public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args) { contentPack.identifier = identifier; contentPack.bodyPrefabs.Add(bodyPrefabs.ToArray()); contentPack.masterPrefabs.Add(masterPrefabs.ToArray()); contentPack.projectilePrefabs.Add(projectilePrefabs.ToArray()); contentPack.survivorDefs.Add(survivorDefs.ToArray()); contentPack.unlockableDefs.Add(unlockableDefs.ToArray()); contentPack.skillDefs.Add(skillDefs.ToArray()); contentPack.skillFamilies.Add(skillFamilies.ToArray()); contentPack.entityStateTypes.Add(entityStates.ToArray()); contentPack.buffDefs.Add(buffDefs.ToArray()); contentPack.effectDefs.Add(effectDefs.ToArray()); contentPack.networkSoundEventDefs.Add(networkSoundEventDefs.ToArray()); args.ReportProgress(1f); yield break; } public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args) { ContentPack.Copy(contentPack, args.output); args.ReportProgress(1f); yield break; } public IEnumerator FinalizeAsync(FinalizeAsyncArgs args) { args.ReportProgress(1f); yield break; } } internal class Content { public static void AddCharacterBodyPrefab(GameObject bprefab) { ContentPacks.bodyPrefabs.Add(bprefab); } public static void AddMasterPrefab(GameObject prefab) { ContentPacks.masterPrefabs.Add(prefab); } public static void AddProjectilePrefab(GameObject prefab) { ContentPacks.projectilePrefabs.Add(prefab); } public static void AddSurvivorDef(SurvivorDef survivorDef) { ContentPacks.survivorDefs.Add(survivorDef); } public static void AddUnlockableDef(UnlockableDef unlockableDef) { ContentPacks.unlockableDefs.Add(unlockableDef); } public static void AddSkillDef(SkillDef skillDef) { ContentPacks.skillDefs.Add(skillDef); } public static void AddSkillFamily(SkillFamily skillFamily) { ContentPacks.skillFamilies.Add(skillFamily); } public static void AddEntityState(Type entityState) { ContentPacks.entityStates.Add(entityState); } public static void AddBuffDef(BuffDef buffDef) { ContentPacks.buffDefs.Add(buffDef); } public static void AddEffectDef(EffectDef effectDef) { ContentPacks.effectDefs.Add(effectDef); } public static void AddNetworkSoundEventDef(NetworkSoundEventDef networkSoundEventDef) { ContentPacks.networkSoundEventDefs.Add(networkSoundEventDef); } } internal static class Helpers { internal const string agilePrefix = "<style=cIsUtility>Agile.</style> "; internal static string ScepterDescription(string desc) { return "\n<color=#d299ff>SCEPTER: " + desc + "</color>"; } public static T[] Append<T>(ref T[] array, List<T> list) { int num = array.Length; int count = list.Count; Array.Resize(ref array, num + count); list.CopyTo(array, num); return array; } public static Func<T[], T[]> AppendDel<T>(List<T> list) { return (T[] r) => Append(ref r, list); } } internal static class ItemDisplays { private static Dictionary<string, GameObject> itemDisplayPrefabs = new Dictionary<string, GameObject>(); internal static void PopulateDisplays() { PopulateFromBody("MageBody"); PopulateFromBody("LunarExploderBody"); PopulateCustomLightningArm(); } private static void PopulateFromBody(string bodyName) { ItemDisplayRuleSet itemDisplayRuleSet = ((Component)LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/" + bodyName).GetComponent<ModelLocator>().modelTransform).GetComponent<CharacterModel>().itemDisplayRuleSet; KeyAssetRuleGroup[] keyAssetRuleGroups = itemDisplayRuleSet.keyAssetRuleGroups; for (int i = 0; i < keyAssetRuleGroups.Length; i++) { ItemDisplayRule[] rules = keyAssetRuleGroups[i].displayRuleGroup.rules; for (int j = 0; j < rules.Length; j++) { GameObject followerPrefab = rules[j].followerPrefab; if (Object.op_Implicit((Object)(object)followerPrefab)) { string key = ((Object)followerPrefab).name?.ToLowerInvariant(); if (!itemDisplayPrefabs.ContainsKey(key)) { itemDisplayPrefabs[key] = followerPrefab; } } } } } private static void PopulateCustomLightningArm() { GameObject val = PrefabAPI.InstantiateClone(itemDisplayPrefabs["displaylightningarmright"], "DisplayLightningCustom", false); LimbMatcher component = val.GetComponent<LimbMatcher>(); component.limbPairs[0].targetChildLimb = "LightningArm1"; component.limbPairs[1].targetChildLimb = "LightningArm2"; component.limbPairs[2].targetChildLimb = "LightningArmEnd"; itemDisplayPrefabs["displaylightningarmcustom"] = val; } public static GameObject LoadDisplay(string name) { if (itemDisplayPrefabs.ContainsKey(name.ToLowerInvariant()) && Object.op_Implicit((Object)(object)itemDisplayPrefabs[name.ToLowerInvariant()])) { return itemDisplayPrefabs[name.ToLowerInvariant()]; } Log.Error("item display " + name + " returned null"); return null; } } internal static class Materials { private static List<Material> cachedMaterials = new List<Material>(); public static Material CreateHopooMaterial(string materialName) { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown Material val = cachedMaterials.Find(delegate(Material mat) { materialName.Replace(" (Instance)", ""); return ((Object)mat).name.Contains(materialName); }); if (Object.op_Implicit((Object)(object)val)) { return val; } val = Assets.mainAssetBundle.LoadAsset<Material>(materialName); if (!Object.op_Implicit((Object)(object)val)) { Log.Error("Failed to load material: " + materialName + " - Check to see that the material in your Unity project matches this name"); return new Material(Assets.hotpoo); } return val.SetHopooMaterial(); } public static Material SetHopooMaterial(this Material tempMat) { //IL_0089: 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_0107: Unknown result type (might be due to invalid IL or missing references) if (cachedMaterials.Contains(tempMat)) { return tempMat; } float? num = null; Color? val = null; if (tempMat.IsKeywordEnabled("_NORMALMAP")) { num = tempMat.GetFloat("_BumpScale"); } if (tempMat.IsKeywordEnabled("_EMISSION")) { val = tempMat.GetColor("_EmissionColor"); } tempMat.shader = Assets.hotpoo; tempMat.SetColor("_Color", tempMat.GetColor("_Color")); tempMat.SetTexture("_MainTex", tempMat.GetTexture("_MainTex")); tempMat.SetTexture("_EmTex", tempMat.GetTexture("_EmissionMap")); tempMat.EnableKeyword("DITHER"); if (num.HasValue) { tempMat.SetFloat("_NormalStrength", num.Value); } if (val.HasValue) { tempMat.SetColor("_EmColor", val.Value); tempMat.SetFloat("_EmPower", 1f); } if (tempMat.IsKeywordEnabled("NOCULL")) { tempMat.SetInt("_Cull", 0); } if (tempMat.IsKeywordEnabled("LIMBREMOVAL")) { tempMat.SetInt("_LimbRemovalOn", 1); } cachedMaterials.Add(tempMat); return tempMat; } public static Material MakeUnique(this Material material) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown if (cachedMaterials.Contains(material)) { return new Material(material); } return material; } public static Material SetColor(this Material material, Color color) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) material.SetColor("_Color", color); return material; } public static Material SetNormal(this Material material, float normalStrength = 1f) { material.SetFloat("_NormalStrength", normalStrength); return material; } public static Material SetEmission(this Material material) { return material.SetEmission(1f); } public static Material SetEmission(this Material material, float emission) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return material.SetEmission(emission, Color.white); } public static Material SetEmission(this Material material, float emission, Color emissionColor) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) material.SetFloat("_EmPower", emission); material.SetColor("_EmColor", emissionColor); return material; } public static Material SetCull(this Material material, bool cull = false) { material.SetInt("_Cull", cull ? 1 : 0); return material; } } internal static class Prefabs { private static PhysicMaterial ragdollMaterial; public static GameObject CreateDisplayPrefab(string displayModelName, GameObject prefab, BodyInfo bodyInfo) { GameObject val = Assets.LoadSurvivorModel(displayModelName); CharacterModel val2 = val.GetComponent<CharacterModel>(); if (!Object.op_Implicit((Object)(object)val2)) { val2 = val.AddComponent<CharacterModel>(); } val2.baseRendererInfos = prefab.GetComponentInChildren<CharacterModel>().baseRendererInfos; Assets.ConvertAllRenderersToHopooShader(val); return val.gameObject; } public static GameObject CreateBodyPrefab(string bodyName, string modelName, BodyInfo bodyInfo) { //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) GameObject val = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/" + bodyInfo.bodyNameToClone + "Body"); if (!Object.op_Implicit((Object)(object)val)) { Log.Error(bodyInfo.bodyNameToClone + "Body is not a valid body, character creation failed"); return null; } GameObject val2 = PrefabAPI.InstantiateClone(val, bodyName); Transform val3 = null; GameObject val4 = null; if (modelName != "mdl") { val4 = Assets.LoadSurvivorModel(modelName); if ((Object)(object)val4 == (Object)null) { val4 = ((Component)val2.GetComponentInChildren<CharacterModel>()).gameObject; } val3 = AddCharacterModelToSurvivorBody(val2, val4.transform, bodyInfo); } CharacterBody component = val2.GetComponent<CharacterBody>(); ((Object)component).name = bodyInfo.bodyName; component.baseNameToken = bodyInfo.bodyNameToken; component.subtitleNameToken = bodyInfo.subtitleNameToken; component.portraitIcon = bodyInfo.characterPortrait; component.bodyColor = bodyInfo.bodyColor; component._defaultCrosshairPrefab = bodyInfo.crosshair; component.hideCrosshair = false; component.preferredPodPrefab = bodyInfo.podPrefab; component.baseMaxHealth = bodyInfo.maxHealth; component.baseRegen = bodyInfo.healthRegen; component.levelArmor = bodyInfo.armorGrowth; component.baseMaxShield = bodyInfo.shield; component.baseDamage = bodyInfo.damage; component.baseAttackSpeed = bodyInfo.attackSpeed; component.baseCrit = bodyInfo.crit; component.baseMoveSpeed = bodyInfo.moveSpeed; component.baseJumpPower = bodyInfo.jumpPower; component.autoCalculateLevelStats = bodyInfo.autoCalculateLevelStats; component.levelDamage = bodyInfo.damageGrowth; component.levelAttackSpeed = bodyInfo.attackSpeedGrowth; component.levelCrit = bodyInfo.critGrowth; component.levelMaxHealth = bodyInfo.healthGrowth; component.levelRegen = bodyInfo.regenGrowth; component.baseArmor = bodyInfo.armor; component.levelMaxShield = bodyInfo.shieldGrowth; component.levelMoveSpeed = bodyInfo.moveSpeedGrowth; component.levelJumpPower = bodyInfo.jumpPowerGrowth; component.baseAcceleration = bodyInfo.acceleration; component.baseJumpCount = bodyInfo.jumpCount; component.sprintingSpeedMultiplier = 1.45f; component.bodyFlags = (BodyFlags)16; component.rootMotionInMainState = false; component.hullClassification = (HullClassification)0; component.isChampion = false; SetupCameraTargetParams(val2, bodyInfo); SetupModelLocator(val2, val3, val4.transform); SetupCapsuleCollider(val2); SetupMainHurtbox(val2, val4); SetupAimAnimator(val2, val4); if ((Object)(object)val3 != (Object)null) { SetupCharacterDirection(val2, val3, val4.transform); } SetupFootstepController(val4); SetupRagdoll(val4); Content.AddCharacterBodyPrefab(val2); return val2; } public static void CreateGenericDoppelganger(GameObject bodyPrefab, string masterName, string masterToCopy) { GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterMasters/" + masterToCopy + "MonsterMaster"), masterName, true); val.GetComponent<CharacterMaster>().bodyPrefab = bodyPrefab; Content.AddMasterPrefab(val); } private static Transform AddCharacterModelToSurvivorBody(GameObject bodyPrefab, Transform modelTransform, BodyInfo bodyInfo) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Expected O, but got Unknown //IL_00ba: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Expected O, but got Unknown //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) for (int num = bodyPrefab.transform.childCount - 1; num >= 0; num--) { Object.DestroyImmediate((Object)(object)((Component)bodyPrefab.transform.GetChild(num)).gameObject); } Transform transform = new GameObject("ModelBase").transform; transform.parent = bodyPrefab.transform; transform.localPosition = bodyInfo.modelBasePosition; transform.localRotation = Quaternion.identity; modelTransform.parent = ((Component)transform).transform; modelTransform.localPosition = Vector3.zero; modelTransform.localRotation = Quaternion.identity; GameObject val = new GameObject("CameraPivot"); val.transform.parent = bodyPrefab.transform; val.transform.localPosition = bodyInfo.cameraPivotPosition; val.transform.localRotation = Quaternion.identity; GameObject val2 = new GameObject("AimOrigin"); val2.transform.parent = bodyPrefab.transform; val2.transform.localPosition = bodyInfo.aimOriginPosition; val2.transform.localRotation = Quaternion.identity; bodyPrefab.GetComponent<CharacterBody>().aimOriginTransform = val2.transform; return ((Component)transform).transform; } public static CharacterModel SetupCharacterModel(GameObject prefab) { return SetupCharacterModel(prefab, null); } public static CharacterModel SetupCharacterModel(GameObject prefab, CustomRendererInfo[] customInfos) { CharacterModel val = ((Component)prefab.GetComponent<ModelLocator>().modelTransform).gameObject.GetComponent<CharacterModel>(); bool flag = (Object)(object)val != (Object)null; if (!flag) { val = ((Component)prefab.GetComponent<ModelLocator>().modelTransform).gameObject.AddComponent<CharacterModel>(); } val.body = prefab.GetComponent<CharacterBody>(); val.autoPopulateLightInfos = true; val.invisibilityCount = 0; val.temporaryOverlays = new List<TemporaryOverlay>(); if (!flag) { SetupCustomRendererInfos(val, customInfos); } else { SetupPreAttachedRendererInfos(val); } return val; } public static void SetupPreAttachedRendererInfos(CharacterModel characterModel) { for (int i = 0; i < characterModel.baseRendererInfos.Length; i++) { if ((Object)(object)characterModel.baseRendererInfos[i].defaultMaterial == (Object)null) { characterModel.baseRendererInfos[i].defaultMaterial = characterModel.baseRendererInfos[i].renderer.sharedMaterial; } characterModel.baseRendererInfos[i].defaultMaterial.SetHopooMaterial(); } } public static void SetupCustomRendererInfos(CharacterModel characterModel, CustomRendererInfo[] customInfos) { //IL_00de: 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) ChildLocator component = ((Component)characterModel).GetComponent<ChildLocator>(); if (!Object.op_Implicit((Object)(object)component)) { Log.Error("Failed CharacterModel setup: ChildLocator component does not exist on the model"); return; } List<RendererInfo> list = new List<RendererInfo>(); for (int i = 0; i < customInfos.Length; i++) { if (!Object.op_Implicit((Object)(object)component.FindChild(customInfos[i].childName))) { Log.Error("Trying to add a RendererInfo for a renderer that does not exist: " + customInfos[i].childName); continue; } Renderer component2 = ((Component)component.FindChild(customInfos[i].childName)).GetComponent<Renderer>(); if (Object.op_Implicit((Object)(object)component2)) { Material val = customInfos[i].material; if ((Object)(object)val == (Object)null) { val = ((!customInfos[i].dontHotpoo) ? component2.material.SetHopooMaterial() : component2.material); } list.Add(new RendererInfo { renderer = component2, defaultMaterial = val, ignoreOverlays = customInfos[i].ignoreOverlays, defaultShadowCastingMode = (ShadowCastingMode)1 }); } } characterModel.baseRendererInfos = list.ToArray(); } private static void SetupCharacterDirection(GameObject prefab, Transform modelBaseTransform, Transform modelTransform) { if (Object.op_Implicit((Object)(object)prefab.GetComponent<CharacterDirection>())) { CharacterDirection component = prefab.GetComponent<CharacterDirection>(); component.targetTransform = modelBaseTransform; component.overrideAnimatorForwardTransform = null; component.rootMotionAccumulator = null; component.modelAnimator = ((Component)modelTransform).GetComponent<Animator>(); component.driveFromRootRotation = false; component.turnSpeed = 720f; } } private static void SetupCameraTargetParams(GameObject prefab, BodyInfo bodyInfo) { CameraTargetParams component = prefab.GetComponent<CameraTargetParams>(); component.cameraParams = bodyInfo.cameraParams; component.cameraPivotTransform = prefab.transform.Find("CameraPivot"); } private static void SetupModelLocator(GameObject prefab, Transform modelBaseTransform, Transform modelTransform) { ModelLocator component = prefab.GetComponent<ModelLocator>(); component.modelTransform = modelTransform; component.modelBaseTransform = modelBaseTransform; } private static void SetupCapsuleCollider(GameObject prefab) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) CapsuleCollider component = prefab.GetComponent<CapsuleCollider>(); component.center = new Vector3(0f, 0f, 0f); component.radius = 0.5f; component.height = 1.82f; component.direction = 1; } private static void SetupMainHurtbox(GameObject prefab, GameObject model) { //IL_0075: Unknown result type (might be due to invalid IL or missing references) ChildLocator component = model.GetComponent<ChildLocator>(); if (!Object.op_Implicit((Object)(object)component.FindChild("MainHurtbox"))) { Debug.LogWarning((object)"Could not set up main hurtbox: make sure you have a transform pair in your prefab's ChildLocator component called 'MainHurtbox'"); return; } HurtBoxGroup val = model.AddComponent<HurtBoxGroup>(); HurtBox val2 = ((Component)component.FindChild("MainHurtbox")).gameObject.AddComponent<HurtBox>(); ((Component)val2).gameObject.layer = LayerIndex.entityPrecise.intVal; val2.healthComponent = prefab.GetComponent<HealthComponent>(); val2.isBullseye = true; val2.damageModifier = (DamageModifier)0; val2.hurtBoxGroup = val; val2.indexInGroup = 0; val.hurtBoxes = (HurtBox[])(object)new HurtBox[1] { val2 }; val.mainHurtBox = val2; val.bullseyeCount = 1; } public static void SetupHurtBoxes(GameObject bodyPrefab) { HealthComponent component = bodyPrefab.GetComponent<HealthComponent>(); HurtBoxGroup[] componentsInChildren = bodyPrefab.GetComponentsInChildren<HurtBoxGroup>(); foreach (HurtBoxGroup val in componentsInChildren) { val.mainHurtBox.healthComponent = component; for (int j = 0; j < val.hurtBoxes.Length; j++) { val.hurtBoxes[j].healthComponent = component; } } } private static void SetupFootstepController(GameObject model) { FootstepHandler val = model.AddComponent<FootstepHandler>(); val.baseFootstepString = "Play_player_footstep"; val.sprintFootstepOverrideString = ""; val.enableFootstepDust = true; val.footstepDustPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/GenericFootstepDust"); } private static void SetupRagdoll(GameObject model) { RagdollController component = model.GetComponent<RagdollController>(); if (!Object.op_Implicit((Object)(object)component)) { return; } if ((Object)(object)ragdollMaterial == (Object)null) { ragdollMaterial = ((Component)LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/CommandoBody").GetComponentInChildren<RagdollController>().bones[1]).GetComponent<Collider>().material; } Transform[] bones = component.bones; foreach (Transform val in bones) { if (Object.op_Implicit((Object)(object)val)) { ((Component)val).gameObject.layer = LayerIndex.ragdoll.intVal; Collider component2 = ((Component)val).GetComponent<Collider>(); if (Object.op_Implicit((Object)(object)component2)) { component2.material = ragdollMaterial; component2.sharedMaterial = ragdollMaterial; } } } } private static void SetupAimAnimator(GameObject prefab, GameObject model) { AimAnimator val = model.AddComponent<AimAnimator>(); val.directionComponent = prefab.GetComponent<CharacterDirection>(); val.pitchRangeMax = 60f; val.pitchRangeMin = -60f; val.yawRangeMin = -80f; val.yawRangeMax = 80f; val.pitchGiveupRange = 30f; val.yawGiveupRange = 10f; val.giveupDuration = 3f; val.inputBank = prefab.GetComponent<InputBankTest>(); } public static void SetupHitbox(GameObject prefab, Transform hitboxTransform, string hitboxName) { HitBoxGroup val = prefab.AddComponent<HitBoxGroup>(); HitBox val2 = ((Component)hitboxTransform).gameObject.AddComponent<HitBox>(); ((Component)hitboxTransform).gameObject.layer = LayerIndex.projectile.intVal; val.hitBoxes = (HitBox[])(object)new HitBox[1] { val2 }; val.groupName = hitboxName; } public static void SetupHitbox(GameObject prefab, string hitboxName, params Transform[] hitboxTransforms) { HitBoxGroup val = prefab.AddComponent<HitBoxGroup>(); List<HitBox> list = new List<HitBox>(); foreach (Transform val2 in hitboxTransforms) { HitBox item = ((Component)val2).gameObject.AddComponent<HitBox>(); ((Component)val2).gameObject.layer = LayerIndex.projectile.intVal; list.Add(item); } val.hitBoxes = list.ToArray(); val.groupName = hitboxName; } } public class CustomRendererInfo { public string childName; public Material material = null; public bool dontHotpoo = false; public bool ignoreOverlays = false; } internal static class Projectiles { internal static GameObject bombPrefab; internal static void RegisterProjectiles() { CreateBomb(); AddProjectile(bombPrefab); } internal static void AddProjectile(GameObject projectileToAdd) { Content.AddProjectilePrefab(projectileToAdd); } private static void CreateBomb() { bombPrefab = CloneProjectilePrefab("CommandoGrenadeProjectile", "HenryBombProjectile"); ProjectileImpactExplosion component = bombPrefab.GetComponent<ProjectileImpactExplosion>(); InitializeImpactExplosion(component); ((ProjectileExplosion)component).blastRadius = 16f; component.destroyOnEnemy = true; component.lifetime = 12f; component.impactEffect = Assets.bombExplosionEffect; component.timerAfterImpact = true; component.lifetimeAfterImpact = 0.1f; ProjectileController component2 = bombPrefab.GetComponent<ProjectileController>(); if ((Object)(object)Assets.mainAssetBundle.LoadAsset<GameObject>("HenryBombGhost") != (Object)null) { component2.ghostPrefab = CreateGhostPrefab("HenryBombGhost"); } component2.startSound = ""; } private static void InitializeImpactExplosion(ProjectileImpactExplosion projectileImpactExplosion) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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) ((ProjectileExplosion)projectileImpactExplosion).blastDamageCoefficient = 1f; ((ProjectileExplosion)projectileImpactExplosion).blastProcCoefficient = 1f; ((ProjectileExplosion)projectileImpactExplosion).blastRadius = 1f; ((ProjectileExplosion)projectileImpactExplosion).bonusBlastForce = Vector3.zero; ((ProjectileExplosion)projectileImpactExplosion).childrenCount = 0; ((ProjectileExplosion)projectileImpactExplosion).childrenDamageCoefficient = 0f; ((ProjectileExplosion)projectileImpactExplosion).childrenProjectilePrefab = null; projectileImpactExplosion.destroyOnEnemy = false; projectileImpactExplosion.destroyOnWorld = false; ((ProjectileExplosion)projectileImpactExplosion).falloffModel = (FalloffModel)0; ((ProjectileExplosion)projectileImpactExplosion).fireChildren = false; projectileImpactExplosion.impactEffect = null; projectileImpactExplosion.lifetime = 0f; projectileImpactExplosion.lifetimeAfterImpact = 0f; projectileImpactExplosion.lifetimeRandomOffset = 0f; projectileImpactExplosion.offsetForLifetimeExpiredSound = 0f; projectileImpactExplosion.timerAfterImpact = false; ((Component)projectileImpactExplosion).GetComponent<ProjectileDamage>().damageType = (DamageType)0; } private static GameObject CreateGhostPrefab(string ghostName) { GameObject val = Assets.mainAssetBundle.LoadAsset<GameObject>(ghostName); if (!Object.op_Implicit((Object)(object)val.GetComponent<NetworkIdentity>())) { val.AddComponent<NetworkIdentity>(); } if (!Object.op_Implicit((Object)(object)val.GetComponent<ProjectileGhostController>())) { val.AddComponent<ProjectileGhostController>(); } Assets.ConvertAllRenderersToHopooShader(val); return val; } private static GameObject CloneProjectilePrefab(string prefabName, string newPrefabName) { return PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/Projectiles/" + prefabName), newPrefabName); } } internal static class Skills { public static void CreateSkillFamilies(GameObject targetPrefab, bool destroyExisting = true) { if (destroyExisting) { GenericSkill[] componentsInChildren = targetPrefab.GetComponentsInChildren<GenericSkill>(); foreach (GenericSkill val in componentsInChildren) { Object.DestroyImmediate((Object)(object)val); } } SkillLocator component = targetPrefab.GetComponent<SkillLocator>(); component.primary = CreateGenericSkillWithSkillFamily(targetPrefab, "Primary"); component.secondary = CreateGenericSkillWithSkillFamily(targetPrefab, "Secondary"); component.utility = CreateGenericSkillWithSkillFamily(targetPrefab, "Utility"); component.special = CreateGenericSkillWithSkillFamily(targetPrefab, "Special"); } public static GenericSkill CreateGenericSkillWithSkillFamily(GameObject targetPrefab, string familyName, bool hidden = false) { GenericSkill val = targetPrefab.AddComponent<GenericSkill>(); val.skillName = familyName; val.hideInCharacterSelect = hidden; SkillFamily val2 = ScriptableObject.CreateInstance<SkillFamily>(); ((Object)val2).name = ((Object)targetPrefab).name + familyName + "Family"; val2.variants = (Variant[])(object)new Variant[0]; val._skillFamily = val2; Content.AddSkillFamily(val2); return val; } public static void AddSkillToFamily(SkillFamily skillFamily, SkillDef skillDef, UnlockableDef unlockableDef = null) { //IL_0029: 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) 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, unlockableDef = unlockableDef }; ((Variant)(ref val)).viewableNode = new Node(skillDef.skillNameToken, false, (Node)null); variants[num] = val; } public static void AddSkillsToFamily(SkillFamily skillFamily, params SkillDef[] skillDefs) { foreach (SkillDef skillDef in skillDefs) { AddSkillToFamily(skillFamily, skillDef); } } public static void AddPrimarySkills(GameObject targetPrefab, params SkillDef[] skillDefs) { AddSkillsToFamily(targetPrefab.GetComponent<SkillLocator>().primary.skillFamily, skillDefs); } public static void AddSecondarySkills(GameObject targetPrefab, params SkillDef[] skillDefs) { AddSkillsToFamily(targetPrefab.GetComponent<SkillLocator>().secondary.skillFamily, skillDefs); } public static void AddUtilitySkills(GameObject targetPrefab, params SkillDef[] skillDefs) { AddSkillsToFamily(targetPrefab.GetComponent<SkillLocator>().utility.skillFamily, skillDefs); } public static void AddSpecialSkills(GameObject targetPrefab, params SkillDef[] skillDefs) { AddSkillsToFamily(targetPrefab.GetComponent<SkillLocator>().special.skillFamily, skillDefs); } public static void AddUnlockablesToFamily(SkillFamily skillFamily, params UnlockableDef[] unlockableDefs) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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) for (int i = 0; i < unlockableDefs.Length; i++) { Variant val = skillFamily.variants[i]; val.unlockableDef = unlockableDefs[i]; skillFamily.variants[i] = val; } } public static SkillDef CreateSkillDef(SkillDefInfo skillDefInfo) { return Skills.CreateSkillDef<SkillDef>(skillDefInfo); } public static T CreateSkillDef<T>(SkillDefInfo skillDefInfo) where T : SkillDef { //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_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) T val = ScriptableObject.CreateInstance<T>(); ((SkillDef)val).skillName = skillDefInfo.skillName; ((Object)(object)val).name = skillDefInfo.skillName; ((SkillDef)val).skillNameToken = skillDefInfo.skillNameToken; ((SkillDef)val).skillDescriptionToken = skillDefInfo.skillDescriptionToken; ((SkillDef)val).icon = skillDefInfo.skillIcon; ((SkillDef)val).activationState = skillDefInfo.activationState; ((SkillDef)val).activationStateMachineName = skillDefInfo.activationStateMachineName; ((SkillDef)val).baseMaxStock = skillDefInfo.baseMaxStock; ((SkillDef)val).baseRechargeInterval = skillDefInfo.baseRechargeInterval; ((SkillDef)val).beginSkillCooldownOnSkillEnd = skillDefInfo.beginSkillCooldownOnSkillEnd; ((SkillDef)val).canceledFromSprinting = skillDefInfo.canceledFromSprinting; ((SkillDef)val).forceSprintDuringState = skillDefInfo.forceSprintDuringState; ((SkillDef)val).fullRestockOnAssign = skillDefInfo.fullRestockOnAssign; ((SkillDef)val).interruptPriority = skillDefInfo.interruptPriority; ((SkillDef)val).resetCooldownTimerOnUse = skillDefInfo.resetCooldownTimerOnUse; ((SkillDef)val).isCombatSkill = skillDefInfo.isCombatSkill; ((SkillDef)val).mustKeyPress = skillDefInfo.mustKeyPress; ((SkillDef)val).cancelSprintingOnActivation = skillDefInfo.cancelSprintingOnActivation; ((SkillDef)val).rechargeStock = skillDefInfo.rechargeStock; ((SkillDef)val).requiredStock = skillDefInfo.requiredStock; ((SkillDef)val).stockToConsume = skillDefInfo.stockToConsume; ((SkillDef)val).keywordTokens = skillDefInfo.keywordTokens; Content.AddSkillDef((SkillDef)(object)val); return val; } } internal class SkillDefInfo { public string skillName; public string skillNameToken; public string skillDescriptionToken; public string[] keywordTokens = new string[0]; public Sprite skillIcon; public SerializableEntityStateType activationState; public InterruptPriority interruptPriority; public string activationStateMachineName; public float baseRechargeInterval; public int baseMaxStock = 1; public int rechargeStock = 1; public int requiredStock = 1; public int stockToConsume = 1; public bool isCombatSkill = true; public bool canceledFromSprinting; public bool forceSprintDuringState; public bool cancelSprintingOnActivation = true; public bool beginSkillCooldownOnSkillEnd; public bool fullRestockOnAssign = true; public bool resetCooldownTimerOnUse; public bool mustKeyPress; public SkillDefInfo() { } public SkillDefInfo(string skillNameToken, string skillDescriptionToken, Sprite skillIcon, SerializableEntityStateType activationState, string activationStateMachineName = "Weapon", bool agile = false) { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) skillName = skillNameToken; this.skillNameToken = skillNameToken; this.skillDescriptionToken = skillDescriptionToken; this.skillIcon = skillIcon; this.activationState = activationState; this.activationStateMachineName = activationStateMachineName; interruptPriority = (InterruptPriority)0; isCombatSkill = true; baseRechargeInterval = 0f; requiredStock = 0; stockToConsume = 0; cancelSprintingOnActivation = !agile; if (agile) { keywordTokens = new string[1] { "KEYWORD_AGILE" }; } } } internal static class Skins { internal struct SkinDefInfo { internal SkinDef[] BaseSkins; internal Sprite Icon; internal string NameToken; internal UnlockableDef UnlockableDef; internal GameObject RootObject; internal RendererInfo[] RendererInfos; internal MeshReplacement[] MeshReplacements; internal GameObjectActivation[] GameObjectActivations; internal ProjectileGhostReplacement[] ProjectileGhostReplacements; internal MinionSkinReplacement[] MinionSkinReplacements; internal string Name; } internal static SkinDef CreateSkinDef(string skinName, Sprite skinIcon, RendererInfo[] rendererInfos, SkinnedMeshRenderer mainRenderer, GameObject root) { return CreateSkinDef(skinName, skinIcon, rendererInfos, mainRenderer, root, null); } internal static SkinDef CreateSkinDef(string skinName, Sprite skinIcon, RendererInfo[] rendererInfos, SkinnedMeshRenderer mainRenderer, GameObject root, UnlockableDef unlockableDef) { //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Expected O, but got Unknown //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Expected O, but got Unknown SkinDefInfo skinDefInfo = default(SkinDefInfo); skinDefInfo.BaseSkins = Array.Empty<SkinDef>(); skinDefInfo.GameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[0]; skinDefInfo.Icon = skinIcon; skinDefInfo.MeshReplacements = (MeshReplacement[])(object)new MeshReplacement[0]; skinDefInfo.MinionSkinReplacements = (MinionSkinReplacement[])(object)new MinionSkinReplacement[0]; skinDefInfo.Name = skinName; skinDefInfo.NameToken = skinName; skinDefInfo.ProjectileGhostReplacements = (ProjectileGhostReplacement[])(object)new ProjectileGhostReplacement[0]; skinDefInfo.RendererInfos = rendererInfos; skinDefInfo.RootObject = root; skinDefInfo.UnlockableDef = unlockableDef; SkinDefInfo skinDefInfo2 = skinDefInfo; SkinDef.Awake += new hook_Awake(DoNothing); SkinDef val = ScriptableObject.CreateInstance<SkinDef>(); val.baseSkins = skinDefInfo2.BaseSkins; val.icon = skinDefInfo2.Icon; val.unlockableDef = skinDefInfo2.UnlockableDef; val.rootObject = skinDefInfo2.RootObject; val.rendererInfos = skinDefInfo2.RendererInfos; val.gameObjectActivations = skinDefInfo2.GameObjectActivations; val.meshReplacements = skinDefInfo2.MeshReplacements; val.projectileGhostReplacements = skinDefInfo2.ProjectileGhostReplacements; val.minionSkinReplacements = skinDefInfo2.MinionSkinReplacements; val.nameToken = skinDefInfo2.NameToken; ((Object)val).name = skinDefInfo2.Name; SkinDef.Awake -= new hook_Awake(DoNothing); return val; } private static void DoNothing(orig_Awake orig, SkinDef self) { } private static RendererInfo[] getRendererMaterials(RendererInfo[] defaultRenderers, params Material[] materials) { RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[defaultRenderers.Length]; defaultRenderers.CopyTo(array, 0); for (int i = 0; i < array.Length; i++) { try { array[i].defaultMaterial = materials[i]; } catch { Log.Error("error adding skin rendererinfo material. make sure you're not passing in too many"); } } return array; } internal static MeshReplacement[] getMeshReplacements(RendererInfo[] rendererinfos, params string[] meshes) { //IL_001d: 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) List<MeshReplacement> list = new List<MeshReplacement>(); for (int i = 0; i < rendererinfos.Length; i++) { if (!string.IsNullOrEmpty(meshes[i])) { list.Add(new MeshReplacement { renderer = rendererinfos[i].renderer, mesh = Assets.mainAssetBundle.LoadAsset<Mesh>(meshes[i]) }); } } return list.ToArray(); } } public static class States { internal static void RegisterStates() { Content.AddEntityState(typeof(BaseMeleeAttack)); Content.AddEntityState(typeof(SlashCombo)); Content.AddEntityState(typeof(Shoot)); Content.AddEntityState(typeof(Roll)); Content.AddEntityState(typeof(ThrowBomb)); } } internal static class StaticValues { internal static string descriptionText = "Impostor is a Man / Machine / Alien who can kill, quite well.<color=#CCD3E0>" + Environment.NewLine + Environment.NewLine + "< ! > Knife is an excellent for inconspicously neutralising your foes." + Environment.NewLine + Environment.NewLine + "< ! > The 7-shooter can tactically expire the life contracts of the Impostor's foes from a distance." + Environment.NewLine + Environment.NewLine + "< ! > Vent can help you escape from any situation that puts your credibility at risk." + Environment.NewLine + Environment.NewLine + "< ! > [KILL] does as advertised, might want put a couple more stab wounds in (just in case)" + Environment.NewLine + Environment.NewLine; internal const float swordDamageCoefficient = 2.5f; internal const float gunDamageCoefficient = 4.2f; internal const float bombDamageCoefficient = 69f; } internal static class Tokens { internal static void AddTokens() { string text = "RESYNTAX_IMPOSTOR_BODY_"; string text2 = "Impostor is a Man / Machine / Alien who can kill, quite well.<color=#CCD3E0>" + Environment.NewLine + Environment.NewLine; text2 = text2 + "< ! > Knife is an excellent for inconspicously neutralising your foes." + Environment.NewLine + Environment.NewLine; text2 = text2 + "< ! > The 7-shooter can tactically expire the life contracts of the Impostor's foes from a distance." + Environment.NewLine + Environment.NewLine; text2 = text2 + "< ! > Vent can help you escape from any situation that puts your credibility at risk." + Environment.NewLine + Environment.NewLine; text2 = text2 + "< ! > [KILL] does as advertised, might want put a couple more stab wounds in (just in case)" + Environment.NewLine + Environment.NewLine; string text3 = "..and so he left, moving on to the next target."; string text4 = "..and so he vanished, absolutely PISSED."; LanguageAPI.Add(text + "NAME", "Impostor"); LanguageAPI.Add(text + "DESCRIPTION", text2); LanguageAPI.Add(text + "SUBTITLE", "Extremely Suspicious"); LanguageAPI.Add(text + "LORE", "Impostor is a Man / Machine / Alien who can kill, quite well. A man of class, a tactical killer, A killing machine, a thing with sussy intentions: you decide"); LanguageAPI.Add(text + "OUTRO_FLAVOR", text3); LanguageAPI.Add(text + "OUTRO_FAILURE", text4); LanguageAPI.Add(text + "DEFAULT_SKIN_NAME", "Default"); LanguageAPI.Add(text + "MASTERY_SKIN_NAME", "Alternate"); LanguageAPI.Add(text + "PASSIVE_NAME", "Regenerative"); LanguageAPI.Add(text + "PASSIVE_DESCRIPTION", "He heals quite quickly, you know"); LanguageAPI.Add(text + "PRIMARY_SLASH_NAME", "Knife"); LanguageAPI.Add(text + "PRIMARY_SLASH_DESCRIPTION", "<style=cIsUtility>Agile.</style> " + $"Shank for <style=cIsDamage>{250f}% damage</style>."); LanguageAPI.Add(text + "SECONDARY_GUN_NAME", "6+1 Shooter"); LanguageAPI.Add(text + "SECONDARY_GUN_DESCRIPTION", "<style=cIsUtility>Agile.</style> " + $"Fire a 8-1 shooter for <style=cIsDamage>{419.99997f}% damage</style>."); LanguageAPI.Add(text + "UTILITY_ROLL_NAME", "Vent"); LanguageAPI.Add(text + "UTILITY_ROLL_DESCRIPTION", "Vent a moderate distance, gaining <style=cIsUtility>300 armor</style>. <style=cIsUtility>You cannot be hit during the roll.</style>"); LanguageAPI.Add(text + "SPECIAL_BOMB_NAME", "[KILL]"); LanguageAPI.Add(text + "SPECIAL_BOMB_DESCRIPTION", $"Stab for <style=cIsDamage>{6900f}% damage</style>."); LanguageAPI.Add(text + "MASTERYUNLOCKABLE_ACHIEVEMENT_NAME", "Impostor: Mastery"); LanguageAPI.Add(text + "MASTERYUNLOCKABLE_ACHIEVEMENT_DESC", "As the impostor, beat the game or obliterate on Monsoon."); LanguageAPI.Add(text + "MASTERYUNLOCKABLE_UNLOCKABLE_NAME", "IMPOSTOR: Mastery"); } } public abstract class BaseMasteryUnlockable : GenericModdedUnlockable { public abstract string RequiredCharacterBody { get; } public abstract float RequiredDifficultyCoefficient { get; } public override void OnBodyRequirementMet() { ((ModdedUnlockable)this).OnBodyRequirementMet(); Run.onClientGameOverGlobal += OnClientGameOverGlobal; } public override void OnBodyRequirementBroken() { Run.onClientGameOverGlobal -= OnClientGameOverGlobal; ((ModdedUnlockable)this).OnBodyRequirementBroken(); } private void OnClientGameOverGlobal(Run run, RunReport runReport) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)runReport.gameEnding) && runReport.gameEnding.isWin) { DifficultyDef difficultyDef = DifficultyCatalog.GetDifficultyDef(runReport.ruleBook.FindDifficulty()); if (difficultyDef.countsAsHardMode && difficultyDef.scalingValue >= RequiredDifficultyCoefficient) { ((BaseAchievement)this).Grant(); } } } public override BodyIndex LookUpRequiredBodyIndex() { //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 BodyCatalog.FindBodyIndex(RequiredCharacterBody); } } public abstract class GenericModdedUnlockable : ModdedUnlockable { public abstract string AchievementTokenPrefix { get; } public abstract string AchievementSpriteName { get; } public override string AchievementIdentifier => AchievementTokenPrefix + "UNLOCKABLE_ACHIEVEMENT_ID"; public override string UnlockableIdentifier => AchievementTokenPrefix + "UNLOCKABLE_REWARD_ID"; public override string AchievementNameToken => AchievementTokenPrefix + "UNLOCKABLE_ACHIEVEMENT_NAME"; public override string AchievementDescToken => AchievementTokenPrefix + "UNLOCKABLE_ACHIEVEMENT_DESC"; public override string UnlockableNameToken => AchievementTokenPrefix + "UNLOCKABLE_UNLOCKABLE_NAME"; public override Sprite Sprite => Assets.mainAssetBundle.LoadAsset<Sprite>(AchievementSpriteName); public override Func<string> GetHowToUnlock => () => Language.GetStringFormatted("UNLOCK_VIA_ACHIEVEMENT_FORMAT", new object[2] { Language.GetString(((ModdedUnlockable)this).AchievementNameToken), Language.GetString(((ModdedUnlockable)this).AchievementDescToken) }); public override Func<string> GetUnlocked => () => Language.GetStringFormatted("UNLOCKED_FORMAT", new object[2] { Language.GetString(((ModdedUnlockable)this).AchievementNameToken), Language.GetString(((ModdedUnlockable)this).AchievementDescToken) }); } } namespace ImpostorMod.Modules.Survivors { internal class MyCharacter : SurvivorBase { public const string IMPOSTOR_PREFIX = "RESYNTAX_IMPOSTOR_BODY_"; private static UnlockableDef masterySkinUnlockableDef; public override string bodyName => "Henry"; public override string survivorTokenPrefix => "RESYNTAX_IMPOSTOR_BODY_"; public override BodyInfo bodyInfo { get; set; } = new BodyInfo { bodyName = "ImpostorBody", bodyNameToken = "RESYNTAX_IMPOSTOR_BODY_NAME", subtitleNameToken = "RESYNTAX_IMPOSTOR_BODY_SUBTITLE", characterPortrait = Assets.mainAssetBundle.LoadAsset<Texture>("texHenryIcon"), bodyColor = Color.white, crosshair = Assets.LoadCrosshair("Standard"), podPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/NetworkedObjects/SurvivorPod"), maxHealth = 69f, healthRegen = 4f, armor = 0f, jumpCount = 1 }; public override CustomRendererInfo[] customRendererInfos { get; set; } = new CustomRendererInfo[14] { new CustomRendererInfo { childName = "SwordModel", material = Materials.CreateHopooMaterial("matKnife") }, new CustomRendererInfo { childName = "GunModel", material = Materials.CreateHopooMaterial("matHenry") }, new CustomRendererInfo { childName = "Vent", material = Materials.CreateHopooMaterial("GrayVent") }, new CustomRendererInfo { childName = "Visor", material = Materials.CreateHopooMaterial("SusVisor") }, new CustomRendererInfo { childName = "AmogusBody", material = Materials.CreateHopooMaterial("SusRed") }, new CustomRendererInfo { childName = "AmogusHandR" }, new CustomRendererInfo { childName = "AmogusHandL" }, new CustomRendererInfo { childName = "SusThighR" }, new CustomRendererInfo { childName = "SusThighL" }, new CustomRendererInfo { childName = "SusKneeR" }, new CustomRendererInfo { childName = "SusKneeL" }, new CustomRendererInfo { childName = "SusCalfR" }, new CustomRendererInfo { childName = "SusCalfL" }, new CustomRendererInfo { childName = "Backpack" } }; public override UnlockableDef characterUnlockableDef => null; public override Type characterMainState => typeof(GenericCharacterMain); public override ItemDisplaysBase itemDisplays => new ImpostorItemDisplays(); public override ConfigEntry<bool> characterEnabledConfig => null; public override void InitializeCharacter() { base.InitializeCharacter(); } public override void InitializeUnlockables() { } public override void InitializeHitboxes() { ChildLocator componentInChildren = bodyPrefab.GetComponentInChildren<ChildLocator>(); GameObject gameObject = ((Component)componentInChildren).gameObject; Transform hitboxTransform = componentInChildren.FindChild("SwordHitbox"); Prefabs.SetupHitbox(gameObject, hitboxTransform, "Sword"); } public override void InitializeSkills() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: 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_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) Skills.CreateSkillFamilies(bodyPrefab); string text = "RESYNTAX"; SkillDef val = Skills.CreateSkillDef(new SkillDefInfo(text + "_IMPOSTOR_BODY_PRIMARY_SLASH_NAME", text + "_IMPOSTOR_BODY_PRIMARY_SLASH_DESCRIPTION", Assets.mainAssetBundle.LoadAsset<Sprite>("texPrimaryIcon"), new SerializableEntityStateType(typeof(SlashCombo)), "Weapon", agile: true)); Skills.AddPrimarySkills(bodyPrefab, val); SkillDefInfo skillDefInfo = new SkillDefInfo(); skillDefInfo.skillName = text + "_IMPOSTOR_BODY_SECONDARY_GUN_NAME"; skillDefInfo.skillNameToken = text + "_IMPOSTOR_BODY_SECONDARY_GUN_NAME"; skillDefInfo.skillDescriptionToken = text + "_IMPOSTOR_BODY_SECONDARY_GUN_DESCRIPTION"; skillDefInfo.skillIcon = Assets.mainAssetBundle.LoadAsset<Sprite>("texSecondaryIcon"); skillDefInfo.activationState = new SerializableEntityStateType(typeof(Shoot)); skillDefInfo.activationStateMachineName = "Slide"; skillDefInfo.baseMaxStock = 7; skillDefInfo.baseRechargeInterval = 2f; skillDefInfo.beginSkillCooldownOnSkillEnd = true; skillDefInfo.canceledFromSprinting = false; skillDefInfo.forceSprintDuringState = false; skillDefInfo.fullRestockOnAssign = true; skillDefInfo.interruptPriority = (InterruptPriority)1; skillDefInfo.resetCooldownTimerOnUse = true; skillDefInfo.isCombatSkill = true; skillDefInfo.mustKeyPress = false; skillDefInfo.cancelSprintingOnActivation = false; skillDefInfo.rechargeStock = 7; skillDefInfo.requiredStock = 1; skillDefInfo.stockToConsume = 1; skillDefInfo.keywordTokens = new string[1] { "KEYWORD_AGILE" }; SkillDef val2 = Skills.CreateSkillDef(skillDefInfo); Skills.AddSecondarySkills(bodyPrefab, val2); skillDefInfo = new SkillDefInfo(); skillDefInfo.skillName = text + "_IMPOSTOR_BODY_UTILITY_ROLL_NAME"; skillDefInfo.skillNameToken = text + "_IMPOSTOR_BODY_UTILITY_ROLL_NAME"; skillDefInfo.skillDescriptionToken = text + "_IMPOSTOR_BODY_UTILITY_ROLL_DESCRIPTION"; skillDefInfo.skillIcon = Assets.mainAssetBundle.LoadAsset<Sprite>("texUtilityIcon"); skillDefInfo.activationState = new SerializableEntityStateType(typeof(Roll)); skillDefInfo.activationStateMachineName = "Body"; skillDefInfo.baseMaxStock = 1; skillDefInfo.baseRechargeInterval = 5f; skillDefInfo.beginSkillCooldownOnSkillEnd = false; skillDefInfo.canceledFromSprinting = false; skillDefInfo.forceSprintDuringState = true; skillDefInfo.fullRestockOnAssign = true; skillDefInfo.interruptPriority = (InterruptPriority)2; skillDefInfo.resetCooldownTimerOnUse = false; skillDefInfo.isCombatSkill = false; skillDefInfo.mustKeyPress = false; skillDefInfo.cancelSprintingOnActivation = false; skillDefInfo.rechargeStock = 1; skillDefInfo.requiredStock = 1; skillDefInfo.stockToConsume = 1; SkillDef val3 = Skills.CreateSkillDef(skillDefInfo); Skills.AddUtilitySkills(bodyPrefab, val3); skillDefInfo = new SkillDefInfo(); skillDefInfo.skillName = text + "_IMPOSTOR_BODY_SPECIAL_BOMB_NAME"; skillDefInfo.skillNameToken = text + "_IMPOSTOR_BODY_SPECIAL_BOMB_NAME"; skillDefInfo.skillDescriptionToken = text + "_IMPOSTOR_BODY_SPECIAL_BOMB_DESCRIPTION"; skillDefInfo.skillIcon = Assets.mainAssetBundle.LoadAsset<Sprite>("texSpecialIcon"); skillDefInfo.activationState = new SerializableEntityStateType(typeof(ThrowBomb)); skillDefInfo.activationStateMachineName = "Slide"; skillDefInfo.baseMaxStock = 1; skillDefInfo.baseRechargeInterval = 20f; skillDefInfo.beginSkillCooldownOnSkillEnd = true; skillDefInfo.canceledFromSprinting = true; skillDefInfo.forceSprintDuringState = false; skillDefInfo.fullRestockOnAssign = true; skillDefInfo.interruptPriority = (InterruptPriority)2; skillDefInfo.resetCooldownTimerOnUse = false; skillDefInfo.isCombatSkill = true; skillDefInfo.mustKeyPress = true; skillDefInfo.cancelSprintingOnActivation = true; skillDefInfo.rechargeStock = 1; skillDefInfo.requiredStock = 1; skillDefInfo.stockToConsume = 1; SkillDef val4 = Skills.CreateSkillDef(skillDefInfo); Skills.AddSpecialSkills(bodyPrefab, val4); } public override void InitializeSkins() { GameObject gameObject = ((Component)bodyPrefab.GetComponentInChildren<ModelLocator>().modelTransform).gameObject; CharacterModel component = gameObject.GetComponent<CharacterModel>(); ModelSkinController val = gameObject.AddComponent<ModelSkinController>(); ChildLocator component2 = gameObject.GetComponent<ChildLocator>(); SkinnedMeshRenderer mainSkinnedMeshRenderer = component.mainSkinnedMeshRenderer; RendererInfo[] baseRendererInfos = component.baseRendererInfos; List<SkinDef> list = new List<SkinDef>(); SkinDef val2 = Skins.CreateSkinDef("RESYNTAX_IMPOSTOR_BODY_DEFAULT_SKIN_NAME", Assets.mainAssetBundle.LoadAsset<Sprite>("texMainSkin"), baseRendererInfos, mainSkinnedMeshRenderer, gameObject); val2.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[0]; list.Add(val2); val.skins = list.ToArray(); } } internal abstract class SurvivorBase : CharacterBase { public abstract string survivorTokenPrefix { get; } public abstract UnlockableDef characterUnlockableDef { get; } public virtual ConfigEntry<bool> characterEnabledConfig { get; } public virtual GameObject displayPrefab { get; set; } public override void InitializeCharacter() { if (characterEnabledConfig == null || characterEnabledConfig.Value) { InitializeUnlockables(); base.InitializeCharacter(); InitializeSurvivor(); } } protected override void InitializeCharacterBodyAndModel() { base.InitializeCharacterBodyAndModel(); InitializeDisplayPrefab(); } protected virtual void InitializeSurvivor() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) RegisterNewSurvivor(bodyPrefab, displayPrefab, Color.grey, survivorTokenPrefix, characterUnlockableDef, bodyInfo.sortPosition); } protected virtual void InitializeDisplayPrefab() { displayPrefab = Prefabs.CreateDisplayPrefab(bodyName + "Display", bodyPrefab, bodyInfo); } public virtual void InitializeUnlockables() { } public static void RegisterNewSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) RegisterNewSurvivor(bodyPrefab, displayPrefab, charColor, tokenPrefix, null, 100f); } public static void RegisterNewSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix, float sortPosition) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) RegisterNewSurvivor(bodyPrefab, displayPrefab, charColor, tokenPrefix, null, sortPosition); } public static void RegisterNewSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix, UnlockableDef unlockableDef) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) RegisterNewSurvivor(bodyPrefab,