Exemple #1
0
 private void SFXPlay(UInt16 flag, Int32 exe, Int32 trg)
 {
     Byte[]            monbone = new Byte[2];
     PSX_LIBGTE.VECTOR trgcpos = default(PSX_LIBGTE.VECTOR);
     trgcpos.vx = (trgcpos.vy = (trgcpos.vz = 0));
     SFX.Begin(flag, 0, monbone, trgcpos);
     SFX.SetExe(FF9StateSystem.Battle.FF9Battle.btl_data[exe]);
     SFX.SetTrg(FF9StateSystem.Battle.FF9Battle.btl_data[trg]);
     SFX.Play(this.effNum);
     if (exe == 4)
     {
         SFX.SetTaskMonsteraStart();
     }
 }
Exemple #2
0
    private void OnUiSpecialEffectBottom0()
    {
        GUILayout.BeginHorizontal("box", new GUILayoutOption[0]);
        if (GUILayout.Button("<", new GUILayoutOption[0]))
        {
            this.effNum--;
            if (this.effNum < 0)
            {
                this.effNum = 510;
            }
            this.strEffNum = this.effNum.ToString();
        }
        String text = this.strEffNum;

        this.strEffNum = GUILayout.TextField(text, new GUILayoutOption[0]);
        if (this.strEffNum != text)
        {
            Int32 num = 0;
            if (Int32.TryParse(this.strEffNum, out num))
            {
                if (num >= 0 && num < 511)
                {
                    this.effNum    = num;
                    this.strEffNum = this.effNum.ToString();
                }
            }
            else if (this.strEffNum.Length == 0)
            {
                this.effNum = 0;
            }
        }
        if (GUILayout.Button(">", new GUILayoutOption[0]))
        {
            this.effNum++;
            if (this.effNum >= 511)
            {
                this.effNum = 0;
            }
            this.strEffNum = this.effNum.ToString();
        }
        Boolean enabled = true;

        GUI.enabled = enabled;
        if (GUILayout.Button(" P2E ", new GUILayoutOption[0]))
        {
            this.SFXPlay(8, FF9StateSystem.Battle.selectCharPosID, 4);
        }
        if (GUILayout.Button(" E2P ", new GUILayoutOption[0]))
        {
            this.SFXPlay(1, 4, 0);
        }
        if (GUILayout.Button("P(Me)", new GUILayoutOption[0]))
        {
            this.SFXPlay(8, FF9StateSystem.Battle.selectCharPosID, FF9StateSystem.Battle.selectCharPosID);
        }
        if (GUILayout.Button("E(Me)", new GUILayoutOption[0]))
        {
            this.SFXPlay(1, 4, 4);
        }
        if (GUILayout.Button("Summon", new GUILayoutOption[0]))
        {
            Byte[]            monbone = new Byte[2];
            PSX_LIBGTE.VECTOR trgcpos = default(PSX_LIBGTE.VECTOR);
            trgcpos.vx = (trgcpos.vy = (trgcpos.vz = 0));
            SFX.Begin(4, 0, monbone, trgcpos);
            SFX.SetExe(FF9StateSystem.Battle.FF9Battle.btl_data[0]);
            SFX.SetTrg(FF9StateSystem.Battle.FF9Battle.btl_data, 4);
            SFX.Play(this.effNum);
        }
        if (GUILayout.Button(" Item ", new GUILayoutOption[0]))
        {
            this.SFXPlay(2, FF9StateSystem.Battle.selectCharPosID, 1);
        }
        if (GUILayout.Button("Sword", new GUILayoutOption[0]))
        {
            Byte[]            monbone2 = new Byte[2];
            PSX_LIBGTE.VECTOR trgcpos2 = default(PSX_LIBGTE.VECTOR);
            trgcpos2.vx = (trgcpos2.vy = (trgcpos2.vz = 0));
            SFX.Begin(4, 0, monbone2, trgcpos2);
            SFX.SetExe(FF9StateSystem.Battle.FF9Battle.btl_data[3]);
            SFX.SetMExe(FF9StateSystem.Battle.FF9Battle.btl_data[1]);
            SFX.SetTrg(FF9StateSystem.Battle.FF9Battle.btl_data[4]);
            SFX.Play(this.effNum);
        }
        if (GUILayout.Button(" Ref ", new GUILayoutOption[0]))
        {
            Byte[]            monbone3 = new Byte[2];
            PSX_LIBGTE.VECTOR trgcpos3 = default(PSX_LIBGTE.VECTOR);
            trgcpos3.vx = (trgcpos3.vy = (trgcpos3.vz = 0));
            SFX.Begin(16, 0, monbone3, trgcpos3);
            SFX.SetExe(FF9StateSystem.Battle.FF9Battle.btl_data[4]);
            SFX.SetTrg(FF9StateSystem.Battle.FF9Battle.btl_data[4]);
            SFX.SetRTrgTest(FF9StateSystem.Battle.FF9Battle.btl_data[2]);
            SFX.Play(this.effNum);
        }
        if (GUILayout.Button("Auto " + ((!SFX.isDebugAutoPlay) ? "Off" : "On"), new GUILayoutOption[0]))
        {
            SFX.isDebugAutoPlay = !SFX.isDebugAutoPlay;
        }
        if (SFX.isDebugAutoPlay && !SFX.isRunning)
        {
            this.effNum = BattleUI.repTable[this.repIndex];
            this.repIndex++;
            if (this.repIndex > (Int32)BattleUI.repTable.Length)
            {
                this.repIndex = 0;
            }
            this.strEffNum = this.effNum.ToString();
            this.SFXPlay(8, FF9StateSystem.Battle.selectCharPosID, 4);
        }
        GUI.enabled = true;
        GUILayout.EndHorizontal();
    }
Exemple #3
0
    public static void SetBattleVfx(CMD_DATA cmd, UInt32 fx_no, Int16[] arg)
    {
        BTL_VFX_REQ fx_req = FF9StateSystem.Battle.FF9Battle.fx_req;

        PSX_LIBGTE.VECTOR vector = default(PSX_LIBGTE.VECTOR);
        vector.vx = 0;
        vector.vy = 0;
        vector.vz = 0;
        UInt16 num = 0;

        fx_req.exe = cmd.regist;
        if (arg != null)
        {
            fx_req.monbone[0] = (Byte)arg[0];
            fx_req.monbone[1] = (Byte)arg[1];
            fx_req.arg0       = (Int16)((Byte)arg[2]);
            fx_req.flgs       = (UInt16)((Byte)arg[3]);
        }
        else
        {
            fx_req.monbone[0] = (fx_req.monbone[1] = 0);
            fx_req.flgs       = 0;
            fx_req.arg0       = 0;
        }
        fx_req.trgno        = (fx_req.rtrgno = 0);
        cmd.regist.fig      = (cmd.regist.m_fig = 0);
        cmd.regist.fig_info = 0;
        if (cmd.info.reflec == 0)
        {
            num = btl_cmd.CheckReflec(cmd);
            if (cmd.cmd_no == BattleCommandId.Item || cmd.cmd_no == BattleCommandId.AutoPotion)
            {
                fx_req.flgs = 2;
            }
            else if (cmd.cmd_no == BattleCommandId.MagicSword)
            {
                fx_req.flgs = 4;
            }
            else if (cmd.cmd_no == BattleCommandId.SysPhantom || cmd.cmd_no == BattleCommandId.SysLastPhoenix)
            {
                fx_req.flgs = 1;
            }
        }
        else if (cmd.info.reflec == 2)
        {
            cmd.info.reflec = 1;
            if (cmd.regist.bi.player == 0)
            {
                cmd.info.mon_reflec = 1;
            }
            fx_req.flgs = 17;
        }
        for (BTL_DATA next = FF9StateSystem.Battle.FF9Battle.btl_list.next; next != null; next = next.next)
        {
            if ((next.btl_id & cmd.tar_id) != 0)
            {
                BTL_DATA[]  trg         = fx_req.trg;
                BTL_VFX_REQ btl_VFX_REQ = fx_req;
                SByte       b;
                btl_VFX_REQ.trgno     = (SByte)((b = btl_VFX_REQ.trgno) + 1);
                trg[(Int32)((Byte)b)] = next;
                next.fig      = (next.m_fig = 0);
                next.fig_info = 0;
                vector.vx    += (Int32)next.base_pos[0];
                vector.vz    += (Int32)next.base_pos[2];
            }
            if ((next.btl_id & num) != 0)
            {
                BTL_DATA[]  rtrg         = fx_req.rtrg;
                BTL_VFX_REQ btl_VFX_REQ2 = fx_req;
                SByte       b;
                btl_VFX_REQ2.rtrgno    = (SByte)((b = btl_VFX_REQ2.rtrgno) + 1);
                rtrg[(Int32)((Byte)b)] = next;
            }
            if (cmd.cmd_no == BattleCommandId.MagicSword && btl_util.getSerialNumber(next) == 2)
            {
                fx_req.mexe = next;
            }
        }
        fx_req.trgcpos.vx = vector.vx / (Int32)fx_req.trgno;
        fx_req.trgcpos.vy = 0;
        fx_req.trgcpos.vz = vector.vz / (Int32)fx_req.trgno;
        ENEMY_TYPE[] enemy_type = FF9StateSystem.Battle.FF9Battle.enemy_type;
        SFX.Begin(fx_req.flgs, fx_req.arg0, fx_req.monbone, fx_req.trgcpos);
        SFX.SetExe(fx_req.exe);
        SFX.SetMExe(fx_req.mexe);
        SFX.SetTrg(fx_req.trg, fx_req.trgno);
        SFX.SetRTrg(fx_req.rtrg, fx_req.rtrgno);
        SFX.Play((Int32)fx_no);
    }