using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using AncientScepter;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.BeetleGuardMonster;
using EntityStates.Commando;
using HG;
using HG.BlendableTypes;
using On.RoR2;
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 ShamanMod.Modules;
using ShamanMod.Modules.Characters;
using ShamanMod.Modules.Survivors;
using ShamanMod.SkillStates;
using ShamanMod.SkillStates.BaseStates;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.Rendering;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("ShamanMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ShamanMod")]
[assembly: AssemblyTitle("ShamanMod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: UnverifiableCode]
public class MenuSoundComponent : MonoBehaviour
{
private uint playID1 = 0u;
private void OnEnable()
{
((MonoBehaviour)this).StartCoroutine(delayedGunSound(5f / 12f, "ShamanLobby2"));
}
private IEnumerator delayedGunSound(float delay, string playedSound)
{
yield return (object)new WaitForSeconds(delay);
if (playedSound == "ShamanLobby2")
{
playID1 = Util.PlaySound(playedSound, ((Component)this).gameObject);
}
}
private void OnDestroy()
{
if (playID1 != 0)
{
AkSoundEngine.StopPlayingID(playID1);
}
}
}
namespace ShamanMod
{
internal static class Log
{
internal static ManualLogSource _logSource;
internal static void Init(ManualLogSource logSource)
{
_logSource = logSource;
}
internal static void Debug(object data)
{
_logSource.LogDebug(data);
}
internal static void Error(object data)
{
_logSource.LogError(data);
}
internal static void Fatal(object data)
{
_logSource.LogFatal(data);
}
internal static void Info(object data)
{
_logSource.LogInfo(data);
}
internal static void Message(object data)
{
_logSource.LogMessage(data);
}
internal static void Warning(object data)
{
_logSource.LogWarning(data);
}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.manti.ShamanMod", "ShamanMod", "1.2.0")]
[R2APISubmoduleDependency(new string[] { "PrefabAPI", "LanguageAPI", "SoundAPI", "UnlockableAPI" })]
public class ShamanPlugin : BaseUnityPlugin
{
public const string MODUID = "com.manti.ShamanMod";
public const string MODNAME = "ShamanMod";
public const string MODVERSION = "1.2.0";
public const string DEVELOPER_PREFIX = "MANTI";
public static ShamanPlugin instance;
private void Awake()
{
instance = this;
Log.Init(((BaseUnityPlugin)this).Logger);
ShamanAssets.Initialize();
Config.ReadConfig();
States.RegisterStates();
Buffs.RegisterBuffs();
Projectiles.RegisterProjectiles();
Tokens.AddTokens();
ItemDisplays.PopulateDisplays();
new ShamanSurvivor().Initialize();
new AcolyteCharacter().Initialize();
new AcolyteBeastCharacter().Initialize();
new AcolyteAngelCharacter().Initialize();
new ContentPacks().Initialize();
Hook();
}
private void Hook()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: 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
CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats);
CharacterBody.FixedUpdate += new hook_FixedUpdate(CharacterBody_FixedUpdate);
CharacterBody.Start += new hook_Start(CharacterBody_Start);
}
private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self)
{
orig.Invoke(self);
if (Object.op_Implicit((Object)(object)self))
{
if (self.HasBuff(Buffs.armorBuff))
{
self.armor += 100f;
}
if (self.HasBuff(Buffs.acolyteBeastSummonBuff))
{
self.armor += 10f;
self.baseDamage += 2f;
self.baseMaxHealth += 50f;
}
if (self.HasBuff(Buffs.acolyteFrenzyBuff))
{
self.attackSpeed *= 2f;
self.moveSpeed *= 2f;
self.damage *= 1.5f;
}
}
}
private void CharacterBody_FixedUpdate(orig_FixedUpdate orig, CharacterBody self)
{
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: Expected O, but got Unknown
//IL_0089: 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_00b7: 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_00ff: Unknown result type (might be due to invalid IL or missing references)
//IL_0104: Unknown result type (might be due to invalid IL or missing references)
//IL_0109: 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_010f: Unknown result type (might be due to invalid IL or missing references)
orig.Invoke(self);
if (Object.op_Implicit((Object)(object)self) && !(self.baseNameToken != "MANTI_SHAMAN_BODY_NAME") && !self.HasBuff(Buffs.summonCooldownDebuff) && NetworkServer.active)
{
MasterSummon val = new MasterSummon();
val.masterPrefab = AcolyteCharacter.masterPrefab;
if (self.isPlayerControlled)
{
val.inventoryToCopy = self.inventory;
}
val.teamIndexOverride = self.teamComponent.teamIndex;
val.summonerBodyObject = ((Component)self).gameObject;
val.rotation = ((Component)self).gameObject.transform.rotation;
Vector3 position = ((Component)self).gameObject.transform.position + new Vector3(Random.value * 6f - 3f, 0.1f + Random.value * 0.25f, Random.value * 6f - 3f);
val.position = position;
val.Perform();
float num = Mathf.Clamp(45f - (self.attackSpeed - 1f) * 10f, 15f, 60f);
self.AddTimedBuff(Buffs.summonCooldownDebuff, num);
}
}
private void CharacterBody_Start(orig_Start orig, CharacterBody self)
{
orig.Invoke(self);
if (Object.op_Implicit((Object)(object)self) && NetworkServer.active && !(self.baseNameToken != "MANTI_SHAMAN_BODY_NAME"))
{
self.AddTimedBuff(Buffs.summonCooldownDebuff, 5f);
}
}
}
}
namespace ShamanMod.SkillStates
{
public class AcolyteAngelCurseShoot : GenericProjectileBaseState
{
public static float BaseDuration = 0.15f;
public static float DamageCoefficient = 0.75f;
public override void OnEnter()
{
base.projectilePrefab = Projectiles.curseSkullPrefab;
base.effectPrefab = ShamanAssets.staffCastEffect;
base.targetMuzzle = "Root";
base.attackSoundString = "ShamanCurseSkullFire";
base.baseDuration = BaseDuration;
base.duration = BaseDuration / ((BaseState)this).attackSpeedStat;
((EntityState)this).characterBody.SetAimTimer(2f);
base.damageCoefficient = DamageCoefficient;
base.force = 80f;
base.projectilePitchBonus = 0f;
base.minSpread = 0f;
base.maxSpread = 20f;
base.recoilAmplitude = 0.1f;
base.bloom = 10f;
((GenericProjectileBaseState)this).OnEnter();
}
public override void FixedUpdate()
{
((GenericProjectileBaseState)this).FixedUpdate();
}
public override InterruptPriority GetMinimumInterruptPriority()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (InterruptPriority)2;
}
public override void PlayAnimation(float duration)
{
if (!Object.op_Implicit((Object)(object)((EntityState)this).GetModelAnimator()))
{
}
}
}
public class AcolyteAngelProjectileAttack : GenericProjectileBaseState
{
public static float BaseDuration = 0.07f;
public static float DamageCoefficient = 0.75f;
public override void OnEnter()
{
base.projectilePrefab = Projectiles.staffCastPrefab;
base.effectPrefab = ShamanAssets.staffCastEffect;
base.targetMuzzle = "Root";
base.attackSoundString = "ShamanAcolyteAngelProjectileShoot";
base.baseDuration = BaseDuration;
base.duration = BaseDuration / ((BaseState)this).attackSpeedStat;
((EntityState)this).characterBody.SetAimTimer(2f);
base.damageCoefficient = DamageCoefficient;
base.force = 80f;
base.projectilePitchBonus = 0f;
base.minSpread = 0f;
base.maxSpread = 12f;
base.recoilAmplitude = 0.1f;
base.bloom = 10f;
((GenericProjectileBaseState)this).OnEnter();
}
public override void FixedUpdate()
{
((GenericProjectileBaseState)this).FixedUpdate();
}
public override InterruptPriority GetMinimumInterruptPriority()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (InterruptPriority)2;
}
public override void PlayAnimation(float duration)
{
if (!Object.op_Implicit((Object)(object)((EntityState)this).GetModelAnimator()))
{
}
}
}
public class AcolyteAngelShootAttack : BaseSkillState
{
public static float damageCoefficient = 1.25f;
public static float procCoefficient = 1f;
public static float baseDuration = 0.15f;
public static float force = 800f;
public static float recoil = 5f;
public static float range = 128f;
public static GameObject tracerEffectPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/Tracers/TracerEngiTurret");
private float duration;
private float fireTime;
private bool hasFired;
private string muzzleString;
public override void OnEnter()
{
((BaseState)this).OnEnter();
duration = baseDuration / ((BaseState)this).attackSpeedStat;
fireTime = 0f;
((EntityState)this).characterBody.SetAimTimer(2f);
muzzleString = "Root";
}
public override void OnExit()
{
((EntityState)this).OnExit();
}
private void Fire()
{
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: Unknown result type (might be due to invalid IL or missing references)
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
//IL_0105: Unknown result type (might be due to invalid IL or missing references)
//IL_0106: Unknown result type (might be due to invalid IL or missing references)
//IL_010b: Unknown result type (might be due to invalid IL or missing references)
//IL_0110: Unknown result type (might be due to invalid IL or missing references)
//IL_011b: Unknown result type (might be due to invalid IL or missing references)
//IL_0126: Unknown result type (might be due to invalid IL or missing references)
//IL_0132: Unknown result type (might be due to invalid IL or missing references)
//IL_013e: Unknown result type (might be due to invalid IL or missing references)
//IL_014a: 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)
//IL_0157: 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_0168: Unknown result type (might be due to invalid IL or missing references)
//IL_0173: Unknown result type (might be due to invalid IL or missing references)
//IL_017a: Unknown result type (might be due to invalid IL or missing references)
//IL_017b: Unknown result type (might be due to invalid IL or missing references)
//IL_0180: Unknown result type (might be due to invalid IL or missing references)
//IL_0185: Unknown result type (might be due to invalid IL or missing references)
//IL_018c: Unknown result type (might be due to invalid IL or missing references)
//IL_0197: Unknown result type (might be due to invalid IL or missing references)
//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
//IL_01af: Unknown result type (might be due to invalid IL or missing references)
//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
if (!hasFired)
{
hasFired = true;
((EntityState)this).characterBody.AddSpreadBloom(1.5f);
EffectManager.SimpleMuzzleFlash(ShamanAssets.staffCastEffect, ((EntityState)this).gameObject, muzzleString, false);
Util.PlaySound("ShamanAcolyteAngelShoot", ((EntityState)this).gameObject);
if (((EntityState)this).isAuthority)
{
Ray aimRay = ((BaseState)this).GetAimRay();
((BaseState)this).AddRecoil(-1f * DistortedFusion.recoil, -2f * DistortedFusion.recoil, -0.5f * DistortedFusion.recoil, 0.5f * DistortedFusion.recoil);
new BulletAttack
{
bulletCount = 5u,
aimVector = ((Ray)(ref aimRay)).direction,
origin = ((Ray)(ref aimRay)).origin,
damage = damageCoefficient * ((BaseState)this).damageStat,
damageColorIndex = (DamageColorIndex)0,
damageType = DamageTypeCombo.op_Implicit((DamageType)0),
falloffModel = (FalloffModel)1,
maxDistance = range,
force = force,
hitMask = CommonMasks.bullet,
minSpread = 0f,
maxSpread = 25f,
isCrit = ((BaseState)this).RollCrit(),
owner = ((EntityState)this).gameObject,
muzzleName = muzzleString,
smartCollision = false,
procChainMask = default(ProcChainMask),
procCoefficient = procCoefficient,
radius = 0.75f,
sniper = false,
stopperMask = CommonMasks.bullet,
weapon = null,
tracerEffectPrefab = tracerEffectPrefab,
spreadPitchScale = 1f,
spreadYawScale = 1f,
queryTriggerInteraction = (QueryTriggerInteraction)0,
hitEffectPrefab = ShamanAssets.magicImpact2Effect
}.Fire();
}
}
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
if (((EntityState)this).fixedAge >= fireTime)
{
Fire();
}
if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
public override InterruptPriority GetMinimumInterruptPriority()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (InterruptPriority)2;
}
}
public class AcolyteBeastMeleeSlam : BaseMeleeAttack
{
public override void OnEnter()
{
//IL_000f: 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_003b: Unknown result type (might be due to invalid IL or missing references)
hitboxName = "Slam";
damageType = (DamageType)32;
damageCoefficient = 7f;
procCoefficient = 1f;
pushForce = 1200f;
bonusForce = Vector3.zero;
baseDuration = 3f;
attackStartTime = 0.45f;
attackEndTime = 0.6f;
baseEarlyExitTime = 0.8f;
hitStopDuration = 0.012f;
attackRecoil = 3f;
hitHopVelocity = 12f;
swingSoundString = "ShamanAcolyteBeastSlam";
hitSoundString = "";
muzzleString = "SlamHitbox";
swingEffectPrefab = GroundSlam.slamEffectPrefab;
hitEffectPrefab = null;
Util.PlaySound("ShamanAcolyteBeastAttack", ((EntityState)this).gameObject);
base.OnEnter();
}
protected override void PlayAttackAnimation()
{
((EntityState)this).PlayCrossfade("Gesture, Override", "Slam", "Slam.playbackRate", duration, 0.05f);
}
protected override void PlaySwingEffect()
{
base.PlaySwingEffect();
}
protected override void OnHitEnemyAuthority()
{
base.OnHitEnemyAuthority();
}
public override void OnExit()
{
base.OnExit();
}
}
public class AcolyteBeastMeleeSwipe : BaseMeleeAttack
{
public override void OnEnter()
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
hitboxName = "Slash";
damageType = (DamageType)0;
damageCoefficient = 3.8f;
procCoefficient = 1f;
pushForce = 300f;
bonusForce = Vector3.zero;
baseDuration = 1.5f;
attackStartTime = 0.4f;
attackEndTime = 0.7f;
baseEarlyExitTime = 0.8f;
hitStopDuration = 0.012f;
attackRecoil = 0.5f;
hitHopVelocity = 4f;
swingSoundString = "ShamanAcolyteBeastSwipe";
hitSoundString = "";
muzzleString = "SlashHitbox";
swingEffectPrefab = ShamanAssets.acolyteBeastSwingEffect;
hitEffectPrefab = ShamanAssets.magicImpactEffect;
Util.PlaySound("ShamanAcolyteBeastAttack", ((EntityState)this).gameObject);
base.OnEnter();
}
protected override void PlayAttackAnimation()
{
((EntityState)this).PlayCrossfade("Gesture, Override", "Slash", "Slash.playbackRate", duration, 0.05f);
}
protected override void PlaySwingEffect()
{
base.PlaySwingEffect();
}
protected override void OnHitEnemyAuthority()
{
base.OnHitEnemyAuthority();
}
public override void OnExit()
{
base.OnExit();
}
}
public class AcolyteBeastShootAttack : BaseSkillState
{
public static float damageCoefficient = 1.25f;
public static float procCoefficient = 1f;
public static float baseDuration = 0.5f;
public static float force = 800f;
public static float recoil = 5f;
public static float range = 128f;
public static GameObject tracerEffectPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/Tracers/TracerEngiTurret");
private float duration;
private float fireTime;
private bool hasFired;
private string muzzleString;
public override void OnEnter()
{
((BaseState)this).OnEnter();
duration = baseDuration / ((BaseState)this).attackSpeedStat;
fireTime = 0f;
((EntityState)this).characterBody.SetAimTimer(2f);
muzzleString = "Muzzle";
}
public override void OnExit()
{
((EntityState)this).OnExit();
}
private void Fire()
{
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: Unknown result type (might be due to invalid IL or missing references)
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
//IL_0105: Unknown result type (might be due to invalid IL or missing references)
//IL_0106: Unknown result type (might be due to invalid IL or missing references)
//IL_010b: Unknown result type (might be due to invalid IL or missing references)
//IL_0110: Unknown result type (might be due to invalid IL or missing references)
//IL_011b: Unknown result type (might be due to invalid IL or missing references)
//IL_0126: Unknown result type (might be due to invalid IL or missing references)
//IL_0132: Unknown result type (might be due to invalid IL or missing references)
//IL_013e: Unknown result type (might be due to invalid IL or missing references)
//IL_014a: 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)
//IL_0157: 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_0168: Unknown result type (might be due to invalid IL or missing references)
//IL_0173: Unknown result type (might be due to invalid IL or missing references)
//IL_017a: Unknown result type (might be due to invalid IL or missing references)
//IL_017b: Unknown result type (might be due to invalid IL or missing references)
//IL_0180: Unknown result type (might be due to invalid IL or missing references)
//IL_0185: Unknown result type (might be due to invalid IL or missing references)
//IL_018c: Unknown result type (might be due to invalid IL or missing references)
//IL_0197: Unknown result type (might be due to invalid IL or missing references)
//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
//IL_01af: Unknown result type (might be due to invalid IL or missing references)
//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
if (!hasFired)
{
hasFired = true;
((EntityState)this).characterBody.AddSpreadBloom(1.5f);
EffectManager.SimpleMuzzleFlash(ShamanAssets.staffCastEffect, ((EntityState)this).gameObject, muzzleString, false);
Util.PlaySound("ShamanAcolyteBeastShoot", ((EntityState)this).gameObject);
if (((EntityState)this).isAuthority)
{
Ray aimRay = ((BaseState)this).GetAimRay();
((BaseState)this).AddRecoil(-1f * DistortedFusion.recoil, -2f * DistortedFusion.recoil, -0.5f * DistortedFusion.recoil, 0.5f * DistortedFusion.recoil);
new BulletAttack
{
bulletCount = 3u,
aimVector = ((Ray)(ref aimRay)).direction,
origin = ((Ray)(ref aimRay)).origin,
damage = damageCoefficient * ((BaseState)this).damageStat,
damageColorIndex = (DamageColorIndex)0,
damageType = DamageTypeCombo.op_Implicit((DamageType)0),
falloffModel = (FalloffModel)1,
maxDistance = range,
force = force,
hitMask = CommonMasks.bullet,
minSpread = 0f,
maxSpread = 5f,
isCrit = ((BaseState)this).RollCrit(),
owner = ((EntityState)this).gameObject,
muzzleName = muzzleString,
smartCollision = false,
procChainMask = default(ProcChainMask),
procCoefficient = procCoefficient,
radius = 0.75f,
sniper = false,
stopperMask = CommonMasks.bullet,
weapon = null,
tracerEffectPrefab = tracerEffectPrefab,
spreadPitchScale = 0.25f,
spreadYawScale = 1f,
queryTriggerInteraction = (QueryTriggerInteraction)0,
hitEffectPrefab = ShamanAssets.magicImpact2Effect
}.Fire();
}
}
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
if (((EntityState)this).fixedAge >= fireTime)
{
Fire();
}
if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
public override InterruptPriority GetMinimumInterruptPriority()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (InterruptPriority)2;
}
}
public class AcolyteMeleeAttack : BaseMeleeAttack
{
public override void OnEnter()
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
hitboxName = "Melee";
damageType = (DamageType)0;
damageCoefficient = 3f;
procCoefficient = 1f;
pushForce = 300f;
bonusForce = Vector3.zero;
baseDuration = 1f;
attackStartTime = 0.2f;
attackEndTime = 0.4f;
baseEarlyExitTime = 0.4f;
hitStopDuration = 0.012f;
attackRecoil = 0.5f;
hitHopVelocity = 4f;
swingSoundString = "ShamanAcolyteSwing";
hitSoundString = "";
muzzleString = "MeleeHitbox";
swingEffectPrefab = ShamanAssets.acolyteSwingEffect;
hitEffectPrefab = ShamanAssets.magicImpactEffect;
base.OnEnter();
}
protected override void PlayAttackAnimation()
{
((EntityState)this).PlayCrossfade("Gesture, Override", "Slash", "Slash.playbackRate", duration, 0.05f);
}
protected override void PlaySwingEffect()
{
base.PlaySwingEffect();
}
protected override void OnHitEnemyAuthority()
{
base.OnHitEnemyAuthority();
}
public override void OnExit()
{
base.OnExit();
}
}
public class AcolyteShootAttack : BaseSkillState
{
public static float damageCoefficient = 1f;
public static float procCoefficient = 1f;
public static float baseDuration = 0.4f;
public static float force = 800f;
public static float recoil = 5f;
public static float range = 128f;
public static GameObject tracerEffectPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/Tracers/TracerEngiTurret");
private float duration;
private float fireTime;
private bool hasFired;
private string muzzleString;
public override void OnEnter()
{
((BaseState)this).OnEnter();
duration = baseDuration / ((BaseState)this).attackSpeedStat;
fireTime = 0f;
((EntityState)this).characterBody.SetAimTimer(2f);
muzzleString = "Muzzle";
}
public override void OnExit()
{
((EntityState)this).OnExit();
}
private void Fire()
{
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: Unknown result type (might be due to invalid IL or missing references)
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
//IL_0105: Unknown result type (might be due to invalid IL or missing references)
//IL_0106: Unknown result type (might be due to invalid IL or missing references)
//IL_010b: Unknown result type (might be due to invalid IL or missing references)
//IL_0110: Unknown result type (might be due to invalid IL or missing references)
//IL_011b: Unknown result type (might be due to invalid IL or missing references)
//IL_0126: Unknown result type (might be due to invalid IL or missing references)
//IL_0132: Unknown result type (might be due to invalid IL or missing references)
//IL_013e: Unknown result type (might be due to invalid IL or missing references)
//IL_014a: 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)
//IL_0157: 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_0168: Unknown result type (might be due to invalid IL or missing references)
//IL_0173: Unknown result type (might be due to invalid IL or missing references)
//IL_017a: Unknown result type (might be due to invalid IL or missing references)
//IL_017b: Unknown result type (might be due to invalid IL or missing references)
//IL_0180: Unknown result type (might be due to invalid IL or missing references)
//IL_0185: Unknown result type (might be due to invalid IL or missing references)
//IL_018c: Unknown result type (might be due to invalid IL or missing references)
//IL_0197: Unknown result type (might be due to invalid IL or missing references)
//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
//IL_01af: Unknown result type (might be due to invalid IL or missing references)
//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
if (!hasFired)
{
hasFired = true;
((EntityState)this).characterBody.AddSpreadBloom(1.5f);
EffectManager.SimpleMuzzleFlash(ShamanAssets.staffCastEffect, ((EntityState)this).gameObject, muzzleString, false);
Util.PlaySound("ShamanAcolyteShoot", ((EntityState)this).gameObject);
if (((EntityState)this).isAuthority)
{
Ray aimRay = ((BaseState)this).GetAimRay();
((BaseState)this).AddRecoil(-1f * DistortedFusion.recoil, -2f * DistortedFusion.recoil, -0.5f * DistortedFusion.recoil, 0.5f * DistortedFusion.recoil);
new BulletAttack
{
bulletCount = 1u,
aimVector = ((Ray)(ref aimRay)).direction,
origin = ((Ray)(ref aimRay)).origin,
damage = damageCoefficient * ((BaseState)this).damageStat,
damageColorIndex = (DamageColorIndex)0,
damageType = DamageTypeCombo.op_Implicit((DamageType)0),
falloffModel = (FalloffModel)1,
maxDistance = range,
force = force,
hitMask = CommonMasks.bullet,
minSpread = 0f,
maxSpread = 0f,
isCrit = ((BaseState)this).RollCrit(),
owner = ((EntityState)this).gameObject,
muzzleName = muzzleString,
smartCollision = false,
procChainMask = default(ProcChainMask),
procCoefficient = procCoefficient,
radius = 0.75f,
sniper = false,
stopperMask = CommonMasks.bullet,
weapon = null,
tracerEffectPrefab = tracerEffectPrefab,
spreadPitchScale = 0f,
spreadYawScale = 0f,
queryTriggerInteraction = (QueryTriggerInteraction)0,
hitEffectPrefab = ShamanAssets.magicImpact2Effect
}.Fire();
}
}
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
if (((EntityState)this).fixedAge >= fireTime)
{
Fire();
}
if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
public override InterruptPriority GetMinimumInterruptPriority()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (InterruptPriority)2;
}
}
public class Ancestry : BaseSkillState
{
public static float duration = 1f;
public override void OnEnter()
{
//IL_0114: Unknown result type (might be due to invalid IL or missing references)
//IL_0124: Unknown result type (might be due to invalid IL or missing references)
//IL_0222: Unknown result type (might be due to invalid IL or missing references)
//IL_0227: Unknown result type (might be due to invalid IL or missing references)
//IL_0195: Unknown result type (might be due to invalid IL or missing references)
//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
//IL_01da: Unknown result type (might be due to invalid IL or missing references)
((BaseState)this).OnEnter();
Util.PlaySound("ShamanTeleportCast", ((EntityState)this).gameObject);
EffectManager.SimpleMuzzleFlash(ShamanAssets.magicImpact2Effect, ((EntityState)this).gameObject, "Muzzle", false);
Object[] array = Resources.FindObjectsOfTypeAll(typeof(CharacterBody));
CharacterBody[] array2 = array as CharacterBody[];
foreach (CharacterBody val in array2)
{
if (!((Object)(object)val == (Object)null) && !((Object)(object)((Component)val).gameObject == (Object)null) && !((Object)(object)((Component)val).gameObject.GetComponent<TeamComponent>() == (Object)null) && !((Object)(object)((EntityState)this).gameObject.GetComponent<TeamComponent>() == (Object)null) && !((Object)(object)val.master == (Object)null) && !((Object)(object)val.master.minionOwnership == (Object)null) && !((Object)(object)val.master.minionOwnership.ownerMaster == (Object)null) && ((Component)val).gameObject.GetComponent<TeamComponent>().teamIndex == ((EntityState)this).gameObject.GetComponent<TeamComponent>().teamIndex && (Object)(object)val != (Object)(object)((EntityState)this).characterBody && Object.op_Implicit((Object)(object)val.master) && (Object)(object)val.master.minionOwnership.ownerMaster.GetBody() == (Object)(object)((EntityState)this).characterBody)
{
if (NetworkServer.active)
{
Vector3 val2 = ((EntityState)this).gameObject.transform.position + new Vector3(Random.value * 4f - 2f, 0.1f + Random.value * 1f, Random.value * 4f - 2f);
TeleportHelper.TeleportBody(val, val2);
}
HealthComponent healthComponent = val.healthComponent;
healthComponent.barrier += val.maxHealth * 0.6f;
Util.PlaySound("ShamanAncestralTeleport", ((Component)val).gameObject);
EffectManager.SimpleImpactEffect(ShamanAssets.acolyteSummonEffect, ((EntityState)this).gameObject.transform.position, Vector3.up, true);
}
}
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
public override void OnExit()
{
((EntityState)this).OnExit();
}
public override void OnSerialize(NetworkWriter writer)
{
((BaseSkillState)this).OnSerialize(writer);
}
public override void OnDeserialize(NetworkReader reader)
{
((BaseSkillState)this).OnDeserialize(reader);
}
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 DistortedFusion : BaseSkillState
{
public static float damageCoefficient = 3f;
public static float procCoefficient = 1f;
public static float baseDuration = 4f;
public static float force = 800f;
public static float recoil = 3f;
public static float range = 256f;
private float duration;
private float fireTime;
private bool hasFired;
private string muzzleString;
private int noSacrificed = 0;
public override void OnEnter()
{
//IL_0114: Unknown result type (might be due to invalid IL or missing references)
//IL_0124: Unknown result type (might be due to invalid IL or missing references)
Object[] array = Resources.FindObjectsOfTypeAll(typeof(CharacterBody));
fireTime = 3.25f;
muzzleString = "Muzzle";
noSacrificed = 0;
CharacterBody[] array2 = array as CharacterBody[];
foreach (CharacterBody val in array2)
{
if (!((Object)(object)val == (Object)null) && !((Object)(object)((Component)val).gameObject == (Object)null) && !((Object)(object)((Component)val).gameObject.GetComponent<TeamComponent>() == (Object)null) && !((Object)(object)((EntityState)this).gameObject.GetComponent<TeamComponent>() == (Object)null) && !((Object)(object)val.master == (Object)null) && !((Object)(object)val.master.minionOwnership == (Object)null) && !((Object)(object)val.master.minionOwnership.ownerMaster == (Object)null) && val.baseNameToken == "MANTI_ACOLYTE_BODY_NAME" && ((Component)val).gameObject.GetComponent<TeamComponent>().teamIndex == ((EntityState)this).gameObject.GetComponent<TeamComponent>().teamIndex && Object.op_Implicit((Object)(object)val.master) && (Object)(object)val.master.minionOwnership.ownerMaster.GetBody() == (Object)(object)((EntityState)this).characterBody)
{
noSacrificed++;
}
}
if (noSacrificed < 3)
{
Util.PlaySound("ShamanCastFusionFail", ((EntityState)this).gameObject);
EffectManager.SimpleMuzzleFlash(ShamanAssets.magicImpact2Effect, ((EntityState)this).gameObject, muzzleString, false);
duration = 0.25f;
return;
}
((BaseState)this).OnEnter();
Util.PlaySound("ShamanCastFusion", ((EntityState)this).gameObject);
EffectManager.SimpleMuzzleFlash(ShamanAssets.castFusionEffect, ((EntityState)this).gameObject, muzzleString, false);
duration = 4f;
((EntityState)this).characterBody.SetAimTimer(5f);
if (NetworkServer.active)
{
((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, 4f);
}
((EntityState)this).PlayAnimation("FullBody, Override", "FusionCast", "ShootGun.playbackRate", 1f, 0f);
}
private void Fire()
{
//IL_01e2: 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_01fb: Unknown result type (might be due to invalid IL or missing references)
//IL_020b: Unknown result type (might be due to invalid IL or missing references)
//IL_0215: 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)
//IL_0133: Unknown result type (might be due to invalid IL or missing references)
//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
if (hasFired || noSacrificed <= 2)
{
return;
}
hasFired = true;
Object[] array = Resources.FindObjectsOfTypeAll(typeof(CharacterBody));
CharacterBody[] array2 = array as CharacterBody[];
foreach (CharacterBody val in array2)
{
if (!((Object)(object)val == (Object)null) && !((Object)(object)((Component)val).gameObject == (Object)null) && !((Object)(object)((Component)val).gameObject.GetComponent<TeamComponent>() == (Object)null) && !((Object)(object)((EntityState)this).gameObject.GetComponent<TeamComponent>() == (Object)null) && !((Object)(object)val.master == (Object)null) && !((Object)(object)val.master.minionOwnership == (Object)null) && !((Object)(object)val.master.minionOwnership.ownerMaster == (Object)null) && val.baseNameToken == "MANTI_ACOLYTE_BODY_NAME" && ((Component)val).gameObject.GetComponent<TeamComponent>().teamIndex == ((EntityState)this).gameObject.GetComponent<TeamComponent>().teamIndex && Object.op_Implicit((Object)(object)((Component)val).gameObject.GetComponent<HealthComponent>()) && Object.op_Implicit((Object)(object)val.master) && (Object)(object)val.master.minionOwnership.ownerMaster.GetBody() == (Object)(object)((EntityState)this).characterBody)
{
((Component)val).gameObject.GetComponent<HealthComponent>().Suicide((GameObject)null, (GameObject)null, default(DamageTypeCombo));
}
}
if (NetworkServer.active)
{
((EntityState)this).characterBody.SendConstructTurret(((EntityState)this).characterBody, ((EntityState)this).gameObject.transform.position + new Vector3(0f, 10f, 0f), ((EntityState)this).gameObject.transform.rotation, MasterCatalog.FindMasterIndex(AcolyteBeastCharacter.masterPrefab));
}
Util.PlaySound("ShamanSummonAcolyteBeast", ((EntityState)this).gameObject);
}
public override void OnExit()
{
//IL_00fe: 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_017e: Unknown result type (might be due to invalid IL or missing references)
//IL_0184: Unknown result type (might be due to invalid IL or missing references)
((EntityState)this).OnExit();
Object[] array = Resources.FindObjectsOfTypeAll(typeof(CharacterBody));
CharacterBody[] array2 = array as CharacterBody[];
foreach (CharacterBody val in array2)
{
if (!((Object)(object)val == (Object)null) && !((Object)(object)((Component)val).gameObject == (Object)null) && !((Object)(object)((Component)val).gameObject.GetComponent<TeamComponent>() == (Object)null) && !((Object)(object)((EntityState)this).gameObject.GetComponent<TeamComponent>() == (Object)null) && !((Object)(object)val.master == (Object)null) && !((Object)(object)val.master.minionOwnership == (Object)null) && !((Object)(object)val.master.minionOwnership.ownerMaster == (Object)null) && val.baseNameToken == "MANTI_ACOLYTEBEAST_BODY_NAME" && ((Component)val).gameObject.GetComponent<TeamComponent>().teamIndex == ((EntityState)this).gameObject.GetComponent<TeamComponent>().teamIndex && NetworkServer.active && Object.op_Implicit((Object)(object)val.master) && (Object)(object)val.master.minionOwnership.ownerMaster.GetBody() == (Object)(object)((EntityState)this).characterBody && noSacrificed >= 3)
{
val.healthComponent.HealFraction(1f, default(ProcChainMask));
for (int j = 0; j < noSacrificed - 2; j++)
{
val.AddTimedBuff(Buffs.acolyteBeastSummonBuff, 480f);
}
break;
}
}
noSacrificed = 0;
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
if (((EntityState)this).fixedAge >= fireTime)
{
Fire();
}
if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
public override InterruptPriority GetMinimumInterruptPriority()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (InterruptPriority)1;
}
}
public class DistortedFusionScepter : BaseSkillState
{
public static float damageCoefficient = 3f;
public static float procCoefficient = 1f;
public static float baseDuration = 4f;
public static float force = 800f;
public static float recoil = 3f;
public static float range = 256f;
private float duration;
private float fireTime;
private bool hasFired;
private string muzzleString;
private int noSacrificed = 0;
public override void OnEnter()
{
//IL_0114: Unknown result type (might be due to invalid IL or missing references)
//IL_0124: Unknown result type (might be due to invalid IL or missing references)
Object[] array = Resources.FindObjectsOfTypeAll(typeof(CharacterBody));
fireTime = 3.25f;
muzzleString = "Muzzle";
noSacrificed = 0;
CharacterBody[] array2 = array as CharacterBody[];
foreach (CharacterBody val in array2)
{
if (!((Object)(object)val == (Object)null) && !((Object)(object)((Component)val).gameObject == (Object)null) && !((Object)(object)((Component)val).gameObject.GetComponent<TeamComponent>() == (Object)null) && !((Object)(object)((EntityState)this).gameObject.GetComponent<TeamComponent>() == (Object)null) && !((Object)(object)val.master == (Object)null) && !((Object)(object)val.master.minionOwnership == (Object)null) && !((Object)(object)val.master.minionOwnership.ownerMaster == (Object)null) && val.baseNameToken == "MANTI_ACOLYTE_BODY_NAME" && ((Component)val).gameObject.GetComponent<TeamComponent>().teamIndex == ((EntityState)this).gameObject.GetComponent<TeamComponent>().teamIndex && Object.op_Implicit((Object)(object)val.master) && (Object)(object)val.master.minionOwnership.ownerMaster.GetBody() == (Object)(object)((EntityState)this).characterBody)
{
noSacrificed++;
}
}
if (noSacrificed < 6)
{
Util.PlaySound("ShamanCastFusionFail", ((EntityState)this).gameObject);
EffectManager.SimpleMuzzleFlash(ShamanAssets.magicImpact2Effect, ((EntityState)this).gameObject, muzzleString, false);
duration = 0.25f;
return;
}
((BaseState)this).OnEnter();
Util.PlaySound("ShamanAcolyteAngelFuse", ((EntityState)this).gameObject);
EffectManager.SimpleMuzzleFlash(ShamanAssets.castFusionEffect, ((EntityState)this).gameObject, muzzleString, false);
duration = 4f;
((EntityState)this).characterBody.SetAimTimer(5f);
if (NetworkServer.active)
{
((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, 4f);
}
((EntityState)this).PlayAnimation("FullBody, Override", "FusionCast", "ShootGun.playbackRate", 1f, 0f);
}
private void Fire()
{
//IL_01e2: 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_01fb: Unknown result type (might be due to invalid IL or missing references)
//IL_020b: Unknown result type (might be due to invalid IL or missing references)
//IL_0215: 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)
//IL_0133: Unknown result type (might be due to invalid IL or missing references)
//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
if (hasFired || noSacrificed <= 5)
{
return;
}
hasFired = true;
Object[] array = Resources.FindObjectsOfTypeAll(typeof(CharacterBody));
CharacterBody[] array2 = array as CharacterBody[];
foreach (CharacterBody val in array2)
{
if (!((Object)(object)val == (Object)null) && !((Object)(object)((Component)val).gameObject == (Object)null) && !((Object)(object)((Component)val).gameObject.GetComponent<TeamComponent>() == (Object)null) && !((Object)(object)((EntityState)this).gameObject.GetComponent<TeamComponent>() == (Object)null) && !((Object)(object)val.master == (Object)null) && !((Object)(object)val.master.minionOwnership == (Object)null) && !((Object)(object)val.master.minionOwnership.ownerMaster == (Object)null) && val.baseNameToken == "MANTI_ACOLYTE_BODY_NAME" && ((Component)val).gameObject.GetComponent<TeamComponent>().teamIndex == ((EntityState)this).gameObject.GetComponent<TeamComponent>().teamIndex && Object.op_Implicit((Object)(object)((Component)val).gameObject.GetComponent<HealthComponent>()) && Object.op_Implicit((Object)(object)val.master) && (Object)(object)val.master.minionOwnership.ownerMaster.GetBody() == (Object)(object)((EntityState)this).characterBody)
{
((Component)val).gameObject.GetComponent<HealthComponent>().Suicide((GameObject)null, (GameObject)null, default(DamageTypeCombo));
}
}
if (NetworkServer.active)
{
((EntityState)this).characterBody.SendConstructTurret(((EntityState)this).characterBody, ((EntityState)this).gameObject.transform.position + new Vector3(0f, 20f, 0f), ((EntityState)this).gameObject.transform.rotation, MasterCatalog.FindMasterIndex(AcolyteAngelCharacter.masterPrefab));
}
Util.PlaySound("ShamanSummonAcolyteAngel", ((EntityState)this).gameObject);
Util.PlaySound("ShamanAcolyteAngelBirth", ((EntityState)this).gameObject);
}
public override void OnExit()
{
//IL_00fe: 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_017e: Unknown result type (might be due to invalid IL or missing references)
//IL_0184: Unknown result type (might be due to invalid IL or missing references)
((EntityState)this).OnExit();
Object[] array = Resources.FindObjectsOfTypeAll(typeof(CharacterBody));
CharacterBody[] array2 = array as CharacterBody[];
foreach (CharacterBody val in array2)
{
if (!((Object)(object)val == (Object)null) && !((Object)(object)((Component)val).gameObject == (Object)null) && !((Object)(object)((Component)val).gameObject.GetComponent<TeamComponent>() == (Object)null) && !((Object)(object)((EntityState)this).gameObject.GetComponent<TeamComponent>() == (Object)null) && !((Object)(object)val.master == (Object)null) && !((Object)(object)val.master.minionOwnership == (Object)null) && !((Object)(object)val.master.minionOwnership.ownerMaster == (Object)null) && val.baseNameToken == "MANTI_ACOLYTEANGEL_BODY_NAME" && ((Component)val).gameObject.GetComponent<TeamComponent>().teamIndex == ((EntityState)this).gameObject.GetComponent<TeamComponent>().teamIndex && NetworkServer.active && Object.op_Implicit((Object)(object)val.master) && (Object)(object)val.master.minionOwnership.ownerMaster.GetBody() == (Object)(object)((EntityState)this).characterBody && noSacrificed >= 8)
{
val.healthComponent.HealFraction(1f, default(ProcChainMask));
for (int j = 0; j < noSacrificed - 5; j++)
{
val.AddTimedBuff(Buffs.acolyteBeastSummonBuff, 600f);
}
break;
}
}
noSacrificed = 0;
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
if (((EntityState)this).fixedAge >= fireTime)
{
Fire();
}
if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
public override InterruptPriority GetMinimumInterruptPriority()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (InterruptPriority)1;
}
}
public class FeralCall : BaseSkillState
{
public static float duration = 1f;
public override void OnEnter()
{
//IL_0114: Unknown result type (might be due to invalid IL or missing references)
//IL_0124: Unknown result type (might be due to invalid IL or missing references)
//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
((BaseState)this).OnEnter();
Util.PlaySound("ShamanFrenzyCast", ((EntityState)this).gameObject);
EffectManager.SimpleMuzzleFlash(ShamanAssets.magicImpact2Effect, ((EntityState)this).gameObject, "Muzzle", false);
Object[] array = Resources.FindObjectsOfTypeAll(typeof(CharacterBody));
CharacterBody[] array2 = array as CharacterBody[];
foreach (CharacterBody val in array2)
{
if ((Object)(object)val == (Object)null || (Object)(object)((Component)val).gameObject == (Object)null || (Object)(object)((Component)val).gameObject.GetComponent<TeamComponent>() == (Object)null || (Object)(object)((EntityState)this).gameObject.GetComponent<TeamComponent>() == (Object)null || (Object)(object)val.master == (Object)null || (Object)(object)val.master.minionOwnership == (Object)null || (Object)(object)val.master.minionOwnership.ownerMaster == (Object)null || ((Component)val).gameObject.GetComponent<TeamComponent>().teamIndex != ((EntityState)this).gameObject.GetComponent<TeamComponent>().teamIndex || !((Object)(object)val != (Object)(object)((EntityState)this).characterBody) || !Object.op_Implicit((Object)(object)val.master) || !((Object)(object)val.master.minionOwnership.ownerMaster.GetBody() == (Object)(object)((EntityState)this).characterBody) || !(val.baseNameToken == "MANTI_ACOLYTE_BODY_NAME"))
{
continue;
}
if (NetworkServer.active)
{
for (int j = 0; j < 100; j++)
{
val.AddTimedBuff(Buffs.PermanentCurse, 15f, 100);
}
val.AddTimedBuff(Buffs.acolyteFrenzyBuff, 15f);
}
Util.PlaySound("ShamanAcolyteFrenziedGrowl", ((Component)val).gameObject);
EffectManager.SimpleImpactEffect(ShamanAssets.acolyteSummonEffect, ((Component)val).gameObject.transform.position, Vector3.up, true);
}
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
public override void OnExit()
{
((EntityState)this).OnExit();
}
public override void OnSerialize(NetworkWriter writer)
{
((BaseSkillState)this).OnSerialize(writer);
}
public override void OnDeserialize(NetworkReader reader)
{
((BaseSkillState)this).OnDeserialize(reader);
}
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 FeralCallScepter : BaseSkillState
{
public static float duration = 1f;
public override void OnEnter()
{
//IL_00c0: 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_012c: 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)
((BaseState)this).OnEnter();
Util.PlaySound("ShamanFrenzyCast", ((EntityState)this).gameObject);
EffectManager.SimpleMuzzleFlash(ShamanAssets.magicImpact2Effect, ((EntityState)this).gameObject, "Muzzle", false);
Object[] array = Resources.FindObjectsOfTypeAll(typeof(CharacterBody));
CharacterBody[] array2 = array as CharacterBody[];
foreach (CharacterBody val in array2)
{
if (!((Object)(object)val == (Object)null) && !((Object)(object)((Component)val).gameObject == (Object)null) && !((Object)(object)((Component)val).gameObject.GetComponent<TeamComponent>() == (Object)null) && !((Object)(object)((EntityState)this).gameObject.GetComponent<TeamComponent>() == (Object)null) && ((Component)val).gameObject.GetComponent<TeamComponent>().teamIndex == ((EntityState)this).gameObject.GetComponent<TeamComponent>().teamIndex && (Object)(object)val != (Object)(object)((EntityState)this).characterBody)
{
if (NetworkServer.active)
{
val.AddTimedBuff(Buffs.acolyteFrenzyBuff, 15f);
}
Util.PlaySound("ShamanAcolyteFrenziedGrowl", ((Component)val).gameObject);
EffectManager.SimpleImpactEffect(ShamanAssets.acolyteSummonEffect, ((Component)val).gameObject.transform.position, Vector3.up, true);
}
}
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
if (((EntityState)this).fixedAge >= FeralCall.duration && ((EntityState)this).isAuthority)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
public override void OnExit()
{
((EntityState)this).OnExit();
}
public override void OnSerialize(NetworkWriter writer)
{
((BaseSkillState)this).OnSerialize(writer);
}
public override void OnDeserialize(NetworkReader reader)
{
((BaseSkillState)this).OnDeserialize(reader);
}
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 GhostVeil : BaseSkillState
{
public static float duration = 10f;
public static float initialSpeedCoefficient = 5f;
public static float finalSpeedCoefficient = 2.5f;
public static float dodgeFOV = DodgeState.dodgeFOV;
public override void OnEnter()
{
((BaseState)this).OnEnter();
Util.PlaySound("ShamanGhostEnter", ((EntityState)this).gameObject);
if (NetworkServer.active)
{
((EntityState)this).characterBody.AddTimedBuff(Buffs.armorBuff, 10f);
((EntityState)this).characterBody.AddTimedBuff(Buffs.Cloak, 10f);
((EntityState)this).characterBody.AddTimedBuff(Buffs.CloakSpeed, 10f);
}
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
{
((EntityState)this).outer.SetNextStateToMain();
Util.PlaySound("ShamanGhostExit", ((EntityState)this).gameObject);
}
}
public override void OnExit()
{
((EntityState)this).OnExit();
}
public override void OnSerialize(NetworkWriter writer)
{
((BaseSkillState)this).OnSerialize(writer);
}
public override void OnDeserialize(NetworkReader reader)
{
((BaseSkillState)this).OnDeserialize(reader);
}
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 StaffCast : GenericProjectileBaseState
{
public static float BaseDuration = 0.25f;
public static float DamageCoefficient = 0.75f;
public override void OnEnter()
{
base.projectilePrefab = Projectiles.staffCastPrefab;
base.effectPrefab = ShamanAssets.staffCastEffect;
base.targetMuzzle = "Muzzle";
base.attackSoundString = "ShamanStaffCast";
base.baseDuration = BaseDuration;
base.duration = BaseDuration / ((BaseState)this).attackSpeedStat;
((EntityState)this).characterBody.SetAimTimer(2f);
base.damageCoefficient = DamageCoefficient;
base.force = 80f;
base.projectilePitchBonus = 0f;
base.minSpread = 0f;
base.maxSpread = 2f;
base.recoilAmplitude = 0.1f;
base.bloom = 10f;
((GenericProjectileBaseState)this).OnEnter();
}
public override void FixedUpdate()
{
((GenericProjectileBaseState)this).FixedUpdate();
}
public override InterruptPriority GetMinimumInterruptPriority()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (InterruptPriority)2;
}
public override void PlayAnimation(float duration)
{
if (Object.op_Implicit((Object)(object)((EntityState)this).GetModelAnimator()))
{
((EntityState)this).PlayAnimation("OrbLayer", "OrbShoot", "OrbCast.playbackRate", base.duration, 0f);
}
}
}
public class StaffCurseSkill : GenericProjectileBaseState
{
public static float BaseDuration = 0.75f;
public static float DamageCoefficient = 0.75f;
public override void OnEnter()
{
base.projectilePrefab = Projectiles.curseSkullPrefab;
base.effectPrefab = ShamanAssets.staffCastEffect;
base.targetMuzzle = "Muzzle";
base.attackSoundString = "ShamanCurseSkullFire";
base.baseDuration = BaseDuration;
base.duration = BaseDuration / ((BaseState)this).attackSpeedStat;
((EntityState)this).characterBody.SetAimTimer(2f);
base.damageCoefficient = DamageCoefficient;
base.force = 80f;
base.projectilePitchBonus = 0f;
base.minSpread = 0f;
base.maxSpread = 2f;
base.recoilAmplitude = 0.1f;
base.bloom = 10f;
((GenericProjectileBaseState)this).OnEnter();
}
public override void FixedUpdate()
{
((GenericProjectileBaseState)this).FixedUpdate();
}
public override InterruptPriority GetMinimumInterruptPriority()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (InterruptPriority)2;
}
public override void PlayAnimation(float duration)
{
if (Object.op_Implicit((Object)(object)((EntityState)this).GetModelAnimator()))
{
((EntityState)this).PlayAnimation("Gesture, Override", "AcolyteSummoningSkill", "AcolyteSummoningSkill.playbackRate", base.duration, 0f);
}
}
}
public class StaffHealingSkill : GenericProjectileBaseState
{
public static float BaseDuration = 0.75f;
public static float DamageCoefficient = 0.75f;
public override void OnEnter()
{
base.projectilePrefab = Projectiles.healOrbPrefab;
base.effectPrefab = ShamanAssets.staffCastEffect;
base.targetMuzzle = "Muzzle";
base.attackSoundString = "ShamanHealOrbShoot";
base.baseDuration = BaseDuration;
base.duration = BaseDuration / ((BaseState)this).attackSpeedStat;
((EntityState)this).characterBody.SetAimTimer(2f);
base.damageCoefficient = DamageCoefficient;
base.force = 80f;
base.projectilePitchBonus = 0f;
base.minSpread = 0f;
base.maxSpread = 2f;
base.recoilAmplitude = 0.1f;
base.bloom = 10f;
((GenericProjectileBaseState)this).OnEnter();
}
public override void FixedUpdate()
{
((GenericProjectileBaseState)this).FixedUpdate();
}
public override InterruptPriority GetMinimumInterruptPriority()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (InterruptPriority)2;
}
public override void PlayAnimation(float duration)
{
if (Object.op_Implicit((Object)(object)((EntityState)this).GetModelAnimator()))
{
((EntityState)this).PlayAnimation("Gesture, Override", "AcolyteSummoningSkill", "AcolyteSummoningSkill.playbackRate", base.duration, 0f);
}
}
}
}
namespace ShamanMod.SkillStates.BaseStates
{
public class BaseMeleeAttack : BaseSkillState
{
public int swingIndex;
protected string hitboxName = "Melee";
protected DamageType damageType = (DamageType)0;
protected float damageCoefficient = 3.5f;
protected float procCoefficient = 1f;
protected float pushForce = 300f;
protected Vector3 bonusForce = Vector3.zero;
protected float baseDuration = 1f;
protected float attackStartTime = 0.2f;
protected float attackEndTime = 0.4f;
protected float baseEarlyExitTime = 0.4f;
protected float hitStopDuration = 0.012f;
protected float attackRecoil = 0.75f;
protected float hitHopVelocity = 4f;
protected bool cancelled = false;
protected string swingSoundString = "";
protected string hitSoundString = "";
protected string muzzleString = "MeleeHitbox";
protected GameObject swingEffectPrefab;
protected GameObject hitEffectPrefab;
protected NetworkSoundEventIndex impactSound;
private float earlyExitTime;
public float duration;
private bool hasFired;
private float hitPauseTimer;
private OverlapAttack attack;
protected bool inHitPause;
private bool hasHopped;
protected float stopwatch;
protected Animator animator;
private HitStopCachedState hitStopCachedState;
private Vector3 storedVelocity;
public override void OnEnter()
{
//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
//IL_00b6: Expected O, but got Unknown
//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
//IL_0140: Unknown result type (might be due to invalid IL or missing references)
//IL_0145: Unknown result type (might be due to invalid IL or missing references)
//IL_017f: Unknown result type (might be due to invalid IL or missing references)
//IL_0184: Unknown result type (might be due to invalid IL or missing references)
((BaseState)this).OnEnter();
duration = baseDuration / ((BaseState)this).attackSpeedStat;
earlyExitTime = baseEarlyExitTime / ((BaseState)this).attackSpeedStat;
hasFired = false;
animator = ((EntityState)this).GetModelAnimator();
((BaseState)this).StartAimMode(0.5f + duration, false);
((EntityState)this).characterBody.outOfCombatStopwatch = 0f;
animator.SetBool("attacking", true);
HitBoxGroup hitBoxGroup = null;
Transform modelTransform = ((EntityState)this).GetModelTransform();
if (Object.op_Implicit((Object)(object)modelTransform))
{
hitBoxGroup = Array.Find(((Component)modelTransform).GetComponents<HitBoxGroup>(), (HitBoxGroup element) => element.groupName == hitboxName);
}
PlayAttackAnimation();
attack = new OverlapAttack();
attack.damageType = DamageTypeCombo.op_Implicit(damageType);
attack.attacker = ((EntityState)this).gameObject;
attack.inflictor = ((EntityState)this).gameObject;
attack.teamIndex = ((BaseState)this).GetTeam();
attack.damage = damageCoefficient * ((BaseState)this).damageStat;
attack.procCoefficient = procCoefficient;
attack.hitEffectPrefab = hitEffectPrefab;
attack.forceVector = bonusForce;
attack.pushAwayForce = pushForce;
attack.hitBoxGroup = hitBoxGroup;
attack.isCrit = ((BaseState)this).RollCrit();
attack.impactSound = impactSound;
}
protected virtual void PlayAttackAnimation()
{
((EntityState)this).PlayCrossfade("Gesture, Override", "Slash1", "Slash.playbackRate", duration, 0.05f);
}
public override void OnExit()
{
((EntityState)this).OnExit();
animator.SetBool("attacking", false);
}
protected virtual void PlaySwingEffect()
{
EffectManager.SimpleMuzzleFlash(swingEffectPrefab, ((EntityState)this).gameObject, muzzleString, true);
}
protected virtual void OnHitEnemyAuthority()
{
//IL_007e: Unknown result type (might be due to invalid IL or missing references)
//IL_0083: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: Unknown result type (might be due to invalid IL or missing references)
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
if (!hasHopped)
{
if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded && hitHopVelocity > 0f)
{
((BaseState)this).SmallHop(((EntityState)this).characterMotor, hitHopVelocity);
}
hasHopped = true;
}
if (!inHitPause && hitStopDuration > 0f)
{
storedVelocity = ((EntityState)this).characterMotor.velocity;
hitStopCachedState = ((BaseState)this).CreateHitStopCachedState(((EntityState)this).characterMotor, animator, "Slash.playbackRate");
hitPauseTimer = hitStopDuration / ((BaseState)this).attackSpeedStat;
inHitPause = true;
}
}
private void FireAttack()
{
if (!hasFired)
{
hasFired = true;
Util.PlayAttackSpeedSound(swingSoundString, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat);
if (((EntityState)this).isAuthority)
{
PlaySwingEffect();
((BaseState)this).AddRecoil(-1f * attackRecoil, -2f * attackRecoil, -0.5f * attackRecoil, 0.5f * attackRecoil);
}
}
if (((EntityState)this).isAuthority && attack.Fire((List<HurtBox>)null))
{
OnHitEnemyAuthority();
}
}
protected virtual void SetNextState()
{
int num = ((swingIndex == 0) ? 1 : 0);
((EntityState)this).outer.SetNextState((EntityState)(object)new BaseMeleeAttack
{
swingIndex = num
});
}
public override void FixedUpdate()
{
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
((EntityState)this).FixedUpdate();
hitPauseTimer -= Time.fixedDeltaTime;
if (hitPauseTimer <= 0f && inHitPause)
{
((BaseState)this).ConsumeHitStopCachedState(hitStopCachedState, ((EntityState)this).characterMotor, animator);
inHitPause = false;
((EntityState)this).characterMotor.velocity = storedVelocity;
}
if (!inHitPause)
{
stopwatch += Time.fixedDeltaTime;
}
else
{
if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
{
((EntityState)this).characterMotor.velocity = Vector3.zero;
}
if (Object.op_Implicit((Object)(object)animator))
{
animator.SetFloat("Swing.playbackRate", 0f);
}
}
if (stopwatch >= duration * attackStartTime && stopwatch <= duration * attackEndTime)
{
FireAttack();
}
if (stopwatch >= duration && ((EntityState)this).isAuthority)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
public override InterruptPriority GetMinimumInterruptPriority()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (InterruptPriority)1;
}
public override void OnSerialize(NetworkWriter writer)
{
((BaseSkillState)this).OnSerialize(writer);
writer.Write(swingIndex);
}
public override void OnDeserialize(NetworkReader reader)
{
((BaseSkillState)this).OnDeserialize(reader);
swingIndex = reader.ReadInt32();
}
}
public class BaseTimedSkillState : BaseSkillState
{
public static float TimedBaseDuration;
public static float TimedBaseCastStartTime;
public static float TimedBaseCastEndTime;
protected float duration;
protected float castStartTime;
protected float castEndTime;
protected bool hasFired;
protected bool isFiring;
protected bool hasExited;
protected virtual void InitDurationValues(float baseDuration, float baseCastStartTime, float baseCastEndTime = 1f)
{
TimedBaseDuration = baseDuration;
TimedBaseCastStartTime = baseCastStartTime;
TimedBaseCastEndTime = baseCastEndTime;
duration = TimedBaseDuration / ((BaseState)this).attackSpeedStat;
castStartTime = baseCastStartTime * duration;
castEndTime = baseCastEndTime * duration;
}
protected virtual void OnCastEnter()
{
}
protected virtual void OnCastFixedUpdate()
{
}
protected virtual void OnCastUpdate()
{
}
protected virtual void OnCastExit()
{
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
if (!hasFired && ((EntityState)this).fixedAge > castStartTime)
{
hasFired = true;
OnCastEnter();
}
bool flag = ((EntityState)this).fixedAge >= castStartTime;
bool flag2 = ((EntityState)this).fixedAge >= castEndTime;
isFiring = false;
if ((flag && !flag2) || (flag && flag2 && !hasFired))
{
isFiring = true;
OnCastFixedUpdate();
}
if (flag2 && !hasExited)
{
hasExited = true;
OnCastExit();
}
if (((EntityState)this).fixedAge > duration)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
public override void Update()
{
((EntityState)this).Update();
if (isFiring)
{
OnCastUpdate();
}
}
}
public class ExampleTimedSkillState : BaseTimedSkillState
{
public static float SkillBaseDuration = 1.5f;
public static float SkillStartTime = 0.2f;
public static float SkillEndTime = 0.9f;
public override void OnEnter()
{
((BaseState)this).OnEnter();
InitDurationValues(SkillBaseDuration, SkillStartTime, SkillEndTime);
}
protected override void OnCastEnter()
{
}
protected override void OnCastFixedUpdate()
{
}
protected override void OnCastExit()
{
}
}
public class ExampleDelayedSkillState : BaseTimedSkillState
{
public static float SkillBaseDuration = 1.5f;
public static float SkillStartTime = 0.2f;
public override void OnEnter()
{
((BaseState)this).OnEnter();
InitDurationValues(SkillBaseDuration, SkillStartTime);
}
protected override void OnCastEnter()
{
}
}
}
namespace ShamanMod.Modules
{
public static class Buffs
{
internal static BuffDef armorBuff;
internal static BuffDef summonCooldownDebuff;
internal static BuffDef acolyteBeastSummonBuff;
internal static BuffDef acolyteFrenzyBuff;
internal static void RegisterBuffs()
{
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: 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)
armorBuff = AddNewBuff("ArmorBuff", LegacyResourcesAPI.Load<BuffDef>("BuffDefs/HiddenInvincibility").iconSprite, Color.white, canStack: false, isDebuff: false);
summonCooldownDebuff = AddNewBuff("ShamanSummonCooldownDebuff", ShamanAssets.mainAssetBundle.LoadAsset<Sprite>("texCooldownDebuff"), new Color(2f / 51f, 16f / 51f, 0f), canStack: false, isDebuff: false);
acolyteBeastSummonBuff = AddNewBuff("AcolyteBeastPowerBuff", ShamanAssets.mainAssetBundle.LoadAsset<Sprite>("texCooldownDebuff"), new Color(2f / 51f, 16f / 51f, 0f), canStack: true, isDebuff: false);
acolyteFrenzyBuff = AddNewBuff("AcolyteFrenzyBuff", ShamanAssets.mainAssetBundle.LoadAsset<Sprite>("texFeralBuff"), new Color(0.8f, 0f, 0f), canStack: false, isDebuff: false);
}
internal static BuffDef AddNewBuff(string buffName, Sprite buffIcon, Color buffColor, bool canStack, bool isDebuff)
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
BuffDef val = ScriptableObject.CreateInstance<BuffDef>();
((Object)val).name = buffName;
val.buffColor = buffColor;
val.canStack = canStack;
val.isDebuff = isDebuff;
val.eliteDef = null;
val.iconSprite = buffIcon;
Content.AddBuffDef(val);
return val;
}
}
public class Compat
{
public static bool TinkersSatchelInstalled;
public static bool AetheriumInstalled;
public static bool ScepterInstalled;
public static void Initialize()
{
if (Chainloader.PluginInfos.ContainsKey("com.ThinkInvisible.TinkersSatchel"))
{
TinkersSatchelInstalled = true;
}
if (Chainloader.PluginInfos.ContainsKey("com.KomradeSpectre.Aetherium"))
{
AetheriumInstalled = true;
}
if (Chainloader.PluginInfos.ContainsKey("com.DestroyedClone.AncientScepter"))
{
ScepterInstalled = true;
}
}
internal static int TryGetScepterCount(Inventory inventory)
{
if (!ScepterInstalled)
{
return 0;
}
return GetScepterCount(inventory);
}
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
private static int GetScepterCount(Inventory inventory)
{
return inventory.GetItemCount(((ItemBase)ItemBase<AncientScepterItem>.instance).ItemDef);
}
}
public static class Config
{
public static void ReadConfig()
{
}
public static ConfigEntry<bool> CharacterEnableConfig(string characterName, string description = "Set to false to disable this character", bool enabledDefault = true)
{
return ((BaseUnityPlugin)ShamanPlugin.instance).Config.Bind<bool>("General", "Enable " + characterName, enabledDefault, description);
}
}
internal class ContentPacks : IContentPackProvider
{
internal ContentPack contentPack = new ContentPack();
public static List<GameObject> bodyPrefabs = new List<GameObject>();
public static List<GameObject> masterPrefabs = new List<GameObject>();
public static List<GameObject> projectilePrefabs = new List<GameObject>();
public static List<SurvivorDef> survivorDefs = new List<SurvivorDef>();
public static List<UnlockableDef> unlockableDefs = new List<UnlockableDef>();
public static List<SkillFamily> skillFamilies = new List<SkillFamily>();
public static List<SkillDef> skillDefs = new List<SkillDef>();
public static List<Type> entityStates = new List<Type>();
public static List<BuffDef> buffDefs = new List<BuffDef>();
public static List<EffectDef> effectDefs = new List<EffectDef>();
public static List<NetworkSoundEventDef> networkSoundEventDefs = new List<NetworkSoundEventDef>();
public string identifier => "com.manti.ShamanMod";
public void Initialize()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(ContentManager_collectContentPackProviders);
}
private void ContentManager_collectContentPackProviders(AddContentPackProviderDelegate addContentPackProvider)
{
addContentPackProvider.Invoke((IContentPackProvider)(object)this);
}
public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
{
contentPack.identifier = identifier;
contentPack.bodyPrefabs.Add(bodyPrefabs.ToArray());
contentPack.masterPrefabs.Add(masterPrefabs.ToArray());
contentPack.projectilePrefabs.Add(projectilePrefabs.ToArray());
contentPack.survivorDefs.Add(survivorDefs.ToArray());
contentPack.unlockableDefs.Add(unlockableDefs.ToArray());
contentPack.skillDefs.Add(skillDefs.ToArray());
contentPack.skillFamilies.Add(skillFamilies.ToArray());
contentPack.entityStateTypes.Add(entityStates.ToArray());
contentPack.buffDefs.Add(buffDefs.ToArray());
contentPack.effectDefs.Add(effectDefs.ToArray());
contentPack.networkSoundEventDefs.Add(networkSoundEventDefs.ToArray());
args.ReportProgress(1f);
yield break;
}
public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args)
{
ContentPack.Copy(contentPack, args.output);
args.ReportProgress(1f);
yield break;
}
public IEnumerator FinalizeAsync(FinalizeAsyncArgs args)
{
args.ReportProgress(1f);
yield break;
}
}
internal class Content
{
public static void AddCharacterBodyPrefab(GameObject bprefab)
{
ContentPacks.bodyPrefabs.Add(bprefab);
}
public static void AddMasterPrefab(GameObject prefab)
{
ContentPacks.masterPrefabs.Add(prefab);
}
public static void AddProjectilePrefab(GameObject prefab)
{
ContentPacks.projectilePrefabs.Add(prefab);
}
public static void AddSurvivorDef(SurvivorDef survivorDef)
{
ContentPacks.survivorDefs.Add(survivorDef);
}
public static void AddUnlockableDef(UnlockableDef unlockableDef)
{
ContentPacks.unlockableDefs.Add(unlockableDef);
}
public static void AddSkillDef(SkillDef skillDef)
{
ContentPacks.skillDefs.Add(skillDef);
}
public static void AddSkillFamily(SkillFamily skillFamily)
{
ContentPacks.skillFamilies.Add(skillFamily);
}
public static void AddEntityState(Type entityState)
{
ContentPacks.entityStates.Add(entityState);
}
public static void AddBuffDef(BuffDef buffDef)
{
ContentPacks.buffDefs.Add(buffDef);
}
public static void AddEffectDef(EffectDef effectDef)
{
ContentPacks.effectDefs.Add(effectDef);
}
public static void AddNetworkSoundEventDef(NetworkSoundEventDef networkSoundEventDef)
{
ContentPacks.networkSoundEventDefs.Add(networkSoundEventDef);
}
}
internal static class Helpers
{
internal const string agilePrefix = "<style=cIsUtility>Agile.</style> ";
internal static string ScepterDescription(string desc)
{
return "\n<color=#d299ff>SCEPTER: " + desc + "</color>";
}
public static T[] Append<T>(ref T[] array, List<T> list)
{
int num = array.Length;
int count = list.Count;
Array.Resize(ref array, num + count);
list.CopyTo(array, num);
return array;
}
public static Func<T[], T[]> AppendDel<T>(List<T> list)
{
return (T[] r) => Append(ref r, list);
}
}
internal static class ItemDisplays
{
private static Dictionary<string, GameObject> itemDisplayPrefabs = new Dictionary<string, GameObject>();
private static bool recording = false;
public static Dictionary<string, int> itemDisplayCheckCount = new Dictionary<string, int>();
public static Dictionary<string, Object> itemDisplayCheckAsset = new Dictionary<string, Object>();
public static void PopulateDisplays()
{
PopulateDisplaysFromBody("MageBody");
PopulateDisplaysFromBody("LunarExploderBody");
AddCustomLightningArm();
}
private static void PopulateDisplaysFromBody(string bodyName)
{
GameObject obj = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/" + bodyName);
object obj2;
if (obj == null)
{
obj2 = null;
}
else
{
ModelLocator component = obj.GetComponent<ModelLocator>();
obj2 = ((component == null) ? null : ((Component)component.modelTransform).GetComponent<CharacterModel>()?.itemDisplayRuleSet);
}
ItemDisplayRuleSet val = (ItemDisplayRuleSet)obj2;
if ((Object)(object)val == (Object)null)
{
Debug.LogError((object)("couldn't load ItemDisplayRuleSet from " + bodyName + ". Check if name was entered correctly"));
return;
}
KeyAssetRuleGroup[] keyAssetRuleGroups = val.keyAssetRuleGroups;
for (int i = 0; i < keyAssetRuleGroups.Length; i++)
{
ItemDisplayRule[] rules = keyAssetRuleGroups[i].displayRuleGroup.rules;
for (int j = 0; j < rules.Length; j++)
{
GameObject followerPrefab = rules[j].followerPrefab;
if (Object.op_Implicit((Object)(object)followerPrefab))
{
string key = ((Object)followerPrefab).name?.ToLowerInvariant();
if (!itemDisplayPrefabs.ContainsKey(key))
{
itemDisplayPrefabs[key] = followerPrefab;
itemDisplayCheckCount[key] = 0;
itemDisplayCheckAsset[key] = keyAssetRuleGroups[i].keyAsset;
}
}
}
}
}
private static void AddCustomLightningArm()
{
GameObject val = PrefabAPI.InstantiateClone(itemDisplayPrefabs["DisplayLightningArmRight".ToLowerInvariant()], "DisplayLightningArmCustom", false);
LimbMatcher component = val.GetComponent<LimbMatcher>();
component.limbPairs[0].targetChildLimb = "LightningArm1";
component.limbPairs[1].targetChildLimb = "LightningArm2";
component.limbPairs[2].targetChildLimb = "LightningArmEnd";
string key = "DisplayLightningArmCustom".ToLowerInvariant();
itemDisplayPrefabs[key] = val;
}
public static GameObject LoadDisplay(string name)
{
if (itemDisplayPrefabs.ContainsKey(name.ToLowerInvariant()) && Object.op_Implicit((Object)(object)itemDisplayPrefabs[name.ToLowerInvariant()]))
{
if (recording && itemDisplayCheckCount.ContainsKey(name.ToLowerInvariant()))
{
itemDisplayCheckCount[name.ToLowerInvariant()]++;
}
return itemDisplayPrefabs[name.ToLowerInvariant()];
}
Debug.LogError((object)("item display " + name + " returned null"));
return null;
}
public static void recordUnused()
{
recording = true;
}
public static void printUnused()
{
string text = "used:";
string text2 = "not used:";
foreach (KeyValuePair<string, int> item in itemDisplayCheckCount)
{
string text3 = $"\n{itemDisplayCheckAsset[item.Key]} | {((Object)itemDisplayPrefabs[item.Key]).name}";
text3 = SpitOutNewRule(itemDisplayCheckAsset[item.Key], ((Object)itemDisplayPrefabs[item.Key]).name);
if (item.Value > 0)
{
text += text3;
}
else
{
text2 += text3;
}
}
}
private static string SpitOutNewRule(Object asset, string prefabName, string content = "DLC1Content")
{
string text = ((asset is ItemDef) ? "Items" : "Equipment");
return "\n itemDisplayRules.Add(ItemDisplays.CreateGenericDisplayRule(" + content + "." + text + "." + asset.name + ", \"" + prefabName + "\",\n \"Chest\",\n new Vector3(2, 2, 2),\n new Vector3(0, 0, 0),\n new Vector3(1, 1, 1)));";
}
private static void resetUnused()
{
foreach (KeyValuePair<string, int> item in itemDisplayCheckCount)
{
itemDisplayCheckCount[item.Key] = 0;
}
recording = false;
}
private static Object GetKeyAssetFromString(string itemName)
{
Object val = (Object)(object)LegacyResourcesAPI.Load<ItemDef>("ItemDefs/" + itemName);
if (val == (Object)null)
{
val = (Object)(object)LegacyResourcesAPI.Load<EquipmentDef>("EquipmentDefs/" + itemName);
}
if (val == (Object)null)
{
Debug.LogError((object)("Could not load keyasset for " + itemName));
}
return val;
}
public static KeyAssetRuleGroup CreateGenericDisplayRuleGroup(Object keyAsset_, GameObject itemPrefab, string childName, Vector3 position, Vector3 rotation, Vector3 scale)
{
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
//IL_0004: 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_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
ItemDisplayRule val = CreateDisplayRule(itemPrefab, childName, position, rotation, scale);
return CreateDisplayRuleGroupWithRules(keyAsset_, val);
}
public static ItemDisplayRule CreateDisplayRule(string prefabName, string childName, Vector3 position, Vector3 rotation, Vector3 scale)
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
return CreateDisplayRule(LoadDisplay(prefabName), childName, position, rotation, scale);
}
public static ItemDisplayRule CreateDisplayRule(GameObject itemPrefab, string childName, Vector3 position, Vector3 rotation, Vector3 scale)
{
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: 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_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: 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_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: 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)
ItemDisplayRule result = default(ItemDisplayRule);
result.ruleType = (ItemDisplayRuleType)0;
result.childName = childName;
result.followerPrefab = itemPrefab;
result.limbMask = (LimbFlags)0;
result.localPos = position;
result.localAngles = rotation;
result.localScale = scale;
return result;
}
public static ItemDisplayRule CreateLimbMaskDisplayRule(LimbFlags limb)
{
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: 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)
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
ItemDisplayRule result = default(ItemDisplayRule);
result.ruleType = (ItemDisplayRuleType)1;
result.limbMask = limb;
result.childName = "";
result.followerPrefab = null;
return result;
}
public static KeyAssetRuleGroup CreateDisplayRuleGroupWithRules(string itemName, params ItemDisplayRule[] rules)
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
return CreateDisplayRuleGroupWithRules(GetKeyAssetFromString(itemName), rules);
}
public static KeyAssetRuleGroup CreateDisplayRuleGroupWithRules(Object keyAsset_, params ItemDisplayRule[] rules)
{
//IL_0003: 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_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
KeyAssetRuleGroup result = default(KeyAssetRuleGroup);
result.keyAsset = keyAsset_;
result.displayRuleGroup = new DisplayRuleGroup
{
rules = rules
};
return result;
}
public static KeyAssetRuleGroup CreateGenericDisplayRule(string itemName, string prefabName, string childName, Vector3 position, Vector3 rotation, Vector3 scale)
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
return CreateGenericDisplayRule(GetKeyAssetFromString(itemName), prefabName, childName, position, rotation, scale);
}
public static KeyAssetRuleGroup CreateGenericDisplayRule(Object itemDef, string prefabName, string childName, Vector3 position, Vector3 rotation, Vector3 scale)
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
return CreateGenericDisplayRule(itemDef, LoadDisplay(prefabName), childName, position, rotation, scale);
}
public static KeyAssetRuleGroup CreateGenericDisplayRule(string itemName, GameObject displayPrefab, string childName, Vector3 position, Vector3 rotation, Vector3 scale)
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
return CreateGenericDisplayRule(GetKeyAssetFromString(itemName), displayPrefab, childName, position, rotation, scale);
}
public static KeyAssetRuleGroup CreateGenericDisplayRule(Object itemDef, GameObject displayPrefab, string childName, Vector3 position, Vector3 rotation, Vector3 scale)
{
//IL_0003: 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_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_0048: 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_0050: 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_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0079: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: Unknown result type (might be due to invalid IL or missing references)
KeyAssetRuleGroup result = default(KeyAssetRuleGroup);
result.keyAsset = itemDef;
result.displayRuleGroup = new DisplayRuleGroup
{
rules = (ItemDisplayRule[])(object)new ItemDisplayRule[1]
{
new ItemDisplayRule
{
ruleType = (ItemDisplayRuleType)0,
childName = childName,
followerPrefab = displayPrefab,
limbMask = (LimbFlags)0,
localPos = position,
localAngles = rotation,
localScale = scale
}
}
};
return result;
}
}
internal static class Materials
{
private static List<Material> cachedMaterials = new List<Material>();
internal static Shader hotpoo = LegacyResourcesAPI.Load<Shader>("Shaders/Deferred/HGStandard");
public static Material CreateHopooMaterial(string materialName)
{
//IL_0074: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: Expected O, but got Unknown
Material val = cachedMaterials.Find(delegate(Material mat)
{
materialName.Replace(" (Instance)", "");
return ((Object)mat).name.Contains(materialName);
});
if (Object.op_Implicit((Object)(object)val))
{
return val;
}
val = ShamanAssets.mainAssetBundle.LoadAsset<Material>(materialName);
if (!Object.op_Implicit((Object)(object)val))
{
Log.Error("Failed to load material: " + materialName + " - Check to see that the material in your Unity project matches this name");
return new Material(hotpoo);
}
return val.SetHopooMaterial();
}
public static Material SetHopooMaterial(this Material tempMat)
{
//IL_0089: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_0107: Unknown result type (might be due to invalid IL or missing references)
if (cachedMaterials.Contains(tempMat))
{
return tempMat;
}
float? num = null;
Color? val = null;
if (tempMat.IsKeywordEnabled("_NORMALMAP"))
{
num = tempMat.GetFloat("_BumpScale");
}
if (tempMat.IsKeywordEnabled("_EMISSION"))
{
val = tempMat.GetColor("_EmissionColor");
}
tempMat.shader = hotpoo;
tempMat.SetColor("_Color", tempMat.GetColor("_Color"));
tempMat.SetTexture("_MainTex", tempMat.GetTexture("_MainTex"));
tempMat.SetTexture("_EmTex", tempMat.GetTexture("_EmissionMap"));
tempMat.EnableKeyword("DITHER");
if (num.HasValue)
{
tempMat.SetFloat("_NormalStrength", num.Value);
}
if (val.HasValue)
{
tempMat.SetColor("_EmColor", val.Value);
tempMat.SetFloat("_EmPower", 1f);
}
if (tempMat.IsKeywordEnabled("NOCULL"))
{
tempMat.SetInt("_Cull", 0);
}
if (tempMat.IsKeywordEnabled("LIMBREMOVAL"))
{
tempMat.SetInt("_LimbRemovalOn", 1);
}
cachedMaterials.Add(tempMat);
return tempMat;
}
public static Material MakeUnique(this Material material)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Expected O, but got Unknown
if (cachedMaterials.Contains(material))
{
return new Material(material);
}
return material;
}
public static Material SetColor(this Material material, Color color)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
material.SetColor("_Color", color);
return material;
}
public static Material SetNormal(this Material material, float normalStrength = 1f)
{
material.SetFloat("_NormalStrength", normalStrength);
return material;
}
public static Material SetEmission(this Material material)
{
return material.SetEmission(1f);
}
public static Material SetEmission(this Material material, float emission)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
return material.SetEmission(emission, Color.white);
}
public static Material SetEmission(this Material material, float emission, Color emissionColor)
{
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
material.SetFloat("_EmPower", emission);
material.SetColor("_EmColor", emissionColor);
return material;
}
public static Material SetCull(this Material material, bool cull = false)
{
material.SetInt("_Cull", cull ? 1 : 0);
return material;
}
}
internal static class Prefabs
{
private static PhysicMaterial ragdollMaterial;
public static GameObject CreateDisplayPrefab(string displayModelName, GameObject prefab, BodyInfo bodyInfo)
{
GameObject val = ShamanAssets.LoadSurvivorModel(displayModelName);
CharacterModel val2 = val.GetComp