Esempio n. 1
0
    private void Start()
    {
        BattleHUD.Read();
        this.cameraController = GameObject.Find("Battle Camera").GetComponent <BattleMapCameraController> ();
        this.InitBattleScene();
        HonoluluBattleMain.UpdateFrameTime(FF9StateSystem.Settings.FastForwardFactor);
        GameObject gameObject = GameObject.Find("BattleMap Root");

        HonoluluBattleMain.battleSPS = new GameObject("BattleMap SPS")
        {
            transform =
            {
                parent = gameObject.transform
            }
        }.AddComponent <BattleSPSSystem> ();
        HonoluluBattleMain.battleSPS.Init();
        byte camera = FF9StateSystem.Battle.FF9Battle.btl_scene.PatAddr[(int)FF9StateSystem.Battle.FF9Battle.btl_scene.PatNum].Camera;

        FF9StateSystem.Battle.FF9Battle.seq_work_set.CameraNo = ((camera >= 3) ? checked ((byte)UnityEngine.Random.Range(0, 3)) : camera);
        SFX.StartBattle();
        if (FF9StateSystem.Settings.cfg.skip_btl_camera == 0UL && FF9StateSystem.Battle.isRandomEncounter)
        {
            SFX.SkipCameraAnimation(-1);
        }
        if (FF9StateSystem.Battle.isNoBoosterMap())
        {
            FF9StateSystem.Settings.IsBoosterButtonActive[0] = false;
            FF9StateSystem.Settings.SetBoosterHudToCurrentState();
            PersistenSingleton <UIManager> .Instance.Booster.SetBoosterButton(BoosterType.BattleAssistance, false);
        }
    }
Esempio n. 2
0
 public void SetFastForward(bool isFastForward)
 {
     FF9StateSystem.Settings.IsBoosterButtonActive[1] = isFastForward;
     if (isFastForward)
     {
         if (PersistenSingleton <UIManager> .Instance.UnityScene == UIManager.Scene.Field)
         {
             if (EventHUD.CurrentHUD != MinigameHUD.Auction && EventHUD.CurrentHUD != MinigameHUD.PandoniumElevator)
             {
                 HonoBehaviorSystem.Instance.StartFastForwardMode();
                 if (!MBG.IsNull)
                 {
                     MBG.Instance.SetFastForward(true);
                 }
             }
         }
         else if (PersistenSingleton <UIManager> .Instance.UnityScene == UIManager.Scene.World)
         {
             HonoBehaviorSystem.Instance.StartFastForwardMode();
         }
         else if (PersistenSingleton <UIManager> .Instance.UnityScene == UIManager.Scene.Battle)
         {
             HonoluluBattleMain.UpdateFrameTime(HonoBehaviorSystem.Instance.GetFastForwardFactor());
         }
         else if (PersistenSingleton <UIManager> .Instance.UnityScene == UIManager.Scene.Ending && !MBG.IsNull)
         {
             MBG.Instance.SetFastForward(true);
         }
     }
     else if (PersistenSingleton <UIManager> .Instance.UnityScene == UIManager.Scene.Field)
     {
         HonoBehaviorSystem.Instance.StopFastForwardMode();
         if (!MBG.IsNull)
         {
             MBG.Instance.SetFastForward(false);
         }
     }
     else if (PersistenSingleton <UIManager> .Instance.UnityScene == UIManager.Scene.World)
     {
         HonoBehaviorSystem.Instance.StopFastForwardMode();
     }
     else if (PersistenSingleton <UIManager> .Instance.UnityScene == UIManager.Scene.Battle)
     {
         HonoluluBattleMain.UpdateFrameTime(1);
     }
     else if (PersistenSingleton <UIManager> .Instance.UnityScene == UIManager.Scene.Ending && !MBG.IsNull)
     {
         MBG.Instance.SetFastForward(false);
     }
     SoundLib.UpdatePlayingSoundEffectPitchByGameSpeed();
 }
Esempio n. 3
0
    private void OnUiAttackDebug()
    {
        Rect fullscreenRect = DebugGuiSkin.GetFullscreenRect();
        Rect screenRect     = fullscreenRect;

        screenRect.height *= 0.375f;
        screenRect.y       = fullscreenRect.height - screenRect.height;
        GUILayout.BeginArea(screenRect);
        GUILayout.BeginVertical(new GUILayoutOption[0]);
        this.scrollPosition = GUILayout.BeginScrollView(this.scrollPosition, new GUILayoutOption[]
        {
            GUILayout.Width(screenRect.width),
            GUILayout.Height(screenRect.height)
        });
        GUILayout.BeginHorizontal("Box", new GUILayoutOption[0]);
        Boolean isTrance = GUILayout.Toggle(FF9StateSystem.Battle.isTrance[FF9StateSystem.Battle.selectCharPosID], "Trance", new GUILayoutOption[0]);

        if (isTrance != FF9StateSystem.Battle.isTrance[FF9StateSystem.Battle.selectCharPosID])
        {
            BattleUnit character = btl_scrp.FindBattleUnit((UInt16)(1 << FF9StateSystem.Battle.selectCharPosID));
            FF9StateSystem.Battle.isTrance[FF9StateSystem.Battle.selectCharPosID] = isTrance;
            if (isTrance)
            {
                character.Trance = Byte.MaxValue;
                character.AlterStatus(BattleStatus.Trance);
            }
            else
            {
                character.Trance = 0;
                character.RemoveStatus(BattleStatus.Trance);
            }
        }
        if (GUILayout.Button("Attack", new GUILayoutOption[0]))
        {
            HonoluluBattleMain.playCommand(FF9StateSystem.Battle.selectCharPosID, 0, 16, isTrance);
        }
        else if (GUILayout.Button("Skill1", new GUILayoutOption[0]))
        {
            HonoluluBattleMain.playCommand(FF9StateSystem.Battle.selectCharPosID, 1, 16, isTrance);
        }
        else if (GUILayout.Button("Skill2", new GUILayoutOption[0]))
        {
            HonoluluBattleMain.playCommand(FF9StateSystem.Battle.selectCharPosID, 2, 16, isTrance);
        }
        else if (GUILayout.Button("Item", new GUILayoutOption[0]))
        {
            HonoluluBattleMain.playCommand(FF9StateSystem.Battle.selectCharPosID, 3, 16, isTrance);
        }
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal("Box", new GUILayoutOption[0]);
        GUILayout.Label("PlayerCount:" + FF9StateSystem.Battle.selectPlayerCount, new GUILayoutOption[0]);
        if (GUILayout.Button("<", new GUILayoutOption[0]))
        {
            FF9StateSystem.Battle.selectPlayerCount--;
            if (FF9StateSystem.Battle.selectPlayerCount <= 0)
            {
                FF9StateSystem.Battle.selectPlayerCount = 4;
                ff9play.FF9Play_SetParty(0, 0);
                ff9play.FF9Play_SetParty(1, 1);
                ff9play.FF9Play_SetParty(2, 2);
                ff9play.FF9Play_SetParty(3, 3);
            }
            else
            {
                ff9play.FF9Play_SetParty(FF9StateSystem.Battle.selectPlayerCount, -1);
            }
            SceneDirector.Replace("BattleMapDebug", SceneTransition.FadeOutToBlack_FadeIn, true);
        }
        if (GUILayout.Button(">", new GUILayoutOption[0]))
        {
            Int32 num = FF9StateSystem.Battle.selectPlayerCount++;
            if (FF9StateSystem.Battle.selectPlayerCount > 4)
            {
                FF9StateSystem.Battle.selectPlayerCount = 1;
                ff9play.FF9Play_SetParty(3, -1);
                ff9play.FF9Play_SetParty(2, -1);
                ff9play.FF9Play_SetParty(1, -1);
            }
            else
            {
                ff9play.FF9Play_SetParty(num, num);
            }
            SceneDirector.Replace("BattleMapDebug", SceneTransition.FadeOutToBlack_FadeIn, true);
        }
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal("Box", new GUILayoutOption[0]);
        GUILayout.Label("CharPosID:" + FF9StateSystem.Battle.selectCharPosID, new GUILayoutOption[0]);
        if (GUILayout.Button("<", new GUILayoutOption[0]))
        {
            FF9StateSystem.Battle.selectCharPosID--;
            if (FF9StateSystem.Battle.selectCharPosID < 0)
            {
                FF9StateSystem.Battle.selectCharPosID = FF9StateSystem.Battle.selectPlayerCount - 1;
            }
        }
        if (GUILayout.Button(">", new GUILayoutOption[0]))
        {
            FF9StateSystem.Battle.selectCharPosID++;
            if (FF9StateSystem.Battle.selectCharPosID >= FF9StateSystem.Battle.selectPlayerCount)
            {
                FF9StateSystem.Battle.selectCharPosID = 0;
            }
        }
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal("Box", new GUILayoutOption[0]);
        GUILayout.Label("CharModelID:" + FF9StateSystem.Common.FF9.party.member[FF9StateSystem.Battle.selectCharPosID].info.slot_no, new GUILayoutOption[0]);
        if (GUILayout.Button("<", new GUILayoutOption[0]))
        {
            Int32 num2 = BattleUI.currentDebugSerialCharacter[FF9StateSystem.Battle.selectCharPosID];
            do
            {
                if (num2 != 0)
                {
                    num2--;
                }
                else
                {
                    num2 = 11;
                }
            }while (Array.IndexOf <Int32>(BattleUI.currentDebugSerialCharacter, num2) != -1);
            ff9play.FF9Dbg_SetCharacter(num2, FF9StateSystem.Battle.selectCharPosID);
            BattleUI.currentDebugSerialCharacter[FF9StateSystem.Battle.selectCharPosID] = num2;
            SceneDirector.Replace("BattleMapDebug", SceneTransition.FadeOutToBlack_FadeIn, true);
        }
        if (GUILayout.Button(">", new GUILayoutOption[0]))
        {
            Int32 num3 = BattleUI.currentDebugSerialCharacter[FF9StateSystem.Battle.selectCharPosID];
            do
            {
                if (num3 < 12)
                {
                    num3++;
                }
                else
                {
                    num3 = 0;
                }
            }while (Array.IndexOf <Int32>(BattleUI.currentDebugSerialCharacter, num3) != -1);
            ff9play.FF9Dbg_SetCharacter(num3, FF9StateSystem.Battle.selectCharPosID);
            BattleUI.currentDebugSerialCharacter[FF9StateSystem.Battle.selectCharPosID] = num3;
            SceneDirector.Replace("BattleMapDebug", SceneTransition.FadeOutToBlack_FadeIn, true);
        }
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal("Box", new GUILayoutOption[0]);
        GUILayout.Label("WeaponID:" + this.battleMain.GetWeaponID(FF9StateSystem.Battle.selectCharPosID), new GUILayoutOption[0]);
        if (GUILayout.Button("<", new GUILayoutOption[0]))
        {
            HonoluluBattleMain.CurPlayerWeaponIndex[FF9StateSystem.Battle.selectCharPosID]--;
            ff9feqp.FF9FEqp_Equip((Byte)FF9StateSystem.Battle.selectCharPosID, ref HonoluluBattleMain.CurPlayerWeaponIndex[FF9StateSystem.Battle.selectCharPosID]);
            SceneDirector.Replace("BattleMapDebug", SceneTransition.FadeOutToBlack_FadeIn, true);
        }
        if (GUILayout.Button(">", new GUILayoutOption[0]))
        {
            HonoluluBattleMain.CurPlayerWeaponIndex[FF9StateSystem.Battle.selectCharPosID]++;
            ff9feqp.FF9FEqp_Equip((Byte)FF9StateSystem.Battle.selectCharPosID, ref HonoluluBattleMain.CurPlayerWeaponIndex[FF9StateSystem.Battle.selectCharPosID]);
            SceneDirector.Replace("BattleMapDebug", SceneTransition.FadeOutToBlack_FadeIn, true);
        }
        GUILayout.EndHorizontal();
        GUILayout.EndScrollView();
        GUILayout.EndVertical();
        GUILayout.EndArea();
    }