Example #1
0
        public override void OnEnableFsm(PlayMakerFSM fsm)
        {
            if (fsm.FsmName == "Geo Rock" && fsm.gameObject.name == GeoRockUtility.GetGeoRockName(this))
            {
                GeoRockUtility.ModifyGeoRock(fsm, location.flingType, this, items);
            }

            if (fsm.FsmName == "Shiny Control" && ShinyUtility.TryGetItemFromShinyName(fsm.gameObject.name, this, out var item))
            {
                ShinyUtility.ModifyShiny(fsm, location.flingType, this, item);
                if (!HasVisited() && location.flingType == FlingType.Everywhere)
                {
                    ShinyUtility.FlingShinyRandomly(fsm);
                }
                else
                {
                    ShinyUtility.FlingShinyDown(fsm);
                }
                fsm.gameObject.transform.Translate(new Vector3(0, 0, -0.1f));
            }

            if (fsm.FsmName == "Shiny Control" && ShinyUtility.GetShinyPrefix(this) == fsm.gameObject.name)
            {
                ShinyUtility.ModifyMultiShiny(fsm, location.flingType, this, items);
                if (!HasVisited() && location.flingType == FlingType.Everywhere)
                {
                    ShinyUtility.FlingShinyRandomly(fsm);
                }
                else
                {
                    ShinyUtility.FlingShinyDown(fsm);
                }
                fsm.gameObject.transform.Translate(new Vector3(0, 0, -0.1f));
            }

            if (fsm.FsmName == "Bottle Control" && fsm.gameObject.name == GrubJarUtility.GetGrubJarName(this))
            {
                GrubJarUtility.ModifyBottleFsm(fsm.gameObject, location.flingType, this, items);
            }

            if (fsm.FsmName == "Chest Control" && fsm.gameObject.name == ChestUtility.GetChestName(this))
            {
                ChestUtility.ModifyChest(fsm, location.flingType, this, items);
            }
        }
        public override void OnEnableFsm(PlayMakerFSM fsm)
        {
            if (fsm.FsmName == chestFsm && fsm.gameObject.name == chestName)
            {
                ChestUtility.ModifyChest(fsm, flingType, this, items);
            }

            if (fsm.FsmName == "Shiny Control" && ShinyUtility.TryGetItemFromShinyName(fsm.gameObject.name, this, out var item))
            {
                ShinyUtility.ModifyShiny(fsm, flingType, this, item);
                if (!HasVisited() && flingType == FlingType.Everywhere)
                {
                    ShinyUtility.FlingShinyRandomly(fsm);
                }
                else
                {
                    ShinyUtility.FlingShinyDown(fsm);
                }
            }
        }