public static Int32 SeqExecMessage(SEQ_WORK pSeqWork, BTL_DATA pMe) { btlseq.BattleLog("SeqExecMessage"); UInt16 num = (UInt16)btlseq.sequenceReader.ReadByte(); if ((num & 128) != 0) { btlseq.BattleLog("wOfs " + pSeqWork.CmdPtr.aa.Name); UIManager.Battle.SetBattleTitle(pSeqWork.CmdPtr.aa.Name, 1); } else { num = (UInt16)(num + (UInt16)FF9StateSystem.Battle.FF9Battle.enemy[(Int32)pMe.bi.slot_no].et.mes); btlseq.BattleLog("wMsg " + num); if (btlseq.wSeqCode == 33) { String str = FF9TextTool.BattleText((Int32)num); UIManager.Battle.SetBattleTitle(str, 3); } else { String str2 = FF9TextTool.BattleText((Int32)num); UIManager.Battle.SetBattleMessage(str2, 3); } } pSeqWork.CurPtr += 2; return(1); }
public static Int32 SeqExecStartVfx(SEQ_WORK pSeqWork, BTL_DATA pMe) { btlseq.BattleLog("SeqExecStartVfx"); SFX.SetTaskMonsteraStart(); pSeqWork.CurPtr++; return(1); }
public static Int32 SeqExecTargetBone(SEQ_WORK pSeqWork, BTL_DATA pMe) { btlseq.BattleLog("SeqExecTargetBone"); pMe.tar_bone = btlseq.sequenceReader.ReadByte(); pSeqWork.CurPtr += 2; return(1); }
public static Int32 SeqExecFadeOut(SEQ_WORK pSeqWork, BTL_DATA pMe) { btlseq.BattleLog("SeqExecFadeOut"); pSeqWork.FadeTotal = (pSeqWork.FadeStep = btlseq.sequenceReader.ReadByte()); pSeqWork.CurPtr += 2; return(1); }
public static Int32 SeqExecSetCamera(SEQ_WORK pSeqWork, BTL_DATA pMe) { btlseq.BattleLog("SeqExecSetCamera"); btlseq.seq_work_set.CameraNo = btlseq.sequenceReader.ReadByte(); pSeqWork.CurPtr += 2; return(1); }
public static Int32 SeqExecTexAnimStop(SEQ_WORK pSeqWork, BTL_DATA pMe) { btlseq.BattleLog("SeqExecTexAnimStop"); GeoTexAnim.geoTexAnimStop(pMe.texanimptr, (Int32)btlseq.sequenceReader.ReadByte()); pSeqWork.CurPtr += 2; return(1); }
public static Int32 SeqExecDefaultIdle(SEQ_WORK pSeqWork, BTL_DATA pMe) { btlseq.BattleLog("SeqExecDefaultIdle"); pMe.bi.def_idle = btlseq.sequenceReader.ReadByte(); pSeqWork.CurPtr += 2; return(1); }
public static Int32 SeqExecSVfx(SEQ_WORK pSeqWork, BTL_DATA pMe) { btlseq.BattleLog("SeqExecSVfx"); pSeqWork.SVfxNum = btlseq.sequenceReader.ReadUInt16(); pSeqWork.SVfxParam = btlseq.sequenceReader.ReadByte(); pSeqWork.SVfxTime = (Byte)(btlseq.sequenceReader.ReadByte() + 1); pSeqWork.CurPtr += 5; return(1); }
public static Int32 SeqExecWait(SEQ_WORK pSeqWork, BTL_DATA pMe) { btlseq.BattleLog("SeqExecWait"); if (pSeqWork.DecCnt <= 0) { pSeqWork.CurPtr += 2; return(1); } return(0); }
public static Int32 SeqExecMoveToPoint(SEQ_WORK pSeqWork, BTL_DATA pMe) { btlseq.BattleLog("SeqExecMoveToPoint"); btlseq.SeqExecMoveToTarget(pSeqWork, pMe); for (Int16 num = 0; num < 3; num = (Int16)(num + 1)) { pMe.base_pos[(Int32)num] = pMe.pos[(Int32)num]; } return(0); }
public static Int32 SeqExecWaitLoadVfx(SEQ_WORK pSeqWork, BTL_DATA pMe) { btlseq.BattleLog("SeqExecWaitLoadVfx"); if (pSeqWork.Flags.DoneLoadVfx) { pSeqWork.CurPtr++; return(1); } return(0); }
public static Int32 SeqExecWaitVfx(SEQ_WORK pSeqWork, BTL_DATA pMe) { btlseq.BattleLog("SeqExecWaitVfx"); if (SFX.GetEffectOvRun() == 0) { pSeqWork.CurPtr++; return(1); } return(0); }
public static Int32 SeqExecMeshHide(SEQ_WORK pSeqWork, BTL_DATA pMe) { btlseq.BattleLog("SeqExecMeshHide"); UInt16 num = btlseq.sequenceReader.ReadUInt16(); pMe.meshflags |= (UInt32)num; pMe.mesh_current = (UInt16)(pMe.mesh_current | num); btl_mot.HideMesh(pMe, num, false); pSeqWork.CurPtr += 3; return(1); }
public static Int32 SeqExecWaitAnim(SEQ_WORK pSeqWork, BTL_DATA pMe) { btlseq.BattleLog("SeqExecWaitAnim"); if (pSeqWork.AnmCnt != 0 && ((UInt16)pMe.evt.animFrame >= GeoAnim.geoAnimGetNumFrames(pMe) || (pMe.stat.cur & 33558530u) != 0u)) { SFX.SetEffCamTrigger(); pSeqWork.CurPtr++; return(1); } return(0); }
public static Int32 SeqExecMeshShow(SEQ_WORK pSeqWork, BTL_DATA pMe) { btlseq.BattleLog("SeqExecMeshShow"); UInt16 num = btlseq.sequenceReader.ReadUInt16(); pMe.meshflags &= (UInt32)(~num); pMe.mesh_current = (UInt16)(pMe.mesh_current & (UInt16)(~num)); btl_mot.ShowMesh(pMe, num, false); pSeqWork.CurPtr += 3; return(1); }
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; } }
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 SeqInitMoveToTurn(SEQ_WORK pSeqWork, BTL_DATA pMe) { btlseq.BattleLog("SeqInitMoveToTurn"); WK_MOVE wk_MOVE = new WK_MOVE(); wk_MOVE.Next = 2; pSeqWork.IncCnt = 1; wk_MOVE.Frames = (Int16)btlseq.sequenceReader.ReadByte(); for (Int16 num = 0; num < 3; num = (Int16)(num + 1)) { wk_MOVE.Org[(Int32)num] = (Int16)pMe.gameObject.transform.localPosition[(Int32)num]; wk_MOVE.Dst[(Int32)num] = (Int16)pMe.base_pos[(Int32)num]; } pSeqWork.Work = btlseq.SequenceConverter.WkMoveToWork(wk_MOVE); }
public static Int32 SeqExecCalc(SEQ_WORK pSeqWork, BTL_DATA pMe) { btlseq.BattleLog("SeqExecCalc"); CMD_DATA cmdPtr = pSeqWork.CmdPtr; UInt16 tar_id = cmdPtr.tar_id; for (BTL_DATA next = FF9StateSystem.Battle.FF9Battle.btl_list.next; next != null; next = next.next) { if ((next.btl_id & tar_id) != 0) { btl_cmd.ExecVfxCommand(next); } } pSeqWork.CurPtr++; return(1); }
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); }
public static Int32 SeqExecFastEnd(SEQ_WORK pSeqWork, BTL_DATA pMe) { btlseq.BattleLog("SeqExecFastEnd"); if (SFX.isRunning) { return(0); } if (pSeqWork.TurnTime != 0) { return(0); } if (!pSeqWork.Flags.EventMode) { btl_cmd.ReqFinishCommand(); } pSeqWork.CmdPtr = (CMD_DATA)null; return(0); }
public static Int32 SeqExecTurn(SEQ_WORK pSeqWork, BTL_DATA pMe) { btlseq.BattleLog("SeqExecTurn"); Int16 num = 0; Int16 num2 = 0; Int16 num3 = btlseq.sequenceReader.ReadInt16(); Int16 num4 = btlseq.sequenceReader.ReadInt16(); num4 = (Int16)((Single)num4 / 4096f * 360f); pSeqWork.TurnTime = btlseq.sequenceReader.ReadByte(); pSeqWork.TurnOrg = (Int16)pMe.rot.eulerAngles.y; pSeqWork.TurnCnt = 1; if (((Int32)num3 & 32768) != 0) { Int16 num5 = (Int16)(num3 & Int16.MaxValue); if (num5 != 0) { if (num5 != 1) { num3 = (Int16)pMe.rot.eulerAngles[1]; } else { btlseq.SeqSubTargetAveragePos(pSeqWork.CmdPtr.tar_id, out num, out num2); num = (Int16)(pMe.gameObject.transform.localPosition.x - (Single)num); num2 = (Int16)(pMe.gameObject.transform.localPosition.z - (Single)num2); num3 = (Int16)((num != 0 || num2 != 0) ? ((Int16)((Double)Mathf.Atan2((Single)num, (Single)num2) * 57.295779513082323)) : ((Int16)pMe.rot.eulerAngles.y)); } } else { num3 = (Int16)pMe.evt.rotBattle.eulerAngles.y; } } else { num3 = (Int16)((Single)num3 / 4096f * 360f); } num3 = (Int16)(num3 + num4); num3 = (Int16)(pMe.rot.eulerAngles.y - (Single)num3); pSeqWork.TurnRot = (Int16)((num3 <= 180) ? ((Int16)(-num3)) : ((Int16)(360 - num3))); pSeqWork.CurPtr += 6; return(1); }
public static Int32 SeqExecVfx(SEQ_WORK pSeqWork, BTL_DATA pMe) { btlseq.BattleLog("SeqExecVfx"); Int16[] array = new Int16[4]; if (SFX.GetEffectOvRun() != 0) { return(0); } UInt16 fx_no = btlseq.sequenceReader.ReadUInt16(); array[0] = btlseq.sequenceReader.ReadInt16(); array[1] = btlseq.sequenceReader.ReadInt16(); array[2] = btlseq.sequenceReader.ReadInt16(); array[3] = (Int16)((btlseq.wSeqCode != 26) ? 0 : 1); btl_vfx.SetBattleVfx(pSeqWork.CmdPtr, (UInt32)fx_no, array); pSeqWork.Flags.WaitLoadVfx = true; pSeqWork.CurPtr += 9; return(1); }
public static Int32 SeqExecScale(SEQ_WORK pSeqWork, BTL_DATA pMe) { btlseq.BattleLog("SeqExecScale"); WK_SCALE wk_SCALE = btlseq.SequenceConverter.WorkToWkScale(pSeqWork.Work); UInt16 num = (UInt16)(wk_SCALE.Scl * pSeqWork.IncCnt / wk_SCALE.Frames + wk_SCALE.Org); geo.geoScaleSet(pMe, (Int32)num); btl_scrp.SetCharacterData(pMe, 55u, (UInt32)num); if (num == 4096) { geo.geoScaleReset(pMe); } if (pSeqWork.IncCnt >= wk_SCALE.Frames) { pSeqWork.CurPtr += 4; return(1); } return(0); }
public static void SeqInitMoveToPoint(SEQ_WORK pSeqWork, BTL_DATA pMe) { btlseq.BattleLog("SeqInitMoveToPoint"); WK_MOVE wk_MOVE = btlseq.SequenceConverter.WorkToWkMove(pSeqWork.Work); wk_MOVE.Next = 8; pSeqWork.IncCnt = 1; wk_MOVE.Frames = (Int16)btlseq.sequenceReader.ReadByte(); for (Int16 num = 0; num < 3; num = (Int16)(num + 1)) { wk_MOVE.Org[(Int32)num] = (Int16)pMe.gameObject.transform.localPosition[(Int32)num]; Int16 num2 = btlseq.sequenceReader.ReadInt16(); if (num == 1) { num2 = (Int16)(num2 * -1); } wk_MOVE.Dst[(Int32)num] = num2; } pSeqWork.Work = btlseq.SequenceConverter.WkMoveToWork(wk_MOVE); }
public static void SeqInitScale(SEQ_WORK pSeqWork, BTL_DATA pMe) { btlseq.BattleLog("SeqInitScale"); WK_SCALE wk_SCALE = new WK_SCALE(); wk_SCALE.Org = (Int16)(pMe.gameObject.transform.localScale.x * 4096f); Int16 num = btlseq.sequenceReader.ReadInt16(); if (num == -1) { num = 4096; } else { num = (Int16)(wk_SCALE.Org * num / 4096); } wk_SCALE.Scl = (Int16)(num - wk_SCALE.Org); pSeqWork.IncCnt = 1; wk_SCALE.Frames = (Int16)btlseq.sequenceReader.ReadByte(); pSeqWork.Work = btlseq.SequenceConverter.WkScaleToWork(wk_SCALE); }
public static Int32 SeqExecAnim(SEQ_WORK pSeqWork, BTL_DATA pMe) { btlseq.BattleLog("SeqExecAnim"); Byte b = btlseq.sequenceReader.ReadByte(); if (b == 255) { Int32 num = (Int32)((pMe.bi.def_idle == 0) ? 0 : 1); String name = FF9StateSystem.Battle.FF9Battle.enemy[(Int32)pMe.bi.slot_no].et.mot[num]; btl_mot.setMotion(pMe, name); } else { Int32 num = (Int32)(pSeqWork.AnmIDOfs + b); String name2 = FF9BattleDB.Animation[btlseq.seq_work_set.AnmAddrList[num]]; btl_mot.setMotion(pMe, name2); } pMe.evt.animFrame = 0; pSeqWork.AnmCnt = 0; pSeqWork.CurPtr += 2; return(1); }
public static void SeqInitMoveToTarget(SEQ_WORK pSeqWork, BTL_DATA pMe) { btlseq.BattleLog("SeqInitMoveToTarget"); WK_MOVE wk_MOVE = new WK_MOVE(); wk_MOVE.Next = 4; pSeqWork.IncCnt = 1; wk_MOVE.Frames = (Int16)btlseq.sequenceReader.ReadByte(); for (Int32 i = 0; i < 3; i++) { wk_MOVE.Org[i] = (Int16)pMe.pos[i]; } wk_MOVE.Dst[1] = wk_MOVE.Org[1]; btlseq.SeqSubTargetAveragePos(pSeqWork.CmdPtr.tar_id, out wk_MOVE.Dst[0], out wk_MOVE.Dst[2]); Int16 num = btlseq.sequenceReader.ReadInt16(); if (wk_MOVE.Org[0] != wk_MOVE.Dst[0] || wk_MOVE.Org[2] != wk_MOVE.Dst[2]) { if (btlseq.wSeqCode == 30) { Int16[] dst = wk_MOVE.Dst; Int32 num2 = 2; dst[num2] = (Int16)(dst[num2] + (Int16)(-num)); } else { Double num3 = (Double)Mathf.Atan2((Single)(wk_MOVE.Dst[0] - wk_MOVE.Org[0]), (Single)(wk_MOVE.Dst[2] - wk_MOVE.Org[2])); Double num4 = (Double)Mathf.Sin((Single)num3); Double num5 = (Double)Mathf.Cos((Single)num3); Int16[] dst2 = wk_MOVE.Dst; Int32 num6 = 0; dst2[num6] = (Int16)(dst2[num6] + (Int16)(num4 * (Double)num)); Int16[] dst3 = wk_MOVE.Dst; Int32 num7 = 2; dst3[num7] = (Int16)(dst3[num7] + (Int16)(num5 * (Double)num)); } } pSeqWork.Work = btlseq.SequenceConverter.WkMoveToWork(wk_MOVE); }
public static Int32 SeqExecMoveToTarget(SEQ_WORK pSeqWork, BTL_DATA pMe) { btlseq.BattleLog("SeqExecMoveToTarget"); WK_MOVE wk_MOVE = new WK_MOVE(); wk_MOVE = btlseq.SequenceConverter.WorkToWkMove(pSeqWork.Work); Vector3 zero = Vector3.zero; Vector3 zero2 = Vector3.zero; for (Int16 num = 0; num < 3; num = (Int16)(num + 1)) { Int16 num2 = wk_MOVE.Org[(Int32)num]; Int16 num3 = wk_MOVE.Dst[(Int32)num]; zero[(Int32)num] = pMe.pos[(Int32)num]; zero2[(Int32)num] = (Single)num3; pMe.pos[(Int32)num] = (Single)(num3 - num2) * ((Single)pSeqWork.IncCnt * 1f) / (Single)wk_MOVE.Frames + (Single)num2; } if (pSeqWork.IncCnt >= wk_MOVE.Frames) { pSeqWork.CurPtr += (Int32)wk_MOVE.Next; } return(0); }
private static Int32 SeqExecEnd(SEQ_WORK pSeqWork, BTL_DATA pMe) { btlseq.BattleLog("SeqExecEnd!!!!!!!!!!!!"); if (!pSeqWork.Flags.FinishIdle && pSeqWork.AnmCnt != 0 && (UInt16)pMe.evt.animFrame >= GeoAnim.geoAnimGetNumFrames(pMe)) { btl_mot.setMotion(pMe, pMe.bi.def_idle); pMe.evt.animFrame = 0; pSeqWork.Flags.FinishIdle = true; } if ((pMe.stat.cur & 33558530u) == 0u && !pSeqWork.Flags.FinishIdle) { return(0); } if (SFX.isRunning) { return(0); } if (pSeqWork.TurnTime != 0) { return(0); } if (UIManager.Battle.BtlWorkLibra) { return(0); } if (!pSeqWork.Flags.EventMode) { btl_cmd.ReqFinishCommand(); } pSeqWork.CmdPtr = (CMD_DATA)null; if (FF9StateSystem.Battle.isDebug) { pMe.pos = (pMe.base_pos = pMe.original_pos); pMe.gameObject.transform.localPosition = pMe.pos; } return(0); }