Esempio n. 1
0
    public static void DispCharacter(BTL_DATA btl)
    {
        PosObj evt = btl.evt;

        if (btl.bi.slave == 0)
        {
            if (btl.bi.player != 0 && btl_mot.checkMotion(btl, 17))
            {
                Vector3 eulerAngles = btl.rot.eulerAngles;
                eulerAngles.y = 180f;
                btl.gameObject.transform.localRotation = Quaternion.Euler(eulerAngles);
            }
            else
            {
                btl.gameObject.transform.localRotation = btl.rot;
            }
            if ((!(HonoluluBattleMain.battleSceneName == "EF_E006") && !(HonoluluBattleMain.battleSceneName == "EF_E007")) || btl != FF9StateSystem.Battle.FF9Battle.btl_data[5])
            {
                btl.gameObject.transform.localPosition = btl.pos;
            }
            btl_mot.PlayAnim(btl);
            if ((UInt16)evt.animFrame >= GeoAnim.geoAnimGetNumFrames(btl))
            {
                if (!btl_mot.SetDefaultIdle(btl))
                {
                    btl.evt.animFrame = 0;
                }
                else if (Status.checkCurStat(btl, 33558531u))
                {
                    PosObj evt2 = btl.evt;
                    evt2.animFrame = (Byte)(evt2.animFrame - 1);
                }
            }
            if (!Status.checkCurStat(btl, 33558531u) && btl.bi.stop_anim == 0)
            {
                if (btl.animation != (UnityEngine.Object)null)
                {
                    btl.animation.enabled = true;
                }
                PosObj posObj = evt;
                posObj.animFrame = (Byte)(posObj.animFrame + 1);
            }
            else if (btl.animation != (UnityEngine.Object)null)
            {
                btl.animation.enabled = false;
            }
            Int32 num  = btl.meshCount;
            Int32 num2 = 0;
            Int32 num3 = 0;
            btl.flags = (UInt16)(btl.flags & (UInt16)(~geo.GEO_FLAGS_RENDER));
            for (Int32 i = 0; i < num; i++)
            {
                if (geo.geoMeshChkFlags(btl, i) == 0)
                {
                    btl.flags = (UInt16)(btl.flags | geo.GEO_FLAGS_RENDER);
                    btl.SetIsEnabledMeshRenderer(i, true);
                    num3++;
                }
                else
                {
                    btl.SetIsEnabledMeshRenderer(i, false);
                    num2++;
                }
            }
            if (num2 == num)
            {
                btl.SetIsEnabledBattleModelRenderer(false);
                if ((btl.bi.slot_no == 2 && btl.bi.player != 0) || (btl.bi.player == 0 && btl.dms_geo_id == 671))
                {
                    Renderer[] componentsInChildren = btl.gameObject.transform.GetChildByName("long_hair").GetComponentsInChildren <Renderer>();
                    Renderer[] array = componentsInChildren;
                    for (Int32 j = 0; j < (Int32)array.Length; j++)
                    {
                        Renderer renderer = array[j];
                        renderer.enabled = false;
                    }
                    Renderer[] componentsInChildren2 = btl.gameObject.transform.GetChildByName("short_hair").GetComponentsInChildren <Renderer>();
                    Renderer[] array2 = componentsInChildren2;
                    for (Int32 k = 0; k < (Int32)array2.Length; k++)
                    {
                        Renderer renderer2 = array2[k];
                        renderer2.enabled = false;
                    }
                }
            }
            if (num3 == num)
            {
                btl.SetIsEnabledBattleModelRenderer(true);
                if ((btl.bi.slot_no == 2 && btl.bi.player != 0) || (btl.bi.player == 0 && btl.dms_geo_id == 671))
                {
                    Byte serialNumber = btl_util.getSerialNumber(btl);
                    if (Configuration.Graphics.GarnetHair != 2 && (serialNumber == 4 || serialNumber == 3 || Configuration.Graphics.GarnetHair == 1))
                    {
                        Renderer[] componentsInChildren3 = btl.gameObject.transform.GetChildByName("long_hair").GetComponentsInChildren <Renderer>();
                        Renderer[] array3 = componentsInChildren3;
                        for (Int32 l = 0; l < (Int32)array3.Length; l++)
                        {
                            Renderer renderer3 = array3[l];
                            renderer3.enabled = true;
                        }
                    }
                    else
                    {
                        Renderer[] componentsInChildren4 = btl.gameObject.transform.GetChildByName("short_hair").GetComponentsInChildren <Renderer>();
                        Renderer[] array4 = componentsInChildren4;
                        for (Int32 m = 0; m < (Int32)array4.Length; m++)
                        {
                            Renderer renderer4 = array4[m];
                            renderer4.enabled = true;
                        }
                    }
                }
                else if (btl.bi.slot_no == 0 && btl.bi.player != 0)
                {
                    Byte serialNumber2 = btl_util.getSerialNumber(btl);
                    if (serialNumber2 == 1)
                    {
                        btl.SetIsEnabledBattleModelRenderer(false);
                    }
                }
            }
            if (!Status.checkCurStat(btl, 1073741824u))
            {
                GeoTexAnim.geoTexAnimService(btl.texanimptr);
                GeoTexAnim.geoTexAnimService(btl.tranceTexanimptr);
            }
            if (btl.weapon_geo != (UnityEngine.Object)null)
            {
                num             = btl.weaponMeshCount;
                btl.weaponFlags = (UInt16)(btl.weaponFlags & (UInt16)(~geo.GEO_FLAGS_RENDER));
                for (Int32 n = 0; n < num; n++)
                {
                    if (geo.geoWeaponMeshChkFlags(btl, n) == 0)
                    {
                        btl.weaponFlags = (UInt16)(btl.weaponFlags | geo.GEO_FLAGS_RENDER);
                        btl.weaponRenderer[n].enabled = true;
                    }
                    else
                    {
                        btl.weaponRenderer[n].enabled = false;
                    }
                }
            }
            return;
        }
        BattleUnit masterEnemyBtlPtr = btl_util.GetMasterEnemyBtlPtr();

        if (masterEnemyBtlPtr == null)
        {
            return;
        }
        btl.rot = masterEnemyBtlPtr.Data.rot;
        btl_mot.setSlavePos(btl, ref btl.base_pos);
        btl_mot.setBasePos(btl);
    }
Esempio n. 2
0
    public static void SetCharacterData(BTL_DATA btl, UInt32 id, UInt32 val)
    {
        FF9StateBattleSystem ff9Battle = FF9StateSystem.Battle.FF9Battle;

        switch (id)
        {
        case 32u:
            for (Int32 i = 0; i < btl.meshCount; i++)
            {
                btl.SetIsEnabledMeshRenderer(i, true);
            }
            btl.getShadow().SetActive(true);
            btl.SetIsEnabledWeaponRenderer(true);
            btl.SetIsEnabledBattleModelRenderer(true);
            btl_sys.AddCharacter(btl);
            break;

        case 33u:
            for (Int32 j = 0; j < btl.meshCount; j++)
            {
                btl.SetIsEnabledMeshRenderer(j, false);
            }
            btl.getShadow().SetActive(false);
            btl.SetIsEnabledWeaponRenderer(false);
            btl.SetIsEnabledBattleModelRenderer(false);
            btl_cmd.KillCommand2(btl);
            btl_sys.DelCharacter(btl);
            break;

        case 34u:
            if (btl_cmd.KillCommand2(btl))
            {
                btl.sel_mode = 0;
            }
            break;

        case 35u:
            btl.max.hp = (UInt16)val;
            break;

        case 36u:
            btl.cur.hp = (UInt16)val;
            break;

        case 37u:
            btl.max.mp = (Int16)val;
            break;

        case 38u:
            btl.cur.mp = (Int16)val;
            break;

        case 40u:
            btl.cur.at = (Int16)val;
            break;

        case 48u:
            btl.def_attr.invalid = (Byte)val;
            break;

        case 49u:
            btl.def_attr.absorb = (Byte)val;
            break;

        case 50u:
            btl.def_attr.half = (Byte)val;
            break;

        case 51u:
            btl.def_attr.weak = (Byte)val;
            break;

        case 52u:
            if (ff9Battle.btl_phase == 2)
            {
                btl.tar_mode  = 0;
                btl.bi.target = 0;
                btl.bi.atb    = 0;
                btl.bi.select = 0;
            }
            else
            {
                btl.tar_mode = (Byte)(2u + val);
            }
            break;

        case 53u:
            btl.SetDisappear((Byte)val);
            if (val == 0u || ff9Battle.btl_phase == 2)
            {
            }
            break;

        case 54u:
            btl.bi.shadow = (Byte)val;
            if (btl.bi.shadow != 0)
            {
                btl.getShadow().SetActive(true);
            }
            else
            {
                btl.getShadow().SetActive(false);
            }
            break;

        case 55u:
            geo.geoScaleSet(btl, (Int32)val);
            btlshadow.FF9ShadowSetScaleBattle(btl_util.GetFF9CharNo(btl), (Byte)(btl.shadow_x * val >> 12), (Byte)(btl.shadow_z * val >> 12));
            break;

        case 56u:
            geo.geoScaleReset(btl);
            btlshadow.FF9ShadowSetScaleBattle(btl_util.GetFF9CharNo(btl), btl.shadow_x, btl.shadow_z);
            break;

        case 59u:
            btl_mot.HideMesh(btl, (UInt16)val, false);
            btl.mesh_current = (UInt16)(btl.mesh_current | (UInt16)val);
            break;

        case 60u:
            btl_mot.ShowMesh(btl, (UInt16)val, false);
            btl.mesh_current = (UInt16)(btl.mesh_current & (UInt16)(~(UInt16)val));
            break;

        case 61u:
            GeoTexAnim.geoTexAnimPlay(btl.texanimptr, (Int32)val);
            break;

        case 62u:
            GeoTexAnim.geoTexAnimStop(btl.texanimptr, (Int32)val);
            break;

        case 63u:
            GeoTexAnim.geoTexAnimPlayOnce(btl.texanimptr, (Int32)val);
            break;

        case 69u:
            btl.bi.def_idle = (Byte)val;
            break;

        case 71u:
            btl_sys.SetBonus(btl_util.getEnemyTypePtr(btl));
            break;

        case 72u:
            btl.elem.str = (Byte)val;
            break;

        case 73u:
            btl.elem.mgc = (Byte)val;
            break;

        case 74u:
            btl.defence.PhisicalDefence = (Byte)val;
            break;

        case 75u:
            btl.defence.PhisicalEvade = (Byte)val;
            break;

        case 76u:
            btl.defence.MagicalDefence = (Byte)val;
            break;

        case 77u:
            btl.defence.MagicalEvade = (Byte)val;
            break;

        case 78u:
            btl.cur.at   = btl.max.at;
            btl.sel_mode = 1;
            btl_cmd.SetCommand(btl.cmd[0], BattleCommandId.SummonEiko, 187u, (UInt16)val, 8u);
            UIManager.Battle.FF9BMenu_EnableMenu(true);
            break;
        }
    }