public static Int32 SeqExecShadow(SEQ_WORK pSeqWork, BTL_DATA pMe) { btlseq.BattleLog("SeqExecShadow"); pMe.bi.shadow = btlseq.sequenceReader.ReadByte(); if (pMe.bi.shadow != 0) { pMe.getShadow().SetActive(true); } else { pMe.getShadow().SetActive(false); } pSeqWork.CurPtr += 2; return(1); }
public static void SetEnemyFadeToPacket(BTL_DATA btl, Int32 rate) { BBGINFO bbginfo = battlebg.nf_GetBbgInfoPtr(); btl_util.GeoSetABR(btl.gameObject, "GEO_POLYFLAGS_TRANS_100_PLUS_25"); btl_util.GeoSetColor2DrawPacket(btl.gameObject, (Byte)((Int32)bbginfo.chr_r * rate >> 5), (Byte)((Int32)bbginfo.chr_g * rate >> 5), (Byte)((Int32)bbginfo.chr_b * rate >> 5), Byte.MaxValue); if (btl.bi.shadow != 0) { btl_util.GeoSetABR(btl.getShadow(), "GEO_POLYFLAGS_TRANS_100_PLUS_25"); btl_util.GeoSetColor2DrawPacket(btl.getShadow(), (Byte)((Int32)bbginfo.chr_r * rate >> 5), (Byte)((Int32)bbginfo.chr_g * rate >> 5), (Byte)((Int32)bbginfo.chr_b * rate >> 5), Byte.MaxValue); } if (rate == 0) { btl.SetDisappear(1); } }
public static void OrganizeEnemyData(FF9StateBattleSystem btlsys) { for (Int32 i = 0; i < BTL_SCENE.GetMonCount(); i++) { ENEMY_TYPE et = btlsys.enemy[i].et; BTL_DATA btl_DATA = btlsys.btl_data[4 + i]; btl_DATA.level = et.level; btl_DATA.max.at = (Int16)((60 - btl_DATA.elem.dex) * 40 << 2); btl_para.InitATB(btl_DATA); btl_DATA.cur.at = (Int16)(Comn.random16() % (Int32)btl_DATA.max.at); btl_DATA.weapon = (ItemAttack)null; btl_stat.InitCountDownStatus(btl_DATA); btl_mot.HideMesh(btl_DATA, btl_DATA.mesh_current, false); if (btl_DATA.bi.slave != 0) { btl_DATA.cur.at = 0; btl_DATA.cur.at_coef = 0; btl_DATA.gameObject.transform.localRotation = btl_DATA.rot; btl_DATA.gameObject.transform.localPosition = btl_DATA.evt.posBattle; btl_DATA.currentAnimationName = btl_DATA.mot[(Int32)btl_DATA.bi.def_idle]; btl_mot.setMotion(btl_DATA, btl_DATA.currentAnimationName); btl_mot.setSlavePos(btl_DATA, ref btl_DATA.base_pos); UnityEngine.Object.Destroy(btl_DATA.gameObject); UnityEngine.Object.Destroy(btl_DATA.getShadow()); btl_DATA.gameObject = btl_util.GetMasterEnemyBtlPtr().Data.gameObject; } else { btl_DATA.base_pos[0] = btl_DATA.evt.posBattle[0]; btl_DATA.base_pos[1] = btl_DATA.evt.posBattle[1]; btl_DATA.base_pos[2] = btl_DATA.evt.posBattle[2]; btl_DATA.currentAnimationName = btl_DATA.mot[(Int32)btl_DATA.bi.def_idle]; btl_DATA.evt.animFrame = (Byte)(Comn.random8() % (Int32)GeoAnim.geoAnimGetNumFrames(btl_DATA)); } } }
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; } }