Beispiel #1
0
    public void InitBattleScene()
    {
        FF9StateGlobal FF9 = FF9StateSystem.Common.FF9;

        FF9.charArray.Clear();
        this.btlScene = FF9StateSystem.Battle.FF9Battle.btl_scene = new BTL_SCENE();
        Debug.Log("battleID = " + FF9StateSystem.Battle.battleMapIndex);
        Dictionary <String, Int32> source = FF9BattleDB.SceneData;

        battleSceneName = source.FirstOrDefault(p => p.Value == FF9StateSystem.Battle.battleMapIndex).Key;
        battleSceneName = battleSceneName.Substring(4);
        Debug.Log("battleSceneName = " + battleSceneName);
        this.btlScene.ReadBattleScene(battleSceneName);
        this.StartCoroutine(PersistenSingleton <FF9TextTool> .Instance.UpdateBattleText(FF9BattleDB.SceneData["BSC_" + battleSceneName]));
        WMProfiler.Begin("Start Load Text");
        String battleModelPath = FF9BattleDB.MapModel["BSC_" + battleSceneName];

        FF9StateSystem.Battle.FF9Battle.map.btlBGPtr     = ModelFactory.CreateModel("BattleMap/BattleModel/battleMap_all/" + battleModelPath + "/" + battleModelPath, Vector3.zero, Vector3.zero, true);
        FF9StateSystem.Battle.FF9Battle.btl_scene.PatNum = FF9StateSystem.Battle.isDebug ? FF9StateSystem.Battle.patternIndex : (Byte)this.ChoicePattern();
        this.btlSeq = new btlseq();
        this.btlSeq.ReadBattleSequence(battleSceneName);
        BeginInitialize();
        battle.InitBattle();
        EndInitialize();
        if (!FF9StateSystem.Battle.isDebug)
        {
            String            ebFileName        = "EVT_BATTLE_" + battleSceneName;
            FF9StateBattleMap ff9StateBattleMap = FF9StateSystem.Battle.FF9Battle.map;
            ff9StateBattleMap.evtPtr = EventEngineUtils.loadEventData(ebFileName, "Battle/");
            PersistenSingleton <EventEngine> .Instance.StartEvents(ff9StateBattleMap.evtPtr);

            PersistenSingleton <EventEngine> .Instance.eTb.InitMessage();
        }
        this.CreateBattleData(FF9);
        if (battleSceneName == "EF_E006" || battleSceneName == "EF_E007")
        {
            BTL_DATA btlData1 = FF9StateSystem.Battle.FF9Battle.btl_data[4];
            BTL_DATA btlData2 = FF9StateSystem.Battle.FF9Battle.btl_data[5];
            this.GeoBattleAttach(btlData2.gameObject, btlData1.gameObject, 55);
            btlData2.attachOffset = 100;
        }
        FF9StateBattleSystem stateBattleSystem = FF9StateSystem.Battle.FF9Battle;
        GEOTEXHEADER         geotexheader      = new GEOTEXHEADER();

        geotexheader.ReadBGTextureAnim(battleModelPath);
        stateBattleSystem.map.btlBGTexAnimPtr = geotexheader;
        BBGINFO bbginfo = new BBGINFO();

        bbginfo.ReadBattleInfo(battleModelPath);
        FF9StateSystem.Battle.FF9Battle.map.btlBGInfoPtr = bbginfo;
        btlshadow.ff9battleShadowInit(13);
        battle.InitBattleMap();
        this.seqList = new List <Int32>();
        SB2_PATTERN sb2Pattern = this.btlScene.PatAddr[FF9StateSystem.Battle.FF9Battle.btl_scene.PatNum];

        Int32[] numArray = new Int32[sb2Pattern.MonCount];
        for (Int32 index = 0; index < (Int32)sb2Pattern.MonCount; ++index)
        {
            numArray[index] = sb2Pattern.Put[index].TypeNo;
        }
        foreach (Int32 num in numArray.Distinct().ToArray())
        {
            for (Int32 index1 = 0; index1 < this.btlSeq.sequenceProperty.Length; ++index1)
            {
                SequenceProperty sequenceProperty = this.btlSeq.sequenceProperty[index1];
                if (sequenceProperty.Montype == num)
                {
                    for (Int32 index2 = 0; index2 < sequenceProperty.PlayableSequence.Count; ++index2)
                    {
                        this.seqList.Add(sequenceProperty.PlayableSequence[index2]);
                    }
                }
            }
        }
        this.btlIDList          = FF9StateSystem.Battle.FF9Battle.seq_work_set.AnmOfsList.Distinct().ToArray();
        this.battleState        = BattleState.PlayerTurn;
        playerEnterCommand      = false;
        this.playerCastingSkill = false;
        this.enemyEnterCommand  = false;
    }