using System; using System.Collections; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using HarmonyLib; using HutongGames.PlayMaker; using HutongGames.PlayMaker.Actions; using JetBrains.Annotations; using Microsoft.CodeAnalysis; using MitosisDancers.Behaviours; using MitosisDancers.Patches; using TeamCherry.Localization; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("MitosisDancers")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.2.0")] [assembly: AssemblyInformationalVersion("1.0.2+da65e5d13368ef8e0973392484ea9460a7b83401")] [assembly: AssemblyProduct("MitosisDancers")] [assembly: AssemblyTitle("MitosisDancers")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.2.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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] [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] [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 BepInEx { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] [Conditional("CodeGeneration")] internal sealed class BepInAutoPluginAttribute : Attribute { public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null) { } } } namespace BepInEx.Preloader.Core.Patching { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] [Conditional("CodeGeneration")] internal sealed class PatcherAutoPluginAttribute : Attribute { public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null) { } } } namespace MitosisDancers { public class DelegateAction : FsmStateAction { public Action? Method; public TArg? Arg; public override void Reset() { Method = null; ((FsmStateAction)this).Reset(); } public override void OnEnter() { if (Method != null && Arg != null) { Method(Arg); } if (!(Arg is Action action) || action != new Action(base.Finish)) { ((FsmStateAction)this).Finish(); } } } public static class FsmUtil { [PublicAPI] public static PlayMakerFSM? GetFsmPreprocessed(this GameObject go, string fsmName) { PlayMakerFSM[] components = go.GetComponents(); foreach (PlayMakerFSM val in components) { if (val.FsmName == fsmName) { val.Preprocess(); return val; } } return null; } private static TVal? GetItemFromArray(TVal[] origArray, Func isItemCheck) where TVal : class { foreach (TVal val in origArray) { if (isItemCheck(val)) { return val; } } return null; } private static TVal[] GetItemsFromArray(TVal[] origArray, Func isItemCheck) where TVal : class { int num = 0; foreach (TVal arg in origArray) { if (isItemCheck(arg)) { num++; } } if (num == origArray.Length) { return origArray; } if (num == 0) { return Array.Empty(); } TVal[] array = new TVal[num]; int num2 = 0; foreach (TVal val in origArray) { if (isItemCheck(val)) { array[num2] = val; num2++; } } return array; } [PublicAPI] public static FsmState? GetState(this PlayMakerFSM fsm, string stateName) { return GetItemFromArray(fsm.FsmStates, (FsmState x) => x.Name == stateName); } [PublicAPI] public static FsmState? GetState(this Fsm fsm, string stateName) { return GetItemFromArray(fsm.States, (FsmState x) => x.Name == stateName); } [PublicAPI] public static FsmTransition? GetTransition(this PlayMakerFSM fsm, string stateName, string eventName) { return fsm.GetState(stateName).GetTransition(eventName); } [PublicAPI] public static FsmTransition? GetTransition(this Fsm fsm, string stateName, string eventName) { return fsm.GetState(stateName).GetTransition(eventName); } [PublicAPI] public static FsmTransition? GetTransition(this FsmState state, string eventName) { return GetItemFromArray(state.Transitions, (FsmTransition x) => x.EventName == eventName); } [PublicAPI] public static FsmTransition? GetGlobalTransition(this PlayMakerFSM fsm, string globalEventName) { return fsm.Fsm.GetGlobalTransition(globalEventName); } [PublicAPI] public static FsmTransition? GetGlobalTransition(this Fsm fsm, string globalEventName) { return GetItemFromArray(fsm.GlobalTransitions, (FsmTransition x) => x.EventName == globalEventName); } [PublicAPI] public static TAction? GetAction(this PlayMakerFSM fsm, string stateName, int index) where TAction : FsmStateAction { return fsm.GetState(stateName).GetAction(index); } [PublicAPI] public static TAction? GetAction(this Fsm fsm, string stateName, int index) where TAction : FsmStateAction { return fsm.GetState(stateName).GetAction(index); } [PublicAPI] public static TAction? GetAction(this FsmState state, int index) where TAction : FsmStateAction { FsmStateAction obj = state.Actions[index]; return (TAction)(object)((obj is TAction) ? obj : null); } [PublicAPI] public static FsmStateAction? GetStateAction(this PlayMakerFSM fsm, string stateName, int index) { return fsm.GetState(stateName).GetStateAction(index); } [PublicAPI] public static FsmStateAction? GetStateAction(this Fsm fsm, string stateName, int index) { return fsm.GetState(stateName).GetStateAction(index); } [PublicAPI] public static FsmStateAction? GetStateAction(this FsmState state, int index) { return state.Actions[index]; } [PublicAPI] public static TAction[] GetActionsOfType(this PlayMakerFSM fsm, string stateName) where TAction : FsmStateAction { return fsm.GetState(stateName).GetActionsOfType(); } [PublicAPI] public static TAction[] GetActionsOfType(this Fsm fsm, string stateName) where TAction : FsmStateAction { return fsm.GetState(stateName).GetActionsOfType(); } [PublicAPI] public static TAction[] GetActionsOfType(this FsmState state) where TAction : FsmStateAction { return Array.ConvertAll(GetItemsFromArray(state.Actions, (FsmStateAction x) => x is TAction), (FsmStateAction x) => (TAction)(object)x); } [PublicAPI] public static TAction? GetFirstActionOfType(this PlayMakerFSM fsm, string stateName) where TAction : FsmStateAction { return fsm.GetState(stateName).GetFirstActionOfType(); } [PublicAPI] public static TAction? GetFirstActionOfType(this Fsm fsm, string stateName) where TAction : FsmStateAction { return fsm.GetState(stateName).GetFirstActionOfType(); } [PublicAPI] public static TAction? GetFirstActionOfType(this FsmState state) where TAction : FsmStateAction { int num = -1; for (int i = 0; i < state.Actions.Length; i++) { if (state.Actions[i] is TAction) { num = i; break; } } if (num == -1) { return default(TAction); } return state.GetAction(num); } [PublicAPI] public static TAction? GetLastActionOfType(this PlayMakerFSM fsm, string stateName) where TAction : FsmStateAction { return fsm.GetState(stateName).GetLastActionOfType(); } [PublicAPI] public static TAction? GetLastActionOfType(this Fsm fsm, string stateName) where TAction : FsmStateAction { return fsm.GetState(stateName).GetLastActionOfType(); } [PublicAPI] public static TAction? GetLastActionOfType(this FsmState state) where TAction : FsmStateAction { int num = -1; for (int num2 = state.Actions.Length - 1; num2 >= 0; num2--) { if (state.Actions[num2] is TAction) { num = num2; break; } } if (num == -1) { return default(TAction); } return state.GetAction(num); } private static TVal[] AddItemToArray(TVal[] origArray, TVal value) { TVal[] array = new TVal[origArray.Length + 1]; origArray.CopyTo(array, 0); array[origArray.Length] = value; return array; } [PublicAPI] public static FsmState AddState(this PlayMakerFSM fsm, string stateName) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown return fsm.Fsm.AddState(new FsmState(fsm.Fsm) { Name = stateName }); } [PublicAPI] public static FsmState AddState(this Fsm fsm, string stateName) { //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_0014: Expected O, but got Unknown return fsm.AddState(new FsmState(fsm) { Name = stateName }); } [PublicAPI] public static FsmState AddState(this PlayMakerFSM fsm, FsmState state) { return fsm.Fsm.AddState(state); } [PublicAPI] public static FsmState AddState(this Fsm fsm, FsmState state) { FsmState[] states = fsm.States; FsmState[] array = (fsm.States = AddItemToArray(states, state)); fsm.SaveActions(); return array[states.Length]; } [PublicAPI] public static FsmState CopyState(this PlayMakerFSM fsm, string fromState, string toState) { return fsm.Fsm.CopyState(fromState, toState); } [PublicAPI] public static FsmState CopyState(this Fsm fsm, string fromState, string toState) { //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_0024: Expected O, but got Unknown FsmState state = fsm.GetState(fromState); if (state != null) { state.SaveActions(); } FsmState val = new FsmState(state) { Name = toState }; FsmTransition[] transitions = val.Transitions; foreach (FsmTransition val2 in transitions) { val2.ToFsmState = fsm.GetState(val2.ToState); } fsm.AddState(val); return val; } [PublicAPI] public static FsmEvent AddTransition(this PlayMakerFSM fsm, string stateName, string eventName, string toState) { return fsm.GetState(stateName).AddTransition(eventName, toState); } [PublicAPI] public static FsmEvent AddTransition(this Fsm fsm, string stateName, string eventName, string toState) { return fsm.GetState(stateName).AddTransition(eventName, toState); } [PublicAPI] public static FsmEvent AddTransition(this FsmState state, string eventName, string toState) { //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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown FsmEvent fsmEvent = FsmEvent.GetFsmEvent(eventName); FsmTransition[] transitions = AddItemToArray(state.Transitions, new FsmTransition { ToState = toState, ToFsmState = state.Fsm.GetState(toState), FsmEvent = fsmEvent }); state.Transitions = transitions; return fsmEvent; } [PublicAPI] public static FsmEvent AddGlobalTransition(this PlayMakerFSM fsm, string globalEventName, string toState) { return fsm.Fsm.AddGlobalTransition(globalEventName, toState); } [PublicAPI] public static FsmEvent AddGlobalTransition(this Fsm fsm, string globalEventName, string toState) { //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_0010: Expected O, but got Unknown //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_0023: 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_003e: Expected O, but got Unknown FsmEvent val = new FsmEvent(globalEventName) { IsGlobal = true }; FsmTransition[] globalTransitions = AddItemToArray(fsm.GlobalTransitions, new FsmTransition { ToState = toState, ToFsmState = fsm.GetState(toState), FsmEvent = val }); fsm.GlobalTransitions = globalTransitions; return val; } [PublicAPI] public static void AddAction(this PlayMakerFSM fsm, string stateName, FsmStateAction action) { fsm.GetState(stateName).AddAction(action); } [PublicAPI] public static void AddAction(this Fsm fsm, string stateName, FsmStateAction action) { fsm.GetState(stateName).AddAction(action); } [PublicAPI] public static void AddAction(this FsmState state, FsmStateAction action) { FsmStateAction[] actions = AddItemToArray(state.Actions, action); state.Actions = actions; action.Init(state); } [PublicAPI] public static void AddActions(this PlayMakerFSM fsm, string stateName, params FsmStateAction[] actions) { fsm.GetState(stateName).AddActions(actions); } [PublicAPI] public static void AddActions(this Fsm fsm, string stateName, params FsmStateAction[] actions) { fsm.GetState(stateName).AddActions(actions); } [PublicAPI] public static void AddActions(this FsmState state, params FsmStateAction[] actions) { foreach (FsmStateAction action in actions) { state.AddAction(action); } } [PublicAPI] public static void AddMethod(this PlayMakerFSM fsm, string stateName, Action method) { fsm.GetState(stateName).AddMethod(method); } [PublicAPI] public static void AddMethod(this Fsm fsm, string stateName, Action method) { fsm.GetState(stateName).AddMethod(method); } [PublicAPI] public static void AddMethod(this FsmState state, Action method) { DelegateAction delegateAction = new DelegateAction { Method = method }; delegateAction.Arg = (FsmStateAction?)(object)delegateAction; state.AddAction((FsmStateAction)(object)delegateAction); } [PublicAPI] public static void AddLambdaMethod(this PlayMakerFSM fsm, string stateName, Action method) { fsm.GetState(stateName).AddLambdaMethod(method); } [PublicAPI] public static void AddLambdaMethod(this Fsm fsm, string stateName, Action method) { fsm.GetState(stateName).AddLambdaMethod(method); } [PublicAPI] public static void AddLambdaMethod(this FsmState state, Action method) { DelegateAction delegateAction = new DelegateAction { Method = method }; delegateAction.Arg = ((FsmStateAction)delegateAction).Finish; state.AddAction((FsmStateAction)(object)delegateAction); } private static TVal[] InsertItemIntoArray(TVal[] origArray, TVal value, int index) { int num = origArray.Length; if (index < 0 || index > num + 1) { throw new ArgumentOutOfRangeException($"Index {index} was out of range for array with length {num}!"); } TVal[] array = new TVal[num + 1]; for (int i = 0; i < index; i++) { array[i] = origArray[i]; } array[index] = value; for (int i = index; i < num; i++) { array[i + 1] = origArray[i]; } return array; } [PublicAPI] public static void InsertAction(this PlayMakerFSM fsm, string stateName, FsmStateAction action, int index) { fsm.GetState(stateName).InsertAction(index, action); } [PublicAPI] public static void InsertAction(this PlayMakerFSM fsm, string stateName, int index, FsmStateAction action) { fsm.GetState(stateName).InsertAction(index, action); } [PublicAPI] public static void InsertAction(this Fsm fsm, string stateName, FsmStateAction action, int index) { fsm.GetState(stateName).InsertAction(index, action); } [PublicAPI] public static void InsertAction(this Fsm fsm, string stateName, int index, FsmStateAction action) { fsm.GetState(stateName).InsertAction(index, action); } [PublicAPI] public static void InsertAction(this FsmState state, FsmStateAction action, int index) { state.InsertAction(index, action); } [PublicAPI] public static void InsertAction(this FsmState state, int index, FsmStateAction action) { FsmStateAction[] actions = InsertItemIntoArray(state.Actions, action, index); state.Actions = actions; action.Init(state); } [PublicAPI] public static void InsertActions(this PlayMakerFSM fsm, string stateName, int index, params FsmStateAction[] actions) { fsm.GetState(stateName).InsertActions(index, actions); } [PublicAPI] public static void InsertActions(this Fsm fsm, string stateName, int index, params FsmStateAction[] actions) { fsm.GetState(stateName).InsertActions(index, actions); } [PublicAPI] public static void InsertActions(this FsmState state, int index, params FsmStateAction[] actions) { foreach (FsmStateAction action in actions) { state.InsertAction(action, index); index++; } } [PublicAPI] public static void InsertMethod(this PlayMakerFSM fsm, string stateName, Action method, int index) { fsm.GetState(stateName).InsertMethod(index, method); } [PublicAPI] public static void InsertMethod(this PlayMakerFSM fsm, string stateName, int index, Action method) { fsm.GetState(stateName).InsertMethod(index, method); } [PublicAPI] public static void InsertMethod(this Fsm fsm, string stateName, Action method, int index) { fsm.GetState(stateName).InsertMethod(index, method); } [PublicAPI] public static void InsertMethod(this Fsm fsm, string stateName, int index, Action method) { fsm.GetState(stateName).InsertMethod(index, method); } [PublicAPI] public static void InsertMethod(this FsmState state, Action method, int index) { state.InsertMethod(index, method); } [PublicAPI] public static void InsertMethod(this FsmState state, int index, Action method) { DelegateAction delegateAction = new DelegateAction { Method = method }; delegateAction.Arg = (FsmStateAction?)(object)delegateAction; state.InsertAction((FsmStateAction)(object)delegateAction, index); } [PublicAPI] public static void InsertLambdaMethod(this PlayMakerFSM fsm, string stateName, Action method, int index) { fsm.GetState(stateName).InsertLambdaMethod(index, method); } [PublicAPI] public static void InsertLambdaMethod(this PlayMakerFSM fsm, string stateName, int index, Action method) { fsm.GetState(stateName).InsertLambdaMethod(index, method); } [PublicAPI] public static void InsertLambdaMethod(this Fsm fsm, string stateName, Action method, int index) { fsm.GetState(stateName).InsertLambdaMethod(index, method); } [PublicAPI] public static void InsertLambdaMethod(this Fsm fsm, string stateName, int index, Action method) { fsm.GetState(stateName).InsertLambdaMethod(index, method); } [PublicAPI] public static void InsertLambdaMethod(this FsmState state, Action method, int index) { state.InsertLambdaMethod(index, method); } [PublicAPI] public static void InsertLambdaMethod(this FsmState state, int index, Action method) { DelegateAction delegateAction = new DelegateAction { Method = method }; delegateAction.Arg = ((FsmStateAction)delegateAction).Finish; state.InsertAction((FsmStateAction)(object)delegateAction, index); } [PublicAPI] public static void ReplaceAction(this PlayMakerFSM fsm, string stateName, FsmStateAction action, int index) { fsm.GetState(stateName).ReplaceAction(index, action); } [PublicAPI] public static void ReplaceAction(this PlayMakerFSM fsm, string stateName, int index, FsmStateAction action) { fsm.GetState(stateName).ReplaceAction(index, action); } [PublicAPI] public static void ReplaceAction(this Fsm fsm, string stateName, FsmStateAction action, int index) { fsm.GetState(stateName).ReplaceAction(index, action); } [PublicAPI] public static void ReplaceAction(this Fsm fsm, string stateName, int index, FsmStateAction action) { fsm.GetState(stateName).ReplaceAction(index, action); } [PublicAPI] public static void ReplaceAction(this FsmState state, FsmStateAction action, int index) { state.ReplaceAction(index, action); } [PublicAPI] public static void ReplaceAction(this FsmState state, int index, FsmStateAction action) { state.Actions[index] = action; action.Init(state); } [PublicAPI] public static void ReplaceAllActions(this PlayMakerFSM fsm, string stateName, params FsmStateAction[] actions) { fsm.GetState(stateName).ReplaceAllActions(actions); } [PublicAPI] public static void ReplaceAllActions(this Fsm fsm, string stateName, params FsmStateAction[] actions) { fsm.GetState(stateName).ReplaceAllActions(actions); } [PublicAPI] public static void ReplaceAllActions(this FsmState state, params FsmStateAction[] actions) { state.Actions = actions; foreach (FsmStateAction val in actions) { val.Init(state); } } [PublicAPI] public static bool ChangeTransition(this PlayMakerFSM fsm, string stateName, string eventName, string toState) { return fsm.GetState(stateName).ChangeTransition(eventName, toState); } [PublicAPI] public static bool ChangeTransition(this Fsm fsm, string stateName, string eventName, string toState) { return fsm.GetState(stateName).ChangeTransition(eventName, toState); } [PublicAPI] public static bool ChangeTransition(this FsmState state, string eventName, string toState) { FsmTransition transition = state.GetTransition(eventName); if (transition == null) { return false; } transition.ToState = toState; transition.ToFsmState = state.Fsm.GetState(toState); return true; } [PublicAPI] public static bool ChangeGlobalTransition(this PlayMakerFSM fsm, string globalEventName, string toState) { return fsm.Fsm.ChangeGlobalTransition(globalEventName, toState); } [PublicAPI] public static bool ChangeGlobalTransition(this Fsm fsm, string globalEventName, string toState) { FsmTransition globalTransition = fsm.GetGlobalTransition(globalEventName); if (globalTransition == null) { return false; } globalTransition.ToState = toState; globalTransition.ToFsmState = fsm.GetState(toState); return true; } private static TVal[] RemoveItemsFromArray(TVal[] origArray, Func shouldBeRemovedCallback) { int num = 0; foreach (TVal arg in origArray) { if (shouldBeRemovedCallback(arg)) { num++; } } if (num == 0) { return origArray; } TVal[] array = new TVal[origArray.Length - num]; for (int num2 = origArray.Length - 1; num2 >= 0; num2--) { TVal val = origArray[num2]; if (shouldBeRemovedCallback(val)) { num--; } else { array[num2 - num] = val; } } return array; } [PublicAPI] public static void RemoveState(this PlayMakerFSM fsm, string stateName) { fsm.Fsm.RemoveState(stateName); } [PublicAPI] public static void RemoveState(this Fsm fsm, string stateName) { fsm.States = RemoveItemsFromArray(fsm.States, (FsmState x) => x.Name == stateName); } [PublicAPI] public static void RemoveTransition(this PlayMakerFSM fsm, string stateName, string eventName) { fsm.GetState(stateName).RemoveTransition(eventName); } [PublicAPI] public static void RemoveTransition(this Fsm fsm, string stateName, string eventName) { fsm.GetState(stateName).RemoveTransition(eventName); } [PublicAPI] public static void RemoveTransition(this FsmState state, string eventName) { state.Transitions = RemoveItemsFromArray(state.Transitions, (FsmTransition x) => x.EventName == eventName); } [PublicAPI] public static void RemoveGlobalTransition(this PlayMakerFSM fsm, string globalEventName) { fsm.Fsm.RemoveGlobalTransition(globalEventName); } [PublicAPI] public static void RemoveGlobalTransition(this Fsm fsm, string globalEventName) { fsm.GlobalTransitions = RemoveItemsFromArray(fsm.GlobalTransitions, (FsmTransition x) => x.EventName == globalEventName); } [PublicAPI] public static void RemoveTransitionsTo(this PlayMakerFSM fsm, string toState) { fsm.Fsm.RemoveTransitionsTo(toState); } [PublicAPI] public static void RemoveTransitionsTo(this Fsm fsm, string toState) { FsmState[] states = fsm.States; foreach (FsmState state in states) { state.RemoveTransitionsTo(toState); } } [PublicAPI] public static void RemoveTransitionsTo(this PlayMakerFSM fsm, string stateName, string toState) { fsm.GetState(stateName).RemoveTransitionsTo(toState); } [PublicAPI] public static void RemoveTransitionsTo(this Fsm fsm, string stateName, string toState) { fsm.GetState(stateName).RemoveTransitionsTo(toState); } [PublicAPI] public static void RemoveTransitionsTo(this FsmState state, string toState) { state.Transitions = RemoveItemsFromArray(state.Transitions, (FsmTransition x) => x.ToState == toState); } [PublicAPI] public static void RemoveTransitions(this PlayMakerFSM fsm, string stateName) { fsm.GetState(stateName).RemoveTransitions(); } [PublicAPI] public static void RemoveTransitions(this Fsm fsm, string stateName) { fsm.GetState(stateName).RemoveTransitions(); } [PublicAPI] public static void RemoveTransitions(this FsmState state) { state.Transitions = Array.Empty(); } [PublicAPI] public static bool RemoveAction(this PlayMakerFSM fsm, string stateName, int index) { return fsm.GetState(stateName).RemoveAction(index); } [PublicAPI] public static bool RemoveAction(this Fsm fsm, string stateName, int index) { return fsm.GetState(stateName).RemoveAction(index); } [PublicAPI] public static bool RemoveAction(this FsmState state, int index) { FsmStateAction[] actions = state.Actions; if (index < 0 || index >= actions.Length) { return false; } FsmStateAction[] array = (FsmStateAction[])(object)new FsmStateAction[actions.Length - 1]; int num = array.Length; for (int i = 0; i < index; i++) { array[i] = actions[i]; } for (int i = index; i < num; i++) { array[i] = actions[i + 1]; } state.Actions = array; return true; } [PublicAPI] public static void RemoveActionsOfType(this PlayMakerFSM fsm) { fsm.Fsm.RemoveActionsOfType(); } [PublicAPI] public static void RemoveActionsOfType(this Fsm fsm) { FsmState[] states = fsm.States; foreach (FsmState state in states) { state.RemoveActionsOfType(); } } [PublicAPI] public static void RemoveActionsOfType(this PlayMakerFSM fsm, string stateName) { fsm.GetState(stateName).RemoveActionsOfType(); } [PublicAPI] public static void RemoveActionsOfType(this Fsm fsm, string stateName) { fsm.GetState(stateName).RemoveActionsOfType(); } [PublicAPI] public static void RemoveActionsOfType(this FsmState state) { state.Actions = RemoveItemsFromArray(state.Actions, (FsmStateAction x) => x is TAction); } [PublicAPI] public static void RemoveFirstActionOfType(this PlayMakerFSM fsm, string stateName) { fsm.GetState(stateName).RemoveFirstActionOfType(); } [PublicAPI] public static void RemoveFirstActionOfType(this Fsm fsm, string stateName) { fsm.GetState(stateName).RemoveFirstActionOfType(); } [PublicAPI] public static void RemoveFirstActionOfType(this FsmState state) { int num = -1; for (int i = 0; i < state.Actions.Length; i++) { if (state.Actions[i] is TAction) { num = i; break; } } if (num != -1) { state.RemoveAction(num); } } [PublicAPI] public static void RemoveLastActionOfType(this PlayMakerFSM fsm, string stateName) { fsm.GetState(stateName).RemoveLastActionOfType(); } [PublicAPI] public static void RemoveLastActionOfType(this Fsm fsm, string stateName) { fsm.GetState(stateName).RemoveLastActionOfType(); } [PublicAPI] public static void RemoveLastActionOfType(this FsmState state) { int num = -1; for (int num2 = state.Actions.Length - 1; num2 >= 0; num2--) { if (state.Actions[num2] is TAction) { num = num2; break; } } if (num != -1) { state.RemoveAction(num); } } [PublicAPI] public static bool DisableAction(this PlayMakerFSM fsm, string stateName, int index) { return fsm.GetState(stateName).DisableAction(index); } [PublicAPI] public static bool DisableAction(this Fsm fsm, string stateName, int index) { return fsm.GetState(stateName).DisableAction(index); } [PublicAPI] public static bool DisableAction(this FsmState state, int index) { if (index < 0 || index >= state.Actions.Length) { return false; } state.Actions[index].Enabled = false; return true; } [PublicAPI] public static bool DisableActions(this PlayMakerFSM fsm, string stateName, params int[] indices) { return fsm.GetState(stateName).DisableActions(indices); } [PublicAPI] public static bool DisableActions(this Fsm fsm, string stateName, params int[] indices) { return fsm.GetState(stateName).DisableActions(indices); } [PublicAPI] public static bool DisableActions(this FsmState state, params int[] indices) { bool flag = true; foreach (int index in indices) { flag = flag && state.DisableAction(index); } return flag; } [PublicAPI] public static void DisableActionsOfType(this PlayMakerFSM fsm) { fsm.Fsm.DisableActionsOfType(); } [PublicAPI] public static void DisableActionsOfType(this Fsm fsm) { FsmState[] states = fsm.States; foreach (FsmState state in states) { state.DisableActionsOfType(); } } [PublicAPI] public static void DisableActionsOfType(this PlayMakerFSM fsm, string stateName) { fsm.GetState(stateName).DisableActionsOfType(); } [PublicAPI] public static void DisableActionsOfType(this Fsm fsm, string stateName) { fsm.GetState(stateName).DisableActionsOfType(); } [PublicAPI] public static void DisableActionsOfType(this FsmState state) { FsmStateAction[] actions = state.Actions; foreach (FsmStateAction val in actions) { if (val is TAction) { val.Enabled = false; } } } private static TVar[] MakeNewVariableArray(TVar[] orig, string name) where TVar : NamedVariable, new() { TVar[] array = new TVar[orig.Length + 1]; orig.CopyTo(array, 0); int num = orig.Length; TVar val = new TVar(); ((NamedVariable)val).name = name; array[num] = val; return array; } [PublicAPI] public static FsmFloat AddFloatVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.AddFloatVariable(name); } [PublicAPI] public static FsmFloat AddFloatVariable(this Fsm fsm, string name) { FsmFloat[] array = MakeNewVariableArray(fsm.Variables.FloatVariables, name); fsm.Variables.FloatVariables = array; return array[^1]; } [PublicAPI] public static FsmInt AddIntVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.AddIntVariable(name); } [PublicAPI] public static FsmInt AddIntVariable(this Fsm fsm, string name) { FsmInt[] array = MakeNewVariableArray(fsm.Variables.IntVariables, name); fsm.Variables.IntVariables = array; return array[^1]; } [PublicAPI] public static FsmBool AddBoolVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.AddBoolVariable(name); } [PublicAPI] public static FsmBool AddBoolVariable(this Fsm fsm, string name) { FsmBool[] array = MakeNewVariableArray(fsm.Variables.BoolVariables, name); fsm.Variables.BoolVariables = array; return array[^1]; } [PublicAPI] public static FsmString AddStringVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.AddStringVariable(name); } [PublicAPI] public static FsmString AddStringVariable(this Fsm fsm, string name) { FsmString[] array = MakeNewVariableArray(fsm.Variables.StringVariables, name); fsm.Variables.StringVariables = array; return array[^1]; } [PublicAPI] public static FsmVector2 AddVector2Variable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.AddVector2Variable(name); } [PublicAPI] public static FsmVector2 AddVector2Variable(this Fsm fsm, string name) { FsmVector2[] array = MakeNewVariableArray(fsm.Variables.Vector2Variables, name); fsm.Variables.Vector2Variables = array; return array[^1]; } [PublicAPI] public static FsmVector3 AddVector3Variable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.AddVector3Variable(name); } [PublicAPI] public static FsmVector3 AddVector3Variable(this Fsm fsm, string name) { FsmVector3[] array = MakeNewVariableArray(fsm.Variables.Vector3Variables, name); fsm.Variables.Vector3Variables = array; return array[^1]; } [PublicAPI] public static FsmColor AddColorVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.AddColorVariable(name); } [PublicAPI] public static FsmColor AddColorVariable(this Fsm fsm, string name) { FsmColor[] array = MakeNewVariableArray(fsm.Variables.ColorVariables, name); fsm.Variables.ColorVariables = array; return array[^1]; } [PublicAPI] public static FsmRect AddRectVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.AddRectVariable(name); } [PublicAPI] public static FsmRect AddRectVariable(this Fsm fsm, string name) { FsmRect[] array = MakeNewVariableArray(fsm.Variables.RectVariables, name); fsm.Variables.RectVariables = array; return array[^1]; } [PublicAPI] public static FsmQuaternion AddQuaternionVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.AddQuaternionVariable(name); } [PublicAPI] public static FsmQuaternion AddQuaternionVariable(this Fsm fsm, string name) { FsmQuaternion[] array = MakeNewVariableArray(fsm.Variables.QuaternionVariables, name); fsm.Variables.QuaternionVariables = array; return array[^1]; } [PublicAPI] public static FsmGameObject AddGameObjectVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.AddGameObjectVariable(name); } [PublicAPI] public static FsmGameObject AddGameObjectVariable(this Fsm fsm, string name) { FsmGameObject[] array = MakeNewVariableArray(fsm.Variables.GameObjectVariables, name); fsm.Variables.GameObjectVariables = array; return array[^1]; } private static TVar? FindInVariableArray(TVar[] orig, string name) where TVar : NamedVariable, new() { foreach (TVar val in orig) { if (((NamedVariable)val).Name == name) { return val; } } return default(TVar); } [PublicAPI] public static FsmFloat? FindFloatVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.FindFloatVariable(name); } [PublicAPI] public static FsmFloat? FindFloatVariable(this Fsm fsm, string name) { return FindInVariableArray(fsm.Variables.FloatVariables, name); } [PublicAPI] public static FsmInt? FindIntVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.FindIntVariable(name); } [PublicAPI] public static FsmInt? FindIntVariable(this Fsm fsm, string name) { return FindInVariableArray(fsm.Variables.IntVariables, name); } [PublicAPI] public static FsmBool? FindBoolVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.FindBoolVariable(name); } [PublicAPI] public static FsmBool? FindBoolVariable(this Fsm fsm, string name) { return FindInVariableArray(fsm.Variables.BoolVariables, name); } [PublicAPI] public static FsmString? FindStringVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.FindStringVariable(name); } [PublicAPI] public static FsmString? FindStringVariable(this Fsm fsm, string name) { return FindInVariableArray(fsm.Variables.StringVariables, name); } [PublicAPI] public static FsmVector2? FindVector2Variable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.FindVector2Variable(name); } [PublicAPI] public static FsmVector2? FindVector2Variable(this Fsm fsm, string name) { return FindInVariableArray(fsm.Variables.Vector2Variables, name); } [PublicAPI] public static FsmVector3? FindVector3Variable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.FindVector3Variable(name); } [PublicAPI] public static FsmVector3? FindVector3Variable(this Fsm fsm, string name) { return FindInVariableArray(fsm.Variables.Vector3Variables, name); } [PublicAPI] public static FsmColor? FindColorVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.FindColorVariable(name); } [PublicAPI] public static FsmColor? FindColorVariable(this Fsm fsm, string name) { return FindInVariableArray(fsm.Variables.ColorVariables, name); } [PublicAPI] public static FsmRect? FindRectVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.FindRectVariable(name); } [PublicAPI] public static FsmRect? FindRectVariable(this Fsm fsm, string name) { return FindInVariableArray(fsm.Variables.RectVariables, name); } [PublicAPI] public static FsmQuaternion? FindQuaternionVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.FindQuaternionVariable(name); } [PublicAPI] public static FsmQuaternion? FindQuaternionVariable(this Fsm fsm, string name) { return FindInVariableArray(fsm.Variables.QuaternionVariables, name); } [PublicAPI] public static FsmGameObject? FindGameObjectVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.FindGameObjectVariable(name); } [PublicAPI] public static FsmGameObject? FindGameObjectVariable(this Fsm fsm, string name) { return FindInVariableArray(fsm.Variables.GameObjectVariables, name); } [PublicAPI] public static FsmFloat GetFloatVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.GetFloatVariable(name); } [PublicAPI] public static FsmFloat GetFloatVariable(this Fsm fsm, string name) { FsmFloat val = fsm.FindFloatVariable(name); if (val != null) { return val; } return fsm.AddFloatVariable(name); } [PublicAPI] public static FsmInt GetIntVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.GetIntVariable(name); } [PublicAPI] public static FsmInt GetIntVariable(this Fsm fsm, string name) { FsmInt val = fsm.FindIntVariable(name); if (val != null) { return val; } return fsm.AddIntVariable(name); } [PublicAPI] public static FsmBool GetBoolVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.GetBoolVariable(name); } [PublicAPI] public static FsmBool GetBoolVariable(this Fsm fsm, string name) { FsmBool val = fsm.FindBoolVariable(name); if (val != null) { return val; } return fsm.AddBoolVariable(name); } [PublicAPI] public static FsmString GetStringVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.GetStringVariable(name); } [PublicAPI] public static FsmString GetStringVariable(this Fsm fsm, string name) { FsmString val = fsm.FindStringVariable(name); if (val != null) { return val; } return fsm.AddStringVariable(name); } [PublicAPI] public static FsmVector2 GetVector2Variable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.GetVector2Variable(name); } [PublicAPI] public static FsmVector2 GetVector2Variable(this Fsm fsm, string name) { FsmVector2 val = fsm.FindVector2Variable(name); if (val != null) { return val; } return fsm.AddVector2Variable(name); } [PublicAPI] public static FsmVector3 GetVector3Variable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.GetVector3Variable(name); } [PublicAPI] public static FsmVector3 GetVector3Variable(this Fsm fsm, string name) { FsmVector3 val = fsm.FindVector3Variable(name); if (val != null) { return val; } return fsm.AddVector3Variable(name); } [PublicAPI] public static FsmColor GetColorVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.GetColorVariable(name); } [PublicAPI] public static FsmColor GetColorVariable(this Fsm fsm, string name) { FsmColor val = fsm.FindColorVariable(name); if (val != null) { return val; } return fsm.AddColorVariable(name); } [PublicAPI] public static FsmRect GetRectVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.GetRectVariable(name); } [PublicAPI] public static FsmRect GetRectVariable(this Fsm fsm, string name) { FsmRect val = fsm.FindRectVariable(name); if (val != null) { return val; } return fsm.AddRectVariable(name); } [PublicAPI] public static FsmQuaternion GetQuaternionVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.GetQuaternionVariable(name); } [PublicAPI] public static FsmQuaternion GetQuaternionVariable(this Fsm fsm, string name) { FsmQuaternion val = fsm.FindQuaternionVariable(name); if (val != null) { return val; } return fsm.AddQuaternionVariable(name); } [PublicAPI] public static FsmGameObject GetGameObjectVariable(this PlayMakerFSM fsm, string name) { return fsm.Fsm.GetGameObjectVariable(name); } [PublicAPI] public static FsmGameObject GetGameObjectVariable(this Fsm fsm, string name) { FsmGameObject val = fsm.FindGameObjectVariable(name); if (val != null) { return val; } return fsm.AddGameObjectVariable(name); } } [BepInPlugin("MitosisDancers", "MitosisDancers", "1.0.0")] public class Plugin : BaseUnityPlugin { private static Harmony _harmony; private void Awake() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown Debug.Log((object)"Plugin MitosisDancers (1.0.0) has loaded!"); _harmony = new Harmony("1.0.0"); MainPatches.Initialize(); _harmony.PatchAll(typeof(MainPatches)); } private void OnDestroy() { _harmony.UnpatchSelf(); } } } namespace MitosisDancers.Patches { internal static class BossPatches { internal static GameObject[] AllDancers = (GameObject[])(object)new GameObject[8]; [HarmonyPrefix] [HarmonyPatch(typeof(PlayMakerFSM), "Start")] private static void ModifyDancer(PlayMakerFSM __instance) { //IL_006c: 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) string name = ((Object)((Component)__instance).gameObject).name; if (name == "Dancer Control" && __instance.FsmName == "Control" && (Object)(object)((Component)__instance).gameObject.GetComponent() == (Object)null) { GameObject gameObject = ((Component)__instance).gameObject; AllDancers[0] = gameObject; ((Component)__instance).gameObject.AddComponent(); for (int i = 1; i < 8; i++) { GameObject val = Object.Instantiate(gameObject, gameObject.transform.position, gameObject.transform.rotation); AllDancers[i] = val; } } } [HarmonyPostfix] [HarmonyPatch(typeof(Language), "Get", new Type[] { typeof(string), typeof(string) })] private static void ChangeDancersTitle(string key, string sheetTitle, ref string __result) { //IL_0014: 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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Invalid comparison between Unknown and I4 //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Invalid comparison between Unknown and I4 if (1 == 0) { } string text2; if (key == "COGWORK_DANCERS_SUPER") { LanguageCode val = Language.CurrentLanguage(); if (1 == 0) { } string text = (((int)val == 44) ? "Mitosis" : (((int)val != 117) ? __result : "자가복제")); if (1 == 0) { } text2 = text; } else { text2 = __result; } if (1 == 0) { } __result = text2; } } internal static class HealthSharePatch { internal static int SharedHealth = 100; [HarmonyPostfix] [HarmonyPatch(typeof(HealthManager), "TakeDamage")] private static void DamageTaken(HealthManager __instance, HitInstance hitInstance) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)((Component)((Component)__instance).transform.parent).gameObject.GetComponent())) { SharedHealth -= hitInstance.DamageDealt; __instance.hp = SharedHealth; } } internal static void PhaseHPsetter(int health) { SharedHealth = health; } } internal static class MainPatches { private static Harmony _harmony; internal static void Initialize() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown _harmony = new Harmony("MainPatches"); } [HarmonyPostfix] [HarmonyPatch(typeof(GameManager), "SetLoadedGameData", new Type[] { typeof(SaveGameData), typeof(int) })] private static void CheckPatchDancers(GameManager __instance) { __instance.GetSaveStatsForSlot(PlayerData.instance.profileID, (Action)delegate { _harmony.PatchAll(typeof(BossPatches)); _harmony.PatchAll(typeof(HealthSharePatch)); }); } [HarmonyPostfix] [HarmonyPatch(typeof(GameManager), "ReturnToMainMenu")] private static IEnumerator Unpatch(IEnumerator result) { while (result.MoveNext()) { yield return result.Current; } _harmony.UnpatchSelf(); } } } namespace MitosisDancers.Behaviours { [RequireComponent(typeof(PlayMakerFSM))] internal class MitosisDancersInit : MonoBehaviour { private GameObject dancerA = null; private GameObject dancerB = null; private GameObject pos1 = null; private GameObject pos2 = null; private GameObject pos3 = null; private GameObject pos4 = null; private GameObject pos5 = null; private GameObject pos6 = null; private GameObject pos7 = null; private GameObject pos8 = null; private GameObject pos9 = null; private GameObject pos10 = null; private GameObject pos11 = null; private GameObject pos12 = null; private GameObject centre = null; private PlayMakerFSM _control = null; private PlayMakerFSM _beat = null; private PlayMakerFSM dancerA_control = null; private PlayMakerFSM dancerB_control = null; private int order = 0; private Vector3 currentscale = new Vector3(1f, 1f, 1f); private void Start() { _control = FSMUtility.LocateMyFSM(((Component)this).gameObject, "Control"); _beat = FSMUtility.LocateMyFSM(((Component)this).gameObject, "Beat Control"); dancerA = ((Component)((Component)this).gameObject.transform.Find("Dancer A")).gameObject; dancerB = ((Component)((Component)this).gameObject.transform.Find("Dancer B")).gameObject; dancerA_control = FSMUtility.LocateMyFSM(dancerA, "Control"); dancerB_control = FSMUtility.LocateMyFSM(dancerB, "Control"); order = Array.IndexOf(BossPatches.AllDancers, ((Component)this).gameObject); BaseModifier(); ((MonoBehaviour)this).StartCoroutine(OrderModifier()); ShareStun(); } private void BaseModifier() { //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_027b: 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) _control.GetState("Set Phase 2").RemoveAction(1); _control.GetState("Set Phase 2").RemoveAction(0); _control.GetState("Set Phase 3").RemoveAction(1); _control.GetState("Set Phase 3").RemoveAction(0); pos1 = ((Component)((Component)this).gameObject.transform.Find("Pos1")).gameObject; pos2 = ((Component)((Component)this).gameObject.transform.Find("Pos2")).gameObject; pos3 = ((Component)((Component)this).gameObject.transform.Find("Pos3")).gameObject; pos4 = ((Component)((Component)this).gameObject.transform.Find("Pos4")).gameObject; pos5 = ((Component)((Component)this).gameObject.transform.Find("Pos5")).gameObject; pos6 = ((Component)((Component)this).gameObject.transform.Find("Pos6")).gameObject; pos7 = ((Component)((Component)this).gameObject.transform.Find("Pos7")).gameObject; pos8 = ((Component)((Component)this).gameObject.transform.Find("Pos8")).gameObject; pos9 = ((Component)((Component)this).gameObject.transform.Find("Pos9")).gameObject; pos10 = ((Component)((Component)this).gameObject.transform.Find("Pos10")).gameObject; pos11 = ((Component)((Component)this).gameObject.transform.Find("Pos11")).gameObject; pos12 = ((Component)((Component)this).gameObject.transform.Find("Pos12")).gameObject; centre = ((Component)((Component)this).gameObject.transform.Find("Centre")).gameObject; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(2.3f, 0f, 0f); Transform transform = pos1.transform; transform.position -= val; Transform transform2 = pos5.transform; transform2.position += val; Transform transform3 = pos8.transform; transform3.position -= val; Transform transform4 = pos12.transform; transform4.position += val; } private IEnumerator OrderModifier() { yield return null; yield return null; FsmState delaystate = _beat.AddState("Order Delay"); delaystate.AddTransition("FINISHED", "Beat"); _beat.ChangeTransition("Init", "BEGIN", "Order Delay"); GameObject ringholder = new GameObject("Ring Holder"); GameObject bladesphere = dancerA_control.fsm.GetFsmGameObject("Blade Sphere").value; GameObject ring = ((Component)((Component)this).gameObject.transform.Find("Join Ring")).gameObject; GameObject ringglow = ((Component)((Component)this).gameObject.transform.Find("Join Glow")).gameObject; ringholder.transform.position = ring.transform.position; bladesphere.transform.parent = ringholder.transform; ring.transform.parent = ringholder.transform; ringglow.transform.parent = ringholder.transform; ringholder.transform.parent = ((Component)this).gameObject.transform; ringholder.transform.parent = ((Component)this).gameObject.transform; GameObject[] groundhalf = (GameObject[])(object)new GameObject[5] { pos8, pos9, pos10, pos11, pos12 }; GameObject[] tophalf = (GameObject[])(object)new GameObject[5] { pos1, this.pos2, pos3, pos4, pos5 }; _control.GetState("Set Phase 2").AddMethod(delegate { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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_0072: 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_0098: 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_00cd: 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_00d3: Unknown result type (might be due to invalid IL or missing references) Vector3 localScale = default(Vector3); ((Vector3)(ref localScale))..ctor(0.75f, 0.75f, 0.75f); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(0f, 0.8f, 0f); currentscale = localScale; dancerA.transform.localScale = localScale; dancerB.transform.localScale = localScale; ringholder.transform.localScale = localScale; GameObject[] array3 = tophalf; foreach (GameObject val2 in array3) { Transform transform31 = val2.transform; transform31.position += val; } GameObject[] array4 = groundhalf; foreach (GameObject val3 in array4) { Transform transform32 = val3.transform; transform32.position -= val; } }); _control.GetState("Set Phase 3").AddMethod(delegate { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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_0072: 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_0098: 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_00cd: 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_00d3: Unknown result type (might be due to invalid IL or missing references) Vector3 localScale = default(Vector3); ((Vector3)(ref localScale))..ctor(0.5f, 0.5f, 0.5f); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(0f, 0.8f, 0f); currentscale = localScale; dancerA.transform.localScale = localScale; dancerB.transform.localScale = localScale; ringholder.transform.localScale = localScale; GameObject[] array3 = tophalf; foreach (GameObject val2 in array3) { Transform transform31 = val2.transform; transform31.position += val; } GameObject[] array4 = groundhalf; foreach (GameObject val3 in array4) { Transform transform32 = val3.transform; transform32.position -= val; } }); FsmState deathstate = _control.GetState("Dancer Death"); deathstate.RemoveAction(6); deathstate.RemoveAction(5); deathstate.RemoveAction(4); deathstate.RemoveAction(3); deathstate.RemoveAction(2); deathstate.AddMethod(delegate { dancerA_control.SendEvent("DIE"); dancerB_control.SendEvent("DIE"); _control.fsm.GetFsmInt("Dancers Killed").value = 2; }); if (order == 0) { _control.GetState("Windup 1").AddMethod(delegate { HealthSharePatch.PhaseHPsetter(900); }); _control.GetState("Set Phase 2").AddMethod(delegate { HealthSharePatch.PhaseHPsetter(1500); }); _control.GetState("Set Phase 3").AddMethod(delegate { HealthSharePatch.PhaseHPsetter(2000); }); } else { Object.Destroy((Object)(object)FSMUtility.LocateMyFSM(((Component)this).gameObject, "Music Control")); _beat.GetState("Beat").RemoveAction(1); } if (order > 1) { dancerA.SetActive(false); dancerB.SetActive(false); dancerA_control.fsm.GetFsmBool("Did Roar").value = true; dancerB_control.fsm.GetFsmBool("Did Roar").value = true; if (order < 4) { _control.GetState("Set Phase 2").AddMethod(delegate { dancerA.SetActive(true); dancerB.SetActive(true); }); } else { _control.GetState("Set Phase 3").AddMethod(delegate { dancerA.SetActive(true); dancerB.SetActive(true); }); GameObject[] array = tophalf; foreach (GameObject pos in array) { Transform transform = pos.transform; transform.position += new Vector3(0f, -3.5f, 0f); } GameObject[] array2 = groundhalf; foreach (GameObject pos2 in array2) { Transform transform2 = pos2.transform; transform2.position += new Vector3(0f, 3.5f, 0f); } } } FsmState emergeA = dancerA_control.GetState("Emerge"); FsmState emergeB = dancerB_control.GetState("Emerge"); switch (order) { case 0: { Transform transform29 = dancerA.transform; transform29.position += new Vector3(-0.5f, 0f); Transform transform30 = dancerB.transform; transform30.position += new Vector3(-0.5f, 0f); break; } case 1: { _control.ChangeTransition("Start Phase 1", "FINISHED", "Sequence 1A 5"); delaystate.AddAction(Waiter(0.5f)); Transform transform27 = dancerA.transform; transform27.position += new Vector3(0.5f, 0f); Transform transform28 = dancerB.transform; transform28.position += new Vector3(0.5f, 0f); dancerA_control.fsm.GetFsmGameObject("Start Pos").value = pos11; dancerB_control.fsm.GetFsmGameObject("Start Pos").value = pos9; emergeA.GetAction(9).gameObject = FsmGO(pos11); emergeB.GetAction(9).gameObject = FsmGO(pos9); break; } case 2: { _control.ChangeTransition("Start Phase 2", "FINISHED", "Sequence 1C 3"); delaystate.AddAction(Waiter(0.25f)); Transform transform23 = dancerA.transform; transform23.position += new Vector3(0f, 1.5f); Transform transform24 = dancerB.transform; transform24.position += new Vector3(0f, 1.5f); dancerA_control.fsm.GetFsmGameObject("Current Pos").value = pos5; dancerB_control.fsm.GetFsmGameObject("Current Pos").value = pos1; emergeA.GetAction(9).gameObject = FsmGO(pos5); emergeB.GetAction(9).gameObject = FsmGO(pos1); Transform transform25 = centre.transform; transform25.position += new Vector3(5f, 0f); Transform transform26 = ringholder.transform; transform26.position += new Vector3(5f, 0f); break; } case 3: { _control.ChangeTransition("Start Phase 2", "FINISHED", "Sequence 2A 1"); delaystate.AddAction(Waiter(0.75f)); Transform transform19 = dancerA.transform; transform19.position += new Vector3(0f, -1.5f); Transform transform20 = dancerB.transform; transform20.position += new Vector3(0f, -1.5f); dancerA_control.fsm.GetFsmGameObject("Current Pos").value = this.pos2; dancerB_control.fsm.GetFsmGameObject("Current Pos").value = pos4; emergeA.GetAction(9).gameObject = FsmGO(this.pos2); emergeB.GetAction(9).gameObject = FsmGO(pos4); Transform transform21 = centre.transform; transform21.position += new Vector3(-5f, 0f); Transform transform22 = ringholder.transform; transform22.position += new Vector3(-5f, 0f); break; } case 4: { _control.ChangeTransition("Start Phase 3", "FINISHED", "Sequence 1C 1"); delaystate.AddAction(Waiter(0.125f)); Transform transform15 = dancerA.transform; transform15.position += new Vector3(0.5f, 1.5f); Transform transform16 = dancerB.transform; transform16.position += new Vector3(0.5f, 1.5f); dancerA_control.fsm.GetFsmGameObject("Current Pos").value = pos8; dancerB_control.fsm.GetFsmGameObject("Current Pos").value = pos12; emergeA.GetAction(9).gameObject = FsmGO(pos8); emergeB.GetAction(9).gameObject = FsmGO(pos12); Transform transform17 = centre.transform; transform17.position += new Vector3(3f, 2f); Transform transform18 = ringholder.transform; transform18.position += new Vector3(3f, 2f); break; } case 5: { _control.ChangeTransition("Start Phase 3", "FINISHED", "Sequence 1A 5"); delaystate.AddAction(Waiter(0.375f)); Transform transform11 = dancerA.transform; transform11.position += new Vector3(-0.5f, -1.5f); Transform transform12 = dancerB.transform; transform12.position += new Vector3(-0.5f, -1.5f); dancerA_control.fsm.GetFsmGameObject("Current Pos").value = pos11; dancerB_control.fsm.GetFsmGameObject("Current Pos").value = pos9; emergeA.GetAction(9).gameObject = FsmGO(pos11); emergeB.GetAction(9).gameObject = FsmGO(pos9); Transform transform13 = centre.transform; transform13.position += new Vector3(-3f, -2f); Transform transform14 = ringholder.transform; transform14.position += new Vector3(-3f, -2f); break; } case 6: { _control.ChangeTransition("Start Phase 3", "FINISHED", "Sequence 1D 5"); delaystate.AddAction(Waiter(0.625f)); Transform transform7 = dancerA.transform; transform7.position += new Vector3(-0.5f, 1.5f); Transform transform8 = dancerB.transform; transform8.position += new Vector3(-0.5f, 1.5f); dancerA_control.fsm.GetFsmGameObject("Current Pos").value = pos1; dancerB_control.fsm.GetFsmGameObject("Current Pos").value = pos5; emergeA.GetAction(9).gameObject = FsmGO(pos1); emergeB.GetAction(9).gameObject = FsmGO(pos5); Transform transform9 = centre.transform; transform9.position += new Vector3(-3f, 2f); Transform transform10 = ringholder.transform; transform10.position += new Vector3(-3f, 2f); break; } case 7: { _control.ChangeTransition("Start Phase 3", "FINISHED", "Sequence 4D 5"); delaystate.AddAction(Waiter(0.875f)); Transform transform3 = dancerA.transform; transform3.position += new Vector3(0.5f, -1.5f); Transform transform4 = dancerB.transform; transform4.position += new Vector3(0.5f, -1.5f); dancerA_control.fsm.GetFsmGameObject("Current Pos").value = pos4; dancerB_control.fsm.GetFsmGameObject("Current Pos").value = this.pos2; emergeA.GetAction(9).gameObject = FsmGO(pos4); emergeB.GetAction(9).gameObject = FsmGO(this.pos2); Transform transform5 = centre.transform; transform5.position += new Vector3(3f, -2f); Transform transform6 = ringholder.transform; transform6.position += new Vector3(3f, -2f); break; } } dancerA_control.fsm.GetFsmVector3("Rest Pos").value = dancerA.transform.position; dancerB_control.fsm.GetFsmVector3("Rest Pos").value = dancerB.transform.position; dancerA_control.fsm.GetFsmVector3("Return Pos").value = dancerA.transform.position; dancerB_control.fsm.GetFsmVector3("Return Pos").value = dancerB.transform.position; dancerA_control.GetState("OB Pause").GetAction(0).time = FsmFloat.op_Implicit(0.25f); dancerB_control.GetState("OB Pause").GetAction(0).time = FsmFloat.op_Implicit(0.25f); dancerA_control.AddMethod("Primary Return", delegate { //IL_0017: 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) dancerA.transform.localScale = currentscale; dancerB.transform.localScale = currentscale; }); static FsmOwnerDefault FsmGO(GameObject go) { //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_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_001a: Expected O, but got Unknown return new FsmOwnerDefault { ownerOption = (OwnerDefaultOption)1, gameObject = FsmGameObject.op_Implicit(go) }; } static FsmStateAction Waiter(float time) { //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_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown return (FsmStateAction)new Wait { time = FsmFloat.op_Implicit(time), finishEvent = FsmEvent.Finished }; } } private void ShareStun() { //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_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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown //IL_0046: 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) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown PlayMakerFSM[] array = (PlayMakerFSM[])(object)new PlayMakerFSM[2] { dancerA_control, dancerB_control }; foreach (PlayMakerFSM fsm in array) { fsm.GetState("Stun Stagger").AddAction((FsmStateAction)new SendEventByName { eventTarget = new FsmEventTarget { target = (EventTarget)4 }, sendEvent = FsmString.op_Implicit("DANCER STUNNED"), delay = FsmFloat.op_Implicit(0f), everyFrame = false }); } } } }