using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using Alexandria.ItemAPI;
using BepInEx;
using Dungeonator;
using Gungeon;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Mono.Cecil;
using Mono.Cecil.Cil;
using Mono.Collections.Generic;
using MonoMod.Cil;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("NerfedWitchPistol")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("NerfedWitchPistol")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("2bbd6f4e-5b13-4f7b-96c7-bac6fe1d355a")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[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 OrdinaryMagicianItems
{
[HarmonyPatch]
public class Broom : PlayerItem
{
public GameObject prefabToAttachToPlayer;
private GameObject instanceAttachment;
private tk2dBaseSprite instanceAttachmentSprite;
private bool m_callbacksInitialized;
public static void Init()
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Expected O, but got Unknown
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_006b: Expected O, but got Unknown
//IL_0105: Unknown result type (might be due to invalid IL or missing references)
//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
//IL_010a: Unknown result type (might be due to invalid IL or missing references)
//IL_0145: Unknown result type (might be due to invalid IL or missing references)
//IL_014e: Unknown result type (might be due to invalid IL or missing references)
//IL_0153: Unknown result type (might be due to invalid IL or missing references)
//IL_015b: Unknown result type (might be due to invalid IL or missing references)
//IL_0165: Expected O, but got Unknown
//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
//IL_01af: Unknown result type (might be due to invalid IL or missing references)
//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
//IL_01d7: Expected O, but got Unknown
//IL_01db: Unknown result type (might be due to invalid IL or missing references)
//IL_01e2: Expected O, but got Unknown
//IL_0231: Unknown result type (might be due to invalid IL or missing references)
string text = "Ordinary Broom";
string text2 = "OrdinaryMagicianItems/Resources/broom";
GameObject val = new GameObject(text);
Broom broom = val.AddComponent<Broom>();
ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
string text3 = "Aesthetics Matter";
string text4 = "Grants flight until you hop off.\nAllows to steal in plain sight and run for your life.\n\nThis is a completely normal broom with no special properties whatsoever.\nSweeping dust is a broom's most common use, but this one in particular is used by a certain Ordinary Magician in order to fly.\nAccording to her, though, she doesn't actually need the broom to fly, and simply uses it during flight for aesthetic purposes.";
ItemBuilder.SetupItem((PickupObject)(object)broom, text3, text4, "spapi");
ItemBuilder.SetCooldownType((PlayerItem)(object)broom, (CooldownType)0, 1f);
((PlayerItem)broom).consumable = false;
((PickupObject)broom).quality = (ItemQuality)(-50);
GameObject val2 = new GameObject("BroomAttachment");
val2.SetActive(false);
FakePrefab.MakeFakePrefab(val2);
Object.DontDestroyOnLoad((Object)(object)val2);
broom.prefabToAttachToPlayer = val2;
string[] array = new string[6] { "broom_front", "broom_back", "broom_front_left", "broom_front_right", "broom_back_right", "broom_back_left" };
tk2dSpriteAnimationClip[] array2 = (tk2dSpriteAnimationClip[])(object)new tk2dSpriteAnimationClip[array.Length];
tk2dSpriteCollectionData itemCollection = SpriteBuilder.itemCollection;
for (int i = 0; i < array.Length; i++)
{
string text5 = array[i];
Vector2 val3 = (Vector2)((text5 == "broom_back_left") ? new Vector2(0f, -0.0625f) : Vector2.zero);
int num = SpriteBuilder.AddSpriteToCollection("OrdinaryMagicianItems/Resources/broom_obj/" + text5, itemCollection, (Assembly)null);
tk2dSpriteDefinition val4 = itemCollection.spriteDefinitions[num];
GunTools.ConstructOffsetsFromAnchor(val4, (Anchor)4, (Vector2?)null, false, false);
GunTools.MakeOffset(val4, val3, false);
tk2dSpriteAnimationFrame val5 = new tk2dSpriteAnimationFrame
{
spriteId = num,
spriteCollection = itemCollection
};
int num2 = SpriteBuilder.AddSpriteToCollection("OrdinaryMagicianItems/Resources/broom_obj/" + text5 + "2", itemCollection, (Assembly)null);
tk2dSpriteDefinition val6 = itemCollection.spriteDefinitions[num2];
GunTools.ConstructOffsetsFromAnchor(val6, (Anchor)4, (Vector2?)null, false, false);
GunTools.MakeOffset(val6, val3 + new Vector2(0f, -0.0625f), false);
tk2dSpriteAnimationFrame val7 = new tk2dSpriteAnimationFrame
{
spriteId = num2,
spriteCollection = itemCollection
};
int num3 = i;
tk2dSpriteAnimationClip val8 = new tk2dSpriteAnimationClip();
val8.fps = 6f;
val8.frames = (tk2dSpriteAnimationFrame[])(object)new tk2dSpriteAnimationFrame[2] { val5, val7 };
val8.loopStart = 0;
val8.maxFidgetDuration = 0f;
val8.minFidgetDuration = 0f;
val8.name = text5;
val8.wrapMode = (WrapMode)0;
array2[num3] = val8;
}
tk2dSprite.AddComponent(val2, itemCollection, array2[0].frames[0].spriteId);
tk2dSpriteAnimator val9 = val2.AddComponent<tk2dSpriteAnimator>();
tk2dSpriteAnimation val10 = (val9.Library = val2.AddComponent<tk2dSpriteAnimation>());
tk2dSpriteAnimation val12 = val10;
val12.clips = array2;
}
public void InitializeCallbacks(PlayerController player)
{
player.OnEnteredCombat = (Action)Delegate.Combine(player.OnEnteredCombat, new Action(OnCombatEntered));
player.OnUsedBlank += Shoot;
m_callbacksInitialized = true;
}
public void DeinitializeCallbacks(PlayerController player)
{
player.OnEnteredCombat = (Action)Delegate.Remove(player.OnEnteredCombat, new Action(OnCombatEntered));
player.OnUsedBlank -= Shoot;
m_callbacksInitialized = false;
}
public void Shoot(PlayerController player, int i)
{
//IL_0002: 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_0045: 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)
if (player.HasActiveBonusSynergy(Plugin.IncidentResolverKitSynergy, false))
{
GameObject val = SpawnManager.SpawnProjectile(((Component)((Component)PickupObjectDatabase.GetById(508)).GetComponent<Gun>().DefaultModule.projectiles[0]).gameObject, Vector2.op_Implicit(((BraveBehaviour)player).specRigidbody.UnitCenter), Quaternion.Euler(0f, 0f, ((GameActor)player).FacingDirection), true);
Projectile component = val.GetComponent<Projectile>();
if (!((Object)(object)component == (Object)null))
{
component.Owner = (GameActor)(object)player;
component.Shooter = ((BraveBehaviour)player).specRigidbody;
}
}
}
public void OnCombatEntered()
{
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
if (!((PlayerItem)this).PickedUp || (Object)(object)base.LastOwner == (Object)null || !base.LastOwner.HasActiveBonusSynergy(Plugin.IncidentResolverKitSynergy, false))
{
return;
}
RoomHandler currentRoom = base.LastOwner.CurrentRoom;
if (currentRoom == null)
{
return;
}
List<AIActor> activeEnemies = currentRoom.GetActiveEnemies((ActiveEnemyType)0);
if (activeEnemies == null)
{
return;
}
foreach (AIActor item in activeEnemies)
{
if ((Object)(object)item == (Object)null || (Object)(object)((BraveBehaviour)item).healthHaver == (Object)null || !((BraveBehaviour)item).healthHaver.IsBoss)
{
continue;
}
LootEngine.GivePrefabToPlayer(((Component)PickupObjectDatabase.GetById(GlobalItemIds.Blank)).gameObject, base.LastOwner);
LootEngine.GivePrefabToPlayer(((Component)PickupObjectDatabase.GetById(GlobalItemIds.SmallHeart)).gameObject, base.LastOwner);
{
foreach (PlayerItem activeItem in base.LastOwner.activeItems)
{
activeItem.DidDamage(base.LastOwner, 100f);
}
break;
}
}
}
public override void DoEffect(PlayerController user)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Invalid comparison between Unknown and I4
if ((int)GameManager.Instance.CurrentLevelOverrideState != 4)
{
((PlayerItem)this).IsCurrentlyActive = true;
((GameActor)user).SetIsFlying(true, "broom", true, false);
user.AdditionalCanDodgeRollWhileFlying.SetOverride("broom", true, (float?)null);
user.SetCapableOfStealing(true, "broom", (float?)null);
PassiveItem.IncrementFlag(user, typeof(Broom));
instanceAttachment = user.RegisterAttachedObject(prefabToAttachToPlayer, "", 0f);
instanceAttachmentSprite = (tk2dBaseSprite)(object)instanceAttachment.GetComponent<tk2dSprite>();
}
}
public void LateUpdate()
{
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)instanceAttachment) && ((PlayerItem)this).PickedUp && Object.op_Implicit((Object)(object)base.LastOwner))
{
instanceAttachment.transform.position = Vector2.op_Implicit(((BraveBehaviour)base.LastOwner).sprite.WorldCenter + new Vector2(0f, -0.5f));
instanceAttachmentSprite.UpdateZDepth();
}
}
protected void Deactivate(PlayerController user)
{
((PlayerItem)this).IsCurrentlyActive = false;
((GameActor)user).SetIsFlying(false, "broom", true, false);
user.AdditionalCanDodgeRollWhileFlying.RemoveOverride("broom");
user.SetCapableOfStealing(false, "broom", (float?)null);
PassiveItem.DecrementFlag(user, typeof(Broom));
if ((Object)(object)instanceAttachment != (Object)null)
{
user.DeregisterAttachedObject(instanceAttachment, true);
}
instanceAttachmentSprite = null;
user.stats.RecalculateStats(user, false, false);
}
public override void Update()
{
//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
//IL_00f9: Invalid comparison between Unknown and I4
((PlayerItem)this).Update();
if (((PlayerItem)this).PickedUp && !m_callbacksInitialized)
{
InitializeCallbacks(base.LastOwner);
}
if (((PlayerItem)this).IsCurrentlyActive)
{
string text = base.LastOwner.GetBaseAnimationSuffix(false);
if (text.EndsWith("_right") && ((BraveBehaviour)base.LastOwner).sprite.FlipX)
{
text = text.Substring(0, text.LastIndexOf('_')) + "_left";
}
if ((Object)(object)instanceAttachment != (Object)null && (Object)(object)((BraveBehaviour)instanceAttachmentSprite).spriteAnimator != (Object)null && !((BraveBehaviour)instanceAttachmentSprite).spriteAnimator.IsPlaying("broom" + text))
{
((BraveBehaviour)instanceAttachmentSprite).spriteAnimator.Play("broom" + text);
}
if ((int)GameManager.Instance.CurrentLevelOverrideState == 4 || ((Object)(object)base.LastOwner != (Object)null && base.LastOwner.IsDodgeRolling))
{
Deactivate(base.LastOwner);
}
}
}
public override void OnPreDrop(PlayerController user)
{
if (((PlayerItem)this).IsCurrentlyActive)
{
Deactivate(user);
}
if (m_callbacksInitialized)
{
DeinitializeCallbacks(user);
}
}
public override void OnItemSwitched(PlayerController user)
{
if (((PlayerItem)this).IsCurrentlyActive)
{
Deactivate(user);
}
}
public override void OnDestroy()
{
((PlayerItem)this).OnDestroy();
if ((Object)(object)base.LastOwner != (Object)null && m_callbacksInitialized)
{
DeinitializeCallbacks(base.LastOwner);
}
}
public override bool CanBeUsed(PlayerController user)
{
return ((PlayerItem)this).CanBeUsed(user) && !user.IsDodgeRolling;
}
[HarmonyPatch(typeof(ShopItemController), "Interact")]
[HarmonyILManipulator]
public static void BroomSteal_Transpiler(ILContext ctx)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Expected O, but got Unknown
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(ctx);
if (val.JumpToNext((Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<BaseShopController>(x, "AttemptToSteal")))
{
val.Emit(OpCodes.Ldarg_0);
val.Emit(OpCodes.Ldarg_1);
val.EmitStaticDelegate(new Func<bool, ShopItemController, PlayerController, bool>(BroomSteal_ModifyAttemptToSteal));
}
}
public static bool BroomSteal_ModifyAttemptToSteal(bool curr, ShopItemController shopItem, PlayerController player)
{
if ((Object)(object)player == (Object)null || !PassiveItem.IsFlagSetForCharacter(player, typeof(Broom)))
{
return curr;
}
if ((Object)(object)shopItem.m_baseParentShop == (Object)null)
{
return curr;
}
shopItem.m_baseParentShop.NotifyStealFailed();
return true;
}
}
public class ChangeReloadSpeedSynergyProcessor : GunBehaviour
{
public float SynergyReloadTime;
public CustomSynergyType RequiredSynergy;
private bool m_processed;
private float m_cachedReloadTime;
public override void Update()
{
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)((GunBehaviour)this).PlayerOwner))
{
bool flag = ((GunBehaviour)this).PlayerOwner.HasActiveBonusSynergy(RequiredSynergy, false);
if (flag && !m_processed)
{
m_processed = true;
m_cachedReloadTime = base.gun.reloadTime;
base.gun.reloadTime = SynergyReloadTime;
}
else if (!flag && m_processed)
{
m_processed = false;
base.gun.reloadTime = m_cachedReloadTime;
}
}
}
}
public static class ILTools
{
public static bool JumpToNext(this ILCursor crs, Func<Instruction, bool> match, int times = 1)
{
for (int i = 0; i < times; i++)
{
if (!crs.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1] { match }))
{
return false;
}
}
return true;
}
public static bool JumpBeforeNext(this ILCursor crs, Func<Instruction, bool> match, int times = 1)
{
for (int i = 0; i < times; i++)
{
if (!crs.TryGotoNext((MoveType)((i != times - 1) ? 2 : 0), new Func<Instruction, bool>[1] { match }))
{
return false;
}
}
return true;
}
public static IEnumerable MatchAfter(this ILCursor crs, Func<Instruction, bool> match, bool matchFromStart = true)
{
Instruction curr = crs.Next;
if (matchFromStart)
{
crs.Index = 0;
}
while (crs.JumpToNext(match))
{
yield return crs.Previous;
}
crs.Next = curr;
}
public static IEnumerable MatchBefore(this ILCursor crs, Func<Instruction, bool> match, bool matchFromStart = true)
{
Instruction curr = crs.Next;
if (matchFromStart)
{
crs.Index = 0;
}
while (crs.JumpBeforeNext(match))
{
Instruction c = crs.Next;
yield return crs.Next;
crs.Goto(c, (MoveType)2, false);
}
crs.Next = curr;
}
public static VariableDefinition DeclareLocal<T>(this ILContext ctx)
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Expected O, but got Unknown
VariableDefinition val = new VariableDefinition(ctx.Import(typeof(T)));
ctx.Body.Variables.Add(val);
return val;
}
public static VariableDefinition DeclareLocal<T>(this ILCursor crs)
{
return crs.Context.DeclareLocal<T>();
}
public static bool TryGotoArgForInstruction(this ILCursor crs, Instruction targetInstr, int argIndex, int instance = 0)
{
if (argIndex < 0)
{
return false;
}
if (instance < 0)
{
return false;
}
if (targetInstr == null)
{
return false;
}
List<Instruction> argumentInstructions = targetInstr.GetArgumentInstructions(crs.Context, argIndex);
if (instance >= argumentInstructions.Count)
{
return false;
}
crs.Goto(argumentInstructions[instance], (MoveType)2, false);
return true;
}
public static bool TryGotoArgForNext(this ILCursor crs, int argIndex, int instance = 0)
{
return crs.TryGotoArgForInstruction(crs.Next, argIndex, instance);
}
public static bool TryGotoArgForPrevious(this ILCursor crs, int argIndex, int instance = 0)
{
return crs.TryGotoArgForInstruction(crs.Previous, argIndex, instance);
}
public static IEnumerable MatchArgForInstruction(this ILCursor crs, Instruction targetInstr, int argIndex)
{
if (argIndex < 0 || targetInstr == null)
{
yield break;
}
Instruction curr = crs.Next;
List<Instruction> argumentInstrs = targetInstr.GetArgumentInstructions(crs.Context, argIndex);
foreach (Instruction arg in argumentInstrs)
{
crs.Goto(arg, (MoveType)2, false);
yield return null;
}
crs.Next = curr;
}
public static IEnumerable MatchArgForNext(this ILCursor crs, int argIndex)
{
return crs.MatchArgForInstruction(crs.Next, argIndex);
}
public static IEnumerable MatchArgForPrevious(this ILCursor crs, int argIndex)
{
return crs.MatchArgForInstruction(crs.Previous, argIndex);
}
private static List<Instruction> GetArgumentInstructions(this Instruction instruction, ILContext context, int argumentIndex)
{
int num = instruction.InputCount();
int num2 = num - argumentIndex - 1;
if (num2 < 0)
{
return new List<Instruction>();
}
List<Instruction> list = instruction.PossiblePreviousInstructions(context);
List<Instruction> list2 = new List<Instruction>();
foreach (Instruction item in list)
{
BacktrackToArg(item, context, num2, list2);
}
list2.Sort((Instruction a, Instruction b) => context.IndexOf(a).CompareTo(context.IndexOf(b)));
return list2;
}
private static void BacktrackToArg(Instruction current, ILContext ctx, int remainingMoves, List<Instruction> foundArgs)
{
if (remainingMoves <= 0 && current.OutputCount() > 0)
{
if (remainingMoves == 0)
{
foundArgs.Add(current);
}
return;
}
remainingMoves -= current.StackDelta();
List<Instruction> list = current.PossiblePreviousInstructions(ctx);
foreach (Instruction item in list)
{
BacktrackToArg(item, ctx, remainingMoves, foundArgs);
}
}
private static int InputCount(this Instruction instr)
{
//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_001f: Invalid comparison between Unknown and I4
//IL_009f: Unknown result type (might be due to invalid IL or missing references)
//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Expected O, but got Unknown
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Invalid comparison between Unknown and I4
//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
//IL_00f7: Expected I4, but got Unknown
//IL_0083: Unknown result type (might be due to invalid IL or missing references)
//IL_008a: Invalid comparison between Unknown and I4
if (instr == null)
{
return 0;
}
OpCode opCode = instr.OpCode;
if ((int)((OpCode)(ref opCode)).FlowControl == 2)
{
IMethodSignature val = (IMethodSignature)instr.Operand;
int num = 0;
if ((int)((OpCode)(ref opCode)).Code != 114 && val.HasThis && !val.ExplicitThis)
{
num++;
}
if (val.HasParameters)
{
num += val.Parameters.Count;
}
if ((int)((OpCode)(ref opCode)).Code == 40)
{
num++;
}
return num;
}
StackBehaviour stackBehaviourPop = ((OpCode)(ref opCode)).StackBehaviourPop;
if (1 == 0)
{
}
int result;
switch (stackBehaviourPop - 1)
{
case 0:
case 2:
case 9:
result = 1;
break;
case 1:
case 3:
case 4:
case 5:
case 7:
case 8:
case 10:
case 11:
result = 2;
break;
case 6:
case 12:
case 13:
case 14:
case 15:
case 16:
result = 3;
break;
default:
result = 0;
break;
}
if (1 == 0)
{
}
return result;
}
private static int OutputCount(this Instruction instr)
{
//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_001f: Invalid comparison between Unknown and I4
//IL_0069: 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_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Expected O, but got Unknown
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Invalid comparison between Unknown and I4
//IL_0074: Unknown result type (might be due to invalid IL or missing references)
//IL_0078: Unknown result type (might be due to invalid IL or missing references)
//IL_009a: Expected I4, but got Unknown
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Invalid comparison between Unknown and I4
if (instr == null)
{
return 0;
}
OpCode opCode = instr.OpCode;
if ((int)((OpCode)(ref opCode)).FlowControl == 2)
{
IMethodSignature val = (IMethodSignature)instr.Operand;
int num = 0;
if ((int)((OpCode)(ref opCode)).Code == 114 || (int)val.ReturnType.MetadataType != 1)
{
num++;
}
return num;
}
StackBehaviour stackBehaviourPush = ((OpCode)(ref opCode)).StackBehaviourPush;
if (1 == 0)
{
}
int result;
switch (stackBehaviourPush - 20)
{
case 0:
case 2:
case 3:
case 4:
case 5:
case 6:
result = 1;
break;
case 1:
result = 2;
break;
default:
result = 0;
break;
}
if (1 == 0)
{
}
return result;
}
private static int StackDelta(this Instruction instr)
{
return instr.OutputCount() - instr.InputCount();
}
private static List<Instruction> PossiblePreviousInstructions(this Instruction instr, ILContext ctx)
{
//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)
List<Instruction> list = new List<Instruction>();
Enumerator<Instruction> enumerator = ctx.Instrs.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
Instruction current = enumerator.Current;
if (Array.IndexOf(current.PossibleNextInstructions(), instr) >= 0)
{
list.Add(current);
}
}
}
finally
{
((IDisposable)enumerator/*cast due to .constrained prefix*/).Dispose();
}
return list;
}
private static Instruction[] PossibleNextInstructions(this Instruction instr)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Expected I4, but got Unknown
OpCode opCode = instr.OpCode;
FlowControl flowControl = ((OpCode)(ref opCode)).FlowControl;
if (1 == 0)
{
}
Instruction[] result;
switch ((int)flowControl)
{
case 2:
case 5:
result = (Instruction[])(object)new Instruction[1] { instr.Next };
break;
case 0:
{
Instruction branchTarget2 = instr.GetBranchTarget();
result = (Instruction[])(object)((branchTarget2 == null) ? new Instruction[0] : new Instruction[1] { branchTarget2 });
break;
}
case 3:
{
Instruction branchTarget = instr.GetBranchTarget();
result = (Instruction[])(object)((branchTarget == null) ? new Instruction[1] { instr.Next } : new Instruction[2] { instr.Next, branchTarget });
break;
}
default:
result = (Instruction[])(object)new Instruction[0];
break;
}
if (1 == 0)
{
}
return result;
}
private static Instruction GetBranchTarget(this Instruction branch)
{
object operand = branch.Operand;
Instruction val = (Instruction)((operand is Instruction) ? operand : null);
if (val != null)
{
return val;
}
object operand2 = branch.Operand;
return ((ILLabel)(((operand2 is ILLabel) ? operand2 : null)?)).Target;
}
public static void EmitStaticDelegate(this ILCursor crs, Delegate call)
{
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
if (call.GetInvocationList().Length != 1 || call.Target != null)
{
throw new ArgumentException("Delegate is either not static or has additional invocations");
}
crs.Emit(OpCodes.Call, (MethodBase)call.Method);
}
public static string InstructionToString(this Instruction c)
{
//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_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_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0146: Unknown result type (might be due to invalid IL or missing references)
//IL_014b: 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_0040: Invalid comparison between Unknown and I4
//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
//IL_00b4: Invalid comparison between Unknown and I4
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
if (c == null)
{
return "Null instruction";
}
OpCode opCode;
try
{
return ((object)c).ToString();
}
catch
{
try
{
opCode = c.OpCode;
OperandType operandType = ((OpCode)(ref opCode)).OperandType;
if (((int)operandType == 0 || (int)operandType == 15) ? true : false)
{
object operand = c.Operand;
ILLabel val = (ILLabel)((operand is ILLabel) ? operand : null);
if (val != null)
{
object arg = c.Offset;
opCode = c.OpCode;
return $"IL_{arg:x4}: {((OpCode)(ref opCode)).Name} IL_{val.Target.Offset:x4}";
}
}
opCode = c.OpCode;
if ((int)((OpCode)(ref opCode)).OperandType == 10 && c.Operand is IEnumerable<ILLabel> source)
{
object arg2 = c.Offset;
opCode = c.OpCode;
return string.Format("IL_{0:x4}: {1} {2}", arg2, ((OpCode)(ref opCode)).Name, string.Join(", ", source.Select((ILLabel x) => x.Target.Offset.ToString("x4")).ToArray()));
}
}
catch
{
}
}
object arg3 = c.Offset;
opCode = c.OpCode;
return $"IL_{arg3:x4}: {((OpCode)(ref opCode)).Name} (This shouldn't be happening)";
}
public static T EnumeratorGetField<T>(this object obj, string name)
{
return (T)obj.GetType().EnumeratorField(name).GetValue(obj);
}
public static void EnumeratorSetField(this object obj, string name, object value)
{
obj.GetType().EnumeratorField(name).SetValue(obj, value);
}
public static FieldInfo EnumeratorField(this MethodBase method, string name)
{
return method.DeclaringType.EnumeratorField(name);
}
public static FieldInfo EnumeratorField(this Type tp, string name)
{
return tp.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).First((FieldInfo x) => (object)x != null && x.Name != null && (x.Name.Contains("<" + name + ">") || x.Name == name));
}
}
public class MiniHakkero : GunBehaviour
{
public string lastIdleAnimation;
public string normalIdleAnimation;
public string idle2Animation;
public static void Init()
{
//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
Gun val = Databases.Items.NewGun("Mini-Hakkero", "mini_hakkero");
Game.Items.Rename("outdated_gun_mods:minihakkero", "spapi:mini_hakkero");
GunExt.SetShortDescription((PickupObject)(object)val, "It's all about firepower!");
GunExt.SetLongDescription((PickupObject)(object)val, "Made by a master smith and forged with the mythical hihi'irokane metal, this Magic Furnace takes the form of an octagonal block of wood with the eight Taoist trigrams inscribed on the front.\n\nIt allows its' wielder to channel and amplify their magic energy into a beam of destructive power.");
GunExt.SetupSprite(val, (tk2dSpriteCollectionData)null, "mini_hakkero_idle2_001", 8);
GunExt.SetAnimationFPS(val, val.idleAnimation, 8);
PickupObject byId = PickupObjectDatabase.GetById(508);
GunExt.AddProjectileModuleFrom(val, (Gun)(object)((byId is Gun) ? byId : null), true, false);
PickupObject byId2 = PickupObjectDatabase.GetById(508);
Gun val2 = (Gun)(object)((byId2 is Gun) ? byId2 : null);
val.UsesRechargeLikeActiveItem = true;
val.ActiveItemStyleRechargeAmount = val2.ActiveItemStyleRechargeAmount;
val.reloadTime = 1.6f;
val.InfiniteAmmo = true;
val.gunSwitchGroup = "ChargeLaser";
Transform transform = ((Component)val.barrelOffset).transform;
transform.localPosition += new Vector3(-0.55f, -0.16f, 0f);
((PickupObject)val).quality = (ItemQuality)(-50);
val.gunClass = (GunClass)1;
((PickupObject)val).PreventStartingOwnerFromDropping = true;
MiniHakkero miniHakkero = ((Component)val).gameObject.AddComponent<MiniHakkero>();
miniHakkero.idle2Animation = GunExt.UpdateAnimation(val, "idle2", (tk2dSpriteCollectionData)null, false);
miniHakkero.normalIdleAnimation = GunExt.UpdateAnimation(val, "idle", (tk2dSpriteCollectionData)null, false);
Databases.Items.Add(val, (tk2dSpriteCollectionData)null, "ANY");
}
public override void Update()
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)((GunBehaviour)this).GenericOwner == (Object)null))
{
bool flag = Object.op_Implicit((Object)(object)((GunBehaviour)this).PlayerOwner) && ((GunBehaviour)this).PlayerOwner.HasActiveBonusSynergy(Plugin.CheatAgainstTheImpossibleSynergy, false);
if (flag)
{
base.gun.RemainingActiveCooldownAmount = Mathf.Max(0f, base.gun.RemainingActiveCooldownAmount - 10f * BraveTime.DeltaTime);
}
if (base.gun.RemainingActiveCooldownAmount <= 0f || flag)
{
base.gun.idleAnimation = normalIdleAnimation;
}
else
{
base.gun.idleAnimation = idle2Animation;
}
if (lastIdleAnimation != base.gun.idleAnimation)
{
base.gun.PlayIdleAnimation();
}
lastIdleAnimation = base.gun.idleAnimation;
}
}
public void LateUpdate()
{
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_0065: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)((GunBehaviour)this).GenericOwner == (Object)null))
{
tk2dBaseSprite sprite = base.gun.GetSprite();
GameActor genericOwner = ((GunBehaviour)this).GenericOwner;
PlayerController val = (PlayerController)(object)((genericOwner is PlayerController) ? genericOwner : null);
float num = ((val != null) ? Vector2Extensions.ToAngle(Vector3Extensions.XY(val.unadjustedAimPoint) - Vector3Extensions.XY(((BraveBehaviour)base.gun).transform.parent.position)) : base.gun.CurrentAngle);
int num2 = BraveMathCollege.AngleToOctant(num + 90f);
if (num2 == 1 || num2 == 2 || num2 == 3)
{
sprite.HeightOffGround = 0.075f;
}
else
{
sprite.HeightOffGround = -0.075f;
}
sprite.UpdateZDepth();
}
}
}
public class Shanghai : PassiveItem
{
public string CompanionGuid;
private Coroutine m_currentTimeSlow;
private GameObject m_extantCompanion;
public static GameObject prefab;
public static void Init()
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Expected O, but got Unknown
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
string text = "Shanghai";
string text2 = "OrdinaryMagicianItems/Resources/shanghai_ammonomicon_icon";
GameObject val = new GameObject(text);
Shanghai shanghai = val.AddComponent<Shanghai>();
ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
string text3 = "The Precious Thing";
string text4 = "A little sentient doll. No, it's not yours.\nWhen in danger, it will start following you around and will attack enemies.\nAlice won't forgive you if you lose it.";
ItemBuilder.SetupItem((PickupObject)(object)shanghai, text3, text4, "spapi");
((PickupObject)shanghai).quality = (ItemQuality)(-50);
shanghai.CompanionGuid = "shanghai";
BuildPrefab();
}
public static void BuildPrefab()
{
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0083: 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_008a: Unknown result type (might be due to invalid IL or missing references)
//IL_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_0091: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_009d: Unknown result type (might be due to invalid IL or missing references)
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
//IL_00b9: Expected O, but got Unknown
//IL_02e2: Unknown result type (might be due to invalid IL or missing references)
//IL_02e9: Expected O, but got Unknown
//IL_0316: Unknown result type (might be due to invalid IL or missing references)
//IL_0343: Unknown result type (might be due to invalid IL or missing references)
//IL_034a: Expected O, but got Unknown
//IL_0376: Unknown result type (might be due to invalid IL or missing references)
//IL_037b: Unknown result type (might be due to invalid IL or missing references)
//IL_0382: Unknown result type (might be due to invalid IL or missing references)
//IL_038d: Unknown result type (might be due to invalid IL or missing references)
//IL_0394: Unknown result type (might be due to invalid IL or missing references)
//IL_039b: Unknown result type (might be due to invalid IL or missing references)
//IL_03a6: 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_03b8: Unknown result type (might be due to invalid IL or missing references)
//IL_03bf: Unknown result type (might be due to invalid IL or missing references)
//IL_03ca: Unknown result type (might be due to invalid IL or missing references)
//IL_03da: Expected O, but got Unknown
//IL_03e2: Unknown result type (might be due to invalid IL or missing references)
//IL_03e7: Unknown result type (might be due to invalid IL or missing references)
//IL_03f2: Unknown result type (might be due to invalid IL or missing references)
//IL_03f9: Unknown result type (might be due to invalid IL or missing references)
//IL_0400: Unknown result type (might be due to invalid IL or missing references)
//IL_040b: Unknown result type (might be due to invalid IL or missing references)
//IL_0412: Unknown result type (might be due to invalid IL or missing references)
//IL_0422: Expected O, but got Unknown
if (!((Object)(object)prefab != (Object)null) && !CompanionBuilder.companionDictionary.ContainsKey("shanghai"))
{
prefab = CompanionBuilder.BuildPrefab("Shanghai", "shanghai", "OrdinaryMagicianItems/Resources/companion/idle_right/shanghai_idle_front_right_001", new IntVector2(9, 3), new IntVector2(8, 12));
CompanionController val = prefab.AddComponent<CompanionController>();
((BraveBehaviour)val).aiActor.IsNormalEnemy = false;
val.CanInterceptBullets = false;
((BraveBehaviour)val).specRigidbody.PixelColliders.Add(new PixelCollider
{
ColliderGenerationMode = (PixelColliderGeneration)0,
CollisionLayer = (CollisionLayer)2,
ManualWidth = 8,
ManualHeight = 12,
ManualOffsetX = 9,
ManualOffsetY = 3
});
((BraveBehaviour)val).specRigidbody.CollideWithOthers = true;
((BraveBehaviour)val).aiActor.CollisionDamage = 0f;
((BraveBehaviour)val).aiActor.MovementSpeed = 7.2f;
((BraveBehaviour)val).aiActor.HitByEnemyBullets = false;
((BraveBehaviour)val).aiActor.CanDropCurrency = false;
CompanionBuilder.AddAnimation(prefab, "idle_right", "OrdinaryMagicianItems/Resources/companion/idle_right", 6, (AnimationType)1, (DirectionType)2, (FlipType)0);
CompanionBuilder.AddAnimation(prefab, "idle_left", "OrdinaryMagicianItems/Resources/companion/idle_left", 6, (AnimationType)1, (DirectionType)2, (FlipType)0);
CompanionBuilder.AddAnimation(prefab, "run_right", "OrdinaryMagicianItems/Resources/companion/run_right", 6, (AnimationType)0, (DirectionType)2, (FlipType)0);
CompanionBuilder.AddAnimation(prefab, "run_left", "OrdinaryMagicianItems/Resources/companion/run_left", 6, (AnimationType)0, (DirectionType)2, (FlipType)0);
tk2dSpriteCollectionData collection = ((Component)val).GetComponent<tk2dSpriteCollectionData>();
if (!Object.op_Implicit((Object)(object)collection))
{
collection = SpriteBuilder.ConstructCollection(((Component)val).gameObject, ((Object)val).name + "_collection", false);
}
Assembly asmb = typeof(Plugin).Assembly;
List<string> source = new List<string> { "OrdinaryMagicianItems/Resources/companion/attack_left/shanghai_attack_front_left_001", "OrdinaryMagicianItems/Resources/companion/attack_left/shanghai_attack_front_left_002", "OrdinaryMagicianItems/Resources/companion/attack_left/shanghai_attack_front_left_003", "OrdinaryMagicianItems/Resources/companion/attack_left/shanghai_attack_front_left_004", "OrdinaryMagicianItems/Resources/companion/attack_left/shanghai_attack_front_left_005", "OrdinaryMagicianItems/Resources/companion/attack_left/shanghai_attack_front_left_006" };
tk2dSpriteAnimationClip val2 = SpriteBuilder.AddAnimation(((BraveBehaviour)val).spriteAnimator, collection, source.Select((string x) => SpriteBuilder.AddSpriteToCollection(x, collection, asmb)).ToList(), "attack_left", (WrapMode)2, 15f);
val2.fps = 6f;
List<string> source2 = new List<string> { "OrdinaryMagicianItems/Resources/companion/attack_right/shanghai_attack_front_right_001", "OrdinaryMagicianItems/Resources/companion/attack_right/shanghai_attack_front_right_002", "OrdinaryMagicianItems/Resources/companion/attack_right/shanghai_attack_front_right_003", "OrdinaryMagicianItems/Resources/companion/attack_right/shanghai_attack_front_right_004", "OrdinaryMagicianItems/Resources/companion/attack_right/shanghai_attack_front_right_005", "OrdinaryMagicianItems/Resources/companion/attack_right/shanghai_attack_front_right_006" };
tk2dSpriteAnimationClip val3 = SpriteBuilder.AddAnimation(((BraveBehaviour)val).spriteAnimator, collection, source2.Select((string x) => SpriteBuilder.AddSpriteToCollection(x, collection, asmb)).ToList(), "attack_right", (WrapMode)2, 15f);
val3.fps = 6f;
AIAnimator aiAnimator = ((BraveBehaviour)val).aiAnimator;
DirectionalAnimation val4 = new DirectionalAnimation();
val4.AnimNames = new string[2] { "attack_right", "attack_left" };
val4.Flipped = (FlipType[])(object)new FlipType[2];
val4.Type = (DirectionType)2;
val4.Prefix = string.Empty;
CompanionBuilder.AssignDirectionalAnimation(aiAnimator, "attack", val4, (AnimationType)6);
BehaviorSpeculator component = prefab.GetComponent<BehaviorSpeculator>();
List<MovementBehaviorBase> movementBehaviors = component.MovementBehaviors;
CompanionFollowPlayerBehavior val5 = new CompanionFollowPlayerBehavior();
val5.IdleAnimations = new string[1] { "idle" };
val5.DisableInCombat = true;
movementBehaviors.Add((MovementBehaviorBase)(object)val5);
component.MovementBehaviors.Add((MovementBehaviorBase)new SeekTargetBehavior
{
StopWhenInRange = false,
CustomRange = -1f,
LineOfSight = true,
ReturnToSpawn = false,
SpawnTetherDistance = 0f,
PathInterval = 0.25f,
ExternalCooldownSource = false,
SpecifyRange = false,
MinActiveRange = 0f,
MaxActiveRange = 0f
});
component.TargetBehaviors.Add((TargetBehaviorBase)new TargetPlayerBehavior
{
Radius = 35f,
LineOfSight = true,
ObjectPermanence = true,
SearchInterval = 0.25f,
PauseOnTargetSwitch = false,
PauseTime = 0.25f
});
component.AttackBehaviors.Add((AttackBehaviorBase)(object)new ShanghaiAttackBehavior
{
minLeapDistance = 1f,
leapDistance = 2f,
maxTravelDistance = 5f,
leadAmount = 1f,
leapTime = 0.4f,
maximumChargeTime = 0.25f,
chargeAnim = string.Empty,
leapAnim = "attack"
});
}
}
private void CreateCompanion(PlayerController owner)
{
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Invalid comparison between Unknown and I4
//IL_0080: Unknown result type (might be due to invalid IL or missing references)
//IL_0081: 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_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_0074: Unknown result type (might be due to invalid IL or missing references)
//IL_0079: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)((BraveBehaviour)owner).healthHaver != (Object)null) || !(((BraveBehaviour)owner).healthHaver.GetCurrentHealthPercentage() >= 1f))
{
string companionGuid = CompanionGuid;
AIActor orLoadByGuid = EnemyDatabase.GetOrLoadByGuid(companionGuid);
Vector3 val = ((BraveBehaviour)owner).transform.position;
if ((int)GameManager.Instance.CurrentLevelOverrideState == 1)
{
val += new Vector3(1.125f, -0.3125f, 0f);
}
GameObject extantCompanion = Object.Instantiate<GameObject>(((Component)orLoadByGuid).gameObject, val, Quaternion.identity);
m_extantCompanion = extantCompanion;
CompanionController orAddComponent = GameObjectExtensions.GetOrAddComponent<CompanionController>(m_extantCompanion);
orAddComponent.Initialize(owner);
if (Object.op_Implicit((Object)(object)((BraveBehaviour)orAddComponent).specRigidbody))
{
PhysicsEngine.Instance.RegisterOverlappingGhostCollisionExceptions(((BraveBehaviour)orAddComponent).specRigidbody, (int?)null, false);
}
}
}
public void ForceCompanionRegeneration(PlayerController owner, Vector2? overridePosition)
{
//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_006b: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_008e: Unknown result type (might be due to invalid IL or missing references)
//IL_0094: Unknown result type (might be due to invalid IL or missing references)
Vector2? val = overridePosition ?? (((Object)(object)m_extantCompanion != (Object)null) ? new Vector2?(Vector3Extensions.XY(m_extantCompanion.transform.position)) : ((Vector2?)null));
DestroyCompanion();
CreateCompanion(owner);
if (!Object.op_Implicit((Object)(object)m_extantCompanion) || !val.HasValue)
{
return;
}
Vector2 valueOrDefault = val.GetValueOrDefault();
if (true)
{
m_extantCompanion.transform.position = Vector2Extensions.ToVector3ZisY(valueOrDefault, 0f);
SpeculativeRigidbody component = m_extantCompanion.GetComponent<SpeculativeRigidbody>();
if (Object.op_Implicit((Object)(object)component))
{
component.Reinitialize();
}
}
}
private void DestroyCompanion()
{
if (Object.op_Implicit((Object)(object)m_extantCompanion))
{
Object.Destroy((Object)(object)m_extantCompanion);
m_extantCompanion = null;
}
}
public override void Pickup(PlayerController player)
{
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Expected O, but got Unknown
((PassiveItem)this).Pickup(player);
player.OnNewFloorLoaded = (Action<PlayerController>)Delegate.Combine(player.OnNewFloorLoaded, new Action<PlayerController>(HandleNewFloor));
HealthHaver healthHaver = ((BraveBehaviour)player).healthHaver;
if ((Object)(object)healthHaver != (Object)null)
{
healthHaver.OnHealthChanged += new OnHealthChangedEvent(OnHealthChanged);
healthHaver.OnPreDeath += MaybeRevive;
}
CreateCompanion(player);
}
public void MaybeRevive(Vector2 deathDir)
{
List<int> list = new List<int> { 421, 422, 423, 424, 425 };
foreach (PassiveItem passiveItem in base.m_owner.passiveItems)
{
if (!list.Contains(((PickupObject)passiveItem).PickupObjectId))
{
continue;
}
base.m_owner.RemovePassiveItem(((PickupObject)passiveItem).PickupObjectId);
((BraveBehaviour)base.m_owner).healthHaver.ApplyHealing(1f);
base.m_owner.ForceBlank(25f, 0.5f, false, true, (Vector2?)null, true, -1f);
base.m_owner.ClearDeadFlags();
if (!((Object)(object)GameManager.Instance == (Object)null))
{
if (m_currentTimeSlow != null)
{
((MonoBehaviour)GameManager.Instance).StopCoroutine(m_currentTimeSlow);
}
m_currentTimeSlow = ((MonoBehaviour)GameManager.Instance).StartCoroutine(PostReviveTimeSlow());
}
break;
}
}
public IEnumerator PostReviveTimeSlow()
{
BraveTime.ClearMultiplier(((Component)this).gameObject);
BraveTime.RegisterTimeScaleMultiplier(0.1f, ((Component)this).gameObject);
float elapsed = 0f;
float duration = 2.5f;
while (elapsed < duration)
{
elapsed += GameManager.INVARIANT_DELTA_TIME;
BraveTime.ClearMultiplier(((Component)this).gameObject);
BraveTime.RegisterTimeScaleMultiplier(Mathf.Lerp(0.1f, 1f, elapsed - (duration - 1f)), ((Component)this).gameObject);
yield return null;
}
BraveTime.ClearMultiplier(((Component)this).gameObject);
}
public void OnHealthChanged(float resultValue, float maxValue)
{
if (resultValue >= maxValue)
{
DestroyCompanion();
}
else if ((Object)(object)m_extantCompanion == (Object)null)
{
CreateCompanion(((PassiveItem)this).Owner);
}
}
private void HandleNewFloor(PlayerController obj)
{
DestroyCompanion();
CreateCompanion(obj);
}
public override void DisableEffect(PlayerController player)
{
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: Expected O, but got Unknown
((PassiveItem)this).DisableEffect(player);
DestroyCompanion();
if (!((Object)(object)player == (Object)null))
{
player.OnNewFloorLoaded = (Action<PlayerController>)Delegate.Remove(player.OnNewFloorLoaded, new Action<PlayerController>(HandleNewFloor));
if ((Object)(object)((BraveBehaviour)player).healthHaver != (Object)null)
{
((BraveBehaviour)player).healthHaver.OnHealthChanged -= new OnHealthChangedEvent(OnHealthChanged);
((BraveBehaviour)player).healthHaver.OnPreDeath -= MaybeRevive;
}
}
}
}
public class MagicianPistol
{
public static void Init()
{
//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0104: Unknown result type (might be due to invalid IL or missing references)
//IL_0137: 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_0179: Unknown result type (might be due to invalid IL or missing references)
//IL_018f: Unknown result type (might be due to invalid IL or missing references)
//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0213: Unknown result type (might be due to invalid IL or missing references)
//IL_0229: Unknown result type (might be due to invalid IL or missing references)
//IL_023f: Unknown result type (might be due to invalid IL or missing references)
//IL_0255: Unknown result type (might be due to invalid IL or missing references)
//IL_026b: Unknown result type (might be due to invalid IL or missing references)
//IL_032f: Unknown result type (might be due to invalid IL or missing references)
//IL_0334: Unknown result type (might be due to invalid IL or missing references)
//IL_0356: Unknown result type (might be due to invalid IL or missing references)
//IL_02d8: Unknown result type (might be due to invalid IL or missing references)
Gun val = Databases.Items.NewGun("Magician Pistol", "nerfed_witch_pistol");
Game.Items.Rename("outdated_gun_mods:magician_pistol", "spapi:magician_pistol");
GunExt.SetShortDescription((PickupObject)(object)val, "Fancy Schmancy");
GunExt.SetLongDescription((PickupObject)(object)val, "Well this is just a really messy attempt at a Witch Pistol.\nThe shoddy craftsmanship makes it particularly awkward to reload, but you'll sure as hell look cool doing it!\n\nThe \"Magic\" part of this weapon is purely for cosmetic purposes, it's really just a standard magnum.");
GunExt.AddProjectileModuleFrom(val, "klobb", true, false);
? val2 = val;
PickupObject byId = PickupObjectDatabase.GetById(145);
((Gun)val2).TransformToTargetGun((Gun)(object)((byId is Gun) ? byId : null));
GunExt.SetupSprite(val, (tk2dSpriteCollectionData)null, "nerfed_witch_pistol_idle_001", 16);
PickupObject byId2 = PickupObjectDatabase.GetById(145);
Projectile val3 = Object.Instantiate<Projectile>(((Gun)((byId2 is Gun) ? byId2 : null)).DefaultModule.projectiles[0]);
((Component)val3).gameObject.SetActive(false);
FakePrefab.MarkAsFakePrefab(((Component)val3).gameObject);
Object.DontDestroyOnLoad((Object)(object)val3);
val3.CanTransmogrify = false;
val3.ChanceToTransmogrify = -1f;
val.reloadTime = 1.6f;
val.StarterGunForAchievement = true;
val.DefaultModule.projectiles[0] = val3;
val.InfiniteAmmo = true;
((PickupObject)val).quality = (ItemQuality)(-50);
val.gunClass = (GunClass)1;
((PickupObject)val).PreventStartingOwnerFromDropping = true;
tk2dSpriteAnimator component = ((Component)val).GetComponent<tk2dSpriteAnimator>();
Dictionary<string, List<Vector2>> dictionary = new Dictionary<string, List<Vector2>>
{
[val.idleAnimation] = new List<Vector2>
{
new Vector2(0f, 0f)
},
[val.shootAnimation] = new List<Vector2>
{
new Vector2(0f, 0f),
new Vector2(-0.0625f, 0.0625f),
new Vector2(0f, -0.0625f),
new Vector2(0f, 0f)
},
[val.reloadAnimation] = new List<Vector2>
{
new Vector2(0f, -0.0625f),
new Vector2(0.125f, 0f),
new Vector2(0.125f, 0.0625f),
new Vector2(0.125f, 0.125f),
new Vector2(0.125f, 0.0625f),
new Vector2(0.125f, 0.125f),
new Vector2(0f, 0.0625f),
new Vector2(0f, -0.0625f)
}
};
foreach (KeyValuePair<string, List<Vector2>> item in dictionary)
{
tk2dSpriteAnimationFrame[] frames = component.GetClipByName(item.Key).frames;
List<Vector2> value = item.Value;
for (int i = 0; i < frames.Length; i++)
{
tk2dSpriteAnimationFrame val4 = frames[i];
tk2dSpriteDefinition val5 = val4.spriteCollection.spriteDefinitions[val4.spriteId];
GunTools.MakeOffset(val5, value[i], false);
}
}
ChangeReloadSpeedSynergyProcessor changeReloadSpeedSynergyProcessor = ((Component)val).gameObject.AddComponent<ChangeReloadSpeedSynergyProcessor>();
changeReloadSpeedSynergyProcessor.SynergyReloadTime = 1.2f;
changeReloadSpeedSynergyProcessor.RequiredSynergy = Plugin.TwelveShotsSynergy;
Databases.Items.Add(val, (tk2dSpriteCollectionData)null, "ANY");
AddDualWieldSynergyProcessor(((PickupObject)val).PickupObjectId, 145, Plugin.TwelveShotsSynergy);
}
public static void AddDualWieldSynergyProcessor(int id1, int id2, CustomSynergyType synergy)
{
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
DualWieldSynergyProcessor val = ((Component)PickupObjectDatabase.GetById(id1)).gameObject.AddComponent<DualWieldSynergyProcessor>();
val.SynergyToCheck = synergy;
val.PartnerGunID = id2;
DualWieldSynergyProcessor val2 = ((Component)PickupObjectDatabase.GetById(id2)).gameObject.AddComponent<DualWieldSynergyProcessor>();
val2.SynergyToCheck = synergy;
val2.PartnerGunID = id1;
}
}
[BepInPlugin("spapi.etg.ordinarymagicianitems", "Ordinary Magician Items", "1.0.8")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Plugin : BaseUnityPlugin
{
public const string MOD_GUID = "spapi.etg.ordinarymagicianitems";
public static CustomSynergyType TwelveShotsSynergy;
public static CustomSynergyType CheatAgainstTheImpossibleSynergy;
public static CustomSynergyType IncidentResolverKitSynergy;
public static CustomSynergyType ExtendSynergy;
public void Start()
{
ETGModMainBehaviour.WaitForGameManagerStart((Action<GameManager>)GMStart);
}
public void GMStart(GameManager man)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Unknown result type (might be due to invalid IL or missing references)
//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
//IL_0109: Unknown result type (might be due to invalid IL or missing references)
//IL_014c: Unknown result type (might be due to invalid IL or missing references)
//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
new Harmony("spapi.etg.ordinarymagicianitems").PatchAll();
Assets.SetupSpritesFromAssembly(typeof(Plugin).Assembly, "OrdinaryMagicianItems/Resources/MTGAPISpriteRoot");
TwelveShotsSynergy = ETGModCompatibility.ExtendEnum<CustomSynergyType>("spapi.etg.ordinarymagicianitems", "TWELVE_SHOTS");
CheatAgainstTheImpossibleSynergy = ETGModCompatibility.ExtendEnum<CustomSynergyType>("spapi.etg.ordinarymagicianitems", "CHEAT_AGAINST_THE_IMPOSSIBLE");
IncidentResolverKitSynergy = ETGModCompatibility.ExtendEnum<CustomSynergyType>("spapi.etg.ordinarymagicianitems", "INCIDENT_RESOLVER_KIT");
ExtendSynergy = ETGModCompatibility.ExtendEnum<CustomSynergyType>("spapi.etg.ordinarymagicianitems", "EXTEND");
MagicianPistol.Init();
MiniHakkero.Init();
Broom.Init();
Shanghai.Init();
AdvancedSynergyEntry val = CustomSynergies.Add("Twelve Shots", new List<string>(2) { "witch_pistol", "spapi:magician_pistol" }, (List<string>)null, true);
val.bonusSynergies = new List<CustomSynergyType>(1) { TwelveShotsSynergy };
AdvancedSynergyEntry val2 = CustomSynergies.Add("Cheat against the Impossible", new List<string>(2) { "staff_of_firepower", "spapi:mini_hakkero" }, (List<string>)null, true);
val2.bonusSynergies = new List<CustomSynergyType>(1) { CheatAgainstTheImpossibleSynergy };
AdvancedSynergyEntry val3 = CustomSynergies.Add("Incident-Resolver kit", new List<string>(2) { "spapi:ordinary_broom", "backpack" }, (List<string>)null, true);
val3.bonusSynergies = new List<CustomSynergyType>(1) { IncidentResolverKitSynergy };
AdvancedSynergyEntry val4 = CustomSynergies.Add("Extend!", new List<string>(1) { "spapi:shanghai" }, new List<string>(5) { "heart_holster", "heart_lunchbox", "heart_locket", "heart_bottle", "heart_purse" }, true);
val4.bonusSynergies = new List<CustomSynergyType>(1) { ExtendSynergy };
AmmoRegenSynergyProcessor val5 = ((Component)Game.Items["staff_of_firepower"]).gameObject.AddComponent<AmmoRegenSynergyProcessor>();
val5.PreventGainWhileFiring = false;
val5.RequiredSynergy = CheatAgainstTheImpossibleSynergy;
val5.AmmoPerSecond = 1f;
}
}
public class ShanghaiAttackBehavior : AttackBehaviorBase
{
private enum State
{
Idle,
Charging,
Leaping
}
public float minLeapDistance = 1f;
public float leapDistance = 4f;
public float maxTravelDistance = 5f;
public float leadAmount;
public float leapTime = 0.75f;
public float maximumChargeTime = 0.25f;
public string chargeAnim;
public string leapAnim;
private float m_elapsed;
private State m_state;
private float charge_elapsed;
public override BehaviorResult Update()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Invalid comparison between Unknown and I4
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0152: Unknown result type (might be due to invalid IL or missing references)
//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: Unknown result type (might be due to invalid IL or missing references)
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0094: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
//IL_013c: 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_014e: Unknown result type (might be due to invalid IL or missing references)
BehaviorResult val = ((BehaviorBase)this).Update();
if ((int)val > 0)
{
return val;
}
if (!Object.op_Implicit((Object)(object)((BehaviorBase)this).m_aiActor.TargetRigidbody))
{
return (BehaviorResult)0;
}
Vector2 val2 = ((BraveBehaviour)((BehaviorBase)this).m_aiActor.TargetRigidbody).specRigidbody.GetUnitCenter((ColliderType)2);
if (leadAmount > 0f)
{
Vector2 val3 = val2 + ((BraveBehaviour)((BehaviorBase)this).m_aiActor.TargetRigidbody).specRigidbody.Velocity * 0.75f;
val2 = Vector2.Lerp(val2, val3, leadAmount);
}
float num = Vector2.Distance(((BraveBehaviour)((BehaviorBase)this).m_aiActor).specRigidbody.UnitCenter, val2);
if (num <= minLeapDistance || num >= leapDistance)
{
return (BehaviorResult)0;
}
m_state = State.Charging;
if (!string.IsNullOrEmpty(chargeAnim))
{
((BehaviorBase)this).m_aiAnimator.PlayForDuration(chargeAnim, maximumChargeTime, true, (string)null, -1f, false);
}
else
{
charge_elapsed = maximumChargeTime;
}
((BehaviorBase)this).m_aiActor.ClearPath();
((BehaviorBase)this).m_aiActor.BehaviorOverridesVelocity = true;
((BehaviorBase)this).m_aiActor.BehaviorVelocity = Vector2.zero;
((BehaviorBase)this).m_updateEveryFrame = true;
return (BehaviorResult)4;
}
public override ContinuousBehaviorResult ContinuousUpdate()
{
//IL_025d: Unknown result type (might be due to invalid IL or missing references)
//IL_0261: Unknown result type (might be due to invalid IL or missing references)
//IL_0257: 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_00bb: Unknown result type (might be due to invalid IL or missing references)
//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
//IL_0123: Unknown result type (might be due to invalid IL or missing references)
//IL_0124: Unknown result type (might be due to invalid IL or missing references)
//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0107: Unknown result type (might be due to invalid IL or missing references)
//IL_010c: Unknown result type (might be due to invalid IL or missing references)
//IL_0111: Unknown result type (might be due to invalid IL or missing references)
//IL_0113: Unknown result type (might be due to invalid IL or missing references)
//IL_0114: Unknown result type (might be due to invalid IL or missing references)
//IL_011c: Unknown result type (might be due to invalid IL or missing references)
//IL_0121: Unknown result type (might be due to invalid IL or missing references)
//IL_0184: Unknown result type (might be due to invalid IL or missing references)
//IL_0185: Unknown result type (might be due to invalid IL or missing references)
//IL_0186: Unknown result type (might be due to invalid IL or missing references)
//IL_018b: Unknown result type (might be due to invalid IL or missing references)
//IL_018f: Unknown result type (might be due to invalid IL or missing references)
//IL_019c: Unknown result type (might be due to invalid IL or missing references)
//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
//IL_013b: Unknown result type (might be due to invalid IL or missing references)
//IL_013c: Unknown result type (might be due to invalid IL or missing references)
//IL_013d: Unknown result type (might be due to invalid IL or missing references)
//IL_013e: Unknown result type (might be due to invalid IL or missing references)
//IL_0143: Unknown result type (might be due to invalid IL or missing references)
//IL_0147: Unknown result type (might be due to invalid IL or missing references)
//IL_0152: Unknown result type (might be due to invalid IL or missing references)
//IL_0157: Unknown result type (might be due to invalid IL or missing references)
//IL_015c: Unknown result type (might be due to invalid IL or missing references)
//IL_015d: Unknown result type (might be due to invalid IL or missing references)
//IL_015e: Unknown result type (might be due to invalid IL or missing references)
if (m_state == State.Charging)
{
if (((BehaviorBase)this).m_aiAnimator.IsPlaying(chargeAnim) || charge_elapsed > 0f)
{
charge_elapsed = Mathf.Max(0f, charge_elapsed - BraveTime.DeltaTime);
return (ContinuousBehaviorResult)0;
}
m_state = State.Leaping;
m_elapsed = 0f;
if (!Object.op_Implicit((Object)(object)((BehaviorBase)this).m_aiActor.TargetRigidbody) || !((Behaviour)((BehaviorBase)this).m_aiActor.TargetRigidbody).enabled)
{
m_state = State.Idle;
return (ContinuousBehaviorResult)1;
}
Vector2 unitCenter = ((BraveBehaviour)((BehaviorBase)this).m_aiActor).specRigidbody.UnitCenter;
Vector2 val = ((BraveBehaviour)((BehaviorBase)this).m_aiActor.TargetRigidbody).specRigidbody.GetUnitCenter((ColliderType)2);
if (leadAmount > 0f)
{
Vector2 val2 = val + ((BraveBehaviour)((BehaviorBase)this).m_aiActor.TargetRigidbody).specRigidbody.Velocity * 0.75f;
val = Vector2.Lerp(val, val2, leadAmount);
}
float num = Vector2.Distance(unitCenter, val);
Vector2 val3;
if (num > maxTravelDistance)
{
val3 = val - unitCenter;
val = unitCenter + ((Vector2)(ref val3)).normalized * maxTravelDistance;
num = Vector2.Distance(unitCenter, val);
}
((BehaviorBase)this).m_aiActor.ClearPath();
((BehaviorBase)this).m_aiActor.BehaviorOverridesVelocity = true;
AIActor aiActor = ((BehaviorBase)this).m_aiActor;
val3 = val - unitCenter;
aiActor.BehaviorVelocity = ((Vector2)(ref val3)).normalized * (num / leapTime);
((BehaviorBase)this).m_aiActor.PathableTiles = (CellTypes)6;
((GameActor)((BehaviorBase)this).m_aiActor).DoDustUps = false;
float facingDirection = Vector2Extensions.ToAngle(((BehaviorBase)this).m_aiActor.BehaviorVelocity);
((BehaviorBase)this).m_aiAnimator.LockFacingDirection = true;
((BehaviorBase)this).m_aiAnimator.FacingDirection = facingDirection;
if (!string.IsNullOrEmpty(leapAnim))
{
((BehaviorBase)this).m_aiAnimator.PlayUntilFinished(leapAnim, true, (string)null, -1f, false);
}
}
else if (m_state == State.Leaping)
{
m_elapsed += ((BehaviorBase)this).m_deltaTime;
if (m_elapsed >= leapTime)
{
return (ContinuousBehaviorResult)1;
}
}
return (ContinuousBehaviorResult)0;
}
public override void EndContinuousUpdate()
{
//IL_0079: Unknown result type (might be due to invalid IL or missing references)
//IL_0056: Unknown result type (might be due to invalid IL or missing references)
((BehaviorBase)this).EndContinuousUpdate();
if (Object.op_Implicit((Object)(object)((BehaviorBase)this).m_aiActor.TargetRigidbody) && Object.op_Implicit((Object)(object)((BraveBehaviour)((BehaviorBase)this).m_aiActor.TargetRigidbody).healthHaver))
{
((BraveBehaviour)((BehaviorBase)this).m_aiActor.TargetRigidbody).healthHaver.ApplyDamage(6f, ((BraveBehaviour)((BehaviorBase)this).m_aiActor).specRigidbody.Velocity, "Shanghai", (CoreDamageTypes)0, (DamageCategory)0, false, (PixelCollider)null, false);
}
m_state = State.Idle;
((BehaviorBase)this).m_aiActor.PathableTiles = (CellTypes)2;
((GameActor)((BehaviorBase)this).m_aiActor).DoDustUps = true;
((BehaviorBase)this).m_aiActor.BehaviorOverridesVelocity = false;
((BehaviorBase)this).m_aiAnimator.LockFacingDirection = false;
((BehaviorBase)this).m_updateEveryFrame = false;
}
public override bool IsReady()
{
return true;
}
public override float GetMinReadyRange()
{
return leapDistance;
}
public override float GetMaxRange()
{
return leapDistance;
}
}
}