public static Byte StartType(BTL_SCENE_INFO info) { Byte num1 = 2; if (info.SpecialStart != 0) { if (info.BackAttack != 0) { num1 = 0; } } else { Byte num2 = 24; if (btl_abil.CheckPartyAbility(1U, 512U)) { num2 = 0; } else if (info.BackAttack != 0) { num2 = Byte.MaxValue; } if (Comn.random8() < num2) { num1 = 0; } else { Byte num3 = 16; if (btl_abil.CheckPartyAbility(1U, 1024U)) { num3 = 85; } if (Comn.random8() < num3) { num1 = 1; } } } if (num1 == 0) { BattleAchievement.UpdateBackAttack(); } return(num1); }
public static void SetBattleData(UInt32 id, Int32 val) { FF9StateBattleSystem ff9Battle = FF9StateSystem.Battle.FF9Battle; FF9StateGlobal ff = FF9StateSystem.Common.FF9; switch (id) { case 32u: UIManager.Battle.FF9BMenu_EnableMenu(false); ff9Battle.btl_escape_key = 0; ff9Battle.cmd_status = (UInt16)(ff9Battle.cmd_status & -2); ff9Battle.btl_phase = 5; ff9Battle.btl_seq = 2; btl_cmd.KillAllCommand(ff9Battle); for (BTL_DATA next = ff9Battle.btl_list.next; next != null; next = next.next) { next.bi.cmd_idle = 0; } break; case 33u: if (ff9Battle.btl_phase == 1) { ff.btl_result = (Byte)val; if (val == 1 && ff9Battle.btl_scene.Info.WinPose != 0) { ff9Battle.btl_phase = 5; ff9Battle.btl_seq = 4; } else { if (ff.btl_result == 1) { ff.btl_result = 2; } ff9Battle.btl_phase = 8; ff9Battle.btl_seq = 0; } } break; case 34u: if (ff9Battle.btl_phase == 1) { ff9Battle.btl_phase = 7; ff9Battle.btl_seq = 0; ff.btl_result = 3; } break; case 35u: if (ff9Battle.btl_phase == 1) { BTL_SCENE_INFO info = ff9Battle.btl_scene.Info; ff9Battle.btl_phase = 3; ff9Battle.btl_seq = 0; if (info.SpecialStart == 0 || info.BackAttack == 0) { info.StartType = 2; } } break; case 36u: if (ff9Battle.btl_phase == 1) { SFX.SetCamera(val); } break; case 37u: { FF9StateGlobal ff9StateGlobal = ff; ff9StateGlobal.btl_flag = (Byte)(ff9StateGlobal.btl_flag | 1); PersistenSingleton <EventEngine> .Instance.SetNextMap(val); break; } case 38u: ff.party.gil += (UInt32)val; if (ff.party.gil > 9999999u) { ff.party.gil = 9999999u; } break; case 39u: if (ff.dragon_no < 9999) { FF9StateGlobal ff9StateGlobal2 = ff; ff9StateGlobal2.dragon_no = (Int16)(ff9StateGlobal2.dragon_no + 1); } break; case 40u: { btlsnd.ff9btlsnd_song_vol_intplall(30, 0); FF9StateGlobal ff2 = FF9StateSystem.Common.FF9; ff2.btl_flag = (Byte)(ff2.btl_flag | 16); break; } } }