Пример #1
0
    public static BTL2D_ENT GetFreeEntry(BTL_DATA pBtl)
    {
        FF9StateBattleSystem ff9Battle      = FF9StateSystem.Battle.FF9Battle;
        BTL2D_WORK           btl2d_work_set = ff9Battle.btl2d_work_set;
        Int16 num = (Int16)(btl2d_work_set.NewID - 1);

        if (num < 0)
        {
            num = 15;
        }
        btl2d_work_set.NewID = num;
        BTL2D_ENT btl2D_ENT = btl2d_work_set.Entry[num];

        btl2D_ENT.BtlPtr = pBtl;
        btl2D_ENT.Cnt    = 0;
        btl2D_ENT.Delay  = 0;
        btl2D_ENT.trans  = pBtl.gameObject.transform.GetChildByName("bone" + pBtl.tar_bone.ToString("D3"));
        Vector3   position   = btl2D_ENT.trans.position;
        BTL2D_ENT btl2D_ENT2 = btl2D_ENT;

        btl2D_ENT2.Yofs          = (SByte)(btl2D_ENT2.Yofs + 4);
        btl2D_ENT.trans.position = position;
        return(btl2D_ENT);
    }
Пример #2
0
    private static void Btl2dStatIcon()
    {
        FF9StateBattleSystem ff9Battle      = FF9StateSystem.Battle.FF9Battle;
        BTL2D_WORK           btl2d_work_set = ff9Battle.btl2d_work_set;
        Vector3 rot;

        rot.x = 0f;
        rot.z = 0f;
        for (BTL_DATA next = ff9Battle.btl_list.next; next != null; next = next.next)
        {
            if (next.bi.disappear == 0)
            {
                if ((next.flags & geo.GEO_FLAGS_CLIP) == 0)
                {
                    if ((btl2d_work_set.OldDisappear & next.btl_id) == 0)
                    {
                        BattleStatus num = next.stat.cur | next.stat.permanent;
                        if ((num & BattleStatus.Death) == 0u)
                        {
                            if ((num & STATUS_2D_ICON) != 0u)
                            {
                                if (next.bi.player == 0 || !btl_mot.checkMotion(next, 17))
                                {
                                    Int32   num2 = ff9.rsin(fixedPointAngle: (Int32)(next.rot.eulerAngles.y / 360f * 4096f));
                                    Int32   num3 = ff9.rcos(fixedPointAngle: (Int32)(next.rot.eulerAngles.y / 360f * 4096f));
                                    Int16   num4;
                                    Byte[]  array;
                                    SByte[] array2;
                                    SByte[] array3;
                                    if (next.bi.player != 0)
                                    {
                                        num4   = FF9StateSystem.Common.FF9.player[next.bi.slot_no].info.serial_no;
                                        array  = btl2d.wBonePC[num4];
                                        array2 = btl2d.wYofsPC[num4];
                                        array3 = btl2d.wZofsPC[num4];
                                    }
                                    else
                                    {
                                        ENEMY_TYPE et = ff9Battle.enemy[next.bi.slot_no].et;
                                        array  = et.icon_bone;
                                        array2 = et.icon_y;
                                        array3 = et.icon_z;
                                    }
                                    Int32 num5 = 0;
                                    num4 = 12;
                                    for (;;)
                                    {
                                        Int16 num6 = num4;
                                        num4 = (Int16)(num6 - 1);
                                        if (num6 == 0)
                                        {
                                            break;
                                        }
                                        btl2d.STAT_ICON_TBL stat_ICON_TBL = btl2d.wStatIconTbl[num5];
                                        if ((num & stat_ICON_TBL.Mask) != 0u)
                                        {
                                            if ((num & stat_ICON_TBL.Mask2) == 0u)
                                            {
                                                Int16 num7 = (Int16)(array2[stat_ICON_TBL.Pos] << 4);
                                                Int16 num8 = (Int16)(array3[stat_ICON_TBL.Pos] << 4);
                                                if ((next.flags & geo.GEO_FLAGS_SCALE) != 0)
                                                {
                                                    num7 = (Int16)((Int32)(num7 * next.gameObject.transform.localScale.y));
                                                    num8 = (Int16)((Int32)(num8 * next.gameObject.transform.localScale.z));
                                                }
                                                Vector3 position = next.gameObject.transform.GetChildByName("bone" + array[stat_ICON_TBL.Pos].ToString("D3")).position;
                                                Vector3 pos;
                                                pos.x = position.x + (num8 * num2 >> 12);
                                                pos.y = position.y - num7;
                                                pos.z = position.z + (num8 * num3 >> 12);
                                                if (stat_ICON_TBL.Type != 0)
                                                {
                                                    rot.y = 0f;
                                                    HonoluluBattleMain.battleSPS.UpdateBtlStatus(next, stat_ICON_TBL.Mask, pos, rot, btl2d_work_set.Timer);
                                                }
                                                else
                                                {
                                                    Int32 ang = stat_ICON_TBL.Ang;
                                                    if (ang != 0)
                                                    {
                                                        Int32 num9 = (Int32)(next.rot.eulerAngles.y / 360f * 4095f);
                                                        num9  = (num9 + 3072 & 4095);
                                                        rot.y = num9 / 4095f * 360f;
                                                    }
                                                    else
                                                    {
                                                        rot.y = 0f;
                                                    }
                                                    HonoluluBattleMain.battleSPS.UpdateBtlStatus(next, stat_ICON_TBL.Mask, pos, rot, btl2d_work_set.Timer);
                                                }
                                            }
                                        }
                                        num5++;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
Пример #3
0
    public static void Btl2dMain()
    {
        FF9StateBattleSystem ff9Battle      = FF9StateSystem.Battle.FF9Battle;
        BTL2D_WORK           btl2d_work_set = ff9Battle.btl2d_work_set;
        Int16 num = btl2d_work_set.NewID;

        for (Int16 num2 = 0; num2 < 16; num2 = (Int16)(num2 + 1))
        {
            BTL2D_ENT btl2D_ENT = btl2d_work_set.Entry[num];
            if (btl2D_ENT.BtlPtr != null)
            {
                if (btl2D_ENT.Type > 2)
                {
                    btl2D_ENT.BtlPtr = null;
                }
                else if (btl2D_ENT.Delay != 0)
                {
                    BTL2D_ENT btl2D_ENT2 = btl2D_ENT;
                    btl2D_ENT2.Delay = (Byte)(btl2D_ENT2.Delay - 1);
                }
                else
                {
                    String text = String.Empty;
                    HUDMessage.MessageStyle style = HUDMessage.MessageStyle.DAMAGE;
                    if (btl2D_ENT.Type == 0)
                    {
                        if (btl2D_ENT.Work.Num.Color == 0)
                        {
                            style = HUDMessage.MessageStyle.DAMAGE;
                        }
                        else
                        {
                            style = HUDMessage.MessageStyle.RESTORE_HP;
                        }
                        text = btl2D_ENT.Work.Num.Value.ToString();
                    }
                    else if (btl2D_ENT.Type == 1)
                    {
                        if (btl2D_ENT.Work.Num.Color == 0)
                        {
                            style = HUDMessage.MessageStyle.DAMAGE;
                        }
                        else
                        {
                            style = HUDMessage.MessageStyle.RESTORE_MP;
                        }
                        text = btl2D_ENT.Work.Num.Value.ToString() + " " + Localization.Get("MPCaption");
                    }
                    else if (btl2D_ENT.Type == 2)
                    {
                        if (btl2D_ENT.Work.Num.Value == 0u)
                        {
                            text  = Localization.Get("Miss");
                            style = HUDMessage.MessageStyle.MISS;
                        }
                        else if (btl2D_ENT.Work.Num.Value == 1u)
                        {
                            text  = Localization.Get("Death");
                            style = HUDMessage.MessageStyle.DEATH;
                        }
                        else if (btl2D_ENT.Work.Num.Value == 2u)
                        {
                            text  = Localization.Get("Guard");
                            style = HUDMessage.MessageStyle.GUARD;
                        }
                        else if (btl2D_ENT.Work.Num.Value == 3u)
                        {
                            text  = NGUIText.FF9YellowColor + Localization.Get("Critical") + "[-] \n " + text;
                            style = HUDMessage.MessageStyle.CRITICAL;
                        }
                    }
                    Singleton <HUDMessage> .Instance.Show(btl2D_ENT.trans, text, style, new Vector3(0f, btl2D_ENT.Yofs, 0f), 0);

                    UIManager.Battle.DisplayParty();
                    btl2D_ENT.BtlPtr = null;
                }
            }
            num = (Int16)(num + 1);
            if (num >= 16)
            {
                num = 0;
            }
        }
        btl2d.Btl2dStatCount();
        if (SFX.GetEffectJTexUsed() == 0)
        {
            btl2d.Btl2dStatIcon();
        }
        BTL2D_WORK btl2D_WORK = btl2d_work_set;

        btl2D_WORK.Timer = (UInt16)(btl2D_WORK.Timer + 1);
        Byte b = Byte.MaxValue;

        for (BTL_DATA next = ff9Battle.btl_list.next; next != null; next = next.next)
        {
            if (next.bi.disappear == 0)
            {
                b = (Byte)(b & (Byte)(~(Byte)next.btl_id));
            }
        }
        btl2d_work_set.OldDisappear = b;
    }