Пример #1
0
        private IEnumerator DreamFall()
        {
            #region Freeze Camera
            c.FreezeInPlace(true);
            #endregion

            #region Fade Out

            foreach (var item in hGo.GetComponentsInChildren <PlayMakerFSM>())
            {
                item.SendEvent("FSM CANCEL");
            }
            hGo.LocateMyFSM("ProxyFSM").FsmVariables.GetFsmBool("No Charms").Value = false;
            h.RelinquishControl();
            // Spawn "Audio Player Actor" at the knight's position with the "dream_enter" audioclip, at 1-1 pitch with 1 volume, 0 delay, maybe store?
            h.StopAnimationControl();
            foreach (var item in GameObject.Find("HUD Blanker White").GetComponentsInChildren <PlayMakerFSM>())
            {
                item.SendEvent("FADE IN");
            }
            GameObject.Find("HUD Blanker White").LocateMyFSM("Blanker Control").FsmVariables.GetFsmFloat("Fade Time").Value = 0.9f;
            foreach (var item in GameObject.Find("HUD Blanker White").GetComponentsInChildren <PlayMakerFSM>())
            {
                item.SendEvent("FADE IN");
            }
            yield return(new WaitForSeconds(1));

            #endregion

            #region New Scene
            g.TimePasses();
            g.ResetSemiPersistentItems();
            GameObject.Find("MainCamera").LocateMyFSM("CameraFade").FsmVariables.GetFsmBool("No Fade").Value = true;
            hGo.LocateMyFSM("Dream Return").FsmVariables.GetFsmBool("Dream Returning").Value = true;
            h.EnterWithoutInput(true);
            #endregion

            #region Waterways
            // begin the scene transition, 0 delay, enum 0, preventfade true
            #endregion
        }
Пример #2
0
        public static void Teleport(string scenename, Vector3 pos)
        {
            PlayerData.instance.nailDamage = 65;

            if (hc == null)
            {
                hc = gm.hero_ctrl;

                for (int i = 1; i <= 40; i++)
                {
                    PlayerData.instance.SetIntInternal("charmCost_" + i, 0);
                }
            }

            HeroController.instance.RegainControl();
            HeroController.instance.StartAnimationControl();
            HeroController.instance.cState.invulnerable = false;
            PlayerData.instance.disablePause            = false;

            GameCameras.instance.hudCamera.enabled = true;

            bgImg.enabled        = true;
            BossInfo.battleScene = null;

            BossRush.selectX        = 1;
            BossRush.selectY        = 1;
            BossRush.selectingStage = false;

            bossSelectImg.enabled = false;
            selectPos.GetComponent <Image>().enabled = false;
            for (int i = 0; i < bossFaces.Length; i++)
            {
                bossFaces[i].enabled = false;
                bossText[i].enabled  = false;
            }
            if (BossInfo.defeatedBosses % 9 == 8)
            {
                if (BossInfo.defeatedBosses < 9)
                {
                    for (int i = 0; i < bossFaces.Length; i++)
                    {
                        bossFaces[i].sprite = bossFace2[i];
                    }
                }
                else
                {
                    for (int i = 0; i < bossFaces.Length; i++)
                    {
                        bossFaces[i].sprite = bossFace3[i];
                    }
                }
            }

            pickups = 0;

            PlayerData.instance.soulLimited = false;
            PlayerData.instance.EndSoulLimiter();
            if (!ItemInfo.upgrades.ContainsKey("quakeLevel"))
            {
                ItemInfo.upgrades["quakeLevel"] = 0;
            }
            quakeLevel = ItemInfo.upgrades["quakeLevel"];
            if (scenename == "Ruins1_24")
            {
                PlayerData.instance.quakeLevel = 0;
            }
            else
            {
                PlayerData.instance.quakeLevel = quakeLevel;
            }
            //PlayerData.instance.quakeLevel = 0;

            PlayerData.instance.canDash     = PlayerData.instance.hasDash;
            PlayerData.instance.canWallJump = PlayerData.instance.hasWalljump;

            if (PlayerData.instance.royalCharmState > 0 && !PlayerData.instance.gotCharm_36)
            {
                PlayerData.instance.gotCharm_36      = true;
                PlayerData.instance.equippedCharm_36 = true;
            }

            oldGrimmLevel = grimmLevel;

            PlayerData.instance.metGrimm    = true;
            PlayerData.instance.foughtGrimm = true;
            if (scenename == "Grimm_Main_Tent")
            {
                PlayerData.instance.SetIntInternal("grimmChildLevel", 2);
            }
            else
            {
                PlayerData.instance.SetIntInternal("grimmChildLevel", grimmLevel);
            }
            PlayerData.instance.SetIntInternal("flamesCollected", 3);
            PlayerData.instance.SetBoolInternal("grimmChildAwoken", false);
            PlayerData.instance.SetBoolInternal("foughtGrimm", false);
            PlayerData.instance.SetBoolInternal("killedGrimm", false);

            if (grimmLevel > 0 || scenename == "Grimm_Main_Tent")
            {
                PlayerData.instance.equippedCharm_40 = true;
            }

            PlayerData.instance.hasCharm     = true;
            PlayerData.instance.hasSpell     = true;
            PlayerData.instance.hasNailArt   = true;
            PlayerData.instance.hasDreamNail = true;

            PlayerData.instance.fragileGreed_unbreakable    = true;
            PlayerData.instance.fragileHealth_unbreakable   = true;
            PlayerData.instance.fragileStrength_unbreakable = true;

            hc.proxyFSM.SendEvent("HeroCtrl-MaxHealth");
            hc.proxyFSM.SendEvent("HeroCtrl-Healed");
            hc.proxyFSM.SendEvent("BENCHREST");
            hc.proxyFSM.SendEvent("HERO REVIVED");
            GameCameras.instance.soulOrbFSM.SendEvent("MP GAIN");
            gm.soulVessel_fsm.SendEvent("MP RESERVE UP");
            PlayMakerFSM.BroadcastEvent("UPDATE NAIL DAMAGE");

            PlayerData.instance.MaxHealth();
            HeroController.instance.CharmUpdate();
            PlayerData.instance.UpdateBlueHealth();
            PlayMakerFSM.BroadcastEvent("UPDATE BLUE HEALTH");

            //VVV TELEPORT CODE VVV

            hc.transform.position = pos;

            hc.EnterWithoutInput(false);
            hc.proxyFSM.SendEvent("HeroCtrl-LeavingScene");
            hc.transform.SetParent(null);

            gm.NoLongerFirstGame();
            gm.SaveLevelState();
            gm.SetState(GameState.EXITING_LEVEL);
            gm.entryGateName = "dreamGate";
            gm.cameraCtrl.FreezeInPlace(false);

            hc.ResetState();

            gm.LoadScene(scenename);
        }