コード例 #1
0
    public static void InitSequencer()
    {
        SEQ_WORK_SET seq_WORK_SET = btlseq.seq_work_set;

        SEQ_WORK[] seqWork = seq_WORK_SET.SeqWork;
        for (Int32 i = 0; i < 4; i++)
        {
            seqWork[i]        = new SEQ_WORK();
            seqWork[i].CmdPtr = (CMD_DATA)null;
        }
    }
コード例 #2
0
    public static Int32 SeqExecRunCamera(SEQ_WORK pSeqWork, BTL_DATA pMe)
    {
        btlseq.BattleLog("SeqExecRunCamera");
        FF9StateBattleSystem ff9Battle    = FF9StateSystem.Battle.FF9Battle;
        SEQ_WORK_SET         seq_WORK_SET = ff9Battle.seq_work_set;

        if (btlseq.wSeqCode != 32)
        {
            if (pSeqWork.CmdPtr.aa.Info.DefaultCamera == false)
            {
                if (FF9StateSystem.Settings.cfg.camera == 1UL)
                {
                    goto IL_16C;
                }
                UInt32 num = pMe.stat.cur;
                for (BTL_DATA next = ff9Battle.btl_list.next; next != null; next = next.next)
                {
                    if ((next.btl_id & pSeqWork.CmdPtr.tar_id) != 0)
                    {
                        num |= next.stat.cur;
                    }
                }
                if ((num & 335544320u) != 0u)
                {
                    goto IL_16C;
                }
                if (Comn.random8() >= 128)
                {
                    goto IL_16C;
                }
            }
        }
        Int16[] array = new Int16[3];
        btlseq.SeqSubTargetAveragePos(pSeqWork.CmdPtr.tar_id, out array[0], out array[2]);
        array[1] = 0;
        seq_WORK_SET.CamTrgCPos = new Vector3((Single)array[0], (Single)array[1], (Single)array[2]);
        seq_WORK_SET.CamExe     = pMe;
        seq_WORK_SET.CamTrg     = btlseq.SeqSubGetTarget(pSeqWork.CmdPtr.tar_id);
        SFX.SetCameraTarget(seq_WORK_SET.CamTrgCPos, seq_WORK_SET.CamExe, seq_WORK_SET.CamTrg);
        ff9Battle.seq_work_set.CameraNo = btlseq.sequenceReader.ReadByte();
        SFX.SetEnemyCamera(pMe);
IL_16C:
        pSeqWork.CurPtr += 2;
        return(1);
    }
コード例 #3
0
ファイル: btl_cmd.cs プロジェクト: uzoko1/Memoria
    public static void SetEnemyCommandBySequence(ushort tar_id, uint cmd_no, uint sub_no)
    {
        FF9StateBattleSystem stateBattleSystem = FF9StateSystem.Battle.FF9Battle;
        BTL_DATA             btl = btl_scrp.GetBtlDataPtr(16);

        BTL_DATA[]   btlDataArray = stateBattleSystem.btl_data;
        SEQ_WORK_SET seqWorkSet   = stateBattleSystem.seq_work_set;
        int          num1         = Array.IndexOf(seqWorkSet.AnmOfsList.Distinct().ToArray(), seqWorkSet.AnmOfsList[sub_no]);

        for (int index = 0; index < btlDataArray.Length; ++index)
        {
            if (num1 == btlDataArray[index].typeNo)
            {
                btl = btlDataArray[index];
                break;
            }
        }
        if (btl == null)
        {
            return;
        }
        if ((stateBattleSystem.cmd_status & 1) != 0 || Status.checkCurStat(btl, 33689859U))
        {
            btl.sel_mode = 0;
        }
        else
        {
            CMD_DATA cmd;
            if ((int)cmd_no == 47)
            {
                if (stateBattleSystem.btl_phase != 4)
                {
                    btl.sel_mode = 0;
                    return;
                }
                cmd = btl.cmd[0];
                if (Status.checkCurStat(btl, 1024U))
                {
                    tar_id = btl_util.GetRandomBtlID((uint)(Comn.random8() & 1));
                    sub_no = btl_util.getEnemyTypePtr(btl).p_atk_no;
                }
                else if (Status.checkCurStat(btl, 2048U))
                {
                    tar_id = btl_util.GetRandomBtlID(1U);
                    sub_no = btl_util.getEnemyTypePtr(btl).p_atk_no;
                }
            }
            else if ((int)cmd_no == 53)
            {
                cmd = btl.cmd[1];
            }
            else if ((int)cmd_no == 54)
            {
                cmd = btl.cmd[1];
            }
            else
            {
                btl.sel_mode = 0;
                return;
            }
            cmd.aa             = stateBattleSystem.enemy_attack[sub_no];
            cmd.aa.Ref.prog_no = 26;
            cmd.tar_id         = tar_id;
            cmd.cmd_no         = (byte)cmd_no;
            cmd.sub_no         = (byte)sub_no;
            cmd.info.cursor    = cmd.aa.Info.cursor < 6 || cmd.aa.Info.cursor >= 13 ? (byte)0 : (byte)1;
            if (cmd_no > 48U)
            {
                cmd.info.priority = 1;
            }
            else
            {
                /*int num2 = (int)*/
                btl_stat.RemoveStatus(cmd.regist, 32768U);
            }
            cmd.info.cover  = 0;
            cmd.info.dodge  = 0;
            cmd.info.reflec = 0;
            btl.bi.cmd_idle = 1;
            EnqueueCommand(cmd);
        }
    }