using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using EmotesAPI;
using EntityStates;
using EntityStates.AI.Walker;
using EntityStates.Loader;
using HG;
using HG.BlendableTypes;
using KinematicCharacterController;
using On.RoR2;
using On.RoR2.Projectile;
using On.RoR2.UI;
using R2API;
using R2API.Utils;
using RoR2;
using RoR2.Achievements;
using RoR2.Audio;
using RoR2.CharacterAI;
using RoR2.ContentManagement;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using SubmarinerMod.Modules;
using SubmarinerMod.Modules.Achievements;
using SubmarinerMod.Modules.BaseStates;
using SubmarinerMod.Modules.Characters;
using SubmarinerMod.SubmarinerCharacter;
using SubmarinerMod.SubmarinerCharacter.Components;
using SubmarinerMod.SubmarinerCharacter.Content;
using SubmarinerMod.SubmarinerCharacter.SkillStates;
using ThreeEyedGames;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Events;
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.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("SubmarinerMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+e331d3d7c32fb537ed8d81494f64ff68e52a55e2")]
[assembly: AssemblyProduct("SubmarinerMod")]
[assembly: AssemblyTitle("SubmarinerMod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
internal enum SubmarinerCameraParams
{
DEFAULT,
EMOTE
}
namespace SubmarinerMod
{
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 ErrorAssetBundle(string assetName, string bundleName)
{
Error("failed to load asset, " + assetName + ", because it does not exist in asset bundle, " + bundleName);
}
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);
}
}
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.kenko.Submariner", "Submariner", "1.0.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class SubmarinerPlugin : BaseUnityPlugin
{
[Serializable]
[CompilerGenerated]
private sealed class <>c
{
public static readonly <>c <>9 = new <>c();
public static hook_AssignHookReferenceToBodyStateMachine <>9__9_0;
internal void <Awake>b__9_0(orig_AssignHookReferenceToBodyStateMachine orig, ProjectileGrappleController self)
{
orig.Invoke(self);
if (Object.op_Implicit((Object)(object)self.owner.stateMachine) && self.owner.stateMachine.state is HarpoonShot harpoonShot)
{
harpoonShot.SetHookReference(((Component)self).gameObject);
}
}
}
public const string MODUID = "com.kenko.Submariner";
public const string MODNAME = "Submariner";
public const string MODVERSION = "1.0.0";
public const string DEVELOPER_PREFIX = "KENKO";
public static SubmarinerPlugin instance;
public static bool emotesInstalled => Chainloader.PluginInfos.ContainsKey("com.weliveinasociety.CustomEmotesAPI");
public static bool scepterInstalled => Chainloader.PluginInfos.ContainsKey("com.DestroyedClone.AncientScepter");
private void Awake()
{
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Expected O, but got Unknown
instance = this;
Log.Init(((BaseUnityPlugin)this).Logger);
Language.Init();
new SubmarinerSurvivor().Initialize();
object obj = <>c.<>9__9_0;
if (obj == null)
{
hook_AssignHookReferenceToBodyStateMachine val = delegate(orig_AssignHookReferenceToBodyStateMachine orig, ProjectileGrappleController self)
{
orig.Invoke(self);
if (Object.op_Implicit((Object)(object)self.owner.stateMachine) && self.owner.stateMachine.state is HarpoonShot harpoonShot)
{
harpoonShot.SetHookReference(((Component)self).gameObject);
}
};
<>c.<>9__9_0 = val;
obj = (object)val;
}
ProjectileGrappleController.AssignHookReferenceToBodyStateMachine += (hook_AssignHookReferenceToBodyStateMachine)obj;
new ContentPacks().Initialize();
}
}
}
namespace SubmarinerMod.SubmarinerCharacter
{
public class SubmarinerSurvivor : SurvivorBase<SubmarinerSurvivor>
{
[Serializable]
[CompilerGenerated]
private sealed class <>c
{
public static readonly <>c <>9 = new <>c();
public static hook_Init <>9__62_0;
internal void <Emotes>b__62_0(orig_Init orig)
{
orig.Invoke();
GameObject val = SubmarinerAssets.mainAssetBundle.LoadAsset<GameObject>("submariner_emoteskeleton");
CustomEmotesAPI.ImportArmature(characterPrefab, val, 0, true);
}
}
public const string SUBMARINER_PREFIX = "KENKO_SUBMARINER_";
internal static GameObject characterPrefab;
public static SkillDef convictScepterSkillDef;
public override string assetBundleName => "submariner";
public override string bodyName => "SubmarinerBody";
public override string masterName => "SubmarinerMonsterMaster";
public override string modelPrefabName => "mdlSubmariner";
public override string displayPrefabName => "SubmarinerDisplay";
public override string survivorTokenPrefix => "KENKO_SUBMARINER_";
public override BodyInfo bodyInfo => new BodyInfo
{
bodyName = bodyName,
bodyNameToken = "KENKO_SUBMARINER_NAME",
subtitleNameToken = "KENKO_SUBMARINER_SUBTITLE",
characterPortrait = assetBundle.LoadAsset<Texture>("texSubmarinerIcon"),
bodyColor = SubmarinerAssets.SubmarinerColor,
sortPosition = 5.99f,
crosshair = CharacterAssets.LoadCrosshair("Standard"),
podPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/NetworkedObjects/SurvivorPod"),
damage = SubmarinerConfig.damage.Value,
damageGrowth = SubmarinerConfig.damageGrowth.Value * SubmarinerConfig.damage.Value,
attackSpeed = SubmarinerConfig.attackSpeed.Value,
attackSpeedGrowth = SubmarinerConfig.attackSpeedGrowth.Value,
crit = SubmarinerConfig.crit.Value,
critGrowth = SubmarinerConfig.critGrowth.Value,
maxHealth = SubmarinerConfig.maxHealth.Value,
healthGrowth = SubmarinerConfig.healthGrowth.Value * SubmarinerConfig.maxHealth.Value,
healthRegen = SubmarinerConfig.healthRegen.Value,
regenGrowth = SubmarinerConfig.regenGrowth.Value * SubmarinerConfig.healthRegen.Value,
shield = SubmarinerConfig.shield.Value,
shieldGrowth = SubmarinerConfig.shieldGrowth.Value * SubmarinerConfig.shield.Value,
armor = SubmarinerConfig.armor.Value,
armorGrowth = SubmarinerConfig.armorGrowth.Value * SubmarinerConfig.armor.Value,
moveSpeed = SubmarinerConfig.moveSpeed.Value,
moveSpeedGrowth = SubmarinerConfig.moveSpeedGrowth.Value * SubmarinerConfig.moveSpeed.Value,
jumpPower = SubmarinerConfig.jumpPower.Value,
jumpPowerGrowth = SubmarinerConfig.jumpPowerGrowth.Value * SubmarinerConfig.jumpPower.Value,
acceleration = SubmarinerConfig.acceleration.Value,
jumpCount = SubmarinerConfig.jumpCount.Value,
autoCalculateLevelStats = SubmarinerConfig.autoCalculateLevelStats.Value
};
public override CustomRendererInfo[] customRendererInfos => new CustomRendererInfo[8]
{
new CustomRendererInfo
{
childName = "Model"
},
new CustomRendererInfo
{
childName = "AnchorModel"
},
new CustomRendererInfo
{
childName = "GearModel"
},
new CustomRendererInfo
{
childName = "BeastModel"
},
new CustomRendererInfo
{
childName = "VisorModel"
},
new CustomRendererInfo
{
childName = "HarpoonModel"
},
new CustomRendererInfo
{
childName = "HeadModel"
},
new CustomRendererInfo
{
childName = "RopeModel"
}
};
public override UnlockableDef characterUnlockableDef => SubmarinerUnlockables.characterUnlockableDef;
public override ItemDisplaysBase itemDisplays => new SubmarinerItemDisplays();
public override AssetBundle assetBundle { get; protected set; }
public override GameObject bodyPrefab { get; protected set; }
public override CharacterBody prefabCharacterBody { get; protected set; }
public override GameObject characterModelObject { get; protected set; }
public override CharacterModel prefabCharacterModel { get; protected set; }
public override GameObject displayPrefab { get; protected set; }
public override void Initialize()
{
base.Initialize();
}
public override void InitializeCharacter()
{
SubmarinerConfig.Init();
SubmarinerUnlockables.Init();
base.InitializeCharacter();
ChildLocator componentInChildren = bodyPrefab.GetComponentInChildren<ChildLocator>();
DamageTypes.Init();
SubmarinerStates.Init();
SubmarinerTokens.Init();
SubmarinerAssets.Init(assetBundle);
SubmarinerBuffs.Init(assetBundle);
InitializeEntityStateMachines();
InitializeSkills();
InitializeSkins();
InitializeCharacterMaster();
AdditionalBodySetup();
characterPrefab = bodyPrefab;
AddHooks();
}
private void AdditionalBodySetup()
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Expected O, but got Unknown
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_00a2: 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)
TempVisualEffectAPI.AddTemporaryVisualEffect(SubmarinerAssets.regenerativeEffect, new EffectCondition(tempAdd), false, "");
AddHitboxes();
bodyPrefab.AddComponent<SubmarinerController>();
AkBank component = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Croco/CrocoBody.prefab").WaitForCompletion().GetComponent<AkBank>();
AkBank val = bodyPrefab.AddComponent<AkBank>();
((AkTriggerHandler)val).triggerList = ((AkTriggerHandler)component).triggerList;
val.data = component.data;
((AkTriggerHandler)val).useOtherObject = false;
val.decodeBank = false;
val.overrideLoadSetting = false;
val.loadAsynchronous = false;
val.saveDecodedBank = false;
val.unloadTriggerList = component.unloadTriggerList;
component = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Loader/LoaderBody.prefab").WaitForCompletion().GetComponent<AkBank>();
val = bodyPrefab.AddComponent<AkBank>();
((AkTriggerHandler)val).triggerList = ((AkTriggerHandler)component).triggerList;
val.data = component.data;
((AkTriggerHandler)val).useOtherObject = false;
val.decodeBank = false;
val.overrideLoadSetting = false;
val.loadAsynchronous = false;
val.saveDecodedBank = false;
val.unloadTriggerList = component.unloadTriggerList;
static bool tempAdd(CharacterBody body)
{
return body.HasBuff(SubmarinerBuffs.SubmarinerRegenBuff);
}
}
public void AddHitboxes()
{
Prefabs.SetupHitBoxGroup(characterModelObject, "MeleeHitbox", "MeleeHitbox");
Prefabs.SetupHitBoxGroup(characterModelObject, "HarpoonKickHitbox", "HarpoonKickHitbox");
}
public override void InitializeEntityStateMachines()
{
Prefabs.ClearEntityStateMachines(bodyPrefab);
Prefabs.AddMainEntityStateMachine(bodyPrefab, "Body", typeof(MainState), typeof(SpawnTeleporterState));
Prefabs.AddEntityStateMachine(bodyPrefab, "Weapon");
Prefabs.AddEntityStateMachine(bodyPrefab, "Weapon2");
Prefabs.AddEntityStateMachine(bodyPrefab, "Dash");
Prefabs.AddEntityStateMachine(bodyPrefab, "Hook");
}
public override void InitializeSkills()
{
bodyPrefab.AddComponent<SubmarinerPassive>();
Skills.CreateSkillFamilies(bodyPrefab);
AddPassiveSkills();
AddPrimarySkills();
AddSecondarySkills();
AddUtilitySkills();
AddSpecialSkills();
}
private void AddPassiveSkills()
{
//IL_0082: Unknown result type (might be due to invalid IL or missing references)
//IL_0087: Unknown result type (might be due to invalid IL or missing references)
//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
SubmarinerPassive component = bodyPrefab.GetComponent<SubmarinerPassive>();
SkillLocator component2 = bodyPrefab.GetComponent<SkillLocator>();
component2.passiveSkill.enabled = false;
component.SubmarinerPassiveSkillDef = Skills.CreateSkillDef(new SkillDefInfo
{
skillName = "KENKO_SUBMARINER_PASSIVE_NAME",
skillNameToken = "KENKO_SUBMARINER_PASSIVE_NAME",
skillDescriptionToken = "KENKO_SUBMARINER_PASSIVE_DESCRIPTION",
skillIcon = assetBundle.LoadAsset<Sprite>("texPassive"),
keywordTokens = new string[1] { Tokens.submarinerRegenBuff },
activationState = new SerializableEntityStateType(typeof(Idle)),
activationStateMachineName = "",
baseMaxStock = 1,
baseRechargeInterval = 0f,
beginSkillCooldownOnSkillEnd = false,
canceledFromSprinting = false,
forceSprintDuringState = false,
fullRestockOnAssign = true,
interruptPriority = (InterruptPriority)0,
resetCooldownTimerOnUse = false,
isCombatSkill = false,
mustKeyPress = false,
cancelSprintingOnActivation = false,
rechargeStock = 1,
requiredStock = 2,
stockToConsume = 1
});
Skills.AddPassiveSkills(component.passiveSkillSlot.skillFamily, component.SubmarinerPassiveSkillDef);
}
private void AddPrimarySkills()
{
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
SteppedSkillDef val = Skills.CreateSkillDef<SteppedSkillDef>(new SkillDefInfo("Anchor", "KENKO_SUBMARINER_PRIMARY_SWING_NAME", "KENKO_SUBMARINER_PRIMARY_SWING_DESCRIPTION", assetBundle.LoadAsset<Sprite>("texPrimary"), new SerializableEntityStateType(typeof(Swing))));
val.stepCount = 2;
val.stepGraceDuration = 0.25f;
((SkillDef)val).keywordTokens = new string[0];
Skills.AddPrimarySkills(bodyPrefab, (SkillDef)val);
}
private void AddSecondarySkills()
{
//IL_0055: 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_006c: Unknown result type (might be due to invalid IL or missing references)
SkillDefInfo skillDefInfo = new SkillDefInfo();
skillDefInfo.skillName = "Harpoon";
skillDefInfo.skillNameToken = "KENKO_SUBMARINER_SECONDARY_HARPOON_NAME";
skillDefInfo.skillDescriptionToken = "KENKO_SUBMARINER_SECONDARY_HARPOON_DESCRIPTION";
skillDefInfo.keywordTokens = new string[0];
skillDefInfo.skillIcon = assetBundle.LoadAsset<Sprite>("texSecondary");
skillDefInfo.activationState = new SerializableEntityStateType(typeof(HarpoonShot));
skillDefInfo.activationStateMachineName = "Hook";
skillDefInfo.interruptPriority = (InterruptPriority)0;
skillDefInfo.baseMaxStock = 2;
skillDefInfo.baseRechargeInterval = 4f;
skillDefInfo.rechargeStock = 1;
skillDefInfo.requiredStock = 1;
skillDefInfo.stockToConsume = 0;
skillDefInfo.resetCooldownTimerOnUse = false;
skillDefInfo.fullRestockOnAssign = true;
skillDefInfo.dontAllowPastMaxStocks = false;
skillDefInfo.beginSkillCooldownOnSkillEnd = true;
skillDefInfo.mustKeyPress = true;
skillDefInfo.isCombatSkill = true;
skillDefInfo.canceledFromSprinting = false;
skillDefInfo.cancelSprintingOnActivation = false;
skillDefInfo.forceSprintDuringState = false;
SkillDef val = Skills.CreateSkillDef(skillDefInfo);
Skills.AddSecondarySkills(bodyPrefab, val);
}
private void AddUtilitySkills()
{
//IL_0055: 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_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_013a: Unknown result type (might be due to invalid IL or missing references)
//IL_013f: Unknown result type (might be due to invalid IL or missing references)
//IL_0151: Unknown result type (might be due to invalid IL or missing references)
SkillDefInfo skillDefInfo = new SkillDefInfo();
skillDefInfo.skillName = "Mine";
skillDefInfo.skillNameToken = "KENKO_SUBMARINER_UTILITY_MINE_NAME";
skillDefInfo.skillDescriptionToken = "KENKO_SUBMARINER_UTILITY_MINE_DESCRIPTION";
skillDefInfo.keywordTokens = new string[0];
skillDefInfo.skillIcon = assetBundle.LoadAsset<Sprite>("texUtility");
skillDefInfo.activationState = new SerializableEntityStateType(typeof(BackFlip));
skillDefInfo.activationStateMachineName = "Dash";
skillDefInfo.interruptPriority = (InterruptPriority)1;
skillDefInfo.baseRechargeInterval = 7f;
skillDefInfo.baseMaxStock = 1;
skillDefInfo.rechargeStock = 1;
skillDefInfo.requiredStock = 1;
skillDefInfo.stockToConsume = 1;
skillDefInfo.resetCooldownTimerOnUse = false;
skillDefInfo.fullRestockOnAssign = true;
skillDefInfo.dontAllowPastMaxStocks = false;
skillDefInfo.mustKeyPress = false;
skillDefInfo.beginSkillCooldownOnSkillEnd = false;
skillDefInfo.isCombatSkill = false;
skillDefInfo.canceledFromSprinting = false;
skillDefInfo.cancelSprintingOnActivation = false;
skillDefInfo.forceSprintDuringState = true;
SkillDef val = Skills.CreateSkillDef(skillDefInfo);
skillDefInfo = new SkillDefInfo();
skillDefInfo.skillName = "Beast";
skillDefInfo.skillNameToken = "KENKO_SUBMARINER_UTILITY_BEAST_NAME";
skillDefInfo.skillDescriptionToken = "KENKO_SUBMARINER_UTILITY_BEAST_DESCRIPTION";
skillDefInfo.keywordTokens = new string[1] { Tokens.slayerKeyword };
skillDefInfo.skillIcon = assetBundle.LoadAsset<Sprite>("texAltUtility");
skillDefInfo.activationState = new SerializableEntityStateType(typeof(BeastRide));
skillDefInfo.activationStateMachineName = "Body";
skillDefInfo.interruptPriority = (InterruptPriority)1;
skillDefInfo.baseRechargeInterval = 7f;
skillDefInfo.baseMaxStock = 1;
skillDefInfo.rechargeStock = 1;
skillDefInfo.requiredStock = 1;
skillDefInfo.stockToConsume = 1;
skillDefInfo.resetCooldownTimerOnUse = false;
skillDefInfo.fullRestockOnAssign = true;
skillDefInfo.dontAllowPastMaxStocks = false;
skillDefInfo.mustKeyPress = false;
skillDefInfo.beginSkillCooldownOnSkillEnd = true;
skillDefInfo.isCombatSkill = false;
skillDefInfo.canceledFromSprinting = false;
skillDefInfo.cancelSprintingOnActivation = false;
skillDefInfo.forceSprintDuringState = true;
SkillDef val2 = Skills.CreateSkillDef(skillDefInfo);
Skills.AddUtilitySkills(bodyPrefab, val, val2);
}
private void AddSpecialSkills()
{
//IL_0055: 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_006c: Unknown result type (might be due to invalid IL or missing references)
SkillDefInfo skillDefInfo = new SkillDefInfo();
skillDefInfo.skillName = "AnchorThrow";
skillDefInfo.skillNameToken = "KENKO_SUBMARINER_SPECIAL_ANCHORTHROW_NAME";
skillDefInfo.skillDescriptionToken = "KENKO_SUBMARINER_SPECIAL_ANCHORTHROW_DESCRIPTION";
skillDefInfo.keywordTokens = new string[0];
skillDefInfo.skillIcon = assetBundle.LoadAsset<Sprite>("texSpecial");
skillDefInfo.activationState = new SerializableEntityStateType(typeof(AimAnchor));
skillDefInfo.activationStateMachineName = "Weapon";
skillDefInfo.interruptPriority = (InterruptPriority)1;
skillDefInfo.baseRechargeInterval = 16f;
skillDefInfo.baseMaxStock = 1;
skillDefInfo.rechargeStock = 1;
skillDefInfo.requiredStock = 1;
skillDefInfo.stockToConsume = 1;
skillDefInfo.resetCooldownTimerOnUse = false;
skillDefInfo.fullRestockOnAssign = true;
skillDefInfo.dontAllowPastMaxStocks = false;
skillDefInfo.mustKeyPress = true;
skillDefInfo.beginSkillCooldownOnSkillEnd = true;
skillDefInfo.isCombatSkill = true;
skillDefInfo.canceledFromSprinting = true;
skillDefInfo.cancelSprintingOnActivation = true;
skillDefInfo.forceSprintDuringState = false;
SkillDef val = Skills.CreateSkillDef(skillDefInfo);
Skills.AddSpecialSkills(bodyPrefab, val);
}
private void InitializeScepter()
{
}
public override void InitializeSkins()
{
ModelSkinController val = ((Component)prefabCharacterModel).gameObject.AddComponent<ModelSkinController>();
ChildLocator component = ((Component)prefabCharacterModel).GetComponent<ChildLocator>();
RendererInfo[] baseRendererInfos = prefabCharacterModel.baseRendererInfos;
List<SkinDef> list = new List<SkinDef>();
SkinDef val2 = Skins.CreateSkinDef("DEFAULT_SKIN", assetBundle.LoadAsset<Sprite>("texDefaultSkin"), baseRendererInfos, ((Component)prefabCharacterModel).gameObject);
val2.meshReplacements = Skins.getMeshReplacements(assetBundle, baseRendererInfos, "meshSubmariner", "meshAnchor", "meshGear", "meshBeast", "meshVisor", "meshHarpoon", "meshHead", "meshRope");
list.Add(val2);
val.skins = list.ToArray();
}
public override void InitializeCharacterMaster()
{
SubmarinerAI.Init(bodyPrefab, masterName);
}
private void AddHooks()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Expected O, but got Unknown
LoadoutPanelController.Rebuild += new hook_Rebuild(LoadoutPanelController_Rebuild);
GlobalEventManager.onCharacterDeathGlobal += GlobalEventManager_onCharacterDeathGlobal;
CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats);
if (SubmarinerPlugin.emotesInstalled)
{
Emotes();
}
}
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
private static void Emotes()
{
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Expected O, but got Unknown
object obj = <>c.<>9__62_0;
if (obj == null)
{
hook_Init val = delegate(orig_Init orig)
{
orig.Invoke();
GameObject val2 = SubmarinerAssets.mainAssetBundle.LoadAsset<GameObject>("submariner_emoteskeleton");
CustomEmotesAPI.ImportArmature(characterPrefab, val2, 0, true);
};
<>c.<>9__62_0 = val;
obj = (object)val;
}
SurvivorCatalog.Init += (hook_Init)obj;
}
private static void LoadoutPanelController_Rebuild(orig_Rebuild orig, LoadoutPanelController self)
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
orig.Invoke(self);
if (self.currentDisplayData.bodyIndex != BodyCatalog.FindBodyIndex("SubmarinerBody"))
{
return;
}
LanguageTextMeshController[] componentsInChildren = ((Component)self).gameObject.GetComponentsInChildren<LanguageTextMeshController>();
foreach (LanguageTextMeshController val in componentsInChildren)
{
if (Object.op_Implicit((Object)(object)val) && val.token == "LOADOUT_SKILL_MISC")
{
val.token = "Passive";
}
}
}
private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self)
{
orig.Invoke(self);
if (!Object.op_Implicit((Object)(object)self) || !(self.baseNameToken == "KENKO_SUBMARINER_NAME"))
{
return;
}
SubmarinerController component = ((Component)self).gameObject.GetComponent<SubmarinerController>();
if (Object.op_Implicit((Object)(object)component))
{
if (self.HasBuff(SubmarinerBuffs.SubmarinerRegenBuff))
{
self.regen *= 1.1f * (float)self.GetBuffCount(SubmarinerBuffs.SubmarinerRegenBuff);
}
self.moveSpeed *= component.movementSpeedAnchorIncrease;
}
if (self.HasBuff(SubmarinerBuffs.SubmarinerBeastBuff))
{
self.moveSpeed *= 1f + 0.1f * (float)self.GetBuffCount(SubmarinerBuffs.SubmarinerBeastBuff);
self.damage += 2.5f * (float)self.GetBuffCount(SubmarinerBuffs.SubmarinerBeastBuff);
}
}
private static void GlobalEventManager_onCharacterDeathGlobal(DamageReport damageReport)
{
CharacterBody attackerBody = damageReport.attackerBody;
if (Object.op_Implicit((Object)(object)attackerBody) && Object.op_Implicit((Object)(object)damageReport.attackerMaster) && Object.op_Implicit((Object)(object)damageReport.victim) && attackerBody.baseNameToken == "KENKO_SUBMARINER_NAME" && attackerBody.HasBuff(SubmarinerBuffs.SubmarinerBeastBuff))
{
attackerBody.AddBuff(SubmarinerBuffs.SubmarinerBeastBuff);
attackerBody.RecalculateStats();
}
}
}
}
namespace SubmarinerMod.SubmarinerCharacter.SkillStates
{
public class AimAnchor : AimThrowableBase
{
public static string enterSoundString;
public static string exitSoundString;
public override void OnEnter()
{
base.maxDistance = 35f;
base.arcVisualizerPrefab = SubmarinerAssets.throwable;
base.projectilePrefab = SubmarinerAssets.anchorPrefab;
base.endpointVisualizerPrefab = SubmarinerAssets.throwableEnd;
base.damageCoefficient = SubmarinerConfig.anchorDamageCoefficient.Value;
base.baseMinimumDuration = 0.25f;
enterSoundString = "Play_gravekeeper_attack2_charge";
exitSoundString = "Play_gravekeeper_attack2_shoot";
((AimThrowableBase)this).OnEnter();
((EntityState)this).PlayAnimation("Gesture, Override", "ChargeAnchor");
Util.PlaySound(enterSoundString, ((EntityState)this).gameObject);
base.detonationRadius = 15f;
}
public override void OnExit()
{
((AimThrowableBase)this).OnExit();
((EntityState)this).PlayAnimation("Gesture, Override", "ThrowAnchor", "Harpoon.playbackRate", 1f / ((BaseState)this).attackSpeedStat, 0f);
((EntityState)this).outer.SetNextState((EntityState)(object)new RecoverAnchor());
Util.PlaySound(exitSoundString, ((EntityState)this).gameObject);
}
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 BackFlip : BaseSubmarinerSkillState
{
public static GameObject dashPrefab = SubmarinerAssets.dashEffect;
public static GameObject projectilePrefab = SubmarinerAssets.minePrefab;
public static float baseDuration = 0.5f;
public static float dashDuration = 0.25f;
public static float pushAwayForce = 2.5f;
public static float pushAwayYFactor = 10f;
public static float speedCoefficient = 7f;
public static string beginSoundString = "Play_acrid_shift_jump";
public static string endSoundString = "sfx_submariner_dash";
public static float damageCoefficient = SubmarinerConfig.mineDamageCoefficient.Value;
public static float procCoefficient = 1f;
public static float hitPauseDuration = 0.012f;
public bool mine = true;
private Vector3 dashVector = Vector3.zero;
public override void OnEnter()
{
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: 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_00c7: 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_00e0: Unknown result type (might be due to invalid IL or missing references)
//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
RefreshState();
base.OnEnter();
((BaseState)this).StartAimMode(2f, false);
Ray aimRay = ((BaseState)this).GetAimRay();
dashVector = ((Ray)(ref aimRay)).direction;
if (mine)
{
FireProjectile();
}
if (((EntityState)this).isAuthority)
{
if (NetworkServer.active)
{
((EntityState)this).characterBody.AddBuff(Buffs.HiddenInvincibility);
}
((EntityState)this).characterMotor.velocity.y = 0f;
((EntityState)this).characterDirection.forward = dashVector;
((EntityState)this).characterBody.isSprinting = true;
((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f);
Vector3 val = -((EntityState)this).characterDirection.forward;
val.y = pushAwayYFactor;
((EntityState)this).characterMotor.velocity = val * pushAwayForce;
}
((EntityState)this).PlayAnimation("FullBody, Override", "BackFlip", "Dash.playbackRate", baseDuration + dashDuration, 0f);
Util.PlaySound(beginSoundString, ((EntityState)this).gameObject);
}
public override void FixedUpdate()
{
base.FixedUpdate();
if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= baseDuration + dashDuration)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
public void FireProjectile()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
Ray aimRay = ((BaseState)this).GetAimRay();
if (((EntityState)this).isAuthority)
{
ProjectileManager.instance.FireProjectile(projectilePrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, ((BaseState)this).damageStat * damageCoefficient, 200f, Util.CheckRoll(((BaseState)this).critStat, ((EntityState)this).characterBody.master), (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)null);
}
}
public override void OnExit()
{
if (NetworkServer.active && ((EntityState)this).characterBody.HasBuff(Buffs.HiddenInvincibility))
{
((EntityState)this).characterBody.RemoveBuff(Buffs.HiddenInvincibility);
((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, 0.3f);
}
((EntityState)this).OnExit();
}
public override InterruptPriority GetMinimumInterruptPriority()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (InterruptPriority)3;
}
}
public class BaseEmote : BaseState
{
private Animator animator;
private ChildLocator childLocator;
private float duration;
private uint activePlayID;
public LocalUser localUser;
public override void OnEnter()
{
((BaseState)this).OnEnter();
animator = ((EntityState)this).GetModelAnimator();
childLocator = ((EntityState)this).GetModelChildLocator();
FindLocalUser();
((EntityState)this).characterBody.hideCrosshair = true;
}
private void FindLocalUser()
{
if (localUser != null || !Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
{
return;
}
foreach (LocalUser readOnlyLocalUsers in LocalUserManager.readOnlyLocalUsersList)
{
if ((Object)(object)readOnlyLocalUsers.cachedBody == (Object)(object)((EntityState)this).characterBody)
{
localUser = readOnlyLocalUsers;
break;
}
}
}
protected void PlayEmote(string animString, string soundString = "", float animDuration = 0f)
{
PlayEmote(animString, soundString, ((EntityState)this).GetModelAnimator(), animDuration);
}
protected void PlayEmote(string animString, string soundString, Animator animator, float animDuration = 0f)
{
if (animDuration >= 0f && duration != 0f)
{
animDuration = duration;
}
if (duration > 0f)
{
EntityState.PlayAnimationOnAnimator(animator, "FullBody, Override", animString, "Emote.playbackRate", animDuration, 0f);
}
else
{
animator.SetFloat("Emote.playbackRate", 1f);
EntityState.PlayAnimationOnAnimator(animator, "FullBody, Override", animString);
}
if (!string.IsNullOrEmpty(soundString))
{
activePlayID = Util.PlaySound(soundString, ((EntityState)this).gameObject);
}
}
public override void Update()
{
((EntityState)this).Update();
if (((EntityState)this).isAuthority)
{
CheckEmote<Rest>(SubmarinerConfig.restKey);
}
}
private void CheckEmote(KeyCode keybind, EntityState state)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
if (Input.GetKeyDown(keybind) && !localUser.isUIFocused)
{
((EntityState)this).outer.SetInterruptState(state, (InterruptPriority)0);
}
}
private void CheckEmote<T>(ConfigEntry<KeyboardShortcut> keybind) where T : EntityState, new()
{
if (Config.GetKeyPressed(keybind))
{
FindLocalUser();
if (localUser != null && !localUser.isUIFocused)
{
((EntityState)this).outer.SetInterruptState((EntityState)(object)new T(), (InterruptPriority)0);
}
}
}
public override void FixedUpdate()
{
//IL_00a5: 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)
((EntityState)this).FixedUpdate();
bool flag = false;
if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded)
{
flag = true;
}
if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank))
{
if (((EntityState)this).inputBank.skill1.down)
{
flag = true;
}
if (((EntityState)this).inputBank.skill2.down)
{
flag = true;
}
if (((EntityState)this).inputBank.skill3.down)
{
flag = true;
}
if (((EntityState)this).inputBank.skill4.down)
{
flag = true;
}
if (((EntityState)this).inputBank.moveVector != Vector3.zero)
{
flag = true;
}
}
if (duration > 0f && ((EntityState)this).fixedAge >= duration)
{
flag = true;
}
if (flag && ((EntityState)this).isAuthority)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
public override void OnExit()
{
((EntityState)this).OnExit();
((EntityState)this).characterBody.hideCrosshair = false;
((EntityState)this).PlayAnimation("FullBody, Override", "BufferEmpty");
if (activePlayID != 0)
{
AkSoundEngine.StopPlayingID(activePlayID);
}
}
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)0;
}
}
public class BeastImpact : BaseSubmarinerState
{
public HealthComponent victimHealthComponent;
public Vector3 idealDirection;
public bool isCrit;
public override void OnEnter()
{
//IL_014d: 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_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_00de: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_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_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_0074: Unknown result type (might be due to invalid IL or missing references)
//IL_0079: Unknown result type (might be due to invalid IL or missing references)
//IL_0080: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
//IL_008b: Expected O, but got Unknown
base.OnEnter();
if (NetworkServer.active)
{
if (Object.op_Implicit((Object)(object)victimHealthComponent))
{
DamageInfo val = new DamageInfo
{
attacker = ((EntityState)this).gameObject,
damage = ((BaseState)this).damageStat * BeastRide.knockbackDamageCoefficient,
crit = isCrit,
procCoefficient = 1f,
damageColorIndex = (DamageColorIndex)3,
damageType = DamageTypeCombo.op_Implicit((DamageType)524320),
position = ((EntityState)this).characterBody.corePosition
};
victimHealthComponent.TakeDamage(val);
GlobalEventManager.instance.OnHitEnemy(val, ((Component)victimHealthComponent).gameObject);
GlobalEventManager.instance.OnHitAll(val, ((Component)victimHealthComponent).gameObject);
}
((EntityState)this).healthComponent.TakeDamageForce(idealDirection * (0f - BeastRide.knockbackForce), true, false);
}
if (((EntityState)this).isAuthority)
{
((BaseState)this).AddRecoil(-0.5f * BeastRide.recoilAmplitude * 3f, -0.5f * BeastRide.recoilAmplitude * 3f, -0.5f * BeastRide.recoilAmplitude * 8f, 0.5f * BeastRide.recoilAmplitude * 3f);
EffectManager.SimpleImpactEffect(BeastRide.knockbackEffectPrefab, ((EntityState)this).characterBody.corePosition, ((EntityState)this).characterDirection.forward, true);
((EntityState)this).outer.SetNextStateToMain();
}
}
public override void OnSerialize(NetworkWriter writer)
{
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
((EntityState)this).OnSerialize(writer);
writer.Write(Object.op_Implicit((Object)(object)victimHealthComponent) ? ((Component)victimHealthComponent).gameObject : null);
writer.Write(idealDirection);
writer.Write(isCrit);
}
public override void OnDeserialize(NetworkReader reader)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
((EntityState)this).OnDeserialize(reader);
GameObject val = reader.ReadGameObject();
victimHealthComponent = (Object.op_Implicit((Object)(object)val) ? val.GetComponent<HealthComponent>() : null);
idealDirection = reader.ReadVector3();
isCrit = reader.ReadBoolean();
}
public override InterruptPriority GetMinimumInterruptPriority()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (InterruptPriority)7;
}
}
public class BeastRide : BaseCharacterMain
{
public float baseDuration = 5f;
public float speedMultiplier = 2.2f;
public static float chargeDamageCoefficient = SubmarinerConfig.beastDamageCoefficient.Value;
public static float awayForceMagnitude = 0f;
public static float upwardForceMagnitude = 2100f;
public static GameObject impactEffectPrefab = LoaderMeleeAttack.overchargeImpactEffectPrefab;
public static float hitPauseDuration = 0.04f;
public static string impactSoundString = "Play_acrid_m2_bite_shoot";
public static float recoilAmplitude = 1f;
public static string startSoundString = "Play_acrid_shift_fly_loop";
public static string endSoundString = "Stop_acrid_shift_fly_loop";
public static GameObject knockbackEffectPrefab = LoaderMeleeAttack.overchargeImpactEffectPrefab;
public static float knockbackDamageCoefficient = 10f;
public static float massThresholdForKnockback = 250f;
public static float knockbackForce = 8000f;
private uint soundID;
private float duration;
private float hitPauseTimer;
private Vector3 idealDirection;
private OverlapAttack attack;
private bool inHitPause;
private List<HurtBox> victimsStruck = new List<HurtBox>();
public override void OnEnter()
{
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_0091: 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_0185: Expected O, but got Unknown
//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
//IL_01e5: 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_01f4: Unknown result type (might be due to invalid IL or missing references)
//IL_0231: Unknown result type (might be due to invalid IL or missing references)
//IL_0236: Unknown result type (might be due to invalid IL or missing references)
//IL_0247: Unknown result type (might be due to invalid IL or missing references)
((BaseCharacterMain)this).OnEnter();
duration = baseDuration;
if (((EntityState)this).isAuthority)
{
if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank))
{
idealDirection = ((EntityState)this).inputBank.aimDirection;
idealDirection.y = 0f;
}
UpdateDirection();
}
if (Object.op_Implicit((Object)(object)((EntityState)this).modelLocator))
{
((EntityState)this).modelLocator.normalizeToFloor = true;
}
if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
{
((EntityState)this).characterDirection.forward = idealDirection;
}
soundID = Util.PlaySound(startSoundString, ((EntityState)this).gameObject);
if (!SubmarinerConfig.enableFunnyMode.Value)
{
((Component)((BaseState)this).FindModelChild("BeastModel")).gameObject.SetActive(true);
}
((EntityState)this).PlayCrossfade("FullBody, Override", "BeastStart", 0.1f);
((BaseCharacterMain)this).modelAnimator.SetFloat("aimWeight", 0f);
if (NetworkServer.active)
{
((EntityState)this).characterBody.AddBuff(Buffs.ArmorBoost);
((EntityState)this).characterBody.AddBuff(SubmarinerBuffs.SubmarinerBeastBuff);
}
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 == "MeleeHitbox");
}
attack = new OverlapAttack();
attack.attacker = ((EntityState)this).gameObject;
attack.inflictor = ((EntityState)this).gameObject;
attack.teamIndex = ((BaseState)this).GetTeam();
attack.damage = chargeDamageCoefficient * ((BaseState)this).damageStat;
attack.hitEffectPrefab = impactEffectPrefab;
attack.forceVector = Vector3.up * upwardForceMagnitude;
attack.pushAwayForce = awayForceMagnitude;
attack.hitBoxGroup = hitBoxGroup;
attack.isCrit = ((BaseState)this).RollCrit();
attack.damageType = DamageTypeCombo.op_Implicit((DamageType)524288);
attack.damageType.damageSource = (DamageSource)4;
}
public override void OnExit()
{
//IL_0091: Unknown result type (might be due to invalid IL or missing references)
//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
//IL_00cf: 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_00d9: Unknown result type (might be due to invalid IL or missing references)
AkSoundEngine.StopPlayingID(soundID);
Util.PlaySound(endSoundString, ((EntityState)this).gameObject);
if (!((EntityState)this).outer.destroying && Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
{
((EntityState)this).PlayAnimation("FullBody, Override", "BeastEnd", "Dash.playbackRate", 0.4f, 0f);
((EntityState)this).characterBody.isSprinting = false;
if (NetworkServer.active)
{
((EntityState)this).characterBody.RemoveBuff(Buffs.ArmorBoost);
((EntityState)this).characterBody.SetBuffCount(SubmarinerBuffs.SubmarinerBeastBuff.buffIndex, 0);
}
}
if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.disableAirControlUntilCollision)
{
CharacterMotor characterMotor = ((EntityState)this).characterMotor;
characterMotor.velocity += GetIdealVelocity();
}
if (Object.op_Implicit((Object)(object)((EntityState)this).modelLocator))
{
((EntityState)this).modelLocator.normalizeToFloor = false;
}
((BaseCharacterMain)this).modelAnimator.SetFloat("aimWeight", 1f);
((BaseCharacterMain)this).OnExit();
if (!SubmarinerConfig.enableFunnyMode.Value)
{
((Component)((BaseState)this).FindModelChild("BeastModel")).gameObject.SetActive(false);
}
}
private void UpdateDirection()
{
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank))
{
Vector2 val = Util.Vector3XZToVector2XY(((EntityState)this).inputBank.moveVector);
if (val != Vector2.zero)
{
((Vector2)(ref val)).Normalize();
Vector3 val2 = new Vector3(val.x, 0f, val.y);
idealDirection = ((Vector3)(ref val2)).normalized;
}
}
}
private Vector3 GetIdealVelocity()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
return ((EntityState)this).characterDirection.forward * ((EntityState)this).characterBody.moveSpeed * speedMultiplier;
}
public override void FixedUpdate()
{
//IL_02d8: Unknown result type (might be due to invalid IL or missing references)
//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
//IL_0107: Unknown result type (might be due to invalid IL or missing references)
//IL_010d: Unknown result type (might be due to invalid IL or missing references)
//IL_0117: Unknown result type (might be due to invalid IL or missing references)
//IL_011c: Unknown result type (might be due to invalid IL or missing references)
//IL_0121: Unknown result type (might be due to invalid IL or missing references)
//IL_028c: Unknown result type (might be due to invalid IL or missing references)
//IL_0291: Unknown result type (might be due to invalid IL or missing references)
((BaseCharacterMain)this).FixedUpdate();
if (((EntityState)this).fixedAge >= duration)
{
((EntityState)this).outer.SetNextStateToMain();
}
else
{
if (!((EntityState)this).isAuthority)
{
return;
}
if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
{
((EntityState)this).characterBody.isSprinting = true;
}
if (Object.op_Implicit((Object)(object)((EntityState)this).skillLocator.special) && ((EntityState)this).inputBank.skill4.down)
{
((EntityState)this).skillLocator.special.ExecuteIfReady();
}
UpdateDirection();
if (!inHitPause)
{
if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
{
((EntityState)this).characterDirection.moveVector = idealDirection;
if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.disableAirControlUntilCollision)
{
CharacterMotor characterMotor = ((EntityState)this).characterMotor;
characterMotor.rootMotion += GetIdealVelocity() * Time.fixedDeltaTime;
}
}
attack.damage = ((BaseState)this).damageStat * chargeDamageCoefficient;
if (!attack.Fire(victimsStruck))
{
return;
}
Util.PlaySound(impactSoundString, ((EntityState)this).gameObject);
inHitPause = true;
hitPauseTimer = hitPauseDuration;
((BaseState)this).AddRecoil(-0.5f * recoilAmplitude, -0.5f * recoilAmplitude, -0.5f * recoilAmplitude, 0.5f * recoilAmplitude);
((EntityState)this).PlayAnimation("FullBody, Override", "BeastEat", "Dash.playbackRate", hitPauseDuration, 0f);
for (int i = 0; i < victimsStruck.Count; i++)
{
float num = 0f;
HurtBox val = victimsStruck[i];
if (!Object.op_Implicit((Object)(object)val.healthComponent))
{
continue;
}
CharacterMotor component = ((Component)val.healthComponent).GetComponent<CharacterMotor>();
if (Object.op_Implicit((Object)(object)component))
{
num = component.mass;
}
else
{
Rigidbody component2 = ((Component)val.healthComponent).GetComponent<Rigidbody>();
if (Object.op_Implicit((Object)(object)component2))
{
num = component2.mass;
}
}
if (num >= massThresholdForKnockback)
{
((EntityState)this).outer.SetNextState((EntityState)(object)new BeastImpact
{
victimHealthComponent = val.healthComponent,
idealDirection = idealDirection,
isCrit = attack.isCrit
});
break;
}
}
}
else
{
((EntityState)this).characterMotor.velocity = Vector3.zero;
hitPauseTimer -= Time.fixedDeltaTime;
if (hitPauseTimer < 0f)
{
inHitPause = false;
}
}
}
}
public override InterruptPriority GetMinimumInterruptPriority()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (InterruptPriority)7;
}
}
internal class Bounce : BaseSubmarinerSkillState
{
public static float baseDuration = 1f;
public Vector3 faceDirection;
public override void OnEnter()
{
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
RefreshState();
base.OnEnter();
if (((EntityState)this).characterMotor.isGrounded)
{
((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f);
}
((EntityState)this).characterMotor.ApplyForce(Vector3.up * 12f, true, false);
}
public override void FixedUpdate()
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
base.FixedUpdate();
if (((EntityState)this).isAuthority)
{
((EntityState)this).characterDirection.forward = faceDirection;
((EntityState)this).characterBody.isSprinting = true;
((EntityState)this).characterMotor.disableAirControlUntilCollision = false;
if (((EntityState)this).fixedAge >= baseDuration || ((EntityState)this).characterMotor.isGrounded)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
}
public override void OnExit()
{
((EntityState)this).OnExit();
if (((EntityState)this).characterMotor.isGrounded)
{
((EntityState)this).PlayCrossfade("FullBody, Override", "BufferEmpty", 0.1f);
}
}
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 class HarpoonShot : BaseSubmarinerSkillState
{
private Transform modelTransform;
public static GameObject dashPrefab = SubmarinerAssets.dashEffect;
public static GameObject projectilePrefab = SubmarinerAssets.hookPrefab;
public static float smallHopVelocity = 12f;
public static float baseDuration = 1f;
public static float dashDuration = 0.5f;
public static float pushAwayForce = 10f;
public static float pushAwayYFactor = 2.5f;
public static float speedCoefficient = 5f;
public static string beginSoundString = "Play_loader_m2_launch";
public static string endSoundString = "sfx_submariner_dash";
public static float damageCoefficient = SubmarinerConfig.harpoonDamageCoefficient.Value;
public static float procCoefficient = 1f;
public static float hitPauseDuration = 0.012f;
private OverlapAttack attack;
private List<HurtBox> victimsStruck = new List<HurtBox>();
private Vector3 dashVector = Vector3.zero;
private ChildLocator childLocator;
public GameObject hookInstance;
protected ProjectileStickOnImpact hookStickOnImpact;
private bool isStuck;
private bool hasHit;
private bool hadHookInstance;
private AimRequest aimRequest;
public override void OnEnter()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Expected O, but got Unknown
//IL_006b: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0091: Unknown result type (might be due to invalid IL or missing references)
//IL_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)
//IL_010a: 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_0131: Unknown result type (might be due to invalid IL or missing references)
//IL_0136: Unknown result type (might be due to invalid IL or missing references)
RefreshState();
base.OnEnter();
((BaseState)this).StartAimMode(0.5f + baseDuration, false);
Ray aimRay = ((BaseState)this).GetAimRay();
dashVector = ((Ray)(ref aimRay)).direction;
attack = new OverlapAttack();
attack.attacker = ((EntityState)this).gameObject;
attack.inflictor = ((EntityState)this).gameObject;
attack.damageType = DamageTypeCombo.op_Implicit((DamageType)32);
attack.procCoefficient = 1f;
attack.teamIndex = ((BaseState)this).GetTeam();
attack.isCrit = ((BaseState)this).RollCrit();
attack.forceVector = Vector3.zero;
attack.pushAwayForce = 1f;
attack.damage = damageCoefficient * ((BaseState)this).damageStat;
attack.hitBoxGroup = ((BaseState)this).FindHitBoxGroup("HarpoonKickHitbox");
attack.hitEffectPrefab = SubmarinerAssets.submarinerHitEffect;
DamageAPI.AddModdedDamageType(attack, DamageTypes.SubmarinerRegeneration);
attack.damageType.damageSource = (DamageSource)2;
attack.impactSound = SubmarinerAssets.impactSound.index;
FireProjectile();
Util.PlaySound("Play_loader_m2_launch", ((EntityState)this).gameObject);
((EntityState)this).PlayAnimation("Gesture, Override", "FireHarpoon", "Harpoon.playbackRate", baseDuration, 0f);
}
private void CreateDashEffect()
{
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_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_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Expected O, but got Unknown
Transform val = childLocator.FindChild("Chest");
if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)dashPrefab))
{
EffectManager.SpawnEffect(dashPrefab, new EffectData
{
origin = val.position,
rotation = Util.QuaternionSafeLookRotation(-dashVector)
}, true);
}
}
public override void FixedUpdate()
{
//IL_0198: Unknown result type (might be due to invalid IL or missing references)
//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
//IL_01d6: 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_01f1: Unknown result type (might be due to invalid IL or missing references)
//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
//IL_0208: Unknown result type (might be due to invalid IL or missing references)
//IL_020d: Unknown result type (might be due to invalid IL or missing references)
//IL_0109: 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_0119: Unknown result type (might be due to invalid IL or missing references)
//IL_011e: Unknown result type (might be due to invalid IL or missing references)
//IL_0123: Unknown result type (might be due to invalid IL or missing references)
base.FixedUpdate();
((BaseState)this).StartAimMode(2f, false);
if (!((EntityState)this).isAuthority)
{
return;
}
if (Object.op_Implicit((Object)(object)hookStickOnImpact) && Object.op_Implicit((Object)(object)hookStickOnImpact.stuckBody))
{
Rigidbody component = ((Component)hookStickOnImpact.stuckBody).GetComponent<Rigidbody>();
if (Object.op_Implicit((Object)(object)component) && component.mass >= hookInstance.GetComponent<ProjectileGrappleController>().yankMassLimit)
{
if (hookStickOnImpact.stuck && !isStuck)
{
if (NetworkServer.active)
{
((EntityState)this).characterBody.AddBuff(Buffs.HiddenInvincibility);
}
((EntityState)this).PlayAnimation("FullBody, Override", "HarpoonPullStart", "Dash.playbackRate", dashDuration, 0f);
((EntityState)this).characterMotor.velocity.y = 0f;
CharacterMotor characterMotor = ((EntityState)this).characterMotor;
characterMotor.velocity += dashVector * 52.5f;
}
isStuck = hookStickOnImpact.stuck;
if (attack.Fire(victimsStruck))
{
((EntityState)this).PlayAnimation("FullBody, Override", "HarpoonEndToKick", "Dash.playbackRate", dashDuration, 0f);
hasHit = true;
((EntityState)this).characterMotor.velocity.y = 0f;
((EntityState)this).characterDirection.forward = dashVector;
((EntityState)this).characterBody.isSprinting = true;
((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f);
Vector3 val = -((EntityState)this).characterDirection.forward;
val.y = pushAwayYFactor;
((EntityState)this).characterMotor.velocity = val * pushAwayForce;
((EntityState)this).outer.SetNextState((EntityState)(object)new Bounce
{
faceDirection = dashVector
});
}
}
}
if (((EntityState)this).isAuthority && !Object.op_Implicit((Object)(object)hookInstance) && hadHookInstance)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
public void SetHookReference(GameObject hook)
{
hookInstance = hook;
hookStickOnImpact = hook.GetComponent<ProjectileStickOnImpact>();
hadHookInstance = true;
}
public void FireProjectile()
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_0079: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: 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_00a5: 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)
if (((EntityState)this).isAuthority)
{
Ray aimRay = ((BaseState)this).GetAimRay();
FireProjectileInfo val = default(FireProjectileInfo);
val.position = ((Ray)(ref aimRay)).origin;
val.rotation = Quaternion.LookRotation(((Ray)(ref aimRay)).direction);
val.crit = ((EntityState)this).characterBody.RollCrit();
val.damage = ((BaseState)this).damageStat * (damageCoefficient / 2f);
val.force = 0f;
val.damageColorIndex = (DamageColorIndex)0;
val.procChainMask = default(ProcChainMask);
val.projectilePrefab = projectilePrefab;
val.owner = ((EntityState)this).gameObject;
FireProjectileInfo val2 = val;
ProjectileManager.instance.FireProjectile(val2);
}
}
public override void OnExit()
{
((EntityState)this).OnExit();
if (!hasHit)
{
((EntityState)this).PlayCrossfade("FullBody, Override", "BufferEmpty", 0.1f);
}
if (NetworkServer.active && ((EntityState)this).characterBody.HasBuff(Buffs.HiddenInvincibility))
{
((EntityState)this).characterBody.RemoveBuff(Buffs.HiddenInvincibility);
((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, 0.3f);
}
}
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)3;
}
}
public class MainState : GenericCharacterMain
{
private Animator animator;
public LocalUser localUser;
public override void OnEnter()
{
((GenericCharacterMain)this).OnEnter();
animator = ((BaseCharacterMain)this).modelAnimator;
FindLocalUser();
}
private void CheckEmote<T>(ConfigEntry<KeyboardShortcut> keybind) where T : EntityState, new()
{
if (Config.GetKeyPressed(keybind))
{
FindLocalUser();
if (localUser != null && !localUser.isUIFocused)
{
((EntityState)this).outer.SetInterruptState((EntityState)(object)new T(), (InterruptPriority)0);
}
}
}
private void FindLocalUser()
{
if (localUser != null || !Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
{
return;
}
foreach (LocalUser readOnlyLocalUsers in LocalUserManager.readOnlyLocalUsersList)
{
if ((Object)(object)readOnlyLocalUsers.cachedBody == (Object)(object)((EntityState)this).characterBody)
{
localUser = readOnlyLocalUsers;
break;
}
}
}
public override void FixedUpdate()
{
((GenericCharacterMain)this).FixedUpdate();
if (Object.op_Implicit((Object)(object)animator))
{
bool flag = false;
if (!((EntityState)this).characterBody.outOfDanger || !((EntityState)this).characterBody.outOfCombat)
{
flag = true;
}
animator.SetBool("inCombat", flag);
if (((BaseState)this).isGrounded)
{
animator.SetFloat("airBlend", 0f);
}
else
{
animator.SetFloat("airBlend", 1f);
}
if (animator.GetCurrentStateName(animator.GetLayerIndex("Body")) == "RestIdle")
{
((Behaviour)base.aimAnimator).enabled = false;
}
else
{
((Behaviour)base.aimAnimator).enabled = true;
}
}
if (((EntityState)this).isAuthority && ((EntityState)this).characterMotor.isGrounded)
{
CheckEmote<Rest>(SubmarinerConfig.restKey);
}
}
public override void ProcessJump()
{
//IL_0275: Unknown result type (might be due to invalid IL or missing references)
//IL_027a: Unknown result type (might be due to invalid IL or missing references)
//IL_0281: Unknown result type (might be due to invalid IL or missing references)
//IL_0292: Expected O, but got Unknown
//IL_02b5: Unknown result type (might be due to invalid IL or missing references)
//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
//IL_02c1: Unknown result type (might be due to invalid IL or missing references)
//IL_02cc: Unknown result type (might be due to invalid IL or missing references)
//IL_02e3: Expected O, but got Unknown
//IL_02f7: Unknown result type (might be due to invalid IL or missing references)
//IL_02fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0303: Unknown result type (might be due to invalid IL or missing references)
//IL_030e: Unknown result type (might be due to invalid IL or missing references)
//IL_0315: Unknown result type (might be due to invalid IL or missing references)
//IL_031a: Unknown result type (might be due to invalid IL or missing references)
//IL_031f: Unknown result type (might be due to invalid IL or missing references)
//IL_032a: Expected O, but got Unknown
if (!Object.op_Implicit((Object)(object)((EntityState)this).characterBody) || !Object.op_Implicit((Object)(object)((EntityState)this).characterBody.inventory) || !((BaseCharacterMain)this).hasCharacterMotor || ((EntityState)this).healthComponent.isInFrozenState)
{
return;
}
bool flag = false;
bool flag2 = false;
if (((EntityState)this).characterBody.inventory.GetItemCountEffective(Items.JumpDamageStrike) > 0)
{
((EntityState)this).characterBody.GetBuffCount(Buffs.JumpDamageStrikeCharge);
}
if (!base.jumpInputReceived || !Object.op_Implicit((Object)(object)((EntityState)this).characterBody) || ((EntityState)this).characterMotor.jumpCount >= ((EntityState)this).characterBody.maxJumpCount)
{
return;
}
int itemCountEffective = ((EntityState)this).characterBody.inventory.GetItemCountEffective(Items.JumpBoost);
float num = 1f;
float num2 = 1f;
if (((EntityState)this).characterMotor.jumpCount >= ((EntityState)this).characterBody.baseJumpCount)
{
flag = true;
num = 1.5f;
num2 = 1.5f;
}
else if (itemCountEffective > 0 && ((EntityState)this).characterBody.isSprinting)
{
float num3 = ((EntityState)this).characterBody.acceleration * ((EntityState)this).characterMotor.airControl;
if (((EntityState)this).characterBody.moveSpeed > 0f && num3 > 0f)
{
flag2 = true;
float num4 = Mathf.Sqrt(10f * (float)itemCountEffective / num3);
float num5 = ((EntityState)this).characterBody.moveSpeed / num3;
num = (num4 + num5) / num5;
}
}
GenericCharacterMain.ApplyJumpVelocity(((EntityState)this).characterMotor, ((EntityState)this).characterBody, num, num2, false);
if (((BaseCharacterMain)this).hasModelAnimator)
{
int layerIndex = ((BaseCharacterMain)this).modelAnimator.GetLayerIndex("Body");
if (layerIndex >= 0)
{
if (((EntityState)this).characterBody.isSprinting)
{
((BaseCharacterMain)this).modelAnimator.CrossFadeInFixedTime("SprintJump", ((BaseCharacterMain)this).smoothingParameters.intoJumpTransitionTime, layerIndex);
}
else if (flag)
{
((BaseCharacterMain)this).modelAnimator.CrossFadeInFixedTime("BonusJump", ((BaseCharacterMain)this).smoothingParameters.intoJumpTransitionTime, layerIndex);
}
else
{
((BaseCharacterMain)this).modelAnimator.CrossFadeInFixedTime("Jump", ((BaseCharacterMain)this).smoothingParameters.intoJumpTransitionTime, layerIndex);
}
}
}
if (flag)
{
EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/FeatherEffect"), new EffectData
{
origin = ((EntityState)this).characterBody.footPosition
}, true);
}
else if (((EntityState)this).characterMotor.jumpCount > 0)
{
EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/ImpactEffects/CharacterLandImpact"), new EffectData
{
origin = ((EntityState)this).characterBody.footPosition,
scale = ((EntityState)this).characterBody.radius
}, true);
}
if (flag2)
{
EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/BoostJumpEffect"), new EffectData
{
origin = ((EntityState)this).characterBody.footPosition,
rotation = Util.QuaternionSafeLookRotation(((EntityState)this).characterMotor.velocity)
}, true);
}
CharacterMotor characterMotor = ((EntityState)this).characterMotor;
characterMotor.jumpCount++;
((EntityState)this).characterBody.TriggerJumpEventGlobally();
}
}
public class RecoverAnchor : BaseSubmarinerSkillState
{
public static GameObject muzzleEffectPrefab;
public static float baseDuration = 1f;
private float duration;
public override void OnEnter()
{
RefreshState();
submarinerController.DisableAnchor();
base.OnEnter();
duration = baseDuration / ((BaseState)this).attackSpeedStat;
}
public override void OnExit()
{
((EntityState)this).OnExit();
submarinerController.EnableAnchor();
}
public override void FixedUpdate()
{
base.FixedUpdate();
if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
{
((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 class Rest : BaseEmote
{
public override void OnEnter()
{
base.OnEnter();
PlayEmote("RestEmote", "", 1.5f);
}
}
public class Swing : BaseMeleeAttack
{
protected GameObject swingEffectInstance;
public override void OnEnter()
{
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
//IL_010e: Unknown result type (might be due to invalid IL or missing references)
//IL_0113: Unknown result type (might be due to invalid IL or missing references)
RefreshState();
hitboxGroupName = "MeleeHitbox";
damageType = DamageTypeCombo.op_Implicit((DamageType)0);
damageSource = (DamageSource)1;
damageCoefficient = SubmarinerConfig.swingDamageCoefficient.Value;
procCoefficient = 1f;
pushForce = 1500f;
bonusForce = Vector3.zero;
baseDuration = 1.2f;
attackStartPercentTime = 0.6f;
attackEndPercentTime = 0.9f;
earlyExitPercentTime = 1f;
hitStopDuration = 0.15f;
attackRecoil = 0.75f;
hitHopVelocity = 10f;
swingSoundString = "Play_acrid_m1_bigSlash";
hitSoundString = "";
muzzleString = ((swingIndex % 2 == 0) ? "SwingMuzzle1" : "SwingMuzzle2");
playbackRateParam = "Swing.playbackRate";
swingEffectPrefab = SubmarinerAssets.submarinerSwingEffect;
moddedDamageTypeHolder.Add(DamageTypes.SubmarinerRegeneration);
hitEffectPrefab = SubmarinerAssets.submarinerHitEffect;
impactSound = SubmarinerAssets.impactSound.index;
base.OnEnter();
}
protected override void OnHitEnemyAuthority()
{
base.OnHitEnemyAuthority();
}
protected override void FireAttack()
{
//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_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
if (((EntityState)this).isAuthority)
{
Ray aimRay = ((BaseState)this).GetAimRay();
Vector3 direction = ((Ray)(ref aimRay)).direction;
direction.y = Mathf.Max(direction.y, direction.y * 0.5f);
((BaseState)this).FindModelChild("MeleePivot").rotation = Util.QuaternionSafeLookRotation(direction);
}
base.FireAttack();
}
protected override void PlaySwingEffect()
{
Util.PlaySound(swingSoundString, ((EntityState)this).gameObject);
if (Object.op_Implicit((Object)(object)swingEffectPrefab))
{
Transform val = ((BaseState)this).FindModelChild(muzzleString);
if (Object.op_Implicit((Object)(object)val))
{
swingEffectInstance = Object.Instantiate<GameObject>(swingEffectPrefab, val);
}
}
}
protected override void PlayAttackAnimation()
{
((EntityState)this).PlayCrossfade("Gesture, Override", "Swing" + (1 + swingIndex), playbackRateParam, duration * 1.5f, duration * 0.4f);
}
public override void OnExit()
{
base.OnExit();
if (Object.op_Implicit((Object)(object)swingEffectInstance))
{
EntityState.Destroy((Object)(object)swingEffectInstance);
}
}
}
}
namespace SubmarinerMod.SubmarinerCharacter.Content
{
public static class DamageTypes
{
public static ModdedDamageType Default;
public static ModdedDamageType SubmarinerRegeneration;
internal static void Init()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
Default = DamageAPI.ReserveDamageType();
SubmarinerRegeneration = DamageAPI.ReserveDamageType();
Hook();
}
private static void Hook()
{
GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt;
}
private static void GlobalEventManager_onServerDamageDealt(DamageReport damageReport)
{
//IL_0089: Unknown result type (might be due to invalid IL or missing references)
DamageInfo damageInfo = damageReport.damageInfo;
if (Object.op_Implicit((Object)(object)damageReport.attackerBody) && Object.op_Implicit((Object)(object)damageReport.victimBody))
{
HealthComponent victim = damageReport.victim;
GameObject inflictor = damageInfo.inflictor;
CharacterBody victimBody = damageReport.victimBody;
EntityStateMachine component = ((Component)victimBody).GetComponent<EntityStateMachine>();
CharacterBody attackerBody = damageReport.attackerBody;
GameObject gameObject = damageReport.attacker.gameObject;
if (NetworkServer.active && attackerBody.baseNameToken == "KENKO_SUBMARINER_NAME" && DamageAPI.HasModdedDamageType(damageInfo, SubmarinerRegeneration) && Object.op_Implicit((Object)(object)victimBody) && Object.op_Implicit((Object)(object)attackerBody))
{
attackerBody.AddTimedBuff(SubmarinerBuffs.SubmarinerRegenBuff, 2.5f);
}
}
}
}
public static class SubmarinerAI
{
public static void Init(GameObject bodyPrefab, string masterName)
{
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
//IL_00d0: 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_00fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0137: Unknown result type (might be due to invalid IL or missing references)
//IL_0177: Unknown result type (might be due to invalid IL or missing references)
//IL_0193: Unknown result type (might be due to invalid IL or missing references)
//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
//IL_0210: Unknown result type (might be due to invalid IL or missing references)
//IL_0230: Unknown result type (might be due to invalid IL or missing references)
//IL_0244: Unknown result type (might be due to invalid IL or missing references)
//IL_024c: Unknown result type (might be due to invalid IL or missing references)
//IL_0268: Unknown result type (might be due to invalid IL or missing references)
//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
//IL_0308: Unknown result type (might be due to invalid IL or missing references)
//IL_0330: Unknown result type (might be due to invalid IL or missing references)
//IL_0350: Unknown result type (might be due to invalid IL or missing references)
//IL_0364: Unknown result type (might be due to invalid IL or missing references)
//IL_036c: Unknown result type (might be due to invalid IL or missing references)
GameObject val = Prefabs.CreateBlankMasterPrefab(bodyPrefab, masterName);
BaseAI component = val.GetComponent<BaseAI>();
component.aimVectorDampTime = 0.1f;
component.aimVectorMaxSpeed = 360f;
AISkillDriver val2 = val.AddComponent<AISkillDriver>();
val2.customName = "Use Primary Swing";
val2.skillSlot = (SkillSlot)0;
val2.requiredSkill = null;
val2.requireSkillReady = false;
val2.requireEquipmentReady = false;
val2.minUserHealthFraction = float.NegativeInfinity;
val2.maxUserHealthFraction = float.PositiveInfinity;
val2.minTargetHealthFraction = float.NegativeInfinity;
val2.maxTargetHealthFraction = float.PositiveInfinity;
val2.minDistance = 0f;
val2.maxDistance = 8f;
val2.selectionRequiresTargetLoS = false;
val2.selectionRequiresOnGround = false;
val2.selectionRequiresAimTarget = false;
val2.maxTimesSelected = -1;
val2.moveTargetType = (TargetType)0;
val2.activationRequiresTargetLoS = false;
val2.activationRequiresAimTargetLoS = false;
val2.activationRequiresAimConfirmation = false;
val2.movementType = (MovementType)1;
val2.moveInputScale = 1f;
val2.aimType = (AimType)1;
val2.ignoreNodeGraph = false;
val2.shouldSprint = false;
val2.shouldFireEquipment = false;
val2.buttonPressType = (ButtonPressType)0;
val2.driverUpdateTimerOverride = -1f;
val2.resetCurrentEnemyOnNextDriverSelection = false;
val2.noRepeat = false;
val2.nextHighPriorityOverride = null;
AISkillDriver val3 = val.AddComponent<AISkillDriver>();
val3.customName = "Use Secondary Shoot";
val3.skillSlot = (SkillSlot)1;
val3.requireSkillReady = true;
val3.minDistance = 0f;
val3.maxDistance = 25f;
val3.selectionRequiresTargetLoS = false;
val3.selectionRequiresOnGround = false;
val3.selectionRequiresAimTarget = false;
val3.maxTimesSelected = -1;
val3.moveTargetType = (TargetType)0;
val3.activationRequiresTargetLoS = false;
val3.activationRequiresAimTargetLoS = false;
val3.activationRequiresAimConfirmation = true;
val3.movementType = (MovementType)1;
val3.moveInputScale = 1f;
val3.aimType = (AimType)1;
val3.buttonPressType = (ButtonPressType)0;
AISkillDriver val4 = val.AddComponent<AISkillDriver>();
val4.customName = "Use Utility Roll";
val4.skillSlot = (SkillSlot)2;
val4.requireSkillReady = true;
val4.minDistance = 8f;
val4.maxDistance = 20f;
val4.selectionRequiresTargetLoS = true;
val4.selectionRequiresOnGround = false;
val4.selectionRequiresAimTarget = false;
val4.maxTimesSelected = -1;
val4.moveTargetType = (TargetType)0;
val4.activationRequiresTargetLoS = false;
val4.activationRequiresAimTargetLoS = false;
val4.activationRequiresAimConfirmation = false;
val4.movementType = (MovementType)2;
val4.moveInputScale = 1f;
val4.aimType = (AimType)1;
val4.buttonPressType = (ButtonPressType)0;
AISkillDriver val5 = val.AddComponent<AISkillDriver>();
val5.customName = "Use Special bomb";
val5.skillSlot = (SkillSlot)3;
val5.requireSkillReady = true;
val5.minDistance = 0f;
val5.maxDistance = 20f;
val5.selectionRequiresTargetLoS = false;
val5.selectionRequiresOnGround = false;
val5.selectionRequiresAimTarget = false;
val5.maxTimesSelected = -1;
val5.moveTargetType = (TargetType)0;
val5.activationRequiresTargetLoS = false;
val5.activationRequiresAimTargetLoS = false;
val5.activationRequiresAimConfirmation = false;
val5.movementType = (MovementType)1;
val5.moveInputScale = 1f;
val5.aimType = (AimType)1;
val5.buttonPressType = (ButtonPressType)0;
AISkillDriver val6 = val.AddComponent<AISkillDriver>();
val6.customName = "Chase";
val6.skillSlot = (SkillSlot)(-1);
val6.requireSkillReady = false;
val6.minDistance = 0f;
val6.maxDistance = float.PositiveInfinity;
val6.moveTargetType = (TargetType)0;
val6.activationRequiresTargetLoS = false;
val6.activationRequiresAimTargetLoS = false;
val6.activationRequiresAimConfirmation = false;
val6.movementType = (MovementType)1;
val6.moveInputScale = 1f;
val6.aimType = (AimType)1;
val6.buttonPressType = (ButtonPressType)0;
}
}
public static class SubmarinerAssets
{
internal static AssetBundle mainAssetBundle;
internal static Material commandoMat;
internal static Material anchorMat;
internal static Material ghostMat;
internal static Shader hotpoo = Resources.Load<Shader>("Shaders/Deferred/HGStandard");
internal static GameObject regenerativeEffect;
internal static GameObject anchorLandingEffect;
internal static GameObject submarinerSwingEffect;
internal static GameObject submarinerHitEffect;
internal static GameObject dashEffect;
internal static GameObject throwable;
internal static GameObject throwableEnd;
internal static GameObject anchorTether;
internal static GameObject hookPrefab;
internal static GameObject minePrefab;
internal static GameObject mineExplosionPrefab;
internal static GameObject anchorPrefab;
internal static NetworkSoundEventDef impactSound;
internal static NetworkSoundEventDef swordImpactSoundEvent;
internal static Color SubmarinerColor = new Color(0.23921569f, 0.8980392f, 28f / 85f);
internal static Color SubmarinerSecondaryColor = new Color(14f / 51f, 21f / 85f, 0.36862746f);
public static void Init(AssetBundle assetBundle)
{
mainAssetBundle = assetBundle;
CreateMaterials();
CreateModels();
CreateEffects();
CreateSounds();
CreateProjectiles();
CreateUI();
}
private static void CleanChildren(Transform startingTrans)
{
for (int num = startingTrans.childCount - 1; num >= 0; num--)
{
if (startingTrans.GetChild(num).childCount > 0)
{
CleanChildren(startingTrans.GetChild(num));
}
Object.DestroyImmediate((Object)(object)((Component)startingTrans.GetChild(num)).gameObject);
}
}
private static void CreateMaterials()
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
anchorMat = mainAssetBundle.LoadAsset<Material>("matSubmariner");
ghostMat = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/VFX/matGhostEffect.mat").WaitForCompletion();
}
private static void CreateModels()
{
}
private static void CreateEffects()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0073: Unknown result type (might be due to invalid IL or missing references)
//IL_0078: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: Unknown result type (might be due to invalid IL or missing references)
//IL_009a: Unknown result type (might be due to invalid IL or missing references)
//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
//IL_014a: Unknown result type (might be due to invalid IL or missing references)
//IL_0154: Unknown result type (might be due to invalid IL or missing references)
//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
//IL_0265: Unknown result type (might be due to invalid IL or missing references)
//IL_026f: Unknown result type (might be due to invalid IL or missing references)
//IL_028f: Unknown result type (might be due to invalid IL or missing references)
//IL_0299: Unknown result type (might be due to invalid IL or missing references)
//IL_02cc: Unknown result type (might be due to invalid IL or missing references)
//IL_02d1: Unknown result type (might be due to invalid IL or missing references)
//IL_0303: Unknown result type (might be due to invalid IL or missing references)
//IL_031e: Unknown result type (might be due to invalid IL or missing references)
//IL_0323: Unknown result type (might be due to invalid IL or missing references)
//IL_0355: Unknown result type (might be due to invalid IL or missing references)
//IL_035a: Unknown result type (might be due to invalid IL or missing references)
//IL_038c: Unknown result type (might be due to invalid IL or missing references)
//IL_0391: Unknown result type (might be due to invalid IL or missing references)
//IL_03b5: Unknown result type (might be due to invalid IL or missing references)
//IL_03ba: Unknown result type (might be due to invalid IL or missing references)
anchorLandingEffect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidMegaCrab/VoidMegacrabAntimatterExplosionSimple.prefab").WaitForCompletion(), "SubmarinerAnchorLandingEffect", false);
if (!Object.op_Implicit((Object)(object)anchorLandingEffect.GetComponent<EffectComponent>()))
{
anchorLandingEffect.AddComponent<EffectComponent>();
}
EffectComponent component = anchorLandingEffect.GetComponent<EffectComponent>();
component.applyScale = true;
component.soundName = "Play_voidDevastator_m2_secondary_explo";
SubmarinerMod.Modules.Content.CreateAndAddEffectDef(anchorLandingEffect);
regenerativeEffect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Croco/CrocoRegenEffect.prefab").WaitForCompletion(), "SubmarinerRegenerativeEffect", false);
throwable = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/VFX/BasicThrowableVisualizer.prefab").WaitForCompletion();
throwableEnd = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Huntress/HuntressArrowRainIndicator.prefab").WaitForCompletion();
anchorTether = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Treebot/EntangleOrbEffect.prefab").WaitForCompletion(), "SubmarinerChains");
anchorTether.AddComponent<NetworkIdentity>();
Material[] materials = (Material[])(object)new Material[1] { Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Gravekeeper/matGravekeeperHookChain.mat").WaitForCompletion() };
((Renderer)((Component)anchorTether.transform.GetChild(0)).GetComponent<LineRenderer>()).materials = materials;
((Component)anchorTether.transform.GetChild(0)).GetComponent<LineRenderer>().textureMode = (LineTextureMode)1;
Transform transform = anchorTether.transform;
transform.localScale *= 0.5f;
Object.Destroy((Object)(object)((Component)anchorTether.transform.GetChild(0).GetChild(0)).gameObject);
((Behaviour)anchorTether.gameObject.GetComponent<AkEvent>()).enabled = false;
((Behaviour)anchorTether.gameObject.GetComponent<AkGameObj>()).enabled = false;
anchorTether.gameObject.AddComponent<DestroyOnCondition>();
SubmarinerMod.Modules.Content.CreateAndAddEffectDef(anchorTether);
dashEffect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Brother/BrotherDashEffect.prefab").WaitForCompletion(), "SubmarinerDashEffect");
dashEffect.AddComponent<NetworkIdentity>();
Object.Destroy((Object)(object)((Component)dashEffect.transform.Find("Point light")).gameObject);
Object.Destroy((Object)(object)((Component)dashEffect.transform.Find("Flash, White")).gameObject);
Object.Destroy((Object)(object)((Component)dashEffect.transform.Find("NoiseTrails")).gameObject);
Transform obj = dashEffect.transform.Find("Donut");
obj.localScale *= 0.5f;
Transform obj2 = dashEffect.transform.Find("Donut, Distortion");
obj2.localScale *= 0.5f;
((Renderer)((Component)dashEffect.transform.Find("Dash")).GetComponent<ParticleSystemRenderer>()).material.SetTexture("_RemapTex", Addressables.LoadAssetAsync<Texture>((object)"RoR2/Base/Common/ColorRamps/texRampDefault.png").WaitForCompletion());
((Renderer)((Component)dashEffect.transform.Find("Dash")).GetComponent<ParticleSystemRenderer>()).material.SetColor("_TintColor", SubmarinerColor);
SubmarinerMod.Modules.Content.CreateAndAddEffectDef(dashEffect);
submarinerHitEffect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Bandit2/HitsparkBandit.prefab").WaitForCompletion(), "SubmarinerHitEffect");
submarinerHitEffect.AddComponent<NetworkIdentity>();
SubmarinerMod.Modules.Content.CreateAndAddEffectDef(submarinerHitEffect);
submarinerSwingEffect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Merc/MercSwordSlash.prefab").WaitForCompletion(), "SubmarinerSwing", false);
((Renderer)((Component)submarinerSwingEffect.transform.GetChild(0)).GetComponent<ParticleSystemRenderer>()).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Huntress/matHuntressSwingTrail.mat").WaitForCompletion();
MainModule main = ((Component)submarinerSwingEffect.transform.GetChild(0)).GetComponent<ParticleSystem>().main;
((MainModule)(ref main)).startLifetimeMultiplier = ((MainModule)(ref main)).startLifetimeMultiplier * 2f;
}
private static void CreateProjectiles()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0153: Unknown result type (might be due to invalid IL or missing references)
//IL_015d: Unknown result type (might be due to invalid IL or missing references)
//IL_0167: Unknown result type (might be due to invalid IL or missing references)
//IL_0171: Unknown result type (might be due to invalid IL or missing references)
//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
//IL_02fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0311: Unknown result type (might be due to invalid IL or missing references)
//IL_0316: Unknown result type (might be due to invalid IL or missing references)
//IL_0387: Unknown result type (might be due to invalid IL or missing references)
//IL_038c: Unknown result type (might be due to invalid IL or missing references)
//IL_0445: Unknown result type (might be due to invalid IL or missing references)
//IL_0536: Unknown result type (might be due to invalid IL or missing references)
//IL_053b: Unknown result type (might be due to invalid IL or missing references)
//IL_05c1: Unknown result type (might be due to invalid IL or missing references)
//IL_05cb: Unknown result type (might be due to invalid IL or missing references)
//IL_0626: Unknown result type (might be due to invalid IL or missing references)
//IL_062d: Expected O, but got Unknown
//IL_0641: Unknown result type (might be due to invalid IL or missing references)
//IL_064b: Unknown result type (might be due to invalid IL or missing references)
//IL_0676: Unknown result type (might be due to invalid IL or missing references)
//IL_0680: Unknown result type (might be due to invalid IL or missing references)
//IL_06ec: Unknown result type (might be due to invalid IL or missing references)
//IL_06f1: Unknown result type (might be due to invalid IL or missing references)
//IL_06ff: Unknown result type (might be due to invalid IL or missing references)
//IL_0704: Unknown result type (might be due to invalid IL or missing references)
//IL_0747: Unknown result type (might be due to invalid IL or missing references)
//IL_074f: Unknown result type (might be due to invalid IL or missing references)
//IL_0754: Unknown result type (might be due to invalid IL or missing references)
hookPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Loader/LoaderYankHook.prefab").WaitForCompletion(), "SubmarinerHarpoon");
if (!Object.op_Implicit((Object)(object)hookPrefab.GetComponent<NetworkIdentity>()))
{
hookPrefab.AddComponent<NetworkIdentity>();
}
ProjectileGrappleController component = hookPrefab.GetComponent<ProjectileGrappleController>();
component.ownerHookStateType = new SerializableEntityStateType(typeof(HarpoonShot));
component.maxTravelDistance = 120f;
component.lookAcceleration = 0f;
component.moveAcceleration = 0f;
component.muzzleStringOnBody = "HandL";
component.minHookDistancePitchModifier = 0f;
component.maxHookDistancePitchModifier = 60f;
component.nearBreakDistance = 0f;
((Renderer)((Component)hookPrefab.transform.Find("FistMesh")).gameObject.GetComponent<MeshRenderer>()).materials = (Material[])(object)new Material[1];
((Renderer)((Component)hookPrefab.transform.Find("FistMesh")).gameObject.GetComponent<MeshRenderer>()).materials[0] = anchorMat;
((Component)hookPrefab.transform.Find("FistMesh")).gameObject.GetComponent<MeshFilter>().mesh = mainAssetBundle.LoadAsset<Mesh>("meshHarpoonProjectile");
hookPrefab.transform.Find("FistMesh").rotation = new Quaternion(90f, Quaternion.identity.x, Quaternion.identity.z, Quaternion.identity.w);
((Renderer)((Component)hookPrefab.transform.Find("FistMesh").Find("RopeFront")).gameObject.GetComponent<LineRenderer>()).material.SetColor("_TintColor", new Color(0.23921569f, 0.8980392f, 28f / 85f));
Object.Destroy((Object)(object)((Component)hookPrefab.transform.Find("FistMesh").Find("RopeFront").Find("Dust")).gameObject);
Object.Destroy((Object)(object)((Component)hookPrefab.transform.Find("FistMesh").Find("RopeFront").Find("Sparks, Fast")).gameObject);
Object.Destroy((Object)(object)((Component)hookPrefab.transform.Find("FistMesh").Find("RopeFront").Find("Point Light")).gameObject);
Object.Destroy((Object)(object)((Component)hookPrefab.transform.Find("RopeEnd").Find("Dust")).gameObject);
Object.Destroy((Object)(object)((Component)hookPrefab.transform.Find("RopeEnd").Find("Sparks, Fast")).gameObject);
Object.Destroy((Object)(object)((Component)hookPrefab.transform.Find("RopeEnd").Find("Point Light")).gameObject);
hookPrefab.GetComponent<ProjectileStickOnImpact>().ignoreWorld = true;
hookPrefab.GetComponent<ProjectileDamage>().damageType.damageSource = (DamageSource)2;
SubmarinerMod.Modules.Content.AddProjectilePrefab(hookPrefab);
minePrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Engi/EngiMine.prefab").WaitForCompletion(), "SubmarinerMine");
minePrefab.gameObject.GetComponent<ProjectileController>().ghostPrefab = PrefabAPI.InstantiateClone(minePrefab.gameObject.GetComponent<ProjectileController>().ghostPrefab, "SubmarinerMineGhost");
GameObject ghostPrefab = minePrefab.gameObject.GetComponent<ProjectileController>().ghostPrefab;
((Behaviour)ghostPrefab.GetComponent<EngiMineAnimator>()).enabled = false;
mineExplosionPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Engi/EngiMineExplosion.prefab").WaitForCompletion(), "SubmarinerMineExplosion");
mineExplosionPrefab.GetComponent<EffectComponent>().soundName = "Play_acrid_shift_land";
SubmarinerMod.Modules.Content.CreateAndAddEffectDef(mineExplosionPrefab);
ProjectileImpactExplosion val = minePrefab.AddComponent<ProjectileImpactExplosion>();
((ProjectileExplosion)val).blastDamageCoefficient = 1f;
((ProjectileExplosion)val).blastProcCoefficient = 1f;
((ProjectileExplosion)val).blastRadius = 12f;
((ProjectileExplosion)val).canRejectForce = true;
((ProjectileExplosion)val).fireChildren = false;
val.destroyOnEnemy = true;
val.destroyOnWorld = false;
val.impactOnWorld = false;
val.lifetime = 8f;
val.lifetimeAfterImpact = 0.3f;
val.impactEffect = mineExplosionPrefab;
ProjectileDamage component2 = minePrefab.GetComponent<ProjectileDamage>();
component2.damageType.damageSource = (DamageSource)4;
MeshFilter val2 = ((Component)ghostPrefab.transform.Find("mdlEngiMine").Find("EngiMineMesh")).gameObject.AddComponent<MeshFilter>();
val2.mesh = mainAssetBundle.LoadAsset<Mesh>("meshMine");
MeshRenderer val3 = ((Component)ghostPrefab.transform.Find("mdlEngiMine").Find("EngiMineMesh")).gameObject.AddComponent<MeshRenderer>();
((Renderer)val3).materials = (Material[])(object)new Material[1];
((Renderer)val3).materials[0] = anchorMat;
((Renderer)val3).material = anchorMat;
Object.DestroyImmediate((Object)(object)((Component)ghostPrefab.transform.Find("mdlEngiMine").Find("EngiMineMesh")).gameObject.GetComponent<SkinnedMeshRenderer>());
((Component)gho