Beispiel #1
0
    public static Int32 SeqExecMessage(SEQ_WORK pSeqWork, BTL_DATA pMe)
    {
        btlseq.BattleLog("SeqExecMessage");
        UInt16 num = (UInt16)btlseq.sequenceReader.ReadByte();

        if ((num & 128) != 0)
        {
            btlseq.BattleLog("wOfs " + pSeqWork.CmdPtr.aa.Name);
            UIManager.Battle.SetBattleTitle(pSeqWork.CmdPtr.aa.Name, 1);
        }
        else
        {
            num = (UInt16)(num + (UInt16)FF9StateSystem.Battle.FF9Battle.enemy[(Int32)pMe.bi.slot_no].et.mes);
            btlseq.BattleLog("wMsg " + num);
            if (btlseq.wSeqCode == 33)
            {
                String str = FF9TextTool.BattleText((Int32)num);
                UIManager.Battle.SetBattleTitle(str, 3);
            }
            else
            {
                String str2 = FF9TextTool.BattleText((Int32)num);
                UIManager.Battle.SetBattleMessage(str2, 3);
            }
        }
        pSeqWork.CurPtr += 2;
        return(1);
    }
Beispiel #2
0
    public static void SetupBattleEnemy()
    {
        SB2_PATTERN[] patAddr   = FF9StateSystem.Battle.FF9Battle.btl_scene.PatAddr;
        SB2_HEAD      header    = FF9StateSystem.Battle.FF9Battle.btl_scene.header;
        BTL_SCENE     btl_scene = FF9StateSystem.Battle.FF9Battle.btl_scene;

        if (FF9StateSystem.Battle.isDebug)
        {
            btl_scene.Info.StartType = FF9StateSystem.Battle.debugStartType;
        }
        else
        {
            btl_scene.Info.StartType = btl_sys.StartType(btl_scene.Info);
        }
        SB2_MON_PARM[] monAddr = FF9StateSystem.Battle.FF9Battle.btl_scene.MonAddr;
        AA_DATA[]      atk     = FF9StateSystem.Battle.FF9Battle.btl_scene.atk;
        Int16          num     = (Int16)(header.TypCount + header.AtkCount);
        UInt16         num2    = 0;

        SB2_MON_PARM[] array      = monAddr;
        ENEMY_TYPE[]   enemy_type = FF9StateSystem.Battle.FF9Battle.enemy_type;
        Int16          num3;

        for (num3 = 0; num3 < (Int16)header.TypCount; num3 = (Int16)(num3 + 1))
        {
            btl_init.SetMonsterParameter(array[(Int32)num3], ref enemy_type[(Int32)num3]);
            enemy_type[(Int32)num3].name = FF9TextTool.BattleText((Int32)num2);
            enemy_type[(Int32)num3].mes  = (Byte)num;
            num  = (Int16)(num + (Int16)array[(Int32)num3].MesCnt);
            num2 = (UInt16)(num2 + 1);
        }
        AA_DATA[] array2       = atk;
        AA_DATA[] enemy_attack = FF9StateSystem.Battle.FF9Battle.enemy_attack;
        for (num3 = 0; num3 < (Int16)header.AtkCount; num3 = (Int16)(num3 + 1))
        {
            btl_init.SetAttackData(ref array2[(Int32)num3], ref enemy_attack[(Int32)num3]);
            enemy_attack[(Int32)num3].Name = FF9TextTool.BattleText((Int32)num2);
            num2 = (UInt16)(num2 + 1);
        }
        BTL_DATA    next        = FF9StateSystem.Battle.FF9Battle.btl_list.next;
        SB2_PATTERN sb2_PATTERN = patAddr[(Int32)FF9StateSystem.Battle.FF9Battle.btl_scene.PatNum];

        num3 = 0;
        while (num3 < (Int16)sb2_PATTERN.MonCount && next != null)
        {
            btl_init.PutMonster(sb2_PATTERN.Put[(Int32)num3], next, btl_scene, num3);
            btl_init.SetMonsterData(monAddr[(Int32)sb2_PATTERN.Put[(Int32)num3].TypeNo], next, num3);
            num3 = (Int16)(num3 + 1);
            next = next.next;
        }
    }
Beispiel #3
0
    public Dialog AttachDialog(Int32 dialogId, Dialog.WindowStyle style, Int32 textId, PosObj po, Dialog.DialogIntDelegate listener, Dialog.CaptionType captionType)
    {
        Dialog dialogFromPool = this.GetDialogFromPool();

        if (dialogFromPool != null)
        {
            dialogFromPool.Reset();
            dialogFromPool.Id      = dialogId;
            dialogFromPool.Style   = style;
            dialogFromPool.Po      = po;
            dialogFromPool.TextId  = textId;
            dialogFromPool.Caption = FF9TextTool.GetDialogCaptionText(captionType);
            dialogFromPool.CapType = captionType;
            if (PersistenSingleton <UIManager> .Instance.UnityScene == UIManager.Scene.Battle)
            {
                if (FF9TextTool.IsBattleTextLoaded)
                {
                    dialogFromPool.Phrase = FF9TextTool.BattleText(textId);
                }
                else
                {
                    dialogFromPool.Phrase = String.Empty;
                    dialogFromPool.Style  = Dialog.WindowStyle.WindowStyleTransparent;
                }
            }
            else if (PersistenSingleton <UIManager> .Instance.UnityScene == UIManager.Scene.Field || PersistenSingleton <UIManager> .Instance.UnityScene == UIManager.Scene.World)
            {
                dialogFromPool.Phrase = FF9TextTool.FieldText(textId);

                // Subscribe
                Action onFieldTextUpdated = () =>
                {
                    dialogFromPool.Phrase = FF9TextTool.FieldText(textId);
                    dialogFromPool.Show();
                };
                FF9TextTool.FieldTextUpdated += onFieldTextUpdated;

                // Unsubscribe
                Dialog.DialogIntDelegate unsubscribe = (c) => FF9TextTool.FieldTextUpdated -= onFieldTextUpdated;
                listener = (Dialog.DialogIntDelegate)Delegate.Combine(unsubscribe, listener);
            }
            dialogFromPool.Show();
            dialogFromPool.AfterDialogHidden = listener;
            if (!this.isActivate)
            {
                this.ActivateDialogScene();
            }
        }
        return(dialogFromPool);
    }