//------------------------------------------ // 定数定義 ※ここの数字を変更する //------------------------------------------ const CNT_TRYING = 100 // 作成数 const CNT_UPGRADE = 9 // 強化回数 const PER_WHITE = 10 // 白書成功率 const PER_OHTER = 20 // 強化書成功率 //------------------------------------------ // 変数定義 //------------------------------------------ public _cnt_upgrade = 0 // 残アップグレード回数 public _cnt_other = 0 // 強化使用書枚数 public _cnt_white_total = 0 // 白書使用枚数 public _cnt_white_success = 0 // 白書成功回数 public _cnt_white_failed_max = 0 // 白書連続失敗回数 //------------------------------------------ // メイン処理 //------------------------------------------ Main Exit //------------------------------------------ // プロシージャ //------------------------------------------ procedure Main for i = 1 to CNT_TRYING TryPaper next ResultLogging fend //------------------------------------------ procedure TryPaper // 強化回数を設定 _cnt_upgrade = CNT_UPGRADE repeat // 強化書使用枚数を増やす _cnt_other = _cnt_other + 1 // ランダム数字生成 num = Random(99) // 強化書成功判定 ifb PER_OHTER > num // 成功したらアップグレード回数を減らす _cnt_upgrade = _cnt_upgrade - 1 else // 失敗したら白書で復活 RepairUpgrade endif until _cnt_upgrade = 0 fend //------------------------------------------ procedure RepairUpgrade // 失敗回数 cnt_failed = -1 repeat // 失敗回数 cnt_failed = cnt_failed + 1 // 白書使用枚数を増やす _cnt_white_total = _cnt_white_total + 1 // ランダム数字生成 num = Random(99) until PER_WHITE > num // 白書成功回数 _cnt_white_success = _cnt_white_success + 1 // 白書連続失敗回数 if _cnt_white_failed_max < cnt_failed then _cnt_white_failed_max = cnt_failed fend //------------------------------------------ procedure ResultLogging print "作成回数 : " + CNT_TRYING print "白書使用枚数 : " + _cnt_white_total print "強化書使用枚数 : " + _cnt_other print "白書成功率 : " + ( _cnt_white_success / _cnt_white_total ) * 100 + "%" print "強化書成功率 : " + ( CNT_UPGRADE * CNT_TRYING / _cnt_other ) * 100 + "%" print "白書連続失敗回数 : " + _cnt_white_failed_max fend