using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.Bandit2.Weapon;
using EntityStates.Commando.CommandoWeapon;
using EntityStates.Huntress;
using EntityStates.Huntress.HuntressWeapon;
using EntityStates.Huntress.Weapon;
using HG.GeneralSerializer;
using IL.RoR2;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.EntityStates.Bandit2.Weapon;
using On.EntityStates.Huntress.HuntressWeapon;
using On.EntityStates.Huntress.Weapon;
using On.RoR2;
using RoR2;
using RoR2.Orbs;
using RoR2.Projectile;
using UnityEngine;
using UnityEngine.AddressableAssets;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("GameTweaks")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("GameTweaks")]
[assembly: AssemblyTitle("GameTweaks")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace GameTweaks
{
[BepInPlugin("Jeffdev.GameTweaks", "GameTweaks", "1.0.0")]
public class GameTweaks : BaseUnityPlugin
{
[Serializable]
[CompilerGenerated]
private sealed class <>c
{
public static readonly <>c <>9 = new <>c();
public static hook_FireShiv <>9__44_3;
public static hook_AuthorityModifyOverlapAttack <>9__44_4;
public static Action <>9__44_7;
public static Func<Instruction, bool> <>9__52_0;
internal void <Awake>b__44_3(orig_FireShiv orig, Bandit2FireShiv self)
{
self.damageCoefficient = (float)bandDaggerDmg.Value / 100f;
orig.Invoke(self);
}
internal void <Awake>b__44_4(orig_AuthorityModifyOverlapAttack orig, SlashBlade self, OverlapAttack overlapAttack)
{
overlapAttack.damage = (float)bandDaggerDmg.Value / 100f * ((BaseState)self).damageStat;
orig.Invoke(self, overlapAttack);
}
internal void <Awake>b__44_7()
{
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0074: Unknown result type (might be due to invalid IL or missing references)
//IL_0079: Unknown result type (might be due to invalid IL or missing references)
//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
//IL_013e: Unknown result type (might be due to invalid IL or missing references)
//IL_0143: Unknown result type (might be due to invalid IL or missing references)
//IL_0156: Unknown result type (might be due to invalid IL or missing references)
//IL_0165: Unknown result type (might be due to invalid IL or missing references)
//IL_0183: Unknown result type (might be due to invalid IL or missing references)
//IL_0188: Unknown result type (might be due to invalid IL or missing references)
FirePistol2.damageCoefficient = cmdDblTapDmg.Value / 100;
FireThermite.damageCoefficient = cmdRoundDmg.Value / 100;
GameObject obj = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/FMJRamping.prefab").WaitForCompletion();
obj.AddComponent<CustomProjectileDamageModifier>().dmgTypeName = "fmj";
obj.GetComponent<ProjectileController>().procCoefficient = cmdRoundProc.Value;
FireBarrage.damageCoefficient = cmdSuppDmg.Value / 100;
GameObject obj2 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/CommandoGrenadeProjectile.prefab").WaitForCompletion();
ProjectileController component = obj2.GetComponent<ProjectileController>();
ProjectileImpactExplosion component2 = obj2.GetComponent<ProjectileImpactExplosion>();
component.procCoefficient = cmdGrenadeProc.Value;
((ProjectileExplosion)component2).blastRadius = cmdGrenadeAoe.Value;
((Component)component2).transform.localScale = Vector3.one * (float)cmdGrenadeAoe.Value;
((ProjectileExplosion)component2).blastProcCoefficient = cmdGrenadeProc.Value;
ThrowGlaive.damageCoefficient = huntGlaiveDmg.Value / 100;
ThrowGlaive.damageCoefficientPerBounce = (huntGlaiveDmgBounce.Value + 100) / 100;
ThrowGlaive.glaiveProcCoefficient = huntGlaiveProc.Value;
ArrowRain.damageCoefficient = huntArrowRainDmg.Value * 2 / 100;
ArrowRain.arrowRainRadius = huntArrowRainAoe.Value;
ProjectileDotZone component3 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Huntress/HuntressArrowRain.prefab").WaitForCompletion().GetComponent<ProjectileDotZone>();
((Component)component3).transform.localScale = Vector3.one * huntArrowRainAoe.Value;
component3.overlapProcCoefficient = huntArrowRainProc.Value;
GameObject obj3 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Bandit2/Bandit2ShivProjectile.prefab").WaitForCompletion();
obj3.AddComponent<CustomProjectileDamageModifier>().dmgTypeName = "shiv";
obj3.GetComponent<ProjectileController>().procCoefficient = bandShivProc.Value;
}
internal bool <BulletAttack_HandleBulletDamage>b__52_0(Instruction x)
{
return ILPatternMatchingExt.MatchCall(x, typeof(NetworkExtensions), "ReadDamageInfo");
}
}
public const string PluginGUID = "Jeffdev.GameTweaks";
public const string PluginAuthor = "Jeffdev";
public const string PluginName = "GameTweaks";
public const string PluginVersion = "1.0.0";
public static ConfigEntry<int> cmdDblTapDmg;
public static ConfigEntry<float> cmdDblTapProc;
public static ConfigEntry<int> cmdRoundDmg;
public static ConfigEntry<int> cmdRoundPierceDmg;
public static ConfigEntry<float> cmdRoundProc;
public static ConfigEntry<int> cmdBlastDmg;
public static ConfigEntry<float> cmdBlastProc;
public static ConfigEntry<int> cmdSuppDmg;
public static ConfigEntry<float> cmdSuppProc;
public static ConfigEntry<int> cmdGrenadeAoe;
public static ConfigEntry<int> cmdGrenadeDmg;
public static ConfigEntry<float> cmdGrenadeProc;
public static ConfigEntry<int> huntStrafeDmg;
public static ConfigEntry<float> huntStrafeProc;
public static ConfigEntry<int> huntFlurryDmg;
public static ConfigEntry<float> huntFlurryProc;
public static ConfigEntry<int> huntGlaiveDmg;
public static ConfigEntry<int> huntGlaiveDmgBounce;
public static ConfigEntry<float> huntGlaiveProc;
public static ConfigEntry<float> huntArrowRainAoe;
public static ConfigEntry<int> huntArrowRainDmg;
public static ConfigEntry<float> huntArrowRainProc;
public static ConfigEntry<int> huntBallistaDmg;
public static ConfigEntry<float> huntBallistaProc;
public static ConfigEntry<int> bandHemoDmg;
public static ConfigEntry<int> bandBurstDmg;
public static ConfigEntry<float> bandBurstProc;
public static ConfigEntry<int> bandBlastDmg;
public static ConfigEntry<float> bandBlastProc;
public static ConfigEntry<int> bandDaggerDmg;
public static ConfigEntry<float> bandDaggerProc;
public static ConfigEntry<int> bandShivDmg;
public static ConfigEntry<float> bandShivProc;
public static ConfigEntry<int> bandSmokeDmg;
public static ConfigEntry<float> bandSmokeProc;
public static ConfigEntry<int> bandLightsOutDmg;
public static ConfigEntry<float> bandLightsOutProc;
public static ConfigEntry<int> bandDesperadoDmg;
public static ConfigEntry<int> bandDesperadoBuff;
public static ConfigEntry<float> bandDesperadoProc;
public void Awake()
{
//IL_059a: Unknown result type (might be due to invalid IL or missing references)
//IL_05a4: Expected O, but got Unknown
//IL_05ab: Unknown result type (might be due to invalid IL or missing references)
//IL_05b5: Expected O, but got Unknown
//IL_05bc: Unknown result type (might be due to invalid IL or missing references)
//IL_05c6: Expected O, but got Unknown
//IL_05cd: Unknown result type (might be due to invalid IL or missing references)
//IL_05d7: Expected O, but got Unknown
//IL_05de: Unknown result type (might be due to invalid IL or missing references)
//IL_05e8: Expected O, but got Unknown
//IL_05fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0601: Unknown result type (might be due to invalid IL or missing references)
//IL_0607: Expected O, but got Unknown
//IL_0637: Unknown result type (might be due to invalid IL or missing references)
//IL_0641: Expected O, but got Unknown
//IL_0648: Unknown result type (might be due to invalid IL or missing references)
//IL_0652: Expected O, but got Unknown
//IL_0659: Unknown result type (might be due to invalid IL or missing references)
//IL_0663: Expected O, but got Unknown
//IL_066a: Unknown result type (might be due to invalid IL or missing references)
//IL_0674: Expected O, but got Unknown
//IL_067b: Unknown result type (might be due to invalid IL or missing references)
//IL_0685: Expected O, but got Unknown
//IL_068c: Unknown result type (might be due to invalid IL or missing references)
//IL_0696: Expected O, but got Unknown
//IL_069d: Unknown result type (might be due to invalid IL or missing references)
//IL_06a7: Expected O, but got Unknown
//IL_0620: Unknown result type (might be due to invalid IL or missing references)
//IL_0625: Unknown result type (might be due to invalid IL or missing references)
//IL_062b: Expected O, but got Unknown
Log.Init(((BaseUnityPlugin)this).Logger);
cmdDblTapDmg = ((BaseUnityPlugin)this).Config.Bind<int>("Commando - Double Tap", "Damage", 100, "Base damage % for Double Tap.");
cmdDblTapProc = ((BaseUnityPlugin)this).Config.Bind<float>("Commando - Double Tap", "Proc Coefficient", 1f, "Proc coefficient for Double Tap.");
cmdRoundDmg = ((BaseUnityPlugin)this).Config.Bind<int>("Commando - Phase Round", "Damage", 300, "Base damage % for Phase Round.");
cmdRoundPierceDmg = ((BaseUnityPlugin)this).Config.Bind<int>("Commando - Phase Round", "Pierce Damage", 40, "Damage % dealt to enemies hit after the first.");
cmdRoundProc = ((BaseUnityPlugin)this).Config.Bind<float>("Commando - Phase Round", "Proc Coefficient", 1f, "Proc coefficient for Phase Round.");
cmdBlastDmg = ((BaseUnityPlugin)this).Config.Bind<int>("Commando - Phase Blast", "Damage", 200, "Base damage % per shot for Phase Blast.");
cmdBlastProc = ((BaseUnityPlugin)this).Config.Bind<float>("Commando - Phase Blast", "Proc Coefficient", 0.5f, "Proc coefficient for Phase Blast.");
cmdSuppDmg = ((BaseUnityPlugin)this).Config.Bind<int>("Commando - Suppressive Fire", "Damage", 100, "Base damage % for Suppressive Fire.");
cmdSuppProc = ((BaseUnityPlugin)this).Config.Bind<float>("Commando - Suppressive Fire", "Proc Coefficient", 1f, "Proc coefficient for Suppressive Fire.");
cmdGrenadeAoe = ((BaseUnityPlugin)this).Config.Bind<int>("Commando - Frag Grenade", "Explosion Radius", 11, "Explosion radius of Frag Grenade in meters.");
cmdGrenadeDmg = ((BaseUnityPlugin)this).Config.Bind<int>("Commando - Frag Grenade", "Damage", 700, "Base damage % for Frag Grenade.");
cmdGrenadeProc = ((BaseUnityPlugin)this).Config.Bind<float>("Commando - Frag Grenade", "Proc Coefficient", 1f, "Proc coefficient for Frag Grenade.");
huntStrafeDmg = ((BaseUnityPlugin)this).Config.Bind<int>("Huntress - Strafe", "Damage", 150, "Base damage % for Strafe.");
huntStrafeProc = ((BaseUnityPlugin)this).Config.Bind<float>("Huntress - Strafe", "Proc Coefficient", 1f, "Proc coefficient for Strafe.");
huntFlurryDmg = ((BaseUnityPlugin)this).Config.Bind<int>("Huntress - Flurry", "Damage", 100, "Base damage % for Flurry.");
huntFlurryProc = ((BaseUnityPlugin)this).Config.Bind<float>("Huntress - Flurry", "Proc Coefficient", 0.7f, "Proc coefficient for Flurry.");
huntGlaiveDmg = ((BaseUnityPlugin)this).Config.Bind<int>("Huntress - Laser Glaive", "Damage", 250, "Base damage % for the initial hit of Laser Glaive.");
huntGlaiveDmgBounce = ((BaseUnityPlugin)this).Config.Bind<int>("Huntress - Laser Glaive", "Bounce Damage", 10, "TOTAL damage increase % for Laser Glaive per bounce.");
huntGlaiveProc = ((BaseUnityPlugin)this).Config.Bind<float>("Huntress - Laser Glaive", "Proc Coefficient", 0.8f, "Proc coefficient for Laser Glaive.");
huntArrowRainAoe = ((BaseUnityPlugin)this).Config.Bind<float>("Huntress - Arrow Rain", "AoE Radius", 7.5f, "Area of effect radius of Arrow Rain in meters.");
huntArrowRainDmg = ((BaseUnityPlugin)this).Config.Bind<int>("Huntress - Arrow Rain", "Damage", 330, "Base damage % for Arrow Rain per second.");
huntArrowRainProc = ((BaseUnityPlugin)this).Config.Bind<float>("Huntress - Arrow Rain", "Proc Coefficient", 0.2f, "Proc coefficient for Arrow Rain.");
huntBallistaDmg = ((BaseUnityPlugin)this).Config.Bind<int>("Huntress - Ballista", "Damage", 900, "Base damage % for Ballista.");
huntBallistaProc = ((BaseUnityPlugin)this).Config.Bind<float>("Huntress - Ballista", "Proc Coefficient", 1f, "Proc coefficient for Ballista.");
bandHemoDmg = ((BaseUnityPlugin)this).Config.Bind<int>("Bandit - Hemorrhage", "Damage", 2000, "Amount of base damage % done by Hemorrhage.");
bandBurstDmg = ((BaseUnityPlugin)this).Config.Bind<int>("Bandit - Burst", "Damage", 100, "Damage multiplier % of each Burst projectile.");
bandBurstProc = ((BaseUnityPlugin)this).Config.Bind<float>("Bandit - Burst", "Proc Coefficient", 0.5f, "Proc coefficient of Burst.");
bandBlastDmg = ((BaseUnityPlugin)this).Config.Bind<int>("Bandit - Blast", "Damage", 330, "Damage multiplier % of each Blast projectile.");
bandBlastProc = ((BaseUnityPlugin)this).Config.Bind<float>("Bandit - Blast", "Proc Coefficient", 1f, "Proc coefficient of Blast.");
bandDaggerDmg = ((BaseUnityPlugin)this).Config.Bind<int>("Bandit - Serrated Dagger", "Damage", 360, "Damage multiplier % of each Serrated Dagger projectile.");
bandDaggerProc = ((BaseUnityPlugin)this).Config.Bind<float>("Bandit - Serrated Dagger", "Proc Coefficient", 1f, "Proc coefficient of Serrated Dagger.");
bandShivDmg = ((BaseUnityPlugin)this).Config.Bind<int>("Bandit - Serrated Shiv", "Damage", 360, "Damage multiplier % of each Serrated Shiv projectile.");
bandShivProc = ((BaseUnityPlugin)this).Config.Bind<float>("Bandit - Serrated Shiv", "Proc Coefficient", 1f, "Proc coefficient of Serrated Shiv.");
bandSmokeDmg = ((BaseUnityPlugin)this).Config.Bind<int>("Bandit - Smoke Bomb", "Damage", 200, "Damage multiplier % of Smoke Bomb Enter/Exit.");
bandSmokeProc = ((BaseUnityPlugin)this).Config.Bind<float>("Bandit - Smoke Bomb", "Proc Coefficient", 1f, "Proc coefficient of Smoke Bomb.");
bandLightsOutDmg = ((BaseUnityPlugin)this).Config.Bind<int>("Bandit - Lights Out", "Damage", 600, "Damage multiplier % of each Lights Out projectile.");
bandLightsOutProc = ((BaseUnityPlugin)this).Config.Bind<float>("Bandit - Lights Out", "Proc Coefficient", 1f, "Proc coefficient of Lights Out.");
bandDesperadoDmg = ((BaseUnityPlugin)this).Config.Bind<int>("Bandit - Desperado", "Damage", 600, "Damage multiplier % of each Desperado projectile.");
bandDesperadoBuff = ((BaseUnityPlugin)this).Config.Bind<int>("Bandit - Desperado", "Buff Damage", 10, "Damage multiplier % increase per Bandit Skull buff.");
bandDesperadoProc = ((BaseUnityPlugin)this).Config.Bind<float>("Bandit - Desperado", "Proc Coefficient", 1f, "Proc coefficient of Desperado.");
FireSeekingArrow.CreateArrowOrb += new hook_CreateArrowOrb(FireSeekingArrow_CreateArrowOrb);
FireFlurrySeekingArrow.CreateArrowOrb += new hook_CreateArrowOrb(FireFlurrySeekingArrow_CreateArrowOrb);
FireArrowSnipe.ModifyBullet += (hook_ModifyBullet)delegate(orig_ModifyBullet orig, FireArrowSnipe self, BulletAttack bulletAttack)
{
ApplyCustomBulletValues(huntBallistaDmg.Value, huntBallistaProc.Value, ((BaseState)self).damageStat, bulletAttack);
orig.Invoke(self, bulletAttack);
};
Bandit2FireRifle.ModifyBullet += (hook_ModifyBullet)delegate(orig_ModifyBullet orig, Bandit2FireRifle self, BulletAttack bulletAttack)
{
ApplyCustomBulletValues(bandBlastDmg.Value, bandBlastProc.Value, ((BaseState)self).damageStat, bulletAttack);
orig.Invoke(self, bulletAttack);
};
FireShotgun2.ModifyBullet += (hook_ModifyBullet)delegate(orig_ModifyBullet orig, FireShotgun2 self, BulletAttack bulletAttack)
{
ApplyCustomBulletValues(bandBurstDmg.Value, bandBurstProc.Value, ((BaseState)self).damageStat, bulletAttack);
orig.Invoke(self, bulletAttack);
};
object obj = <>c.<>9__44_3;
if (obj == null)
{
hook_FireShiv val = delegate(orig_FireShiv orig, Bandit2FireShiv self)
{
self.damageCoefficient = (float)bandDaggerDmg.Value / 100f;
orig.Invoke(self);
};
<>c.<>9__44_3 = val;
obj = (object)val;
}
Bandit2FireShiv.FireShiv += (hook_FireShiv)obj;
object obj2 = <>c.<>9__44_4;
if (obj2 == null)
{
hook_AuthorityModifyOverlapAttack val2 = delegate(orig_AuthorityModifyOverlapAttack orig, SlashBlade self, OverlapAttack overlapAttack)
{
overlapAttack.damage = (float)bandDaggerDmg.Value / 100f * ((BaseState)self).damageStat;
orig.Invoke(self, overlapAttack);
};
<>c.<>9__44_4 = val2;
obj2 = (object)val2;
}
SlashBlade.AuthorityModifyOverlapAttack += (hook_AuthorityModifyOverlapAttack)obj2;
FireSidearmResetRevolver.ModifyBullet += (hook_ModifyBullet)delegate(orig_ModifyBullet orig, FireSidearmResetRevolver self, BulletAttack bulletAttack)
{
ApplyCustomBulletValues(bandLightsOutDmg.Value, bandLightsOutProc.Value, ((BaseState)self).damageStat, bulletAttack);
orig.Invoke(self, bulletAttack);
};
FireSidearmSkullRevolver.ModifyBullet += (hook_ModifyBullet)delegate(orig_ModifyBullet orig, FireSidearmSkullRevolver self, BulletAttack bulletAttack)
{
orig.Invoke(self, bulletAttack);
ApplyCustomBulletValues(bandDesperadoDmg.Value, bandDesperadoProc.Value, ((BaseState)self).damageStat, bulletAttack);
int num = 0;
if (Object.op_Implicit((Object)(object)((EntityState)self).characterBody))
{
num = ((EntityState)self).characterBody.GetBuffCount(Buffs.BanditSkull);
}
float num2 = 1f + (float)bandDesperadoBuff.Value / 100f * (float)num;
bulletAttack.damage *= num2;
};
BulletAttack.HandleBulletDamage += new Manipulator(BulletAttack_HandleBulletDamage);
BulletAttack.DefaultHitCallbackImplementation += new hook_DefaultHitCallbackImplementation(BulletAttack_DefaultHitCallbackImplementation);
DotController.InitDotCatalog += new hook_InitDotCatalog(DotController_InitDotCatalog);
BlastAttack.PerformDamageServer += new hook_PerformDamageServer(BlastAttack_PerformDamageServer);
OverlapAttack.PerformDamage += new hook_PerformDamage(OverlapAttack_PerformDamage);
try
{
RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, (Action)delegate
{
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0074: Unknown result type (might be due to invalid IL or missing references)
//IL_0079: Unknown result type (might be due to invalid IL or missing references)
//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
//IL_013e: Unknown result type (might be due to invalid IL or missing references)
//IL_0143: Unknown result type (might be due to invalid IL or missing references)
//IL_0156: Unknown result type (might be due to invalid IL or missing references)
//IL_0165: Unknown result type (might be due to invalid IL or missing references)
//IL_0183: Unknown result type (might be due to invalid IL or missing references)
//IL_0188: Unknown result type (might be due to invalid IL or missing references)
FirePistol2.damageCoefficient = cmdDblTapDmg.Value / 100;
FireThermite.damageCoefficient = cmdRoundDmg.Value / 100;
GameObject obj3 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/FMJRamping.prefab").WaitForCompletion();
obj3.AddComponent<CustomProjectileDamageModifier>().dmgTypeName = "fmj";
obj3.GetComponent<ProjectileController>().procCoefficient = cmdRoundProc.Value;
FireBarrage.damageCoefficient = cmdSuppDmg.Value / 100;
GameObject obj4 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/CommandoGrenadeProjectile.prefab").WaitForCompletion();
ProjectileController component = obj4.GetComponent<ProjectileController>();
ProjectileImpactExplosion component2 = obj4.GetComponent<ProjectileImpactExplosion>();
component.procCoefficient = cmdGrenadeProc.Value;
((ProjectileExplosion)component2).blastRadius = cmdGrenadeAoe.Value;
((Component)component2).transform.localScale = Vector3.one * (float)cmdGrenadeAoe.Value;
((ProjectileExplosion)component2).blastProcCoefficient = cmdGrenadeProc.Value;
ThrowGlaive.damageCoefficient = huntGlaiveDmg.Value / 100;
ThrowGlaive.damageCoefficientPerBounce = (huntGlaiveDmgBounce.Value + 100) / 100;
ThrowGlaive.glaiveProcCoefficient = huntGlaiveProc.Value;
ArrowRain.damageCoefficient = huntArrowRainDmg.Value * 2 / 100;
ArrowRain.arrowRainRadius = huntArrowRainAoe.Value;
ProjectileDotZone component3 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Huntress/HuntressArrowRain.prefab").WaitForCompletion().GetComponent<ProjectileDotZone>();
((Component)component3).transform.localScale = Vector3.one * huntArrowRainAoe.Value;
component3.overlapProcCoefficient = huntArrowRainProc.Value;
GameObject obj5 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Bandit2/Bandit2ShivProjectile.prefab").WaitForCompletion();
obj5.AddComponent<CustomProjectileDamageModifier>().dmgTypeName = "shiv";
obj5.GetComponent<ProjectileController>().procCoefficient = bandShivProc.Value;
});
}
catch (Exception ex)
{
Log.Error(ex.Message + " - " + ex.StackTrace);
}
}
private void OverlapAttack_PerformDamage(orig_PerformDamage orig, GameObject attacker, GameObject inflictor, float damage, bool isCrit, ProcChainMask procChainMask, float procCoefficient, DamageColorIndex damageColorIndex, DamageTypeCombo damageType, Vector3 forceVector, float pushAwayForce, List<OverlapInfo> hitList)
{
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
//IL_00ca: 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)
if (Object.op_Implicit((Object)(object)attacker))
{
CharacterBody component = attacker.GetComponent<CharacterBody>();
if (Object.op_Implicit((Object)(object)component) && component.baseNameToken == "BANDIT2_BODY_NAME")
{
SkillLocator skillLocator = component.skillLocator;
if (Object.op_Implicit((Object)(object)skillLocator) && Object.op_Implicit((Object)(object)skillLocator.secondary) && Object.op_Implicit((Object)(object)skillLocator.secondary.skillDef) && ((Enum)damageType.damageSource).HasFlag((Enum)(object)(DamageSource)2) && skillLocator.secondary.skillDef.skillNameToken == "BANDIT2_SECONDARY_NAME")
{
damage = (float)bandDaggerDmg.Value / 100f * component.damage;
procCoefficient = bandDaggerProc.Value;
}
}
}
orig.Invoke(attacker, inflictor, damage, isCrit, procChainMask, procCoefficient, damageColorIndex, damageType, forceVector, pushAwayForce, hitList);
}
private void BlastAttack_PerformDamageServer(orig_PerformDamageServer orig, ref BlastAttackDamageInfo blastAttackDamageInfo)
{
//IL_0073: Unknown result type (might be due to invalid IL or missing references)
try
{
if (Object.op_Implicit((Object)(object)blastAttackDamageInfo.attacker))
{
CharacterBody component = blastAttackDamageInfo.attacker.GetComponent<CharacterBody>();
if (Object.op_Implicit((Object)(object)component) && component.baseNameToken == "BANDIT2_BODY_NAME")
{
SkillLocator skillLocator = component.skillLocator;
if (Object.op_Implicit((Object)(object)skillLocator) && Object.op_Implicit((Object)(object)skillLocator.utility) && Object.op_Implicit((Object)(object)skillLocator.utility.skillDef) && ((Enum)blastAttackDamageInfo.damageType.damageSource).HasFlag((Enum)(object)(DamageSource)4) && skillLocator.utility.skillDef.skillNameToken == "BANDIT2_UTILITY_NAME")
{
blastAttackDamageInfo.damage = (float)bandSmokeDmg.Value / 100f * component.damage;
blastAttackDamageInfo.procCoefficient = bandSmokeProc.Value;
}
}
}
}
catch (Exception arg)
{
Debug.LogError((object)$"[GameTweaks] BlastAttack hook failed: {arg}");
}
orig.Invoke(ref blastAttackDamageInfo);
}
private void DotController_InitDotCatalog(orig_InitDotCatalog orig)
{
orig.Invoke();
float num = 60f;
float damageCoefficient = (float)bandHemoDmg.Value / 100f / num;
DotController.dotDefs[6].damageCoefficient = damageCoefficient;
}
private bool BulletAttack_DefaultHitCallbackImplementation(orig_DefaultHitCallbackImplementation orig, BulletAttack bulletAttack, ref BulletHit hitInfo)
{
//IL_0032: 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_00b5: Unknown result type (might be due to invalid IL or missing references)
CharacterBody component = bulletAttack.owner.GetComponent<CharacterBody>();
if (Object.op_Implicit((Object)(object)component) && component.baseNameToken == "COMMANDO_BODY_NAME")
{
if (((Enum)bulletAttack.damageType.damageSource).HasFlag((Enum)(object)(DamageSource)1))
{
if (component.skillLocator.primary.skillDef.skillNameToken == "COMMANDO_PRIMARY_NAME")
{
bulletAttack.procCoefficient = cmdDblTapProc.Value;
}
if (component.skillLocator.secondary.skillDef.skillNameToken == "COMMANDO_SECONDARY_ALT1_NAME")
{
bulletAttack.damage = (float)(cmdBlastDmg.Value / 100) * component.damage * BulletAttack.CalcFalloffFactor(bulletAttack.falloffModel, hitInfo.distance);
bulletAttack.procCoefficient = cmdBlastProc.Value;
}
}
if (((Enum)bulletAttack.damageType.damageSource).HasFlag((Enum)(object)(DamageSource)8) && component.skillLocator.special.skillDef.skillNameToken == "COMMANDO_SPECIAL_NAME")
{
bulletAttack.procCoefficient = cmdSuppProc.Value;
}
}
return orig.Invoke(bulletAttack, ref hitInfo);
}
private void ApplyCustomBulletValues(float dmgPercent, float procCoeff, float damageStat, BulletAttack bulletAttack)
{
bulletAttack.damage = dmgPercent / 100f * damageStat;
bulletAttack.procCoefficient = procCoeff;
}
private GenericDamageOrb FireSeekingArrow_CreateArrowOrb(orig_CreateArrowOrb orig, FireSeekingArrow self)
{
self.orbDamageCoefficient = huntStrafeDmg.Value / 100;
self.orbProcCoefficient = huntStrafeProc.Value;
return orig.Invoke(self);
}
private GenericDamageOrb FireFlurrySeekingArrow_CreateArrowOrb(orig_CreateArrowOrb orig, FireFlurrySeekingArrow self)
{
((FireSeekingArrow)self).orbDamageCoefficient = huntFlurryDmg.Value / 100;
((FireSeekingArrow)self).orbProcCoefficient = huntFlurryProc.Value;
return orig.Invoke(self);
}
private void BulletAttack_HandleBulletDamage(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
ILCursor val = new ILCursor(il);
if (val.TryGotoNext(new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchCall(x, typeof(NetworkExtensions), "ReadDamageInfo")
}))
{
int index = val.Index;
val.Index = index + 1;
val.EmitDelegate<Func<DamageInfo, DamageInfo>>((Func<DamageInfo, DamageInfo>)((DamageInfo damageInfo) => PatchDamageInfo(damageInfo)));
Log.Info("Successfully IL Patched ReadDamageInfo.");
}
else
{
Log.Error("Failed to find ReadDamageInfo.");
}
}
private DamageInfo PatchDamageInfo(DamageInfo damageInfo)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
//IL_0241: Unknown result type (might be due to invalid IL or missing references)
//IL_0130: Unknown result type (might be due to invalid IL or missing references)
//IL_02fd: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)damageInfo.attacker))
{
CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
if (Object.op_Implicit((Object)(object)component))
{
float num = BulletAttack.CalcFalloffFactor((FalloffModel)1, Vector3.Distance(component.aimOrigin, damageInfo.position));
if (component.baseNameToken == "COMMANDO_BODY_NAME")
{
if (((Enum)damageInfo.damageType.damageSource).HasFlag((Enum)(object)(DamageSource)1) && component.skillLocator.primary.skillDef.skillNameToken == "COMMANDO_PRIMARY_NAME")
{
damageInfo.damage = (float)(cmdDblTapDmg.Value / 100) * component.damage * num;
damageInfo.procCoefficient = cmdDblTapProc.Value;
}
if (((Enum)damageInfo.damageType.damageSource).HasFlag((Enum)(object)(DamageSource)2) && component.skillLocator.secondary.skillDef.skillNameToken == "COMMANDO_SECONDARY_ALT1_NAME")
{
damageInfo.damage = (float)(cmdBlastDmg.Value / 100) * component.damage * num;
damageInfo.procCoefficient = cmdBlastProc.Value;
}
if (((Enum)damageInfo.damageType.damageSource).HasFlag((Enum)(object)(DamageSource)8) && component.skillLocator.special.skillDef.skillNameToken == "COMMANDO_SPECIAL_NAME")
{
damageInfo.damage = (float)(cmdSuppDmg.Value / 100) * component.damage * num;
damageInfo.procCoefficient = cmdSuppProc.Value;
}
}
else if (component.baseNameToken == "HUNTRESS_BODY_NAME")
{
if (((Enum)damageInfo.damageType.damageSource).HasFlag((Enum)(object)(DamageSource)8) && component.skillLocator.special.skillDef.skillNameToken == "HUNTRESS_SPECIAL_ALT1_NAME")
{
damageInfo.damage = (float)(huntBallistaDmg.Value / 100) * component.damage;
damageInfo.procCoefficient = huntBallistaProc.Value;
}
}
else if (component.baseNameToken == "BANDIT2_BODY_NAME")
{
if (((Enum)damageInfo.damageType.damageSource).HasFlag((Enum)(object)(DamageSource)1))
{
if (component.skillLocator.primary.skillDef.skillNameToken == "BANDIT2_PRIMARY_NAME")
{
damageInfo.damage = (float)(bandBurstDmg.Value / 100) * component.damage * num;
damageInfo.procCoefficient = bandBurstProc.Value;
}
else if (component.skillLocator.primary.skillDef.skillNameToken == "BANDIT2_PRIMARY_ALT_NAME")
{
damageInfo.damage = (float)(bandBlastDmg.Value / 100) * component.damage;
damageInfo.procCoefficient = bandBlastProc.Value;
}
}
if (((Enum)damageInfo.damageType.damageSource).HasFlag((Enum)(object)(DamageSource)8))
{
if (component.skillLocator.special.skillDef.skillNameToken == "BANDIT2_SPECIAL_NAME")
{
damageInfo.damage = (float)(bandLightsOutDmg.Value / 100) * component.damage;
damageInfo.procCoefficient = bandLightsOutProc.Value;
}
else if (component.skillLocator.special.skillDef.skillNameToken == "BANDIT2_SPECIAL_ALT_NAME")
{
damageInfo.procCoefficient = bandDesperadoProc.Value;
damageInfo.damage = (float)(bandDesperadoDmg.Value / 100) * component.damage;
int buffCount = component.GetBuffCount(Buffs.BanditSkull);
damageInfo.damage *= 1f + (float)(bandDesperadoBuff.Value / 100 * buffCount);
Log.Info(damageInfo.damage);
}
}
}
}
}
return damageInfo;
}
}
public class CustomProjectileDamageModifier : MonoBehaviour
{
public string dmgTypeName;
private void Start()
{
ProjectileDamage component = ((Component)this).GetComponent<ProjectileDamage>();
ProjectileController component2 = ((Component)this).GetComponent<ProjectileController>();
if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component2))
{
return;
}
CharacterBody component3 = component2.owner.GetComponent<CharacterBody>();
if (!Object.op_Implicit((Object)(object)component3))
{
return;
}
string text = dmgTypeName;
if (!(text == "fmj"))
{
if (text == "shiv")
{
component.damage = (float)GameTweaks.bandShivDmg.Value / 100f * component3.damage;
}
}
else
{
component.damage = (float)GameTweaks.cmdRoundDmg.Value / 100f * component3.damage;
}
}
}
public static class EntityStateConfigurationExtensions
{
public static bool TryModifyFieldValue<T>(this EntityStateConfiguration entityStateConfiguration, string fieldName, T value)
{
ref SerializedField orCreateField = ref ((SerializedFieldCollection)(ref entityStateConfiguration.serializedFieldsCollection)).GetOrCreateField(fieldName);
if (Object.op_Implicit(orCreateField.fieldValue.objectValue) && typeof(Object).IsAssignableFrom(typeof(T)))
{
ref Object objectValue = ref orCreateField.fieldValue.objectValue;
object obj = value;
objectValue = (Object)((obj is Object) ? obj : null);
return true;
}
if (orCreateField.fieldValue.stringValue != null && StringSerializer.CanSerializeType(typeof(T)))
{
orCreateField.fieldValue.stringValue = StringSerializer.Serialize(typeof(T), (object)value);
return true;
}
Debug.LogError((object)("Failed to modify field " + fieldName));
return false;
}
public static bool TryGetFieldValue<T>(this EntityStateConfiguration entityStateConfiguration, string fieldName, out T value) where T : Object
{
ref SerializedField orCreateField = ref ((SerializedFieldCollection)(ref entityStateConfiguration.serializedFieldsCollection)).GetOrCreateField(fieldName);
if (Object.op_Implicit(orCreateField.fieldValue.objectValue) && typeof(Object).IsAssignableFrom(typeof(T)))
{
value = (T)(object)orCreateField.fieldValue.objectValue;
return true;
}
if (!string.IsNullOrEmpty(orCreateField.fieldValue.stringValue))
{
Debug.LogError((object)("Failed to return " + fieldName + " as an Object, try getting the string value instead."));
}
else
{
Debug.LogError((object)("Field is null " + fieldName));
}
value = default(T);
return false;
}
public static bool TryGetFieldValueString<T>(this EntityStateConfiguration entityStateConfiguration, string fieldName, out T value) where T : IEquatable<T>
{
ref SerializedField orCreateField = ref ((SerializedFieldCollection)(ref entityStateConfiguration.serializedFieldsCollection)).GetOrCreateField(fieldName);
if (orCreateField.fieldValue.stringValue != null && StringSerializer.CanSerializeType(typeof(T)))
{
value = (T)StringSerializer.Deserialize(typeof(T), orCreateField.fieldValue.stringValue);
return true;
}
if (Object.op_Implicit(orCreateField.fieldValue.objectValue))
{
Debug.LogError((object)("Failed to return " + fieldName + " as a string, try getting the Object value instead."));
}
else
{
Debug.LogError((object)("Field is null " + fieldName));
}
value = default(T);
return false;
}
}
internal static class Log
{
private 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);
}
}
}