using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Cryptography;
using System.Security.Permissions;
using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using BepInEx.Unity.IL2CPP.Utils.Collections;
using Bloodcraft.Commands;
using Bloodcraft.Interfaces;
using Bloodcraft.Patches;
using Bloodcraft.Resources;
using Bloodcraft.Services;
using Bloodcraft.Systems;
using Bloodcraft.Systems.Expertise;
using Bloodcraft.Systems.Familiars;
using Bloodcraft.Systems.Legacies;
using Bloodcraft.Systems.Leveling;
using Bloodcraft.Systems.Professions;
using Bloodcraft.Systems.Quests;
using Bloodcraft.Utilities;
using HarmonyLib;
using Il2CppInterop.Runtime;
using Il2CppInterop.Runtime.Injection;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSystem;
using Il2CppSystem.Collections.Generic;
using Il2CppSystem.Text;
using Microsoft.CodeAnalysis;
using ProjectM;
using ProjectM.AimPreviewSplines.Component;
using ProjectM.Audio;
using ProjectM.Behaviours;
using ProjectM.CastleBuilding;
using ProjectM.CastleBuilding.AssetSwapping;
using ProjectM.CastleBuilding.Items;
using ProjectM.CastleBuilding.Placement;
using ProjectM.CastleBuilding.Rebuilding;
using ProjectM.Community;
using ProjectM.Debugging;
using ProjectM.Gameplay;
using ProjectM.Gameplay.Clan;
using ProjectM.Gameplay.Scripting;
using ProjectM.Gameplay.Systems;
using ProjectM.Gameplay.WarEvents;
using ProjectM.HUD;
using ProjectM.Haptics;
using ProjectM.Hybrid;
using ProjectM.LightningStorm;
using ProjectM.Network;
using ProjectM.Pathfinding;
using ProjectM.Physics;
using ProjectM.Presentation;
using ProjectM.Replays;
using ProjectM.Roofs;
using ProjectM.Scripting;
using ProjectM.Sequencer;
using ProjectM.Sequencer.Debugging;
using ProjectM.Shared;
using ProjectM.Shared.Systems;
using ProjectM.Shared.WarEvents;
using ProjectM.Shared.WorldEvents;
using ProjectM.SunBlocker;
using ProjectM.Terrain;
using ProjectM.Terrain.Editor;
using ProjectM.Tiles;
using ProjectM.Transmog;
using ProjectM.UI;
using ProjectM.Wind;
using Stunlock.Core;
using Stunlock.Core.Authoring;
using Stunlock.Network;
using Stunlock.Sequencer;
using Terrain.Systems;
using Tests;
using Unity.Collections;
using Unity.Deformations;
using Unity.Entities;
using Unity.Entities.Graphics;
using Unity.Entities.Graphics.Extension;
using Unity.Entities.Hybrid.Baking;
using Unity.Entities.Serialization;
using Unity.Jobs;
using Unity.Mathematics;
using Unity.Physics;
using Unity.Physics.Authoring;
using Unity.Physics.GraphicsIntegration;
using Unity.Physics.Systems;
using Unity.Rendering;
using Unity.Scenes;
using Unity.Transforms;
using UnityEngine;
using VampireCommandFramework;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("Bloodcraft.Tests")]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("Bloodcraft")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.12.17.0")]
[assembly: AssemblyInformationalVersion("1.12.17")]
[assembly: AssemblyProduct("Bloodcraft")]
[assembly: AssemblyTitle("Bloodcraft")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.12.17.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]
internal sealed class IsUnmanagedAttribute : Attribute
{
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
[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 Bloodcraft
{
internal static class Core
{
private static MonoBehaviour _monoBehaviour;
private static readonly List<PrefabGUID> _returnBuffs = new List<PrefabGUID>
{
PrefabGUIDs.Buff_Shared_Return,
PrefabGUIDs.Buff_Shared_Return_NoInvulernable,
PrefabGUIDs.Buff_Vampire_BloodKnight_Return,
PrefabGUIDs.Buff_Vampire_Dracula_Return,
PrefabGUIDs.Buff_Dracula_Return,
PrefabGUIDs.Buff_WerewolfChieftain_Return,
PrefabGUIDs.Buff_Werewolf_Return,
PrefabGUIDs.Buff_Monster_Return,
PrefabGUIDs.Buff_Purifier_Return,
PrefabGUIDs.Buff_Blackfang_Morgana_Return,
PrefabGUIDs.Buff_ChurchOfLight_Paladin_Return,
PrefabGUIDs.Buff_Gloomrot_Voltage_Return,
PrefabGUIDs.Buff_Militia_Fabian_Return
};
private static readonly List<PrefabGUID> _bearFormBuffs = new List<PrefabGUID>
{
PrefabGUIDs.AB_Shapeshift_Bear_Buff,
PrefabGUIDs.AB_Shapeshift_Bear_Skin01_Buff
};
private static readonly List<PrefabGUID> _shardBearerDropTables = new List<PrefabGUID>
{
PrefabGUIDs.DT_Unit_Relic_Manticore_Unique,
PrefabGUIDs.DT_Unit_Relic_Paladin_Unique,
PrefabGUIDs.DT_Unit_Relic_Monster_Unique,
PrefabGUIDs.DT_Unit_Relic_Dracula_Unique,
PrefabGUIDs.DT_Unit_Relic_Morgana_Unique
};
private static readonly bool _leveling = ConfigService.LevelingSystem;
private static readonly bool _legacies = ConfigService.LegacySystem;
private static readonly bool _expertise = ConfigService.ExpertiseSystem;
private static readonly bool _classes = ConfigService.ClassSystem;
private static readonly bool _familiars = ConfigService.FamiliarSystem;
private static readonly bool _resetShardBearers = ConfigService.EliteShardBearers;
private static readonly bool _shouldApplyBonusStats = _legacies || _expertise || _classes || _familiars;
private static HashSet<WeaponType> _bleedingEdge = new HashSet<WeaponType>();
private static HashSet<Profession> _disabledProfessions = new HashSet<Profession>();
private const int SECONDARY_SKILL_SLOT = 4;
private const int BLEED_STACKS = 3;
private static bool _initialized;
private static readonly HashSet<PrefabGUID> _shardBearers = new HashSet<PrefabGUID>
{
PrefabGUIDs.CHAR_Manticore_VBlood,
PrefabGUIDs.CHAR_ChurchOfLight_Paladin_VBlood,
PrefabGUIDs.CHAR_Gloomrot_Monster_VBlood,
PrefabGUIDs.CHAR_Vampire_Dracula_VBlood,
PrefabGUIDs.CHAR_Blackfang_Morgana_VBlood
};
public static World Server { get; } = GetServerWorld() ?? throw new Exception("There is no Server world!");
public static EntityManager EntityManager => Server.EntityManager;
public static ServerGameManager ServerGameManager => SystemService.ServerScriptMapper.GetServerGameManager();
public static SystemService SystemService { get; } = new SystemService(Server);
public static ServerGameBalanceSettings ServerGameBalanceSettings { get; set; }
public static bool IsPvP => (int)ServerGameBalanceSettings.GameModeType == 1;
public static double ServerTime => ServerGameManager.ServerTime;
public static double DeltaTime => ServerGameManager.DeltaTime;
public static ManualLogSource Log => Plugin.LogInstance;
public static bool Eclipsed { get; } = _leveling || _legacies || _expertise || _classes || _familiars;
public static IReadOnlySet<WeaponType> BleedingEdge => _bleedingEdge;
public static IReadOnlySet<Profession> DisabledProfessions => _disabledProfessions;
public static byte[] NEW_SHARED_KEY { get; set; }
public static bool IsReady => _initialized;
public static void Initialize()
{
//IL_0191: Unknown result type (might be due to invalid IL or missing references)
//IL_0197: Expected O, but got Unknown
//IL_0170: Unknown result type (might be due to invalid IL or missing references)
//IL_0175: Unknown result type (might be due to invalid IL or missing references)
if (_initialized)
{
return;
}
NEW_SHARED_KEY = Convert.FromBase64String(SecretManager.GetNewSharedKey());
if (!ComponentRegistry._initialized)
{
ComponentRegistry.Initialize();
}
new PlayerService();
new LocalizationService();
if (Eclipsed)
{
new EclipseService();
}
if (ConfigService.ExtraRecipes)
{
Recipes.ModifyRecipes();
}
if (ConfigService.StarterKit)
{
Configuration.GetStarterKitItems();
}
if (ConfigService.PrestigeSystem)
{
Buffs.GetPrestigeBuffs();
}
if (ConfigService.ClassSystem)
{
Configuration.GetClassSpellCooldowns();
Classes.GetAbilityJewels();
}
if (ConfigService.LevelingSystem)
{
DeathEventListenerSystemPatch.OnDeathEventHandler += LevelingSystem.OnUpdate;
}
if (ConfigService.ExpertiseSystem)
{
DeathEventListenerSystemPatch.OnDeathEventHandler += WeaponSystem.OnUpdate;
}
if (ConfigService.QuestSystem)
{
new QuestService();
DeathEventListenerSystemPatch.OnDeathEventHandler += QuestSystem.OnUpdate;
}
if (ConfigService.FamiliarSystem)
{
Configuration.GetExcludedFamiliars();
if (!ConfigService.LevelingSystem)
{
DeathEventListenerSystemPatch.OnDeathEventHandler += FamiliarLevelingSystem.OnUpdate;
}
DeathEventListenerSystemPatch.OnDeathEventHandler += FamiliarUnlockSystem.OnUpdate;
new BattleService();
new FamiliarService();
}
if (ConfigService.ProfessionSystem)
{
GetDisabledProfessions();
}
GetBleedingEdgeWeapons();
ModifyPrefabs();
Buffs.GetStackableBuffs();
try
{
ServerGameBalanceSettings = ServerGameBalanceSettings.Get(SystemService.ServerGameSettingsSystem._ServerBalanceSettings);
Progression.GetAttributeCaps();
}
catch (Exception ex)
{
ManualLogSource log = Log;
bool flag = default(bool);
BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(35, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Error getting attribute soft caps: ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Exception>(ex);
}
log.LogWarning(val);
}
if (_resetShardBearers)
{
ResetShardBearers();
}
_initialized = true;
}
private static World GetServerWorld()
{
return ((IEnumerable<World>)World.s_AllWorlds.ToArray()).FirstOrDefault((Func<World, bool>)((World world) => world.Name == "Server"));
}
private static MonoBehaviour GetOrCreateMonoBehaviour()
{
return _monoBehaviour ?? (_monoBehaviour = CreateMonoBehaviour());
}
private static MonoBehaviour CreateMonoBehaviour()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
IgnorePhysicsDebugSystem obj = new GameObject("Bloodcraft").AddComponent<IgnorePhysicsDebugSystem>();
Object.DontDestroyOnLoad((Object)(object)((Component)obj).gameObject);
return (MonoBehaviour)(object)obj;
}
public static Coroutine StartCoroutine(IEnumerator routine)
{
return GetOrCreateMonoBehaviour().StartCoroutine(CollectionExtensions.WrapToIl2Cpp(routine));
}
public static void StopCoroutine(Coroutine routine)
{
GetOrCreateMonoBehaviour().StopCoroutine(routine);
}
public static void Delayed(Action action, float delay = 0.25f)
{
RunDelayed(delay, action).Run();
}
private static IEnumerator RunDelayed(float delay, Action action)
{
yield return (object)new WaitForSeconds(delay);
action?.Invoke();
}
public static AddItemSettings GetAddItemSettings()
{
//IL_0002: 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_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
AddItemSettings result = default(AddItemSettings);
result.EntityManager = EntityManager;
result.DropRemainder = true;
ServerGameManager serverGameManager = ServerGameManager;
result.ItemDataMap = ((ServerGameManager)(ref serverGameManager)).ItemLookupMap;
result.EquipIfPossible = true;
return result;
}
private static void GetBleedingEdgeWeapons()
{
HashSet<WeaponType> hashSet = new HashSet<WeaponType>();
foreach (WeaponType item in Configuration.ParseEnumsFromString<WeaponType>(ConfigService.BleedingEdge))
{
hashSet.Add(item);
}
_bleedingEdge = hashSet;
}
public static void GetDisabledProfessions()
{
HashSet<Profession> hashSet = new HashSet<Profession>();
foreach (Profession item in Configuration.ParseEnumsFromString<Profession>(ConfigService.DisabledProfessions))
{
hashSet.Add(item);
}
_disabledProfessions = hashSet;
}
private static void ModifyPrefabs()
{
//IL_0011: 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)
//IL_0019: 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_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: 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_00e3: Unknown result type (might be due to invalid IL or missing references)
//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
//IL_0100: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_0074: Unknown result type (might be due to invalid IL or missing references)
//IL_0080: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
//IL_0093: Unknown result type (might be due to invalid IL or missing references)
//IL_03b1: Unknown result type (might be due to invalid IL or missing references)
//IL_03b6: Unknown result type (might be due to invalid IL or missing references)
//IL_03b9: Unknown result type (might be due to invalid IL or missing references)
//IL_027c: Unknown result type (might be due to invalid IL or missing references)
//IL_0281: Unknown result type (might be due to invalid IL or missing references)
//IL_0284: Unknown result type (might be due to invalid IL or missing references)
//IL_0128: Unknown result type (might be due to invalid IL or missing references)
//IL_012d: Unknown result type (might be due to invalid IL or missing references)
//IL_0139: Unknown result type (might be due to invalid IL or missing references)
//IL_013e: Unknown result type (might be due to invalid IL or missing references)
//IL_0141: 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)
//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
//IL_03c7: Unknown result type (might be due to invalid IL or missing references)
//IL_02df: Unknown result type (might be due to invalid IL or missing references)
//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
//IL_0301: Unknown result type (might be due to invalid IL or missing references)
//IL_0306: Unknown result type (might be due to invalid IL or missing references)
//IL_0312: Unknown result type (might be due to invalid IL or missing references)
//IL_0317: Unknown result type (might be due to invalid IL or missing references)
//IL_031e: Unknown result type (might be due to invalid IL or missing references)
//IL_0292: Unknown result type (might be due to invalid IL or missing references)
//IL_014c: Unknown result type (might be due to invalid IL or missing references)
//IL_0363: Unknown result type (might be due to invalid IL or missing references)
//IL_0368: Unknown result type (might be due to invalid IL or missing references)
//IL_036b: Unknown result type (might be due to invalid IL or missing references)
//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
//IL_015a: Unknown result type (might be due to invalid IL or missing references)
//IL_015f: Unknown result type (might be due to invalid IL or missing references)
//IL_0163: Unknown result type (might be due to invalid IL or missing references)
//IL_0168: Unknown result type (might be due to invalid IL or missing references)
//IL_0170: Unknown result type (might be due to invalid IL or missing references)
//IL_0379: 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)
//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
//IL_0206: Unknown result type (might be due to invalid IL or missing references)
//IL_021c: Unknown result type (might be due to invalid IL or missing references)
//IL_0232: Unknown result type (might be due to invalid IL or missing references)
if (ConfigService.LevelingSystem)
{
Entity entity = default(Entity);
if (SystemService.PrefabCollectionSystem._PrefabGuidToEntityMap.TryGetValue(PrefabGUIDs.Item_EquipBuff_Shared_General, ref entity))
{
entity.Add<ScriptSpawn>();
}
if (SystemService.PrefabCollectionSystem._PrefabGuidToEntityMap.TryGetValue(PrefabGUIDs.Item_EquipBuff_MagicSource_BloodKey_T01, ref entity))
{
entity.Add<ScriptSpawn>();
}
}
if (ConfigService.FamiliarSystem)
{
Entity @null = Entity.Null;
foreach (PrefabGUID returnBuff in _returnBuffs)
{
if (SystemService.PrefabCollectionSystem._PrefabGuidToEntityMap.TryGetValue(returnBuff, ref @null) && @null.TryGetBuffer<HealOnGameplayEvent>(out DynamicBuffer<HealOnGameplayEvent> dynamicBuffer))
{
HealOnGameplayEvent val = dynamicBuffer[0];
val.showSCT = false;
dynamicBuffer[0] = val;
}
}
}
Entity entity2 = default(Entity);
if (_shouldApplyBonusStats && SystemService.PrefabCollectionSystem._PrefabGuidToEntityMap.TryGetValue(Buffs.BonusStatsBuff, ref entity2))
{
entity2.Add<ScriptSpawn>();
if (entity2.TryGetBuffer<ModifyUnitStatBuff_DOTS>(out DynamicBuffer<ModifyUnitStatBuff_DOTS> dynamicBuffer2))
{
dynamicBuffer2.Clear();
}
}
if (ConfigService.BearFormDash)
{
Entity entity3 = default(Entity);
foreach (PrefabGUID bearFormBuff in _bearFormBuffs)
{
if (SystemService.PrefabCollectionSystem._PrefabGuidToEntityMap.TryGetValue(bearFormBuff, ref entity3) && entity3.TryGetBuffer<ReplaceAbilityOnSlotBuff>(out DynamicBuffer<ReplaceAbilityOnSlotBuff> dynamicBuffer3))
{
ReplaceAbilityOnSlotBuff val2 = dynamicBuffer3[4];
val2.NewGroupId = PrefabGUIDs.AB_Shapeshift_Bear_Dash_Group;
dynamicBuffer3[4] = val2;
}
}
}
if (ConfigService.EliteShardBearers && !IsPvP)
{
Entity entity4 = default(Entity);
foreach (PrefabGUID shardBearerDropTable in _shardBearerDropTables)
{
if (SystemService.PrefabCollectionSystem._PrefabGuidToEntityMap.TryGetValue(shardBearerDropTable, ref entity4) && entity4.TryGetBuffer<DropTableDataBuffer>(out DynamicBuffer<DropTableDataBuffer> dynamicBuffer4) && !dynamicBuffer4.IsEmpty)
{
DropTableDataBuffer val3 = dynamicBuffer4[0];
val3.DropRate = 0.6f;
dynamicBuffer4.Add(val3);
val3.DropRate = 0.45f;
dynamicBuffer4.Add(val3);
val3.DropRate = 0.3f;
dynamicBuffer4.Add(val3);
}
}
}
if (BleedingEdge.Any())
{
Entity entity5 = default(Entity);
if (BleedingEdge.Contains(WeaponType.Slashers) && SystemService.PrefabCollectionSystem._PrefabGuidToEntityMap.TryGetValue(Buffs.VargulfBleedBuff, ref entity5))
{
entity5.With<Buff>((VExtensions.WithRefHandler<Buff>)delegate(ref Buff buff)
{
buff.MaxStacks = 3;
buff.IncreaseStacks = true;
});
}
if (BleedingEdge.Contains(WeaponType.Crossbow, WeaponType.Pistols))
{
ComponentType[] allTypes = (ComponentType[])(object)new ComponentType[4]
{
ComponentType.ReadOnly(Il2CppType.Of<PrefabGUID>()),
ComponentType.ReadOnly(Il2CppType.Of<Projectile>()),
ComponentType.ReadOnly(Il2CppType.Of<LifeTime>()),
ComponentType.ReadOnly(Il2CppType.Of<Velocity>())
};
BleedingEdgePrimaryProjectileRoutine(EntityManager.CreateQueryDesc(allTypes, null, null, new int[1], (EntityQueryOptions)195)).Run();
}
Entity entity6 = default(Entity);
if (BleedingEdge.Contains(WeaponType.Daggers) && SystemService.PrefabCollectionSystem._PrefabGuidToEntityMap.TryGetValue(PrefabGUIDs.EquipBuff_Weapon_Daggers_Ability03, ref entity6))
{
entity6.With<RemoveBuffOnGameplayEventEntry>(0, (VExtensions.WithRefHandler<RemoveBuffOnGameplayEventEntry>)delegate(ref RemoveBuffOnGameplayEventEntry removeBuffOnGameplayEventEntry)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
removeBuffOnGameplayEventEntry.Buff = PrefabIdentifier.Empty;
});
}
}
Entity entity7 = default(Entity);
if (ConfigService.TwilightArsenal && SystemService.PrefabCollectionSystem._PrefabGuidToEntityMap.TryGetValue(PrefabGUIDs.Item_Weapon_Axe_T09_ShadowMatter, ref entity7))
{
entity7.With<EquippableData>((VExtensions.WithRefHandler<EquippableData>)delegate(ref EquippableData equippableData)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
equippableData.BuffGuid = PrefabGUIDs.EquipBuff_Weapon_DualHammers_Ability03;
});
}
}
private static void ResetShardBearers()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: Unknown result type (might be due to invalid IL or missing references)
//IL_009c: Expected O, but got Unknown
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
ComponentType[] all = (ComponentType[])(object)new ComponentType[3]
{
ComponentType.ReadOnly(Il2CppType.Of<PrefabGUID>()),
ComponentType.ReadOnly(Il2CppType.Of<VBloodConsumeSource>()),
ComponentType.ReadOnly(Il2CppType.Of<VBloodUnit>())
};
using NativeAccessor<Entity> nativeAccessor = EntityManager.BuildEntityQuery(all, (EntityQueryOptions)2).ToEntityArrayAccessor((Allocator)2);
try
{
Enumerator<Entity> enumerator = nativeAccessor.GetEnumerator();
while (enumerator.MoveNext())
{
Entity current = enumerator.Current;
if (current.TryGetComponent<PrefabGUID>(out PrefabGUID componentData) && _shardBearers.Contains(componentData))
{
current.Destroy();
}
}
}
catch (Exception ex)
{
ManualLogSource log = Log;
bool flag = default(bool);
BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(27, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[ResetShardBearers] error: ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Exception>(ex);
}
log.LogWarning(val);
}
}
private static IEnumerator BleedingEdgePrimaryProjectileRoutine(EntityQueries.QueryDesc projectileQueryDesc)
{
bool pistols = BleedingEdge.Contains(WeaponType.Pistols);
bool crossbow = BleedingEdge.Contains(WeaponType.Crossbow);
yield return EntityQueries.QueryResultStreamAsync(projectileQueryDesc, delegate(EntityQueries.QueryResultStream stream)
{
//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
//IL_00fc: Expected O, but got Unknown
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: Unknown result type (might be due to invalid IL or missing references)
//IL_0063: Unknown result type (might be due to invalid IL or missing references)
try
{
using (stream)
{
foreach (EntityQueries.QueryResult result in stream.GetResults())
{
Entity entity = result.Entity;
string prefabName = result.ResolveComponentData<PrefabGUID>().GetPrefabName();
if (pistols && IsWeaponPrimaryProjectile(prefabName, WeaponType.Pistols))
{
entity.With<Projectile>((VExtensions.WithRefHandler<Projectile>)delegate(ref Projectile projectile)
{
projectile.Range *= 1.25f;
});
entity.HasWith<LifeTime>((VExtensions.WithRefHandler<LifeTime>)delegate(ref LifeTime lifeTime)
{
lifeTime.Duration *= 1.25f;
});
}
else if (crossbow && IsWeaponPrimaryProjectile(prefabName, WeaponType.Crossbow))
{
entity.With<Projectile>((VExtensions.WithRefHandler<Projectile>)delegate(ref Projectile projectile)
{
projectile.Speed = 100f;
});
}
}
}
}
catch (Exception ex)
{
ManualLogSource log = Log;
bool flag = default(bool);
BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(41, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[BleedingEdgePrimaryProjectileRoutine] - ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Exception>(ex);
}
log.LogWarning(val);
}
});
}
private static bool IsWeaponPrimaryProjectile(string prefabName, WeaponType weaponType)
{
return prefabName.ContainsAll(new List<string>
{
weaponType.ToString(),
"Primary",
"Projectile"
});
}
public static void DumpEntity(this Entity entity, World world)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Expected O, but got Unknown
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Expected O, but got Unknown
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Expected O, but got Unknown
StringBuilder val = new StringBuilder();
bool flag = default(bool);
try
{
EntityDebuggingUtility.DumpEntity(world, entity, true, val);
ManualLogSource log = Log;
BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(13, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Entity Dump:\n");
((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(((Object)val).ToString());
}
log.LogInfo(val2);
}
catch (Exception ex)
{
ManualLogSource log2 = Log;
BepInExWarningLogInterpolatedStringHandler val3 = new BepInExWarningLogInterpolatedStringHandler(22, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("Error dumping entity: ");
((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(ex.Message);
}
log2.LogWarning(val3);
}
}
}
public struct NativeAccessor<T> : IDisposable where T : unmanaged
{
private NativeArray<T> _array;
public T this[int index]
{
get
{
return _array[index];
}
set
{
_array[index] = value;
}
}
public int Length => _array.Length;
public NativeAccessor(NativeArray<T> array)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
_array = array;
}
public Enumerator<T> GetEnumerator()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
return _array.GetEnumerator();
}
public void Dispose()
{
_array.Dispose();
}
}
internal static class GenerateREADME
{
private static readonly Regex _commandGroupRegex = new Regex("\\[CommandGroup\\((?<args>.*?)\\)\\]", RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.Singleline);
private static readonly Regex _commandAttributeRegex = new Regex("\\[Command\\((?<args>.*?)\\)\\]", RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.Singleline);
private static readonly Regex _argPairRegex = new Regex("\\b(?<key>\\w+)\\s*:\\s*(?<value>\\\"[^\\\"]*\\\"|[^,\\)\\r\\n]+)", RegexOptions.IgnoreCase | RegexOptions.Compiled);
private const string COMMANDS_HEADER = "## Chat Commands";
private const string CONFIG_HEADER = "## Configuration";
private static readonly Dictionary<(string groupName, string groupShort), List<(string name, string shortHand, bool adminOnly, string usage, string description)>> _commandsByGroup = new Dictionary<(string, string), List<(string, string, bool, string, string)>>();
private static string CommandsPath { get; set; }
private static string ReadMePath { get; set; }
public static void Main(string[] args)
{
if (Environment.GetEnvironmentVariable("GITHUB_ACTIONS") == "true")
{
Console.WriteLine("GenerateREADME skipped during GitHub Actions build.");
return;
}
if (args.Length < 2)
{
Console.WriteLine("Usage: GenerateREADME <CommandsPath> <ReadMePath>");
return;
}
CommandsPath = args[0];
ReadMePath = args[1];
try
{
Generate();
Console.WriteLine("README generated successfully.");
}
catch (Exception ex)
{
Console.WriteLine("Error generating README: " + ex.Message);
}
}
private static void Generate()
{
CollectCommands();
string commandsSection = BuildCommandsSection();
string configSection = BuildConfigSection();
UpdateReadme(commandsSection, configSection);
}
private static void CollectCommands()
{
foreach (string item in from file in Directory.GetFiles(CommandsPath, "*.cs")
where !Path.GetFileName(file).Equals("DevCommands.cs", StringComparison.CurrentCultureIgnoreCase)
select file)
{
string input = File.ReadAllText(item);
Match match = _commandGroupRegex.Match(input);
string args = (match.Success ? match.Groups["args"].Value : string.Empty);
string text = GetStringArg(args, "name");
string stringArg = GetStringArg(args, "short");
if (string.IsNullOrEmpty(stringArg))
{
stringArg = GetStringArg(args, "shortHand");
}
if (string.IsNullOrEmpty(text))
{
text = "misc";
}
if (!_commandsByGroup.TryGetValue((text, stringArg), out List<(string, string, bool, string, string)> value))
{
value = new List<(string, string, bool, string, string)>();
_commandsByGroup[(text, stringArg)] = value;
}
foreach (Match item2 in _commandAttributeRegex.Matches(input))
{
string value2 = item2.Groups["args"].Value;
string stringArg2 = GetStringArg(value2, "name");
string stringArg3 = GetStringArg(value2, "shortHand");
bool boolArg = GetBoolArg(value2, "adminOnly");
string stringArg4 = GetStringArg(value2, "usage");
string stringArg5 = GetStringArg(value2, "description");
value.Add((stringArg2, stringArg3, boolArg, stringArg4, stringArg5));
}
}
foreach (var item3 in _commandsByGroup.Keys.ToList())
{
(string, string) key = item3;
List<(string, string, bool, string, string)> list = new List<(string, string, bool, string, string)>();
foreach (var item4 in _commandsByGroup[item3].OrderBy<(string, string, bool, string, string), string>(((string name, string shortHand, bool adminOnly, string usage, string description) c) => c.name, StringComparer.CurrentCultureIgnoreCase))
{
list.Add(item4);
}
_commandsByGroup[key] = list;
}
}
private static string BuildCommandsSection()
{
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.AppendLine("## Chat Commands").AppendLine();
foreach (var item8 in _commandsByGroup.Keys.OrderBy(((string groupName, string groupShort) g) => g.groupName))
{
string item = item8.groupName;
string item2 = item8.groupShort;
StringBuilder stringBuilder2 = stringBuilder;
StringBuilder stringBuilder3 = stringBuilder2;
StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(13, 1, stringBuilder2);
handler.AppendLiteral("### ");
handler.AppendFormatted(Capitalize(item));
handler.AppendLiteral(" Commands");
stringBuilder3.AppendLine(ref handler);
foreach (var item9 in _commandsByGroup[(item, item2)])
{
string item3 = item9.name;
string item4 = item9.shortHand;
bool item5 = item9.adminOnly;
string item6 = item9.usage;
string item7 = item9.description;
bool flag = !string.IsNullOrEmpty(item4);
string text = (string.IsNullOrEmpty(item6) ? ("." + (string.IsNullOrEmpty(item2) ? item : item2) + " " + (flag ? item4 : item3)) : item6);
string text2 = string.Empty;
string[] array = text.Split(' ', 3, StringSplitOptions.RemoveEmptyEntries);
if (array.Length >= 3)
{
text2 = array[2];
}
else if (array.Length == 2 && array[1].StartsWith("["))
{
text2 = array[1];
}
string value = (item5 ? " \ud83d\udd12" : string.Empty);
string value2 = ((text2.Length > 0) ? $"- `.{item} {item3} {text2}`{value}" : $"- `.{item} {item3}`{value}");
stringBuilder.AppendLine(value2);
if (!string.IsNullOrEmpty(item7))
{
stringBuilder2 = stringBuilder;
StringBuilder stringBuilder4 = stringBuilder2;
handler = new StringBuilder.AppendInterpolatedStringHandler(4, 1, stringBuilder2);
handler.AppendLiteral(" - ");
handler.AppendFormatted(item7);
stringBuilder4.AppendLine(ref handler);
}
stringBuilder2 = stringBuilder;
StringBuilder stringBuilder5 = stringBuilder2;
handler = new StringBuilder.AppendInterpolatedStringHandler(16, 1, stringBuilder2);
handler.AppendLiteral(" - Shortcut: *");
handler.AppendFormatted(text);
handler.AppendLiteral("*");
stringBuilder5.AppendLine(ref handler);
}
stringBuilder.AppendLine();
}
return stringBuilder.ToString();
}
private static string BuildConfigSection()
{
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.AppendLine("## Configuration");
stringBuilder.AppendLine();
List<IGrouping<string, ConfigService.ConfigInitialization.ConfigEntryDefinition>> list = (from entry in ConfigService.ConfigInitialization.ConfigEntries
group entry by entry.Section into @group
orderby ConfigService.ConfigInitialization.SectionOrder.IndexOf(@group.Key)
select @group).ToList();
foreach (IGrouping<string, ConfigService.ConfigInitialization.ConfigEntryDefinition> item in list)
{
StringBuilder stringBuilder2 = stringBuilder;
StringBuilder stringBuilder3 = stringBuilder2;
StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(4, 1, stringBuilder2);
handler.AppendLiteral("### ");
handler.AppendFormatted(item.Key);
stringBuilder3.AppendLine(ref handler);
foreach (ConfigService.ConfigInitialization.ConfigEntryDefinition item2 in item)
{
string value = ((item2.DefaultValue is string text) ? ("\"" + text + "\"") : item2.DefaultValue.ToString());
string text2 = item2.DefaultValue.GetType().Name.ToLower();
switch (text2)
{
case "boolean":
text2 = "bool";
break;
case "single":
text2 = "float";
break;
case "int32":
text2 = "int";
break;
}
stringBuilder2 = stringBuilder;
StringBuilder stringBuilder4 = stringBuilder2;
handler = new StringBuilder.AppendInterpolatedStringHandler(24, 4, stringBuilder2);
handler.AppendLiteral("- **");
handler.AppendFormatted(AddSpacesToCamelCase(item2.Key));
handler.AppendLiteral("**: `");
handler.AppendFormatted(item2.Key);
handler.AppendLiteral("` (");
handler.AppendFormatted(text2);
handler.AppendLiteral(", default: ");
handler.AppendFormatted(value);
handler.AppendLiteral(")");
stringBuilder4.AppendLine(ref handler);
if (!string.IsNullOrEmpty(item2.Description))
{
stringBuilder2 = stringBuilder;
StringBuilder stringBuilder5 = stringBuilder2;
handler = new StringBuilder.AppendInterpolatedStringHandler(2, 1, stringBuilder2);
handler.AppendLiteral(" ");
handler.AppendFormatted(item2.Description);
stringBuilder5.AppendLine(ref handler);
}
}
if (list.IndexOf(item) < list.Count - 1)
{
stringBuilder.AppendLine();
}
}
return stringBuilder.ToString();
}
private static string AddSpacesToCamelCase(string input)
{
if (string.IsNullOrEmpty(input))
{
return input;
}
StringBuilder stringBuilder = new StringBuilder();
for (int i = 0; i < input.Length; i++)
{
char c = input[i];
bool flag = char.IsUpper(c);
bool num = i > 0;
bool flag2 = num && char.IsLower(input[i - 1]);
bool flag3 = i < input.Length - 1 && char.IsLower(input[i + 1]);
if (num && flag && (flag2 || flag3))
{
stringBuilder.Append(' ');
}
stringBuilder.Append(c);
}
return stringBuilder.ToString();
}
private static void UpdateReadme(string commandsSection, string configSection)
{
bool flag = false;
bool flag2 = false;
bool flag3 = false;
bool flag4 = false;
List<string> list = new List<string>();
try
{
foreach (string item in File.ReadLines(ReadMePath))
{
if (item.Trim().Equals("## Chat Commands", StringComparison.CurrentCultureIgnoreCase))
{
flag = true;
flag3 = true;
list.Add(commandsSection);
continue;
}
if (item.Trim().Equals("## Configuration", StringComparison.CurrentCultureIgnoreCase))
{
flag2 = true;
flag4 = true;
list.Add(configSection);
continue;
}
if (flag && item.Trim().StartsWith("## ", StringComparison.CurrentCultureIgnoreCase) && !item.Trim().Equals("## Chat Commands", StringComparison.CurrentCultureIgnoreCase))
{
flag = false;
}
if (flag2 && item.Trim().StartsWith("## ", StringComparison.CurrentCultureIgnoreCase) && !item.Trim().Equals("## Configuration", StringComparison.CurrentCultureIgnoreCase))
{
flag2 = false;
}
if (!flag && !flag2)
{
list.Add(item);
}
}
if (flag2)
{
list.Add(configSection);
flag2 = false;
}
if (!flag3)
{
list.Add("## Chat Commands");
list.Add(commandsSection);
}
if (!flag4)
{
list.Add("## Configuration");
list.Add(configSection);
}
File.WriteAllLines(ReadMePath, list);
}
catch (Exception ex)
{
Console.Error.WriteLine("Error updating the readme: " + ex.Message);
throw;
}
}
private static string GetStringArg(string args, string key)
{
foreach (Match item in _argPairRegex.Matches(args))
{
if (!item.Groups["key"].Value.Equals(key, StringComparison.CurrentCultureIgnoreCase))
{
continue;
}
string text = item.Groups["value"].Value.Trim();
string result;
if (text.Length > 1 && text[0] == '"')
{
if (text[text.Length - 1] == '"')
{
string text2 = text;
result = text2.Substring(1, text2.Length - 1 - 1);
goto IL_0097;
}
}
result = text;
goto IL_0097;
IL_0097:
return result;
}
return string.Empty;
}
private static bool GetBoolArg(string args, string key)
{
foreach (Match item in _argPairRegex.Matches(args))
{
bool result;
if (string.Equals(item.Groups["key"].Value, key, StringComparison.CurrentCultureIgnoreCase))
{
return bool.TryParse(item.Groups["value"].Value, out result) && result;
}
}
return false;
}
private static string Capitalize(string input)
{
if (!string.IsNullOrEmpty(input))
{
return char.ToUpper(input[0]) + input.Substring(1, input.Length - 1);
}
return input;
}
}
internal static class IExtensions
{
public static Dictionary<TValue, TKey> Reverse<TKey, TValue>(this IDictionary<TKey, TValue> source)
{
Dictionary<TValue, TKey> dictionary = new Dictionary<TValue, TKey>();
foreach (KeyValuePair<TKey, TValue> item in source)
{
dictionary[item.Value] = item.Key;
}
return dictionary;
}
public static Dictionary<TValue, TKey> ReverseIl2CppDictionary<TKey, TValue>(this Dictionary<TKey, TValue> source)
{
Dictionary<TValue, TKey> dictionary = new Dictionary<TValue, TKey>();
if (source == null)
{
return dictionary;
}
Enumerator<TKey, TValue> enumerator = source.GetEnumerator();
while (enumerator.MoveNext())
{
KeyValuePair<TKey, TValue> current = enumerator.Current;
if (!dictionary.ContainsKey(current.Value))
{
dictionary[current.Value] = current.Key;
}
}
return dictionary;
}
public static void ForEach<T>(this IEnumerable<T> collection, Action<T> action)
{
foreach (T item in collection)
{
action(item);
}
}
public static bool IsIndexWithinRange<T>(this IList<T> list, int index)
{
if (index >= 0)
{
return index < list.Count;
}
return false;
}
public static bool ContainsAll(this string stringChars, List<string> strings)
{
foreach (string @string in strings)
{
if (!stringChars.Contains(@string, StringComparison.CurrentCultureIgnoreCase))
{
return false;
}
}
return true;
}
public static T DrawRandom<T>(this IList<T> list)
{
if (list == null || !list.Any())
{
return default(T);
}
int index = new Random((int)Misc.GetRandomSeed()).Next(list.Count);
if (!list.IsIndexWithinRange(index))
{
return default(T);
}
return list[index];
}
public static IEnumerable<IReadOnlyList<T>> Batch<T>(this IReadOnlyList<T> source, int size)
{
if (size <= 0)
{
throw new ArgumentOutOfRangeException("size");
}
List<T> list = (source as List<T>) ?? throw new ArgumentException("Source must be a List<T>.", "source");
for (int i = 0; i < list.Count; i += size)
{
yield return list.GetRange(i, Math.Min(size, list.Count - i));
}
}
public static bool ContainsAny(this string stringChars, List<string> strings, StringComparison stringComparison = StringComparison.CurrentCultureIgnoreCase)
{
foreach (string @string in strings)
{
if (stringChars.Contains(@string, stringComparison))
{
return true;
}
}
return false;
}
public static void Shuffle<T>(this IList<T> list)
{
Random random = new Random((int)Misc.GetRandomSeed());
int num = list.Count;
while (num > 1)
{
num--;
int num2 = random.Next(num + 1);
int index = num;
int index2 = num2;
T value = list[num2];
T value2 = list[num];
list[index] = value;
list[index2] = value2;
}
}
public static bool Equals<T>(this T value, params T[] options) where T : unmanaged
{
foreach (T val in options)
{
if (value.Equals(val))
{
return true;
}
}
return false;
}
public static bool Contains<T>(this IEnumerable<T> source, params T[] values)
{
foreach (T value in values)
{
if (Enumerable.Contains(source, value))
{
return true;
}
}
return false;
}
public static void Run(this IEnumerator routine, float delay = 0f)
{
if (delay > 0f)
{
Core.StartCoroutine(Delay(routine, delay));
}
else
{
Core.StartCoroutine(routine);
}
}
public static IEnumerator Delay(IEnumerator routine, float delay)
{
yield return (object)new WaitForSeconds(delay);
routine.Run();
}
public static Coroutine Start(this IEnumerator routine)
{
return Core.StartCoroutine(routine);
}
public static void Stop(this Coroutine coroutine)
{
Core.StopCoroutine(coroutine);
}
}
[BepInPlugin("io.zfolmt.Bloodcraft", "Bloodcraft", "1.12.17")]
internal class Plugin : BasePlugin
{
private Harmony _harmony;
internal static Plugin Instance { get; set; }
public static Harmony Harmony => Instance._harmony;
internal static ManualLogSource LogInstance => ((BasePlugin)Instance).Log;
public override void Load()
{
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Expected O, but got Unknown
Instance = this;
if (Application.productName != "VRisingServer")
{
LogInstance.LogInfo((object)"Bloodcraft is a server mod and will not continue loading on the client; this is not an error, and likely just means you're using ServerLaunchFix in which case you may disregard this");
return;
}
_harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null);
ConfigService.ConfigInitialization.InitializeConfig();
DataService.PlayerDataInitialization.LoadPlayerData();
CommandRegistry.RegisterAll();
ManualLogSource log = Core.Log;
bool flag = default(bool);
BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(10, 2, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("Bloodcraft");
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("1.12.17");
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("] loaded!");
}
log.LogInfo(val);
}
public override bool Unload()
{
((BasePlugin)this).Config.Clear();
_harmony.UnpatchSelf();
return true;
}
}
internal static class VExtensions
{
public delegate void WithRefHandler<T>(ref T item);
private const string EMPTY_KEY = "LocalizationKey.Empty";
private const string PREFIX = "Entity(";
private const string CHAR = "CHAR_";
private const int LENGTH = 7;
private static EntityManager EntityManager => Core.EntityManager;
private static ServerGameManager ServerGameManager => Core.ServerGameManager;
private static SystemService SystemService => Core.SystemService;
private static DebugEventsSystem DebugEventsSystem => SystemService.DebugEventsSystem;
public static void With<T>(this Entity entity, WithRefHandler<T> action) where T : struct
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: 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)
T item = entity.Read<T>();
action(ref item);
EntityManager entityManager = EntityManager;
((EntityManager)(ref entityManager)).SetComponentData<T>(entity, item);
}
public static void With<T>(this Entity entity, int index, WithRefHandler<T> action) where T : struct
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Expected O, but got Unknown
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
//IL_0063: Expected O, but got Unknown
bool flag = default(bool);
if (!entity.TryGetBuffer<T>(out var dynamicBuffer))
{
ManualLogSource log = Core.Log;
BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(36, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Entity doesn't have DynamicBuffer<");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Type>(typeof(T));
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(">!");
}
log.LogWarning(val);
}
else if (!dynamicBuffer.IsIndexWithinRange<T>(index))
{
ManualLogSource log2 = Core.Log;
BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(49, 3, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Index ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(index);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" out of range for DynamicBuffer<");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Type>(typeof(T));
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(">! Length: ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(dynamicBuffer.Length);
}
log2.LogWarning(val);
}
else
{
T item = dynamicBuffer[index];
action(ref item);
dynamicBuffer[index] = item;
}
}
public static void AddWith<T>(this Entity entity, WithRefHandler<T> action) where T : struct
{
//IL_0000: 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_0008: Unknown result type (might be due to invalid IL or missing references)
if (!entity.Has<T>())
{
entity.Add<T>();
}
entity.With(action);
}
public static void HasWith<T>(this Entity entity, WithRefHandler<T> action) where T : struct
{
//IL_0000: 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)
if (entity.Has<T>())
{
entity.With(action);
}
}
public static void Write<T>(this Entity entity, T componentData) where T : struct
{
//IL_0000: 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)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
EntityManager entityManager = EntityManager;
((EntityManager)(ref entityManager)).SetComponentData<T>(entity, componentData);
}
public static T Read<T>(this Entity entity) where T : struct
{
//IL_0000: 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)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
EntityManager entityManager = EntityManager;
return ((EntityManager)(ref entityManager)).GetComponentData<T>(entity);
}
public static DynamicBuffer<T> ReadBuffer<T>(this Entity entity) where T : struct
{
//IL_0000: 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)
//IL_0008: 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)
EntityManager entityManager = EntityManager;
return ((EntityManager)(ref entityManager)).GetBuffer<T>(entity, false);
}
public static DynamicBuffer<T> AddBuffer<T>(this Entity entity) where T : struct
{
//IL_0000: 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)
//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)
EntityManager entityManager = EntityManager;
return ((EntityManager)(ref entityManager)).AddBuffer<T>(entity);
}
public static bool TryGetComponent<T>(this Entity entity, out T componentData) where T : struct
{
//IL_0007: 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)
componentData = default(T);
if (entity.Has<T>())
{
componentData = entity.Read<T>();
return true;
}
return false;
}
public static bool Has<T>(this Entity entity) where T : struct
{
//IL_0000: 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)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
EntityManager entityManager = EntityManager;
return ((EntityManager)(ref entityManager)).HasComponent(entity, new ComponentType(Il2CppType.Of<T>(), (AccessMode)0));
}
public static bool IsCharacter(this PrefabGUID prefabGuid)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
return prefabGuid.GetPrefabName().StartsWith("CHAR_");
}
public static string GetPrefabName(this PrefabGUID prefabGuid, bool verbose = false)
{
//IL_0005: 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)
if (LocalizationService.PrefabGuidNames.TryGetValue(prefabGuid, out var value))
{
if (!verbose)
{
return $"{value} {prefabGuid}";
}
return value;
}
return "LocalizationKey.Empty";
}
public static string GetSequenceName(this SequenceGUID sequenceGuid)
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
if (!LocalizationService.SequenceGuidNames.TryGetValue(sequenceGuid, out var value))
{
return string.Empty;
}
return value;
}
public static string GetLocalizedName(this PrefabGUID prefabGuid)
{
//IL_0000: 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)
string value = LocalizationService.GetNameFromPrefabGuid(prefabGuid);
if (!string.IsNullOrEmpty(value))
{
return value;
}
if (LocalizationService.PrefabGuidNames.TryGetValue(prefabGuid, out value))
{
return value;
}
return "LocalizationKey.Empty";
}
public static void Add<T>(this Entity entity) where T : struct
{
//IL_0000: 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_0010: 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)
if (!entity.Has<T>())
{
EntityManager entityManager = EntityManager;
((EntityManager)(ref entityManager)).AddComponent(entity, new ComponentType(Il2CppType.Of<T>(), (AccessMode)0));
}
}
public static void Remove<T>(this Entity entity) where T : struct
{
//IL_0000: 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_0010: 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)
if (entity.Has<T>())
{
EntityManager entityManager = EntityManager;
((EntityManager)(ref entityManager)).RemoveComponent(entity, new ComponentType(Il2CppType.Of<T>(), (AccessMode)0));
}
}
public static bool TryGetFollowedPlayer(this Entity entity, out Entity player)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: 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)
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
player = Entity.Null;
if (entity.TryGetComponent<Follower>(out Follower componentData) && componentData.Followed._Value.TryGetPlayer(out player))
{
return true;
}
return false;
}
public static bool TryGetPlayer(this Entity entity, out Entity player)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: 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)
player = Entity.Null;
if (entity.Has<PlayerCharacter>())
{
player = entity;
return true;
}
return false;
}
public static bool IsPlayer(this Entity entity)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
if (entity.Has<PlayerCharacter>())
{
return true;
}
return false;
}
public static bool IsFamiliar(this Entity entity)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
if (entity.Has<BlockFeedBuff>())
{
return true;
}
return false;
}
public static bool IsFollowingPlayer(this Entity entity)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: 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)
if (entity.Has<BlockFeedBuff>() && !entity.Has<Buff>() && !entity.Has<ServantEquipment>())
{
return true;
}
if (entity.TryGetComponent<Follower>(out Follower componentData) && componentData.Followed._Value.IsPlayer())
{
return true;
}
return false;
}
public static bool TryGetAttached(this Entity entity, out Entity attached)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: 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)
//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)
attached = Entity.Null;
if (entity.TryGetComponent<Attach>(out Attach componentData) && componentData.Parent.Exists())
{
attached = componentData.Parent;
return true;
}
return false;
}
public static Entity GetBuffTarget(this Entity entity)
{
//IL_0000: 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)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
return CreateGameplayEventServerUtility.GetBuffTarget(EntityManager, entity);
}
public static Entity GetPrefabEntity(this Entity entity)
{
//IL_0000: 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)
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
if (!entity.Exists())
{
return Entity.Null;
}
ServerGameManager serverGameManager = ServerGameManager;
return ((ServerGameManager)(ref serverGameManager)).GetPrefabEntity(entity.GetPrefabGuid());
}
public static Entity GetPrefabEntity(this PrefabGUID prefabGuid)
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//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_0009: Unknown result type (might be due to invalid IL or missing references)
if (!((PrefabGUID)(ref prefabGuid)).HasValue())
{
return Entity.Null;
}
ServerGameManager serverGameManager = ServerGameManager;
return ((ServerGameManager)(ref serverGameManager)).GetPrefabEntity(prefabGuid);
}
public static Entity GetSpellTarget(this Entity entity)
{
//IL_0000: 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)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
return CreateGameplayEventServerUtility.GetSpellTarget(EntityManager, entity);
}
public static bool TryGetTeamEntity(this Entity entity, out Entity teamEntity)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: 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)
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: 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_002b: Unknown result type (might be due to invalid IL or missing references)
teamEntity = Entity.Null;
if (entity.TryGetComponent<TeamReference>(out TeamReference componentData))
{
Entity value = componentData.Value._Value;
if (value.Exists())
{
teamEntity = value;
return true;
}
}
return false;
}
public static bool Exists(this Entity entity)
{
//IL_0000: 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_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
if (entity.HasValue() && entity.IndexWithinCapacity())
{
EntityManager entityManager = EntityManager;
return ((EntityManager)(ref entityManager)).Exists(entity);
}
return false;
}
public static bool HasValue(this Entity entity)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
return entity != Entity.Null;
}
public static bool IndexWithinCapacity(this Entity entity)
{
//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)
ReadOnlySpan<char> span = ((object)(Entity)(ref entity)).ToString().AsSpan();
if (!span.StartsWith("Entity("))
{
return false;
}
ref ReadOnlySpan<char> reference = ref span;
span = reference.Slice(7, reference.Length - 7);
int num = span.IndexOf(':');
if (num <= 0)
{
return false;
}
reference = ref span;
int result = num + 1;
ReadOnlySpan<char> span2 = reference.Slice(result, reference.Length - result);
int num2 = span2.IndexOf(')');
if (num2 <= 0)
{
return false;
}
if (!int.TryParse(span.Slice(0, num), out var result2))
{
return false;
}
if (!int.TryParse(span2.Slice(0, num2), out result))
{
return false;
}
EntityManager entityManager = EntityManager;
int entityCapacity = ((EntityManager)(ref entityManager)).EntityCapacity;
return (uint)result2 < (uint)entityCapacity;
}
public static bool IsDisabled(this Entity entity)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
return entity.Has<Disabled>();
}
public static bool IsVBlood(this Entity entity)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
return entity.Has<VBloodConsumeSource>();
}
public static bool IsGateBoss(this Entity entity)
{
//IL_0000: 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)
if (entity.Has<VBloodUnit>())
{
return !entity.Has<VBloodConsumeSource>();
}
return false;
}
public static bool IsVBloodOrGateBoss(this Entity entity)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
return entity.Has<VBloodUnit>();
}
public static bool IsLegendary(this Entity entity)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
return entity.Has<LegendaryItemInstance>();
}
public static bool HasSpellLevel(this Entity entity)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
return entity.Has<SpellLevel>();
}
public static bool IsMounter(this Entity entity)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
return entity.Has<UnitMounter>();
}
public static bool IsAncestralWeapon(this Entity entity)
{
//IL_0000: 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)
if (entity.Has<LegendaryItemInstance>())
{
return !entity.IsMagicSource();
}
return false;
}
public static bool IsShardNecklace(this Entity entity)
{
//IL_0000: 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)
if (entity.Has<LegendaryItemInstance>())
{
return entity.IsMagicSource();
}
return false;
}
public static bool IsMagicSource(this Entity entity)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
if (entity.TryGetComponent<EquippableData>(out EquippableData componentData))
{
return ((object)(EquipmentType)(ref componentData.EquipmentType)).Equals((object)(EquipmentType)3);
}
return false;
}
public static ulong GetSteamId(this Entity entity)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
if (entity.TryGetComponent<PlayerCharacter>(out PlayerCharacter componentData))
{
return componentData.UserEntity.GetUser().PlatformId;
}
if (entity.TryGetComponent<User>(out User componentData2))
{
return componentData2.PlatformId;
}
return 0uL;
}
public static NetworkId GetNetworkId(this Entity entity)
{
//IL_0000: 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_000a: Unknown result type (might be due to invalid IL or missing references)
if (entity.TryGetComponent<NetworkId>(out NetworkId componentData))
{
return componentData;
}
return NetworkId.Empty;
}
public static bool TryGetPlayerInfo(this ulong steamId, out PlayerService.PlayerInfo playerInfo)
{
if (PlayerService.SteamIdPlayerInfoCache.TryGetValue(steamId, out playerInfo))
{
return true;
}
if (PlayerService.SteamIdOnlinePlayerInfoCache.TryGetValue(steamId, out playerInfo))
{
return true;
}
return false;
}
public static PrefabGUID GetPrefabGuid(this Entity entity)
{
//IL_0000: 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_000a: Unknown result type (might be due to invalid IL or missing references)
if (entity.TryGetComponent<PrefabGUID>(out PrefabGUID componentData))
{
return componentData;
}
return PrefabGUID.Empty;
}
public static int GetGuidHash(this Entity entity)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
if (entity.TryGetComponent<PrefabGUID>(out PrefabGUID componentData))
{
return ((PrefabGUID)(ref componentData)).GuidHash;
}
PrefabGUID empty = PrefabGUID.Empty;
return ((PrefabGUID)(ref empty)).GuidHash;
}
public static Entity GetUserEntity(this Entity entity)
{
//IL_0000: 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_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
if (entity.TryGetComponent<PlayerCharacter>(out PlayerCharacter componentData))
{
return componentData.UserEntity;
}
if (entity.Has<User>())
{
return entity;
}
return Entity.Null;
}
public static Entity GetOwner(this Entity entity, bool trueOwner = false)
{
//IL_0000: 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_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0011: 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_0021: Unknown result type (might be due to invalid IL or missing references)
if (!entity.Exists())
{
return Entity.Null;
}
Entity result = default(Entity);
if (trueOwner && VampireDownedServerEventSystem.TryFindRootOwner(entity, 1, EntityManager, ref result))
{
return result;
}
ServerGameManager serverGameManager = ServerGameManager;
return ((ServerGameManager)(ref serverGameManager)).GetOwner(entity);
}
public static User GetUser(this Entity entity)
{
//IL_0000: 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_000a: 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_0016: 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_0025: Unknown result type (might be due to invalid IL or missing references)
if (entity.TryGetComponent<User>(out User componentData))
{
return componentData;
}
if (entity.TryGetComponent<PlayerCharacter>(out PlayerCharacter componentData2) && componentData2.UserEntity.TryGetComponent<User>(out componentData))
{
return componentData;
}
return User.Empty;
}
public static bool HasBuff(this Entity entity, PrefabGUID buffPrefabGuid)
{
//IL_0000: 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)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
ServerGameManager serverGameManager = ServerGameManager;
return ((ServerGameManager)(ref serverGameManager)).HasBuff(entity, ((PrefabGUID)(ref buffPrefabGuid)).ToIdentifier());
}
public static bool HasBuff<T>(this Entity entity)
{
//IL_0000: 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 BuffUtility.HasBuff<T>(EntityManager, entity);
}
public static bool TryGetBuffer<T>(this Entity entity, out DynamicBuffer<T> dynamicBuffer) where T : struct
{
//IL_0000: 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)
//IL_0008: 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)
ServerGameManager serverGameManager = ServerGameManager;
if (((ServerGameManager)(ref serverGameManager)).TryGetBuffer<T>(entity, ref dynamicBuffer))
{
return true;
}
dynamicBuffer = default(DynamicBuffer<T>);
return false;
}
public static float3 GetAimPosition(this Entity entity)
{
//IL_0000: 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_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
if (entity.TryGetComponent<EntityInput>(out EntityInput componentData))
{
return componentData.AimPosition;
}
return float3.zero;
}
public static float3 GetPosition(this Entity entity)
{
//IL_0000: 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_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
if (entity.TryGetComponent<Translation>(out Translation componentData))
{
return componentData.Value;
}
return float3.zero;
}
public static int2 GetTileCoord(this Entity entity)
{
//IL_0000: 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_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
if (entity.TryGetComponent<TilePosition>(out TilePosition componentData))
{
return componentData.Tile;
}
return int2.zero;
}
public static int GetUnitLevel(this Entity entity)
{
//IL_0000: 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_000b: Unknown result type (might be due to invalid IL or missing references)
if (entity.TryGetComponent<UnitLevel>(out UnitLevel componentData))
{
return componentData.Level._Value;
}
return 0;
}
public static float GetMaxDurability(this Entity entity)
{
//IL_0000: 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)
if (entity.TryGetComponent<Durability>(out Durability componentData))
{
return componentData.MaxDurability;
}
return 0f;
}
public static float GetDurability(this Entity entity)
{
//IL_0000: 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)
if (entity.TryGetComponent<Durability>(out Durability componentData))
{
return componentData.Value;
}
return 0f;
}
public static float GetMaxHealth(this Entity entity)
{
//IL_0000: 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_000b: Unknown result type (might be due to invalid IL or missing references)
if (entity.TryGetComponent<Health>(out Health componentData))
{
return componentData.MaxHealth._Value;
}
return 0f;
}
public static Blood GetBlood(this Entity entity)
{
//IL_0000: 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)
if (entity.TryGetComponent<Blood>(out Blood componentData))
{
return componentData;
}
throw new InvalidOperationException("Entity does not have Blood!");
}
public static AiMoveSpeeds GetMoveSpeeds(this Entity entity)
{
//IL_0000: 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)
if (entity.TryGetComponent<AiMoveSpeeds>(out AiMoveSpeeds componentData))
{
return componentData;
}
throw new InvalidOperationException("Entity does not have Blood!");
}
public static EntityInput GetInput(this Entity entity)
{
//IL_0000: 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)
//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)
ServerGameManager serverGameManager = ServerGameManager;
return ((ServerGameManager)(ref serverGameManager)).GetInput(entity);
}
public static (float physicalPower, float spellPower) GetPowerTuple(this Entity entity)
{
//IL_0000: 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_000b: 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_0016: Unknown result type (might be due to invalid IL or missing references)
if (entity.TryGetComponent<UnitStats>(out UnitStats componentData))
{
return (componentData.PhysicalPower._Value, componentData.SpellPower._Value);
}
return (0f, 0f);
}
public static bool IsUnitSpawnerSpawned(this Entity entity)
{
//IL_0000: 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)
if (entity.TryGetComponent<IsMinion>(out IsMinion componentData) && componentData.Value)
{
return true;
}
return false;
}
public static bool IsStackableBuff(this Entity entity, out int maxStacks)
{
//IL_0003: 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_0015: Unknown result type (might be due to invalid IL or missing references)
maxStacks = 1;
if (entity.TryGetComponent<Buff>(out Buff componentData))
{
maxStacks = componentData.MaxStacks;
return componentData.IncreaseStacks;
}
return false;
}
public static Entity Create(this ComponentType[] components)
{
//IL_0000: 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)
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
EntityManager entityManager = EntityManager;
return ((EntityManager)(ref entityManager)).CreateEntity(components);
}
public static void Destroy(this Entity entity, bool immediate = false)
{
//IL_0000: 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_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
if (entity.Exists())
{
bool flag = entity.IsBuff();
if (immediate && !flag)
{
EntityManager entityManager = EntityManager;
((EntityManager)(ref entityManager)).DestroyEntity(entity);
}
else if (flag)
{
DestroyUtility.Destroy(EntityManager, entity, (DestroyDebugReason)13, (string)null, 0);
}
else
{
DestroyUtility.Destroy(EntityManager, entity, (DestroyDebugReason)0, (string)null, 0);
}
}
}
public static bool IsBuff(this Entity entity)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
return entity.Has<Buff>();
}
public static void SetTeam(this Entity entity, Entity teamSource)
{
//IL_0000: 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_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
if (entity.Has<Team>() && entity.Has<TeamReference>() && teamSource.TryGetComponent<Team>(out Team componentData) && teamSource.TryGetComponent<TeamReference>(out TeamReference componentData2))
{
Entity teamRefEntity = componentData2.Value._Value;
int teamId = componentData.Value;
entity.With<TeamReference>((WithRefHandler<TeamReference>)delegate(ref TeamReference teamReference)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
teamReference.Value._Value = teamRefEntity;
});
entity.With<Team>((WithRefHandler<Team>)delegate(ref Team team)
{
team.Value = teamId;
});
}
}
public static void SetPosition(this Entity entity, float3 position)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: 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_0015: 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)
if (entity.Has<Translation>())
{
entity.With<Translation>((WithRefHandler<Translation>)delegate(ref Translation translation)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
translation.Value = position;
});
}
if (entity.Has<LastTranslation>())
{
entity.With<LastTranslation>((WithRefHandler<LastTranslation>)delegate(ref LastTranslation lastTranslation)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
lastTranslation.Value = position;
});
}
}
public static void SetFaction(this Entity entity, PrefabGUID factionPrefabGuid)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: 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)
if (entity.Has<FactionReference>())
{
entity.With<FactionReference>((WithRefHandler<FactionReference>)delegate(ref FactionReference factionReference)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
factionReference.FactionGuid._Value = factionPrefabGuid;
});
}
}
public static bool IsAllied(this Entity entity, Entity player)
{
//IL_0000: 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)
//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)
ServerGameManager serverGameManager = ServerGameManager;
return ((ServerGameManager)(ref serverGameManager)).IsAllies(entity, player);
}
public static bool IsDreadful(this Entity entity)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0001: 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_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
return entity.GetPrefabGuid().Equals<PrefabGUID>((PrefabGUID[])(object)new PrefabGUID[2]
{
PrefabGUIDs.CHAR_Legion_DreadHorn_Lesser,
PrefabGUIDs.CHAR_Legion_Dreadhorn
});
}
public static bool IsPlayerOwned(this Entity entity)
{
//IL_0000: 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_000b: Unknown result type (might be due to invalid IL or missing references)
if (entity.TryGetComponent<EntityOwner>(out EntityOwner componentData))
{
return componentData.Owner.IsPlayer();
}
return false;
}
public static void CastAbility(this Entity entity, PrefabGUID abilityGroup)
{
//IL_0000: 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_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: 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_0026: 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_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
bool flag = entity.IsPlayer();
CastAbilityServerDebugEvent val = default(CastAbilityServerDebugEvent);
val.AbilityGroup = abilityGroup;
val.Who = entity.GetNetworkId();
CastAbilityServerDebugEvent val2 = val;
FromCharacter val3 = default(FromCharacter);
val3.Character = entity;
val3.User = (flag ? entity.GetUserEntity() : entity);
FromCharacter val4 = val3;
int num = (flag ? entity.GetUser().Index : 0);
DebugEventsSystem.CastAbilityServerDebugEvent(num, ref val2, ref val4);
}
public static bool IsIndexWithinRange<T>(this DynamicBuffer<T> buffer, int index) where T : struct
{
if (index >= 0)
{
return index < buffer.Length;
}
return false;
}
public static NativeAccessor<Entity> ToEntityArrayAccessor(this EntityQuery entityQuery, Allocator allocator = 2)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0003: 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)
return new NativeAccessor<Entity>(((EntityQuery)(ref entityQuery)).ToEntityArray(AllocatorHandle.op_Implicit(allocator)));
}
public static NativeAccessor<T> ToComponentDataArrayAccessor<T>(this EntityQuery entityQuery, Allocator allocator = 2) where T : unmanaged
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0003: 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)
return new NativeAccessor<T>(((EntityQuery)(ref entityQuery)).ToComponentDataArray<T>(AllocatorHandle.op_Implicit(allocator)));
}
}
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "io.zfolmt.Bloodcraft";
public const string PLUGIN_NAME = "Bloodcraft";
public const string PLUGIN_VERSION = "1.12.17";
}
}
namespace Bloodcraft.Utilities
{
internal static class Battles
{
private const string SANGUIS = "Sanguis";
private const string SANGUIS_DATA_CLASS = "Sanguis.Core+DataStructures";
private const string SANGUIS_DATA_PROPERTY = "PlayerTokens";
private const string SANGUIS_CONFIG_CLASS = "Sanguis.Plugin";
private const string SANGUIS_CONFIG_PROPERTY = "TokensPerMinute";
private const string SANGUIS_SAVE_METHOD = "SavePlayerTokens";
public static bool TryGetMatch(this HashSet<(ulong, ulong)> hashSet, ulong value, out (ulong, ulong) matchingPair)
{
matchingPair = default((ulong, ulong));
foreach (var item in hashSet)
{
if (item.Item1 == value || item.Item2 == value)
{
matchingPair = item;
return true;
}
}
return false;
}
public static bool TryGetMatchPairInfo(this (ulong, ulong) matchPair, out (PlayerService.PlayerInfo, PlayerService.PlayerInfo) matchPairInfo)
{
matchPairInfo = default((PlayerService.PlayerInfo, PlayerService.PlayerInfo));
var (steamId, steamId2) = matchPair;
if (steamId.TryGetPlayerInfo(out var playerInfo) && steamId2.TryGetPlayerInfo(out var playerInfo2))
{
matchPairInfo = (playerInfo, playerInfo2);
return true;
}
return false;
}
public static void BuildBattleGroupDetailsReply(ulong steamId, DataService.FamiliarPersistence.FamiliarBuffsManager.FamiliarBuffsData buffsData, DataService.FamiliarPersistence.FamiliarPrestigeManager.FamiliarPrestigeData prestigeData, List<int> battleGroup, ref List<string> familiars)
{
//IL_001b: 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)
foreach (int item in battleGroup)
{
if (item != 0)
{
string localizedName = VExtensions.GetLocalizedName(new PrefabGUID(item));
string text = "<color=#FF69B4>";
int key = FamiliarLevelingSystem.GetFamiliarExperience(steamId, item).Key;
int value = 0;
if (buffsData.FamiliarBuffs.ContainsKey(item) && FamiliarUnlockSystem.ShinyBuffColorHexes.TryGetValue(new PrefabGUID(buffsData.FamiliarBuffs[item][0]), out var value2))
{
text = "<color=" + value2 + ">";
}
if (!prestigeData.FamiliarPrestige.ContainsKey(item))
{
prestigeData.FamiliarPrestige[item] = 0;
DataService.FamiliarPersistence.FamiliarPrestigeManager.SaveFamiliarPrestigeData(steamId, prestigeData);
}
else
{
value = prestigeData.FamiliarPrestige[item];
}
familiars.Add($"<color=white>{battleGroup.IndexOf(item) + 1}</color>: <color=green>{localizedName}</color>{(buffsData.FamiliarBuffs.ContainsKey(item) ? (text + "*</color>") : "")} [<color=white>{key}</color>][<color=#90EE90>{value}</color>]");
}
}
}
private static void DetectSanguis()
{
//IL_02fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0305: Expected O, but got Unknown
//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
//IL_02cd: Expected O, but got Unknown
//IL_0254: Unknown result type (might be due to invalid IL or missing references)
//IL_025b: Expected O, but got Unknown
//IL_01df: Unknown result type (might be due to invalid IL or missing references)
//IL_01e6: Expected O, but got Unknown
//IL_016a: Unknown result type (might be due to invalid IL or missing references)
//IL_0171: Expected O, but got Unknown
//IL_0131: Unknown result type (might be due to invalid IL or missing references)
//IL_0138: Expected O, but got Unknown
bool flag = default(bool);
try
{
Assembly assembly2 = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault((Assembly assembly) => assembly.GetName().Name == "Sanguis");
if (assembly2 != null)
{
Type type = assembly2.GetType("Sanguis.Plugin");
Type type2 = assembly2.GetType("Sanguis.Core+DataStructures");
if (type != null && type2 != null)
{
PropertyInfo property = type.GetProperty("TokensPerMinute", BindingFlags.Static | BindingFlags.Public);
PropertyInfo property2 = type2.GetProperty("PlayerTokens", BindingFlags.Static | BindingFlags.Public);
if (property != null && property2 != null)
{
MethodInfo method = type2.GetMethod("SavePlayerTokens", BindingFlags.Static | BindingFlags.Public);
Dictionary<ulong, (int, (DateTime, DateTime))> dictionary = (Dictionary<ulong, (int, (DateTime, DateTime))>)(property2?.GetValue(null) ?? new object());
int num = (int)(property?.GetValue(null) ?? ((object)0));
if (method != null && dictionary.Any() && num > 0)
{
BattleService._awardSanguis = true;
BattleService._tokensProperty = property2;
BattleService._tokensTransferred = num;
BattleService._saveTokens = method;
BattleService._playerTokens = dictionary;
ManualLogSource log = Core.Log;
BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(40, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("Sanguis");
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" registered for familiar battle rewards!");
}
log.LogInfo(val);