import random def main(): ## 試行回数 trial = 100000 ## 環境設定, GB(0), N64(1), PBS(2) gamemode = 2 ## 砂嵐の発生ターン(0,1) suna_1, suna_2, suna_3, suna_4 = 0, 0, 0, 0 ## 砂嵐ダメージ,無効(0),有効(1) x_suna, y_suna = 1, 1 ### プレイヤー1 ### ## 最大 HP x_max_hp = 215 ## 現在 HP x_hp = 215 ## 素早さ x_speed = 112 ## 通常ダメージ, 急所ダメージ, 命中率, 急所ランク # 命中率 = 99.6(256), 94.5(242), 89.5(229), 84.4(216), 79.7(204), 74.6(191), 69.5(178), 59.8(153), 54.7(140), 49.6(127), 29.7(76) # 光の粉は accuracy -20, 256のときは -21, 変化技は accuracy 256 # 急所ランク = 0(17), 1(32), 2(64), 3(85), 4(128) x_damage_1, x_critical_damage_1, x_accuracy_1, x_critical_hit_1 = 123, 243, 178, 17 x_damage_2, x_critical_damage_2, x_accuracy_2, x_critical_hit_2 = 123, 243, 178, 17 x_damage_3, x_critical_damage_3, x_accuracy_3, x_critical_hit_3 = 123, 243, 178, 17 x_damage_4, x_critical_damage_4, x_accuracy_4, x_critical_hit_4 = 123, 243, 178, 17 ## 火傷状態の通常ダメージ, 急所ダメージ bx_damage_1, bx_damage_2, bx_damage_3, bx_damage_4 = 0, 0, 0, 0 bx_critical_damage_1, bx_critical_damage_2, bx_critical_damage_3, bx_critical_damage_4 = 0, 0, 0, 0 ## 混乱ダメージ, 火傷状態の混乱ダメージ x_konran_damage, bx_konran_damage = 0, 0 ## 破壊の遺伝子(0,1) x_idenshi = 0 ## 王者の印(0,1) x_ouja_1, x_ouja_2, x_ouja_3, x_ouja_4 = 0, 0, 0, 0 ## 気合の鉢巻き(0,1) x_hachimaki = 0 ## 先制の爪(0,1) x_sensei = 0 ## 食べ残し(0,1) x_tabenokoshi = 1 ## 木の実(1), 木の実ジュース(2), 黄金の実(3), なし(0) x_kinomi = 0 ## 凍り, 眠り,混乱, 麻痺, 毒, 火傷, 全て(0,1) x_yaketa, x_hakka, x_nigai, x_mahinaoshi, x_dokukeshi, x_kootta, x_kiseki = 0, 0, 0, 0, 0, 0, 0 ## 追加効果 # なし(0), 怯み(1), 凍り(2), 眠り(3), 混乱(4), メロメロ(5), 麻痺(6), 毒(7), 火傷(8), 猛毒(9) # 宿り木の種(10), 悪夢(11), 呪い(12), トライアタック(13) # 反動ダメージ(20), HPドレイン(21), 怒りの前歯(22), 固定ダメージ(23), プレゼント(24), 飛び蹴り(25) # 1/2回復(27), 眠る(28), 寝言(29) # カウンターorミラーコート(30), 優先度+1(31), 優先度-1(32) # 連続攻撃2-5(33), 連続攻撃2(34), ダブルニードル(35), トリプルキック(36), サイコウェーブ(37), 未来予知(38), じたばた(39) # 転がる(40), 連続斬り(41), 痛み分け(42) # 守る(50), 堪える(51) # 素早さダウン(60), 命中率ダウン(61), 防御or特防-1(62), 防御or特防-2(63) x_sub_1, x_sub_2, x_sub_3, x_sub_4 = 6, 6, 6, 6 ## 追加効果の確率, 100(256), 49.7(127), 29.7(76), 19.9(51), 9.8(25), なし(0) x_per_1, x_per_2, x_per_3, x_per_4 = 76, 76, 76, 76 ##(9) 猛毒の経過ターン(0,1-) x_moudoku_up = 0 ##(24) プレゼントの通常ダメージ, 急所ダメージ x_g40, x_g80, x_g120 = 0, 0, 0 x_cg40, x_cg80, x_cg120 = 0, 0, 0 ##(24) 火傷状態の通常ダメージ, 急所ダメージ bx_g40, bx_g80, bx_g120 = 0, 0, 0 bx_cg40, bx_cg80, bx_cg120 = 0, 0, 0 ##(29) 寝言の分岐(2,3) x_negoto_way = 3 ##(29) 寝言, 通常ダメージ, 急所ダメージ, 命中率, 急所ランク, 追加効果, 追加効果の確率 # 寝言で選ばれない技は下段から入力 x1_damage, x1_critical_damage, x1_accuracy, x1_critical_hit, x1_sub, x1_per = 0, 0, 0, 0, 0, 0 x2_damage, x2_critical_damage, x2_accuracy, x2_critical_hit, x2_sub, x2_per = 0, 0, 0, 0, 0, 0 x3_damage, x3_critical_damage, x3_accuracy, x3_critical_hit, x3_sub, x3_per = 0, 0, 0, 0, 0, 0 ##(37) サイコウェーブ(1-) x_level = 50 ##(38) 未来予知(0,1), 通常ダメージ, 命中率 # 指定のターンでダメージ x_mirai_1, x_mirai_2 = 0, 0 x_mirai_damage_1, x_mirai_damage_2 = 0, 0 x_mirai_accuracy_1, x_mirai_accuracy_2 = 0, 0 ##(39) じたばたの通常タメージ, 火傷ダメージ x_f20, x_f40, x_f80, x_f100, x_f150, x_f200 = 0, 0, 0, 0, 0, 0 bx_f20, bx_f40, bx_f80, bx_f100, bx_f150, bx_f200 = 0, 0, 0, 0, 0, 0 ##(40) 転がるの開始ターン(1-5), 丸くなる状態(0,1) x_korogaru_up, x_marukunaru = 1, 0 ##(41) 連続斬りの開始ターン(1-5) x_renzokugiri_up = 1 ##(50,51) 守る・堪えるの開始ターン(1-5) x_protect_up = 1 ##(60) 素早さダウン # gamemode = 0,1 [ -1(66%), -2(50%), -3(40%), -4(33%), -5(28%), -6(25%) ] # gamemode = 2 [ -1(2/3), -2(2/4), -3(2/5), -4(2/6), -5(2/7), -6(2/8) ] y_speed_ph1, y_speed_ph2, y_speed_ph3 = 0, 0, 0 ##(61) 命中率ダウン # gamemode = 0,1 [ -1(75%), -2(60%), -3(50%), -4(43%), -5(36%), -6(33%) ] # gamemode = 2 [ -1(3/4), -2(3/5), -3(3/6), -4(3/7), -5(3/8), -6(3/9) ] # 変化のない箇所は元の値を入力 y_accuracy_1_ph1, y_accuracy_2_ph1, y_accuracy_3_ph1, y_accuracy_4_ph1 = 0, 0, 0, 0 y_accuracy_2_ph2, y_accuracy_3_ph2, y_accuracy_4_ph2 = 0, 0, 0 y_accuracy_3_ph3, y_accuracy_4_ph3 = 0, 0 y_accuracy_4_ph4 = 0 ##(61) 寝言の命中率ダウン y1_accuracy_ph1, y2_accuracy_ph1, y3_accuracy_ph1 = 0, 0, 0 y1_accuracy_ph2, y2_accuracy_ph2, y3_accuracy_ph2 = 0, 0, 0 y1_accuracy_ph3, y2_accuracy_ph3, y3_accuracy_ph3 = 0, 0, 0 y1_accuracy_ph4, y2_accuracy_ph4, y3_accuracy_ph4 = 0, 0, 0 ##(62,63) 防御or特防ダウン, ダメージ, 急所ダメージ # [対象外] プレゼント・じたばた # gamemode = 0,1 [ -1(75%), -2(60%), -3(50%), -4(43%), -5(36%), -6(33%) ] # gamemode = 2 [ -1(3/4), -2(3/5), -3(3/6), -4(3/7), -5(3/8), -6(3/9) ] # 変化のない箇所は元の値を入力 x_damage_2_ph1, x_damage_3_ph1, x_damage_4_ph1 = 0, 0, 0 x_damage_2_ph2, x_damage_3_ph2, x_damage_4_ph2 = 0, 0, 0 x_damage_3_ph3, x_damage_4_ph3 = 0, 0 x_damage_3_ph4, x_damage_4_ph4 = 0, 0 x_damage_4_ph5 = 0 x_damage_4_ph6 = 0 x_critical_damage_2_ph1, x_critical_damage_3_ph1, x_critical_damage_4_ph1 = 0, 0, 0 x_critical_damage_2_ph2, x_critical_damage_3_ph2, x_critical_damage_4_ph2 = 0, 0, 0 x_critical_damage_3_ph3, x_critical_damage_4_ph3 = 0, 0 x_critical_damage_3_ph4, x_critical_damage_4_ph4 = 0, 0 x_critical_damage_4_ph5 = 0 x_critical_damage_4_ph6 = 0 ##(62,63) 火傷状態の通常ダメージ, 急所ダメージ bx_damage_2_ph1, bx_damage_3_ph1, bx_damage_4_ph1 = 0, 0, 0 bx_damage_2_ph2, bx_damage_3_ph2, bx_damage_4_ph2 = 0, 0, 0 bx_damage_3_ph3, bx_damage_4_ph3 = 0, 0 bx_damage_3_ph4, bx_damage_4_ph4 = 0, 0 bx_damage_4_ph5 = 0 bx_damage_4_ph6 = 0 bx_critical_damage_2_ph1, bx_critical_damage_3_ph1, bx_critical_damage_4_ph1 = 0, 0, 0 bx_critical_damage_2_ph2, bx_critical_damage_3_ph2, bx_critical_damage_4_ph2 = 0, 0, 0 bx_critical_damage_3_ph3, bx_critical_damage_4_ph3 = 0, 0 bx_critical_damage_3_ph4, bx_critical_damage_4_ph4 = 0, 0 bx_critical_damage_4_ph5 = 0 bx_critical_damage_4_ph6 = 0 ##(62,63) 寝言の通常ダメージ, 急所ダメージ x1_damage_ph1, x2_damage_ph1, x3_damage_ph1 = 0, 0, 0 x1_damage_ph2, x2_damage_ph2, x3_damage_ph2 = 0, 0, 0 x1_damage_ph3, x2_damage_ph3, x3_damage_ph3 = 0, 0, 0 x1_damage_ph4, x2_damage_ph4, x3_damage_ph4 = 0, 0, 0 x1_damage_ph5, x2_damage_ph5, x3_damage_ph5 = 0, 0, 0 x1_damage_ph6, x2_damage_ph6, x3_damage_ph6 = 0, 0, 0 x1_critical_damage_ph1, x2_critical_damage_ph1, x3_critical_damage_ph1 = 0, 0, 0 x1_critical_damage_ph2, x2_critical_damage_ph2, x3_critical_damage_ph2 = 0, 0, 0 x1_critical_damage_ph3, x2_critical_damage_ph3, x3_critical_damage_ph3 = 0, 0, 0 x1_critical_damage_ph4, x2_critical_damage_ph4, x3_critical_damage_ph4 = 0, 0, 0 x1_critical_damage_ph5, x2_critical_damage_ph5, x3_critical_damage_ph5 = 0, 0, 0 x1_critical_damage_ph6, x2_critical_damage_ph6, x3_critical_damage_ph6 = 0, 0, 0 ##(62,63) 混乱ダメージ, 火傷状態の混乱ダメージ y_konran_damage_ph1, y_konran_damage_ph2, y_konran_damage_ph3, y_konran_damage_ph4, y_konran_damage_ph5, y_konran_damage_ph6 = 0, 0, 0, 0, 0, 0 by_konran_damage_ph1, by_konran_damage_ph2, by_konran_damage_ph3, by_konran_damage_ph4, by_konran_damage_ph5, by_konran_damage_ph6 = 0, 0, 0, 0, 0, 0 ### プレイヤー2 ### ## 最大 HP y_max_hp = 182 ## 現在 HP y_hp = 182 ## 素早さ y_speed = 113 ## 通常ダメージ, 急所ダメージ, 命中率, 急所ランク # 命中率 = 99.6(256), 94.5(242), 89.5(229), 84.4(216), 79.7(204), 74.6(191), 69.5(178), 59.8(153), 54.7(140), 49.6(127), 29.7(76) # 光の粉は accuracy -20, 256のときは -21, 変化技は accuracy 256 # 急所ランク = 0(17), 1(32), 2(64), 3(85), 4(128) y_damage_1, y_critical_damage_1, y_accuracy_1, y_critical_hit_1 = 96, 188, 256, 17 y_damage_2, y_critical_damage_2, y_accuracy_2, y_critical_hit_2 = 96, 188, 256, 17 y_damage_3, y_critical_damage_3, y_accuracy_3, y_critical_hit_3 = 96, 188, 256, 17 y_damage_4, y_critical_damage_4, y_accuracy_4, y_critical_hit_4 = 96, 188, 256, 17 ## 火傷状態の通常ダメージ, 急所ダメージ by_damage_1, by_damage_2, by_damage_3, by_damage_4 = 0, 0, 0, 0 by_critical_damage_1, by_critical_damage_2, by_critical_damage_3, by_critical_damage_4 = 0, 0, 0, 0 ## 混乱ダメージ, 火傷状態の混乱ダメージ y_konran_damage, by_konran_damage = 0, 0 ## 破壊の遺伝子(0,1), GB(0), N64/PBS(1) y_idenshi = 0 ## 王者の印(0,1) y_ouja_1, y_ouja_2, y_ouja_3, y_ouja_4 = 0, 0, 0, 0 ## 気合の鉢巻き(0,1) y_hachimaki = 0 ## 先制の爪(0,1) y_sensei = 0 ## 食べ残し(0,1) y_tabenokoshi = 0 ## 木の実(1), 木の実ジュース(2), 黄金の実(3), なし(0) y_kinomi = 0 ## 凍り, 眠り,混乱, 麻痺, 毒, 火傷, 全て(0,1) y_yaketa, y_hakka, y_nigai, y_mahinaoshi, y_dokukeshi, y_kootta, y_kiseki = 0, 0, 0, 0, 0, 0, 1 ## 追加効果 # なし(0), 怯み(1), 凍り(2), 眠り(3), 混乱(4), メロメロ(5), 麻痺(6), 毒(7), 火傷(8), 猛毒(9) # 宿り木の種(10), 悪夢(11), 呪い(12), トライアタック(13) # 反動ダメージ(20), HPドレイン(21), 怒りの前歯(22), 固定ダメージ(23), プレゼント(24), 飛び蹴り(25) # 1/2回復(27), 眠る(28), 寝言(29) # カウンターorミラーコート(30), 優先度+1(31), 優先度-1(32) # 連続攻撃2-5(33), 連続攻撃2(34), ダブルニードル(35), トリプルキック(36), サイコウェーブ(37), 未来予知(38), じたばた(39) # 転がる(40), 連続斬り(41), 痛み分け(42) # 守る(50), 堪える(51) # 素早さダウン(60), 命中率ダウン(61), 防御or特防-1(62), 防御or特御-2(63) y_sub_1, y_sub_2, y_sub_3, y_sub_4 = 2, 2, 2, 2 ## 追加効果の確率, 100(256), 49.7(127), 29.7(76), 19.9(51), 9.8(25), なし(0) y_per_1, y_per_2, y_per_3, y_per_4 = 25, 25, 25, 25 ##(9) 猛毒の経過ターン(0,1-) y_moudoku_up = 0 ##(24) プレゼントの通常ダメージ, 急所ダメージ y_g40, y_g80, y_g120 = 0, 0, 0 y_cg40, y_cg80, y_cg120 = 0, 0, 0 ##(24) 火傷状態の通常ダメージ, 急所ダメージ by_g40, by_g80, by_g120 = 0, 0, 0 by_cg40, by_cg80, by_cg120 = 0, 0, 0 ##(29) 寝言の分岐(2,3) y_negoto_way = 3 ##(29) 寝言, 通常ダメージ, 急所ダメージ, 命中率, 急所ランク, 追加効果, 追加効果の確率 # 寝言で選ばれない技は下段から入力 y1_damage, y1_critical_damage, y1_accuracy, y1_critical_hit, y1_sub, y1_per = 0, 0, 0, 0, 0, 0 y2_damage, y2_critical_damage, y2_accuracy, y2_critical_hit, y2_sub, y2_per = 0, 0, 0, 0, 0, 0 y3_damage, y3_critical_damage, y3_accuracy, y3_critical_hit, y3_sub, y3_per = 0, 0, 0, 0, 0, 0 ##(37) サイコウェーブ(1-) y_level = 50 ##(38) 未来予知(0,1), 通常ダメージ, 命中率 # 指定のターンでダメージ y_mirai_1, y_mirai_2 = 0, 0 y_mirai_damage_1, y_mirai_damage_2 = 0, 0 y_mirai_accuracy_1, y_mirai_accuracy_2 = 0, 0 ##(39) じたばたの通常タメージ, 火傷ダメージ y_f20, y_f40, y_f80, y_f100, y_f150, y_f200 = 0, 0, 0, 0, 0, 0 by_f20, by_f40, by_f80, by_f100, by_f150, by_f200 = 0, 0, 0, 0, 0, 0 ##(40) 転がるの開始ターン(1-5), 丸くなる状態(0,1) y_korogaru_up, y_marukunaru = 1, 0 ##(41) 連続斬りの開始ターン(1-5) y_renzokugiri_up = 1 ##(50,51) 守る・堪えるの開始ターン(1-5) y_protect_up = 1 ##(60) 素早さダウン # gamemode = 0,1 [ -1(66%), -2(50%), -3(40%), -4(33%), -5(28%), -6(25%) ] # gamemode = 2 [ -1(2/3), -2(2/4), -3(2/5), -4(2/6), -5(2/7), -6(2/8) ] # 切り捨ての値を入力 x_speed_ph1, x_speed_ph2, x_speed_ph3 = 0, 0, 0 ##(61) 命中率ダウン # gamemode = 0,1 [ -1(75%), -2(60%), -3(50%), -4(43%), -5(36%), -6(33%) ] # gamemode = 2 [ -1(3/4), -2(3/5), -3(3/6), -4(3/7), -5(3/8), -6(3/9) ] # 変化のない箇所は元の値を入力 x_accuracy_1_ph1, x_accuracy_2_ph1, x_accuracy_3_ph1, x_accuracy_4_ph1 = 0, 0, 0, 0 x_accuracy_2_ph2, x_accuracy_3_ph2, x_accuracy_4_ph2 = 0, 0, 0 x_accuracy_3_ph3, x_accuracy_4_ph3 = 0, 0 x_accuracy_4_ph4 = 0 ##(61) 寝言の命中率ダウン x1_accuracy_ph1, x2_accuracy_ph1, x3_accuracy_ph1 = 0, 0, 0 x1_accuracy_ph2, x2_accuracy_ph2, x3_accuracy_ph2 = 0, 0, 0 x1_accuracy_ph3, x2_accuracy_ph3, x3_accuracy_ph3 = 0, 0, 0 x1_accuracy_ph4, x2_accuracy_ph4, x3_accuracy_ph4 = 0, 0, 0 ##(62,63) 防御or特防ダウン, ダメージ, 急所ダメージ # [対象外] プレゼント・じたばた # gamemode = 0,1 [ -1(75%), -2(60%), -3(50%), -4(43%), -5(36%), -6(33%) ] # gamemode = 2 [ -1(3/4), -2(3/5), -3(3/6), -4(3/7), -5(3/8), -6(3/9) ] # 変化のない箇所は元の値を入力 y_damage_2_ph1, y_damage_3_ph1, y_damage_4_ph1 = 0, 0, 0 y_damage_2_ph2, y_damage_3_ph2, y_damage_4_ph2 = 0, 0, 0 y_damage_3_ph3, y_damage_4_ph3 = 0, 0 y_damage_3_ph4, y_damage_4_ph4 = 0, 0 y_damage_4_ph5 = 0 y_damage_4_ph6 = 0 y_critical_damage_2_ph1, y_critical_damage_3_ph1, y_critical_damage_4_ph1 = 0, 0, 0 y_critical_damage_2_ph2, y_critical_damage_3_ph2, y_critical_damage_4_ph2 = 0, 0, 0 y_critical_damage_3_ph3, y_critical_damage_4_ph3 = 0, 0 y_critical_damage_3_ph4, y_critical_damage_4_ph4 = 0, 0 y_critical_damage_4_ph5 = 0 y_critical_damage_4_ph6 = 0 ##(62,63) 火傷状態の通常ダメージ, 急所ダメージ by_damage_2_ph1, by_damage_3_ph1, by_damage_4_ph1 = 0, 0, 0 by_damage_2_ph2, by_damage_3_ph2, by_damage_4_ph2 = 0, 0, 0 by_damage_3_ph3, by_damage_4_ph3 = 0, 0 by_damage_3_ph4, by_damage_4_ph4 = 0, 0 by_damage_4_ph5 = 0 by_damage_4_ph6 = 0 by_critical_damage_2_ph1, by_critical_damage_3_ph1, by_critical_damage_4_ph1 = 0, 0, 0 by_critical_damage_2_ph2, by_critical_damage_3_ph2, by_critical_damage_4_ph2 = 0, 0, 0 by_critical_damage_3_ph3, by_critical_damage_4_ph3 = 0, 0 by_critical_damage_3_ph4, by_critical_damage_4_ph4 = 0, 0 by_critical_damage_4_ph5 = 0 by_critical_damage_4_ph6 = 0 ##(62,63) 寝言の通常ダメージ, 急所ダメージ y1_damage_ph1, y2_damage_ph1, y3_damage_ph1 = 0, 0, 0 y1_damage_ph2, y2_damage_ph2, y3_damage_ph2 = 0, 0, 0 y1_damage_ph3, y2_damage_ph3, y3_damage_ph3 = 0, 0, 0 y1_damage_ph4, y2_damage_ph4, y3_damage_ph4 = 0, 0, 0 y1_damage_ph5, y2_damage_ph5, y3_damage_ph5 = 0, 0, 0 y1_damage_ph6, y2_damage_ph6, y3_damage_ph6 = 0, 0, 0 y1_critical_damage_ph1, y2_critical_damage_ph1, y3_critical_damage_ph1 = 0, 0, 0 y1_critical_damage_ph2, y2_critical_damage_ph2, y3_critical_damage_ph2 = 0, 0, 0 y1_critical_damage_ph3, y2_critical_damage_ph3, y3_critical_damage_ph3 = 0, 0, 0 y1_critical_damage_ph4, y2_critical_damage_ph4, y3_critical_damage_ph4 = 0, 0, 0 y1_critical_damage_ph5, y2_critical_damage_ph5, y3_critical_damage_ph5 = 0, 0, 0 y1_critical_damage_ph6, y2_critical_damage_ph6, y3_critical_damage_ph6 = 0, 0, 0 ##(62,63) 混乱ダメージ, 火傷状態の混乱ダメージ x_konran_damage_ph1, x_konran_damage_ph2, x_konran_damage_ph3, x_konran_damage_ph4, x_konran_damage_ph5, x_konran_damage_ph6 = 0, 0, 0, 0, 0, 0 bx_konran_damage_ph1, bx_konran_damage_ph2, bx_konran_damage_ph3, bx_konran_damage_ph4, bx_konran_damage_ph5, bx_konran_damage_ph6 = 0, 0, 0, 0, 0, 0 # 入力終了 # 勝率を格納 x_count_1, x_count_2, x_count_3, x_count_4 = 0, 0, 0, 0 y_count_1, y_count_2, y_count_3, y_count_4 = 0, 0, 0, 0 # 再計算の格納 x_ceil_2, y_ceil_2 = (x_max_hp + 1) // 2, (y_max_hp + 1) // 2 # 端数切り上げ x_trunc_2, y_trunc_2 = x_max_hp // 2, y_max_hp // 2 # 割合 x_trunc_4, y_trunc_4 = x_max_hp // 4, y_max_hp // 4 x_trunc_8, y_trunc_8 = x_max_hp // 8, y_max_hp // 8 x_trunc_16, y_trunc_16 = x_max_hp // 16, y_max_hp // 16 x_trunc_speed, y_trunc_speed = x_speed // 4, y_speed // 4 # 麻痺の素早さ x_flail_2, y_flail_2 = x_max_hp * 2//48, y_max_hp * 2//48 # じたばたの割合 x_flail_5, y_flail_5 = x_max_hp * 5//48, y_max_hp * 5//48 x_flail_10, y_flail_10 = x_max_hp * 10//48, y_max_hp * 10//48 x_flail_17, y_flail_17 = x_max_hp * 17//48, y_max_hp * 17//48 x_flail_33, y_flail_33 = x_max_hp * 33//48, y_max_hp * 33//48 x_flail_pbs, y_flail_pbs = x_max_hp * 31//40, y_max_hp * 31//40 rx_psycho_wave, ry_psycho_wave = x_level * 1.5 // 1, y_level * 1.5 // 1 # サイコウェーブ # 初期化する変数 reset = 0 if any(sub in (29,60,61,62,63) for sub in (x_sub_1, x_sub_2, x_sub_3, x_sub_4, y_sub_1, y_sub_2, y_sub_3, y_sub_4)): reset = 1 clear = ( x_max_hp, x_hp, x_speed, \ y_max_hp, y_hp, y_speed, \ x_damage_1, x_critical_damage_1, x_accuracy_1, x_critical_hit_1, \ x_damage_2, x_critical_damage_2, x_accuracy_2, x_critical_hit_2, \ x_damage_3, x_critical_damage_3, x_accuracy_3, x_critical_hit_3, \ x_damage_4, x_critical_damage_4, x_accuracy_4, x_critical_hit_4, \ y_damage_1, y_critical_damage_1, y_accuracy_1, y_critical_hit_1, \ y_damage_2, y_critical_damage_2, y_accuracy_2, y_critical_hit_2, \ y_damage_3, y_critical_damage_3, y_accuracy_3, y_critical_hit_3, \ y_damage_4, y_critical_damage_4, y_accuracy_4, y_critical_hit_4, \ bx_damage_1, bx_damage_2, bx_damage_3, bx_damage_4, \ by_damage_1, by_damage_2, by_damage_3, by_damage_4, \ bx_critical_damage_1, bx_critical_damage_2, bx_critical_damage_3, bx_critical_damage_4, \ by_critical_damage_1, by_critical_damage_2, by_critical_damage_3, by_critical_damage_4, \ x_konran_damage, bx_konran_damage, \ y_konran_damage, by_konran_damage, \ x_sub_1, x_sub_2, x_sub_3, x_sub_4, \ y_sub_1, y_sub_2, y_sub_3, y_sub_4, \ x_per_1, x_per_2, x_per_3, x_per_4, \ y_per_1, y_per_2, y_per_3, y_per_4, \ x1_damage, x1_critical_damage, x1_accuracy, x1_critical_hit, x1_sub, x1_per, \ x2_damage, x2_critical_damage, x2_accuracy, x2_critical_hit, x2_sub, x2_per, \ x3_damage, x3_critical_damage, x3_accuracy, x3_critical_hit, x3_sub, x3_per, \ y1_damage, y1_critical_damage, y1_accuracy, y1_critical_hit, y1_sub, y1_per, \ y2_damage, y2_critical_damage, y2_accuracy, y2_critical_hit, y2_sub, y2_per, \ y3_damage, y3_critical_damage, y3_accuracy, y3_critical_hit, y3_sub, y3_per) for _ in range(trial): # 変数の初期化 x_stock, y_stock = 1, 1 # 持ち物 rx_attack_1, rx_attack_2, rx_attack_3, rx_attack_4 = 0, 0, 0, 0 # ダメージ ry_attack_1, ry_attack_2, ry_attack_3, ry_attack_4 = 0, 0, 0, 0 x_triple_pbs_1, x_triple_pbs_2, x_triple_pbs_3, x_triple_pbs_4 = 1, 1, 1, 1 # トリプルキックの乗算バグ(PBS) y_triple_pbs_1, y_triple_pbs_2, y_triple_pbs_3, y_triple_pbs_4 = 1, 1, 1, 1 x_bit_1, x_bit_2, x_bit_3, x_bit_4 = 1, 1, 1, 1 # 外し(0), 命中(1), 行動不能(2), 寝言判定(3) y_bit_1, y_bit_2, y_bit_3, y_bit_4 = 1, 1, 1, 1 x_critical_1, x_critical_2, x_critical_3, x_critical_4 = 0, 0, 0, 0 # 急所 y_critical_1, y_critical_2, y_critical_3, y_critical_4 = 0, 0, 0, 0 x_hirumi, x_koori, x_nemuri, x_konran, x_meromero, x_mahi, x_doku, x_yakedo = 0, 0, 0, 0, 0, 0, 0, 0 # 状態 y_hirumi, y_koori, y_nemuri, y_konran, y_meromero, y_mahi, y_doku, y_yakedo = 0, 0, 0, 0, 0, 0, 0, 0 x_yadorigi, x_akumu, x_noroi = 0, 0, 0 y_yadorigi, y_akumu, y_noroi = 0, 0, 0 x_moudoku, x_korogaru, x_renzokugiri, x_protect = x_moudoku_up, x_korogaru_up, x_renzokugiri_up, x_protect_up y_moudoku, y_korogaru, y_renzokugiri, y_protect = y_moudoku_up, y_korogaru_up, y_renzokugiri_up, y_protect_up x_speed_ph, x_accuracy_ph, x_bd_ph = 0, 0, 0 # 素早さダウン, 命中率ダウン, 防御or特防ダウン y_speed_ph, y_accuracy_ph, y_bd_ph = 0, 0, 0 if reset == 1: ( x_max_hp, h_hp, x_speed, \ y_max_hp, h_hp, y_speed, \ x_damage_1, x_critical_damage_1, x_accuracy_1, x_critical_hit_1, \ x_damage_2, x_critical_damage_2, x_accuracy_2, x_critical_hit_2, \ x_damage_3, x_critical_damage_3, x_accuracy_3, x_critical_hit_3, \ x_damage_4, x_critical_damage_4, x_accuracy_4, x_critical_hit_4, \ y_damage_1, y_critical_damage_1, y_accuracy_1, y_critical_hit_1, \ y_damage_2, y_critical_damage_2, y_accuracy_2, y_critical_hit_2, \ y_damage_3, y_critical_damage_3, y_accuracy_3, y_critical_hit_3, \ y_damage_4, y_critical_damage_4, y_accuracy_4, y_critical_hit_4, \ bx_damage_1, bx_damage_2, bx_damage_3, bx_damage_4, \ by_damage_1, by_damage_2, by_damage_3, by_damage_4, \ bx_critical_damage_1, bx_critical_damage_2, bx_critical_damage_3, bx_critical_damage_4, \ by_critical_damage_1, by_critical_damage_2, by_critical_damage_3, by_critical_damage_4, \ x_konran_damage, bx_konran_damage, \ y_konran_damage, by_konran_damage, \ x_sub_1, x_sub_2, x_sub_3, x_sub_4, \ y_sub_1, y_sub_2, y_sub_3, y_sub_4, \ x_per_1, x_per_2, x_per_3, x_per_4, \ y_per_1, y_per_2, y_per_3, y_per_4, \ x1_damage, x1_critical_damage, x1_accuracy, x1_critical_hit, x1_sub, x1_per, \ x2_damage, x2_critical_damage, x2_accuracy, x2_critical_hit, x2_sub, x2_per, \ x3_damage, x3_critical_damage, x3_accuracy, x3_critical_hit, x3_sub, x3_per, \ y1_damage, y1_critical_damage, y1_accuracy, y1_critical_hit, y1_sub, y1_per, \ y2_damage, y2_critical_damage, y2_accuracy, y2_critical_hit, y2_sub, y2_per, \ y3_damage, y3_critical_damage, y3_accuracy, y3_critical_hit, y3_sub, y3_per) = clear # 破壊の遺伝子の混乱付与 if x_idenshi == 1: if gamemode == 0: x_konran = 256 else: x_konran = random.randint(2,5) if y_idenshi == 1: if gamemode == 0: y_konran = 256 else: y_konran = random.randint(2,5) ### 1ターン目 ### # 素早さの抽選(1) xx_speed, yy_speed = x_speed, y_speed # 素早さを初期化 if x_mahi == 1: # 麻痺なら素早さ1/4 xx_speed = x_trunc_speed if y_mahi == 1: yy_speed = y_trunc_speed if x_sensei == 1 and random.randint(1,256) <= 60: # 先制の爪の抽選 xx_speed += 1000 if y_sensei == 1 and random.randint(1,256) <= 60: yy_speed += 1000 if x_sub_1 == 31: # 優先度+1 xx_speed += 10000 elif x_sub_1 in (30,32): # カウンターorミラーコート・優先度-1 xx_speed -= 10000 elif x_sub_1 in (50,51): # 守る・堪える・優先度+2 xx_speed += 20000 if y_sub_1 == 31: yy_speed += 10000 elif y_sub_1 in (30,32): yy_speed -= 10000 elif y_sub_1 in (50,51): yy_speed += 20000 # HPの格納・手番の抽選 x_hp_1, y_hp_1 = x_hp, y_hp # HPの設定 # プレイヤー1の先制 if xx_speed > yy_speed or (xx_speed == yy_speed and random.randint(1,2) == 1): # 先攻 / プレイヤー1 if x_critical_hit_1 >= random.randint(1,256): # 急所の抽選 x_critical_1 = 1 if x_accuracy_1 < random.randint(1,256): # 命中率の抽選 x_bit_1 = 0 if x_koori == 1: # 凍り時の判定 x_bit_1 = 2 elif x_nemuri > 0: # 眠り時の判定 x_nemuri -= 1 if x_nemuri > 0: x_bit_1 = 2 if x_sub_1 == 29: # 寝言の判定 x_bit_1 = 3 elif x_nemuri == 0: # 起きたら悪夢を解除 x_akumu = 0 if x_meromero == 1 and x_bit_1 != 2 and random.randint(1,2) == 1: # メロメロ時の判定 x_bit_1 = 2 if x_mahi == 1 and x_bit_1 != 2 and random.randint(1,4) == 1: # 麻痺時の判定 x_bit_1 = 2 if x_konran > 0 and x_bit_1 != 2: # 混乱時の判定 x_konran -= 1 if random.randint(1,2) == 1 and x_konran > 0: if gamemode != 2 and x_yakedo == 0: # GB/N64は最大値 x_hp_1 -= x_konran_damage elif gamemode != 2 and x_yakedo == 1: x_hp_1 -= bx_konran_damage elif gamemode == 2 and x_yakedo == 0: x_hp_1 -= x_konran_damage * random.randint(217,255) // 255 elif gamemode == 2 and x_yakedo == 1: x_hp_1 -= bx_konran_damage * random.randint(217,255) // 255 x_bit_1 == 2 if x_hp_1 <= 0: # 自傷の瀕死判定 y_count_1 += 1 continue if x_sub_1 == 29 and x_bit_1 == 3: # 寝言の抽選 x_bit_1 = 1 if x_negoto_way == 2: rx_negoto = random.randint(1,2) elif x_negoto_way == 3: rx_negoto = random.randint(1,3) if rx_negoto == 1: x_damage_1, x_critical_damage_1, x_accuracy_1, x_critical_hit_1 = x1_damage, x1_critical_damage, x1_accuracy, x1_critical_hit x_sub_1, x_per_1 = x1_sub, x1_per elif rx_negoto == 2: x_damage_1, x_critical_damage_1, x_accuracy_1, x_critical_hit_1 = x2_damage, x2_critical_damage, x2_accuracy, x2_critical_hit x_sub_1, x_per_1 = x2_sub, x2_per elif rx_negoto == 3: x_damage_1, x_critical_damage_1, x_accuracy_1, x_critical_hit_1 = x3_damage, x3_critical_damage, x3_accuracy, x3_critical_hit x_sub_1, x_per_1 = x3_sub, x3_per if x_critical_hit_1 >= random.randint(1,256): # 急所の抽選 x_critical_1 = 1 if x_accuracy_1 < random.randint(1,256): # 命中率の抽選 x_bit_1 = 0 if x_bit_1 == 1 or x_sub_1 == 25: # 攻撃の判定 if x_critical_1 == 0 and x_yakedo == 0: rx_attack_1 = x_damage_1 * random.randint(217,255) // 255 elif x_critical_1 == 1 and x_yakedo == 0: rx_attack_1 = x_critical_damage_1 * random.randint(217,255) // 255 elif x_critical_1 == 0 and x_yakedo == 1: rx_attack_1 = bx_damage_1 * random.randint(217,255) // 255 elif x_critical_1 == 1 and x_yakedo == 1: rx_attack_1 = bx_critical_damage_1 * random.randint(217,255) // 255 if x_sub_1 >= 22 and x_bit_1 == 1: # 技の効果 if x_sub_1 == 22: # 怒りの前歯 rx_attack_1 = y_hp_1 // 2 elif x_sub_1 == 23: # 固定ダメージ rx_attack_1 = x_damage_1 elif x_sub_1 == 24: # プレゼント rx_gift = random.randint(1,10) if gamemode != 2 and rx_gift in (1,2): # GB/N64の回復 rx_attack_1 = -y_trunc_4 elif gamemode == 2 and rx_gift in (1,2): # PBSの回復 rx_attack_1 = -80 elif x_critical_1 == 0 and x_yakedo == 0: if rx_gift in (3,4,5,6): rx_attack_1 = x_g40 * random.randint(217,255) // 255 elif rx_gift in (7,8,9): rx_attack_1 = x_g80 * random.randint(217,255) // 255 elif rx_gift == 10: rx_attack_1 = x_g120 * random.randint(217,255) // 255 elif x_critical_1 == 1 and x_yakedo == 0: if rx_gift in (3,4,5,6): rx_attack_1 = x_cg40 * random.randint(217,255) // 255 elif rx_gift in (7,8,9): rx_attack_1 = x_cg80 * random.randint(217,255) // 255 elif rx_gift == 10: rx_attack_1 = x_cg120 * random.randint(217,255) // 255 elif x_critical_1 == 0 and x_yakedo == 1: if rx_gift in (3,4,5,6): rx_attack_1 = bx_g40 * random.randint(217,255) // 255 elif rx_gift in (7,8,9): rx_attack_1 = bx_g80 * random.randint(217,255) // 255 elif rx_gift == 10: rx_attack_1 = bx_g120 * random.randint(217,255) // 255 elif x_critical_1 == 1 and x_yakedo == 1: if rx_gift in (3,4,5,6): rx_attack_1 = bx_cg40 * random.randint(217,255) // 255 elif rx_gift in (7,8,9): rx_attack_1 = bx_cg80 * random.randint(217,255) // 255 elif rx_gift == 10: rx_attack_1 = bx_cg120 * random.randint(217,255) // 255 if y_hp_1 > y_max_hp: # 最大HPを超えない y_hp_1 = y_max_hp elif x_sub_1 == 27: # 1/2回復 rx_attack_1 = 0 x_hp_1 += x_trunc_2 if x_hp_1 > x_max_hp: # 最大HPを超えない x_hp_1 = x_max_hp elif x_sub_1 == 28: # 眠る rx_attack_1 = 0 if x_hp_1 < x_max_hp: # 最大HP未満なら回復 x_hp_1 = x_max_hp x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku = 3, 0, 0, 0, 0 # 2ターン眠り elif x_sub_1 == 30: # カウンターorミラーコート rx_attack_1 = 0 # 先制で失敗 elif x_sub_1 in (33,34,35): # 2-5連続攻撃 rx_attack_1 = 0 # ダメージの初期化 if x_sub_1 == 33: rx_renzoku = random.randint(1,8) if rx_renzoku in (1,2,3): x_renzoku = 2 elif rx_renzoku in (4,5,6): x_renzoku = 3 elif rx_renzoku == 7: x_renzoku = 4 elif rx_renzoku == 8: x_renzoku = 5 elif x_sub_1 in (34,35): # 2連続攻撃 x_renzoku = 2 if x_sub_1 == 35 and random.randint(1,256) <= 51 and not any([y_koori, y_nemuri, y_mahi, y_yakedo, y_moudoku]): y_doku = 1 # ダブルニードル for _ in range(x_renzoku): # ダメージ累計 x_critical_1 = 0 # 急所の初期化 if x_critical_hit_1 >= random.randint(1,256): # 急所の抽選 x_critical_1 = 1 if x_critical_1 == 0 and x_yakedo == 0: x_renzoku_damage = x_damage_1 * random.randint(217,255) // 255 elif x_critical_1 == 1 and x_yakedo == 0: x_renzoku_damage = x_critical_damage_1 * random.randint(217,255) // 255 elif x_critical_1 == 0 and x_yakedo == 1: x_renzoku_damage = bx_damage_1 * random.randint(217,255) // 255 elif x_critical_1 == 1 and x_yakedo == 1: x_renzoku_damage = bx_critical_damage_1 * random.randint(217,255) // 255 rx_attack_1 += x_renzoku_damage elif x_sub_1 == 36: # トリプルキック times = 2 # ダメージ倍率 x_renzoku = 0 if x_accuracy_1 >= random.randint(1,256): # 2回目の抽選 x_renzoku = 1 if gamemode == 2: # 後攻への乗算バグ(PBS) y_triple_pbs_1 = 2 if x_accuracy_1 >= random.randint(1,256): # 3回目の抽選 x_renzoku = 2 if gamemode == 2: y_triple_pbs_1 = 3 for _ in range(x_renzoku): # ダメージ累計 x_critical_1 = 0 # 急所の初期化 if x_critical_hit_1 >= random.randint(1,256): x_critical_1 = 1 if x_critical_1 == 0 and x_yakedo == 0: x_triple_kick = x_damage_1 * times * random.randint(217,255) // 255 elif x_critical_1 == 1 and x_yakedo == 0: x_triple_kick = x_critical_damage_1 * times * random.randint(217,255) // 255 elif x_critical_1 == 0 and x_yakedo == 1: x_triple_kick = bx_damage_1 * times * random.randint(217,255) // 255 elif x_critical_1 == 1 and x_yakedo == 1: x_triple_kick = bx_critical_damage_1 * times * random.randint(217,255) // 255 times += 1 rx_attack_1 += x_triple_kick elif x_sub_1 == 37 and x_level > 0: # サイコウェーブ rx_attack_1 = random.randint(1,rx_psycho_wave) elif x_sub_1 == 38: # 未来予知 rx_attack_1 = 0 elif x_sub_1 == 39: # じたばた if 1 <= x_hp <= x_flail_2: # 威力の決定 rx_attack_1 = x_f200 if x_yakedo == 0 else bx_f200 elif x_flail_2 + 1 <= x_hp <= x_flail_5: rx_attack_1 = x_f150 if x_yakedo == 0 else bx_f150 elif x_flail_5 + 1 <= x_hp <= x_flail_10: rx_attack_1 = x_f100 if x_yakedo == 0 else bx_f100 elif x_flail_10 + 1 <= x_hp <= x_flail_17: rx_attack_1 = x_f80 if x_yakedo == 0 else bx_f80 elif gamemode != 2 and x_flail_17 + 1 <= x_hp <= x_flail_33: rx_attack_1 = x_f40 if x_yakedo == 0 else bx_f40 elif gamemode == 2 and x_flail_17 + 1 <= x_hp <= x_flail_pbs: # PBS(40) rx_attack_1 = x_f40 if x_yakedo == 0 else bx_f40 elif gamemode != 2 and x_flail_33 + 1 <= x_hp <= x_max_hp: rx_attack_1 = x_f20 if x_yakedo == 0 else bx_f20 elif gamemode == 2 and x_flail_pbs + 1 <= x_hp <= x_max_hp: # PBS(20) rx_attack_1 = x_f20 if x_yakedo == 0 else bx_f20 elif x_sub_1 in (40,41): if x_sub_1 == 40: # 転がる times = 2 ** (x_korogaru + x_marukunaru - 1) elif x_sub_1 == 41: # 連続斬り times = 2 ** (x_renzokugiri - 1) if x_critical_1 == 0 and x_yakedo == 0: rx_attack_1 = x_damage_1 * times * random.randint(217,255) // 255 elif x_critical_1 == 1 and x_yakedo == 0: rx_attack_1 = x_critical_damage_1 * times * random.randint(217,255) // 255 elif x_critical_1 == 0 and x_yakedo == 1: rx_attack_1 = bx_damage_1 * times * random.randint(217,255) // 255 elif x_critical_1 == 1 and x_yakedo == 1: rx_attack_1 = bx_critical_damage_1 * times * random.randint(217,255) // 255 elif x_sub_1 == 42: # 痛み分け pain_split = (x_hp_1 + y_hp_1) // 2 x_hp_1 = y_hp_1 = pain_split if x_hp_1 > x_max_hp: # 最大HPを超えない x_hp_1 = x_max_hp if y_hp_1 > y_max_hp: y_hp_1 = y_max_hp elif x_sub_1 in (50,51): # 守る・堪える, 後攻で処理 rx_attack_1 = 0 elif x_sub_1 == 60 and random.randint(1,256) <= x_per_1: # 素早さダウン x_speed_ph += 1 if x_speed_ph == 1: y_speed = y_speed_ph1 elif x_sub_1 == 61 and random.randint(1,256) <= x_per_1: # 命中率ダウン x_accuracy_ph += 1 if x_accuracy_ph == 1: y_accuracy_1, y_accuracy_2, y_accuracy_3, y_accuracy_4 = y_accuracy_1_ph1, y_accuracy_2_ph1, y_accuracy_3_ph1, y_accuracy_4_ph1 y1_accuracy, y2_accuracy, y3_accuracy = y1_accuracy_ph1, y2_accuracy_ph1, y3_accuracy_ph1 elif x_sub_1 in (62,63): # 防御or特防ダウン if x_sub_1 == 62 and random.randint(1,256) <= x_per_1: x_bd_ph += 1 elif x_sub_1 == 63: # 防御or特防-2 x_bd_ph += 2 if x_bd_ph == 1: x_damage_2, x_damage_3, x_damage_4 = x_damage_2_ph1, x_damage_3_ph1, x_damage_4_ph1 x_critical_damage_2, x_critical_damage_3, x_critical_damage_4 = x_critical_damage_2_ph1, x_critical_damage_3_ph1, x_critical_damage_4_ph1 bx_damage_2, bx_damage_3, bx_damage_4 = bx_damage_2_ph1, bx_damage_3_ph1, bx_damage_4_ph1 bx_critical_damage_2, bx_critical_damage_3, bx_critical_damage_4 = bx_critical_damage_2_ph1, bx_critical_damage_3_ph1, bx_critical_damage_4_ph1 x1_damage, x2_damage, x3_damage = x1_damage_ph1, x2_damage_ph1, x3_damage_ph1 x1_critical_damage, x2_critical_damage, x3_critical_damage = x1_critical_damage_ph1, x2_critical_damage_ph1, x3_critical_damage_ph1 y_konran_damage, by_konran_damage = y_konran_damage_ph1, by_konran_damage_ph1 elif x_bd_ph == 2: x_damage_2, x_damage_3, x_damage_4 = x_damage_2_ph2, x_damage_3_ph2, x_damage_4_ph2 x_critical_damage_2, x_critical_damage_3, x_critical_damage_4 = x_critical_damage_2_ph2, x_critical_damage_3_ph2, x_critical_damage_4_ph2 bx_damage_2, bx_damage_3, bx_damage_4 = bx_damage_2_ph2, bx_damage_3_ph2, bx_damage_4_ph2 bx_critical_damage_2, bx_critical_damage_3, bx_critical_damage_4 = bx_critical_damage_2_ph2, bx_critical_damage_3_ph2, bx_critical_damage_4_ph2 x1_damage, x2_damage, x3_damage = x1_damage_ph2, x2_damage_ph2, x3_damage_ph2 x1_critical_damage, x2_critical_damage, x3_critical_damage = x1_critical_damage_ph2, x2_critical_damage_ph2, x3_critical_damage_ph2 y_konran_damage, by_konran_damage = y_konran_damage_ph2, by_konran_damage_ph2 if x_bit_1 == 1: # ダメージの判定 y_hp_1 -= rx_attack_1 if x_sub_1 == 20: # 攻撃の反動ダメージ x_hp_1 -= rx_attack_1 // 4 elif x_sub_1 == 21: # HPドレイン x_hp_1 += rx_attack_1 // 2 if x_hp_1 > x_max_hp: # 最大HPを超えない x_hp_1 = x_max_hp if x_ouja_1 == 1 and random.randint(1,256) <= 30: # 先攻のみ王者の抽選 y_hirumi = 1 if y_hachimaki == 1 and y_hp_1 <= 0 and random.randint(1,256) <= 30: # 鉢巻の抽選 y_hp_1 = 1 if y_hp_1 <= 0: # 相手の瀕死判定 x_count_1 += 1 continue elif x_hp_1 <= 0: # 自分の瀕死判定 y_count_1 += 1 continue elif x_sub_1 == 25 and x_bit_1 == 0: # 飛び蹴りの自傷 if gamemode != 2: # GB/N64 x_hp_1 -= rx_attack_1 // 8 elif gamemode == 2: # PBS x_hp_1 -= rx_attack_1 // 4 if x_hp_1 <= 0: # 自分の瀕死判定 y_count_1 += 1 continue if x_hirumi == 1: # 怯みの解除 x_hirumi = 0 # 追加効果の抽選 if x_bit_1 == 1 and 0 < x_sub_1 <= 13: if x_sub_1 == 1: # 怯みの付与 if random.randint(1,256) <= x_per_1: y_hirumi = 1 elif x_sub_1 == 2: # 凍りの付与 if random.randint(1,256) <= x_per_1 and not any([y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku]): y_koori = 1 if y_yaketa == y_stock == 1: # 焼けた木の実 y_koori, y_stock = 0, 0 elif x_sub_1 == 3: # 眠りの付与 if not any([y_koori, y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku]): if gamemode == 0: # GB y_nemuri = random.randint(2,7) elif gamemode == 1: # N64 y_nemuri = random.randint(2,4) elif gamemode == 2: # PBS y_nemuri = random.randint(2,5) if y_hakka == y_stock == 1: # 薄荷の実 y_nemuri, y_stock = 0, 0 elif x_sub_1 == 4: # 混乱の付与 if random.randint(1,256) <= x_per_1 and y_konran == 0: y_konran = random.randint(2,5) if y_nigai == y_stock == 1: # 苦い木の実 y_konran, y_stock = 0, 0 elif x_sub_1 == 5: # メロメロの付与 y_meromero = 1 elif x_sub_1 == 6: # 麻痺の付与 if random.randint(1,256) <= x_per_1 and not any([y_koori, y_nemuri, y_doku, y_yakedo, y_moudoku]): y_mahi = 1 if y_mahinaoshi == y_stock == 1: # 麻痺治しの実 y_mahi, y_stock = 0, 0 elif x_sub_1 == 7: # 毒の付与 if random.randint(1,256) <= x_per_1 and not any([y_koori, y_nemuri, y_mahi, y_yakedo, y_moudoku]): y_doku = 1 if y_dokukeshi == y_stock == 1: # 毒消しの実 y_doku, y_stock = 0, 0 elif x_sub_1 == 8: # 火傷の付与 if random.randint(1,256) <= x_per_1 and not any([y_koori, y_nemuri, y_mahi, y_doku, y_moudoku]): y_yakedo = 1 if y_kootta == y_stock == 1: # 凍った木の実 y_yakedo, y_stock = 0, 0 elif x_sub_1 == 9: # 猛毒の付与 if not any([y_koori, y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku]): y_moudoku = 1 if y_dokukeshi == y_stock == 1: # 毒消しの実 y_moudoku, y_stock = 0, 0 elif x_sub_1 == 10: # 宿り木の付与 y_yadorigi = 1 elif x_sub_1 == 11 and (y_nemuri > 0): # 悪夢の付与 y_akumu = 1 elif x_sub_1 == 12: # 呪いの付与 y_noroi = 1 x_hp_1 -= x_trunc_2 if x_hp_1 <= 0: # 自分の瀕死判定 y_count_1 += 1 continue elif x_sub_1 == 13 and random.randint(1,256) <= 51: # トライアタックの付与(凍り・麻痺・火傷) rx_tri_attack = random.randint(1,3) if rx_tri_attack == 1: # 凍りの付与 if not any([y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku]): y_koori = 1 if y_yaketa == y_stock == 1: # 焼けた木の実 y_koori, y_stock = 0, 0 elif rx_tri_attack == 2: # 麻痺の付与 if not any([y_koori, y_nemuri, y_doku, y_yakedo, y_moudoku]): y_mahi = 1 if y_mahinaoshi == y_stock == 1: # 麻痺治しの実 y_mahi, y_stock = 0, 0 elif rx_tri_attack == 3: # 火傷の付与 if not any([y_koori, y_nemuri, y_mahi, y_doku, y_moudoku]): y_yakedo = 1 if y_kootta == y_stock == 1: # 凍った木の実 y_yakedo, y_stock = 0, 0 elif y_koori == 1: # 相手が凍りなら火傷で解除 y_koori = 0 if y_kiseki == y_stock == 1 and any([y_koori, y_nemuri, y_konran, y_mahi, y_doku, y_yakedo, y_moudoku]): # 奇跡の実 y_koori, y_nemuri, y_konran, y_mahi, y_doku, y_yakedo, y_moudoku, y_stock = 0, 0, 0, 0, 0, 0, 0, 0 # 自分のターン終了時(1A) if x_doku == 1: # 毒 x_hp_1 -= x_trunc_8 elif x_yakedo == 1: # 火傷 x_hp_1 -= x_trunc_8 elif x_moudoku > 0: # 猛毒 x_hp_1 -= x_trunc_16 * x_moudoku x_moudoku += 1 if x_yadorigi == 1: # 宿り木の種 x_hp_1 -= x_trunc_8 y_hp_1 += x_trunc_8 if y_hp_1 > y_max_hp: y_hp_1 = y_max_hp if x_akumu == 1 and x_nemuri > 0: # 悪夢 x_hp_1 -= x_trunc_4 if x_noroi == 1: # 呪い x_hp_1 -= x_trunc_4 if x_hp_1 <= 0: # 自分の瀕死判定 y_count_1 += 1 continue # 後攻 / プレイヤー2 if y_critical_hit_1 >= random.randint(1,256): # 急所の抽選 y_critical_1 = 1 if y_accuracy_1 < random.randint(1,256): # 命中率の抽選 y_bit_1 = 0 if y_hirumi == 1 and gamemode == 2: # 怯み時の判定(PBS) y_bit_1 = 2 if y_koori == 1: # 凍り時の判定 y_bit_1 = 2 elif y_nemuri > 0 and y_bit_1 != 2: # 眠り時の判定 y_nemuri -= 1 if y_nemuri > 0: y_bit_1 = 2 if y_sub_1 == 29: # 寝言の判定 y_bit_1 = 3 elif y_nemuri == 0: # 起きたら悪夢を解除 y_akumu = 0 if y_hirumi == 1 and gamemode != 2: # 怯み時の判定(GB/N64) y_bit_1 = 2 if y_meromero == 1 and y_bit_1 != 2 and random.randint(1,2) == 1: # メロメロ時の判定 y_bit_1 = 2 if y_mahi == 1 and y_bit_1 != 2 and random.randint(1,4) == 1: # 麻痺時の判定 y_bit_1 = 2 if y_konran > 0 and y_bit_1 != 2: # 混乱時の判定 y_konran -= 1 if random.randint(1,2) == 1 and y_konran > 0: if gamemode != 2 and y_yakedo == 0: # GB/N64は最大値 y_hp_1 -= y_konran_damage elif gamemode != 2 and y_yakedo == 1: y_hp_1 -= by_konran_damage elif gamemode == 2 and y_yakedo == 0: y_hp_1 -= y_konran_damage * random.randint(217,255) // 255 elif gamemode == 2 and y_yakedo == 1: y_hp_1 -= by_konran_damage * random.randint(217,255) // 255 y_bit_1 = 2 if y_hp_1 <= 0: # 自傷の瀕死判定 x_count_1 += 1 continue if y_sub_1 == 29 and y_bit_1 == 3: # 寝言の抽選 y_bit_1 = 1 if y_negoto_way == 2: ry_negoto = random.randint(1,2) elif y_negoto_way == 3: ry_negoto = random.randint(1,3) if ry_negoto == 1: y_damage_1, y_critical_damage_1, y_accuracy_1, y_critical_hit_1 = y1_damage, y1_critical_damage, y1_accuracy, y1_critical_hit y_sub_1, y_per_1 = y1_sub, y1_per elif ry_negoto == 2: y_damage_1, y_critical_damage_1, y_accuracy_1, y_critical_hit_1 = y2_damage, y2_critical_damage, y2_accuracy, y2_critical_hit y_sub_1, y_per_1 = y2_sub, y2_per elif ry_negoto == 3: y_damage_1, y_critical_damage_1, y_accuracy_1, y_critical_hit_1 = y3_damage, y3_critical_damage, y3_accuracy, y3_critical_hit y_sub_1, y_per_1 = y3_sub, y3_per if y_critical_hit_1 >= random.randint(1,256): # 急所の抽選 y_critical_1 = 1 if y_accuracy_1 < random.randint(1,256): # 命中率の抽選 y_bit_1 = 0 if x_sub_1 in (50,51): # 先攻の守る・堪える rx_protect = (1/2 ** (x_protect - 1) * 256 - 1/256) // 1 if x_bit_1 != 2 and (rx_protect >= random.randint(1,256) or (gamemode == 2 and x_protect == 1)): # 1ターン目は必ず成功(PBS) x_protect += 1 if x_sub_1 == 50 and not y_sub_1 in (11,12,27,28,38): # 守る # 悪夢・呪い・回復・未来予知は有効 y_bit_1 = 0 else: x_protect = 1 if y_bit_1 == 1 or y_sub_1 == 25: # 攻撃の判定 if y_critical_1 == 0 and y_yakedo == 0: ry_attack_1 = y_damage_1 * y_triple_pbs_1 * random.randint(217,255) // 255 elif y_critical_1 == 1 and y_yakedo == 0: ry_attack_1 = y_critical_damage_1 * y_triple_pbs_1 * random.randint(217,255) // 255 elif y_critical_1 == 0 and y_yakedo == 1: ry_attack_1 = by_damage_1 * y_triple_pbs_1 * random.randint(217,255) // 255 elif y_critical_1 == 1 and y_yakedo == 1: ry_attack_1 = by_critical_damage_1 * y_triple_pbs_1 * random.randint(217,255) // 255 if y_sub_1 >= 22 and y_bit_1 == 1: # 技の効果 if y_sub_1 == 22: # 怒りの前歯 ry_attack_1 = x_hp_1 // 2 elif y_sub_1 == 23: # 固定ダメージ ry_attack_1 = y_damage_1 elif y_sub_1 == 24: # プレゼント ry_gift = random.randint(1,10) if gamemode != 2 and ry_gift in (1,2): # GB/N64の回復 ry_attack_1 = -x_trunc_4 elif gamemode == 2 and ry_gift in (1,2): # PBSの回復 ry_attack_1 = -80 elif y_critical_1 == 0 and y_yakedo == 0: if ry_gift in (3,4,5,6): ry_attack_1 = y_g40 * y_triple_pbs_1 * random.randint(217,255) // 255 elif ry_gift in (7,8,9): ry_attack_1 = y_g80 * y_triple_pbs_1 * random.randint(217,255) // 255 elif ry_gift == 10: ry_attack_1 = y_g120 * y_triple_pbs_1 * random.randint(217,255) // 255 elif y_critical_1 == 1 and y_yakedo == 0: if ry_gift in (3,4,5,6): ry_attack_1 = y_cg40 * y_triple_pbs_1 * random.randint(217,255) // 255 elif ry_gift in (7,8,9): ry_attack_1 = y_cg80 * y_triple_pbs_1 * random.randint(217,255) // 255 elif ry_gift == 10: ry_attack_1 = y_cg120 * y_triple_pbs_1 * random.randint(217,255) // 255 elif y_critical_1 == 0 and y_yakedo == 1: if ry_gift in (3,4,5,6): ry_attack_1 = by_g40 * y_triple_pbs_1 * random.randint(217,255) // 255 elif ry_gift in (7,8,9): ry_attack_1 = by_g80 * y_triple_pbs_1 * random.randint(217,255) // 255 elif ry_gift == 10: ry_attack_1 = by_g120 * y_triple_pbs_1 * random.randint(217,255) // 255 elif y_critical_1 == 1 and y_yakedo == 1: if ry_gift in (3,4,5,6): ry_attack_1 = by_cg40 * y_triple_pbs_1 * random.randint(217,255) // 255 elif ry_gift in (7,8,9): ry_attack_1 = by_cg80 * y_triple_pbs_1 * random.randint(217,255) // 255 elif ry_gift == 10: ry_attack_1 = by_cg120 * y_triple_pbs_1 * random.randint(217,255) // 255 if x_hp_1 > x_max_hp: # 最大HPを超えない x_hp_1 = x_max_hp elif y_sub_1 == 27: # 1/2回復 ry_attack_1 = 0 y_hp_1 += y_trunc_2 if y_hp_1 > y_max_hp: # 最大HPを超えない y_hp_1 = y_max_hp elif y_sub_1 == 28: # 眠る ry_attack_1 = 0 if y_hp_1 < y_max_hp: # 最大HP未満なら回復 y_hp_1 = y_max_hp y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku = 3, 0, 0, 0, 0 # 2ターン眠り elif y_sub_1 == 30: # カウンターorミラーコート ry_attack_1 = rx_attack_1 * 2 if 999 <= x_damage_1 and x_bit_1 == 0 and gamemode == 0: # 一撃外れをカウンター(GB) ry_attack_1 = x_max_hp elif y_sub_1 in (33,34,35): # 2-5連続攻撃 ry_attack_1 = 0 # ダメージの初期化 if y_sub_1 == 33: ry_renzoku = random.randint(1,8) if ry_renzoku in (1,2,3): y_renzoku = 2 elif ry_renzoku in (4,5,6): y_renzoku = 3 elif ry_renzoku == 7: y_renzoku = 4 elif ry_renzoku == 8: y_renzoku = 5 elif y_sub_1 in (34,35): # 2連続攻撃 y_renzoku = 2 if y_sub_1 == 35 and random.randint(1,256) <= 51 and not any([x_koori, x_nemuri, x_mahi, x_yakedo, x_moudoku]): x_doku = 1 # ダブルニードル for _ in range(y_renzoku): # ダメージ累計 y_critical_1 = 0 # 急所の初期化 if y_critical_hit_1 >= random.randint(1,256): # 急所の抽選 y_critical_1 = 1 if y_critical_1 == 0 and y_yakedo == 0: y_renzoku_damage = y_damage_1 * y_triple_pbs_1 * random.randint(217,255) // 255 elif y_critical_1 == 1 and y_yakedo == 0: y_renzoku_damage = y_critical_damage_1 * y_triple_pbs_1 * random.randint(217,255) // 255 elif y_critical_1 == 0 and y_yakedo == 1: y_renzoku_damage = by_damage_1 * y_triple_pbs_1 * random.randint(217,255) // 255 elif y_critical_1 == 1 and y_yakedo == 1: y_renzoku_damage = by_critical_damage_1 * y_triple_pbs_1 * random.randint(217,255) // 255 ry_attack_1 += y_renzoku_damage elif y_sub_1 == 36: # トリプルキック times = 2 # ダメージ倍率 y_renzoku = 0 if y_accuracy_1 >= random.randint(1,256): # 2回目の抽選 y_renzoku = 1 if y_accuracy_1 >= random.randint(1,256): # 3回目の抽選 y_renzoku = 2 for _ in range(y_renzoku): # ダメージ累計 y_critical_1 = 0 # 急所の初期化 if y_critical_hit_1 >= random.randint(1,256): y_critical_1 = 1 if y_critical_1 == 0 and y_yakedo == 0: y_triple_kick = y_damage_1 * times * random.randint(217,255) // 255 elif y_critical_1 == 1 and y_yakedo == 0: y_triple_kick = y_critical_damage_1 * times * random.randint(217,255) // 255 elif y_critical_1 == 0 and y_yakedo == 1: y_triple_kick = by_damage_1 * times * random.randint(217,255) // 255 elif y_critical_1 == 1 and y_yakedo == 1: y_triple_kick = by_critical_damage_1 * times * random.randint(217,255) // 255 times += 1 ry_attack_1 += y_triple_kick elif y_sub_1 == 37 and y_level > 0: # サイコウェーブ ry_attack_1 = random.randint(1,ry_psycho_wave) elif y_sub_1 == 38: # 未来予知 ry_attack_1 = 0 elif y_sub_1 == 39: # じたばた if 1 <= y_hp <= y_flail_2: # 威力の決定 ry_attack_1 = y_f200 if y_yakedo == 0 else by_f200 elif y_flail_2 + 1 <= y_hp <= y_flail_5: ry_attack_1 = y_f150 if y_yakedo == 0 else by_f150 elif y_flail_5 + 1 <= y_hp <= y_flail_10: ry_attack_1 = y_f100 if y_yakedo == 0 else by_f100 elif y_flail_10 + 1 <= y_hp <= y_flail_17: ry_attack_1 = y_f80 if y_yakedo == 0 else by_f80 elif gamemode != 2 and y_flail_17 + 1 <= y_hp <= y_flail_33: ry_attack_1 = y_f40 if y_yakedo == 0 else by_f40 elif gamemode == 2 and y_flail_17 + 1 <= y_hp <= y_flail_pbs: # PBS(40) ry_attack_1 = y_f40 if y_yakedo == 0 else by_f40 elif gamemode != 2 and y_flail_33 + 1 <= y_hp <= y_max_hp: ry_attack_1 = y_f20 if y_yakedo == 0 else by_f20 elif gamemode == 2 and y_flail_pbs + 1 <= y_hp <= y_max_hp: # PBS(20) ry_attack_1 = y_f20 if y_yakedo == 0 else by_f20 if gamemode == 2: # 最高乱数+1ダメージ(PBS) ry_attack_1 = ry_attack_1 * y_triple_pbs_1 + 1 elif y_sub_1 in (40,41): if y_sub_1 == 40: # 転がる times = 2 ** (y_korogaru + y_marukunaru - 1) elif y_sub_1 == 41: # 連続斬り times = 2 ** (y_renzokugiri - 1) if y_critical_1 == 0 and y_yakedo == 0: ry_attack_1 = y_damage_1 * times * random.randint(217,255) // 255 elif y_critical_1 == 1 and y_yakedo == 0: ry_attack_1 = y_critical_damage_1 * times * random.randint(217,255) // 255 elif y_critical_1 == 0 and y_yakedo == 1: ry_attack_1 = by_damage_1 * times * random.randint(217,255) // 255 elif y_critical_1 == 1 and y_yakedo == 1: ry_attack_1 = by_critical_damage_1 * times * random.randint(217,255) // 255 elif y_sub_1 == 42: # 痛み分け pain_split = (y_hp_1 + x_hp_1) // 2 y_hp_1 = x_hp_1 = pain_split if y_hp_1 > y_max_hp: # 最大HPを超えない y_hp_1 = y_max_hp if x_hp_1 > x_max_hp: x_hp_1 = x_max_hp elif y_sub_1 in (50,51): # 守る・堪える, 後攻は失敗 ry_attack_1, y_protect = 0, 1 elif y_sub_1 == 60 and random.randint(1,256) <= y_per_1: # 素早さダウン y_speed_ph += 1 if y_speed_ph == 1: x_speed = x_speed_ph1 elif y_sub_1 == 61 and random.randint(1,256) <= y_per_1: # 命中率ダウン y_accuracy_ph += 1 if y_accuracy_ph == 1: x_accuracy_2, x_accuracy_3, x_accuracy_4 = x_accuracy_2_ph1, x_accuracy_3_ph1, x_accuracy_4_ph1 x1_accuracy, x2_accuracy, x3_accuracy = x1_accuracy_ph1, x2_accuracy_ph1, x3_accuracy_ph1 elif y_sub_1 in (62,63): # 防御or特防ダウン if y_sub_1 == 62 and random.randint(1,256) <= y_per_1: y_bd_ph += 1 elif y_sub_1 == 63: # 防御or特防-2 y_bd_ph += 2 if y_bd_ph == 1: y_damage_2, y_damage_3, y_damage_4 = y_damage_2_ph1, y_damage_3_ph1, y_damage_4_ph1 y_critical_damage_2, y_critical_damage_3, y_critical_damage_4 = y_critical_damage_2_ph1, y_critical_damage_3_ph1, y_critical_damage_4_ph1 by_damage_2, by_damage_3, by_damage_4 = by_damage_2_ph1, by_damage_3_ph1, by_damage_4_ph1 by_critical_damage_2, by_critical_damage_3, by_critical_damage_4 = by_critical_damage_2_ph1, by_critical_damage_3_ph1, by_critical_damage_4_ph1 y1_damage, y2_damage, y3_damage = y1_damage_ph1, y2_damage_ph1, y3_damage_ph1 y1_critical_damage, y2_critical_damage, y3_critical_damage = y1_critical_damage_ph1, y2_critical_damage_ph1, y3_critical_damage_ph1 x_konran_damage, bx_konran_damage = x_konran_damage_ph1, bx_konran_damage_ph1 elif y_bd_ph == 2: y_damage_2, y_damage_3, y_damage_4 = y_damage_2_ph2, y_damage_3_ph2, y_damage_4_ph2 y_critical_damage_2, y_critical_damage_3, y_critical_damage_4 = y_critical_damage_2_ph2, y_critical_damage_3_ph2, y_critical_damage_4_ph2 by_damage_2, by_damage_3, by_damage_4 = by_damage_2_ph2, by_damage_3_ph2, by_damage_4_ph2 by_critical_damage_2, by_critical_damage_3, by_critical_damage_4 = by_critical_damage_2_ph2, by_critical_damage_3_ph2, by_critical_damage_4_ph2 y1_damage, y2_damage, y3_damage = y1_damage_ph2, y2_damage_ph2, y3_damage_ph2 y1_critical_damage, y2_critical_damage, y3_critical_damage = y1_critical_damage_ph2, y2_critical_damage_ph2, y3_critical_damage_ph2 x_konran_damage, bx_konran_damage = x_konran_damage_ph2, bx_konran_damage_ph2 if y_bit_1 == 1: # ダメージの判定 x_hp_1 -= ry_attack_1 if y_sub_1 == 20: # 攻撃の反動ダメージ y_hp_1 -= ry_attack_1 // 4 elif y_sub_1 == 21: # HPドレイン y_hp_1 += ry_attack_1 // 2 if y_hp_1 > y_max_hp: # 最大HPを超えない y_hp_1 = y_max_hp if x_sub_1 == 51 and x_hp_1 <= 0 and x_protect > 1 and x_bit_1 == 1: # 堪える x_hp_1 = 1 if x_hachimaki == 1 and x_hp_1 <= 0 and random.randint(1,256) <= 30: # 鉢巻の抽選 x_hp_1 = 1 if x_hp_1 <= 0: # 相手の瀕死判定 y_count_1 += 1 continue elif y_hp_1 <= 0: # 自分の瀕死判定 x_count_1 += 1 continue elif y_sub_1 == 25 and y_bit_1 == 0: # 飛び蹴りの自傷 if gamemode != 2: # GB/N64 y_hp_1 -= ry_attack_1 // 8 elif gamemode == 2: # PBS y_hp_1 -= ry_attack_1 // 4 if y_hp_1 <= 0: # 自分の瀕死判定 x_count_1 += 1 continue if y_hirumi == 1: # 怯みの解除 y_hirumi = 0 # 追加効果の抽選 if y_bit_1 == 1 and 0 < y_sub_1 <= 13: # 先攻は怯まない if y_sub_1 == 2: # 凍りの付与 if random.randint(1,256) <= y_per_1 and not any([x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku]): x_koori = 1 if x_yaketa == x_stock == 1: # 焼けた木の実 x_koori, x_stock = 0, 0 elif y_sub_1 == 3: # 眠りの付与 if not any([x_koori, x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku]): if gamemode == 0: # GB x_nemuri = random.randint(2,7) elif gamemode == 1: # N64 x_nemuri = random.randint(2,4) elif gamemode == 2: # PBS x_nemuri = random.randint(2,5) if x_hakka == x_stock == 1: # 薄荷の実 x_nemuri, x_stock = 0, 0 elif y_sub_1 == 4: # 混乱の付与 if random.randint(1,256) <= y_per_1 and x_konran == 0: x_konran = random.randint(2,5) if x_nigai == x_stock == 1: # 苦い木の実 x_konran, x_stock = 0, 0 elif y_sub_1 == 5: # メロメロの付与 x_meromero = 1 elif y_sub_1 == 6: # 麻痺の付与 if random.randint(1,256) <= y_per_1 and not any([x_koori, x_nemuri, x_doku, x_yakedo, x_moudoku]): x_mahi = 1 if x_mahinaoshi == x_stock == 1: # 麻痺治しの実 x_mahi, x_stock = 0, 0 elif y_sub_1 == 7: # 毒の付与 if random.randint(1,256) <= y_per_1 and not any([x_koori, x_nemuri, x_mahi, x_yakedo, x_moudoku]): x_doku = 1 if x_dokukeshi == x_stock == 1: # 毒消しの実 x_doku, x_stock = 0, 0 elif y_sub_1 == 8: # 火傷の付与 if random.randint(1,256) <= y_per_1 and not any([x_koori, x_nemuri, x_mahi, x_doku, x_moudoku]): x_yakedo = 1 if x_kootta == x_stock == 1: # 凍った木の実 x_yakedo, x_stock = 0, 0 elif y_sub_1 == 9: # 猛毒の付与 if not any([x_koori, x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku]): x_moudoku = 1 if x_dokukeshi == x_stock == 1: # 毒消しの実 x_moudoku, x_stock = 0, 0 elif y_sub_1 == 10: # 宿り木の付与 x_yadorigi = 1 elif y_sub_1 == 11 and (x_nemuri > 0): # 悪夢の付与 x_akumu = 1 elif y_sub_1 == 12: # 呪いの付与 x_noroi = 1 y_hp_1 -= y_trunc_2 if y_hp_1 <= 0: # 自分の瀕死判定 x_count_1 += 1 continue elif y_sub_1 == 13 and random.randint(1,256) <= 51: # トライアタックの付与(凍り・麻痺・火傷) ry_tri_attack = random.randint(1,3) if ry_tri_attack == 1: # 凍りの付与 if not any([x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku]): x_koori = 1 if x_yaketa == x_stock == 1: # 焼けた木の実 x_koori, x_stock = 0, 0 elif ry_tri_attack == 2: # 麻痺の付与 if not any([x_koori, x_nemuri, x_doku, x_yakedo, x_moudoku]): x_mahi = 1 if x_mahinaoshi == x_stock == 1: # 麻痺治しの実 x_mahi, x_stock = 0, 0 elif ry_tri_attack == 3: # 火傷の付与 if not any([x_koori, x_nemuri, x_mahi, x_doku, x_moudoku]): x_yakedo = 1 if x_kootta == x_stock == 1: # 凍った木の実 x_yakedo, x_stock = 0, 0 elif x_koori == 1: # 相手が凍りなら火傷で解除 x_koori = 0 if x_kiseki == x_stock == 1 and any([x_koori, x_nemuri, x_konran, x_mahi, x_doku, x_yakedo, x_moudoku]): # 奇跡の実 x_koori, x_nemuri, x_konran, x_mahi, x_doku, x_yakedo, x_moudoku, x_stock = 0, 0, 0, 0, 0, 0, 0, 0 # 自分のターン終了時(1A) if y_doku == 1: # 毒 y_hp_1 -= y_trunc_8 elif y_yakedo == 1: # 火傷 y_hp_1 -= y_trunc_8 elif y_moudoku > 0: # 猛毒 y_hp_1 -= y_trunc_16 * y_moudoku y_moudoku += 1 if y_yadorigi == 1: # 宿り木の種 y_hp_1 -= y_trunc_8 x_hp_1 += y_trunc_8 if x_hp_1 > x_max_hp: x_hp_1 = x_max_hp if y_akumu == 1 and y_nemuri > 0: # 悪夢 y_hp_1 -= y_trunc_4 if y_noroi == 1: # 呪い y_hp_1 -= y_trunc_4 if y_hp_1 <= 0: # 自分の瀕死判定 x_count_1 += 1 continue # 全体のターン終了時(1A) if y_mirai_1 == 1 and random.randint(1,256) <= y_mirai_accuracy_1: # 未来予知の判定 x_hp_1 -= y_mirai_damage_1 * random.randint(217,255) // 255 if x_hp_1 <= 0: # 行動順で瀕死の判定 y_count_1 += 1 continue if x_mirai_1 == 1 and random.randint(1,256) <= x_mirai_accuracy_1: y_hp_1 -= x_mirai_damage_1 * random.randint(217,255) // 255 if y_hp_1 <= 0: x_count_1 += 1 continue if suna_1 == 1: # 砂嵐の判定 if x_suna == 1: # 行動順で瀕死の判定 x_hp_1 -= x_trunc_8 if x_hp_1 <= 0: y_count_1 += 1 continue if y_suna == 1: y_hp_1 -= y_trunc_8 if y_hp_1 <= 0: x_count_1 += 1 continue if x_tabenokoshi == 1 and x_hp_1 > 0: # 食べ残しの回復 x_hp_1 += x_trunc_16 if x_hp_1 > x_max_hp: # 最大HPを超えない x_hp_1 = x_max_hp if y_tabenokoshi == 1 and y_hp_1 > 0: y_hp_1 += y_trunc_16 if y_hp_1 > y_max_hp: y_hp_1 = y_max_hp if x_koori == 1 and random.randint(1,256) <= 25: # 凍り時の判定 x_koori = 0 if y_koori == 1 and random.randint(1,256) <= 25: y_koori = 0 if x_nemuri > 0 and x_hakka == x_stock == 1: # 眠るの回復 x_nemuri, x_stock = 0, 0 elif x_nemuri > 0 and x_kiseki == x_stock == 1: # 混乱ごと回復 x_nemuri, x_konran, x_stock = 0, 0, 0 if y_nemuri > 0 and y_hakka == y_stock == 1: y_nemuri, y_stock = 0, 0 elif y_nemuri > 0 and y_kiseki == y_stock == 1: y_nemuri, y_konran, y_stock = 0, 0, 0 if x_kinomi != 0 and x_stock == 1 and x_ceil_2 > x_hp_1 > 0: # 木の実の回復 if x_kinomi == 3: x_hp_1 += 30 elif x_kinomi == 2: x_hp_1 += 20 elif x_kinomi == 1: x_hp_1 += 10 x_stock = 0 if y_kinomi != 0 and y_stock == 1 and y_ceil_2 > y_hp_1 > 0: if y_kinomi == 3: y_hp_1 += 30 elif y_kinomi == 2: y_hp_1 += 20 elif y_kinomi == 1: y_hp_1 += 10 y_stock = 0 # プレイヤー2の先制 else: # 先攻 / プレイヤー2 if y_critical_hit_1 >= random.randint(1,256): # 急所の抽選 y_critical_1 = 1 if y_accuracy_1 < random.randint(1,256): # 命中率の抽選 y_bit_1 = 0 if y_koori == 1: # 凍り時の判定 y_bit_1 = 2 elif y_nemuri > 0: # 眠り時の判定 y_nemuri -= 1 if y_nemuri > 0: y_bit_1 = 2 if y_sub_1 == 29: # 寝言の判定 y_bit_1 = 3 elif y_nemuri == 0: # 起きたら悪夢を解除 y_akumu = 0 if y_meromero == 1 and y_bit_1 != 2 and random.randint(1,2) == 1: # メロメロ時の判定 y_bit_1 = 2 if y_mahi == 1 and y_bit_1 != 2 and random.randint(1,4) == 1: # 麻痺時の判定 y_bit_1 = 2 if y_konran > 0 and y_bit_1 != 2: # 混乱時の判定 y_konran -= 1 if random.randint(1,2) == 1 and y_konran > 0: if gamemode != 2 and y_yakedo == 0: # GB/N64は最大値 y_hp_1 -= y_konran_damage elif gamemode != 2 and y_yakedo == 1: y_hp_1 -= by_konran_damage elif gamemode == 2 and y_yakedo == 0: y_hp_1 -= y_konran_damage * random.randint(217,255) // 255 elif gamemode == 2 and y_yakedo == 1: y_hp_1 -= by_konran_damage * random.randint(217,255) // 255 y_bit_1 = 2 if y_hp_1 <= 0: # 自傷の瀕死判定 x_count_1 += 1 continue if y_sub_1 == 29 and y_bit_1 == 3: # 寝言の抽選 y_bit_1 = 1 if y_negoto_way == 2: ry_negoto = random.randint(1,2) elif y_negoto_way == 3: ry_negoto = random.randint(1,3) if ry_negoto == 1: y_damage_1, y_critical_damage_1, y_accuracy_1, y_critical_hit_1 = y1_damage, y1_critical_damage, y1_accuracy, y1_critical_hit y_sub_1, y_per_1 = y1_sub, y1_per elif ry_negoto == 2: y_damage_1, y_critical_damage_1, y_accuracy_1, y_critical_hit_1 = y2_damage, y2_critical_damage, y2_accuracy, y2_critical_hit y_sub_1, y_per_1 = y2_sub, y2_per elif ry_negoto == 3: y_damage_1, y_critical_damage_1, y_accuracy_1, y_critical_hit_1 = y3_damage, y3_critical_damage, y3_accuracy, y3_critical_hit y_sub_1, y_per_1 = y3_sub, y3_per if y_critical_hit_1 >= random.randint(1,256): # 急所の抽選 y_critical_1 = 1 if y_accuracy_1 < random.randint(1,256): # 命中率の抽選 y_bit_1 = 0 if y_bit_1 == 1 or y_sub_1 == 25: # 攻撃の判定 if y_critical_1 == 0 and y_yakedo == 0: ry_attack_1 = y_damage_1 * random.randint(217,255) // 255 elif y_critical_1 == 1 and y_yakedo == 0: ry_attack_1 = y_critical_damage_1 * random.randint(217,255) // 255 elif y_critical_1 == 0 and y_yakedo == 1: ry_attack_1 = by_damage_1 * random.randint(217,255) // 255 elif y_critical_1 == 1 and y_yakedo == 1: ry_attack_1 = by_critical_damage_1 * random.randint(217,255) // 255 if y_sub_1 >= 22 and y_bit_1 == 1: # 技の効果 if y_sub_1 == 22: # 怒りの前歯 ry_attack_1 = x_hp_1 // 2 elif y_sub_1 == 23: # 固定ダメージ ry_attack_1 = y_damage_1 elif y_sub_1 == 24: # プレゼント ry_gift = random.randint(1,10) if gamemode != 2 and ry_gift in (1,2): # GB/N64の回復 ry_attack_1 = -x_trunc_4 elif gamemode == 2 and ry_gift in (1,2): # PBSの回復 ry_attack_1 = -80 elif y_critical_1 == 0 and y_yakedo == 0: if ry_gift in (3,4,5,6): ry_attack_1 = y_g40 * random.randint(217,255) // 255 elif ry_gift in (7,8,9): ry_attack_1 = y_g80 * random.randint(217,255) // 255 elif ry_gift == 10: ry_attack_1 = y_g120 * random.randint(217,255) // 255 elif y_critical_1 == 1 and y_yakedo == 0: if ry_gift in (3,4,5,6): ry_attack_1 = y_cg40 * random.randint(217,255) // 255 elif ry_gift in (7,8,9): ry_attack_1 = y_cg80 * random.randint(217,255) // 255 elif ry_gift == 10: ry_attack_1 = y_cg120 * random.randint(217,255) // 255 elif y_critical_1 == 0 and y_yakedo == 1: if ry_gift in (3,4,5,6): ry_attack_1 = by_g40 * random.randint(217,255) // 255 elif ry_gift in (7,8,9): ry_attack_1 = by_g80 * random.randint(217,255) // 255 elif ry_gift == 10: ry_attack_1 = by_g120 * random.randint(217,255) // 255 elif y_critical_1 == 1 and y_yakedo == 1: if ry_gift in (3,4,5,6): ry_attack_1 = by_cg40 * random.randint(217,255) // 255 elif ry_gift in (7,8,9): ry_attack_1 = by_cg80 * random.randint(217,255) // 255 elif ry_gift == 10: ry_attack_1 = by_cg120 * random.randint(217,255) // 255 if x_hp_1 > x_max_hp: # 最大HPを超えない x_hp_1 = x_max_hp elif y_sub_1 == 27: # 1/2回復 ry_attack_1 = 0 y_hp_1 += y_trunc_2 if y_hp_1 > y_max_hp: # 最大HPを超えない y_hp_1 = y_max_hp elif y_sub_1 == 28: # 眠る ry_attack_1 = 0 if y_hp_1 < y_max_hp: # 最大HP未満なら回復 y_hp_1 = y_max_hp y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku = 3, 0, 0, 0, 0 # 2ターン眠り elif y_sub_1 == 30: # カウンターorミラーコート ry_attack_1 = 0 # 先制で失敗 elif y_sub_1 in (33,34,35): # 2-5連続攻撃 ry_attack_1 = 0 # ダメージの初期化 if y_sub_1 == 33: ry_renzoku = random.randint(1,8) if ry_renzoku in (1,2,3): y_renzoku = 2 elif ry_renzoku in (4,5,6): y_renzoku = 3 elif ry_renzoku == 7: y_renzoku = 4 elif ry_renzoku == 8: y_renzoku = 5 elif y_sub_1 in (34,35): # 2連続攻撃 y_renzoku = 2 if y_sub_1 == 35 and random.randint(1,256) <= 51 and not any([x_koori, x_nemuri, x_mahi, x_yakedo, x_moudoku]): x_doku = 1 # ダブルニードル for _ in range(y_renzoku): # ダメージ累計 y_critical_1 = 0 # 急所の初期化 if y_critical_hit_1 >= random.randint(1,256): # 急所の抽選 y_critical_1 = 1 if y_critical_1 == 0 and y_yakedo == 0: y_renzoku_damage = y_damage_1 * random.randint(217,255) // 255 elif y_critical_1 == 1 and y_yakedo == 0: y_renzoku_damage = y_critical_damage_1 * random.randint(217,255) // 255 elif y_critical_1 == 0 and y_yakedo == 1: y_renzoku_damage = by_damage_1 * random.randint(217,255) // 255 elif y_critical_1 == 1 and y_yakedo == 1: y_renzoku_damage = by_critical_damage_1 * random.randint(217,255) // 255 ry_attack_1 += y_renzoku_damage elif y_sub_1 == 36: # トリプルキック times = 2 # ダメージ倍率 y_renzoku = 0 if y_accuracy_1 >= random.randint(1,256): # 2回目の抽選 y_renzoku = 1 if gamemode == 2: # 後攻への乗算バグ(PBS) x_triple_pbs_1 = 2 if y_accuracy_1 >= random.randint(1,256): # 3回目の抽選 y_renzoku = 2 if gamemode == 2: x_triple_pbs_1 = 3 for _ in range(y_renzoku): # ダメージ累計 y_critical_1 = 0 # 急所の初期化 if y_critical_hit_1 >= random.randint(1,256): y_critical_1 = 1 if y_critical_1 == 0 and y_yakedo == 0: y_triple_kick = y_damage_1 * times * random.randint(217,255) // 255 elif y_critical_1 == 1 and y_yakedo == 0: y_triple_kick = y_critical_damage_1 * times * random.randint(217,255) // 255 elif y_critical_1 == 0 and y_yakedo == 1: y_triple_kick = by_damage_1 * times * random.randint(217,255) // 255 elif y_critical_1 == 1 and y_yakedo == 1: y_triple_kick = by_critical_damage_1 * times * random.randint(217,255) // 255 times += 1 ry_attack_1 += y_triple_kick elif y_sub_1 == 37 and y_level > 0: # サイコウェーブ ry_attack_1 = random.randint(1,ry_psycho_wave) elif y_sub_1 == 38: # 未来予知 ry_attack_1 = 0 elif y_sub_1 == 39: # じたばた if 1 <= y_hp <= y_flail_2: # 威力の決定 ry_attack_1 = y_f200 if y_yakedo == 0 else by_f200 elif y_flail_2 + 1 <= y_hp <= y_flail_5: ry_attack_1 = y_f150 if y_yakedo == 0 else by_f150 elif y_flail_5 + 1 <= y_hp <= y_flail_10: ry_attack_1 = y_f100 if y_yakedo == 0 else by_f100 elif y_flail_10 + 1 <= y_hp <= y_flail_17: ry_attack_1 = y_f80 if y_yakedo == 0 else by_f80 elif gamemode != 2 and y_flail_17 + 1 <= y_hp <= y_flail_33: ry_attack_1 = y_f40 if y_yakedo == 0 else by_f40 elif gamemode == 2 and y_flail_17 + 1 <= y_hp <= y_flail_pbs: # PBS(40) ry_attack_1 = y_f40 if y_yakedo == 0 else by_f40 elif gamemode != 2 and y_flail_33 + 1 <= y_hp <= y_max_hp: ry_attack_1 = y_f20 if y_yakedo == 0 else by_f20 elif gamemode == 2 and y_flail_pbs + 1 <= y_hp <= y_max_hp: # PBS(20) ry_attack_1 = y_f20 if y_yakedo == 0 else by_f20 elif y_sub_1 in (40,41): if y_sub_1 == 40: # 転がる times = 2 ** (y_korogaru + y_marukunaru - 1) elif y_sub_1 == 41: # 連続斬り times = 2 ** (y_renzokugiri - 1) if y_critical_1 == 0 and y_yakedo == 0: ry_attack_1 = y_damage_1 * times * random.randint(217,255) // 255 elif y_critical_1 == 1 and y_yakedo == 0: ry_attack_1 = y_critical_damage_1 * times * random.randint(217,255) // 255 elif y_critical_1 == 0 and y_yakedo == 1: ry_attack_1 = by_damage_1 * times * random.randint(217,255) // 255 elif y_critical_1 == 1 and y_yakedo == 1: ry_attack_1 = by_critical_damage_1 * times * random.randint(217,255) // 255 elif y_sub_1 == 42: # 痛み分け pain_split = (y_hp_1 + x_hp_1) // 2 y_hp_1 = x_hp_1 = pain_split if y_hp_1 > y_max_hp: # 最大HPを超えない y_hp_1 = y_max_hp if x_hp_1 > x_max_hp: x_hp_1 = x_max_hp elif y_sub_1 in (50,51): # 守る・堪える, 後攻で処理 ry_attack_1 = 0 elif y_sub_1 == 60 and random.randint(1,256) <= y_per_1: # 素早さダウン y_speed_ph += 1 if y_speed_ph == 1: x_speed = x_speed_ph1 elif y_sub_1 == 61 and random.randint(1,256) <= y_per_1: # 命中率ダウン y_accuracy_ph += 1 if y_accuracy_ph == 1: x_accuracy_1, x_accuracy_2, x_accuracy_3, x_accuracy_4 = x_accuracy_1_ph1, x_accuracy_2_ph1, x_accuracy_3_ph1, x_accuracy_4_ph1 x1_accuracy, x2_accuracy, x3_accuracy = x1_accuracy_ph1, x2_accuracy_ph1, x3_accuracy_ph1 elif y_sub_1 in (62,63): # 防御or特防ダウン if y_sub_1 == 62 and random.randint(1,256) <= y_per_1: y_bd_ph += 1 elif y_sub_1 == 63: # 防御or特防-2 y_bd_ph += 2 if y_bd_ph == 1: y_damage_2, y_damage_3, y_damage_4 = y_damage_2_ph1, y_damage_3_ph1, y_damage_4_ph1 y_critical_damage_2, y_critical_damage_3, y_critical_damage_4 = y_critical_damage_2_ph1, y_critical_damage_3_ph1, y_critical_damage_4_ph1 by_damage_2, by_damage_3, by_damage_4 = by_damage_2_ph1, by_damage_3_ph1, by_damage_4_ph1 by_critical_damage_2, by_critical_damage_3, by_critical_damage_4 = by_critical_damage_2_ph1, by_critical_damage_3_ph1, by_critical_damage_4_ph1 y1_damage, y2_damage, y3_damage = y1_damage_ph1, y2_damage_ph1, y3_damage_ph1 y1_critical_damage, y2_critical_damage, y3_critical_damage = y1_critical_damage_ph1, y2_critical_damage_ph1, y3_critical_damage_ph1 x_konran_damage, bx_konran_damage = x_konran_damage_ph1, bx_konran_damage_ph1 elif y_bd_ph == 2: y_damage_2, y_damage_3, y_damage_4 = y_damage_2_ph2, y_damage_3_ph2, y_damage_4_ph2 y_critical_damage_2, y_critical_damage_3, y_critical_damage_4 = y_critical_damage_2_ph2, y_critical_damage_3_ph2, y_critical_damage_4_ph2 by_damage_2, by_damage_3, by_damage_4 = by_damage_2_ph2, by_damage_3_ph2, by_damage_4_ph2 by_critical_damage_2, by_critical_damage_3, by_critical_damage_4 = by_critical_damage_2_ph2, by_critical_damage_3_ph2, by_critical_damage_4_ph2 y1_damage, y2_damage, y3_damage = y1_damage_ph2, y2_damage_ph2, y3_damage_ph2 y1_critical_damage, y2_critical_damage, y3_critical_damage = y1_critical_damage_ph2, y2_critical_damage_ph2, y3_critical_damage_ph2 x_konran_damage, bx_konran_damage = x_konran_damage_ph2, bx_konran_damage_ph2 if y_bit_1 == 1: # ダメージの判定 x_hp_1 -= ry_attack_1 if y_sub_1 == 20: # 攻撃の反動ダメージ y_hp_1 -= ry_attack_1 // 4 elif y_sub_1 == 21: # HPドレイン y_hp_1 += ry_attack_1 // 2 if y_hp_1 > y_max_hp: # 最大HPを超えない y_hp_1 = y_max_hp if y_ouja_1 == 1 and random.randint(1,256) <= 30: # 先攻のみ王者の抽選 x_hirumi = 1 if x_hachimaki == 1 and x_hp_1 <= 0 and random.randint(1,256) <= 30: # 鉢巻の抽選 x_hp_1 = 1 if x_hp_1 <= 0: # 相手の瀕死判定 y_count_1 += 1 continue elif y_hp_1 <= 0: # 自分の瀕死判定 x_count_1 += 1 continue elif y_sub_1 == 25 and y_bit_1 == 0: # 飛び蹴りの自傷 if gamemode != 2: # GB/N64 y_hp_1 -= ry_attack_1 // 8 elif gamemode == 2: # PBS y_hp_1 -= ry_attack_1 // 4 if y_hp_1 <= 0: # 自分の瀕死判定 x_count_1 += 1 continue if y_hirumi == 1: # 怯みの解除 y_hirumi = 0 # 追加効果の抽選 if y_bit_1 == 1 and 0 < y_sub_1 <= 13: if y_sub_1 == 1: # 怯みの付与 if random.randint(1,256) <= y_per_1: x_hirumi = 1 elif y_sub_1 == 2: # 凍りの付与 if random.randint(1,256) <= y_per_1 and not any([x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku]): x_koori = 1 if x_yaketa == x_stock == 1: # 焼けた木の実 x_koori, x_stock = 0, 0 elif y_sub_1 == 3: # 眠りの付与 if not any([x_koori, x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku]): if gamemode == 0: # GB x_nemuri = random.randint(2,7) elif gamemode == 1: # N64 x_nemuri = random.randint(2,4) elif gamemode == 2: # PBS x_nemuri = random.randint(2,5) if x_hakka == x_stock == 1: # 薄荷の実復 x_nemuri, x_stock = 0, 0 elif y_sub_1 == 4: # 混乱の付与 if random.randint(1,256) <= y_per_1 and x_konran == 0: x_konran = random.randint(2,5) if x_nigai == x_stock == 1: # 苦い木の実 x_konran, x_stock = 0, 0 elif y_sub_1 == 5: # メロメロの付与 x_meromero = 1 elif y_sub_1 == 6: # 麻痺の付与 if random.randint(1,256) <= y_per_1 and not any([x_koori, x_nemuri, x_doku, x_yakedo, x_moudoku]): x_mahi = 1 if x_mahinaoshi == x_stock == 1: # 麻痺治しの実 x_mahi, x_stock = 0, 0 elif y_sub_1 == 7: # 毒の付与 if random.randint(1,256) <= y_per_1 and not any([x_koori, x_nemuri, x_mahi, x_yakedo, x_moudoku]): x_doku = 1 if x_dokukeshi == x_stock == 1: # 毒消しの実 x_doku, x_stock = 0, 0 elif y_sub_1 == 8: # 火傷の付与 if random.randint(1,256) <= y_per_1 and not any([x_koori, x_nemuri, x_mahi, x_doku, x_moudoku]): x_yakedo = 1 if x_kootta == x_stock == 1: # 凍った木の実 x_yakedo, x_stock = 0, 0 elif y_sub_1 == 9: # 猛毒の付与 if not any([x_koori, x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku]): x_moudoku = 1 if x_dokukeshi == x_stock == 1: # 毒消しの実 x_moudoku, x_stock = 0, 0 elif y_sub_1 == 10: # 宿り木の付与 x_yadorigi = 1 elif y_sub_1 == 11 and (x_nemuri > 0): # 悪夢の付与 x_akumu = 1 elif y_sub_1 == 12: # 呪いの付与 x_noroi = 1 y_hp_1 -= y_trunc_2 if y_hp_1 <= 0: # 自分の瀕死判定 x_count_1 += 1 continue elif y_sub_1 == 13 and random.randint(1,256) <= 51: # トライアタックの付与(凍り・麻痺・火傷) ry_tri_attack = random.randint(1,3) if ry_tri_attack == 1: # 凍りの付与 if not any([x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku]): x_koori = 1 if x_yaketa == x_stock == 1: # 焼けた木の実 x_koori, x_stock = 0, 0 elif ry_tri_attack == 2: # 麻痺の付与 if not any([x_koori, x_nemuri, x_doku, x_yakedo, x_moudoku]): x_mahi = 1 if x_mahinaoshi == x_stock == 1: # 麻痺治しの実 x_mahi, x_stock = 0, 0 elif ry_tri_attack == 3: # 火傷の付与 if not any([x_koori, x_nemuri, x_mahi, x_doku, x_moudoku]): x_yakedo = 1 if x_kootta == x_stock == 1: # 凍った木の実 x_yakedo, x_stock = 0, 0 elif x_koori == 1: # 相手が凍りなら火傷で解除 x_koori = 0 if x_kiseki == x_stock == 1 and any([x_koori, x_nemuri, x_konran, x_mahi, x_doku, x_yakedo, x_moudoku]): # 奇跡の実 x_koori, x_nemuri, x_konran, x_mahi, x_doku, x_yakedo, x_moudoku, x_stock = 0, 0, 0, 0, 0, 0, 0, 0 # 自分のターン終了時(1B) if y_doku == 1: # 毒 y_hp_1 -= y_trunc_8 elif y_yakedo == 1: # 火傷 y_hp_1 -= y_trunc_8 elif y_moudoku > 0: # 猛毒 y_hp_1 -= y_trunc_16 * y_moudoku y_moudoku += 1 if y_yadorigi == 1: # 宿り木の種 y_hp_1 -= y_trunc_8 x_hp_1 += y_trunc_8 if x_hp_1 > x_max_hp: x_hp_1 = x_max_hp if y_akumu == 1 and y_nemuri > 0: # 悪夢 y_hp_1 -= y_trunc_4 if y_noroi == 1: # 呪い y_hp_1 -= y_trunc_4 if y_hp_1 <= 0: # 自分の瀕死判定 x_count_1 += 1 continue # 後攻 / プレイヤー1 if x_critical_hit_1 >= random.randint(1,256): # 急所の抽選 x_critical_1 = 1 if x_accuracy_1 < random.randint(1,256): # 命中率の抽選 x_bit_1 = 0 if x_hirumi == 1 and gamemode == 2: # 怯み時の判定(PBS) x_bit_1 = 2 if x_koori == 1: # 凍り時の判定 x_bit_1 = 2 elif x_nemuri > 0 and x_bit_1 != 2: # 眠り時の判定 x_nemuri -= 1 if x_nemuri > 0: x_bit_1 = 2 if x_sub_1 == 29: # 寝言の判定 x_bit_1 = 3 elif x_nemuri == 0: # 起きたら悪夢を解除 x_akumu = 0 if x_hirumi == 1 and gamemode != 2: # 怯み時の判定(GB/N64) x_bit_1 = 2 if x_meromero == 1 and x_bit_1 != 2 and random.randint(1,2) == 1: # メロメロ時の判定 x_bit_1 = 2 if x_mahi == 1 and x_bit_1 != 2 and random.randint(1,4) == 1: # 麻痺時の判定 x_bit_1 = 2 if x_konran > 0 and x_bit_1 != 2: # 混乱時の判定 x_konran -= 1 if random.randint(1,2) == 1 and x_konran > 0: if gamemode != 2 and x_yakedo == 0: # GB/N64は最大値 x_hp_1 -= x_konran_damage elif gamemode != 2 and x_yakedo == 1: x_hp_1 -= bx_konran_damage elif gamemode == 2 and x_yakedo == 0: x_hp_1 -= x_konran_damage * random.randint(217,255) // 255 elif gamemode == 2 and x_yakedo == 1: x_hp_1 -= bx_konran_damage * random.randint(217,255) // 255 x_bit_1 = 2 if x_hp_1 <= 0: # 自傷の瀕死判定 y_count_1 += 1 continue if x_sub_1 == 29 and x_bit_1 == 3: # 寝言の抽選 x_bit_1 = 1 if x_negoto_way == 2: rx_negoto = random.randint(1,2) elif x_negoto_way == 3: rx_negoto = random.randint(1,3) if rx_negoto == 1: x_damage_1, x_critical_damage_1, x_accuracy_1, x_critical_hit_1 = x1_damage, x1_critical_damage, x1_accuracy, x1_critical_hit x_sub_1, x_per_1 = x1_sub, x1_per elif rx_negoto == 2: x_damage_1, x_critical_damage_1, x_accuracy_1, x_critical_hit_1 = x2_damage, x2_critical_damage, x2_accuracy, x2_critical_hit x_sub_1, x_per_1 = x2_sub, x2_per elif rx_negoto == 3: x_damage_1, x_critical_damage_1, x_accuracy_1, x_critical_hit_1 = x3_damage, x3_critical_damage, x3_accuracy, x3_critical_hit x_sub_1, x_per_1 = x3_sub, x3_per if x_critical_hit_1 >= random.randint(1,256): # 急所の抽選 x_critical_1 = 1 if x_accuracy_1 < random.randint(1,256): # 命中率の抽選 x_bit_1 = 0 if y_sub_1 in (50,51): # 先攻の守る・堪える ry_protect = (1/2 ** (y_protect - 1) * 256 - 1/256) // 1 if y_bit_1 != 2 and (ry_protect >= random.randint(1,256) or (gamemode == 2 and y_protect == 1)): # 1ターン目は必ず成功(PBS) y_protect += 1 if y_sub_1 == 50 and not x_sub_1 in (11,12,27,28,38): # 守る # 悪夢・呪い・回復・未来予知は有効 x_bit_1 = 0 else: y_protect = 1 if x_bit_1 == 1 or x_sub_1 == 25: # 攻撃の判定 if x_critical_1 == 0 and x_yakedo == 0: rx_attack_1 = x_damage_1 * x_triple_pbs_1 * random.randint(217,255) // 255 elif x_critical_1 == 1 and x_yakedo == 0: rx_attack_1 = x_critical_damage_1 * x_triple_pbs_1 * random.randint(217,255) // 255 elif x_critical_1 == 0 and x_yakedo == 1: rx_attack_1 = bx_damage_1 * x_triple_pbs_1 * random.randint(217,255) // 255 elif x_critical_1 == 1 and x_yakedo == 1: rx_attack_1 = bx_critical_damage_1 * x_triple_pbs_1 * random.randint(217,255) // 255 if x_sub_1 >= 22 and x_bit_1 == 1: # 技の効果 if x_sub_1 == 22: # 怒りの前歯 rx_attack_1 = y_hp_1 // 2 elif x_sub_1 == 23: # 固定ダメージ rx_attack_1 = x_damage_1 elif x_sub_1 == 24: # プレゼント rx_gift = random.randint(1,10) if gamemode != 2 and rx_gift in (1,2): # GB/N64の回復 rx_attack_1 = -y_trunc_4 elif gamemode == 2 and rx_gift in (1,2): # PBSの回復 rx_attack_1 = -80 elif x_critical_1 == 0 and x_yakedo == 0: if rx_gift in (3,4,5,6): rx_attack_1 = x_g40 * x_triple_pbs_1 * random.randint(217,255) // 255 elif rx_gift in (7,8,9): rx_attack_1 = x_g80 * x_triple_pbs_1 * random.randint(217,255) // 255 elif rx_gift == 10: rx_attack_1 = x_g120 * x_triple_pbs_1 * random.randint(217,255) // 255 elif x_critical_1 == 1 and x_yakedo == 0: if rx_gift in (3,4,5,6): rx_attack_1 = x_cg40 * x_triple_pbs_1 * random.randint(217,255) // 255 elif rx_gift in (7,8,9): rx_attack_1 = x_cg80 * x_triple_pbs_1 * random.randint(217,255) // 255 elif rx_gift == 10: rx_attack_1 = x_cg120 * x_triple_pbs_1 * random.randint(217,255) // 255 elif x_critical_1 == 0 and x_yakedo == 1: if rx_gift in (3,4,5,6): rx_attack_1 = bx_g40 * x_triple_pbs_1 * random.randint(217,255) // 255 elif rx_gift in (7,8,9): rx_attack_1 = bx_g80 * x_triple_pbs_1 * random.randint(217,255) // 255 elif rx_gift == 10: rx_attack_1 = bx_g120 * x_triple_pbs_1 * random.randint(217,255) // 255 elif x_critical_1 == 1 and x_yakedo == 1: if rx_gift in (3,4,5,6): rx_attack_1 = bx_cg40 * x_triple_pbs_1 * random.randint(217,255) // 255 elif rx_gift in (7,8,9): rx_attack_1 = bx_cg80 * x_triple_pbs_1 * random.randint(217,255) // 255 elif rx_gift == 10: rx_attack_1 = bx_cg120 * x_triple_pbs_1 * random.randint(217,255) // 255 if y_hp_1 > y_max_hp: # 最大HPを超えない y_hp_1 = y_max_hp elif x_sub_1 == 27: # 1/2回復 rx_attack_1 = 0 x_hp_1 += x_trunc_2 if x_hp_1 > x_max_hp: # 最大HPを超えない x_hp_1 = x_max_hp elif x_sub_1 == 28: # 眠る rx_attack_1 = 0 if x_hp_1 < x_max_hp: # 最大HP未満なら回復 x_hp_1 = x_max_hp x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku = 3, 0, 0, 0, 0 # 2ターン眠り elif x_sub_1 == 30: # カウンターorミラーコート rx_attack_1 = ry_attack_1 * 2 if 999 <= y_damage_1 and y_bit_1 == 0 and gamemode == 0: # 一撃外れをカウンター(GB) rx_attack_1 = y_max_hp elif x_sub_1 in (33,34,35): # 2-5連続攻撃 rx_attack_1 = 0 # ダメージの初期化 if x_sub_1 == 33: rx_renzoku = random.randint(1,8) if rx_renzoku in (1,2,3): x_renzoku = 2 elif rx_renzoku in (4,5,6): x_renzoku = 3 elif rx_renzoku == 7: x_renzoku = 4 elif rx_renzoku == 8: x_renzoku = 5 elif x_sub_1 in (34,35): # 2連続攻撃 x_renzoku = 2 if x_sub_1 == 35 and random.randint(1,256) <= 51 and not any([y_koori, y_nemuri, y_mahi, y_yakedo, y_moudoku]): y_doku = 1 # ダブルニードル for _ in range(x_renzoku): # ダメージ累計 x_critical_1 = 0 # 急所の初期化 if x_critical_hit_1 >= random.randint(1,256): # 急所の抽選 x_critical_1 = 1 if x_critical_1 == 0 and x_yakedo == 0: x_renzoku_damage = x_damage_1 * x_triple_pbs_1 * random.randint(217,255) // 255 elif x_critical_1 == 1 and x_yakedo == 0: x_renzoku_damage = x_critical_damage_1 * x_triple_pbs_1 * random.randint(217,255) // 255 elif x_critical_1 == 0 and x_yakedo == 1: x_renzoku_damage = bx_damage_1 * x_triple_pbs_1 * random.randint(217,255) // 255 elif x_critical_1 == 1 and x_yakedo == 1: x_renzoku_damage = bx_critical_damage_1 * x_triple_pbs_1 * random.randint(217,255) // 255 rx_attack_1 += x_renzoku_damage elif x_sub_1 == 36: # トリプルキック times = 2 # ダメージ倍率 x_renzoku = 0 if x_accuracy_1 >= random.randint(1,256): # 2回目の抽選 x_renzoku = 1 if x_accuracy_1 >= random.randint(1,256): # 3回目の抽選 x_renzoku = 2 for _ in range(x_renzoku): # ダメージ累計 x_critical_1 = 0 # 急所の初期化 if x_critical_hit_1 >= random.randint(1,256): x_critical_1 = 1 if x_critical_1 == 0 and x_yakedo == 0: x_triple_kick = x_damage_1 * times * random.randint(217,255) // 255 elif x_critical_1 == 1 and x_yakedo == 0: x_triple_kick = x_critical_damage_1 * times * random.randint(217,255) // 255 elif x_critical_1 == 0 and x_yakedo == 1: x_triple_kick = bx_damage_1 * times * random.randint(217,255) // 255 elif x_critical_1 == 1 and x_yakedo == 1: x_triple_kick = bx_critical_damage_1 * times * random.randint(217,255) // 255 times += 1 rx_attack_1 += x_triple_kick elif x_sub_1 == 37 and x_level > 0: # サイコウェーブ rx_attack_1 = random.randint(1,rx_psycho_wave) elif x_sub_1 == 38: # 未来予知 rx_attack_1 = 0 elif x_sub_1 == 39: # じたばた if 1 <= x_hp <= x_flail_2: # 威力の決定 rx_attack_1 = x_f200 if x_yakedo == 0 else bx_f200 elif x_flail_2 + 1 <= x_hp <= x_flail_5: rx_attack_1 = x_f150 if x_yakedo == 0 else bx_f150 elif x_flail_5 + 1 <= x_hp <= x_flail_10: rx_attack_1 = x_f100 if x_yakedo == 0 else bx_f100 elif x_flail_10 + 1 <= x_hp <= x_flail_17: rx_attack_1 = x_f80 if x_yakedo == 0 else bx_f80 elif gamemode != 2 and x_flail_17 + 1 <= x_hp <= x_flail_33: rx_attack_1 = x_f40 if x_yakedo == 0 else bx_f40 elif gamemode == 2 and x_flail_17 + 1 <= x_hp <= x_flail_pbs: # PBS(40) rx_attack_1 = x_f40 if x_yakedo == 0 else bx_f40 elif gamemode != 2 and x_flail_33 + 1 <= x_hp <= x_max_hp: rx_attack_1 = x_f20 if x_yakedo == 0 else bx_f20 elif gamemode == 2 and x_flail_pbs + 1 <= x_hp <= x_max_hp: # PBS(20) rx_attack_1 = x_f20 if x_yakedo == 0 else bx_f20 if gamemode == 2: # 最高乱数+1ダメージ(PBS) rx_attack_1 = rx_attack_1 * x_triple_pbs_1 + 1 elif x_sub_1 in (40,41): if x_sub_1 == 40: # 転がる times = 2 ** (x_korogaru + x_marukunaru - 1) elif x_sub_1 == 41: # 連続斬り times = 2 ** (x_renzokugiri - 1) if x_critical_1 == 0 and x_yakedo == 0: rx_attack_1 = x_damage_1 * times * random.randint(217,255) // 255 elif x_critical_1 == 1 and x_yakedo == 0: rx_attack_1 = x_critical_damage_1 * times * random.randint(217,255) // 255 elif x_critical_1 == 0 and x_yakedo == 1: rx_attack_1 = bx_damage_1 * times * random.randint(217,255) // 255 elif x_critical_1 == 1 and x_yakedo == 1: rx_attack_1 = bx_critical_damage_1 * times * random.randint(217,255) // 255 elif x_sub_1 == 42: # 痛み分け pain_split = (x_hp_1 + y_hp_1) // 2 x_hp_1 = y_hp_1 = pain_split if x_hp_1 > x_max_hp: # 最大HPを超えない x_hp_1 = x_max_hp if y_hp_1 > y_max_hp: y_hp_1 = y_max_hp elif x_sub_1 in (50,51): # 守る・堪える, 後攻は失敗 rx_attack_1, x_protect = 0, 1 elif x_sub_1 == 60 and random.randint(1,256) <= x_per_1: # 素早さダウン x_speed_ph += 1 if x_speed_ph == 1: y_speed = y_speed_ph1 elif x_sub_1 == 61 and random.randint(1,256) <= x_per_1: # 命中率ダウン x_accuracy_ph += 1 if x_accuracy_ph == 1: y_accuracy_2, y_accuracy_3, y_accuracy_4 = y_accuracy_2_ph1, y_accuracy_3_ph1, y_accuracy_4_ph1 y1_accuracy, y2_accuracy, y3_accuracy = y1_accuracy_ph1, y2_accuracy_ph1, y3_accuracy_ph1 elif x_sub_1 in (62,63): # 防御or特防ダウン if x_sub_1 == 62 and random.randint(1,256) <= x_per_1: x_bd_ph += 1 elif x_sub_1 == 63: # 防御or特防-2 x_bd_ph += 2 if x_bd_ph == 1: x_damage_2, x_damage_3, x_damage_4 = x_damage_2_ph1, x_damage_3_ph1, x_damage_4_ph1 x_critical_damage_2, x_critical_damage_3, x_critical_damage_4 = x_critical_damage_2_ph1, x_critical_damage_3_ph1, x_critical_damage_4_ph1 bx_damage_2, bx_damage_3, bx_damage_4 = bx_damage_2_ph1, bx_damage_3_ph1, bx_damage_4_ph1 bx_critical_damage_2, bx_critical_damage_3, bx_critical_damage_4 = bx_critical_damage_2_ph1, bx_critical_damage_3_ph1, bx_critical_damage_4_ph1 x1_damage, x2_damage, x3_damage = x1_damage_ph1, x2_damage_ph1, x3_damage_ph1 x1_critical_damage, x2_critical_damage, x3_critical_damage = x1_critical_damage_ph1, x2_critical_damage_ph1, x3_critical_damage_ph1 y_konran_damage, by_konran_damage = y_konran_damage_ph1, by_konran_damage_ph1 elif x_bd_ph == 2: x_damage_2, x_damage_3, x_damage_4 = x_damage_2_ph2, x_damage_3_ph2, x_damage_4_ph2 x_critical_damage_2, x_critical_damage_3, x_critical_damage_4 = x_critical_damage_2_ph2, x_critical_damage_3_ph2, x_critical_damage_4_ph2 bx_damage_2, bx_damage_3, bx_damage_4 = bx_damage_2_ph2, bx_damage_3_ph2, bx_damage_4_ph2 bx_critical_damage_2, bx_critical_damage_3, bx_critical_damage_4 = bx_critical_damage_2_ph2, bx_critical_damage_3_ph2, bx_critical_damage_4_ph2 x1_damage, x2_damage, x3_damage = x1_damage_ph2, x2_damage_ph2, x3_damage_ph2 x1_critical_damage, x2_critical_damage, x3_critical_damage = x1_critical_damage_ph2, x2_critical_damage_ph2, x3_critical_damage_ph2 y_konran_damage, by_konran_damage = y_konran_damage_ph2, by_konran_damage_ph2 if x_bit_1 == 1: # ダメージの判定 y_hp_1 -= rx_attack_1 if x_sub_1 == 20: # 攻撃の反動ダメージ x_hp_1 -= rx_attack_1 // 4 elif x_sub_1 == 21: # HPドレイン x_hp_1 += rx_attack_1 // 2 if x_hp_1 > x_max_hp: # 最大HPを超えない x_hp_1 = x_max_hp if y_sub_1 == 51 and y_hp_1 <= 0 and y_protect > 1 and y_bit_1 == 1: # 堪える y_hp_1 = 1 if y_hachimaki == 1 and y_hp_1 <= 0 and random.randint(1,256) <= 30: # 鉢巻の抽選 y_hp_1 = 1 if y_hp_1 <= 0: # 相手の瀕死判定 x_count_1 += 1 continue elif x_hp_1 <= 0: # 自分の瀕死判定 y_count_1 += 1 continue elif x_sub_1 == 25 and x_bit_1 == 0: # 飛び蹴りの自傷 if gamemode != 2: # GB/N64 x_hp_1 -= rx_attack_1 // 8 elif gamemode == 2: # PBS x_hp_1 -= rx_attack_1 // 4 if x_hp_1 <= 0: # 自分の瀕死判定 y_count_1 += 1 continue if x_hirumi == 1: # 怯みの解除 x_hirumi = 0 # 追加効果の抽選 if x_bit_1 == 1 and 0 < x_sub_1 <= 13: # 先攻は怯まない if x_sub_1 == 2: # 凍りの付与 if random.randint(1,256) <= x_per_1 and not any([y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku]): y_koori = 1 if y_yaketa == y_stock == 1: # 焼けた木の実 y_koori, y_stock = 0, 0 elif x_sub_1 == 3: # 眠りの付与 if not any([y_koori, y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku]): if gamemode == 0: # GB y_nemuri = random.randint(2,7) elif gamemode == 1: # N64 y_nemuri = random.randint(2,4) elif gamemode == 2: # PBS y_nemuri = random.randint(2,5) if y_hakka == y_stock == 1: # 薄荷の実 y_nemuri, y_stock = 0, 0 elif x_sub_1 == 4: # 混乱の付与 if random.randint(1,256) <= x_per_1 and y_konran == 0: y_konran = random.randint(2,5) if y_nigai == y_stock == 1: # 苦い木の実 y_konran, y_stock = 0, 0 elif x_sub_1 == 5: # メロメロの付与 y_meromero = 1 elif x_sub_1 == 6: # 麻痺の付与 if random.randint(1,256) <= x_per_1 and not any([y_koori, y_nemuri, y_doku, y_yakedo, y_moudoku]): y_mahi = 1 if y_mahinaoshi == y_stock == 1: # 麻痺治しの実 y_mahi, y_stock = 0, 0 elif x_sub_1 == 7: # 毒の付与 if random.randint(1,256) <= x_per_1 and not any([y_koori, y_nemuri, y_mahi, y_yakedo, y_moudoku]): y_doku = 1 if y_dokukeshi == y_stock == 1: # 毒消しの実 y_doku, y_stock = 0, 0 elif x_sub_1 == 8: # 火傷の付与 if random.randint(1,256) <= x_per_1 and not any([y_koori, y_nemuri, y_mahi, y_doku, y_moudoku]): y_yakedo = 1 if y_kootta == y_stock == 1: # 凍った木の実 y_yakedo, y_stock = 0, 0 elif x_sub_1 == 9: # 猛毒の付与 if not any([y_koori, y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku]): y_moudoku = 1 if y_dokukeshi == y_stock == 1: # 毒消しの実 y_moudoku, y_stock = 0, 0 elif x_sub_1 == 10: # 宿り木の付与 y_yadorigi = 1 elif x_sub_1 == 11 and (y_nemuri > 0): # 悪夢の付与 y_akumu = 1 elif x_sub_1 == 12: # 呪いの付与 y_noroi = 1 x_hp_1 -= x_trunc_2 if x_hp_1 <= 0: # 自分の瀕死判定 y_count_1 += 1 continue elif x_sub_1 == 13 and random.randint(1,256) <= 51: # トライアタックの付与(凍り・麻痺・火傷) rx_tri_attack = random.randint(1,3) if rx_tri_attack == 1: # 凍りの付与 if not any([y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku]): y_koori = 1 if y_yaketa == y_stock == 1: # 焼けた木の実 y_koori, y_stock = 0, 0 elif rx_tri_attack == 2: # 麻痺の付与 if not any([y_koori, y_nemuri, y_doku, y_yakedo, y_moudoku]): y_mahi = 1 if y_mahinaoshi == y_stock == 1: # 麻痺治しの実 y_mahi, y_stock = 0, 0 elif rx_tri_attack == 3: # 火傷の付与 if not any([y_koori, y_nemuri, y_mahi, y_doku, y_moudoku]): y_yakedo = 1 if y_kootta == y_stock == 1: # 凍った木の実 y_yakedo, y_stock = 0, 0 elif y_koori == 1: # 相手が凍りなら火傷で解除 y_koori = 0 if y_kiseki == y_stock == 1 and any([y_koori, y_nemuri, y_konran, y_mahi, y_doku, y_yakedo, y_moudoku]): # 奇跡の実 y_koori, y_nemuri, y_konran, y_mahi, y_doku, y_yakedo, y_moudoku, y_stock = 0, 0, 0, 0, 0, 0, 0, 0 # 自分のターン終了時(1B) if x_doku == 1: # 毒 x_hp_1 -= x_trunc_8 elif x_yakedo == 1: # 火傷 x_hp_1 -= x_trunc_8 elif x_moudoku > 0: # 猛毒 x_hp_1 -= x_trunc_16 * x_moudoku x_moudoku += 1 if x_yadorigi == 1: # 宿り木の種 x_hp_1 -= x_trunc_8 y_hp_1 += x_trunc_8 if y_hp_1 > y_max_hp: y_hp_1 = y_max_hp if x_akumu == 1 and x_nemuri > 0: # 悪夢 x_hp_1 -= x_trunc_4 if x_noroi == 1: # 呪い x_hp_1 -= x_trunc_4 if x_hp_1 <= 0: # 自分の瀕死判定 y_count_1 += 1 continue # 全体のターン終了時(1B) if x_mirai_1 == 1 and random.randint(1,256) <= x_mirai_accuracy_1: # 未来予知の判定 y_hp_1 -= x_mirai_damage_1 * random.randint(217,255) // 255 if y_hp_1 <= 0: # 行動順で瀕死の判定 x_count_1 += 1 continue if y_mirai_1 == 1 and random.randint(1,256) <= y_mirai_accuracy_1: x_hp_1 -= y_mirai_damage_1 * random.randint(217,255) // 255 if x_hp_1 <= 0: y_count_1 += 1 continue if suna_1 == 1: # 砂嵐の判定 if y_suna == 1: # 行動順で瀕死の判定 y_hp_1 -= y_trunc_8 if y_hp_1 <= 0: x_count_1 += 1 continue if x_suna == 1: x_hp_1 -= x_trunc_8 if x_hp_1 <= 0: y_count_1 += 1 continue if y_tabenokoshi == 1 and y_hp_1 > 0: # 食べ残しの回復 y_hp_1 += y_trunc_16 if y_hp_1 > y_max_hp: # 最大HPを超えない y_hp_1 = y_max_hp if x_tabenokoshi == 1 and x_hp_1 > 0: x_hp_1 += x_trunc_16 if x_hp_1 > x_max_hp: x_hp_1 = x_max_hp if y_koori == 1 and random.randint(1,256) <= 25: # 凍り時の判定 y_koori = 0 if x_koori == 1 and random.randint(1,256) <= 25: x_koori = 0 if y_nemuri > 0 and y_hakka == y_stock == 1: # 眠るの回復 y_nemuri, y_stock = 0, 0 elif y_nemuri > 0 and y_kiseki == y_stock == 1: # 混乱ごと回復 y_nemuri, y_konran, y_stock = 0, 0, 0 if x_nemuri > 0 and x_hakka == x_stock == 1: x_nemuri, x_stock = 0, 0 elif x_nemuri > 0 and x_kiseki == x_stock == 1: x_nemuri, x_konran, x_stock = 0, 0, 0 if y_kinomi != 0 and y_stock == 1 and y_ceil_2 > y_hp_1 > 0: # 木の実の回復 if y_kinomi == 3: y_hp_1 += 30 elif y_kinomi == 2: y_hp_1 += 20 elif y_kinomi == 1: y_hp_1 += 10 y_stock = 0 if x_kinomi != 0 and x_stock == 1 and x_ceil_2 > x_hp_1 > 0: if x_kinomi == 3: x_hp_1 += 30 elif x_kinomi == 2: x_hp_1 += 20 elif x_kinomi == 1: x_hp_1 += 10 x_stock = 0 ### 2ターン目 ### # 素早さの抽選(2) xx_speed, yy_speed = x_speed, y_speed # 素早さを初期化 if x_mahi == 1: # 麻痺なら素早さ1/4 xx_speed = x_trunc_speed if y_mahi == 1: yy_speed = y_trunc_speed if x_sensei == 1 and random.randint(1,256) <= 60: # 先制の爪の抽選 xx_speed += 1000 if y_sensei == 1 and random.randint(1,256) <= 60: yy_speed += 1000 if x_sub_2 == 31: # 優先度+1 xx_speed += 10000 elif x_sub_2 in (30,32): # カウンターorミラーコート・優先度-1 xx_speed -= 10000 elif x_sub_2 in (50,51): # 守る・堪える・優先度+2 xx_speed += 20000 if y_sub_2 == 31: yy_speed += 10000 elif y_sub_2 in (30,32): yy_speed -= 10000 elif y_sub_2 in (50,51): yy_speed += 20000 # HPの格納・手番の抽選 x_hp_2, y_hp_2 = x_hp_1, y_hp_1 # HPの設定 # プレイヤー1の先制 if xx_speed > yy_speed or (xx_speed == yy_speed and random.randint(1,2) == 1): # 先攻 / プレイヤー1 if x_critical_hit_2 >= random.randint(1,256): # 急所の抽選 x_critical_2 = 1 if x_accuracy_2 < random.randint(1,256): # 命中率の抽選 x_bit_2 = 0 if x_koori == 1: # 凍り時の判定: x_bit_2 = 2 elif x_nemuri > 0: # 眠り時の判定 x_nemuri -= 1 if x_nemuri > 0: x_bit_2 = 2 if x_sub_2 == 29: # 寝言の判定 x_bit_2 = 3 elif x_nemuri == 0: # 起きたら悪夢を解除 x_akumu = 0 if x_meromero == 1 and x_bit_2 != 2 and random.randint(1,2) == 1: # メロメロ時の判定 x_bit_2 = 2 if x_mahi == 1 and x_bit_2 != 2 and random.randint(1,4) == 1: # 麻痺時の判定 x_bit_2 = 2 if x_konran > 0 and x_bit_2 != 2: # 混乱時の判定 x_konran -= 1 if random.randint(1,2) == 1 and x_konran > 0: if gamemode != 2 and x_yakedo == 0: # GB/N64は最大値 x_hp_2 -= x_konran_damage elif gamemode != 2 and x_yakedo == 1: x_hp_2 -= bx_konran_damage elif gamemode == 2 and x_yakedo == 0: x_hp_2 -= x_konran_damage * random.randint(217,255) // 255 elif gamemode == 2 and x_yakedo == 1: x_hp_2 -= bx_konran_damage * random.randint(217,255) // 255 x_bit_2 = 2 if x_hp_2 <= 0: # 自傷の瀕死判定 y_count_2 += 1 continue if x_sub_2 == 29 and x_bit_2 == 3: # 寝言の抽選 x_bit_2 = 1 if x_negoto_way == 2: rx_negoto = random.randint(1,2) elif x_negoto_way == 3: rx_negoto = random.randint(1,3) if rx_negoto == 1: x_damage_2, x_critical_damage_2, x_accuracy_2, x_critical_hit_2 = x1_damage, x1_critical_damage, x1_accuracy, x1_critical_hit x_sub_2, x_per_2 = x1_sub, x1_per elif rx_negoto == 2: x_damage_2, x_critical_damage_2, x_accuracy_2, x_critical_hit_2 = x2_damage, x2_critical_damage, x2_accuracy, x2_critical_hit x_sub_2, x_per_2 = x2_sub, x2_per elif rx_negoto == 3: x_damage_2, x_critical_damage_2, x_accuracy_2, x_critical_hit_2 = x3_damage, x3_critical_damage, x3_accuracy, x3_critical_hit x_sub_2, x_per_2 = x3_sub, x3_per if x_critical_hit_2 >= random.randint(1,256): # 急所の抽選 x_critical_2 = 1 if x_accuracy_2 < random.randint(1,256): # 命中率の抽選 x_bit_2 = 0 if x_bit_2 == 1 or x_sub_2 == 25: # 攻撃の判定 if x_critical_2 == 0 and x_yakedo == 0: rx_attack_2 = x_damage_2 * random.randint(217,255) // 255 elif x_critical_2 == 1 and x_yakedo == 0: rx_attack_2 = x_critical_damage_2 * random.randint(217,255) // 255 elif x_critical_2 == 0 and x_yakedo == 1: rx_attack_2 = bx_damage_2 * random.randint(217,255) // 255 elif x_critical_2 == 1 and x_yakedo == 1: rx_attack_2 = bx_critical_damage_2 * random.randint(217,255) // 255 if x_sub_2 >= 22 and x_bit_2 == 1: # 技の効果 if x_sub_2 == 22: # 怒りの前歯 rx_attack_2 = y_hp_2 // 2 elif x_sub_2 == 23: # 固定ダメージ rx_attack_2 = x_damage_2 elif x_sub_2 == 24: # プレゼント rx_gift = random.randint(1,10) if gamemode != 2 and rx_gift in (1,2): # GB/N64の回復 rx_attack_2 = -y_trunc_4 elif gamemode == 2 and rx_gift in (1,2): # PBSの回復 rx_attack_2 = -80 elif x_critical_2 == 0 and x_yakedo == 0: if rx_gift in (3,4,5,6): rx_attack_2 = x_g40 * random.randint(217,255) // 255 elif rx_gift in (7,8,9): rx_attack_2 = x_g80 * random.randint(217,255) // 255 elif rx_gift == 10: rx_attack_2 = x_g120 * random.randint(217,255) // 255 elif x_critical_2 == 1 and x_yakedo == 0: if rx_gift in (3,4,5,6): rx_attack_2 = x_cg40 * random.randint(217,255) // 255 elif rx_gift in (7,8,9): rx_attack_2 = x_cg80 * random.randint(217,255) // 255 elif rx_gift == 10: rx_attack_2 = x_cg120 * random.randint(217,255) // 255 elif x_critical_2 == 0 and x_yakedo == 1: if rx_gift in (3,4,5,6): rx_attack_2 = bx_g40 * random.randint(217,255) // 255 elif rx_gift in (7,8,9): rx_attack_2 = bx_g80 * random.randint(217,255) // 255 elif rx_gift == 10: rx_attack_2 = bx_g120 * random.randint(217,255) // 255 elif x_critical_2 == 1 and x_yakedo == 1: if rx_gift in (3,4,5,6): rx_attack_2 = bx_cg40 * random.randint(217,255) // 255 elif rx_gift in (7,8,9): rx_attack_2 = bx_cg80 * random.randint(217,255) // 255 elif rx_gift == 10: rx_attack_2 = bx_cg120 * random.randint(217,255) // 255 if y_hp_2 > y_max_hp: # 最大HPを超えない y_hp_2 = y_max_hp elif x_sub_2 == 27: # 1/2回復 rx_attack_2 = 0 x_hp_2 += x_trunc_2 if x_hp_2 > x_max_hp: # 最大HPを超えない x_hp_2 = x_max_hp elif x_sub_2 == 28: # 眠る rx_attack_2 = 0 if x_hp_2 < x_max_hp: # 最大HP未満なら回復 x_hp_2 = x_max_hp x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku = 3, 0, 0, 0, 0 # 2ターン眠り elif x_sub_2 == 30: # カウンターorミラーコート rx_attack_2 = 0 # 先制で失敗 elif x_sub_2 in (33,34,35): # 2-5連続攻撃 rx_attack_2 = 0 # ダメージの初期化 if x_sub_2 == 33: rx_renzoku = random.randint(1,8) if rx_renzoku in (1,2,3): x_renzoku = 2 elif rx_renzoku in (4,5,6): x_renzoku = 3 elif rx_renzoku == 7: x_renzoku = 4 elif rx_renzoku == 8: x_renzoku = 5 elif x_sub_2 in (34,35): # 2連続攻撃 x_renzoku = 2 if x_sub_2 == 35 and random.randint(1,256) <= 51 and not any([y_koori, y_nemuri, y_mahi, y_yakedo, y_moudoku]): y_doku = 1 # ダブルニードル for _ in range(x_renzoku): # ダメージ累計 x_critical_2 = 0 # 急所の初期化 if x_critical_hit_2 >= random.randint(1,256): # 急所の抽選 x_critical_2 = 1 if x_critical_2 == 0 and x_yakedo == 0: x_renzoku_damage = x_damage_2 * random.randint(217,255) // 255 elif x_critical_2 == 1 and x_yakedo == 0: x_renzoku_damage = x_critical_damage_2 * random.randint(217,255) // 255 elif x_critical_2 == 0 and x_yakedo == 1: x_renzoku_damage = bx_damage_2 * random.randint(217,255) // 255 elif x_critical_2 == 1 and x_yakedo == 1: x_renzoku_damage = bx_critical_damage_2 * random.randint(217,255) // 255 rx_attack_2 += x_renzoku_damage elif x_sub_2 == 36: # トリプルキック times = 2 # ダメージ倍率 x_renzoku = 0 if x_accuracy_2 >= random.randint(1,256): # 2回目の抽選 x_renzoku = 1 if gamemode == 2: # 後攻への乗算バグ(PBS) y_triple_pbs_2 = 2 if x_accuracy_2 >= random.randint(1,256): # 3回目の抽選 x_renzoku = 2 if gamemode == 2: y_triple_pbs_2 = 3 for _ in range(x_renzoku): # ダメージ累計 x_critical_2 = 0 # 急所の初期化 if x_critical_hit_2 >= random.randint(1,256): x_critical_2 = 1 if x_critical_2 == 0 and x_yakedo == 0: x_triple_kick = x_damage_2 * times * random.randint(217,255) // 255 elif x_critical_2 == 1 and x_yakedo == 0: x_triple_kick = x_critical_damage_2 * times * random.randint(217,255) // 255 elif x_critical_2 == 0 and x_yakedo == 1: x_triple_kick = bx_damage_2 * times * random.randint(217,255) // 255 elif x_critical_2 == 1 and x_yakedo == 1: x_triple_kick = bx_critical_damage_2 * times * random.randint(217,255) // 255 times += 1 rx_attack_2 += x_triple_kick elif x_sub_2 == 37 and x_level > 0: # サイコウェーブ rx_attack_2 = random.randint(1,rx_psycho_wave) elif x_sub_2 == 38: # 未来予知 rx_attack_2 = 0 elif x_sub_2 == 39: # じたばた if 1 <= x_hp <= x_flail_2: # 威力の決定 rx_attack_2 = x_f200 if x_yakedo == 0 else bx_f200 elif x_flail_2 + 1 <= x_hp <= x_flail_5: rx_attack_2 = x_f150 if x_yakedo == 0 else bx_f150 elif x_flail_5 + 1 <= x_hp <= x_flail_10: rx_attack_2 = x_f100 if x_yakedo == 0 else bx_f100 elif x_flail_10 + 1 <= x_hp <= x_flail_17: rx_attack_2 = x_f80 if x_yakedo == 0 else bx_f80 elif gamemode != 2 and x_flail_17 + 1 <= x_hp <= x_flail_33: rx_attack_2 = x_f40 if x_yakedo == 0 else bx_f40 elif gamemode == 2 and x_flail_17 + 1 <= x_hp <= x_flail_pbs: # PBS(40) rx_attack_2 = x_f40 if x_yakedo == 0 else bx_f40 elif gamemode != 2 and x_flail_33 + 1 <= x_hp <= x_max_hp: rx_attack_2 = x_f20 if x_yakedo == 0 else bx_f20 elif gamemode == 2 and x_flail_pbs + 1 <= x_hp <= x_max_hp: # PBS(20) rx_attack_2 = x_f20 if x_yakedo == 0 else bx_f20 elif x_sub_2 in (40,41): if x_sub_2 == 40: # 転がる if x_sub_1 == 40 and x_bit_1 == 1 and (x_korogaru <= 4): # 最大16倍, 丸くなる32倍 x_korogaru += 1 else: # 倍率リセット x_korogaru = 1 times = 2 ** (x_korogaru + x_marukunaru - 1) elif x_sub_2 == 41: # 連続斬り if x_sub_1 == 41 and x_bit_1 == 1 and (x_renzokugiri <= 4 or gamemode == 2): # 最大16倍, 無制限(PBS) x_renzokugiri += 1 else: # 倍率リセット x_renzokugiri = 1 times = 2 ** (x_renzokugiri - 1) if x_critical_2 == 0 and x_yakedo == 0: rx_attack_2 = x_damage_2 * times * random.randint(217,255) // 255 elif x_critical_2 == 1 and x_yakedo == 0: rx_attack_2 = x_critical_damage_2 * times * random.randint(217,255) // 255 elif x_critical_2 == 0 and x_yakedo == 1: rx_attack_2 = bx_damage_2 * times * random.randint(217,255) // 255 elif x_critical_2 == 1 and x_yakedo == 1: rx_attack_2 = bx_critical_damage_2 * times * random.randint(217,255) // 255 elif x_sub_2 == 42: # 痛み分け pain_split = (x_hp_2 + y_hp_2) // 2 x_hp_2 = y_hp_2 = pain_split if x_hp_2 > x_max_hp: # 最大HPを超えない x_hp_2 = x_max_hp if y_hp_2 > y_max_hp: y_hp_2 = y_max_hp elif x_sub_2 in (50,51): # 守る・堪える, 後攻で処理 rx_attack_2 = 0 elif x_sub_2 == 60 and random.randint(1,256) <= x_per_2: # 素早さダウン x_speed_ph += 1 if x_speed_ph == 1: y_speed = y_speed_ph1 elif x_speed_ph == 2: y_speed = y_speed_ph2 elif x_sub_2 == 61 and random.randint(1,256) <= x_per_2: # 命中率ダウン x_accuracy_ph += 1 if x_accuracy_ph == 1: y_accuracy_2, y_accuracy_3, y_accuracy_4 = y_accuracy_2_ph1, y_accuracy_3_ph1, y_accuracy_4_ph1 y1_accuracy, y2_accuracy, y3_accuracy = y1_accuracy_ph1, y2_accuracy_ph1, y3_accuracy_ph1 elif x_accuracy_ph == 2: y_accuracy_2, y_accuracy_3, y_accuracy_4 = y_accuracy_2_ph2, y_accuracy_3_ph2, y_accuracy_4_ph2 y1_accuracy, y2_accuracy, y3_accuracy = y1_accuracy_ph2, y2_accuracy_ph2, y3_accuracy_ph2 elif x_sub_2 in (62,63): # 防御or特防ダウン if x_sub_2 == 62 and random.randint(1,256) <= x_per_2: x_bd_ph += 1 elif x_sub_2 == 63: # 防御or特防-2 x_bd_ph += 2 if x_bd_ph == 1: x_damage_3, x_damage_4 = x_damage_3_ph1, x_damage_4_ph1 x_critical_damage_3, x_critical_damage_4 = x_critical_damage_3_ph1, x_critical_damage_4_ph1 bx_damage_3, bx_damage_4 = bx_damage_2_ph1, bx_damage_3_ph1, bx_damage_4_ph1 bx_critical_damage_3, bx_critical_damage_4 = bx_critical_damage_3_ph1, bx_critical_damage_4_ph1 x1_damage, x2_damage, x3_damage = x1_damage_ph1, x2_damage_ph1, x3_damage_ph1 x1_critical_damage, x2_critical_damage, x3_critical_damage = x1_critical_damage_ph1, x2_critical_damage_ph1, x3_critical_damage_ph1 y_konran_damage, by_konran_damage = y_konran_damage_ph1, by_konran_damage_ph1 elif x_bd_ph == 2: x_damage_3, x_damage_4 = x_damage_3_ph2, x_damage_4_ph2 x_critical_damage_3, x_critical_damage_4 = x_critical_damage_3_ph2, x_critical_damage_4_ph2 bx_damage_3, bx_damage_4 = bx_damage_3_ph2, bx_damage_4_ph2 bx_critical_damage_3, bx_critical_damage_4 = bx_critical_damage_3_ph2, bx_critical_damage_4_ph2 x1_damage, x2_damage, x3_damage = x1_damage_ph2, x2_damage_ph2, x3_damage_ph2 x1_critical_damage, x2_critical_damage, x3_critical_damage = x1_critical_damage_ph2, x2_critical_damage_ph2, x3_critical_damage_ph2 y_konran_damage, by_konran_damage = y_konran_damage_ph2, by_konran_damage_ph2 elif x_bd_ph == 3: x_damage_3, x_damage_4 = x_damage_3_ph3, x_damage_4_ph3 x_critical_damage_3, x_critical_damage_4 = x_critical_damage_3_ph3, x_critical_damage_4_ph3 bx_damage_3, bx_damage_4 = bx_damage_3_ph3, bx_damage_4_ph3 bx_critical_damage_3, bx_critical_damage_4 = bx_critical_damage_3_ph3, bx_critical_damage_4_ph3 x1_damage, x2_damage, x3_damage = x1_damage_ph3, x2_damage_ph3, x3_damage_ph3 x1_critical_damage, x2_critical_damage, x3_critical_damage = x1_critical_damage_ph3, x2_critical_damage_ph3, x3_critical_damage_ph3 y_konran_damage, by_konran_damage = y_konran_damage_ph3, by_konran_damage_ph3 elif x_bd_ph == 4: x_damage_3, x_damage_4 = x_damage_3_ph4, x_damage_4_ph4 x_critical_damage_3, x_critical_damage_4 = x_critical_damage_3_ph4, x_critical_damage_4_ph4 bx_damage_3, bx_damage_4 = bx_damage_3_ph4, bx_damage_4_ph4 bx_critical_damage_3, bx_critical_damage_4 = bx_critical_damage_3_ph4, bx_critical_damage_4_ph4 x1_damage, x2_damage, x3_damage = x1_damage_ph4, x2_damage_ph4, x3_damage_ph4 x1_critical_damage, x2_critical_damage, x3_critical_damage = x1_critical_damage_ph4, x2_critical_damage_ph4, x3_critical_damage_ph4 y_konran_damage, by_konran_damage = y_konran_damage_ph4, by_konran_damage_ph4 if x_bit_2 == 1: # ダメージの判定 y_hp_2 -= rx_attack_2 if x_sub_2 == 20: # 攻撃の反動ダメージ x_hp_2 -= rx_attack_2 // 4 elif x_sub_2 == 21: # HPドレイン x_hp_2 += rx_attack_2 // 2 if x_hp_2 > x_max_hp: # 最大HPを超えない x_hp_2 = x_max_hp if x_ouja_2 == 1 and random.randint(1,256) <= 30: # 先攻のみ王者の抽選 y_hirumi = 1 if y_hachimaki == 1 and y_hp_2 <= 0 and random.randint(1,256) <= 30: # 鉢巻の抽選 y_hp_2 = 1 if y_hp_2 <= 0: # 相手の瀕死判定 x_count_2 += 1 continue elif x_hp_2 <= 0: # 自分の瀕死判定 y_count_2 += 1 continue elif x_sub_2 == 25 and x_bit_2 == 0: # 飛び蹴りの自傷 if gamemode != 2: # GB/N64 x_hp_2 -= rx_attack_2 // 8 elif gamemode == 2: # PBS x_hp_2 -= rx_attack_2 // 4 if x_hp_2 <= 0: # 自分の瀕死判定 y_count_2 += 1 continue if x_hirumi == 1: # 怯みの解除 x_hirumi = 0 # 追加効果の抽選 if x_bit_2 == 1 and 0 < x_sub_2 <= 13: if x_sub_2 == 1: # 怯みの付与 if random.randint(1,256) <= x_per_2: y_hirumi = 1 elif x_sub_2 == 2: # 凍りの付与 if random.randint(1,256) <= x_per_2 and not any([y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku]): y_koori = 1 if y_yaketa == y_stock == 1: # 焼けた木の実 y_koori, y_stock = 0, 0 elif x_sub_2 == 3: # 眠りの付与 if not any([y_koori, y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku]): if gamemode == 0: # GB y_nemuri = random.randint(2,7) elif gamemode == 1: # N64 y_nemuri = random.randint(2,4) elif gamemode == 2: # PBS y_nemuri = random.randint(2,5) if y_hakka == y_stock == 1: # 薄荷の実 y_nemuri, y_stock = 0, 0 elif x_sub_2 == 4: # 混乱の付与 if random.randint(1,256) <= x_per_2 and y_konran == 0: y_konran = random.randint(2,5) if y_nigai == y_stock == 1: # 苦い木の実 y_konran, y_stock = 0, 0 elif x_sub_2 == 5: # メロメロの付与 y_meromero = 1 elif x_sub_2 == 6: # 麻痺の付与 if random.randint(1,256) <= x_per_2 and not any([y_koori, y_nemuri, y_doku, y_yakedo, y_moudoku]): y_mahi = 1 if y_mahinaoshi == y_stock == 1: # 麻痺治しの実 y_mahi, y_stock = 0, 0 elif x_sub_2 == 7: # 毒の付与 if random.randint(1,256) <= x_per_2 and not any([y_koori, y_nemuri, y_mahi, y_yakedo, y_moudoku]): y_doku = 1 if y_dokukeshi == y_stock == 1: # 毒消しの実 y_doku, y_stock = 0, 0 elif x_sub_2 == 8: # 火傷の付与 if random.randint(1,256) <= x_per_2 and not any([y_koori, y_nemuri, y_mahi, y_doku, y_moudoku]): y_yakedo = 1 if y_kootta == y_stock == 1: # 凍った木の実 y_yakedo, y_stock = 0, 0 elif x_sub_2 == 9: # 猛毒の付与 if not any([y_koori, y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku]): y_moudoku = 1 if y_dokukeshi == y_stock == 1: # 毒消しの実 y_moudoku, y_stock = 0, 0 elif x_sub_2 == 10: # 宿り木の付与 y_yadorigi = 1 elif x_sub_2 == 11 and (y_nemuri > 0): # 悪夢の付与 y_akumu = 1 elif x_sub_2 == 12: # 呪いの付与 y_noroi = 1 x_hp_2 -= x_trunc_2 if x_hp_2 <= 0: # 自分の瀕死判定 y_count_2 += 1 continue elif x_sub_2 == 13 and random.randint(1,256) <= 51: # トライアタックの付与(凍り・麻痺・火傷) rx_tri_attack = random.randint(1,3) if rx_tri_attack == 1: # 凍りの付与 if not any([y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku]): y_koori = 1 if y_yaketa == y_stock == 1: # 焼けた木の実 y_koori, y_stock = 0, 0 elif rx_tri_attack == 2: # 麻痺の付与 if not any([y_koori, y_nemuri, y_doku, y_yakedo, y_moudoku]): y_mahi = 1 if y_mahinaoshi == y_stock == 1: # 麻痺治しの実 y_mahi, y_stock = 0, 0 elif rx_tri_attack == 3: # 火傷の付与 if not any([y_koori, y_nemuri, y_mahi, y_doku, y_moudoku]): y_yakedo = 1 if y_kootta == y_stock == 1: # 凍った木の実 y_yakedo, y_stock = 0, 0 elif y_koori == 1: # 相手が凍りなら火傷で解除 y_koori = 0 if y_kiseki == y_stock == 1 and any([y_koori, y_nemuri, y_konran, y_mahi, y_doku, y_yakedo, y_moudoku]): # 奇跡の実 y_koori, y_nemuri, y_konran, y_mahi, y_doku, y_yakedo, y_moudoku, y_stock = 0, 0, 0, 0, 0, 0, 0, 0 # 自分のターン終了時(2A) if x_doku == 1: # 毒 x_hp_2 -= x_trunc_8 elif x_yakedo == 1: # 火傷 x_hp_2 -= x_trunc_8 elif x_moudoku > 0: # 猛毒 x_hp_2 -= x_trunc_16 * x_moudoku x_moudoku += 1 if x_yadorigi == 1: # 宿り木の種 x_hp_2 -= x_trunc_8 y_hp_2 += x_trunc_8 if y_hp_2 > y_max_hp: y_hp_2 = y_max_hp if x_akumu == 1 and x_nemuri > 0: # 悪夢 x_hp_2 -= x_trunc_4 if x_noroi == 1: # 呪い x_hp_2 -= x_trunc_4 if x_hp_2 <= 0: # 自分の瀕死判定 y_count_2 += 1 continue # 後攻 / プレイヤー2 if y_critical_hit_2 >= random.randint(1,256): # 急所の抽選 y_critical_2 = 1 if y_accuracy_2 < random.randint(1,256): # 命中率の抽選 y_bit_2 = 0 if y_hirumi == 1 and gamemode == 2: # 怯み時の判定(PBS) y_bit_2 = 2 if y_koori == 1: # 凍り時の判定: y_bit_2 = 2 elif y_nemuri > 0 and y_bit_2 != 2: # 眠り時の判定 y_nemuri -= 1 if y_nemuri > 0: y_bit_2 = 2 if y_sub_2 == 29: # 寝言の判定 y_bit_2 = 3 elif y_nemuri == 0: # 起きたら悪夢を解除 y_akumu = 0 if y_hirumi == 1 and gamemode != 2: # 怯み時の判定(GB/N64) y_bit_2 = 2 if y_meromero == 1 and y_bit_2 != 2 and random.randint(1,2) == 1: # メロメロ時の判定 y_bit_2 = 2 if y_mahi == 1 and y_bit_2 != 2 and random.randint(1,4) == 1: # 麻痺時の判定 y_bit_2 = 2 if y_konran > 0 and y_bit_2 != 2: # 混乱時の判定 y_konran -= 1 if random.randint(1,2) == 1 and y_konran > 0: if gamemode != 2 and y_yakedo == 0: # GB/N64は最大値 y_hp_2 -= y_konran_damage elif gamemode != 2 and y_yakedo == 1: y_hp_2 -= by_konran_damage elif gamemode == 2 and y_yakedo == 0: y_hp_2 -= y_konran_damage * random.randint(217,255) // 255 elif gamemode == 2 and y_yakedo == 1: y_hp_2 -= by_konran_damage * random.randint(217,255) // 255 y_bit_2 = 2 if y_hp_2 <= 0: # 自傷の瀕死判定 x_count_2 += 1 continue if y_sub_2 == 29 and y_bit_2 == 3: # 寝言の抽選 y_bit_2 = 1 if y_negoto_way == 2: ry_negoto = random.randint(1,2) elif y_negoto_way == 3: ry_negoto = random.randint(1,3) if ry_negoto == 1: y_damage_2, y_critical_damage_2, y_accuracy_2, y_critical_hit_2 = y1_damage, y1_critical_damage, y1_accuracy, y1_critical_hit y_sub_2, y_per_2 = y1_sub, y1_per elif ry_negoto == 2: y_damage_2, y_critical_damage_2, y_accuracy_2, y_critical_hit_2 = y2_damage, y2_critical_damage, y2_accuracy, y2_critical_hit y_sub_2, y_per_2 = y2_sub, y2_per elif ry_negoto == 3: y_damage_2, y_critical_damage_2, y_accuracy_2, y_critical_hit_2 = y3_damage, y3_critical_damage, y3_accuracy, y3_critical_hit y_sub_2, y_per_2 = y3_sub, y3_per if y_critical_hit_2 >= random.randint(1,256): # 急所の抽選 y_critical_2 = 1 if y_accuracy_2 < random.randint(1,256): # 命中率の抽選 y_bit_2 = 0 if x_sub_2 in (50,51): # 先攻の守る・堪える if not x_sub_1 in (50,51): x_protect = 1 rx_protect = (1/2 ** (x_protect - 1) * 256 - 1/256) // 1 if x_bit_2 != 2 and (rx_protect >= random.randint(1,256) or (gamemode == 2 and x_protect == 1)): # 1ターン目は必ず成功(PBS) x_protect += 1 if x_sub_2 == 50 and not y_sub_2 in (11,12,27,28,38): # 守る # 悪夢・呪い・回復・未来予知は有効 y_bit_2 = 0 else: x_protect = 1 if y_bit_2 == 1 or y_sub_2 == 25: # 攻撃の判定 if y_critical_2 == 0 and y_yakedo == 0: ry_attack_2 = y_damage_2 * y_triple_pbs_2 * random.randint(217,255) // 255 elif y_critical_2 == 1 and y_yakedo == 0: ry_attack_2 = y_critical_damage_2 * y_triple_pbs_2 * random.randint(217,255) // 255 elif y_critical_2 == 0 and y_yakedo == 1: ry_attack_2 = by_damage_2 * y_triple_pbs_2 * random.randint(217,255) // 255 elif y_critical_2 == 1 and y_yakedo == 1: ry_attack_2 = by_critical_damage_2 * y_triple_pbs_2 * random.randint(217,255) // 255 if y_sub_2 >= 22 and y_bit_2 == 1: # 技の効果 if y_sub_2 == 22: # 怒りの前歯 ry_attack_2 = x_hp_2 // 2 elif y_sub_2 == 23: # 固定ダメージ ry_attack_2 = y_damage_2 elif y_sub_2 == 24: # プレゼント ry_gift = random.randint(1,10) if gamemode != 2 and ry_gift in (1,2): # GB/N64の回復 ry_attack_2 = -x_trunc_4 elif gamemode == 2 and ry_gift in (1,2): # PBSの回復 ry_attack_2 = -80 elif y_critical_2 == 0 and y_yakedo == 0: if ry_gift in (3,4,5,6): ry_attack_2 = y_g40 * y_triple_pbs_2 * random.randint(217,255) // 255 elif ry_gift in (7,8,9): ry_attack_2 = y_g80 * y_triple_pbs_2 * random.randint(217,255) // 255 elif ry_gift == 10: ry_attack_2 = y_g120 * y_triple_pbs_2 * random.randint(217,255) // 255 elif y_critical_2 == 1 and y_yakedo == 0: if ry_gift in (3,4,5,6): ry_attack_2 = y_cg40 * y_triple_pbs_2 * random.randint(217,255) // 255 elif ry_gift in (7,8,9): ry_attack_2 = y_cg80 * y_triple_pbs_2 * random.randint(217,255) // 255 elif ry_gift == 10: ry_attack_2 = y_cg120 * y_triple_pbs_2 * random.randint(217,255) // 255 elif y_critical_2 == 0 and y_yakedo == 1: if ry_gift in (3,4,5,6): ry_attack_2 = by_g40 * y_triple_pbs_2 * random.randint(217,255) // 255 elif ry_gift in (7,8,9): ry_attack_2 = by_g80 * y_triple_pbs_2 * random.randint(217,255) // 255 elif ry_gift == 10: ry_attack_2 = by_g120 * y_triple_pbs_2 * random.randint(217,255) // 255 elif y_critical_2 == 1 and y_yakedo == 1: if ry_gift in (3,4,5,6): ry_attack_2 = by_cg40 * y_triple_pbs_2 * random.randint(217,255) // 255 elif ry_gift in (7,8,9): ry_attack_2 = by_cg80 * y_triple_pbs_2 * random.randint(217,255) // 255 elif ry_gift == 10: ry_attack_2 = by_cg120 * y_triple_pbs_2 * random.randint(217,255) // 255 if x_hp_2 > x_max_hp: # 最大HPを超えない x_hp_2 = x_max_hp elif y_sub_2 == 27: # 1/2回復 ry_attack_2 = 0 y_hp_2 += y_trunc_2 if y_hp_2 > y_max_hp: # 最大HPを超えない y_hp_2 = y_max_hp elif y_sub_2 == 28: # 眠る ry_attack_2 = 0 if y_hp_2 < y_max_hp: # 最大HP未満なら回復 y_hp_2 = y_max_hp y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku = 3, 0, 0, 0, 0 # 2ターン眠り elif y_sub_2 == 30: # カウンターorミラーコート ry_attack_2 = rx_attack_2 * 2 if 999 <= x_damage_2 and x_bit_2 == 0 and gamemode == 0: # 一撃外れをカウンター(GB) ry_attack_2 = x_max_hp elif y_sub_2 in (33,34,35): # 2-5連続攻撃 ry_attack_2 = 0 # ダメージの初期化 if y_sub_2 == 33: ry_renzoku = random.randint(1,8) if ry_renzoku in (1,2,3): y_renzoku = 2 elif ry_renzoku in (4,5,6): y_renzoku = 3 elif ry_renzoku == 7: y_renzoku = 4 elif ry_renzoku == 8: y_renzoku = 5 elif y_sub_2 in (34,35): # 2連続攻撃 y_renzoku = 2 if y_sub_2 == 35 and random.randint(1,256) <= 51 and not any([x_koori, x_nemuri, x_mahi, x_yakedo, x_moudoku]): x_doku = 1 # ダブルニードル for _ in range(y_renzoku): # ダメージ累計 y_critical_2 = 0 # 急所の初期化 if y_critical_hit_2 >= random.randint(1,256): # 急所の抽選 y_critical_2 = 1 if y_critical_2 == 0 and y_yakedo == 0: y_renzoku_damage = y_damage_2 * y_triple_pbs_2 * random.randint(217,255) // 255 elif y_critical_2 == 1 and y_yakedo == 0: y_renzoku_damage = y_critical_damage_2 * y_triple_pbs_2 * random.randint(217,255) // 255 elif y_critical_2 == 0 and y_yakedo == 1: y_renzoku_damage = by_damage_2 * y_triple_pbs_2 * random.randint(217,255) // 255 elif y_critical_2 == 1 and y_yakedo == 1: y_renzoku_damage = by_critical_damage_2 * y_triple_pbs_2 * random.randint(217,255) // 255 ry_attack_2 += y_renzoku_damage elif y_sub_2 == 36: # トリプルキック times = 2 # ダメージ倍率 y_renzoku = 0 if y_accuracy_2 >= random.randint(1,256): # 2回目の抽選 y_renzoku = 1 if y_accuracy_2 >= random.randint(1,256): # 3回目の抽選 y_renzoku = 2 for _ in range(y_renzoku): # ダメージ累計 y_critical_2 = 0 # 急所の初期化 if y_critical_hit_2 >= random.randint(1,256): y_critical_2 = 1 if y_critical_2 == 0 and y_yakedo == 0: y_triple_kick = y_damage_2 * times * random.randint(217,255) // 255 elif y_critical_2 == 1 and y_yakedo == 0: y_triple_kick = y_critical_damage_2 * times * random.randint(217,255) // 255 elif y_critical_2 == 0 and y_yakedo == 1: y_triple_kick = by_damage_2 * times * random.randint(217,255) // 255 elif y_critical_2 == 1 and y_yakedo == 1: y_triple_kick = by_critical_damage_2 * times * random.randint(217,255) // 255 times += 1 ry_attack_2 += y_triple_kick elif y_sub_2 == 37 and y_level > 0: # サイコウェーブ ry_attack_2 = random.randint(1,ry_psycho_wave) elif y_sub_2 == 38: # 未来予知 ry_attack_2 = 0 elif y_sub_2 == 39: # じたばた if 1 <= y_hp <= y_flail_2: # 威力の決定 ry_attack_2 = y_f200 if y_yakedo == 0 else by_f200 elif y_flail_2 + 1 <= y_hp <= y_flail_5: ry_attack_2 = y_f150 if y_yakedo == 0 else by_f150 elif y_flail_5 + 1 <= y_hp <= y_flail_10: ry_attack_2 = y_f100 if y_yakedo == 0 else by_f100 elif y_flail_10 + 1 <= y_hp <= y_flail_17: ry_attack_2 = y_f80 if y_yakedo == 0 else by_f80 elif gamemode != 2 and y_flail_17 + 1 <= y_hp <= y_flail_33: ry_attack_2 = y_f40 if y_yakedo == 0 else by_f40 elif gamemode == 2 and y_flail_17 + 1 <= y_hp <= y_flail_pbs: # PBS(40) ry_attack_2 = y_f40 if y_yakedo == 0 else by_f40 elif gamemode != 2 and y_flail_33 + 1 <= y_hp <= y_max_hp: ry_attack_2 = y_f20 if y_yakedo == 0 else by_f20 elif gamemode == 2 and y_flail_pbs + 1 <= y_hp <= y_max_hp: # PBS(20) ry_attack_2 = y_f20 if y_yakedo == 0 else by_f20 if gamemode == 2: # 最高乱数+1ダメージ(PBS) ry_attack_2 = ry_attack_2 * y_triple_pbs_2 + 1 elif y_sub_2 in (40,41): if y_sub_2 == 40: # 転がる if y_sub_1 == 40 and y_bit_1 == 1 and (x_korogaru <= 4): # 最大16倍, 丸くなる32倍 y_korogaru += 1 else: # 倍率リセット y_korogaru = 1 times = 2 ** (y_korogaru + y_marukunaru - 1) elif y_sub_2 == 41: # 連続斬り if y_sub_1 == 41 and y_bit_1 == 1 and (x_renzokugiri <= 4 or gamemode == 2): # 最大16倍, 無制限(PBS) y_renzokugiri += 1 else: # 倍率リセット y_renzokugiri = 1 times = 2 ** (y_renzokugiri - 1) if y_critical_2 == 0 and y_yakedo == 0: ry_attack_2 = y_damage_2 * times * random.randint(217,255) // 255 elif y_critical_2 == 1 and y_yakedo == 0: ry_attack_2 = y_critical_damage_2 * times * random.randint(217,255) // 255 elif y_critical_2 == 0 and y_yakedo == 1: ry_attack_2 = by_damage_2 * times * random.randint(217,255) // 255 elif y_critical_2 == 1 and y_yakedo == 1: ry_attack_2 = by_critical_damage_2 * times * random.randint(217,255) // 255 elif y_sub_2 == 42: # 痛み分け pain_split = (y_hp_2 + x_hp_2) // 2 y_hp_2 = x_hp_2 = pain_split if y_hp_2 > y_max_hp: # 最大HPを超えない y_hp_2 = y_max_hp if x_hp_2 > x_max_hp: x_hp_2 = x_max_hp elif y_sub_2 in (50,51): # 守る・堪える, 後攻は失敗 ry_attack_2, y_protect = 0, 1 elif y_sub_2 == 60 and random.randint(1,256) <= y_per_2: # 素早さダウン y_speed_ph += 1 if y_speed_ph == 1: x_speed = x_speed_ph1 elif y_speed_ph == 2: x_speed = x_speed_ph2 elif y_sub_2 == 61 and random.randint(1,256) <= y_per_2: # 命中率ダウン y_accuracy_ph += 1 if y_accuracy_ph == 1: x_accuracy_3, x_accuracy_4 = x_accuracy_3_ph1, x_accuracy_4_ph1 x1_accuracy, x2_accuracy, x3_accuracy = x1_accuracy_ph1, x2_accuracy_ph1, x3_accuracy_ph1 elif y_accuracy_ph == 2: x_accuracy_3, x_accuracy_4 = x_accuracy_3_ph2, x_accuracy_4_ph2 x1_accuracy, x2_accuracy, x3_accuracy = x1_accuracy_ph2, x2_accuracy_ph2, x3_accuracy_ph2 elif y_sub_2 in (62,63): # 防御or特防ダウン if y_sub_2 == 62 and random.randint(1,256) <= y_per_2: y_bd_ph += 1 elif y_sub_2 == 63: # 防御or特防-2 y_bd_ph += 2 if y_bd_ph == 1: y_damage_3, y_damage_4 = y_damage_3_ph1, y_damage_4_ph1 y_critical_damage_3, y_critical_damage_4 = y_critical_damage_3_ph1, y_critical_damage_4_ph1 by_damage_3, by_damage_4 = by_damage_3_ph1, by_damage_4_ph1 by_critical_damage_3, by_critical_damage_4 = by_critical_damage_3_ph1, by_critical_damage_4_ph1 y1_damage, y2_damage, y3_damage = y1_damage_ph1, y2_damage_ph1, y3_damage_ph1 y1_critical_damage, y2_critical_damage, y3_critical_damage = y1_critical_damage_ph1, y2_critical_damage_ph1, y3_critical_damage_ph1 x_konran_damage, bx_konran_damage = x_konran_damage_ph1, bx_konran_damage_ph1 elif y_bd_ph == 2: y_damage_3, y_damage_4 = y_damage_3_ph2, y_damage_4_ph2 y_critical_damage_3, y_critical_damage_4 = y_critical_damage_3_ph2, y_critical_damage_4_ph2 by_damage_3, by_damage_4 = by_damage_3_ph2, by_damage_4_ph2 by_critical_damage_3, by_critical_damage_4 = by_critical_damage_3_ph2, by_critical_damage_4_ph2 y1_damage, y2_damage, y3_damage = y1_damage_ph2, y2_damage_ph2, y3_damage_ph2 y1_critical_damage, y2_critical_damage, y3_critical_damage = y1_critical_damage_ph2, y2_critical_damage_ph2, y3_critical_damage_ph2 x_konran_damage, bx_konran_damage = x_konran_damage_ph2, bx_konran_damage_ph2 elif y_bd_ph == 3: y_damage_3, y_damage_4 = y_damage_3_ph3, y_damage_4_ph3 y_critical_damage_3, y_critical_damage_4 = y_critical_damage_3_ph3, y_critical_damage_4_ph3 by_damage_3, by_damage_4 = by_damage_3_ph3, by_damage_4_ph3 by_critical_damage_3, by_critical_damage_4 = by_critical_damage_3_ph3, by_critical_damage_4_ph3 y1_damage, y2_damage, y3_damage = y1_damage_ph3, y2_damage_ph3, y3_damage_ph3 y1_critical_damage, y2_critical_damage, y3_critical_damage = y1_critical_damage_ph3, y2_critical_damage_ph3, y3_critical_damage_ph3 x_konran_damage, bx_konran_damage = x_konran_damage_ph3, bx_konran_damage_ph3 elif y_bd_ph == 4: y_damage_3, y_damage_4 = y_damage_3_ph4, y_damage_4_ph4 y_critical_damage_3, y_critical_damage_4 = y_critical_damage_3_ph4, y_critical_damage_4_ph4 by_damage_3, by_damage_4 = by_damage_3_ph4, by_damage_4_ph4 by_critical_damage_3, by_critical_damage_4 = by_critical_damage_3_ph4, by_critical_damage_4_ph4 y1_damage, y2_damage, y3_damage = y1_damage_ph4, y2_damage_ph4, y3_damage_ph4 y1_critical_damage, y2_critical_damage, y3_critical_damage = y1_critical_damage_ph4, y2_critical_damage_ph4, y3_critical_damage_ph4 x_konran_damage, bx_konran_damage = x_konran_damage_ph4, bx_konran_damage_ph4 if y_bit_2 == 1: # ダメージの判定 x_hp_2 -= ry_attack_2 if y_sub_2 == 20: # 攻撃の反動ダメージ y_hp_2 -= ry_attack_2 // 4 elif y_sub_2 == 21: # HPドレイン y_hp_2 += ry_attack_2 // 2 if y_hp_2 > y_max_hp: # 最大HPを超えない y_hp_2 = y_max_hp if x_sub_2 == 51 and x_hp_2 <= 0 and x_protect > 1 and x_bit_2 == 1: # 堪える x_hp_2 = 1 if x_hachimaki == 1 and x_hp_2 <= 0 and random.randint(1,256) <= 30: # 鉢巻の抽選 x_hp_2 = 1 if x_hp_2 <= 0: # 相手の瀕死判定 y_count_2 += 1 continue elif y_hp_2 <= 0: # 自分の瀕死判定 x_count_2 += 1 continue elif y_sub_2 == 25 and y_bit_2 == 0: # 飛び蹴りの自傷 if gamemode != 2: # GB/N64 y_hp_2 -= ry_attack_2 // 8 elif gamemode == 2: # PBS y_hp_2 -= ry_attack_2 // 4 if y_hp_2 <= 0: # 自分の瀕死判定 x_count_2 += 1 continue if y_hirumi == 1: # 怯みの解除 y_hirumi = 0 # 追加効果の抽選 if y_bit_2 == 1 and 0 < y_sub_2 <= 13: # 先攻は怯まない if y_sub_2 == 2: # 凍りの付与 if random.randint(1,256) <= y_per_2 and not any([x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku]): x_koori = 1 if x_yaketa == x_stock == 1: # 焼けた木の実 x_koori, x_stock = 0, 0 elif y_sub_2 == 3: # 眠りの付与 if not any([x_koori, x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku]): if gamemode == 0: # GB x_nemuri = random.randint(2,7) elif gamemode == 1: # N64 x_nemuri = random.randint(2,4) elif gamemode == 2: # PBS x_nemuri = random.randint(2,5) if x_hakka == x_stock == 1: # 薄荷の実 x_nemuri, x_stock = 0, 0 elif y_sub_2 == 4: # 混乱の付与 if random.randint(1,256) <= y_per_2 and x_konran == 0: x_konran = random.randint(2,5) if x_nigai == x_stock == 1: # 苦い木の実 x_konran, x_stock = 0, 0 elif y_sub_2 == 5: # メロメロの付与 x_meromero = 1 elif y_sub_2 == 6: # 麻痺の付与 if random.randint(1,256) <= y_per_2 and not any([x_koori, x_nemuri, x_doku, x_yakedo, x_moudoku]): x_mahi = 1 if x_mahinaoshi == x_stock == 1: # 麻痺治しの実 x_mahi, x_stock = 0, 0 elif y_sub_2 == 7: # 毒の付与 if random.randint(1,256) <= y_per_2 and not any([x_koori, x_nemuri, x_mahi, x_yakedo, x_moudoku]): x_doku = 1 if x_dokukeshi == x_stock == 1: # 毒消しの実 x_doku, x_stock = 0, 0 elif y_sub_2 == 8: # 火傷の付与 if random.randint(1,256) <= y_per_2 and not any([x_koori, x_nemuri, x_mahi, x_doku, x_moudoku]): x_yakedo = 1 if x_kootta == x_stock == 1: # 凍った木の実 x_yakedo, x_stock = 0, 0 elif y_sub_2 == 9: # 猛毒の付与 if not any([x_koori, x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku]): x_moudoku = 1 if x_dokukeshi == x_stock == 1: # 毒消しの実 x_moudoku, x_stock = 0, 0 elif y_sub_2 == 10: # 宿り木の付与 x_yadorigi = 1 elif y_sub_2 == 11 and (x_nemuri > 0): # 悪夢の付与 x_akumu = 1 elif y_sub_2 == 12: # 呪いの付与 x_noroi = 1 y_hp_2 -= y_trunc_2 if y_hp_2 <= 0: # 自分の瀕死判定 x_count_2 += 1 continue elif y_sub_2 == 13 and random.randint(1,256) <= 51: # トライアタックの付与(凍り・麻痺・火傷) ry_tri_attack = random.randint(1,3) if ry_tri_attack == 1: # 凍りの付与 if not any([x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku]): x_koori = 1 if x_yaketa == x_stock == 1: # 焼けた木の実 x_koori, x_stock = 0, 0 elif ry_tri_attack == 2: # 麻痺の付与 if not any([x_koori, x_nemuri, x_doku, x_yakedo, x_moudoku]): x_mahi = 1 if x_mahinaoshi == x_stock == 1: # 麻痺治しの実 x_mahi, x_stock = 0, 0 elif ry_tri_attack == 3: # 火傷の付与 if not any([x_koori, x_nemuri, x_mahi, x_doku, x_moudoku]): x_yakedo = 1 if x_kootta == x_stock == 1: # 凍った木の実 x_yakedo, x_stock = 0, 0 elif x_koori == 1: # 相手が凍りなら火傷で解除 x_koori = 0 if x_kiseki == x_stock == 1 and any([x_koori, x_nemuri, x_konran, x_mahi, x_doku, x_yakedo, x_moudoku]): # 奇跡の実 x_koori, x_nemuri, x_konran, x_mahi, x_doku, x_yakedo, x_moudoku, x_stock = 0, 0, 0, 0, 0, 0, 0, 0 # 自分のターン終了時(2A) if y_doku == 1: # 毒 y_hp_2 -= y_trunc_8 elif y_yakedo == 1: # 火傷 y_hp_2 -= y_trunc_8 elif y_moudoku > 0: # 猛毒 y_hp_2 -= y_trunc_16 * y_moudoku y_moudoku += 1 if y_yadorigi == 1: # 宿り木の種 y_hp_2 -= y_trunc_8 x_hp_2 += y_trunc_8 if x_hp_2 > x_max_hp: x_hp_2 = x_max_hp if y_akumu == 1 and y_nemuri > 0: # 悪夢 y_hp_2 -= y_trunc_4 if y_noroi == 1: # 呪い y_hp_2 -= y_trunc_4 if y_hp_2 <= 0: # 自分の瀕死判定 x_count_2 += 1 continue # 全体のターン終了時(2A) if y_mirai_2 == 1 and random.randint(1,256) <= y_mirai_accuracy_2: # 未来予知の判定 x_hp_2 -= y_mirai_damage_2 * random.randint(217,255) // 255 if x_hp_2 <= 0: # 行動順で瀕死の判定 y_count_2 += 1 continue if x_mirai_2 == 1 and random.randint(1,256) <= x_mirai_accuracy_2: y_hp_2 -= x_mirai_damage_2 * random.randint(217,255) // 255 if y_hp_2 <= 0: x_count_2 += 1 continue if suna_2 == 1: # 砂嵐の判定 if x_suna == 1: # 行動順で瀕死の判定 x_hp_2 -= x_trunc_8 if x_hp_2 <= 0: y_count_2 += 1 continue if y_suna == 1: y_hp_2 -= y_trunc_8 if y_hp_2 <= 0: x_count_2 += 1 continue if x_tabenokoshi == 1 and x_hp_2 > 0: # 食べ残しの回復 x_hp_2 += x_trunc_16 if x_hp_2 > x_max_hp: # 最大HPを超えない x_hp_2 = x_max_hp if y_tabenokoshi == 1 and y_hp_2 > 0: y_hp_2 += y_trunc_16 if y_hp_2 > y_max_hp: y_hp_2 = y_max_hp if x_koori == 1 and random.randint(1,256) <= 25: # 凍り時の判定 x_koori = 0 if y_koori == 1 and random.randint(1,256) <= 25: y_koori = 0 if x_nemuri > 0 and x_hakka == x_stock == 1: # 眠るの回復 x_nemuri, x_stock = 0, 0 elif x_nemuri > 0 and x_kiseki == x_stock == 1: # 混乱ごと回復 x_nemuri, x_konran, x_stock = 0, 0, 0 if y_nemuri > 0 and y_hakka == y_stock == 1: y_nemuri, y_stock = 0, 0 elif y_nemuri > 0 and y_kiseki == y_stock == 1: y_nemuri, y_konran, y_stock = 0, 0, 0 if x_kinomi != 0 and x_stock == 1 and x_ceil_2 > x_hp_2 > 0: # 木の実の回復 if x_kinomi == 3: x_hp_2 += 30 elif x_kinomi == 2: x_hp_2 += 20 elif x_kinomi == 1: x_hp_2 += 10 x_stock = 0 if y_kinomi != 0 and y_stock == 1 and y_ceil_2 > y_hp_2 > 0: if y_kinomi == 3: y_hp_2 += 30 elif y_kinomi == 2: y_hp_2 += 20 elif y_kinomi == 1: y_hp_2 += 10 y_stock = 0 # プレイヤー2の先制 else: # 先攻 / プレイヤー2 if y_critical_hit_2 >= random.randint(1,256): # 急所の抽選 y_critical_2 = 1 if y_accuracy_2 < random.randint(1,256): # 命中率の抽選 y_bit_2 = 0 if y_koori == 1: # 凍り時の判定: y_bit_2 = 2 elif y_nemuri > 0: # 眠り時の判定 y_nemuri -= 1 if y_nemuri > 0: y_bit_2 = 2 if y_sub_2 == 29: # 寝言の判定 y_bit_2 = 3 elif y_nemuri == 0: # 起きたら悪夢を解除 y_akumu = 0 if y_meromero == 1 and y_bit_2 != 2 and random.randint(1,2) == 1: # メロメロ時の判定 y_bit_2 = 2 if y_mahi == 1 and y_bit_2 != 2 and random.randint(1,4) == 1: # 麻痺時の判定 y_bit_2 = 2 if y_konran > 0 and y_bit_2 != 2: # 混乱時の判定 y_konran -= 1 if random.randint(1,2) == 1 and y_konran > 0: if gamemode != 2 and y_yakedo == 0: # GB/N64は最大値 y_hp_2 -= y_konran_damage elif gamemode != 2 and y_yakedo == 1: y_hp_2 -= by_konran_damage elif gamemode == 2 and y_yakedo == 0: y_hp_2 -= y_konran_damage * random.randint(217,255) // 255 elif gamemode == 2 and y_yakedo == 1: y_hp_2 -= by_konran_damage * random.randint(217,255) // 255 y_bit_2 = 2 if y_hp_2 <= 0: # 自傷の瀕死判定 x_count_2 += 1 continue if y_sub_2 == 29 and y_bit_2 == 3: # 寝言の抽選 y_bit_2 = 1 if y_negoto_way == 2: ry_negoto = random.randint(1,2) elif y_negoto_way == 3: ry_negoto = random.randint(1,3) if ry_negoto == 1: y_damage_2, y_critical_damage_2, y_accuracy_2, y_critical_hit_2 = y1_damage, y1_critical_damage, y1_accuracy, y1_critical_hit y_sub_2, y_per_2 = y1_sub, y1_per elif ry_negoto == 2: y_damage_2, y_critical_damage_2, y_accuracy_2, y_critical_hit_2 = y2_damage, y2_critical_damage, y2_accuracy, y2_critical_hit y_sub_2, y_per_2 = y2_sub, y2_per elif ry_negoto == 3: y_damage_2, y_critical_damage_2, y_accuracy_2, y_critical_hit_2 = y3_damage, y3_critical_damage, y3_accuracy, y3_critical_hit y_sub_2, y_per_2 = y3_sub, y3_per if y_critical_hit_2 >= random.randint(1,256): # 急所の抽選 y_critical_2 = 1 if y_accuracy_2 < random.randint(1,256): # 命中率の抽選 y_bit_2 = 0 if y_bit_2 == 1 or y_sub_2 == 25: # 攻撃の判定 if y_critical_2 == 0 and y_yakedo == 0: ry_attack_2 = y_damage_2 * random.randint(217,255) // 255 elif y_critical_2 == 1 and y_yakedo == 0: ry_attack_2 = y_critical_damage_2 * random.randint(217,255) // 255 elif y_critical_2 == 0 and y_yakedo == 1: ry_attack_2 = by_damage_2 * random.randint(217,255) // 255 elif y_critical_2 == 1 and y_yakedo == 1: ry_attack_2 = by_critical_damage_2 * random.randint(217,255) // 255 if y_sub_2 >= 22 and y_bit_2 == 1: # 技の効果 if y_sub_2 == 22: # 怒りの前歯 ry_attack_2 = x_hp_2 // 2 elif y_sub_2 == 23: # 固定ダメージ ry_attack_2 = y_damage_2 elif y_sub_2 == 24: # プレゼント ry_gift = random.randint(1,10) if gamemode != 2 and ry_gift in (1,2): # GB/N64の回復 ry_attack_2 = -x_trunc_4 elif gamemode == 2 and ry_gift in (1,2): # PBSの回復 ry_attack_2 = -80 elif y_critical_2 == 0 and y_yakedo == 0: if ry_gift in (3,4,5,6): ry_attack_2 = y_g40 * random.randint(217,255) // 255 elif ry_gift in (7,8,9): ry_attack_2 = y_g80 * random.randint(217,255) // 255 elif ry_gift == 10: ry_attack_2 = y_g120 * random.randint(217,255) // 255 elif y_critical_2 == 1 and y_yakedo == 0: if ry_gift in (3,4,5,6): ry_attack_2 = y_cg40 * random.randint(217,255) // 255 elif ry_gift in (7,8,9): ry_attack_2 = y_cg80 * random.randint(217,255) // 255 elif ry_gift == 10: ry_attack_2 = y_cg120 * random.randint(217,255) // 255 elif y_critical_2 == 0 and y_yakedo == 1: if ry_gift in (3,4,5,6): ry_attack_2 = by_g40 * random.randint(217,255) // 255 elif ry_gift in (7,8,9): ry_attack_2 = by_g80 * random.randint(217,255) // 255 elif ry_gift == 10: ry_attack_2 = by_g120 * random.randint(217,255) // 255 elif y_critical_2 == 1 and y_yakedo == 1: if ry_gift in (3,4,5,6): ry_attack_2 = by_cg40 * random.randint(217,255) // 255 elif ry_gift in (7,8,9): ry_attack_2 = by_cg80 * random.randint(217,255) // 255 elif ry_gift == 10: ry_attack_2 = by_cg120 * random.randint(217,255) // 255 if x_hp_2 > x_max_hp: # 最大HPを超えない x_hp_2 = x_max_hp elif y_sub_2 == 27: # 1/2回復 ry_attack_2 = 0 y_hp_2 += y_trunc_2 if y_hp_2 > y_max_hp: # 最大HPを超えない y_hp_2 = y_max_hp elif y_sub_2 == 28: # 眠る ry_attack_2 = 0 if y_hp_2 < y_max_hp: # 最大HP未満なら回復 y_hp_2 = y_max_hp y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku = 3, 0, 0, 0, 0 # 2ターン眠り elif y_sub_2 == 30: # カウンターorミラーコート ry_attack_2 = 0 # 先制で失敗 elif y_sub_2 in (33,34,35): # 2-5連続攻撃 ry_attack_2 = 0 # ダメージの初期化 if y_sub_2 == 33: ry_renzoku = random.randint(1,8) if ry_renzoku in (1,2,3): y_renzoku = 2 elif ry_renzoku in (4,5,6): y_renzoku = 3 elif ry_renzoku == 7: y_renzoku = 4 elif ry_renzoku == 8: y_renzoku = 5 elif y_sub_2 in (34,35): # 2連続攻撃 y_renzoku = 2 if y_sub_2 == 35 and random.randint(1,256) <= 51 and not any([x_koori, x_nemuri, x_mahi, x_yakedo, x_moudoku]): x_doku = 1 # ダブルニードル for _ in range(y_renzoku): # ダメージ累計 y_critical_2 = 0 # 急所の初期化 if y_critical_hit_2 >= random.randint(1,256): # 急所の抽選 y_critical_2 = 1 if y_critical_2 == 0 and y_yakedo == 0: y_renzoku_damage = y_damage_2 * random.randint(217,255) // 255 elif y_critical_2 == 1 and y_yakedo == 0: y_renzoku_damage = y_critical_damage_2 * random.randint(217,255) // 255 elif y_critical_2 == 0 and y_yakedo == 1: y_renzoku_damage = by_damage_2 * random.randint(217,255) // 255 elif y_critical_2 == 1 and y_yakedo == 1: y_renzoku_damage = by_critical_damage_2 * random.randint(217,255) // 255 ry_attack_2 += y_renzoku_damage elif y_sub_2 == 36: # トリプルキック times = 2 # ダメージ倍率 y_renzoku = 0 if y_accuracy_2 >= random.randint(1,256): # 2回目の抽選 y_renzoku = 1 if gamemode == 2: # 後攻への乗算バグ(PBS) x_triple_pbs_2 = 2 if y_accuracy_2 >= random.randint(1,256): # 3回目の抽選 y_renzoku = 2 if gamemode == 2: x_triple_pbs_2 = 3 for _ in range(y_renzoku): # ダメージ累計 y_critical_2 = 0 # 急所の初期化 if y_critical_hit_2 >= random.randint(1,256): y_critical_2 = 1 if y_critical_2 == 0 and y_yakedo == 0: y_triple_kick = y_damage_2 * times * random.randint(217,255) // 255 elif y_critical_2 == 1 and y_yakedo == 0: y_triple_kick = y_critical_damage_2 * times * random.randint(217,255) // 255 elif y_critical_2 == 0 and y_yakedo == 1: y_triple_kick = by_damage_2 * times * random.randint(217,255) // 255 elif y_critical_2 == 1 and y_yakedo == 1: y_triple_kick = by_critical_damage_2 * times * random.randint(217,255) // 255 times += 1 ry_attack_2 += y_triple_kick elif y_sub_2 == 37 and y_level > 0: # サイコウェーブ ry_attack_2 = random.randint(1,ry_psycho_wave) elif y_sub_2 == 38: # 未来予知 ry_attack_2 = 0 elif y_sub_2 == 39: # じたばた if 1 <= y_hp <= y_flail_2: # 威力の決定 ry_attack_2 = y_f200 if y_yakedo == 0 else by_f200 elif y_flail_2 + 1 <= y_hp <= y_flail_5: ry_attack_2 = y_f150 if y_yakedo == 0 else by_f150 elif y_flail_5 + 1 <= y_hp <= y_flail_10: ry_attack_2 = y_f100 if y_yakedo == 0 else by_f100 elif y_flail_10 + 1 <= y_hp <= y_flail_17: ry_attack_2 = y_f80 if y_yakedo == 0 else by_f80 elif gamemode != 2 and y_flail_17 + 1 <= y_hp <= y_flail_33: ry_attack_2 = y_f40 if y_yakedo == 0 else by_f40 elif gamemode == 2 and y_flail_17 + 1 <= y_hp <= y_flail_pbs: # PBS(40) ry_attack_2 = y_f40 if y_yakedo == 0 else by_f40 elif gamemode != 2 and y_flail_33 + 1 <= y_hp <= y_max_hp: ry_attack_2 = y_f20 if y_yakedo == 0 else by_f20 elif gamemode == 2 and y_flail_pbs + 1 <= y_hp <= y_max_hp: # PBS(20) ry_attack_2 = y_f20 if y_yakedo == 0 else by_f20 elif y_sub_2 in (40,41): if y_sub_2 == 40: # 転がる if y_sub_1 == 40 and y_bit_1 == 1 and (x_korogaru <= 4): # 最大16倍, 丸くなる32倍 y_korogaru += 1 else: # 倍率リセット y_korogaru = 1 times = 2 ** (y_korogaru + y_marukunaru - 1) elif y_sub_2 == 41: # 連続斬り if y_sub_1 == 41 and y_bit_1 == 1 and (x_renzokugiri <= 4 or gamemode == 2): # 最大16倍, 無制限(PBS) y_renzokugiri += 1 else: # 倍率リセット y_renzokugiri = 1 times = 2 ** (y_renzokugiri - 1) if y_critical_2 == 0 and y_yakedo == 0: ry_attack_2 = y_damage_2 * times * random.randint(217,255) // 255 elif y_critical_2 == 1 and y_yakedo == 0: ry_attack_2 = y_critical_damage_2 * times * random.randint(217,255) // 255 elif y_critical_2 == 0 and y_yakedo == 1: ry_attack_2 = by_damage_2 * times * random.randint(217,255) // 255 elif y_critical_2 == 1 and y_yakedo == 1: ry_attack_2 = by_critical_damage_2 * times * random.randint(217,255) // 255 elif y_sub_2 == 42: # 痛み分け pain_split = (y_hp_2 + x_hp_2) // 2 y_hp_2 = x_hp_2 = pain_split if y_hp_2 > y_max_hp: # 最大HPを超えない y_hp_2 = y_max_hp if x_hp_2 > x_max_hp: x_hp_2 = x_max_hp elif y_sub_2 in (50,51): # 守る・堪える, 後攻で処理 ry_attack_2 = 0 elif y_sub_2 == 60 and random.randint(1,256) <= y_per_2: # 素早さダウン y_speed_ph += 1 if y_speed_ph == 1: x_speed = x_speed_ph1 elif y_speed_ph == 2: x_speed = x_speed_ph2 elif y_sub_2 == 61 and random.randint(1,256) <= y_per_2: # 命中率ダウン y_accuracy_ph += 1 if y_accuracy_ph == 1: x_accuracy_2, x_accuracy_3, x_accuracy_4 = x_accuracy_2_ph1, x_accuracy_3_ph1, x_accuracy_4_ph1 x1_accuracy, x2_accuracy, x3_accuracy = x1_accuracy_ph1, x2_accuracy_ph1, x3_accuracy_ph1 elif y_accuracy_ph == 2: x_accuracy_2, x_accuracy_3, x_accuracy_4 = x_accuracy_2_ph2, x_accuracy_3_ph2, x_accuracy_4_ph2 x1_accuracy, x2_accuracy, x3_accuracy = x1_accuracy_ph2, x2_accuracy_ph2, x3_accuracy_ph2 elif y_sub_2 in (62,63): # 防御or特防ダウン if y_sub_2 == 62 and random.randint(1,256) <= y_per_2: y_bd_ph += 1 elif y_sub_2 == 63: # 防御or特防-2 y_bd_ph += 2 if y_bd_ph == 1: y_damage_3, y_damage_4 = y_damage_3_ph1, y_damage_4_ph1 y_critical_damage_3, y_critical_damage_4 =y_critical_damage_3_ph1, y_critical_damage_4_ph1 by_damage_3, by_damage_4 = by_damage_3_ph1, by_damage_4_ph1 by_critical_damage_3, by_critical_damage_4 = by_critical_damage_3_ph1, by_critical_damage_4_ph1 y1_damage, y2_damage, y3_damage = y1_damage_ph1, y2_damage_ph1, y3_damage_ph1 y1_critical_damage, y2_critical_damage, y3_critical_damage = y1_critical_damage_ph1, y2_critical_damage_ph1, y3_critical_damage_ph1 x_konran_damage, bx_konran_damage = x_konran_damage_ph1, bx_konran_damage_ph1 elif y_bd_ph == 2: y_damage_3, y_damage_4 = y_damage_3_ph2, y_damage_4_ph2 y_critical_damage_3, y_critical_damage_4 = y_critical_damage_3_ph2, y_critical_damage_4_ph2 by_damage_3, by_damage_4 = by_damage_3_ph2, by_damage_4_ph2 by_critical_damage_3, by_critical_damage_4 = by_critical_damage_3_ph2, by_critical_damage_4_ph2 y1_damage, y2_damage, y3_damage = y1_damage_ph2, y2_damage_ph2, y3_damage_ph2 y1_critical_damage, y2_critical_damage, y3_critical_damage = y1_critical_damage_ph2, y2_critical_damage_ph2, y3_critical_damage_ph2 x_konran_damage, bx_konran_damage = x_konran_damage_ph2, bx_konran_damage_ph2 elif y_bd_ph == 3: y_damage_3, y_damage_4 = y_damage_3_ph3, y_damage_4_ph3 y_critical_damage_3, y_critical_damage_4 = y_critical_damage_3_ph3, y_critical_damage_4_ph3 by_damage_3, by_damage_4 = by_damage_3_ph3, by_damage_4_ph3 by_critical_damage_3, by_critical_damage_4 = by_critical_damage_3_ph3, by_critical_damage_4_ph3 y1_damage, y2_damage, y3_damage = y1_damage_ph3, y2_damage_ph3, y3_damage_ph3 y1_critical_damage, y2_critical_damage, y3_critical_damage = y1_critical_damage_ph3, y2_critical_damage_ph3, y3_critical_damage_ph3 x_konran_damage, bx_konran_damage = x_konran_damage_ph3, bx_konran_damage_ph3 elif y_bd_ph == 4: y_damage_3, y_damage_4 = y_damage_3_ph4, y_damage_4_ph4 y_critical_damage_3, y_critical_damage_4 = y_critical_damage_3_ph4, y_critical_damage_4_ph4 by_damage_3, by_damage_4 = by_damage_3_ph4, by_damage_4_ph4 by_critical_damage_3, by_critical_damage_4 = by_critical_damage_3_ph4, by_critical_damage_4_ph4 y1_damage, y2_damage, y3_damage = y1_damage_ph4, y2_damage_ph4, y3_damage_ph4 y1_critical_damage, y2_critical_damage, y3_critical_damage = y1_critical_damage_ph4, y2_critical_damage_ph4, y3_critical_damage_ph4 x_konran_damage, bx_konran_damage = x_konran_damage_ph4, bx_konran_damage_ph4 if y_bit_2 == 1: # ダメージの判定 x_hp_2 -= ry_attack_2 if y_sub_2 == 20: # 攻撃の反動ダメージ y_hp_2 -= ry_attack_2 // 4 elif y_sub_2 == 21: # HPドレイン y_hp_2 += ry_attack_2 // 2 if y_hp_2 > y_max_hp: # 最大HPを超えない y_hp_2 = y_max_hp if y_ouja_2 == 1 and random.randint(1,256) <= 30: # 先攻のみ王者の抽選 x_hirumi = 1 if x_hachimaki == 1 and x_hp_2 <= 0 and random.randint(1,256) <= 30: # 鉢巻の抽選 x_hp_2 = 1 if x_hp_2 <= 0: # 相手の瀕死判定 y_count_2 += 1 continue elif y_hp_2 <= 0: # 自分の瀕死判定 x_count_2 += 1 continue elif y_sub_2 == 25 and y_bit_2 == 0: # 飛び蹴りの自傷 if gamemode != 2: # GB/N64 y_hp_2 -= ry_attack_2 // 8 elif gamemode == 2: # PBS y_hp_2 -= ry_attack_2 // 4 if y_hp_2 <= 0: # 自分の瀕死判定 x_count_2 += 1 continue if y_hirumi == 1: # 怯みの解除 y_hirumi = 0 # 追加効果の抽選 if y_bit_2 == 1 and 0 < y_sub_2 <= 13: if y_sub_2 == 1: # 怯みの付与 if random.randint(1,256) <= y_per_2: x_hirumi = 1 elif y_sub_2 == 2: # 凍りの付与 if random.randint(1,256) <= y_per_2 and not any([x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku]): x_koori = 1 if x_yaketa == x_stock == 1: # 焼けた木の実 x_koori, x_stock = 0, 0 elif y_sub_2 == 3: # 眠りの付与 if not any([x_koori, x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku]): if gamemode == 0: # GB x_nemuri = random.randint(2,7) elif gamemode == 1: # N64 x_nemuri = random.randint(2,4) elif gamemode == 2: # PBS x_nemuri = random.randint(2,5) if x_hakka == x_stock == 1: # 薄荷の実 x_nemuri, x_stock = 0, 0 elif y_sub_2 == 4: # 混乱の付与 if random.randint(1,256) <= y_per_2 and x_konran == 0: x_konran = random.randint(2,5) if x_nigai == x_stock == 1: # 苦い木の実 x_konran, x_stock = 0, 0 elif y_sub_2 == 5: # メロメロの付与 x_meromero = 1 elif y_sub_2 == 6: # 麻痺の付与 if random.randint(1,256) <= y_per_2 and not any([x_koori, x_nemuri, x_doku, x_yakedo, x_moudoku]): x_mahi = 1 if x_mahinaoshi == x_stock == 1: # 麻痺治しの実 x_mahi, x_stock = 0, 0 elif y_sub_2 == 7: # 毒の付与 if random.randint(1,256) <= y_per_2 and not any([x_koori, x_nemuri, x_mahi, x_yakedo, x_moudoku]): x_doku = 1 if x_dokukeshi == x_stock == 1: # 毒消しの実 x_doku, x_stock = 0, 0 elif y_sub_2 == 8: # 火傷の付与 if random.randint(1,256) <= y_per_2 and not any([x_koori, x_nemuri, x_mahi, x_doku, x_moudoku]): x_yakedo = 1 if x_kootta == x_stock == 1: # 凍った木の実 x_yakedo, x_stock = 0, 0 elif y_sub_2 == 9: # 猛毒の付与 if not any([x_koori, x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku]): x_moudoku = 1 if x_dokukeshi == x_stock == 1: # 毒消しの実 x_moudoku, x_stock = 0, 0 elif y_sub_2 == 10: # 宿り木の付与 x_yadorigi = 1 elif y_sub_2 == 11 and (x_nemuri > 0): # 悪夢の付与 x_akumu = 1 elif y_sub_2 == 12: # 呪いの付与 x_noroi = 1 y_hp_2 -= y_trunc_2 if y_hp_2 <= 0: # 自分の瀕死判定 x_count_2 += 1 continue elif y_sub_2 == 13 and random.randint(1,256) <= 51: # トライアタックの付与(凍り・麻痺・火傷) ry_tri_attack = random.randint(1,3) if ry_tri_attack == 1: # 凍りの付与 if not any([x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku]): x_koori = 1 if x_yaketa == x_stock == 1: # 焼けた木の実 x_koori, x_stock = 0, 0 elif ry_tri_attack == 2: # 麻痺の付与 if not any([x_koori, x_nemuri, x_doku, x_yakedo, x_moudoku]): x_mahi = 1 if x_mahinaoshi == x_stock == 1: # 麻痺治しの実 x_mahi, x_stock = 0, 0 elif ry_tri_attack == 3: # 火傷の付与 if not any([x_koori, x_nemuri, x_mahi, x_doku, x_moudoku]): x_yakedo = 1 if x_kootta == x_stock == 1: # 凍った木の実 x_yakedo, x_stock = 0, 0 elif x_koori == 1: # 相手が凍りなら火傷で解除 x_koori = 0 if x_kiseki == x_stock == 1 and any([x_koori, x_nemuri, x_konran, x_mahi, x_doku, x_yakedo, x_moudoku]): # 奇跡の実 x_koori, x_nemuri, x_konran, x_mahi, x_doku, x_yakedo, x_moudoku, x_stock = 0, 0, 0, 0, 0, 0, 0, 0 # 自分のターン終了時(2B) if y_doku == 1: # 毒 y_hp_2 -= y_trunc_8 elif y_yakedo == 1: # 火傷 y_hp_2 -= y_trunc_8 elif y_moudoku > 0: # 猛毒 y_hp_2 -= y_trunc_16 * y_moudoku y_moudoku += 1 if y_yadorigi == 1: # 宿り木の種 y_hp_2 -= y_trunc_8 x_hp_2 += y_trunc_8 if x_hp_2 > x_max_hp: x_hp_2 = x_max_hp if y_akumu == 1 and y_nemuri > 0: # 悪夢 y_hp_2 -= y_trunc_4 if y_noroi == 1: # 呪い y_hp_2 -= y_trunc_4 if y_hp_2 <= 0: # 自分の瀕死判定 x_count_2 += 1 continue # 後攻 / プレイヤー1 if x_critical_hit_2 >= random.randint(1,256): # 急所の抽選 x_critical_2 = 1 if x_accuracy_2 < random.randint(1,256): # 命中率の抽選 x_bit_2 = 0 if x_hirumi == 1 and gamemode == 2: # 怯み時の判定(PBS) x_bit_2 = 2 if x_koori == 1: # 凍り時の判定: x_bit_2 = 2 elif x_nemuri > 0 and x_bit_2 != 2: # 眠り時の判定 x_nemuri -= 1 if x_nemuri > 0: x_bit_2 = 2 if x_sub_2 == 29: # 寝言の判定 x_bit_2 = 3 elif x_nemuri == 0: # 起きたら悪夢を解除 x_akumu = 0 if x_hirumi == 1 and gamemode != 2: # 怯み時の判定(GB/N64) x_bit_2 = 2 if x_meromero == 1 and x_bit_2 != 2 and random.randint(1,2) == 1: # メロメロ時の判定 x_bit_2 = 2 if x_mahi == 1 and x_bit_2 != 2 and random.randint(1,4) == 1: # 麻痺時の判定 x_bit_2 = 2 if x_konran > 0 and x_bit_2 != 2: # 混乱時の判定 x_konran -= 1 if random.randint(1,2) == 1 and x_konran > 0: if gamemode != 2 and x_yakedo == 0: # GB/N64は最大値 x_hp_2 -= x_konran_damage elif gamemode != 2 and x_yakedo == 1: x_hp_2 -= bx_konran_damage elif gamemode == 2 and x_yakedo == 0: x_hp_2 -= x_konran_damage * random.randint(217,255) // 255 elif gamemode == 2 and x_yakedo == 1: x_hp_2 -= bx_konran_damage * random.randint(217,255) // 255 x_bit_2 = 2 if x_hp_2 <= 0: # 自傷の瀕死判定 y_count_2 += 1 continue if x_sub_2 == 29 and x_bit_2 == 3: # 寝言の抽選 x_bit_2 = 1 if x_negoto_way == 2: rx_negoto = random.randint(1,2) elif x_negoto_way == 3: rx_negoto = random.randint(1,3) if rx_negoto == 1: x_damage_2, x_critical_damage_2, x_accuracy_2, x_critical_hit_2 = x1_damage, x1_critical_damage, x1_accuracy, x1_critical_hit x_sub_2, x_per_2 = x1_sub, x1_per elif rx_negoto == 2: x_damage_2, x_critical_damage_2, x_accuracy_2, x_critical_hit_2 = x2_damage, x2_critical_damage, x2_accuracy, x2_critical_hit x_sub_2, x_per_2 = x2_sub, x2_per elif rx_negoto == 3: x_damage_2, x_critical_damage_2, x_accuracy_2, x_critical_hit_2 = x3_damage, x3_critical_damage, x3_accuracy, x3_critical_hit x_sub_2, x_per_2 = x3_sub, x3_per if x_critical_hit_2 >= random.randint(1,256): # 急所の抽選 x_critical_2 = 1 if x_accuracy_2 < random.randint(1,256): # 命中率の抽選 x_bit_2 = 0 if y_sub_2 in (50,51): # 先攻の守る・堪える if not y_sub_1 in (50,51): y_protect = 1 ry_protect = (1/2 ** (y_protect - 1) * 256 - 1/256) // 1 if y_bit_2 != 2 and (ry_protect >= random.randint(1,256) or (gamemode == 2 and y_protect == 1)): # 1ターン目は必ず成功(PBS) y_protect += 1 if y_sub_2 == 50 and not x_sub_2 in (11,12,27,28,38): # 守る # 悪夢・呪い・回復・未来予知は有効 x_bit_2 = 0 else: y_protect = 1 if x_bit_2 == 1 or x_sub_2 == 25: # 攻撃の判定 if x_critical_2 == 0 and x_yakedo == 0: rx_attack_2 = x_damage_2 * x_triple_pbs_2 * random.randint(217,255) // 255 elif x_critical_2 == 1 and x_yakedo == 0: rx_attack_2 = x_critical_damage_2 * x_triple_pbs_2 * random.randint(217,255) // 255 elif x_critical_2 == 0 and x_yakedo == 1: rx_attack_2 = bx_damage_2 * x_triple_pbs_2 * random.randint(217,255) // 255 elif x_critical_2 == 1 and x_yakedo == 1: rx_attack_2 = bx_critical_damage_2 * x_triple_pbs_2 * random.randint(217,255) // 255 if x_sub_2 >= 22 and x_bit_2 == 1: # 技の効果 if x_sub_2 == 22: # 怒りの前歯 rx_attack_2 = y_hp_2 // 2 elif x_sub_2 == 23: # 固定ダメージ rx_attack_2 = x_damage_2 elif x_sub_2 == 24: # プレゼント rx_gift = random.randint(1,10) if gamemode != 2 and rx_gift in (1,2): # GB/N64の回復 rx_attack_2 = -y_trunc_4 elif gamemode == 2 and rx_gift in (1,2): # PBSの回復 rx_attack_2 = -80 elif x_critical_2 == 0 and x_yakedo == 0: if rx_gift in (3,4,5,6): rx_attack_2 = x_g40 * x_triple_pbs_2 * random.randint(217,255) // 255 elif rx_gift in (7,8,9): rx_attack_2 = x_g80 * x_triple_pbs_2 * random.randint(217,255) // 255 elif rx_gift == 10: rx_attack_2 = x_g120 * x_triple_pbs_2 * random.randint(217,255) // 255 elif x_critical_2 == 1 and x_yakedo == 0: if rx_gift in (3,4,5,6): rx_attack_2 = x_cg40 * x_triple_pbs_2 * random.randint(217,255) // 255 elif rx_gift in (7,8,9): rx_attack_2 = x_cg80 * x_triple_pbs_2 * random.randint(217,255) // 255 elif rx_gift == 10: rx_attack_2 = x_cg120 * x_triple_pbs_2 * random.randint(217,255) // 255 elif x_critical_2 == 0 and x_yakedo == 1: if rx_gift in (3,4,5,6): rx_attack_2 = bx_g40 * x_triple_pbs_2 * random.randint(217,255) // 255 elif rx_gift in (7,8,9): rx_attack_2 = bx_g80 * x_triple_pbs_2 * random.randint(217,255) // 255 elif rx_gift == 10: rx_attack_2 = bx_g120 * x_triple_pbs_2 * random.randint(217,255) // 255 elif x_critical_2 == 1 and x_yakedo == 1: if rx_gift in (3,4,5,6): rx_attack_2 = bx_cg40 * x_triple_pbs_2 * random.randint(217,255) // 255 elif rx_gift in (7,8,9): rx_attack_2 = bx_cg80 * x_triple_pbs_2 * random.randint(217,255) // 255 elif rx_gift == 10: rx_attack_2 = bx_cg120 * x_triple_pbs_2 * random.randint(217,255) // 255 if y_hp_2 > y_max_hp: # 最大HPを超えない y_hp_2 = y_max_hp elif x_sub_2 == 27: # 1/2回復 rx_attack_2 = 0 x_hp_2 += x_trunc_2 if x_hp_2 > x_max_hp: # 最大HPを超えない x_hp_2 = x_max_hp elif x_sub_2 == 28: # 眠る rx_attack_2 = 0 if x_hp_2 < x_max_hp: # 最大HP未満なら回復 x_hp_2 = x_max_hp x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku = 3, 0, 0, 0, 0 # 2ターン眠り elif x_sub_2 == 30: # カウンターorミラーコート rx_attack_2 = ry_attack_2 * 2 if 999 <= y_damage_2 and y_bit_2 == 0 and gamemode == 0: # 一撃外れをカウンター(GB) rx_attack_2 = y_max_hp elif x_sub_2 in (33,34,35): # 2-5連続攻撃 rx_attack_2 = 0 # ダメージの初期化 if x_sub_2 == 33: rx_renzoku = random.randint(1,8) if rx_renzoku in (1,2,3): x_renzoku = 2 elif rx_renzoku in (4,5,6): x_renzoku = 3 elif rx_renzoku == 7: x_renzoku = 4 elif rx_renzoku == 8: x_renzoku = 5 elif x_sub_2 in (34,35): # 2連続攻撃 x_renzoku = 2 if x_sub_2 == 35 and random.randint(1,256) <= 51 and not any([y_koori, y_nemuri, y_mahi, y_yakedo, y_moudoku]): y_doku = 1 # ダブルニードル for _ in range(x_renzoku): # ダメージ累計 x_critical_2 = 0 # 急所の初期化 if x_critical_hit_2 >= random.randint(1,256): # 急所の抽選 x_critical_2 = 1 if x_critical_2 == 0 and x_yakedo == 0: x_renzoku_damage = x_damage_2 * x_triple_pbs_2 * random.randint(217,255) // 255 elif x_critical_2 == 1 and x_yakedo == 0: x_renzoku_damage = x_critical_damage_2 * x_triple_pbs_2 * random.randint(217,255) // 255 elif x_critical_2 == 0 and x_yakedo == 1: x_renzoku_damage = bx_damage_2 * x_triple_pbs_2 * random.randint(217,255) // 255 elif x_critical_2 == 1 and x_yakedo == 1: x_renzoku_damage = bx_critical_damage_2 * x_triple_pbs_2 * random.randint(217,255) // 255 rx_attack_2 += x_renzoku_damage elif x_sub_2 == 36: # トリプルキック times = 2 # ダメージ倍率 x_renzoku = 0 if x_accuracy_2 >= random.randint(1,256): # 2回目の抽選 x_renzoku = 1 if x_accuracy_2 >= random.randint(1,256): # 3回目の抽選 x_renzoku = 2 for _ in range(x_renzoku): # ダメージ累計 x_critical_2 = 0 # 急所の初期化 if x_critical_hit_2 >= random.randint(1,256): x_critical_2 = 1 if x_critical_2 == 0 and x_yakedo == 0: x_triple_kick = x_damage_2 * times * random.randint(217,255) // 255 elif x_critical_2 == 1 and x_yakedo == 0: x_triple_kick = x_critical_damage_2 * times * random.randint(217,255) // 255 elif x_critical_2 == 0 and x_yakedo == 1: x_triple_kick = bx_damage_2 * times * random.randint(217,255) // 255 elif x_critical_2 == 1 and x_yakedo == 1: x_triple_kick = bx_critical_damage_2 * times * random.randint(217,255) // 255 times += 1 rx_attack_2 += x_triple_kick elif x_sub_2 == 37 and x_level > 0: # サイコウェーブ rx_attack_2 = random.randint(1,rx_psycho_wave) elif x_sub_2 == 38: # 未来予知 rx_attack_2 = 0 elif x_sub_2 == 39: # じたばた if 1 <= x_hp <= x_flail_2: # 威力の決定 rx_attack_2 = x_f200 if x_yakedo == 0 else bx_f200 elif x_flail_2 + 1 <= x_hp <= x_flail_5: rx_attack_2 = x_f150 if x_yakedo == 0 else bx_f150 elif x_flail_5 + 1 <= x_hp <= x_flail_10: rx_attack_2 = x_f100 if x_yakedo == 0 else bx_f100 elif x_flail_10 + 1 <= x_hp <= x_flail_17: rx_attack_2 = x_f80 if x_yakedo == 0 else bx_f80 elif gamemode != 2 and x_flail_17 + 1 <= x_hp <= x_flail_33: rx_attack_2 = x_f40 if x_yakedo == 0 else bx_f40 elif gamemode == 2 and x_flail_17 + 1 <= x_hp <= x_flail_pbs: # PBS(40) rx_attack_2 = x_f40 if x_yakedo == 0 else bx_f40 elif gamemode != 2 and x_flail_33 + 1 <= x_hp <= x_max_hp: rx_attack_2 = x_f20 if x_yakedo == 0 else bx_f20 elif gamemode == 2 and x_flail_pbs + 1 <= x_hp <= x_max_hp: # PBS(20) rx_attack_2 = x_f20 if x_yakedo == 0 else bx_f20 if gamemode == 2: # 最高乱数+1ダメージ(PBS) rx_attack_2 = rx_attack_2 * x_triple_pbs_2 + 1 elif x_sub_2 in (40,41): if x_sub_2 == 40: # 転がる if x_sub_1 == 40 and x_bit_1 == 1 and (x_korogaru <= 4): # 最大16倍, 丸くなる32倍 x_korogaru += 1 else: # 倍率リセット x_korogaru = 1 times = 2 ** (x_korogaru + x_marukunaru - 1) elif x_sub_2 == 41: # 連続斬り if x_sub_1 == 41 and x_bit_1 == 1 and (x_renzokugiri <= 4 or gamemode == 2): # 最大16倍, 無制限(PBS) x_renzokugiri += 1 else: # 倍率リセット x_renzokugiri = 1 times = 2 ** (x_renzokugiri - 1) if x_critical_2 == 0 and x_yakedo == 0: rx_attack_2 = x_damage_2 * times * random.randint(217,255) // 255 elif x_critical_2 == 1 and x_yakedo == 0: rx_attack_2 = x_critical_damage_2 * times * random.randint(217,255) // 255 elif x_critical_2 == 0 and x_yakedo == 1: rx_attack_2 = bx_damage_2 * times * random.randint(217,255) // 255 elif x_critical_2 == 1 and x_yakedo == 1: rx_attack_2 = bx_critical_damage_2 * times * random.randint(217,255) // 255 elif x_sub_2 == 42: # 痛み分け pain_split = (x_hp_2 + y_hp_2) // 2 x_hp_2 = y_hp_2 = pain_split if x_hp_2 > x_max_hp: # 最大HPを超えない x_hp_2 = x_max_hp if y_hp_2 > y_max_hp: y_hp_2 = y_max_hp elif x_sub_2 in (50,51): # 守る・堪える, 後攻は失敗 rx_attack_2, x_protect = 0, 1 elif x_sub_2 == 60 and random.randint(1,256) <= x_per_2: # 素早さダウン x_speed_ph += 1 if x_speed_ph == 1: y_speed = y_speed_ph1 elif x_speed_ph == 2: y_speed = y_speed_ph2 elif x_sub_2 == 61 and random.randint(1,256) <= x_per_2: # 命中率ダウン x_accuracy_ph += 1 if x_accuracy_ph == 1: y_accuracy_3, y_accuracy_4 = y_accuracy_3_ph1, y_accuracy_4_ph1 y1_accuracy, y2_accuracy, y3_accuracy = y1_accuracy_ph1, y2_accuracy_ph1, y3_accuracy_ph1 elif x_accuracy_ph == 2: y_accuracy_3, y_accuracy_4 = y_accuracy_3_ph2, y_accuracy_4_ph2 y1_accuracy, y2_accuracy, y3_accuracy = y1_accuracy_ph2, y2_accuracy_ph2, y3_accuracy_ph2 elif x_sub_2 in (62,63): # 防御or特防ダウン if x_sub_2 == 62 and random.randint(1,256) <= x_per_2: x_bd_ph += 1 elif x_sub_2 == 63: # 防御or特防-2 x_bd_ph += 2 if x_bd_ph == 1: x_damage_3, x_damage_4 = x_damage_3_ph1, x_damage_4_ph1 x_critical_damage_3, x_critical_damage_4 = x_critical_damage_3_ph1, x_critical_damage_4_ph1 bx_damage_3, bx_damage_4 = bx_damage_3_ph1, bx_damage_4_ph1 bx_critical_damage_3, bx_critical_damage_4 = bx_critical_damage_3_ph1, bx_critical_damage_4_ph1 x1_damage, x2_damage, x3_damage = x1_damage_ph1, x2_damage_ph1, x3_damage_ph1 x1_critical_damage, x2_critical_damage, x3_critical_damage = x1_critical_damage_ph1, x2_critical_damage_ph1, x3_critical_damage_ph1 y_konran_damage, by_konran_damage = y_konran_damage_ph1, by_konran_damage_ph1 elif x_bd_ph == 2: x_damage_3, x_damage_4 = x_damage_3_ph2, x_damage_4_ph2 x_critical_damage_3, x_critical_damage_4 = x_critical_damage_3_ph2, x_critical_damage_4_ph2 bx_damage_3, bx_damage_4 = bx_damage_3_ph2, bx_damage_4_ph2 bx_critical_damage_3, bx_critical_damage_4 = bx_critical_damage_3_ph2, bx_critical_damage_4_ph2 x1_damage, x2_damage, x3_damage = x1_damage_ph2, x2_damage_ph2, x3_damage_ph2 x1_critical_damage, x2_critical_damage, x3_critical_damage = x1_critical_damage_ph2, x2_critical_damage_ph2, x3_critical_damage_ph2 y_konran_damage, by_konran_damage = y_konran_damage_ph2, by_konran_damage_ph2 elif x_bd_ph == 3: x_damage_3, x_damage_4 = x_damage_3_ph3, x_damage_4_ph3 x_critical_damage_3, x_critical_damage_4 = x_critical_damage_3_ph3, x_critical_damage_4_ph3 bx_damage_3, bx_damage_4 = bx_damage_3_ph3, bx_damage_4_ph3 bx_critical_damage_3, bx_critical_damage_4 = bx_critical_damage_3_ph3, bx_critical_damage_4_ph3 x1_damage, x2_damage, x3_damage = x1_damage_ph3, x2_damage_ph3, x3_damage_ph3 x1_critical_damage, x2_critical_damage, x3_critical_damage = x1_critical_damage_ph3, x2_critical_damage_ph3, x3_critical_damage_ph3 y_konran_damage, by_konran_damage = y_konran_damage_ph3, by_konran_damage_ph3 elif x_bd_ph == 4: x_damage_3, x_damage_4 = x_damage_3_ph4, x_damage_4_ph4 x_critical_damage_3, x_critical_damage_4 = x_critical_damage_3_ph4, x_critical_damage_4_ph4 bx_damage_3, bx_damage_4 = bx_damage_3_ph4, bx_damage_4_ph4 bx_critical_damage_3, bx_critical_damage_4 = bx_critical_damage_3_ph4, bx_critical_damage_4_ph4 x1_damage, x2_damage, x3_damage = x1_damage_ph4, x2_damage_ph4, x3_damage_ph4 x1_critical_damage, x2_critical_damage, x3_critical_damage = x1_critical_damage_ph4, x2_critical_damage_ph4, x3_critical_damage_ph4 y_konran_damage, by_konran_damage = y_konran_damage_ph4, by_konran_damage_ph4 if x_bit_2 == 1: # ダメージの判定 y_hp_2 -= rx_attack_2 if x_sub_2 == 20: # 攻撃の反動ダメージ x_hp_2 -= rx_attack_2 // 4 elif x_sub_2 == 21: # HPドレイン x_hp_2 += rx_attack_2 // 2 if x_hp_2 > x_max_hp: # 最大HPを超えない x_hp_2 = x_max_hp if y_sub_2 == 51 and y_hp_2 <= 0 and y_protect > 1 and y_bit_2 == 1: # 堪える y_hp_2 = 1 if y_hachimaki == 1 and y_hp_2 <= 0 and random.randint(1,256) <= 30: # 鉢巻の抽選 y_hp_2 = 1 if y_hp_2 <= 0: # 相手の瀕死判定 x_count_2 += 1 continue elif x_hp_2 <= 0: # 自分の瀕死判定 y_count_2 += 1 continue elif x_sub_2 == 25 and x_bit_2 == 0: # 飛び蹴りの自傷 if gamemode != 2: # GB/N64 x_hp_2 -= rx_attack_2 // 8 elif gamemode == 2: # PBS x_hp_2 -= rx_attack_2 // 4 if x_hp_2 <= 0: # 自分の瀕死判定 y_count_2 += 1 continue if x_hirumi == 1: # 怯みの解除 x_hirumi = 0 # 追加効果の抽選 if x_bit_2 == 1 and 0 < x_sub_2 <= 13: # 先攻は怯まない if x_sub_2 == 2: # 凍りの付与 if random.randint(1,256) <= x_per_2 and not any([y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku]): y_koori = 1 if y_yaketa == y_stock == 1: # 焼けた木の実 y_koori, y_stock = 0, 0 elif x_sub_2 == 3: # 眠りの付与 if not any([y_koori, y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku]): if gamemode == 0: # GB y_nemuri = random.randint(2,7) elif gamemode == 1: # N64 y_nemuri = random.randint(2,4) elif gamemode == 2: # PBS y_nemuri = random.randint(2,5) if y_hakka == y_stock == 1: # 薄荷の実 y_nemuri, y_stock = 0, 0 elif x_sub_2 == 4: # 混乱の付与 if random.randint(1,256) <= x_per_2 and y_konran == 0: y_konran = random.randint(2,5) if y_nigai == y_stock == 1: # 苦い木の実 y_konran, y_stock = 0, 0 elif x_sub_2 == 5: # メロメロの付与 y_meromero = 1 elif x_sub_2 == 6: # 麻痺の付与 if random.randint(1,256) <= x_per_2 and not any([y_koori, y_nemuri, y_doku, y_yakedo, y_moudoku]): y_mahi = 1 if y_mahinaoshi == y_stock == 1: # 麻痺治しの実 y_mahi, y_stock = 0, 0 elif x_sub_2 == 7: # 毒の付与 if random.randint(1,256) <= x_per_2 and not any([y_koori, y_nemuri, y_mahi, y_yakedo, y_moudoku]): y_doku = 1 if y_dokukeshi == y_stock == 1: # 毒消しの実 y_doku, y_stock = 0, 0 elif x_sub_2 == 8: # 火傷の付与 if random.randint(1,256) <= x_per_2 and not any([y_koori, y_nemuri, y_mahi, y_doku, y_moudoku]): y_yakedo = 1 if y_kootta == y_stock == 1: # 凍った木の実 y_yakedo, y_stock = 0, 0 elif x_sub_2 == 9: # 猛毒の付与 if not any([y_koori, y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku]): y_moudoku = 1 if y_dokukeshi == y_stock == 1: # 毒消しの実 y_moudoku, y_stock = 0, 0 elif x_sub_2 == 10: # 宿り木の付与 y_yadorigi = 1 elif x_sub_2 == 11 and (y_nemuri > 0): # 悪夢の付与 y_akumu = 1 elif x_sub_2 == 12: # 呪いの付与 y_noroi = 1 x_hp_2 -= x_trunc_2 if x_hp_2 <= 0: # 自分の瀕死判定 y_count_2 += 1 continue elif x_sub_2 == 13 and random.randint(1,256) <= 51: # トライアタックの付与(凍り・麻痺・火傷) rx_tri_attack = random.randint(1,3) if rx_tri_attack == 1: # 凍りの付与 if not any([y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku]): y_koori = 1 if y_yaketa == y_stock == 1: # 焼けた木の実 y_koori, y_stock = 0, 0 elif rx_tri_attack == 2: # 麻痺の付与 if not any([y_koori, y_nemuri, y_doku, y_yakedo, y_moudoku]): y_mahi = 1 if y_mahinaoshi == y_stock == 1: # 麻痺治しの実 y_mahi, y_stock = 0, 0 elif rx_tri_attack == 3: # 火傷の付与 if not any([y_koori, y_nemuri, y_mahi, y_doku, y_moudoku]): y_yakedo = 1 if y_kootta == y_stock == 1: # 凍った木の実 y_yakedo, y_stock = 0, 0 elif y_koori == 1: # 相手が凍りなら火傷で解除 y_koori = 0 if y_kiseki == y_stock == 1 and any([y_koori, y_nemuri, y_konran, y_mahi, y_doku, y_yakedo, y_moudoku]): # 奇跡の実 y_koori, y_nemuri, y_konran, y_mahi, y_doku, y_yakedo, y_moudoku, y_stock = 0, 0, 0, 0, 0, 0, 0, 0 # 自分のターン終了時(2B) if x_doku == 1: # 毒 x_hp_2 -= x_trunc_8 elif x_yakedo == 1: # 火傷 x_hp_2 -= x_trunc_8 elif x_moudoku > 0: # 猛毒 x_hp_2 -= x_trunc_16 * x_moudoku x_moudoku += 1 if x_yadorigi == 1: # 宿り木の種 x_hp_2 -= x_trunc_8 y_hp_2 += x_trunc_8 if y_hp_2 > y_max_hp: y_hp_2 = y_max_hp if x_akumu == 1 and x_nemuri > 0: # 悪夢 x_hp_2 -= x_trunc_4 if x_noroi == 1: # 呪い x_hp_2 -= x_trunc_4 if x_hp_2 <= 0: # 自分の瀕死判定 y_count_2 += 1 continue # 全体のターン終了時(2B) if x_mirai_2 == 1 and random.randint(1,256) <= x_mirai_accuracy_2: # 未来予知の判定 y_hp_2 -= x_mirai_damage_2 * random.randint(217,255) // 255 if y_hp_2 <= 0: # 行動順で瀕死の判定 x_count_2 += 1 continue if y_mirai_2 == 1 and random.randint(1,256) <= y_mirai_accuracy_2: x_hp_2 -= y_mirai_damage_2 * random.randint(217,255) // 255 if x_hp_2 <= 0: y_count_2 += 1 continue if suna_2 == 1: # 砂嵐の判定 if y_suna == 1: # 行動順で瀕死の判定 y_hp_2 -= y_trunc_8 if y_hp_2 <= 0: x_count_2 += 1 continue if x_suna == 1: x_hp_2 -= x_trunc_8 if x_hp_2 <= 0: y_count_2 += 1 continue if y_tabenokoshi == 1 and y_hp_2 > 0: # 食べ残しの回復 y_hp_2 += y_trunc_16 if y_hp_2 > y_max_hp: # 最大HPを超えない y_hp_2 = y_max_hp if x_tabenokoshi == 1 and x_hp_2 > 0: x_hp_2 += x_trunc_16 if x_hp_2 > x_max_hp: x_hp_2 = x_max_hp if y_koori == 1 and random.randint(1,256) <= 25: # 凍り時の判定 y_koori = 0 if x_koori == 1 and random.randint(1,256) <= 25: x_koori = 0 if y_nemuri > 0 and y_hakka == y_stock == 1: # 眠るの回復 y_nemuri, y_stock = 0, 0 elif y_nemuri > 0 and y_kiseki == y_stock == 1: # 混乱ごと回復 y_nemuri, y_konran, y_stock = 0, 0, 0 if x_nemuri > 0 and x_hakka == x_stock == 1: x_nemuri, x_stock = 0, 0 elif x_nemuri > 0 and x_kiseki == x_stock == 1: x_nemuri, x_konran, x_stock = 0, 0, 0 if y_kinomi != 0 and y_stock == 1 and y_ceil_2 > y_hp_2 > 0: # 木の実の回復 if y_kinomi == 3: y_hp_2 += 30 elif y_kinomi == 2: y_hp_2 += 20 elif y_kinomi == 1: y_hp_2 += 10 y_stock = 0 if x_kinomi != 0 and x_stock == 1 and x_ceil_2 > x_hp_2 > 0: if x_kinomi == 3: x_hp_2 += 30 elif x_kinomi == 2: x_hp_2 += 20 elif x_kinomi == 1: x_hp_2 += 10 x_stock = 0 ### 3ターン目 ### # 素早さの抽選(3) xx_speed, yy_speed = x_speed, y_speed # 素早さを初期化 if x_mahi == 1: # 麻痺なら素早さ1/4 xx_speed = x_trunc_speed if y_mahi == 1: yy_speed = y_trunc_speed if x_sensei == 1 and random.randint(1,256) <= 60: # 先制の爪の抽選 xx_speed += 1000 if y_sensei == 1 and random.randint(1,256) <= 60: yy_speed += 1000 if x_sub_3 == 31: # 優先度+1 xx_speed += 10000 elif x_sub_3 in (30,32): # カウンターorミラーコート・優先度-1 xx_speed -= 10000 elif x_sub_3 in (50,51): # 守る・堪える・優先度+2 xx_speed += 20000 if y_sub_3 == 31: yy_speed += 10000 elif y_sub_3 in (30,32): yy_speed -= 10000 elif y_sub_3 in (50,51): yy_speed += 20000 # HPの格納・手番の抽選 x_hp_3, y_hp_3 = x_hp_2, y_hp_2 # HPの設定 # プレイヤー1の先制 if xx_speed > yy_speed or (xx_speed == yy_speed and random.randint(1,2) == 1): # 先攻 / プレイヤー1 if x_critical_hit_3 >= random.randint(1,256): # 急所の抽選 x_critical_3 = 1 if x_accuracy_3 < random.randint(1,256): # 命中率の抽選 x_bit_3 = 0 if x_koori == 1: # 凍り時の判定: x_bit_3 = 2 elif x_nemuri > 0: # 眠り時の判定 x_nemuri -= 1 if x_nemuri > 0: x_bit_3 = 2 if x_sub_3 == 29: # 寝言の判定 x_bit_3 = 3 elif x_nemuri == 0: # 起きたら悪夢を解除 x_akumu = 0 if x_meromero == 1 and x_bit_3 != 2 and random_randint(1,2) == 1: # メロメロ時の判定 x_bit_3 = 2 if x_mahi == 1 and x_bit_3 != 2 and random.randint(1,4) == 1: # 麻痺時の判定 x_bit_3 = 2 if x_konran > 0 and x_bit_3 != 2: # 混乱時の判定 x_konran -= 1 if random.randint(1,2) == 1 and x_konran > 0: if gamemode != 2 and x_yakedo == 0: # GB/N64は最大値 x_hp_3 -= x_konran_damage elif gamemode != 2 and x_yakedo == 1: x_hp_3 -= bx_konran_damage elif gamemode == 2 and x_yakedo == 0: x_hp_3 -= x_konran_damage * random.randint(217,255) // 255 elif gamemode == 2 and x_yakedo == 1: x_hp_3 -= bx_konran_damage * random.randint(217,255) // 255 x_bit_3 = 2 if x_hp_3 <= 0: # 自傷の瀕死判定 y_count_3 += 1 continue if x_sub_3 == 29 and x_bit_3 == 3: # 寝言の抽選 x_bit_3 = 1 if x_negoto_way == 2: rx_negoto = random.randint(1,2) elif x_negoto_way == 3: rx_negoto = random.randint(1,3) if rx_negoto == 1: x_damage_3, x_critical_damage_3, x_accuracy_3, x_critical_hit_3 = x1_damage, x1_critical_damage, x1_accuracy, x1_critical_hit x_sub_3, x_per_3 = x1_sub, x1_per elif rx_negoto == 2: x_damage_3, x_critical_damage_3, x_accuracy_3, x_critical_hit_3 = x2_damage, x2_critical_damage, x2_accuracy, x2_critical_hit x_sub_3, x_per_3 = x2_sub, x2_per elif rx_negoto == 3: x_damage_3, x_critical_damage_3, x_accuracy_3, x_critical_hit_3 = x3_damage, x3_critical_damage, x3_accuracy, x3_critical_hit x_sub_3, x_per_3 = x3_sub, x3_per if x_critical_hit_3 >= random.randint(1,256): # 急所の抽選 x_critical_3 = 1 if x_accuracy_3 < random.randint(1,256): # 命中率の抽選 x_bit_3 = 0 if x_bit_3 == 1 or x_sub_3 == 25: # 攻撃の判定 if x_critical_3 == 0 and x_yakedo == 0: rx_attack_3 = x_damage_3 * random.randint(217,255) // 255 elif x_critical_3 == 1 and x_yakedo == 0: rx_attack_3 = x_critical_damage_3 * random.randint(217,255) // 255 elif x_critical_3 == 0 and x_yakedo == 1: rx_attack_3 = bx_damage_3 * random.randint(217,255) // 255 elif x_critical_3 == 1 and x_yakedo == 1: rx_attack_3 = bx_critical_damage_3 * random.randint(217,255) // 255 if x_sub_3 >= 22 and x_bit_3 == 1: # 技の効果 if x_sub_3 == 22: # 怒りの前歯 rx_attack_3 = y_hp_3 // 2 elif x_sub_3 == 23: # 固定ダメージ rx_attack_3 = x_damage_3 elif x_sub_3 == 24: # プレゼント rx_gift = random.randint(1,10) if gamemode != 2 and rx_gift in (1,2): # GB/N64の回復 rx_attack_3 = -y_trunc_4 elif gamemode == 2 and rx_gift in (1,2): # PBSの回復 rx_attack_3 = -80 elif x_critical_3 == 0 and x_yakedo == 0: if rx_gift in (3,4,5,6): rx_attack_3 = x_g40 * random.randint(217,255) // 255 elif rx_gift in (7,8,9): rx_attack_3 = x_g80 * random.randint(217,255) // 255 elif rx_gift == 10: rx_attack_3 = x_g120 * random.randint(217,255) // 255 elif x_critical_3 == 1 and x_yakedo == 0: if rx_gift in (3,4,5,6): rx_attack_3 = x_cg40 * random.randint(217,255) // 255 elif rx_gift in (7,8,9): rx_attack_3 = x_cg80 * random.randint(217,255) // 255 elif rx_gift == 10: rx_attack_3 = x_cg120 * random.randint(217,255) // 255 elif x_critical_3 == 0 and x_yakedo == 1: if rx_gift in (3,4,5,6): rx_attack_3 = bx_g40 * random.randint(217,255) // 255 elif rx_gift in (7,8,9): rx_attack_3 = bx_g80 * random.randint(217,255) // 255 elif rx_gift == 10: rx_attack_3 = bx_g120 * random.randint(217,255) // 255 elif x_critical_3 == 1 and x_yakedo == 1: if rx_gift in (3,4,5,6): rx_attack_3 = bx_cg40 * random.randint(217,255) // 255 elif rx_gift in (7,8,9): rx_attack_3 = bx_cg80 * random.randint(217,255) // 255 elif rx_gift == 10: rx_attack_3 = bx_cg120 * random.randint(217,255) // 255 if y_hp_3 > y_max_hp: # 最大HPを超えない y_hp_3 = y_max_hp elif x_sub_3 == 27: # 1/2回復 rx_attack_3 = 0 x_hp_3 += x_trunc_2 if x_hp_3 > x_max_hp: # 最大HPを超えない x_hp_3 = x_max_hp elif x_sub_3 == 28: # 眠る rx_attack_3 = 0 if x_hp_3 < x_max_hp: # 最大HP未満なら回復 x_hp_3 = x_max_hp x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku = 3, 0, 0, 0, 0 # 2ターン眠り elif x_sub_3 == 30: # カウンターorミラーコート rx_attack_3 = 0 # 先制で失敗 elif x_sub_3 in (33,34,35): # 2-5連続攻撃 rx_attack_3 = 0 # ダメージの初期化 if x_sub_3 == 33: rx_renzoku = random.randint(1,8) if rx_renzoku in (1,2,3): x_renzoku = 2 elif rx_renzoku in (4,5,6): x_renzoku = 3 elif rx_renzoku == 7: x_renzoku = 4 elif rx_renzoku == 8: x_renzoku = 5 elif x_sub_3 in (34,35): # 2連続攻撃 x_renzoku = 2 if x_sub_3 == 35 and random.randint(1,256) <= 51 and not any([y_koori, y_nemuri, y_mahi, y_yakedo, y_moudoku]): y_doku = 1 # ダブルニードル for _ in range(x_renzoku): # ダメージ累計 x_critical_3 = 0 # 急所の初期化 if x_critical_hit_3 >= random.randint(1,256): # 急所の抽選 x_critical_3 = 1 if x_critical_3 == 0 and x_yakedo == 0: x_renzoku_damage = x_damage_3 * random.randint(217,255) // 255 elif x_critical_3 == 1 and x_yakedo == 0: x_renzoku_damage = x_critical_damage_3 * random.randint(217,255) // 255 elif x_critical_3 == 0 and x_yakedo == 1: x_renzoku_damage = bx_damage_3 * random.randint(217,255) // 255 elif x_critical_3 == 1 and x_yakedo == 1: x_renzoku_damage = bx_critical_damage_3 * random.randint(217,255) // 255 rx_attack_3 += x_renzoku_damage elif x_sub_3 == 36: # トリプルキック times = 2 # ダメージ倍率 x_renzoku = 0 if x_accuracy_3 >= random.randint(1,256): # 2回目の抽選 x_renzoku = 1 if gamemode == 2: # 後攻への乗算バグ(PBS) y_triple_pbs_3 = 2 if x_accuracy_3 >= random.randint(1,256): # 3回目の抽選 x_renzoku = 2 if gamemode == 2: y_triple_pbs_3 = 3 for _ in range(x_renzoku): # ダメージ累計 x_critical_3 = 0 # 急所の初期化 if x_critical_hit_3 >= random.randint(1,256): x_critical_3 = 1 if x_critical_3 == 0 and x_yakedo == 0: x_triple_kick = x_damage_3 * times * random.randint(217,255) // 255 elif x_critical_3 == 1 and x_yakedo == 0: x_triple_kick = x_critical_damage_3 * times * random.randint(217,255) // 255 elif x_critical_3 == 0 and x_yakedo == 1: x_triple_kick = bx_damage_3 * times * random.randint(217,255) // 255 elif x_critical_3 == 1 and x_yakedo == 1: x_triple_kick = bx_critical_damage_3 * times * random.randint(217,255) // 255 times += 1 rx_attack_3 += x_triple_kick elif x_sub_3 == 37 and x_level > 0: # サイコウェーブ rx_attack_3 = random.randint(1,rx_psycho_wave) elif x_sub_3 == 38: # 未来予知 rx_attack_3 = 0 elif x_sub_3 == 39: # じたばた if 1 <= x_hp <= x_flail_2: # 威力の決定 rx_attack_3 = x_f200 if x_yakedo == 0 else bx_f200 elif x_flail_2 + 1 <= x_hp <= x_flail_5: rx_attack_3 = x_f150 if x_yakedo == 0 else bx_f150 elif x_flail_5 + 1 <= x_hp <= x_flail_10: rx_attack_3 = x_f100 if x_yakedo == 0 else bx_f100 elif x_flail_10 + 1 <= x_hp <= x_flail_17: rx_attack_3 = x_f80 if x_yakedo == 0 else bx_f80 elif gamemode != 2 and x_flail_17 + 1 <= x_hp <= x_flail_33: rx_attack_3 = x_f40 if x_yakedo == 0 else bx_f40 elif gamemode == 2 and x_flail_17 + 1 <= x_hp <= x_flail_pbs: # PBS(40) rx_attack_3 = x_f40 if x_yakedo == 0 else bx_f40 elif gamemode != 2 and x_flail_33 + 1 <= x_hp <= x_max_hp: rx_attack_3 = x_f20 if x_yakedo == 0 else bx_f20 elif gamemode == 2 and x_flail_pbs + 1 <= x_hp <= x_max_hp: # PBS(20) rx_attack_3 = x_f20 if x_yakedo == 0 else bx_f20 elif x_sub_3 in (40,41): if x_sub_3 == 40: # 転がる if x_sub_2 == 40 and x_bit_2 == 1 and (x_korogaru <= 4): # 最大16倍, 丸くなる32倍 x_korogaru += 1 else: # 倍率リセット x_korogaru = 1 times = 2 ** (x_korogaru + x_marukunaru - 1) elif x_sub_3 == 41: # 連続斬り if x_sub_2 == 41 and x_bit_2 == 1 and (x_renzokugiri <= 4 or gamemode == 2): # 最大16倍, 無制限(PBS) x_renzokugiri += 1 else: # 倍率リセット x_renzokugiri = 1 times = 2 ** (x_renzokugiri - 1) if x_critical_3 == 0 and x_yakedo == 0: rx_attack_3 = x_damage_3 * times * random.randint(217,255) // 255 elif x_critical_3 == 1 and x_yakedo == 0: rx_attack_3 = x_critical_damage_3 * times * random.randint(217,255) // 255 elif x_critical_3 == 0 and x_yakedo == 1: rx_attack_3 = bx_damage_3 * times * random.randint(217,255) // 255 elif x_critical_3 == 1 and x_yakedo == 1: rx_attack_3 = bx_critical_damage_3 * times * random.randint(217,255) // 255 elif x_sub_3 == 42: # 痛み分け pain_split = (x_hp_3 + y_hp_3) // 2 x_hp_3 = y_hp_3 = pain_split if x_hp_3 > x_max_hp: # 最大HPを超えない x_hp_3 = x_max_hp if y_hp_3 > y_max_hp: y_hp_3 = y_max_hp elif x_sub_3 in (50,51): # 守る・堪える, 後攻で処理 rx_attack_3 = 0 elif x_sub_3 == 60 and random.randint(1,256) <= x_per_3: # 素早さダウン x_speed_ph += 1 if x_speed_ph == 1: y_speed = y_speed_ph1 elif x_speed_ph == 2: y_speed = y_speed_ph2 elif x_speed_ph == 3: y_speed = y_speed_ph3 elif x_sub_3 == 61 and random.randint(1,256) <= x_per_3: # 命中率ダウン x_accuracy_ph += 1 if x_accuracy_ph == 1: y_accuracy_3, y_accuracy_4 = y_accuracy_3_ph1, y_accuracy_4_ph1 y1_accuracy, y2_accuracy, y3_accuracy = y1_accuracy_ph1, y2_accuracy_ph1, y3_accuracy_ph1 elif x_accuracy_ph == 2: y_accuracy_3, y_accuracy_4 = y_accuracy_3_ph2, y_accuracy_4_ph2 y1_accuracy, y2_accuracy, y3_accuracy = y1_accuracy_ph2, y2_accuracy_ph2, y3_accuracy_ph2 elif x_accuracy_ph == 3: y_accuracy_3, y_accuracy_4 = y_accuracy_3_ph3, y_accuracy_4_ph3 y1_accuracy, y2_accuracy, y3_accuracy = y1_accuracy_ph3, y2_accuracy_ph3, y3_accuracy_ph3 elif x_sub_3 in (62,63): # 防御or特防ダウン if x_sub_3 == 62 and random.randint(1,256) <= x_per_3: x_bd_ph += 1 elif x_sub_3 == 63: # 防御or特防-2 x_bd_ph += 2 if x_bd_ph == 1: x_damage_4 = x_damage_4_ph1 x_critical_damage_4 = x_critical_damage_4_ph1 bx_damage_4 = bx_damage_4_ph1 bx_critical_damage_4 = bx_critical_damage_4_ph1 x1_damage, x2_damage, x3_damage = x1_damage_ph1, x2_damage_ph1, x3_damage_ph1 x1_critical_damage, x2_critical_damage, x3_critical_damage = x1_critical_damage_ph1, x2_critical_damage_ph1, x3_critical_damage_ph1 y_konran_damage, by_konran_damage = y_konran_damage_ph1, by_konran_damage_ph1 elif x_bd_ph == 2: x_damage_4 = x_damage_4_ph2 x_critical_damage_4 = x_critical_damage_4_ph2 bx_damage_4 = bx_damage_4_ph2 bx_critical_damage_4 = bx_critical_damage_4_ph2 x1_damage, x2_damage, x3_damage = x1_damage_ph2, x2_damage_ph2, x3_damage_ph2 x1_critical_damage, x2_critical_damage, x3_critical_damage = x1_critical_damage_ph2, x2_critical_damage_ph2, x3_critical_damage_ph2 y_konran_damage, by_konran_damage = y_konran_damage_ph2, by_konran_damage_ph2 elif x_bd_ph == 3: x_damage_4 = x_damage_4_ph3 x_critical_damage_4 = x_critical_damage_4_ph3 bx_damage_4 = bx_damage_4_ph3 bx_critical_damage_4 = bx_critical_damage_4_ph3 x1_damage, x2_damage, x3_damage = x1_damage_ph3, x2_damage_ph3, x3_damage_ph3 x1_critical_damage, x2_critical_damage, x3_critical_damage = x1_critical_damage_ph3, x2_critical_damage_ph3, x3_critical_damage_ph3 y_konran_damage, by_konran_damage = y_konran_damage_ph3, by_konran_damage_ph3 elif x_bd_ph == 4: x_damage_4 = x_damage_4_ph4 x_critical_damage_4 = x_critical_damage_4_ph4 bx_damage_4 = bx_damage_4_ph4 bx_critical_damage_4 = bx_critical_damage_4_ph4 x1_damage, x2_damage, x3_damage = x1_damage_ph4, x2_damage_ph4, x3_damage_ph4 x1_critical_damage, x2_critical_damage, x3_critical_damage = x1_critical_damage_ph4, x2_critical_damage_ph4, x3_critical_damage_ph4 y_konran_damage, by_konran_damage = y_konran_damage_ph4, by_konran_damage_ph4 elif x_bd_ph == 5: x_damage_4 = x_damage_4_ph5 x_critical_damage_4 = x_critical_damage_4_ph5 bx_damage_4 = bx_damage_4_ph5 bx_critical_damage_4 = bx_critical_damage_4_ph5 x1_damage, x2_damage, x3_damage = x1_damage_ph5, x2_damage_ph5, x3_damage_ph5 x1_critical_damage, x2_critical_damage, x3_critical_damage = x1_critical_damage_ph5, x2_critical_damage_ph5, x3_critical_damage_ph5 y_konran_damage, by_konran_damage = y_konran_damage_ph5, by_konran_damage_ph5 elif x_bd_ph == 6: x_damage_4 = x_damage_4_ph6 x_critical_damage_4 = x_critical_damage_4_ph6 bx_damage_4 = bx_damage_4_ph6 bx_critical_damage_4 = bx_critical_damage_4_ph6 x1_damage, x2_damage, x3_damage = x1_damage_ph6, x2_damage_ph6, x3_damage_ph6 x1_critical_damage, x2_critical_damage, x3_critical_damage = x1_critical_damage_ph6, x2_critical_damage_ph6, x3_critical_damage_ph6 y_konran_damage, by_konran_damage = y_konran_damage_ph6, by_konran_damage_ph6 if x_bit_3 == 1: # ダメージの判定 y_hp_3 -= rx_attack_3 if x_sub_3 == 20: # 攻撃の反動ダメージ x_hp_3 -= rx_attack_3 // 4 elif x_sub_3 == 21: # HPドレイン x_hp_3 += rx_attack_3 // 2 if x_hp_3 > x_max_hp: # 最大HPを超えない x_hp_3 = x_max_hp if x_ouja_3 == 1 and random.randint(1,256) <= 30: # 先攻のみ王者の抽選 y_hirumi = 1 if y_hachimaki == 1 and y_hp_3 <= 0 and random.randint(1,256) <= 30: # 鉢巻の抽選 y_hp_3 = 1 if y_hp_3 <= 0: # 相手の瀕死判定 x_count_3 += 1 continue elif x_hp_3 <= 0: # 自分の瀕死判定 y_count_3 += 1 continue elif x_sub_3 == 25 and x_bit_3 == 0: # 飛び蹴りの自傷 if gamemode != 2: # GB/N64 x_hp_3 -= rx_attack_3 // 8 elif gamemode == 2: # PBS x_hp_3 -= rx_attack_3 // 4 if x_hp_3 <= 0: # 自分の瀕死判定 y_count_3 += 1 continue if x_hirumi == 1: # 怯みの解除 x_hirumi = 0 # 追加効果の抽選 if x_bit_3 == 1 and 0 < x_sub_3 <= 13: if x_sub_3 == 1: # 怯みの付与 if random.randint(1,256) <= x_per_3: y_hirumi = 1 elif x_sub_3 == 2: # 凍りの付与 if random.randint(1,256) <= x_per_3 and not any([y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku]): y_koori = 1 if y_yaketa == y_stock == 1: # 焼けた木の実 y_koori, y_stock = 0, 0 elif x_sub_3 == 3: # 眠りの付与 if not any([y_koori, y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku]): if gamemode == 0: # GB y_nemuri = random.randint(2,7) elif gamemode == 1: # N64 y_nemuri = random.randint(2,4) elif gamemode == 2: # PBS y_nemuri = random.randint(2,5) if y_hakka == y_stock == 1: # 薄荷の実 y_nemuri, y_stock = 0, 0 elif x_sub_3 == 4: # 混乱の付与 if random.randint(1,256) <= x_per_3 and y_konran == 0: y_konran = random.randint(2,5) if y_nigai == y_stock == 1: # 苦い木の実 y_konran, y_stock = 0, 0 elif x_sub_3 == 5: # メロメロの付与 y_meromero = 1 elif x_sub_3 == 6: # 麻痺の付与 if random.randint(1,256) <= x_per_3 and not any([y_koori, y_nemuri, y_doku, y_yakedo, y_moudoku]): y_mahi = 1 if y_mahinaoshi == y_stock == 1: # 麻痺治しの実 y_mahi, y_stock = 0, 0 elif x_sub_3 == 7: # 毒の付与 if random.randint(1,256) <= x_per_3 and not any([y_koori, y_nemuri, y_mahi, y_yakedo, y_moudoku]): y_doku = 1 if y_dokukeshi == y_stock == 1: # 毒消しの実 y_doku, y_stock = 0, 0 elif x_sub_3 == 8: # 火傷の付与 if random.randint(1,256) <= x_per_3 and not any([y_koori, y_nemuri, y_mahi, y_doku, y_moudoku]): y_yakedo = 1 if y_kootta == y_stock == 1: # 凍った木の実 y_yakedo, y_stock = 0, 0 elif x_sub_3 == 9: # 猛毒の付与 if not any([y_koori, y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku]): y_moudoku = 1 if y_dokukeshi == y_stock == 1: # 毒消しの実 y_moudoku, y_stock = 0, 0 elif x_sub_3 == 10: # 宿り木の付与 y_yadorigi = 1 elif x_sub_3 == 11 and (y_nemuri > 0): # 悪夢の付与 y_akumu = 1 elif x_sub_3 == 12: # 呪いの付与 y_noroi = 1 x_hp_3 -= x_trunc_2 if x_hp_3 <= 0: # 自分の瀕死判定 y_count_3 += 1 continue elif x_sub_3 == 13 and random.randint(1,256) <= 51: # トライアタックの付与(凍り・麻痺・火傷) rx_tri_attack = random.randint(1,3) if rx_tri_attack == 1: # 凍りの付与 if not any([y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku]): y_koori = 1 if y_yaketa == y_stock == 1: # 焼けた木の実 y_koori, y_stock = 0, 0 elif rx_tri_attack == 2: # 麻痺の付与 if not any([y_koori, y_nemuri, y_doku, y_yakedo, y_moudoku]): y_mahi = 1 if y_mahinaoshi == y_stock == 1: # 麻痺治しの実 y_mahi, y_stock = 0, 0 elif rx_tri_attack == 3: # 火傷の付与 if not any([y_koori, y_nemuri, y_mahi, y_doku, y_moudoku]): y_yakedo = 1 if y_kootta == y_stock == 1: # 凍った木の実 y_yakedo, y_stock = 0, 0 elif y_koori == 1: # 相手が凍りなら火傷で解除 y_koori = 0 if y_kiseki == y_stock == 1 and any([y_koori, y_nemuri, y_konran, y_mahi, y_doku, y_yakedo, y_moudoku]): # 奇跡の実 y_koori, y_nemuri, y_konran, y_mahi, y_doku, y_yakedo, y_moudoku, y_stock = 0, 0, 0, 0, 0, 0, 0, 0 # 自分のターン終了時(3A) if x_doku == 1: # 毒 x_hp_3 -= x_trunc_8 elif x_yakedo == 1: # 火傷 x_hp_3 -= x_trunc_8 elif x_moudoku > 0: # 猛毒 x_hp_3 -= x_trunc_16 * x_moudoku x_moudoku += 1 if x_yadorigi == 1: # 宿り木の種 x_hp_3 -= x_trunc_8 y_hp_3 += x_trunc_8 if y_hp_3 > y_max_hp: y_hp_3 = y_max_hp if x_akumu == 1 and x_nemuri > 0: # 悪夢 x_hp_3 -= x_trunc_4 if x_noroi == 1: # 呪い x_hp_3 -= x_trunc_4 if x_hp_3 <= 0: # 自分の瀕死判定 y_count_3 += 1 continue # 後攻 / プレイヤー2 if y_critical_hit_3 >= random.randint(1,256): # 急所の抽選 y_critical_3 = 1 if y_accuracy_3 < random.randint(1,256): # 命中率の抽選 y_bit_3 = 0 if y_hirumi == 1 and gamemode == 2: # 怯み時の判定(PBS) y_bit_3 = 2 if y_koori == 1: # 凍り時の判定: y_bit_3 = 2 elif y_nemuri > 0 and y_bit_3 != 2: # 眠り時の判定 y_nemuri -= 1 if y_nemuri > 0: y_bit_3 = 2 if y_sub_3 == 29: # 寝言の判定 y_bit_3 = 3 elif y_nemuri == 0: # 起きたら悪夢を解除 y_akumu = 0 if y_hirumi == 1 and gamemode != 2: # 怯み時の判定(GB/N64) y_bit_3 = 2 if y_meromero == 1 and y_bit_3 != 2 and random.randint(1,2) == 1: # メロメロ時の判定 y_bit_3 = 2 if y_mahi == 1 and y_bit_3 != 2 and random.randint(1,4) == 1: # 麻痺時の判定 y_bit_3 = 2 if y_konran > 0 and y_bit_3 != 2: # 混乱時の判定 y_konran -= 1 if random.randint(1,2) == 1 and y_konran > 0: if gamemode != 2 and y_yakedo == 0: # GB/N64は最大値 y_hp_3 -= y_konran_damage elif gamemode != 2 and y_yakedo == 1: y_hp_3 -= by_konran_damage elif gamemode == 2 and y_yakedo == 0: y_hp_3 -= y_konran_damage * random.randint(217,255) // 255 elif gamemode == 2 and y_yakedo == 1: y_hp_3 -= by_konran_damage * random.randint(217,255) // 255 y_bit_3 = 2 if y_hp_3 <= 0: # 自傷の瀕死判定 x_count_3 += 1 continue if y_sub_3 == 29 and y_bit_3 == 3: # 寝言の抽選 y_bit_3 = 1 if y_negoto_way == 2: ry_negoto = random.randint(1,2) elif y_negoto_way == 3: ry_negoto = random.randint(1,3) if ry_negoto == 1: y_damage_3, y_critical_damage_3, y_accuracy_3, y_critical_hit_3 = y1_damage, y1_critical_damage, y1_accuracy, y1_critical_hit y_sub_3, y_per_3 = y1_sub, y1_per elif ry_negoto == 2: y_damage_3, y_critical_damage_3, y_accuracy_3, y_critical_hit_3 = y2_damage, y2_critical_damage, y2_accuracy, y2_critical_hit y_sub_3, y_per_3 = y2_sub, y2_per elif ry_negoto == 3: y_damage_3, y_critical_damage_3, y_accuracy_3, y_critical_hit_3 = y3_damage, y3_critical_damage, y3_accuracy, y3_critical_hit y_sub_3, y_per_3 = y3_sub, y3_per if y_critical_hit_3 >= random.randint(1,256): # 急所の抽選 y_critical_3 = 1 if y_accuracy_3 < random.randint(1,256): # 命中率の抽選 y_bit_3 = 0 if x_sub_3 in (50,51): # 先攻の守る・堪える if not x_sub_2 in (50,51): x_protect = 1 rx_protect = (1/2 ** (x_protect - 1) * 256 - 1/256) // 1 if x_bit_3 != 2 and (rx_protect >= random.randint(1,256) or (gamemode == 2 and x_protect == 1)): # 1ターン目は必ず成功(PBS) x_protect += 1 if x_sub_3 == 50 and not y_sub_3 in (11,12,27,28,38): # 守る # 悪夢・呪い・回復・未来予知は有効 y_bit_3 = 0 else: x_protect = 1 if y_bit_3 == 1 or y_sub_3 == 25: # 攻撃の判定 if y_critical_3 == 0 and y_yakedo == 0: ry_attack_3 = y_damage_3 * y_triple_pbs_3 * random.randint(217,255) // 255 elif y_critical_3 == 1 and y_yakedo == 0: ry_attack_3 = y_critical_damage_3 * y_triple_pbs_3 * random.randint(217,255) // 255 elif y_critical_3 == 0 and y_yakedo == 1: ry_attack_3 = by_damage_3 * y_triple_pbs_3 * random.randint(217,255) // 255 elif y_critical_3 == 1 and y_yakedo == 1: ry_attack_3 = by_critical_damage_3 * y_triple_pbs_3 * random.randint(217,255) // 255 if y_sub_3 >= 22 and y_bit_3 == 1: # 技の効果 if y_sub_3 == 22: # 怒りの前歯 ry_attack_3 = x_hp_3 // 2 elif y_sub_3 == 23: # 固定ダメージ ry_attack_3 = y_damage_3 elif y_sub_3 == 24: # プレゼント ry_gift = random.randint(1,10) if gamemode != 2 and ry_gift in (1,2): # GB/N64の回復 ry_attack_3 = -x_trunc_4 elif gamemode == 2 and ry_gift in (1,2): # PBSの回復 ry_attack_3 = -80 elif y_critical_3 == 0 and y_yakedo == 0: if ry_gift in (3,4,5,6): ry_attack_3 = y_g40 * y_triple_pbs_3 * random.randint(217,255) // 255 elif ry_gift in (7,8,9): ry_attack_3 = y_g80 * y_triple_pbs_3 * random.randint(217,255) // 255 elif ry_gift == 10: ry_attack_3 = y_g120 * y_triple_pbs_3 * random.randint(217,255) // 255 elif y_critical_3 == 1 and y_yakedo == 0: if ry_gift in (3,4,5,6): ry_attack_3 = y_cg40 * y_triple_pbs_3 * random.randint(217,255) // 255 elif ry_gift in (7,8,9): ry_attack_3 = y_cg80 * y_triple_pbs_3 * random.randint(217,255) // 255 elif ry_gift == 10: ry_attack_3 = y_cg120 * y_triple_pbs_3 * random.randint(217,255) // 255 elif y_critical_3 == 0 and y_yakedo == 1: if ry_gift in (3,4,5,6): ry_attack_3 = by_g40 * y_triple_pbs_3 * random.randint(217,255) // 255 elif ry_gift in (7,8,9): ry_attack_3 = by_g80 * y_triple_pbs_3 * random.randint(217,255) // 255 elif ry_gift == 10: ry_attack_3 = by_g120 * y_triple_pbs_3 * random.randint(217,255) // 255 elif y_critical_3 == 1 and y_yakedo == 1: if ry_gift in (3,4,5,6): ry_attack_3 = by_cg40 * y_triple_pbs_3 * random.randint(217,255) // 255 elif ry_gift in (7,8,9): ry_attack_3 = by_cg80 * y_triple_pbs_3 * random.randint(217,255) // 255 elif ry_gift == 10: ry_attack_3 = by_cg120 * y_triple_pbs_3 * random.randint(217,255) // 255 if x_hp_3 > x_max_hp: # 最大HPを超えない x_hp_3 = x_max_hp elif y_sub_3 == 27: # 1/2回復 ry_attack_3 = 0 y_hp_3 += y_trunc_2 if y_hp_3 > y_max_hp: # 最大HPを超えない y_hp_3 = y_max_hp elif y_sub_3 == 28: # 眠る ry_attack_3 = 0 if y_hp_3 < y_max_hp: # 最大HP未満なら回復 y_hp_3 = y_max_hp y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku = 3, 0, 0, 0, 0 # 2ターン眠り elif y_sub_3 == 30: # カウンターorミラーコート ry_attack_3 = rx_attack_3 * 2 if 999 <= x_damage_3 and x_bit_3 == 0 and gamemode == 0: # 一撃外れをカウンター(GB) ry_attack_3 = x_max_hp elif y_sub_3 in (33,34,35): # 2-5連続攻撃 ry_attack_3 = 0 # ダメージの初期化 if y_sub_3 == 33: ry_renzoku = random.randint(1,8) if ry_renzoku in (1,2,3): y_renzoku = 2 elif ry_renzoku in (4,5,6): y_renzoku = 3 elif ry_renzoku == 7: y_renzoku = 4 elif ry_renzoku == 8: y_renzoku = 5 elif y_sub_3 in (34,35): # 2連続攻撃 y_renzoku = 2 if y_sub_3 == 35 and random.randint(1,256) <= 51 and not any([x_koori, x_nemuri, x_mahi, x_yakedo, x_moudoku]): x_doku = 1 # ダブルニードル for _ in range(y_renzoku): # ダメージ累計 y_critical_3 = 0 # 急所の初期化 if y_critical_hit_3 >= random.randint(1,256): # 急所の抽選 y_critical_3 = 1 if y_critical_3 == 0 and y_yakedo == 0: y_renzoku_damage = y_damage_3 * y_triple_pbs_3 * random.randint(217,255) // 255 elif y_critical_3 == 1 and y_yakedo == 0: y_renzoku_damage = y_critical_damage_3 * y_triple_pbs_3 * random.randint(217,255) // 255 elif y_critical_3 == 0 and y_yakedo == 1: y_renzoku_damage = by_damage_3 * y_triple_pbs_3 * random.randint(217,255) // 255 elif y_critical_3 == 1 and y_yakedo == 1: y_renzoku_damage = by_critical_damage_3 * y_triple_pbs_3 * random.randint(217,255) // 255 ry_attack_3 += y_renzoku_damage elif y_sub_3 == 36: # トリプルキック times = 2 # ダメージ倍率 y_renzoku = 0 if y_accuracy_3 >= random.randint(1,256): # 2回目の抽選 y_renzoku = 1 if y_accuracy_3 >= random.randint(1,256): # 3回目の抽選 y_renzoku = 2 for _ in range(y_renzoku): # ダメージ累計 y_critical_3 = 0 # 急所の初期化 if y_critical_hit_3 >= random.randint(1,256): y_critical_3 = 1 if y_critical_3 == 0 and y_yakedo == 0: y_triple_kick = y_damage_3 * times * random.randint(217,255) // 255 elif y_critical_3 == 1 and y_yakedo == 0: y_triple_kick = y_critical_damage_3 * times * random.randint(217,255) // 255 elif y_critical_3 == 0 and y_yakedo == 1: y_triple_kick = by_damage_3 * times * random.randint(217,255) // 255 elif y_critical_3 == 1 and y_yakedo == 1: y_triple_kick = by_critical_damage_3 * times * random.randint(217,255) // 255 times += 1 ry_attack_3 += y_triple_kick elif y_sub_3 == 37 and y_level > 0: # サイコウェーブ ry_attack_3 = random.randint(1,ry_psycho_wave) elif y_sub_3 == 38: # 未来予知 ry_attack_3 = 0 elif y_sub_3 == 39: # じたばた if 1 <= y_hp <= y_flail_2: # 威力の決定 ry_attack_3 = y_f200 if y_yakedo == 0 else by_f200 elif y_flail_2 + 1 <= y_hp <= y_flail_5: ry_attack_3 = y_f150 if y_yakedo == 0 else by_f150 elif y_flail_5 + 1 <= y_hp <= y_flail_10: ry_attack_3 = y_f100 if y_yakedo == 0 else by_f100 elif y_flail_10 + 1 <= y_hp <= y_flail_17: ry_attack_3 = y_f80 if y_yakedo == 0 else by_f80 elif gamemode != 2 and y_flail_17 + 1 <= y_hp <= y_flail_33: ry_attack_3 = y_f40 if y_yakedo == 0 else by_f40 elif gamemode == 2 and y_flail_17 + 1 <= y_hp <= y_flail_pbs: # PBS(40) ry_attack_3 = y_f40 if y_yakedo == 0 else by_f40 elif gamemode != 2 and y_flail_33 + 1 <= y_hp <= y_max_hp: ry_attack_3 = y_f20 if y_yakedo == 0 else by_f20 elif gamemode == 2 and y_flail_pbs + 1 <= y_hp <= y_max_hp: # PBS(20) ry_attack_3 = y_f20 if y_yakedo == 0 else by_f20 if gamemode == 2: # 最高乱数+1ダメージ(PBS) ry_attack_3 = ry_attack_3 * y_triple_pbs_3 + 1 elif y_sub_3 in (40,41): if y_sub_3 == 40: # 転がる if y_sub_2 == 40 and y_bit_2 == 1 and (x_korogaru <= 4): # 最大16倍, 丸くなる32倍 y_korogaru += 1 else: # 倍率リセット y_korogaru = 1 times = 2 ** (y_korogaru + y_marukunaru - 1) elif y_sub_3 == 41: # 連続斬り if y_sub_2 == 41 and y_bit_2 == 1 and (x_renzokugiri <= 4 or gamemode == 2): # 最大16倍, 無制限(PBS) y_renzokugiri += 1 else: # 倍率リセット y_renzokugiri = 1 times = 2 ** (y_renzokugiri - 1) if y_critical_3 == 0 and y_yakedo == 0: ry_attack_3 = y_damage_3 * times * random.randint(217,255) // 255 elif y_critical_3 == 1 and y_yakedo == 0: ry_attack_3 = y_critical_damage_3 * times * random.randint(217,255) // 255 elif y_critical_3 == 0 and y_yakedo == 1: ry_attack_3 = by_damage_3 * times * random.randint(217,255) // 255 elif y_critical_3 == 1 and y_yakedo == 1: ry_attack_3 = by_critical_damage_3 * times * random.randint(217,255) // 255 elif y_sub_3 == 42: # 痛み分け pain_split = (y_hp_3 + x_hp_3) // 2 y_hp_3 = x_hp_3 = pain_split if y_hp_3 > y_max_hp: # 最大HPを超えない y_hp_3 = y_max_hp if x_hp_3 > x_max_hp: x_hp_3 = x_max_hp elif y_sub_3 in (50,51): # 守る・堪える, 後攻は失敗 ry_attack_3, y_protect = 0, 1 elif y_sub_3 == 60 and random.randint(1,256) <= y_per_3: # 素早さダウン y_speed_ph += 1 if y_speed_ph == 1: x_speed = x_speed_ph1 elif y_speed_ph == 2: x_speed = x_speed_ph2 elif y_speed_ph == 3: x_speed = x_speed_ph3 elif y_sub_3 == 61 and random.randint(1,256) <= y_per_3: # 命中率ダウン y_accuracy_ph += 1 if y_accuracy_ph == 1: x_accuracy_4 = x_accuracy_4_ph1 x1_accuracy, x2_accuracy, x3_accuracy = x1_accuracy_ph1, x2_accuracy_ph1, x3_accuracy_ph1 elif y_accuracy_ph == 2: x_accuracy_4 = x_accuracy_4_ph2 x1_accuracy, x2_accuracy, x3_accuracy = x1_accuracy_ph2, x2_accuracy_ph2, x3_accuracy_ph2 elif y_accuracy_ph == 3: x_accuracy_4 = x_accuracy_4_ph3 x1_accuracy, x2_accuracy, x3_accuracy = x1_accuracy_ph3, x2_accuracy_ph3, x3_accuracy_ph3 elif y_sub_3 in (62,63): # 防御or特防ダウン if y_sub_3 == 62 and random.randint(1,256) <= y_per_3: y_bd_ph += 1 elif y_sub_3 == 63: # 防御or特防-2 y_bd_ph += 2 if y_bd_ph == 1: y_damage_4 = y_damage_4_ph1 y_critical_damage_4 = y_critical_damage_4_ph1 by_damage_4 = by_damage_4_ph1 by_critical_damage_4 = by_critical_damage_4_ph1 y1_damage, y2_damage, y3_damage = y1_damage_ph1, y2_damage_ph1, y3_damage_ph1 y1_critical_damage, y2_critical_damage, y3_critical_damage = y1_critical_damage_ph1, y2_critical_damage_ph1, y3_critical_damage_ph1 x_konran_damage, bx_konran_damage = x_konran_damage_ph1, bx_konran_damage_ph1 elif y_bd_ph == 2: y_damage_4 = y_damage_4_ph2 y_critical_damage_4 = y_critical_damage_4_ph2 by_damage_4 = by_damage_4_ph2 by_critical_damage_4 = by_critical_damage_4_ph2 y1_damage, y2_damage, y3_damage = y1_damage_ph2, y2_damage_ph2, y3_damage_ph2 y1_critical_damage, y2_critical_damage, y3_critical_damage = y1_critical_damage_ph2, y2_critical_damage_ph2, y3_critical_damage_ph2 x_konran_damage, bx_konran_damage = x_konran_damage_ph2, bx_konran_damage_ph2 elif y_bd_ph == 3: y_damage_4 = y_damage_4_ph3 y_critical_damage_4 = y_critical_damage_4_ph3 by_damage_4 = by_damage_4_ph3 by_critical_damage_4 = by_critical_damage_4_ph3 y1_damage, y2_damage, y3_damage = y1_damage_ph3, y2_damage_ph3, y3_damage_ph3 y1_critical_damage, y2_critical_damage, y3_critical_damage = y1_critical_damage_ph3, y2_critical_damage_ph3, y3_critical_damage_ph3 x_konran_damage, bx_konran_damage = x_konran_damage_ph3, bx_konran_damage_ph3 elif y_bd_ph == 4: y_damage_4 = y_damage_4_ph4 y_critical_damage_4 = y_critical_damage_4_ph4 by_damage_4 = by_damage_4_ph4 by_critical_damage_4 = by_critical_damage_4_ph4 y1_damage, y2_damage, y3_damage = y1_damage_ph4, y2_damage_ph4, y3_damage_ph4 y1_critical_damage, y2_critical_damage, y3_critical_damage = y1_critical_damage_ph4, y2_critical_damage_ph4, y3_critical_damage_ph4 x_konran_damage, bx_konran_damage = x_konran_damage_ph4, bx_konran_damage_ph4 elif y_bd_ph == 5: y_damage_4 = y_damage_4_ph5 y_critical_damage_4 = y_critical_damage_4_ph5 by_damage_4 = by_damage_4_ph5 by_critical_damage_4 = by_critical_damage_4_ph5 y1_damage, y2_damage, y3_damage = y1_damage_ph5, y2_damage_ph5, y3_damage_ph5 y1_critical_damage, y2_critical_damage, y3_critical_damage = y1_critical_damage_ph5, y2_critical_damage_ph5, y3_critical_damage_ph5 x_konran_damage, bx_konran_damage = x_konran_damage_ph5, bx_konran_damage_ph5 elif y_bd_ph == 6: y_damage_4 = y_damage_4_ph6 y_critical_damage_4 = y_critical_damage_4_ph6 by_damage_4 = by_damage_4_ph6 by_critical_damage_4 = by_critical_damage_4_ph6 y1_damage, y2_damage, y3_damage = y1_damage_ph6, y2_damage_ph6, y3_damage_ph6 y1_critical_damage, y2_critical_damage, y3_critical_damage = y1_critical_damage_ph6, y2_critical_damage_ph6, y3_critical_damage_ph6 x_konran_damage, bx_konran_damage = x_konran_damage_ph6, bx_konran_damage_ph6 if y_bit_3 == 1: # ダメージの判定 x_hp_3 -= ry_attack_3 if y_sub_3 == 20: # 攻撃の反動ダメージ y_hp_3 -= ry_attack_3 // 4 elif y_sub_3 == 21: # HPドレイン y_hp_3 += ry_attack_3 // 2 if y_hp_3 > y_max_hp: # 最大HPを超えない y_hp_3 = y_max_hp if x_sub_3 == 51 and x_hp_3 <= 0 and x_protect > 1 and x_bit_3 == 1: # 堪える x_hp_3 = 1 if x_hachimaki == 1 and x_hp_3 <= 0 and random.randint(1,256) <= 30: # 鉢巻の抽選 x_hp_3 = 1 if x_hp_3 <= 0: # 相手の瀕死判定 y_count_3 += 1 continue elif y_hp_3 <= 0: # 自分の瀕死判定 x_count_3 += 1 continue elif y_sub_3 == 25 and y_bit_3 == 0: # 飛び蹴りの自傷 if gamemode != 2: # GB/N64 y_hp_3 -= ry_attack_3 // 8 elif gamemode == 2: # PBS y_hp_3 -= ry_attack_3 // 4 if y_hp_3 <= 0: # 自分の瀕死判定 x_count_3 += 1 continue if y_hirumi == 1: # 怯みの解除 y_hirumi = 0 # 追加効果の抽選 if y_bit_3 == 1 and 0 < y_sub_3 <= 13: # 先攻は怯まない if y_sub_3 == 2: # 凍りの付与 if random.randint(1,256) <= y_per_3 and not any([x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku]): x_koori = 1 if x_yaketa == x_stock == 1: # 焼けた木の実 x_koori, x_stock = 0, 0 elif y_sub_3 == 3: # 眠りの付与 if not any([x_koori, x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku]): if gamemode == 0: # GB x_nemuri = random.randint(2,7) elif gamemode == 1: # N64 x_nemuri = random.randint(2,4) elif gamemode == 2: # PBS x_nemuri = random.randint(2,5) if x_hakka == x_stock == 1: # 薄荷の実 x_nemuri, x_stock = 0, 0 elif y_sub_3 == 4: # 混乱の付与 if random.randint(1,256) <= y_per_3 and x_konran == 0: x_konran = random.randint(2,5) if x_nigai == x_stock == 1: # 苦い木の実 x_konran, x_stock = 0, 0 elif y_sub_3 == 5: # メロメロの付与 x_meromero = 1 elif y_sub_3 == 6: # 麻痺の付与 if random.randint(1,256) <= y_per_3 and not any([x_koori, x_nemuri, x_doku, x_yakedo, x_moudoku]): x_mahi = 1 if x_mahinaoshi == x_stock == 1: # 麻痺治しの実 x_mahi, x_stock = 0, 0 elif y_sub_3 == 7: # 毒の付与 if random.randint(1,256) <= y_per_3 and not any([x_koori, x_nemuri, x_mahi, x_yakedo, x_moudoku]): x_doku = 1 if x_dokukeshi == x_stock == 1: # 毒消しの実 x_doku, x_stock = 0, 0 elif y_sub_3 == 8: # 火傷の付与 if random.randint(1,256) <= y_per_3 and not any([x_koori, x_nemuri, x_mahi, x_doku, x_moudoku]): x_yakedo = 1 if x_kootta == x_stock == 1: # 凍った木の実 x_yakedo, x_stock = 0, 0 elif y_sub_3 == 9: # 猛毒の付与 if not any([x_koori, x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku]): x_moudoku = 1 if x_dokukeshi == x_stock == 1: # 毒消しの実 x_moudoku, x_stock = 0, 0 elif y_sub_3 == 10: # 宿り木の付与 x_yadorigi = 1 elif y_sub_3 == 11 and (x_nemuri > 0): # 悪夢の付与 x_akumu = 1 elif y_sub_3 == 12: # 呪いの付与 x_noroi = 1 y_hp_3 -= y_trunc_2 if y_hp_3 <= 0: # 自分の瀕死判定 x_count_3 += 1 continue elif y_sub_3 == 13 and random.randint(1,256) <= 51: # トライアタックの付与(凍り・麻痺・火傷) ry_tri_attack = random.randint(1,3) if ry_tri_attack == 1: # 凍りの付与 if not any([x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku]): x_koori = 1 if x_yaketa == x_stock == 1: # 焼けた木の実 x_koori, x_stock = 0, 0 elif ry_tri_attack == 2: # 麻痺の付与 if not any([x_koori, x_nemuri, x_doku, x_yakedo, x_moudoku]): x_mahi = 1 if x_mahinaoshi == x_stock == 1: # 麻痺治しの実 x_mahi, x_stock = 0, 0 elif ry_tri_attack == 3: # 火傷の付与 if not any([x_koori, x_nemuri, x_mahi, x_doku, x_moudoku]): x_yakedo = 1 if x_kootta == x_stock == 1: # 凍った木の実 x_yakedo, x_stock = 0, 0 elif x_koori == 1: # 相手が凍りなら火傷で解除 x_koori = 0 if x_kiseki == x_stock == 1 and any([x_koori, x_nemuri, x_konran, x_mahi, x_doku, x_yakedo, x_moudoku]): # 奇跡の実 x_koori, x_nemuri, x_konran, x_mahi, x_doku, x_yakedo, x_moudoku, x_stock = 0, 0, 0, 0, 0, 0, 0, 0 # 自分のターン終了時(3A) if y_doku == 1: # 毒 y_hp_3 -= y_trunc_8 elif y_yakedo == 1: # 火傷 y_hp_3 -= y_trunc_8 elif y_moudoku > 0: # 猛毒 y_hp_3 -= y_trunc_16 * y_moudoku y_moudoku += 1 if y_yadorigi == 1: # 宿り木の種 y_hp_3 -= y_trunc_8 x_hp_3 += y_trunc_8 if x_hp_3 > x_max_hp: x_hp_3 = x_max_hp if y_akumu == 1 and y_nemuri > 0: # 悪夢 y_hp_3 -= y_trunc_4 if y_noroi == 1: # 呪い y_hp_3 -= y_trunc_4 if y_hp_3 <= 0: # 自分の瀕死判定 x_count_3 += 1 continue # 全体のターン終了時(3A) if y_sub_1 == 38 and y_bit_1 == 1: # 未来予知の判定 x_hp_3 -= y_damage_1 * random.randint(217,255) // 255 if x_hp_3 <= 0: # 行動順で瀕死の判定 y_count_3 += 1 continue if x_sub_1 == 38 and x_bit_1 == 1: y_hp_3 -= x_damage_1 * random.randint(217,255) // 255 if y_hp_3 <= 0: x_count_3 += 1 continue if suna_3 == 1: # 砂嵐の判定 if x_suna == 1: # 行動順で瀕死の判定 x_hp_3 -= x_trunc_8 if x_hp_3 <= 0: y_count_3 += 1 continue if y_suna == 1: y_hp_3 -= y_trunc_8 if y_hp_3 <= 0: x_count_3 += 1 continue if x_tabenokoshi == 1 and y_hp_3 > 0: # 食べ残しの回復 x_hp_3 += x_trunc_16 if x_hp_3 > x_max_hp: # 最大HPを超えない x_hp_3 = x_max_hp if y_tabenokoshi == 1 and y_hp_3 > 0: y_hp_3 += y_trunc_16 if y_hp_3 > y_max_hp: y_hp_3 = y_max_hp if x_koori == 1 and random.randint(1,256) <= 25: # 凍り時の判定 x_koori = 0 if y_koori == 1 and random.randint(1,256) <= 25: y_koori = 0 if x_nemuri > 0 and x_hakka == x_stock == 1: # 眠るの回復 x_nemuri, x_stock = 0, 0 elif x_nemuri > 0 and x_kiseki == x_stock == 1: # 混乱ごと回復 x_nemuri, x_konran, x_stock = 0, 0, 0 if y_nemuri > 0 and y_hakka == y_stock == 1: y_nemuri, y_stock = 0, 0 elif y_nemuri > 0 and y_kiseki == y_stock == 1: y_nemuri, y_konran, y_stock = 0, 0, 0 if x_kinomi != 0 and x_stock == 1 and x_ceil_2 > x_hp_3 > 0: # 木の実の回復 if x_kinomi == 3: x_hp_3 += 30 elif x_kinomi == 2: x_hp_3 += 20 elif x_kinomi == 1: x_hp_3 += 10 x_stock = 0 if y_kinomi != 0 and y_stock == 1 and y_ceil_2 > y_hp_3 > 0: if y_kinomi == 3: y_hp_3 += 30 elif y_kinomi == 2: y_hp_3 += 20 elif y_kinomi == 1: y_hp_3 += 10 y_stock = 0 # プレイヤー2の先制 else: # 先攻 / プレイヤー2 if y_critical_hit_3 >= random.randint(1,256): # 急所の抽選 y_critical_3 = 1 if y_accuracy_3 < random.randint(1,256): # 命中率の抽選 y_bit_3 = 0 if y_koori == 1: # 凍り時の判定: y_bit_3 = 2 elif y_nemuri > 0: # 眠り時の判定 y_nemuri -= 1 if y_nemuri > 0: y_bit_3 = 2 if y_sub_3 == 29: # 寝言の判定 y_bit_3 = 3 elif y_nemuri == 0: # 起きたら悪夢を解除 y_akumu = 0 if y_meromero == 1 and y_bit_3 != 2 and random.randint(1,2) == 1: # メロメロ時の判定 y_bit_3 = 2 if y_mahi == 1 and y_bit_3 != 2 and random.randint(1,4) == 1: # 麻痺時の判定 y_bit_3 = 2 if y_konran > 0 and y_bit_3 != 2: # 混乱時の判定 y_konran -= 1 if random.randint(1,2) == 1 and y_konran > 0: if gamemode != 2 and y_yakedo == 0: # GB/N64は最大値 y_hp_3 -= y_konran_damage elif gamemode != 2 and y_yakedo == 1: y_hp_3 -= by_konran_damage elif gamemode == 2 and y_yakedo == 0: y_hp_3 -= y_konran_damage * random.randint(217,255) // 255 elif gamemode == 2 and y_yakedo == 1: y_hp_3 -= by_konran_damage * random.randint(217,255) // 255 y_bit_3 = 2 if y_hp_3 <= 0: # 自傷の瀕死判定 x_count_3 += 1 continue if y_sub_3 == 29 and y_bit_3 == 3: # 寝言の抽選 y_bit_3 = 1 if y_negoto_way == 2: ry_negoto = random.randint(1,2) elif y_negoto_way == 3: ry_negoto = random.randint(1,3) if ry_negoto == 1: y_damage_3, y_critical_damage_3, y_accuracy_3, y_critical_hit_3 = y1_damage, y1_critical_damage, y1_accuracy, y1_critical_hit y_sub_3, y_per_3 = y1_sub, y1_per elif ry_negoto == 2: y_damage_3, y_critical_damage_3, y_accuracy_3, y_critical_hit_3 = y2_damage, y2_critical_damage, y2_accuracy, y2_critical_hit y_sub_3, y_per_3 = y2_sub, y2_per elif ry_negoto == 3: y_damage_3, y_critical_damage_3, y_accuracy_3, y_critical_hit_3 = y3_damage, y3_critical_damage, y3_accuracy, y3_critical_hit y_sub_3, y_per_3 = y3_sub, y3_per if y_critical_hit_3 >= random.randint(1,256): # 急所の抽選 y_critical_3 = 1 if y_accuracy_3 < random.randint(1,256): # 命中率の抽選 y_bit_3 = 0 if y_bit_3 == 1 or y_sub_3 == 25: # 攻撃の判定 if y_critical_3 == 0 and y_yakedo == 0: ry_attack_3 = y_damage_3 * random.randint(217,255) // 255 elif y_critical_3 == 1 and y_yakedo == 0: ry_attack_3 = y_critical_damage_3 * random.randint(217,255) // 255 elif y_critical_3 == 0 and y_yakedo == 1: ry_attack_3 = by_damage_3 * random.randint(217,255) // 255 elif y_critical_3 == 1 and y_yakedo == 1: ry_attack_3 = by_critical_damage_3 * random.randint(217,255) // 255 if y_sub_3 >= 22 and y_bit_3 == 1: # 技の効果 if y_sub_3 == 22: # 怒りの前歯 ry_attack_3 = x_hp_3 // 2 elif y_sub_3 == 23: # 固定ダメージ ry_attack_3 = y_damage_3 elif y_sub_3 == 24: # プレゼント ry_gift = random.randint(1,10) if gamemode != 2 and ry_gift in (1,2): # GB/N64の回復 ry_attack_3 = -x_trunc_4 elif gamemode == 2 and ry_gift in (1,2): # PBSの回復 ry_attack_3 = -80 elif y_critical_3 == 0 and y_yakedo == 0: if ry_gift in (3,4,5,6): ry_attack_3 = y_g40 * random.randint(217,255) // 255 elif ry_gift in (7,8,9): ry_attack_3 = y_g80 * random.randint(217,255) // 255 elif ry_gift == 10: ry_attack_3 = y_g120 * random.randint(217,255) // 255 elif y_critical_3 == 1 and y_yakedo == 0: if ry_gift in (3,4,5,6): ry_attack_3 = y_cg40 * random.randint(217,255) // 255 elif ry_gift in (7,8,9): ry_attack_3 = y_cg80 * random.randint(217,255) // 255 elif ry_gift == 10: ry_attack_3 = y_cg120 * random.randint(217,255) // 255 elif y_critical_3 == 0 and y_yakedo == 1: if ry_gift in (3,4,5,6): ry_attack_3 = by_g40 * random.randint(217,255) // 255 elif ry_gift in (7,8,9): ry_attack_3 = by_g80 * random.randint(217,255) // 255 elif ry_gift == 10: ry_attack_3 = by_g120 * random.randint(217,255) // 255 elif y_critical_3 == 1 and y_yakedo == 1: if ry_gift in (3,4,5,6): ry_attack_3 = by_cg40 * random.randint(217,255) // 255 elif ry_gift in (7,8,9): ry_attack_3 = by_cg80 * random.randint(217,255) // 255 elif ry_gift == 10: ry_attack_3 = by_cg120 * random.randint(217,255) // 255 if x_hp_3 > x_max_hp: # 最大HPを超えない x_hp_3 = x_max_hp elif y_sub_3 == 27: # 1/2回復 ry_attack_3 = 0 y_hp_3 += y_trunc_2 if y_hp_3 > y_max_hp: # 最大HPを超えない y_hp_3 = y_max_hp elif y_sub_3 == 28: # 眠る ry_attack_3 = 0 if y_hp_3 < y_max_hp: # 最大HP未満なら回復 y_hp_3 = y_max_hp y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku = 3, 0, 0, 0, 0 # 2ターン眠り elif y_sub_3 == 30: # カウンターorミラーコート ry_attack_3 = 0 # 先制で失敗 elif y_sub_3 in (33,34,35): # 2-5連続攻撃 ry_attack_3 = 0 # ダメージの初期化 if y_sub_3 == 33: ry_renzoku = random.randint(1,8) if ry_renzoku in (1,2,3): y_renzoku = 2 elif ry_renzoku in (4,5,6): y_renzoku = 3 elif ry_renzoku == 7: y_renzoku = 4 elif ry_renzoku == 8: y_renzoku = 5 elif y_sub_3 in (34,35): # 2連続攻撃 y_renzoku = 2 if y_sub_3 == 35 and random.randint(1,256) <= 51 and not any([x_koori, x_nemuri, x_mahi, x_yakedo, x_moudoku]): x_doku = 1 # ダブルニードル for _ in range(y_renzoku): # ダメージ累計 y_critical_3 = 0 # 急所の初期化 if y_critical_hit_3 >= random.randint(1,256): # 急所の抽選 y_critical_3 = 1 if y_critical_3 == 0 and y_yakedo == 0: y_renzoku_damage = y_damage_3 * random.randint(217,255) // 255 elif y_critical_3 == 1 and y_yakedo == 0: y_renzoku_damage = y_critical_damage_3 * random.randint(217,255) // 255 elif y_critical_3 == 0 and y_yakedo == 1: y_renzoku_damage = by_damage_3 * random.randint(217,255) // 255 elif y_critical_3 == 1 and y_yakedo == 1: y_renzoku_damage = by_critical_damage_3 * random.randint(217,255) // 255 ry_attack_3 += y_renzoku_damage elif y_sub_3 == 36: # トリプルキック times = 2 # ダメージ倍率 y_renzoku = 0 if y_accuracy_3 >= random.randint(1,256): # 2回目の抽選 y_renzoku = 1 if gamemode == 2: # 後攻への乗算バグ(PBS) x_triple_pbs_3 = 2 if y_accuracy_3 >= random.randint(1,256): # 3回目の抽選 y_renzoku = 2 if gamemode == 2: x_triple_pbs_3 = 3 for _ in range(y_renzoku): # ダメージ累計 y_critical_3 = 0 # 急所の初期化 if y_critical_hit_3 >= random.randint(1,256): y_critical_3 = 1 if y_critical_3 == 0 and y_yakedo == 0: y_triple_kick = y_damage_3 * times * random.randint(217,255) // 255 elif y_critical_3 == 1 and y_yakedo == 0: y_triple_kick = y_critical_damage_3 * times * random.randint(217,255) // 255 elif y_critical_3 == 0 and y_yakedo == 1: y_triple_kick = by_damage_3 * times * random.randint(217,255) // 255 elif y_critical_3 == 1 and y_yakedo == 1: y_triple_kick = by_critical_damage_3 * times * random.randint(217,255) // 255 times += 1 ry_attack_3 += y_triple_kick elif y_sub_3 == 37 and y_level > 0: # サイコウェーブ ry_attack_3 = random.randint(1,ry_psycho_wave) elif y_sub_3 == 38: # 未来予知 ry_attack_3 = 0 elif y_sub_3 == 39: # じたばた if 1 <= y_hp <= y_flail_2: # 威力の決定 ry_attack_3 = y_f200 if y_yakedo == 0 else by_f200 elif y_flail_2 + 1 <= y_hp <= y_flail_5: ry_attack_3 = y_f150 if y_yakedo == 0 else by_f150 elif y_flail_5 + 1 <= y_hp <= y_flail_10: ry_attack_3 = y_f100 if y_yakedo == 0 else by_f100 elif y_flail_10 + 1 <= y_hp <= y_flail_17: ry_attack_3 = y_f80 if y_yakedo == 0 else by_f80 elif gamemode != 2 and y_flail_17 + 1 <= y_hp <= y_flail_33: ry_attack_3 = y_f40 if y_yakedo == 0 else by_f40 elif gamemode == 2 and y_flail_17 + 1 <= y_hp <= y_flail_pbs: # PBS(40) ry_attack_3 = y_f40 if y_yakedo == 0 else by_f40 elif gamemode != 2 and y_flail_33 + 1 <= y_hp <= y_max_hp: ry_attack_3 = y_f20 if y_yakedo == 0 else by_f20 elif gamemode == 2 and y_flail_pbs + 1 <= y_hp <= y_max_hp: # PBS(20) ry_attack_3 = y_f20 if y_yakedo == 0 else by_f20 elif y_sub_3 in (40,41): if y_sub_3 == 40: # 転がる if y_sub_2 == 40 and y_bit_2 == 1 and (x_korogaru <= 4): # 最大16倍, 丸くなる32倍 y_korogaru += 1 else: # 倍率リセット y_korogaru = 1 times = 2 ** (y_korogaru + y_marukunaru - 1) elif y_sub_3 == 41: # 連続斬り if y_sub_2 == 41 and y_bit_2 == 1 and (x_renzokugiri <= 4 or gamemode == 2): # 最大16倍, 無制限(PBS) y_renzokugiri += 1 else: # 倍率リセット y_renzokugiri = 1 times = 2 ** (y_renzokugiri - 1) if y_critical_3 == 0 and y_yakedo == 0: ry_attack_3 = y_damage_3 * times * random.randint(217,255) // 255 elif y_critical_3 == 1 and y_yakedo == 0: ry_attack_3 = y_critical_damage_3 * times * random.randint(217,255) // 255 elif y_critical_3 == 0 and y_yakedo == 1: ry_attack_3 = by_damage_3 * times * random.randint(217,255) // 255 elif y_critical_3 == 1 and y_yakedo == 1: ry_attack_3 = by_critical_damage_3 * times * random.randint(217,255) // 255 elif y_sub_3 == 42: # 痛み分け pain_split = (y_hp_3 + x_hp_3) // 2 y_hp_3 = x_hp_3 = pain_split if y_hp_3 > y_max_hp: # 最大HPを超えない y_hp_3 = y_max_hp if x_hp_3 > x_max_hp: x_hp_3 = x_max_hp elif y_sub_3 in (50,51): # 守る・堪える, 後攻で処理 ry_attack_3 = 0 elif y_sub_3 == 60 and random.randint(1,256) <= y_per_3: # 素早さダウン y_speed_ph += 1 if y_speed_ph == 1: x_speed = x_speed_ph1 elif y_speed_ph == 2: x_speed = x_speed_ph2 elif y_speed_ph == 3: x_speed = x_speed_ph3 elif y_sub_3 == 61 and random.randint(1,256) <= y_per_3: # 命中率ダウン y_accuracy_ph += 1 if y_accuracy_ph == 1: x_accuracy_3, x_accuracy_4 = x_accuracy_3_ph1, x_accuracy_4_ph1 x1_accuracy, x2_accuracy, x3_accuracy = x1_accuracy_ph1, x2_accuracy_ph1, x3_accuracy_ph1 elif y_accuracy_ph == 2: x_accuracy_3, x_accuracy_4 = x_accuracy_3_ph2, x_accuracy_4_ph2 x1_accuracy, x2_accuracy, x3_accuracy = x1_accuracy_ph2, x2_accuracy_ph2, x3_accuracy_ph2 elif y_accuracy_ph == 3: x_accuracy_3, x_accuracy_4 = x_accuracy_3_ph3, x_accuracy_4_ph3 x1_accuracy, x2_accuracy, x3_accuracy = x1_accuracy_ph3, x2_accuracy_ph3, x3_accuracy_ph3 elif y_sub_3 in (62,63): # 防御or特防ダウン if y_sub_3 == 62 and random.randint(1,256) <= y_per_3: y_bd_ph += 1 elif y_sub_3 == 63: # 防御or特防-2 y_bd_ph += 2 if y_bd_ph == 1: y_damage_4 = y_damage_4_ph1 y_critical_damage_4 = y_critical_damage_4_ph1 by_damage_4 = by_damage_4_ph1 by_critical_damage_4 = by_critical_damage_4_ph1 y1_damage, y2_damage, y3_damage = y1_damage_ph1, y2_damage_ph1, y3_damage_ph1 y1_critical_damage, y2_critical_damage, y3_critical_damage = y1_critical_damage_ph1, y2_critical_damage_ph1, y3_critical_damage_ph1 x_konran_damage, bx_konran_damage = x_konran_damage_ph1, bx_konran_damage_ph1 elif y_bd_ph == 2: y_damage_4 = y_damage_4_ph2 y_critical_damage_4 = y_critical_damage_4_ph2 by_damage_4 = by_damage_4_ph2 by_critical_damage_4 = by_critical_damage_4_ph2 y1_damage, y2_damage, y3_damage = y1_damage_ph2, y2_damage_ph2, y3_damage_ph2 y1_critical_damage, y2_critical_damage, y3_critical_damage = y1_critical_damage_ph2, y2_critical_damage_ph2, y3_critical_damage_ph2 x_konran_damage, bx_konran_damage = x_konran_damage_ph2, bx_konran_damage_ph2 elif y_bd_ph == 3: y_damage_4 = y_damage_4_ph3 y_critical_damage_4 = y_critical_damage_4_ph3 by_damage_4 = by_damage_4_ph3 by_critical_damage_4 = by_critical_damage_4_ph3 y1_damage, y2_damage, y3_damage = y1_damage_ph3, y2_damage_ph3, y3_damage_ph3 y1_critical_damage, y2_critical_damage, y3_critical_damage = y1_critical_damage_ph3, y2_critical_damage_ph3, y3_critical_damage_ph3 x_konran_damage, bx_konran_damage = x_konran_damage_ph3, bx_konran_damage_ph3 elif y_bd_ph == 4: y_damage_4 = y_damage_4_ph4 y_critical_damage_4 = y_critical_damage_4_ph4 by_damage_4 =by_damage_4_ph4 by_critical_damage_4 = by_critical_damage_4_ph4 y1_damage, y2_damage, y3_damage = y1_damage_ph4, y2_damage_ph4, y3_damage_ph4 y1_critical_damage, y2_critical_damage, y3_critical_damage = y1_critical_damage_ph4, y2_critical_damage_ph4, y3_critical_damage_ph4 x_konran_damage, bx_konran_damage = x_konran_damage_ph4, bx_konran_damage_ph4 elif y_bd_ph == 5: y_damage_4 = y_damage_4_ph5 y_critical_damage_4 = y_critical_damage_4_ph5 by_damage_4 = by_damage_4_ph5 by_critical_damage_4 = by_critical_damage_4_ph5 y1_damage, y2_damage, y3_damage = y1_damage_ph5, y2_damage_ph5, y3_damage_ph5 y1_critical_damage, y2_critical_damage, y3_critical_damage = y1_critical_damage_ph5, y2_critical_damage_ph5, y3_critical_damage_ph5 x_konran_damage, bx_konran_damage = x_konran_damage_ph5, bx_konran_damage_ph5 elif y_bd_ph == 6: y_damage_4 = y_damage_4_ph6 y_critical_damage_4 = y_critical_damage_4_ph6 by_damage_4 = by_damage_4_ph6 by_critical_damage_4 = by_critical_damage_4_ph6 y1_damage, y2_damage, y3_damage = y1_damage_ph6, y2_damage_ph6, y3_damage_ph6 y1_critical_damage, y2_critical_damage, y3_critical_damage = y1_critical_damage_ph6, y2_critical_damage_ph6, y3_critical_damage_ph6 x_konran_damage, bx_konran_damage = x_konran_damage_ph6, bx_konran_damage_ph6 if y_bit_3 == 1: # ダメージの判定 x_hp_3 -= ry_attack_3 if y_sub_3 == 20: # 攻撃の反動ダメージ y_hp_3 -= ry_attack_3 // 4 elif y_sub_3 == 21: # HPドレイン y_hp_3 += ry_attack_3 // 2 if y_hp_3 > y_max_hp: # 最大HPを超えない y_hp_3 = y_max_hp if y_ouja_3 == 1 and random.randint(1,256) <= 30: # 先攻のみ王者の抽選 x_hirumi = 1 if x_hachimaki == 1 and x_hp_3 <= 0 and random.randint(1,256) <= 30: # 鉢巻の抽選 x_hp_3 = 1 if x_hp_3 <= 0: # 相手の瀕死判定 y_count_3 += 1 continue elif y_hp_3 <= 0: # 自分の瀕死判定 x_count_3 += 1 continue elif y_sub_3 == 25 and y_bit_3 == 0: # 飛び蹴りの自傷 if gamemode != 2: # GB/N64 y_hp_3 -= ry_attack_3 // 8 elif gamemode == 2: # PBS y_hp_3 -= ry_attack_3 // 4 if y_hp_3 <= 0: # 自分の瀕死判定 x_count_3 += 1 continue if y_hirumi == 1: # 怯みの解除 y_hirumi = 0 # 追加効果の抽選 if y_bit_3 == 1 and 0 < y_sub_3 <= 13: if y_sub_3 == 1: # 怯みの付与 if random.randint(1,256) <= y_per_3: x_hirumi = 1 elif y_sub_3 == 2: # 凍りの付与 if random.randint(1,256) <= y_per_3 and not any([x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku]): x_koori = 1 if x_yaketa == x_stock == 1: # 焼けた木の実 x_koori, x_stock = 0, 0 elif y_sub_3 == 3: # 眠りの付与 if not any([x_koori, x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku]): if gamemode == 0: # GB x_nemuri = random.randint(2,7) elif gamemode == 1: # N64 x_nemuri = random.randint(2,4) elif gamemode == 2: # PBS x_nemuri = random.randint(2,5) if x_hakka == x_stock == 1: # 薄荷の実 x_nemuri, x_stock = 0, 0 elif y_sub_3 == 4: # 混乱の付与 if random.randint(1,256) <= y_per_3 and x_konran == 0: x_konran = random.randint(2,5) if x_nigai == x_stock == 1: # 苦い木の実 x_konran, x_stock = 0, 0 elif y_sub_3 == 5: # メロメロの付与 x_meromero = 1 elif y_sub_3 == 6: # 麻痺の付与 if random.randint(1,256) <= y_per_3 and not any([x_koori, x_nemuri, x_doku, x_yakedo, x_moudoku]): x_mahi = 1 if x_mahinaoshi == x_stock == 1: # 麻痺治しの実 x_mahi, x_stock = 0, 0 elif y_sub_3 == 7: # 毒の付与 if random.randint(1,256) <= y_per_3 and not any([x_koori, x_nemuri, x_mahi, x_yakedo, x_moudoku]): x_doku = 1 if x_dokukeshi == x_stock == 1: # 毒消しの実 x_doku, x_stock = 0, 0 elif y_sub_3 == 8: # 火傷の付与 if random.randint(1,256) <= y_per_3 and not any([x_koori, x_nemuri, x_mahi, x_doku, x_moudoku]): x_yakedo = 1 if x_kootta == x_stock == 1: # 凍った木の実 x_yakedo, x_stock = 0, 0 elif y_sub_3 == 9: # 猛毒の付与 if not any([x_koori, x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku]): x_moudoku = 1 if x_dokukeshi == x_stock == 1: # 毒消しの実 x_moudoku, x_stock = 0, 0 elif y_sub_3 == 10: # 宿り木の付与 x_yadorigi = 1 elif y_sub_3 == 11 and (x_nemuri > 0): # 悪夢の付与 x_akumu = 1 elif y_sub_3 == 12: # 呪いの付与 x_noroi = 1 y_hp_3 -= y_trunc_2 if y_hp_3 <= 0: # 自分の瀕死判定 x_count_3 += 1 continue elif y_sub_3 == 13 and random.randint(1,256) <= 51: # トライアタックの付与(凍り・麻痺・火傷) ry_tri_attack = random.randint(1,3) if ry_tri_attack == 1: # 凍りの付与 if not any([x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku]): x_koori = 1 if x_yaketa == x_stock == 1: # 焼けた木の実 x_koori, x_stock = 0, 0 elif ry_tri_attack == 2: # 麻痺の付与 if not any([x_koori, x_nemuri, x_doku, x_yakedo, x_moudoku]): x_mahi = 1 if x_mahinaoshi == x_stock == 1: # 麻痺治しの実 x_mahi, x_stock = 0, 0 elif ry_tri_attack == 3: # 火傷の付与 if not any([x_koori, x_nemuri, x_mahi, x_doku, x_moudoku]): x_yakedo = 1 if x_kootta == x_stock == 1: # 凍った木の実 x_yakedo, x_stock = 0, 0 elif x_koori == 1: # 相手が凍りなら火傷で解除 x_koori = 0 if x_kiseki == x_stock == 1 and any([x_koori, x_nemuri, x_konran, x_mahi, x_doku, x_yakedo, x_moudoku]): # 奇跡の実 x_koori, x_nemuri, x_konran, x_mahi, x_doku, x_yakedo, x_moudoku, x_stock = 0, 0, 0, 0, 0, 0, 0, 0 # 自分のターン終了時(3B) if y_doku == 1: # 毒 y_hp_3 -= y_trunc_8 elif y_yakedo == 1: # 火傷 y_hp_3 -= y_trunc_8 elif y_moudoku > 0: # 猛毒 y_hp_3 -= y_trunc_16 * y_moudoku y_moudoku += 1 if y_yadorigi == 1: # 宿り木の種 y_hp_3 -= y_trunc_8 x_hp_3 += y_trunc_8 if x_hp_3 > x_max_hp: x_hp_3 = x_max_hp if y_akumu == 1 and y_nemuri > 0: # 悪夢 y_hp_3 -= y_trunc_4 if y_noroi == 1: # 呪い y_hp_3 -= y_trunc_4 if y_hp_3 <= 0: # 自分の瀕死判定 x_count_3 += 1 continue # 後攻 / プレイヤー1 if x_critical_hit_3 >= random.randint(1,256): # 急所の抽選 x_critical_3 = 1 if x_accuracy_3 < random.randint(1,256): # 命中率の抽選 x_bit_3 = 0 if x_hirumi == 1 and gamemode == 2: # 怯み時の判定(PBS) x_bit_3 = 2 if x_koori == 1: # 凍り時の判定: x_bit_3 = 2 elif x_nemuri > 0 and x_bit_3 != 2: # 眠り時の判定 x_nemuri -= 1 if x_nemuri > 0: x_bit_3 = 2 if x_sub_3 == 29: # 寝言の判定 x_bit_3 = 3 elif x_nemuri == 0: # 起きたら悪夢を解除 x_akumu = 0 if x_hirumi == 1 and gamemode != 2: # 怯み時の判定(GB/N64) x_bit_3 = 2 if x_meromero == 1 and x_bit_3 != 2 and random.randint(1,2) == 1: # メロメロ時の判定 x_bit_3 = 2 if x_mahi == 1 and x_bit_3 != 2 and random.randint(1,4) == 1: # 麻痺時の判定 x_bit_3 = 2 if x_konran > 0 and x_bit_3 != 2: # 混乱時の判定 x_konran -= 1 if random.randint(1,2) == 1 and y_konran > 0: if gamemode != 2 and x_yakedo == 0: # GB/N64は最大値 x_hp_3 -= x_konran_damage elif gamemode != 2 and x_yakedo == 1: x_hp_3 -= bx_konran_damage elif gamemode == 2 and x_yakedo == 0: x_hp_3 -= x_konran_damage * random.randint(217,255) // 255 elif gamemode == 2 and x_yakedo == 1: x_hp_3 -= bx_konran_damage * random.randint(217,255) // 255 x_bit_3 = 2 if x_hp_3 <= 0: # 自傷の瀕死判定 y_count_3 += 1 continue if x_sub_3 == 29 and x_bit_3 == 3: # 寝言の抽選 x_bit_3 = 1 if x_negoto_way == 2: rx_negoto = random.randint(1,2) elif x_negoto_way == 3: rx_negoto = random.randint(1,3) if rx_negoto == 1: x_damage_3, x_critical_damage_3, x_accuracy_3, x_critical_hit_3 = x1_damage, x1_critical_damage, x1_accuracy, x1_critical_hit x_sub_3, x_per_3 = x1_sub, x1_per elif rx_negoto == 2: x_damage_3, x_critical_damage_3, x_accuracy_3, x_critical_hit_3 = x2_damage, x2_critical_damage, x2_accuracy, x2_critical_hit x_sub_3, x_per_3 = x2_sub, x2_per elif rx_negoto == 3: x_damage_3, x_critical_damage_3, x_accuracy_3, x_critical_hit_3 = x3_damage, x3_critical_damage, x3_accuracy, x3_critical_hit x_sub_3, x_per_3 = x3_sub, x3_per if x_critical_hit_3 >= random.randint(1,256): # 急所の抽選 x_critical_3 = 1 if x_accuracy_3 < random.randint(1,256): # 命中率の抽選 x_bit_3 = 0 if y_sub_3 in (50,51): # 先攻の守る・堪える if not y_sub_2 in (50,51): y_protect = 1 ry_protect = (1/2 ** (y_protect - 1) * 256 - 1/256) // 1 if y_bit_3 != 2 and (ry_protect >= random.randint(1,256) or (gamemode == 2 and y_protect == 1)): # 1ターン目は必ず成功(PBS) y_protect += 1 if y_sub_3 == 50 and not x_sub_3 in (11,12,27,28,38): # 守る # 悪夢・呪い・回復・未来予知は有効 x_bit_3 = 0 else: y_protect = 1 if x_bit_3 == 1 or x_sub_3 == 25: # 攻撃の判定 if x_critical_3 == 0 and x_yakedo == 0: rx_attack_3 = x_damage_3 * x_triple_pbs_3 * random.randint(217,255) // 255 elif x_critical_3 == 1 and x_yakedo == 0: rx_attack_3 = x_critical_damage_3 * x_triple_pbs_3 * random.randint(217,255) // 255 elif x_critical_3 == 0 and x_yakedo == 1: rx_attack_3 = bx_damage_3 * x_triple_pbs_3 * random.randint(217,255) // 255 elif x_critical_3 == 1 and x_yakedo == 1: rx_attack_3 = bx_critical_damage_3 * x_triple_pbs_3 * random.randint(217,255) // 255 if x_sub_3 >= 22 and x_bit_3 == 1: # 技の効果 if x_sub_3 == 22: # 怒りの前歯 rx_attack_3 = y_hp_3 // 2 elif x_sub_3 == 23: # 固定ダメージ rx_attack_3 = x_damage_3 elif x_sub_3 == 24: # プレゼント rx_gift = random.randint(1,10) if gamemode != 2 and rx_gift in (1,2): # GB/N64の回復 rx_attack_3 = -y_trunc_4 elif gamemode == 2 and rx_gift in (1,2): # PBSの回復 rx_attack_3 = -80 elif x_critical_3 == 0 and x_yakedo == 0: if rx_gift in (3,4,5,6): rx_attack_3 = x_g40 * x_triple_pbs_3 * random.randint(217,255) // 255 elif rx_gift in (7,8,9): rx_attack_3 = x_g80 * x_triple_pbs_3 * random.randint(217,255) // 255 elif rx_gift == 10: rx_attack_3 = x_g120 * x_triple_pbs_3 * random.randint(217,255) // 255 elif x_critical_3 == 1 and x_yakedo == 0: if rx_gift in (3,4,5,6): rx_attack_3 = x_cg40 * x_triple_pbs_3 * random.randint(217,255) // 255 elif rx_gift in (7,8,9): rx_attack_3 = x_cg80 * x_triple_pbs_3 * random.randint(217,255) // 255 elif rx_gift == 10: rx_attack_3 = x_cg120 * x_triple_pbs_3 * random.randint(217,255) // 255 elif x_critical_3 == 0 and x_yakedo == 1: if rx_gift in (3,4,5,6): rx_attack_3 = bx_g40 * x_triple_pbs_3 * random.randint(217,255) // 255 elif rx_gift in (7,8,9): rx_attack_3 = bx_g80 * x_triple_pbs_3 * random.randint(217,255) // 255 elif rx_gift == 10: rx_attack_3 = bx_g120 * x_triple_pbs_3 * random.randint(217,255) // 255 elif x_critical_3 == 1 and x_yakedo == 1: if rx_gift in (3,4,5,6): rx_attack_3 = bx_cg40 * x_triple_pbs_3 * random.randint(217,255) // 255 elif rx_gift in (7,8,9): rx_attack_3 = bx_cg80 * x_triple_pbs_3 * random.randint(217,255) // 255 elif rx_gift == 10: rx_attack_3 = bx_cg120 * x_triple_pbs_3 * random.randint(217,255) // 255 if y_hp_3 > y_max_hp: # 最大HPを超えない y_hp_3 = y_max_hp elif x_sub_3 == 27: # 1/2回復 rx_attack_3 = 0 x_hp_3 += x_trunc_2 if x_hp_3 > x_max_hp: # 最大HPを超えない x_hp_3 = x_max_hp elif x_sub_3 == 28: # 眠る rx_attack_3 = 0 if x_hp_3 < x_max_hp: # 最大HP未満なら回復 x_hp_3 = x_max_hp x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku = 3, 0, 0, 0, 0 # 2ターン眠り elif x_sub_3 == 30: # カウンターorミラーコート rx_attack_3 = ry_attack_3 * 2 if 999 <= y_damage_3 and y_bit_3 == 0 and gamemode == 0: # 一撃外れをカウンター(GB) rx_attack_3 = y_max_hp elif x_sub_3 in (33,34,35): # 2-5連続攻撃 rx_attack_3 = 0 # ダメージの初期化 if x_sub_3 == 33: rx_renzoku = random.randint(1,8) if rx_renzoku in (1,2,3): x_renzoku = 2 elif rx_renzoku in (4,5,6): x_renzoku = 3 elif rx_renzoku == 7: x_renzoku = 4 elif rx_renzoku == 8: x_renzoku = 5 elif x_sub_3 in (34,35): # 2連続攻撃 x_renzoku = 2 if x_sub_3 == 35 and random.randint(1,256) <= 51 and not any([y_koori, y_nemuri, y_mahi, y_yakedo, y_moudoku]): y_doku = 1 # ダブルニードル for _ in range(x_renzoku): # ダメージ累計 x_critical_3 = 0 # 急所の初期化 if x_critical_hit_3 >= random.randint(1,256): # 急所の抽選 x_critical_3 = 1 if x_critical_3 == 0 and x_yakedo == 0: x_renzoku_damage = x_damage_3 * x_triple_pbs_3 * random.randint(217,255) // 255 elif x_critical_3 == 1 and x_yakedo == 0: x_renzoku_damage = x_critical_damage_3 * x_triple_pbs_3 * random.randint(217,255) // 255 elif x_critical_3 == 0 and x_yakedo == 1: x_renzoku_damage = bx_damage_3 * x_triple_pbs_3 * random.randint(217,255) // 255 elif x_critical_3 == 1 and x_yakedo == 1: x_renzoku_damage = bx_critical_damage_3 * x_triple_pbs_3 * random.randint(217,255) // 255 rx_attack_3 += x_renzoku_damage elif x_sub_3 == 36: # トリプルキック times = 2 # ダメージ倍率 x_renzoku = 0 if x_accuracy_3 >= random.randint(1,256): # 2回目の抽選 x_renzoku = 1 if x_accuracy_3 >= random.randint(1,256): # 3回目の抽選 x_renzoku = 2 for _ in range(x_renzoku): # ダメージ累計 x_critical_3 = 0 # 急所の初期化 if x_critical_hit_3 >= random.randint(1,256): x_critical_3 = 1 if x_critical_3 == 0 and x_yakedo == 0: x_triple_kick = x_damage_3 * times * random.randint(217,255) // 255 elif x_critical_3 == 1 and x_yakedo == 0: x_triple_kick = x_critical_damage_3 * times * random.randint(217,255) // 255 elif x_critical_3 == 0 and x_yakedo == 1: x_triple_kick = bx_damage_3 * times * random.randint(217,255) // 255 elif x_critical_3 == 1 and x_yakedo == 1: x_triple_kick = bx_critical_damage_3 * times * random.randint(217,255) // 255 times += 1 rx_attack_3 += x_triple_kick elif x_sub_3 == 37 and x_level > 0: # サイコウェーブ rx_attack_3 = random.randint(1,rx_psycho_wave) elif x_sub_3 == 38: # 未来予知 rx_attack_3 = 0 elif x_sub_3 == 39: # じたばた if 1 <= x_hp <= x_flail_2: # 威力の決定 rx_attack_3 = x_f200 if x_yakedo == 0 else bx_f200 elif x_flail_2 + 1 <= x_hp <= x_flail_5: rx_attack_3 = x_f150 if x_yakedo == 0 else bx_f150 elif x_flail_5 + 1 <= x_hp <= x_flail_10: rx_attack_3 = x_f100 if x_yakedo == 0 else bx_f100 elif x_flail_10 + 1 <= x_hp <= x_flail_17: rx_attack_3 = x_f80 if x_yakedo == 0 else bx_f80 elif gamemode != 2 and x_flail_17 + 1 <= x_hp <= x_flail_33: rx_attack_3 = x_f40 if x_yakedo == 0 else bx_f40 elif gamemode == 2 and x_flail_17 + 1 <= x_hp <= x_flail_pbs: # PBS(40) rx_attack_3 = x_f40 if x_yakedo == 0 else bx_f40 elif gamemode != 2 and x_flail_33 + 1 <= x_hp <= x_max_hp: rx_attack_3 = x_f20 if x_yakedo == 0 else bx_f20 elif gamemode == 2 and x_flail_pbs + 1 <= x_hp <= x_max_hp: # PBS(20) rx_attack_3 = x_f20 if x_yakedo == 0 else bx_f20 if gamemode == 2: # 最高乱数+1ダメージ(PBS) rx_attack_3 = rx_attack_3 * x_triple_pbs_3 + 1 elif x_sub_3 in (40,41): if x_sub_3 == 40: # 転がる if x_sub_2 == 40 and x_bit_2 == 1 and (x_korogaru <= 4): # 最大16倍, 丸くなる32倍 x_korogaru += 1 else: # 倍率リセット x_korogaru = 1 times = 2 ** (x_korogaru + x_marukunaru - 1) elif x_sub_3 == 41: # 連続斬り if x_sub_2 == 41 and x_bit_2 == 1 and (x_renzokugiri <= 4 or gamemode == 2): # 最大16倍, 無制限(PBS) x_renzokugiri += 1 else: # 倍率リセット x_renzokugiri = 1 times = 2 ** (x_renzokugiri - 1) if x_critical_3 == 0 and x_yakedo == 0: rx_attack_3 = x_damage_3 * times * random.randint(217,255) // 255 elif x_critical_3 == 1 and x_yakedo == 0: rx_attack_3 = x_critical_damage_3 * times * random.randint(217,255) // 255 elif x_critical_3 == 0 and x_yakedo == 1: rx_attack_3 = bx_damage_3 * times * random.randint(217,255) // 255 elif x_critical_3 == 1 and x_yakedo == 1: rx_attack_3 = bx_critical_damage_3 * times * random.randint(217,255) // 255 elif x_sub_3 == 42: # 痛み分け pain_split = (x_hp_3 + y_hp_3) // 2 x_hp_3 = y_hp_3 = pain_split if x_hp_3 > x_max_hp: # 最大HPを超えない x_hp_3 = x_max_hp if y_hp_3 > y_max_hp: y_hp_3 = y_max_hp elif x_sub_3 in (50,51): # 守る・堪える, 後攻は失敗 rx_attack_3, x_protect = 0, 1 elif x_sub_3 == 60 and random.randint(1,256) <= x_per_3: # 素早さダウン x_speed_ph += 1 if x_speed_ph == 1: y_speed = y_speed_ph1 elif x_speed_ph == 2: y_speed = y_speed_ph2 elif x_speed_ph == 3: y_speed = y_speed_ph3 elif x_sub_3 == 61 and random.randint(1,256) <= x_per_3: # 命中率ダウン x_accuracy_ph += 1 if x_accuracy_ph == 1: y_accuracy_4 = y_accuracy_4_ph1 y1_accuracy, y2_accuracy, y3_accuracy = y1_accuracy_ph1, y2_accuracy_ph1, y3_accuracy_ph1 elif x_accuracy_ph == 2: y_accuracy_4 = y_accuracy_4_ph2 y1_accuracy, y2_accuracy, y3_accuracy = y1_accuracy_ph2, y2_accuracy_ph2, y3_accuracy_ph2 elif x_accuracy_ph == 3: y_accuracy_4 = y_accuracy_4_ph3 y1_accuracy, y2_accuracy, y3_accuracy = y1_accuracy_ph3, y2_accuracy_ph3, y3_accuracy_ph3 elif x_sub_3 in (62,63): # 防御or特防ダウン if x_sub_3 == 62 and random.randint(1,256) <= x_per_3: x_bd_ph += 1 elif x_sub_3 == 63: # 防御or特防-2 x_bd_ph += 2 if x_bd_ph == 1: x_damage_4 = x_damage_4_ph1 x_critical_damage_4 = x_critical_damage_4_ph1 bx_damage_4 = bx_damage_4_ph1 bx_critical_damage_4 = bx_critical_damage_4_ph1 x1_damage, x2_damage, x3_damage = x1_damage_ph1, x2_damage_ph1, x3_damage_ph1 x1_critical_damage, x2_critical_damage, x3_critical_damage = x1_critical_damage_ph1, x2_critical_damage_ph1, x3_critical_damage_ph1 y_konran_damage, by_konran_damage = y_konran_damage_ph1, by_konran_damage_ph1 elif x_bd_ph == 2: x_damage_4 = x_damage_4_ph2 x_critical_damage_4 = x_critical_damage_4_ph2 bx_damage_4 = bx_damage_4_ph2 bx_critical_damage_4 = bx_critical_damage_4_ph2 x1_damage, x2_damage, x3_damage = x1_damage_ph2, x2_damage_ph2, x3_damage_ph2 x1_critical_damage, x2_critical_damage, x3_critical_damage = x1_critical_damage_ph2, x2_critical_damage_ph2, x3_critical_damage_ph2 y_konran_damage, by_konran_damage = y_konran_damage_ph2, by_konran_damage_ph2 elif x_bd_ph == 3: x_damage_4 = x_damage_4_ph3 x_critical_damage_4 = x_critical_damage_4_ph3 bx_damage_4 = bx_damage_4_ph3 bx_critical_damage_4 = bx_critical_damage_4_ph3 x1_damage, x2_damage, x3_damage = x1_damage_ph3, x2_damage_ph3, x3_damage_ph3 x1_critical_damage, x2_critical_damage, x3_critical_damage = x1_critical_damage_ph3, x2_critical_damage_ph3, x3_critical_damage_ph3 y_konran_damage, by_konran_damage = y_konran_damage_ph3, by_konran_damage_ph3 elif x_bd_ph == 4: x_damage_4 = x_damage_4_ph4 x_critical_damage_4 = x_critical_damage_4_ph4 bx_damage_4 = bx_damage_4_ph4 bx_critical_damage_4 = bx_critical_damage_4_ph4 x1_damage, x2_damage, x3_damage = x1_damage_ph4, x2_damage_ph4, x3_damage_ph4 x1_critical_damage, x2_critical_damage, x3_critical_damage = x1_critical_damage_ph4, x2_critical_damage_ph4, x3_critical_damage_ph4 y_konran_damage, by_konran_damage = y_konran_damage_ph4, by_konran_damage_ph4 elif x_bd_ph == 5: x_damage_4 = x_damage_4_ph5 x_critical_damage_4 = x_critical_damage_4_ph5 bx_damage_4 = bx_damage_4_ph5 bx_critical_damage_4 = bx_critical_damage_4_ph5 x1_damage, x2_damage, x3_damage = x1_damage_ph5, x2_damage_ph5, x3_damage_ph5 x1_critical_damage, x2_critical_damage, x3_critical_damage = x1_critical_damage_ph5, x2_critical_damage_ph5, x3_critical_damage_ph5 y_konran_damage, by_konran_damage = y_konran_damage_ph5, by_konran_damage_ph5 elif x_bd_ph == 6: x_damage_4 = x_damage_4_ph6 x_critical_damage_4 = x_critical_damage_4_ph6 bx_damage_4 = bx_damage_4_ph6 bx_critical_damage_4 = bx_critical_damage_4_ph6 x1_damage, x2_damage, x3_damage = x1_damage_ph6, x2_damage_ph6, x3_damage_ph6 x1_critical_damage, x2_critical_damage, x3_critical_damage = x1_critical_damage_ph6, x2_critical_damage_ph6, x3_critical_damage_ph6 y_konran_damage, by_konran_damage = y_konran_damage_ph6, by_konran_damage_ph6 if x_bit_3 == 1: # ダメージの判定 y_hp_3 -= rx_attack_3 if x_sub_3 == 20: # 攻撃の反動ダメージ x_hp_3 -= rx_attack_3 // 4 elif x_sub_3 == 21: # HPドレイン x_hp_3 += rx_attack_3 // 2 if x_hp_3 > x_max_hp: # 最大HPを超えない x_hp_3 = x_max_hp if y_sub_3 == 51 and y_hp_3 <= 0 and y_protect > 1 and y_bit_3 == 1: # 堪える y_hp_3 = 1 if y_hachimaki == 1 and y_hp_3 <= 0 and random.randint(1,256) <= 30: # 鉢巻の抽選 y_hp_3 = 1 if y_hp_3 <= 0: # 相手の瀕死判定 x_count_3 += 1 continue elif x_hp_3 <= 0: # 自分の瀕死判定 y_count_3 += 1 continue elif x_sub_3 == 25 and x_bit_3 == 0: # 飛び蹴りの自傷 if gamemode != 2: # GB/N64 x_hp_3 -= rx_attack_3 // 8 elif gamemode == 2: # PBS x_hp_3 -= rx_attack_3 // 4 if x_hp_3 <= 0: # 自分の瀕死判定 y_count_3 += 1 continue if x_hirumi == 1: # 怯みの解除 x_hirumi = 0 # 追加効果の抽選 if x_bit_3 == 1 and 0 < x_sub_3 <= 13: # 先攻は怯まない if x_sub_3 == 2: # 凍りの付与 if random.randint(1,256) <= x_per_3 and not any([y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku]): y_koori = 1 if y_yaketa == y_stock == 1: # 焼けた木の実 y_koori, y_stock = 0, 0 elif x_sub_3 == 3: # 眠りの付与 if not any([y_koori, y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku]): if gamemode == 0: # GB y_nemuri = random.randint(2,7) elif gamemode == 1: # N64 y_nemuri = random.randint(2,4) elif gamemode == 2: # PBS y_nemuri = random.randint(2,5) if y_hakka == y_stock == 1: # 薄荷の実 y_nemuri, y_stock = 0, 0 elif x_sub_3 == 4: # 混乱の付与 if random.randint(1,256) <= x_per_3 and y_konran == 0: y_konran = random.randint(2,5) if y_nigai == y_stock == 1: # 苦い木の実 y_konran, y_stock = 0, 0 elif x_sub_3 == 5: # メロメロの付与 y_meromero = 1 elif x_sub_3 == 6: # 麻痺の付与 if random.randint(1,256) <= x_per_3 and not any([y_koori, y_nemuri, y_doku, y_yakedo, y_moudoku]): y_mahi = 1 if y_mahinaoshi == y_stock == 1: # 麻痺治しの実 y_mahi, y_stock = 0, 0 elif x_sub_3 == 7: # 毒の付与 if random.randint(1,256) <= x_per_3 and not any([y_koori, y_nemuri, y_mahi, y_yakedo, y_moudoku]): y_doku = 1 if y_dokukeshi == y_stock == 1: # 毒消しの実 y_doku, y_stock = 0, 0 elif x_sub_3 == 8: # 火傷の付与 if random.randint(1,256) <= x_per_3 and not any([y_koori, y_nemuri, y_mahi, y_doku, y_moudoku]): y_yakedo = 1 if y_kootta == y_stock == 1: # 凍った木の実 y_yakedo, y_stock = 0, 0 elif x_sub_3 == 9: # 猛毒の付与 if not any([y_koori, y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku]): y_moudoku = 1 if y_dokukeshi == y_stock == 1: # 毒消しの実 y_moudoku, y_stock = 0, 0 elif x_sub_3 == 10: # 宿り木の付与 y_yadorigi = 1 elif x_sub_3 == 11 and (y_nemuri > 0): # 悪夢の付与 y_akumu = 1 elif x_sub_3 == 12: # 呪いの付与 y_noroi = 1 x_hp_3 -= x_trunc_2 if x_hp_3 <= 0: # 自分の瀕死判定 y_count_3 += 1 continue elif x_sub_3 == 13 and random.randint(1,256) <= 51: # トライアタックの付与(凍り・麻痺・火傷) rx_tri_attack = random.randint(1,3) if rx_tri_attack == 1: # 凍りの付与 if not any([y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku]): y_koori = 1 if y_yaketa == y_stock == 1: # 焼けた木の実 y_koori, y_stock = 0, 0 elif rx_tri_attack == 2: # 麻痺の付与 if not any([y_koori, y_nemuri, y_doku, y_yakedo, y_moudoku]): y_mahi = 1 if y_mahinaoshi == y_stock == 1: # 麻痺治しの実 y_mahi, y_stock = 0, 0 elif rx_tri_attack == 3: # 火傷の付与 if not any([y_koori, y_nemuri, y_mahi, y_doku, y_moudoku]): y_yakedo = 1 if y_kootta == y_stock == 1: # 凍った木の実 y_yakedo, y_stock = 0, 0 elif y_koori == 1: # 相手が凍りなら火傷で解除 y_koori = 0 if y_kiseki == y_stock == 1 and any([y_koori, y_nemuri, y_konran, y_mahi, y_doku, y_yakedo, y_moudoku]): # 奇跡の実 y_koori, y_nemuri, y_konran, y_mahi, y_doku, y_yakedo, y_moudoku, y_stock = 0, 0, 0, 0, 0, 0, 0, 0 # 自分のターン終了時(3B) if x_doku == 1: # 毒 x_hp_3 -= x_trunc_8 elif x_yakedo == 1: # 火傷 x_hp_3 -= x_trunc_8 elif x_moudoku > 0: # 猛毒 x_hp_3 -= x_trunc_16 * x_moudoku x_moudoku += 1 if x_yadorigi == 1: # 宿り木の種 x_hp_3 -= x_trunc_8 y_hp_3 += x_trunc_8 if y_hp_3 > y_max_hp: y_hp_3 = y_max_hp if x_akumu == 1 and x_nemuri > 0: # 悪夢 x_hp_3 -= x_trunc_4 if x_noroi == 1: # 呪い x_hp_3 -= x_trunc_4 if x_hp_3 <= 0: # 自分の瀕死判定 y_count_3 += 1 continue # 全体のターン終了時(3B) if x_sub_1 == 38 and x_bit_1 == 1: # 未来予知の判定 y_hp_3 -= x_damage_1 * random.randint(217,255) // 255 if y_hp_3 <= 0: # 行動順で瀕死の判定 x_count_3 += 1 continue if y_sub_1 == 38 and y_bit_1 == 1: x_hp_3 -= y_damage_1 * random.randint(217,255) // 255 if x_hp_3 <= 0: y_count_3 += 1 continue if suna_3 == 1: # 砂嵐の判定 if y_suna == 1: # 行動順で瀕死の判定 y_hp_3 -= y_trunc_8 if y_hp_3 <= 0: x_count_3 += 1 continue if x_suna == 1: x_hp_3 -= x_trunc_8 if x_hp_3 <= 0: y_count_3 += 1 continue if y_tabenokoshi == 1 and y_hp_3 > 0: # 食べ残しの回復 y_hp_3 += y_trunc_16 if y_hp_3 > y_max_hp: # 最大HPを超えない y_hp_3 = y_max_hp if x_tabenokoshi == 1 and y_hp_3 > 0: x_hp_3 += x_trunc_16 if x_hp_3 > x_max_hp: x_hp_3 = x_max_hp if y_koori == 1 and random.randint(1,256) <= 25: # 凍り時の判定 y_koori = 0 if x_koori == 1 and random.randint(1,256) <= 25: x_koori = 0 if y_nemuri > 0 and y_hakka == y_stock == 1: # 眠るの回復 y_nemuri, y_stock = 0, 0 elif y_nemuri > 0 and y_kiseki == y_stock == 1: # 混乱ごと回復 y_nemuri, y_konran, y_stock = 0, 0, 0 if x_nemuri > 0 and x_hakka == x_stock == 1: x_nemuri, x_stock = 0, 0 elif x_nemuri > 0 and x_kiseki == x_stock == 1: x_nemuri, x_konran, x_stock = 0, 0, 0 if y_kinomi != 0 and y_stock == 1 and y_ceil_2 > y_hp_3 > 0: # 木の実の回復 if y_kinomi == 3: y_hp_3 += 30 elif y_kinomi == 2: y_hp_3 += 20 elif y_kinomi == 1: y_hp_3 += 10 y_stock = 0 if x_kinomi != 0 and x_stock == 1 and x_ceil_2 > x_hp_3 > 0: if x_kinomi == 3: x_hp_3 += 30 elif x_kinomi == 2: x_hp_3 += 20 elif x_kinomi == 1: x_hp_3 += 10 x_stock = 0 ### 4ターン目 ### # 素早さの抽選(4) xx_speed, yy_speed = x_speed, y_speed # 素早さを初期化 if x_mahi == 1: # 麻痺なら素早さ1/4 xx_speed = x_trunc_speed if y_mahi == 1: yy_speed = y_trunc_speed if x_sensei == 1 and random.randint(1,256) <= 60: # 先制の爪の抽選 xx_speed += 1000 if y_sensei == 1 and random.randint(1,256) <= 60: yy_speed += 1000 if x_sub_4 == 31: # 優先度+1 xx_speed += 10000 elif x_sub_4 in (30,32): # カウンターorミラーコート・優先度-1 xx_speed -= 10000 elif x_sub_4 in (50,51): # 守る・堪える・優先度+2 xx_speed += 20000 if y_sub_4 == 31: yy_speed += 10000 elif y_sub_4 in (30,32): yy_speed -= 10000 elif y_sub_4 in (50,51): yy_speed += 20000 # HPの格納・手番の抽選 x_hp_4, y_hp_4 = x_hp_3, y_hp_3 # HPの設定 # プレイヤー1の先制 if xx_speed > yy_speed or (xx_speed == yy_speed and random.randint(1,2) == 1): # 先攻 / プレイヤー1 if x_critical_hit_4 >= random.randint(1,256): # 急所の抽選 x_critical_4 = 1 if x_accuracy_4 < random.randint(1,256): # 命中率の抽選 x_bit_4 = 0 if x_koori == 1: # 凍り時の判定: x_bit_4 = 2 elif x_nemuri > 0: # 眠り時の判定 x_nemuri -= 1 if x_nemuri > 0: x_bit_4 = 2 if x_sub_4 == 29: # 寝言の判定 x_bit_4 = 3 elif x_nemuri == 0: # 起きたら悪夢を解除 x_akumu = 0 if x_meromero == 1 and x_bit_4 != 2 and random.randint(1,2) == 1: # メロメロ時の判定 x_bit_4 = 2 if x_mahi == 1 and x_bit_4 != 2 and random.randint(1,4) == 1: # 麻痺時の判定 x_bit_4 = 2 if x_konran > 0 and x_bit_4 != 2: # 混乱時の判定 x_konran -= 1 if random.randint(1,2) == 1 and x_konran > 0: if gamemode != 2 and x_yakedo == 0: # GB/N64は最大値 x_hp_4 -= x_konran_damage elif gamemode != 2 and x_yakedo == 1: x_hp_4 -= bx_konran_damage elif gamemode == 2 and x_yakedo == 0: x_hp_4 -= x_konran_damage * random.randint(217,255) // 255 elif gamemode == 2 and x_yakedo == 1: x_hp_4 -= bx_konran_damage * random.randint(217,255) // 255 x_bit_4 = 2 if x_hp_4 <= 0: # 自傷の瀕死判定 y_count_4 += 1 continue if x_sub_4 == 29 and x_bit_4 == 3: # 寝言の抽選 x_bit_4 = 1 if x_negoto_way == 2: rx_negoto = random.randint(1,2) elif x_negoto_way == 3: rx_negoto = random.randint(1,3) if rx_negoto == 1: x_damage_4, x_critical_damage_4, x_accuracy_4, x_critical_hit_4 = x1_damage, x1_critical_damage, x1_accuracy, x1_critical_hit x_sub_4, x_per_4 = x1_sub, x1_per elif rx_negoto == 2: x_damage_4, x_critical_damage_4, x_accuracy_4, x_critical_hit_4 = x2_damage, x2_critical_damage, x2_accuracy, x2_critical_hit x_sub_4, x_per_4 = x2_sub, x2_per elif rx_negoto == 3: x_damage_4, x_critical_damage_4, x_accuracy_4, x_critical_hit_4 = x3_damage, x3_critical_damage, x3_accuracy, x3_critical_hit x_sub_4, x_per_4 = x3_sub, x3_per if x_critical_hit_4 >= random.randint(1,256): # 急所の抽選 x_critical_4 = 1 if x_accuracy_4 < random.randint(1,256): # 命中率の抽選 x_bit_4 = 0 if x_bit_4 == 1 or x_sub_4 == 25: # 攻撃の判定 if x_critical_4 == 0 and x_yakedo == 0: rx_attack_4 = x_damage_4 * random.randint(217,255) // 255 elif x_critical_4 == 1 and x_yakedo == 0: rx_attack_4 = x_critical_damage_4 * random.randint(217,255) // 255 elif x_critical_4 == 0 and x_yakedo == 1: rx_attack_4 = bx_damage_4 * random.randint(217,255) // 255 elif x_critical_4 == 1 and x_yakedo == 1: rx_attack_4 = bx_critical_damage_4 * random.randint(217,255) // 255 if x_sub_4 >= 22 and x_bit_4 == 1: # 技の効果 if x_sub_4 == 22: # 怒りの前歯 rx_attack_4 = y_hp_4 // 2 elif x_sub_4 == 23: # 固定ダメージ rx_attack_4 = x_damage_4 elif x_sub_4 == 24: # プレゼント rx_gift = random.randint(1,10) if gamemode != 2 and rx_gift in (1,2): # GB/N64の回復 rx_attack_4 = -y_trunc_4 elif gamemode == 2 and rx_gift in (1,2): # PBSの回復 rx_attack_4 = -80 elif x_critical_4 == 0 and x_yakedo == 0: if rx_gift in (3,4,5,6): rx_attack_4 = x_g40 * random.randint(217,255) // 255 elif rx_gift in (7,8,9): rx_attack_4 = x_g80 * random.randint(217,255) // 255 elif rx_gift == 10: rx_attack_4 = x_g120 * random.randint(217,255) // 255 elif x_critical_4 == 1 and x_yakedo == 0: if rx_gift in (3,4,5,6): rx_attack_4 = x_cg40 * random.randint(217,255) // 255 elif rx_gift in (7,8,9): rx_attack_4 = x_cg80 * random.randint(217,255) // 255 elif rx_gift == 10: rx_attack_4 = x_cg120 * random.randint(217,255) // 255 elif x_critical_4 == 0 and x_yakedo == 1: if rx_gift in (3,4,5,6): rx_attack_4 = bx_g40 * random.randint(217,255) // 255 elif rx_gift in (7,8,9): rx_attack_4 = bx_g80 * random.randint(217,255) // 255 elif rx_gift == 10: rx_attack_4 = bx_g120 * random.randint(217,255) // 255 elif x_critical_4 == 1 and x_yakedo == 1: if rx_gift in (3,4,5,6): rx_attack_4 = bx_cg40 * random.randint(217,255) // 255 elif rx_gift in (7,8,9): rx_attack_4 = bx_cg80 * random.randint(217,255) // 255 elif rx_gift == 10: rx_attack_4 = bx_cg120 * random.randint(217,255) // 255 if y_hp_4 > y_max_hp: # 最大HPを超えない y_hp_4 = y_max_hp elif x_sub_4 == 27: # 1/2回復 rx_attack_4 = 0 x_hp_4 += x_trunc_2 if x_hp_4 > x_max_hp: # 最大HPを超えない x_hp_4 = x_max_hp elif x_sub_4 == 28: # 眠る rx_attack_4 = 0 if x_hp_4 < x_max_hp: # 最大HP未満なら回復 x_hp_4 = x_max_hp x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku = 3, 0, 0, 0, 0 # 2ターン眠り elif x_sub_4 == 30: # カウンターorミラーコート rx_attack_4 = 0 # 先制で失敗 elif x_sub_4 in (33,34,35): # 2-5連続攻撃 rx_attack_4 = 0 # ダメージの初期化 if x_sub_4 == 33: rx_renzoku = random.randint(1,8) if rx_renzoku in (1,2,3): x_renzoku = 2 elif rx_renzoku in (4,5,6): x_renzoku = 3 elif rx_renzoku == 7: x_renzoku = 4 elif rx_renzoku == 8: x_renzoku = 5 elif x_sub_4 in (34,35): # 2連続攻撃 x_renzoku = 2 if x_sub_4 == 35 and random.randint(1,256) <= 51 and not any([y_koori, y_nemuri, y_mahi, y_yakedo, y_moudoku]): y_doku = 1 # ダブルニードル for _ in range(x_renzoku): # ダメージ累計 x_critical_4 = 0 # 急所の初期化 if x_critical_hit_4 >= random.randint(1,256): # 急所の抽選 x_critical_4 = 1 if x_critical_4 == 0 and x_yakedo == 0: x_renzoku_damage = x_damage_4 * random.randint(217,255) // 255 elif x_critical_4 == 1 and x_yakedo == 0: x_renzoku_damage = x_critical_damage_4 * random.randint(217,255) // 255 elif x_critical_4 == 0 and x_yakedo == 1: x_renzoku_damage = bx_damage_4 * random.randint(217,255) // 255 elif x_critical_4 == 1 and x_yakedo == 1: x_renzoku_damage = bx_critical_damage_4 * random.randint(217,255) // 255 rx_attack_4 += x_renzoku_damage elif x_sub_4 == 36: # トリプルキック times = 2 # ダメージ倍率 x_renzoku = 0 if x_accuracy_4 >= random.randint(1,256): # 2回目の抽選 x_renzoku = 1 if gamemode == 2: # 後攻への乗算バグ(PBS) y_triple_pbs_4 = 2 if x_accuracy_4 >= random.randint(1,256): # 3回目の抽選 x_renzoku = 2 if gamemode == 2: y_triple_pbs_4 = 3 for _ in range(x_renzoku): # ダメージ累計 x_critical_4 = 0 # 急所の初期化 if x_critical_hit_4 >= random.randint(1,256): x_critical_4 = 1 if x_critical_4 == 0 and x_yakedo == 0: x_triple_kick = x_damage_4 * times * random.randint(217,255) // 255 elif x_critical_4 == 1 and x_yakedo == 0: x_triple_kick = x_critical_damage_4 * times * random.randint(217,255) // 255 elif x_critical_4 == 0 and x_yakedo == 1: x_triple_kick = bx_damage_4 * times * random.randint(217,255) // 255 elif x_critical_4 == 1 and x_yakedo == 1: x_triple_kick = bx_critical_damage_4 * times * random.randint(217,255) // 255 times += 1 rx_attack_4 += x_triple_kick elif x_sub_4 == 37 and x_level > 0: # サイコウェーブ rx_attack_4 = random.randint(1,rx_psycho_wave) elif x_sub_4 == 38: # 未来予知 rx_attack_4 = 0 elif x_sub_4 == 39: # じたばた if 1 <= x_hp <= x_flail_2: # 威力の決定 rx_attack_4 = x_f200 if x_yakedo == 0 else bx_f200 elif x_flail_2 + 1 <= x_hp <= x_flail_5: rx_attack_4 = x_f150 if x_yakedo == 0 else bx_f150 elif x_flail_5 + 1 <= x_hp <= x_flail_10: rx_attack_4 = x_f100 if x_yakedo == 0 else bx_f100 elif x_flail_10 + 1 <= x_hp <= x_flail_17: rx_attack_4 = x_f80 if x_yakedo == 0 else bx_f80 elif gamemode != 2 and x_flail_17 + 1 <= x_hp <= x_flail_33: rx_attack_4 = x_f40 if x_yakedo == 0 else bx_f40 elif gamemode == 2 and x_flail_17 + 1 <= x_hp <= x_flail_pbs: # PBS(40) rx_attack_4 = x_f40 if x_yakedo == 0 else bx_f40 elif gamemode != 2 and x_flail_33 + 1 <= x_hp <= x_max_hp: rx_attack_4 = x_f20 if x_yakedo == 0 else bx_f20 elif gamemode == 2 and x_flail_pbs + 1 <= x_hp <= x_max_hp: # PBS(20) rx_attack_4 = x_f20 if x_yakedo == 0 else bx_f20 elif x_sub_4 in (40,41): if x_sub_4 == 40: # 転がる if x_sub_3 == 40 and x_bit_3 == 1 and (x_korogaru <= 4): # 最大16倍, 丸くなる32倍 x_korogaru += 1 else: # 倍率リセット x_korogaru = 1 times = 2 ** (x_korogaru + x_marukunaru - 1) elif x_sub_4 == 41: # 連続斬り if x_sub_3 == 41 and x_bit_3 == 1 and (x_renzokugiri <= 4 or gamemode == 2): # 最大16倍, 無制限(PBS) x_renzokugiri += 1 else: # 倍率リセット x_renzokugiri = 1 times = 2 ** (x_renzokugiri - 1) if x_critical_4 == 0 and x_yakedo == 0: rx_attack_4 = x_damage_4 * times * random.randint(217,255) // 255 elif x_critical_4 == 1 and x_yakedo == 0: rx_attack_4 = x_critical_damage_4 * times * random.randint(217,255) // 255 elif x_critical_4 == 0 and x_yakedo == 1: rx_attack_4 = bx_damage_4 * times * random.randint(217,255) // 255 elif x_critical_4 == 1 and x_yakedo == 1: rx_attack_4 = bx_critical_damage_4 * times * random.randint(217,255) // 255 elif x_sub_4 == 42: # 痛み分け pain_split = (x_hp_4 + y_hp_4) // 2 x_hp_4 = y_hp_4 = pain_split if x_hp_4 > x_max_hp: # 最大HPを超えない x_hp_4 = x_max_hp if y_hp_4 > y_max_hp: y_hp_4 = y_max_hp elif x_sub_4 in (50,51): # 守る・堪える, 後攻で処理 rx_attack_4 = 0 # 素早さダウンを省略 elif x_sub_4 == 61 and random.randint(1,256) <= x_per_4: # 命中率ダウン x_accuracy_ph += 1 if x_accuracy_ph == 1: y_accuracy_4 = y_accuracy_4_ph1 y1_accuracy, y2_accuracy, y3_accuracy = y1_accuracy_ph1, y2_accuracy_ph1, y3_accuracy_ph1 elif x_accuracy_ph == 2: y_accuracy_4 = y_accuracy_4_ph2 y1_accuracy, y2_accuracy, y3_accuracy = y1_accuracy_ph2, y2_accuracy_ph2, y3_accuracy_ph2 elif x_accuracy_ph == 3: y_accuracy_4 = y_accuracy_4_ph3 y1_accuracy, y2_accuracy, y3_accuracy = y1_accuracy_ph3, y2_accuracy_ph3, y3_accuracy_ph3 elif x_accuracy_ph == 4: y_accuracy_4 = y_accuracy_4_ph4 y1_accuracy, y2_accuracy, y3_accuracy = y1_accuracy_ph4, y2_accuracy_ph4, y3_accuracy_ph4 elif x_sub_4 in (62,63): # 防御or特防ダウン if x_sub_4 == 62 and random.randint(1,256) <= x_per_4: x_bd_ph += 1 elif x_sub_4 == 63: # 防御or特防-2 x_bd_ph += 2 if x_bd_ph == 1: y_konran_damage, by_konran_damage = y_konran_damage_ph1, by_konran_damage_ph1 elif x_bd_ph == 2: y_konran_damage, by_konran_damage = y_konran_damage_ph2, by_konran_damage_ph2 elif x_bd_ph == 3: y_konran_damage, by_konran_damage = y_konran_damage_ph3, by_konran_damage_ph3 elif x_bd_ph == 4: y_konran_damage, by_konran_damage = y_konran_damage_ph4, by_konran_damage_ph4 elif x_bd_ph == 5: y_konran_damage, by_konran_damage = y_konran_damage_ph5, by_konran_damage_ph5 elif x_bd_ph == 6: y_konran_damage, by_konran_damage = y_konran_damage_ph6, by_konran_damage_ph6 if x_bit_4 == 1: # ダメージの判定 y_hp_4 -= rx_attack_4 if x_sub_4 == 20: # 攻撃の反動ダメージ x_hp_4 -= rx_attack_4 // 4 elif x_sub_4 == 21: # HPドレイン x_hp_4 += rx_attack_4 // 2 if x_hp_4 > x_max_hp: # 最大HPを超えない x_hp_4 = x_max_hp if x_ouja_4 == 1 and random.randint(1,256) <= 30: # 先攻のみ王者の抽選 y_hirumi = 1 if y_hachimaki == 1 and y_hp_4 <= 0 and random.randint(1,256) <= 30: # 鉢巻の抽選 y_hp_4 = 1 if y_hp_4 <= 0: # 相手の瀕死判定 x_count_4 += 1 continue elif x_hp_4 <= 0: # 自分の瀕死判定 y_count_4 += 1 continue elif x_sub_4 == 25 and x_bit_4 == 0: # 飛び蹴りの自傷 if gamemode != 2: # GB/N64 x_hp_4 -= rx_attack_4 // 8 elif gamemode == 2: # PBS x_hp_4 -= rx_attack_4 // 4 if x_hp_4 <= 0: # 自分の瀕死判定 y_count_4 += 1 continue if x_hirumi == 1: # 怯みの解除 x_hirumi = 0 # 追加効果の抽選 if x_bit_4 == 1 and 0 < x_sub_4 <= 13: if x_sub_4 == 1: if random.randint(1,256) <= x_per_4: # 怯みの付与 y_hirumi = 1 elif x_sub_4 == 2: # 凍りの付与 if random.randint(1,256) <= x_per_4 and not any([y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku]): y_koori = 1 if y_yaketa == y_stock == 1: # 焼けた木の実 y_koori, y_stock = 0, 0 elif x_sub_4 == 3: # 眠りの付与 if not any([y_koori, y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku]): if gamemode == 0: # GB y_nemuri = random.randint(2,7) elif gamemode == 1: # N64 y_nemuri = random.randint(2,4) elif gamemode == 2: # PBS y_nemuri = random.randint(2,5) if y_hakka == y_stock == 1: # 薄荷の実 y_nemuri, y_stock = 0, 0 elif x_sub_4 == 4: # 混乱の付与 if random.randint(1,256) <= x_per_4 and y_konran == 0: y_konran = random.randint(2,5) if y_nigai == y_stock == 1: # 苦い木の実 y_konran, y_stock = 0, 0 elif x_sub_4 == 5: # メロメロの付与 y_meromero = 1 elif x_sub_4 == 6: # 麻痺の付与 if random.randint(1,256) <= x_per_4 and not any([y_koori, y_nemuri, y_doku, y_yakedo, y_moudoku]): y_mahi = 1 if y_mahinaoshi == y_stock == 1: # 麻痺治しの実 y_mahi, y_stock = 0, 0 elif x_sub_4 == 7: # 毒の付与 if random.randint(1,256) <= x_per_4 and not any([y_koori, y_nemuri, y_mahi, y_yakedo, y_moudoku]): y_doku = 1 if y_dokukeshi == y_stock == 1: # 毒消しの実 y_doku, y_stock = 0, 0 elif x_sub_4 == 8: # 火傷の付与 if random.randint(1,256) <= x_per_4 and not any([y_koori, y_nemuri, y_mahi, y_doku, y_moudoku]): y_yakedo = 1 if y_kootta == y_stock == 1: # 凍った木の実 y_yakedo, y_stock = 0, 0 elif x_sub_4 == 9: # 猛毒の付与 if not any([y_koori, y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku]): y_moudoku = 1 if y_dokukeshi == y_stock == 1: # 毒消しの実 y_moudoku, y_stock = 0, 0 elif x_sub_4 == 10: # 宿り木の付与 y_yadorigi = 1 elif x_sub_4 == 11 and (y_nemuri > 0): # 悪夢の付与 y_akumu = 1 elif x_sub_4 == 12: # 呪いの付与 y_noroi = 1 x_hp_4 -= x_trunc_2 if x_hp_4 <= 0: # 自分の瀕死判定 y_count_4 += 1 continue elif x_sub_4 == 13 and random.randint(1,256) <= 51: # トライアタックの付与(凍り・麻痺・火傷) rx_tri_attack = random.randint(1,3) if rx_tri_attack == 1: # 凍りの付与 if not any([y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku]): y_koori = 1 if y_yaketa == y_stock == 1: # 焼けた木の実 y_koori, y_stock = 0, 0 elif rx_tri_attack == 2: # 麻痺の付与 if not any([y_koori, y_nemuri, y_doku, y_yakedo, y_moudoku]): y_mahi = 1 if y_mahinaoshi == y_stock == 1: # 麻痺治しの実 y_mahi, y_stock = 0, 0 elif rx_tri_attack == 3: # 火傷の付与 if not any([y_koori, y_nemuri, y_mahi, y_doku, y_moudoku]): y_yakedo = 1 if y_kootta == y_stock == 1: # 凍った木の実 y_yakedo, y_stock = 0, 0 elif y_koori == 1: # 相手が凍りなら火傷で解除 y_koori = 0 if y_kiseki == y_stock == 1 and any([y_koori, y_nemuri, y_konran, y_mahi, y_doku, y_yakedo, y_moudoku]): # 奇跡の実 y_koori, y_nemuri, y_konran, y_mahi, y_doku, y_yakedo, y_moudoku, y_stock = 0, 0, 0, 0, 0, 0, 0, 0 # 自分のターン終了時(4A) if x_doku == 1: # 毒 x_hp_4 -= x_trunc_8 elif x_yakedo == 1: # 火傷 x_hp_4 -= x_trunc_8 elif x_moudoku > 0: # 猛毒 x_hp_4 -= x_trunc_16 * x_moudoku x_moudoku += 1 if x_yadorigi == 1: # 宿り木の種 x_hp_4 -= x_trunc_8 y_hp_4 += x_trunc_8 if y_hp_4 > y_max_hp: y_hp_4 = y_max_hp if x_akumu == 1 and x_nemuri > 0: # 悪夢 x_hp_4 -= x_trunc_4 if x_noroi == 1: # 呪い x_hp_4 -= x_trunc_4 if x_hp_4 <= 0: # 自分の瀕死判定 y_count_4 += 1 continue # 後攻 / プレイヤー2 if y_critical_hit_4 >= random.randint(1,256): # 急所の抽選 y_critical_4 = 1 if y_accuracy_4 < random.randint(1,256): # 命中率の抽選 y_bit_4 = 0 if y_hirumi == 1 and gamemode == 2: # 怯み時の判定(PBS) y_bit_4 = 2 if y_koori == 1: # 凍り時の判定: y_bit_4 = 2 elif y_nemuri > 0 and y_bit_4 != 2: # 眠り時の判定 y_nemuri -= 1 if y_nemuri > 0: y_bit_4 = 2 if y_sub_4 == 29: # 寝言の判定 y_bit_4 = 3 elif y_nemuri == 0: # 起きたら悪夢を解除 y_akumu = 0 if y_hirumi == 1 and gamemode != 2: # 怯み時の判定(GB/N64) y_bit_4 = 2 if y_meromero == 1 and y_bit_4 != 2 and random.randint(1,2) == 1: # メロメロ時の判定 y_bit_4 = 2 if y_mahi == 1 and y_bit_4 != 2 and random.randint(1,4) == 1: # 麻痺時の判定 y_bit_4 = 2 if y_konran > 0 and y_bit_4 != 2: # 混乱時の判定 y_konran -= 1 if random.randint(1,2) == 1 and y_konran > 0: if gamemode != 2 and y_yakedo == 0: # GB/N64は最大値 y_hp_4 -= y_konran_damage elif gamemode != 2 and y_yakedo == 1: y_hp_4 -= by_konran_damage elif gamemode == 2 and y_yakedo == 0: y_hp_4 -= y_konran_damage * random.randint(217,255) // 255 elif gamemode == 2 and y_yakedo == 1: y_hp_4 -= by_konran_damage * random.randint(217,255) // 255 y_bit_4 = 2 if y_hp_4 <= 0: # 自傷の瀕死判定 x_count_4 += 1 continue if y_sub_4 == 29 and y_bit_4 == 3: # 寝言の抽選 y_bit_4 = 1 if y_negoto_way == 2: ry_negoto = random.randint(1,2) elif y_negoto_way == 3: ry_negoto = random.randint(1,3) if ry_negoto == 1: y_damage_4, y_critical_damage_4, y_accuracy_4, y_critical_hit_4 = y1_damage, y1_critical_damage, y1_accuracy, y1_critical_hit y_sub_4, y_per_4 = y1_sub, y1_per elif ry_negoto == 2: y_damage_4, y_critical_damage_4, y_accuracy_4, y_critical_hit_4 = y2_damage, y2_critical_damage, y2_accuracy, y2_critical_hit y_sub_4, y_per_4 = y2_sub, y2_per elif ry_negoto == 3: y_damage_4, y_critical_damage_4, y_accuracy_4, y_critical_hit_4 = y3_damage, y3_critical_damage, y3_accuracy, y3_critical_hit y_sub_4, y_per_4 = y3_sub, y3_per if y_critical_hit_4 >= random.randint(1,256): # 急所の抽選 y_critical_4 = 1 if y_accuracy_4 < random.randint(1,256): # 命中率の抽選 y_bit_4 = 0 if x_sub_4 in (50,51): # 先攻の守る・堪える if not x_sub_3 in (50,51): x_protect = 1 rx_protect = (1/2 ** (x_protect - 1) * 256 - 1/256) // 1 if x_bit_4 != 2 and (rx_protect >= random.randint(1,256) or (gamemode == 2 and x_protect == 1)): # 1ターン目は必ず成功(PBS) x_protect += 1 if x_sub_4 == 50 and not y_sub_4 in (11,12,27,28,38): # 守る # 悪夢・呪い・回復・未来予知は有効 y_bit_4 = 0 else: x_protect = 1 if y_bit_4 == 1 or y_sub_4 == 25: # 攻撃の判定 if y_critical_4 == 0 and y_yakedo == 0: ry_attack_4 = y_damage_4 * y_triple_pbs_4 * random.randint(217,255) // 255 elif y_critical_4 == 1 and y_yakedo == 0: ry_attack_4 = y_critical_damage_4 * y_triple_pbs_4 * random.randint(217,255) // 255 elif y_critical_4 == 0 and y_yakedo == 1: ry_attack_4 = by_damage_4 * y_triple_pbs_4 * random.randint(217,255) // 255 elif y_critical_4 == 1 and y_yakedo == 1: ry_attack_4 = by_critical_damage_4 * y_triple_pbs_4 * random.randint(217,255) // 255 if y_sub_4 >= 22 and y_bit_4 == 1: # 技の効果 if y_sub_4 == 22: # 怒りの前歯 ry_attack_4 = x_hp_4 // 2 elif y_sub_4 == 23: # 固定ダメージ ry_attack_4 = y_damage_4 elif y_sub_4 == 24: # プレゼント ry_gift = random.randint(1,10) if gamemode != 2 and ry_gift in (1,2): # GB/N64の回復 ry_attack_4 = -x_trunc_4 elif gamemode == 2 and ry_gift in (1,2): # PBSの回復 ry_attack_4 = -80 elif y_critical_4 == 0 and y_yakedo == 0: if ry_gift in (3,4,5,6): ry_attack_4 = y_g40 * y_triple_pbs_4 * random.randint(217,255) // 255 elif ry_gift in (7,8,9): ry_attack_4 = y_g80 * y_triple_pbs_4 * random.randint(217,255) // 255 elif ry_gift == 10: ry_attack_4 = y_g120 * y_triple_pbs_4 * random.randint(217,255) // 255 elif y_critical_4 == 1 and y_yakedo == 0: if ry_gift in (3,4,5,6): ry_attack_4 = y_cg40 * y_triple_pbs_4 * random.randint(217,255) // 255 elif ry_gift in (7,8,9): ry_attack_4 = y_cg80 * y_triple_pbs_4 * random.randint(217,255) // 255 elif ry_gift == 10: ry_attack_4 = y_cg120 * y_triple_pbs_4 * random.randint(217,255) // 255 elif y_critical_4 == 0 and y_yakedo == 1: if ry_gift in (3,4,5,6): ry_attack_4 = by_g40 * y_triple_pbs_4 * random.randint(217,255) // 255 elif ry_gift in (7,8,9): ry_attack_4 = by_g80 * y_triple_pbs_4 * random.randint(217,255) // 255 elif ry_gift == 10: ry_attack_4 = by_g120 * y_triple_pbs_4 * random.randint(217,255) // 255 elif y_critical_4 == 1 and y_yakedo == 1: if ry_gift in (3,4,5,6): ry_attack_4 = by_cg40 * y_triple_pbs_4 * random.randint(217,255) // 255 elif ry_gift in (7,8,9): ry_attack_4 = by_cg80 * y_triple_pbs_4 * random.randint(217,255) // 255 elif ry_gift == 10: ry_attack_4 = by_cg120 * y_triple_pbs_4 * random.randint(217,255) // 255 if x_hp_4 > x_max_hp: # 最大HPを超えない x_hp_4 = x_max_hp elif y_sub_4 == 27: # 1/2回復 ry_attack_4 = 0 y_hp_4 += y_trunc_2 if y_hp_4 > y_max_hp: # 最大HPを超えない y_hp_4 = y_max_hp elif y_sub_4 == 28: # 眠る ry_attack_4 = 0 if y_hp_4 < y_max_hp: # 最大HP未満なら回復 y_hp_4 = y_max_hp y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku = 3, 0, 0, 0, 0 # 2ターン眠り elif y_sub_4 == 30: # カウンターorミラーコート ry_attack_4 = rx_attack_4 * 2 if 999 <= x_damage_4 and x_bit_4 == 0 and gamemode == 0: # 一撃外れをカウンター(GB) ry_attack_4 = x_max_hp elif y_sub_4 in (33,34,35): # 2-5連続攻撃 ry_attack_4 = 0 # ダメージの初期化 if y_sub_4 == 33: ry_renzoku = random.randint(1,8) if ry_renzoku in (1,2,3): y_renzoku = 2 elif ry_renzoku in (4,5,6): y_renzoku = 3 elif ry_renzoku == 7: y_renzoku = 4 elif ry_renzoku == 8: y_renzoku = 5 elif y_sub_4 in (34,35): # 2連続攻撃 y_renzoku = 2 if y_sub_4 == 35 and random.randint(1,256) <= 51 and not any([x_koori, x_nemuri, x_mahi, x_yakedo, x_moudoku]): x_doku = 1 # ダブルニードル for _ in range(y_renzoku): # ダメージ累計 y_critical_4 = 0 # 急所の初期化 if y_critical_hit_4 >= random.randint(1,256): # 急所の抽選 y_critical_4 = 1 if y_critical_4 == 0 and y_yakedo == 0: y_renzoku_damage = y_damage_4 * y_triple_pbs_4 * random.randint(217,255) // 255 elif y_critical_4 == 1 and y_yakedo == 0: y_renzoku_damage = y_critical_damage_4 * y_triple_pbs_4 * random.randint(217,255) // 255 elif y_critical_4 == 0 and y_yakedo == 1: y_renzoku_damage = by_damage_4 * y_triple_pbs_4 * random.randint(217,255) // 255 elif y_critical_4 == 1 and y_yakedo == 1: y_renzoku_damage = by_critical_damage_4 * y_triple_pbs_4 * random.randint(217,255) // 255 ry_attack_4 += y_renzoku_damage elif y_sub_4 == 36: # トリプルキック times = 2 # ダメージ倍率 y_renzoku = 0 if y_accuracy_4 >= random.randint(1,256): # 2回目の抽選 y_renzoku = 1 if y_accuracy_4 >= random.randint(1,256): # 3回目の抽選 y_renzoku = 2 for _ in range(y_renzoku): # ダメージ累計 y_critical_4 = 0 # 急所の初期化 if y_critical_hit_4 >= random.randint(1,256): y_critical_4 = 1 if y_critical_4 == 0 and y_yakedo == 0: y_triple_kick = y_damage_4 * times * random.randint(217,255) // 255 elif y_critical_4 == 1 and y_yakedo == 0: y_triple_kick = y_critical_damage_4 * times * random.randint(217,255) // 255 elif y_critical_4 == 0 and y_yakedo == 1: y_triple_kick = by_damage_4 * times * random.randint(217,255) // 255 elif y_critical_4 == 1 and y_yakedo == 1: y_triple_kick = by_critical_damage_4 * times * random.randint(217,255) // 255 times += 1 ry_attack_4 += y_triple_kick elif y_sub_4 == 37 and y_level > 0: # サイコウェーブ ry_attack_4 = random.randint(1,ry_psycho_wave) elif y_sub_4 == 38: # 未来予知 ry_attack_4 = 0 elif y_sub_4 == 39: # じたばた if 1 <= y_hp <= y_flail_2: # 威力の決定 ry_attack_4 = y_f200 if y_yakedo == 0 else by_f200 elif y_flail_2 + 1 <= y_hp <= y_flail_5: ry_attack_4 = y_f150 if y_yakedo == 0 else by_f150 elif y_flail_5 + 1 <= y_hp <= y_flail_10: ry_attack_4 = y_f100 if y_yakedo == 0 else by_f100 elif y_flail_10 + 1 <= y_hp <= y_flail_17: ry_attack_4 = y_f80 if y_yakedo == 0 else by_f80 elif gamemode != 2 and y_flail_17 + 1 <= y_hp <= y_flail_33: ry_attack_4 = y_f40 if y_yakedo == 0 else by_f40 elif gamemode == 2 and y_flail_17 + 1 <= y_hp <= y_flail_pbs: # PBS(40) ry_attack_4 = y_f40 if y_yakedo == 0 else by_f40 elif gamemode != 2 and y_flail_33 + 1 <= y_hp <= y_max_hp: ry_attack_4 = y_f20 if y_yakedo == 0 else by_f20 elif gamemode == 2 and y_flail_pbs + 1 <= y_hp <= y_max_hp: # PBS(20) ry_attack_4 = y_f20 if y_yakedo == 0 else by_f20 if gamemode == 2: # 最高乱数+1ダメージ(PBS) ry_attack_4 = ry_attack_4 * y_triple_pbs_4 + 1 elif y_sub_4 in (40,41): if y_sub_4 == 40: # 転がる if y_sub_3 == 40 and y_bit_3 == 1 and (x_korogaru <= 4): # 最大16倍, 丸くなる32倍 y_korogaru += 1 else: # 倍率リセット y_korogaru = 1 times = 2 ** (y_korogaru + y_marukunaru - 1) elif y_sub_4 == 41: # 連続斬り if y_sub_3 == 41 and y_bit_3 == 1 and (x_renzokugiri <= 4 or gamemode == 2): # 最大16倍, 無制限(PBS) y_renzokugiri += 1 else: # 倍率リセット y_renzokugiri = 1 times = 2 ** (y_renzokugiri - 1) if y_critical_4 == 0 and y_yakedo == 0: ry_attack_4 = y_damage_4 * times * random.randint(217,255) // 255 elif y_critical_4 == 1 and y_yakedo == 0: ry_attack_4 = y_critical_damage_4 * times * random.randint(217,255) // 255 elif y_critical_4 == 0 and y_yakedo == 1: ry_attack_4 = by_damage_4 * times * random.randint(217,255) // 255 elif y_critical_4 == 1 and y_yakedo == 1: ry_attack_4 = by_critical_damage_4 * times * random.randint(217,255) // 255 elif y_sub_4 == 42: # 痛み分け pain_split = (y_hp_4 + x_hp_4) // 2 y_hp_4 = x_hp_4 = pain_split if y_hp_4 > y_max_hp: # 最大HPを超えない y_hp_4 = y_max_hp if x_hp_4 > x_max_hp: x_hp_4 = x_max_hp elif y_sub_4 in (50,51): # 守る・堪える, 後攻は失敗 ry_attack_4, y_protect = 0, 1 # 素早さダウン・命中率ダウン・防御or特防ダウンを省略 if y_bit_4 == 1: # ダメージの判定 x_hp_4 -= ry_attack_4 if y_sub_4 == 20: # 攻撃の反動ダメージ y_hp_4 -= ry_attack_4 // 4 elif y_sub_4 == 21: # HPドレイン y_hp_4 += ry_attack_4 // 2 if y_hp_4 > y_max_hp: # 最大HPを超えない y_hp_4 = y_max_hp if x_sub_4 == 51 and x_hp_4 <= 0 and x_protect > 1 and x_bit_4 == 1: # 堪える x_hp_4 = 1 if x_hachimaki == 1 and x_hp_4 <= 0 and random.randint(1,256) <= 30: # 鉢巻の抽選 x_hp_4 = 1 if x_hp_4 <= 0: # 相手の瀕死判定 y_count_4 += 1 continue elif y_hp_4 <= 0: # 自分の瀕死判定 x_count_4 += 1 continue elif y_sub_4 == 25 and y_bit_4 == 0: # 飛び蹴りの自傷 if gamemode != 2: # GB/N64 y_hp_4 -= ry_attack_4 // 8 elif gamemode == 2: # PBS y_hp_4 -= ry_attack_4 // 4 if y_hp_4 <= 0: # 自分の瀕死判定 x_count_4 += 1 continue if y_hirumi == 1: # 怯みの解除 y_hirumi = 0 # 追加効果の抽選 # 呪い以外を省略 if y_sub_4 == 12 and y_bit_4 == 1: # 呪いの付与 x_noroi = 1 y_hp_4 -= y_trunc_2 if y_hp_4 <= 0: # 自分の瀕死判定 x_count_4 += 1 continue # 自分のターン終了時(4A) if y_doku == 1: # 毒 y_hp_4 -= y_trunc_8 elif y_yakedo == 1: # 火傷 y_hp_4 -= y_trunc_8 elif y_moudoku > 0: # 猛毒 y_hp_4 -= y_trunc_16 * y_moudoku y_moudoku += 1 if y_yadorigi == 1: # 宿り木の種 y_hp_4 -= y_trunc_8 x_hp_4 += y_trunc_8 if x_hp_4 > x_max_hp: x_hp_4 = x_max_hp if y_akumu == 1 and y_nemuri > 0: # 悪夢 y_hp_4 -= y_trunc_4 if y_noroi == 1: # 呪い y_hp_4 -= y_trunc_4 if y_hp_4 <= 0: # 自分の瀕死判定 x_count_4 += 1 continue # 全体のターン終了時(4A) if y_sub_2 == 38 and y_bit_2 == 1: # 未来予知の判定 x_hp_4 -= y_damage_2 * random.randint(217,255) // 255 if x_hp_4 <= 0: # 行動順で瀕死の判定 y_count_4 += 1 continue if x_sub_2 == 38 and x_bit_2 == 1: y_hp_4 -= x_damage_2 * random.randint(217,255) // 255 if y_hp_4 <= 0: x_count_4 += 1 continue if suna_4 == 1: # 砂嵐の判定 if x_suna == 1: # 行動順で瀕死の判定 x_hp_4 -= x_trunc_8 if x_hp_4 <= 0: y_count_4 += 1 continue if y_suna == 1: y_hp_4 -= y_trunc_8 if y_hp_4 <= 0: x_count_4 += 1 continue # 食べ残し以降を省略 # プレイヤー2の先制 else: # 先攻 / プレイヤー2 if y_critical_hit_4 >= random.randint(1,256): # 急所の抽選 y_critical_4 = 1 if y_accuracy_4 < random.randint(1,256): # 命中率の抽選 y_bit_4 = 0 if y_koori == 1: # 凍り時の判定: y_bit_4 = 2 elif y_nemuri > 0: # 眠り時の判定 y_nemuri -= 1 if y_nemuri > 0: y_bit_4 = 2 if y_sub_4 == 29: # 寝言の判定 y_bit_4 = 3 elif y_nemuri == 0: # 起きたら悪夢を解除 y_akumu = 0 if y_meromero == 1 and y_bit_4 != 2 and random.randint(1,2) == 1: # メロメロ時の判定 y_bit_4 = 2 if y_mahi == 1 and y_bit_4 != 2 and random.randint(1,4) == 1: # 麻痺時の判定 y_bit_4 = 2 if y_konran > 0 and y_bit_4 != 2: # 混乱時の判定 y_konran -= 1 if random.randint(1,2) == 1 and y_konran > 0: if gamemode != 2 and y_yakedo == 0: # GB/N64は最大値 y_hp_4 -= y_konran_damage elif gamemode != 2 and y_yakedo == 1: y_hp_4 -= by_konran_damage elif gamemode == 2 and y_yakedo == 0: y_hp_4 -= y_konran_damage * random.randint(217,255) // 255 elif gamemode == 2 and y_yakedo == 1: y_hp_4 -= by_konran_damage * random.randint(217,255) // 255 y_bit_4 = 2 if y_hp_4 <= 0: # 自傷の瀕死判定 x_count_4 += 1 continue if y_sub_4 == 29 and y_bit_4 == 3: # 寝言の抽選 y_bit_4 = 1 if y_negoto_way == 2: ry_negoto = random.randint(1,2) elif y_negoto_way == 3: ry_negoto = random.randint(1,3) if ry_negoto == 1: y_damage_4, y_critical_damage_4, y_accuracy_4, y_critical_hit_4 = y1_damage, y1_critical_damage, y1_accuracy, y1_critical_hit y_sub_4, y_per_4 = y1_sub, y1_per elif ry_negoto == 2: y_damage_4, y_critical_damage_4, y_accuracy_4, y_critical_hit_4 = y2_damage, y2_critical_damage, y2_accuracy, y2_critical_hit y_sub_4, y_per_4 = y2_sub, y2_per elif ry_negoto == 3: y_damage_4, y_critical_damage_4, y_accuracy_4, y_critical_hit_4 = y3_damage, y3_critical_damage, y3_accuracy, y3_critical_hit y_sub_4, y_per_4 = y3_sub, y3_per if y_critical_hit_4 >= random.randint(1,256): # 急所の抽選 y_critical_4 = 1 if y_accuracy_4 < random.randint(1,256): # 命中率の抽選 y_bit_4 = 0 if y_bit_4 == 1 or y_sub_4 == 25: # 攻撃の判定 if y_critical_4 == 0 and y_yakedo == 0: ry_attack_4 = y_damage_4 * random.randint(217,255) // 255 elif y_critical_4 == 1 and y_yakedo == 0: ry_attack_4 = y_critical_damage_4 * random.randint(217,255) // 255 elif y_critical_4 == 0 and y_yakedo == 1: ry_attack_4 = by_damage_4 * random.randint(217,255) // 255 elif y_critical_4 == 1 and y_yakedo == 1: ry_attack_4 = by_critical_damage_4 * random.randint(217,255) // 255 if y_sub_4 >= 22 and y_bit_4 == 1: # 技の効果 if y_sub_4 == 22: # 怒りの前歯 ry_attack_4 = x_hp_4 // 2 elif y_sub_4 == 23: # 固定ダメージ ry_attack_4 = y_damage_4 elif y_sub_4 == 24: # プレゼント ry_gift = random.randint(1,10) if gamemode != 2 and ry_gift in (1,2): # GB/N64の回復 ry_attack_4 = -x_trunc_4 elif gamemode == 2 and ry_gift in (1,2): # PBSの回復 ry_attack_4 = -80 elif y_critical_4 == 0 and y_yakedo == 0: if ry_gift in (3,4,5,6): ry_attack_4 = y_g40 * random.randint(217,255) // 255 elif ry_gift in (7,8,9): ry_attack_4 = y_g80 * random.randint(217,255) // 255 elif ry_gift == 10: ry_attack_4 = y_g120 * random.randint(217,255) // 255 elif y_critical_4 == 1 and y_yakedo == 0: if ry_gift in (3,4,5,6): ry_attack_4 = y_cg40 * random.randint(217,255) // 255 elif ry_gift in (7,8,9): ry_attack_4 = y_cg80 * random.randint(217,255) // 255 elif ry_gift == 10: ry_attack_4 = y_cg120 * random.randint(217,255) // 255 elif y_critical_4 == 0 and y_yakedo == 1: if ry_gift in (3,4,5,6): ry_attack_4 = by_g40 * random.randint(217,255) // 255 elif ry_gift in (7,8,9): ry_attack_4 = by_g80 * random.randint(217,255) // 255 elif ry_gift == 10: ry_attack_4 = by_g120 * random.randint(217,255) // 255 elif y_critical_4 == 1 and y_yakedo == 1: if ry_gift in (3,4,5,6): ry_attack_4 = by_cg40 * random.randint(217,255) // 255 elif ry_gift in (7,8,9): ry_attack_4 = by_cg80 * random.randint(217,255) // 255 elif ry_gift == 10: ry_attack_4 = by_cg120 * random.randint(217,255) // 255 if x_hp_4 > x_max_hp: # 最大HPを超えない x_hp_4 = x_max_hp elif y_sub_4 == 27: # 1/2回復 ry_attack_4 = 0 y_hp_4 += y_trunc_2 if y_hp_4 > y_max_hp: # 最大HPを超えない y_hp_4 = y_max_hp elif y_sub_4 == 28: # 眠る ry_attack_4 = 0 if y_hp_4 < y_max_hp: # 最大HP未満なら回復 y_hp_4 = y_max_hp y_nemuri, y_mahi, y_doku, y_yakedo, y_moudoku = 3, 0, 0, 0, 0 # 2ターン眠り elif y_sub_4 == 30: # カウンターorミラーコート ry_attack_4 = 0 # 先制で失敗 elif y_sub_4 in (33,34,35): # 2-5連続攻撃 ry_attack_4 = 0 # ダメージの初期化 if y_sub_4 == 33: ry_renzoku = random.randint(1,8) if ry_renzoku in (1,2,3): y_renzoku = 2 elif ry_renzoku in (4,5,6): y_renzoku = 3 elif ry_renzoku == 7: y_renzoku = 4 elif ry_renzoku == 8: y_renzoku = 5 elif y_sub_4 in (34,35): # 2連続攻撃 y_renzoku = 2 if y_sub_4 == 35 and random.randint(1,256) <= 51 and not any([x_koori, x_nemuri, x_mahi, x_yakedo, x_moudoku]): x_doku = 1 # ダブルニードル for _ in range(y_renzoku): # ダメージ累計 y_critical_4 = 0 # 急所の初期化 if y_critical_hit_4 >= random.randint(1,256): # 急所の抽選 y_critical_4 = 1 if y_critical_4 == 0 and y_yakedo == 0: y_renzoku_damage = y_damage_4 * random.randint(217,255) // 255 elif y_critical_4 == 1 and y_yakedo == 0: y_renzoku_damage = y_critical_damage_4 * random.randint(217,255) // 255 elif y_critical_4 == 0 and y_yakedo == 1: y_renzoku_damage = by_damage_4 * random.randint(217,255) // 255 elif y_critical_4 == 1 and y_yakedo == 1: y_renzoku_damage = by_critical_damage_4 * random.randint(217,255) // 255 ry_attack_4 += y_renzoku_damage elif y_sub_4 == 36: # トリプルキック times = 2 # ダメージ倍率 y_renzoku = 0 if y_accuracy_4 >= random.randint(1,256): # 2回目の抽選 y_renzoku = 1 if gamemode == 2: # 後攻への乗算バグ(PBS) x_triple_pbs_4 = 2 if y_accuracy_4 >= random.randint(1,256): # 3回目の抽選 y_renzoku = 2 if gamemode == 2: x_triple_pbs_4 = 3 for _ in range(y_renzoku): # ダメージ累計 y_critical_4 = 0 # 急所の初期化 if y_critical_hit_4 >= random.randint(1,256): y_critical_4 = 1 if y_critical_4 == 0 and y_yakedo == 0: y_triple_kick = y_damage_4 * times * random.randint(217,255) // 255 elif y_critical_4 == 1 and y_yakedo == 0: y_triple_kick = y_critical_damage_4 * times * random.randint(217,255) // 255 elif y_critical_4 == 0 and y_yakedo == 1: y_triple_kick = by_damage_4 * times * random.randint(217,255) // 255 elif y_critical_4 == 1 and y_yakedo == 1: y_triple_kick = by_critical_damage_4 * times * random.randint(217,255) // 255 times += 1 ry_attack_4 += y_triple_kick elif y_sub_4 == 37 and y_level > 0: # サイコウェーブ ry_attack_4 = random.randint(1,ry_psycho_wave) elif y_sub_4 == 38: # 未来予知 ry_attack_4 = 0 elif y_sub_4 == 39: # じたばた if 1 <= y_hp <= y_flail_2: # 威力の決定 ry_attack_4 = y_f200 if y_yakedo == 0 else by_f200 elif y_flail_2 + 1 <= y_hp <= y_flail_5: ry_attack_4 = y_f150 if y_yakedo == 0 else by_f150 elif y_flail_5 + 1 <= y_hp <= y_flail_10: ry_attack_4 = y_f100 if y_yakedo == 0 else by_f100 elif y_flail_10 + 1 <= y_hp <= y_flail_17: ry_attack_4 = y_f80 if y_yakedo == 0 else by_f80 elif gamemode != 2 and y_flail_17 + 1 <= y_hp <= y_flail_33: ry_attack_4 = y_f40 if y_yakedo == 0 else by_f40 elif gamemode == 2 and y_flail_17 + 1 <= y_hp <= y_flail_pbs: # PBS(40) ry_attack_4 = y_f40 if y_yakedo == 0 else by_f40 elif gamemode != 2 and y_flail_33 + 1 <= y_hp <= y_max_hp: ry_attack_4 = y_f20 if y_yakedo == 0 else by_f20 elif gamemode == 2 and y_flail_pbs + 1 <= y_hp <= y_max_hp: # PBS(20) ry_attack_4 = y_f20 if y_yakedo == 0 else by_f20 elif y_sub_4 in (40,41): if y_sub_4 == 40: # 転がる if y_sub_3 == 40 and y_bit_3 == 1 and (x_korogaru <= 4): # 最大16倍, 丸くなる32倍 y_korogaru += 1 else: # 倍率リセット y_korogaru = 1 times = 2 ** (y_korogaru + y_marukunaru - 1) elif y_sub_4 == 41: # 連続斬り if y_sub_3 == 41 and y_bit_3 == 1 and (x_renzokugiri <= 4 or gamemode == 2): # 最大16倍, 無制限(PBS) y_renzokugiri += 1 else: # 倍率リセット y_renzokugiri = 1 times = 2 ** (y_renzokugiri - 1) if y_critical_4 == 0 and y_yakedo == 0: ry_attack_4 = y_damage_4 * times * random.randint(217,255) // 255 elif y_critical_4 == 1 and y_yakedo == 0: ry_attack_4 = y_critical_damage_4 * times * random.randint(217,255) // 255 elif y_critical_4 == 0 and y_yakedo == 1: ry_attack_4 = by_damage_4 * times * random.randint(217,255) // 255 elif y_critical_4 == 1 and y_yakedo == 1: ry_attack_4 = by_critical_damage_4 * times * random.randint(217,255) // 255 elif y_sub_4 == 42: # 痛み分け pain_split = (y_hp_4 + x_hp_4) // 2 y_hp_4 = x_hp_4 = pain_split if y_hp_4 > y_max_hp: # 最大HPを超えない y_hp_4 = y_max_hp if x_hp_4 > x_max_hp: x_hp_4 = x_max_hp elif y_sub_4 in (50,51): # 守る・堪える, 後攻で処理 ry_attack_4 = 0 # 素早さダウンを省略 elif y_sub_4 == 61 and random.randint(1,256) <= y_per_4: # 命中率ダウン y_accuracy_ph += 1 if y_accuracy_ph == 1: x_accuracy_4 = x_accuracy_4_ph1 x1_accuracy, x2_accuracy, x3_accuracy = x1_accuracy_ph1, x2_accuracy_ph1, x3_accuracy_ph1 elif y_accuracy_ph == 2: x_accuracy_4 = x_accuracy_4_ph2 x1_accuracy, x2_accuracy, x3_accuracy = x1_accuracy_ph2, x2_accuracy_ph2, x3_accuracy_ph2 elif y_accuracy_ph == 3: x_accuracy_4 = x_accuracy_4_ph3 x1_accuracy, x2_accuracy, x3_accuracy = x1_accuracy_ph3, x2_accuracy_ph3, x3_accuracy_ph3 elif y_accuracy_ph == 4: x_accuracy_4 = x_accuracy_4_ph4 x1_accuracy, x2_accuracy, x3_accuracy = x1_accuracy_ph4, x2_accuracy_ph4, x3_accuracy_ph4 elif y_sub_4 in (62,63): # 防御or特防ダウン if y_sub_4 == 62 and random.randint(1,256) <= y_per_4: y_bd_ph += 1 elif y_sub_4 == 63: # 防御or特防-2 y_bd_ph += 2 if y_bd_ph == 1: x_konran_damage, bx_konran_damage = x_konran_damage_ph1, bx_konran_damage_ph1 elif y_bd_ph == 2: x_konran_damage, bx_konran_damage = x_konran_damage_ph2, bx_konran_damage_ph2 elif y_bd_ph == 3: x_konran_damage, bx_konran_damage = x_konran_damage_ph3, bx_konran_damage_ph3 elif y_bd_ph == 4: x_konran_damage, bx_konran_damage = x_konran_damage_ph4, bx_konran_damage_ph4 elif y_bd_ph == 5: x_konran_damage, bx_konran_damage = x_konran_damage_ph5, bx_konran_damage_ph5 elif y_bd_ph == 6: x_konran_damage, bx_konran_damage = x_konran_damage_ph6, bx_konran_damage_ph6 if y_bit_4 == 1: # ダメージの判定 x_hp_4 -= ry_attack_4 if y_sub_4 == 20: # 攻撃の反動ダメージ y_hp_4 -= ry_attack_4 // 4 elif y_sub_4 == 21: # HPドレイン y_hp_4 += ry_attack_4 // 2 if y_hp_4 > y_max_hp: # 最大HPを超えない y_hp_4 = y_max_hp if y_ouja_4 == 1 and random.randint(1,256) <= 30: # 先攻のみ王者の抽選 x_hirumi = 1 if x_hachimaki == 1 and x_hp_4 <= 0 and random.randint(1,256) <= 30: # 鉢巻の抽選 x_hp_4 = 1 if x_hp_4 <= 0: # 相手の瀕死判定 y_count_4 += 1 continue elif y_hp_4 <= 0: # 自分の瀕死判定 x_count_4 += 1 continue elif y_sub_4 == 25 and y_bit_4 == 0: # 飛び蹴りの自傷 if gamemode != 2: # GB/N64 y_hp_4 -= ry_attack_4 // 8 elif gamemode == 2: # PBS y_hp_4 -= ry_attack_4 // 4 if y_hp_4 <= 0: # 自分の瀕死判定 x_count_4 += 1 continue if y_hirumi == 1: # 怯みの解除 y_hirumi = 0 # 追加効果の抽選 if y_bit_4 == 1 and 0 < y_sub_4 <= 13: if y_sub_4 == 1: # 怯みの付与 if random.randint(1,256) <= y_per_4: x_hirumi = 1 elif y_sub_4 == 2: # 凍りの付与 if random.randint(1,256) <= y_per_4 and not any([x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku]): x_koori = 1 if x_yaketa == x_stock == 1: # 焼けた木の実 x_koori, x_stock = 0, 0 elif y_sub_4 == 3: # 眠りの付与 if not any([x_koori, x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku]): if gamemode == 0: # GB x_nemuri = random.randint(2,7) elif gamemode == 1: # N64 x_nemuri = random.randint(2,4) elif gamemode == 2: # PBS x_nemuri = random.randint(2,5) if x_hakka == x_stock == 1: # 薄荷の実 x_nemuri, x_stock = 0, 0 elif y_sub_4 == 4: # 混乱の付与 if random.randint(1,256) <= y_per_4 and x_konran == 0: x_konran = random.randint(2,5) if x_nigai == x_stock == 1: # 苦い木の実 x_konran, x_stock = 0, 0 elif y_sub_4 == 5: # メロメロの付与 x_meromero = 1 elif y_sub_4 == 6: # 麻痺の付与 if random.randint(1,256) <= y_per_4 and not any([x_koori, x_nemuri, x_doku, x_yakedo, x_moudoku]): x_mahi = 1 if x_mahinaoshi == x_stock == 1: # 麻痺治しの実 x_mahi, x_stock = 0, 0 elif y_sub_4 == 7: # 毒の付与 if random.randint(1,256) <= y_per_4 and not any([x_koori, x_nemuri, x_mahi, x_yakedo, x_moudoku]): x_doku = 1 if x_dokukeshi == x_stock == 1: # 毒消しの実 x_doku, x_stock = 0, 0 elif y_sub_4 == 8: # 火傷の付与 if random.randint(1,256) <= y_per_4 and not any([x_koori, x_nemuri, x_mahi, x_doku, x_moudoku]): x_yakedo = 1 if x_kootta == x_stock == 1: # 凍った木の実 x_yakedo, x_stock = 0, 0 elif y_sub_4 == 9: # 猛毒の付与 if not any([x_koori, x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku]): x_moudoku = 1 if x_dokukeshi == x_stock == 1: # 毒消しの実 x_moudoku, x_stock = 0, 0 elif y_sub_4 == 10: # 宿り木の付与 x_yadorigi = 1 elif y_sub_4 == 11 and (x_nemuri > 0): # 悪夢の付与 x_akumu = 1 elif y_sub_4 == 12: # 呪いの付与 x_noroi = 1 y_hp_4 -= y_trunc_2 if y_hp_4 <= 0: # 自分の瀕死判定 x_count_4 += 1 continue elif y_sub_4 == 13 and random.randint(1,256) <= 51: # トライアタックの付与(凍り・麻痺・火傷) ry_tri_attack = random.randint(1,3) if ry_tri_attack == 1: # 凍りの付与 if not any([x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku]): x_koori = 1 if x_yaketa == x_stock == 1: # 焼けた木の実 x_koori, x_stock = 0, 0 elif ry_tri_attack == 2: # 麻痺の付与 if not any([x_koori, x_nemuri, x_doku, x_yakedo, x_moudoku]): x_mahi = 1 if x_mahinaoshi == x_stock == 1: # 麻痺治しの実 x_mahi, x_stock = 0, 0 elif ry_tri_attack == 3: # 火傷の付与 if not any([x_koori, x_nemuri, x_mahi, x_doku, x_moudoku]): x_yakedo = 1 if x_kootta == x_stock == 1: # 凍った木の実 x_yakedo, x_stock = 0, 0 elif x_koori == 1: # 相手が凍りなら火傷で解除 x_koori = 0 if x_kiseki == x_stock == 1 and any([x_koori, x_nemuri, x_konran, x_mahi, x_doku, x_yakedo, x_moudoku]): # 奇跡の実 x_koori, x_nemuri, x_konran, x_mahi, x_doku, x_yakedo, x_moudoku, x_stock = 0, 0, 0, 0, 0, 0, 0, 0 # 自分のターン終了時(4B) if y_doku == 1: # 毒 y_hp_4 -= y_trunc_8 elif y_yakedo == 1: # 火傷 y_hp_4 -= y_trunc_8 elif y_moudoku > 0: # 猛毒 y_hp_4 -= y_trunc_16 * y_moudoku y_moudoku += 1 if y_yadorigi == 1: # 宿り木の種 y_hp_4 -= y_trunc_8 x_hp_4 += y_trunc_8 if x_hp_4 > x_max_hp: x_hp_4 = x_max_hp if y_akumu == 1 and y_nemuri > 0: # 悪夢 y_hp_4 -= y_trunc_4 if y_noroi == 1: # 呪い y_hp_4 -= y_trunc_4 if y_hp_4 <= 0: # 自分の瀕死判定 x_count_4 += 1 continue # 後攻 / プレイヤー1 if x_critical_hit_4 >= random.randint(1,256): # 急所の抽選 x_critical_4 = 1 if x_accuracy_4 < random.randint(1,256): # 命中率の抽選 x_bit_4 = 0 if x_hirumi == 1 and gamemode == 2: # 怯み時の判定(PBS) x_bit_4 = 2 if x_koori == 1: # 凍り時の判定: x_bit_4 = 2 elif x_nemuri > 0 and x_bit_4 != 2: # 眠り時の判定 x_nemuri -= 1 if x_nemuri > 0: x_bit_4 = 2 if x_sub_4 == 29: # 寝言の判定 x_bit_4 = 3 elif x_nemuri == 0: # 起きたら悪夢を解除 x_akumu = 0 if x_hirumi == 1 and gamemode != 2: # 怯み時の判定(GB/N64) x_bit_4 = 2 if x_meromero == 1 and x_bit_4 != 2 and random.randint(1,2) == 1: # メロメロ時の判定 x_bit_4 = 2 if x_mahi == 1 and x_bit_4 != 2 and random.randint(1,4) == 1: # 麻痺時の判定 x_bit_4 = 2 if x_konran > 0 and x_bit_4 != 2: # 混乱時の判定 x_konran -= 1 if random.randint(1,2) == 1 and y_konran > 0: if gamemode != 2 and x_yakedo == 0: # GB/N64は最大値 x_hp_4 -= x_konran_damage elif gamemode != 2 and x_yakedo == 1: x_hp_4 -= bx_konran_damage elif gamemode == 2 and x_yakedo == 0: x_hp_4 -= x_konran_damage * random.randint(217,255) // 255 elif gamemode == 2 and x_yakedo == 1: x_hp_4 -= bx_konran_damage * random.randint(217,255) // 255 x_bit_4 = 2 if x_hp_4 <= 0: # 自傷の瀕死判定 y_count_4 += 1 continue if x_sub_4 == 29 and x_bit_4 == 3: # 寝言の抽選 x_bit_4 = 1 if x_negoto_way == 2: rx_negoto = random.randint(1,2) elif x_negoto_way == 3: rx_negoto = random.randint(1,3) if rx_negoto == 1: x_damage_4, x_critical_damage_4, x_accuracy_4, x_critical_hit_4 = x1_damage, x1_critical_damage, x1_accuracy, x1_critical_hit x_sub_4, x_per_4 = x1_sub, x1_per elif rx_negoto == 2: x_damage_4, x_critical_damage_4, x_accuracy_4, x_critical_hit_4 = x2_damage, x2_critical_damage, x2_accuracy, x2_critical_hit x_sub_4, x_per_4 = x2_sub, x2_per elif rx_negoto == 3: x_damage_4, x_critical_damage_4, x_accuracy_4, x_critical_hit_4 = x3_damage, x3_critical_damage, x3_accuracy, x3_critical_hit x_sub_4, x_per_4 = x3_sub, x3_per if x_critical_hit_4 >= random.randint(1,256): # 急所の抽選 x_critical_4 = 1 if x_accuracy_4 < random.randint(1,256): # 命中率の抽選 x_bit_4 = 0 if y_sub_4 in (50,51): # 先攻の守る・堪える if not y_sub_3 in (50,51): y_protect = 1 ry_protect = (1/2 ** (y_protect - 1) * 256 - 1/256) // 1 if y_bit_4 != 2 and (ry_protect >= random.randint(1,256) or (gamemode == 2 and y_protect == 1)): # 1ターン目は必ず成功(PBS) y_protect += 1 if y_sub_4 == 50 and not x_sub_4 in (11,12,27,28,38): # 守る # 悪夢・呪い・回復・未来予知は有効 x_bit_4 = 0 else: y_protect = 1 if x_bit_4 == 1 or x_sub_4 == 25: # 攻撃の判定 if x_critical_4 == 0 and x_yakedo == 0: rx_attack_4 = x_damage_4 * x_triple_pbs_4 * random.randint(217,255) // 255 elif x_critical_4 == 1 and x_yakedo == 0: rx_attack_4 = x_critical_damage_4 * x_triple_pbs_4 * random.randint(217,255) // 255 elif x_critical_4 == 0 and x_yakedo == 1: rx_attack_4 = bx_damage_4 * x_triple_pbs_4 * random.randint(217,255) // 255 elif x_critical_4 == 1 and x_yakedo == 1: rx_attack_4 = bx_critical_damage_4 * x_triple_pbs_4 * random.randint(217,255) // 255 if x_sub_4 >= 22 and x_bit_4 == 1: # 技の効果 if x_sub_4 == 22: # 怒りの前歯 rx_attack_4 = y_hp_4 // 2 elif x_sub_4 == 23: # 固定ダメージ rx_attack_4 = x_damage_4 elif x_sub_4 == 24: # プレゼント rx_gift = random.randint(1,10) if gamemode != 2 and rx_gift in (1,2): # GB/N64の回復 rx_attack_4 = -y_trunc_4 elif gamemode == 2 and rx_gift in (1,2): # PBSの回復 rx_attack_4 = -80 elif x_critical_4 == 0 and x_yakedo == 0: if rx_gift in (3,4,5,6): rx_attack_4 = x_g40 * x_triple_pbs_4 * random.randint(217,255) // 255 elif rx_gift in (7,8,9): rx_attack_4 = x_g80 * x_triple_pbs_4 * random.randint(217,255) // 255 elif rx_gift == 10: rx_attack_4 = x_g120 * x_triple_pbs_4 * random.randint(217,255) // 255 elif x_critical_4 == 1 and x_yakedo == 0: if rx_gift in (3,4,5,6): rx_attack_4 = x_cg40 * x_triple_pbs_4 * random.randint(217,255) // 255 elif rx_gift in (7,8,9): rx_attack_4 = x_cg80 * x_triple_pbs_4 * random.randint(217,255) // 255 elif rx_gift == 10: rx_attack_4 = x_cg120 * x_triple_pbs_4 * random.randint(217,255) // 255 elif x_critical_4 == 0 and x_yakedo == 1: if rx_gift in (3,4,5,6): rx_attack_4 = bx_g40 * x_triple_pbs_4 * random.randint(217,255) // 255 elif rx_gift in (7,8,9): rx_attack_4 = bx_g80 * x_triple_pbs_4 * random.randint(217,255) // 255 elif rx_gift == 10: rx_attack_4 = bx_g120 * x_triple_pbs_4 * random.randint(217,255) // 255 elif x_critical_4 == 1 and x_yakedo == 1: if rx_gift in (3,4,5,6): rx_attack_4 = bx_cg40 * x_triple_pbs_4 * random.randint(217,255) // 255 elif rx_gift in (7,8,9): rx_attack_4 = bx_cg80 * x_triple_pbs_4 * random.randint(217,255) // 255 elif rx_gift == 10: rx_attack_4 = bx_cg120 * x_triple_pbs_4 * random.randint(217,255) // 255 if y_hp_4 > y_max_hp: # 最大HPを超えない y_hp_4 = y_max_hp elif x_sub_4 == 27: # 1/2回復 rx_attack_4 = 0 x_hp_4 += x_trunc_2 if x_hp_4 > x_max_hp: # 最大HPを超えない x_hp_4 = x_max_hp elif x_sub_4 == 28: # 眠る rx_attack_4 = 0 if x_hp_4 < x_max_hp: # 最大HP未満なら回復 x_hp_4 = x_max_hp x_nemuri, x_mahi, x_doku, x_yakedo, x_moudoku = 3, 0, 0, 0, 0 # 2ターン眠り elif x_sub_4 == 30: # カウンターorミラーコート rx_attack_4 = ry_attack_4 * 2 if 999 <= y_damage_4 and y_bit_4 == 0 and gamemode == 0: # 一撃外れをカウンター(GB) rx_attack_4 = y_max_hp elif x_sub_4 in (33,34,35): # 2-5連続攻撃 rx_attack_4 = 0 # ダメージの初期化 if x_sub_4 == 33: rx_renzoku = random.randint(1,8) if rx_renzoku in (1,2,3): x_renzoku = 2 elif rx_renzoku in (4,5,6): x_renzoku = 3 elif rx_renzoku == 7: x_renzoku = 4 elif rx_renzoku == 8: x_renzoku = 5 elif x_sub_4 in (34,35): # 2連続攻撃 x_renzoku = 2 if x_sub_4 == 35 and random.randint(1,256) <= 51 and not any([y_koori, y_nemuri, y_mahi, y_yakedo, y_moudoku]): y_doku = 1 # ダブルニードル for _ in range(x_renzoku): # ダメージ累計 x_critical_4 = 0 # 急所の初期化 if x_critical_hit_4 >= random.randint(1,256): # 急所の抽選 x_critical_4 = 1 if x_critical_4 == 0 and x_yakedo == 0: x_renzoku_damage = x_damage_4 * x_triple_pbs_4 * random.randint(217,255) // 255 elif x_critical_4 == 1 and x_yakedo == 0: x_renzoku_damage = x_critical_damage_4 * x_triple_pbs_4 * random.randint(217,255) // 255 elif x_critical_4 == 0 and x_yakedo == 1: x_renzoku_damage = bx_damage_4 * x_triple_pbs_4 * random.randint(217,255) // 255 elif x_critical_4 == 1 and x_yakedo == 1: x_renzoku_damage = bx_critical_damage_4 * x_triple_pbs_4 * random.randint(217,255) // 255 rx_attack_4 += x_renzoku_damage elif x_sub_4 == 36: # トリプルキック times = 2 # ダメージ倍率 x_renzoku = 0 if x_accuracy_4 >= random.randint(1,256): # 2回目の抽選 x_renzoku = 1 if x_accuracy_4 >= random.randint(1,256): # 3回目の抽選 x_renzoku = 2 for _ in range(x_renzoku): # ダメージ累計 x_critical_4 = 0 # 急所の初期化 if x_critical_hit_4 >= random.randint(1,256): x_critical_4 = 1 if x_critical_4 == 0 and x_yakedo == 0: x_triple_kick = x_damage_4 * times * random.randint(217,255) // 255 elif x_critical_4 == 1 and x_yakedo == 0: x_triple_kick = x_critical_damage_4 * times * random.randint(217,255) // 255 elif x_critical_4 == 0 and x_yakedo == 1: x_triple_kick = bx_damage_4 * times * random.randint(217,255) // 255 elif x_critical_4 == 1 and x_yakedo == 1: x_triple_kick = bx_critical_damage_4 * times * random.randint(217,255) // 255 times += 1 rx_attack_4 += x_triple_kick elif x_sub_4 == 37 and x_level > 0: # サイコウェーブ rx_attack_4 = random.randint(1,rx_psycho_wave) elif x_sub_4 == 38: # 未来予知 rx_attack_4 = 0 elif x_sub_4 == 39: # じたばた if 1 <= x_hp <= x_flail_2: # 威力の決定 rx_attack_4 = x_f200 if x_yakedo == 0 else bx_f200 elif x_flail_2 + 1 <= x_hp <= x_flail_5: rx_attack_4 = x_f150 if x_yakedo == 0 else bx_f150 elif x_flail_5 + 1 <= x_hp <= x_flail_10: rx_attack_4 = x_f100 if x_yakedo == 0 else bx_f100 elif x_flail_10 + 1 <= x_hp <= x_flail_17: rx_attack_4 = x_f80 if x_yakedo == 0 else bx_f80 elif gamemode != 2 and x_flail_17 + 1 <= x_hp <= x_flail_33: rx_attack_4 = x_f40 if x_yakedo == 0 else bx_f40 elif gamemode == 2 and x_flail_17 + 1 <= x_hp <= x_flail_pbs: # PBS(40) rx_attack_4 = x_f40 if x_yakedo == 0 else bx_f40 elif gamemode != 2 and x_flail_33 + 1 <= x_hp <= x_max_hp: rx_attack_4 = x_f20 if x_yakedo == 0 else bx_f20 elif gamemode == 2 and x_flail_pbs + 1 <= x_hp <= x_max_hp: # PBS(20) rx_attack_4 = x_f20 if x_yakedo == 0 else bx_f20 if gamemode == 2: # 最高乱数+1ダメージ(PBS) rx_attack_4 = rx_attack_4 * x_triple_pbs_4 + 1 elif x_sub_4 in (40,41): if x_sub_4 == 40: # 転がる if x_sub_3 == 40 and x_bit_3 == 1 and (x_korogaru <= 4): # 最大16倍, 丸くなる32倍 x_korogaru += 1 else: # 倍率リセット x_korogaru = 1 times = 2 ** (x_korogaru + x_marukunaru - 1) elif x_sub_4 == 41: # 連続斬り if x_sub_3 == 41 and x_bit_3 == 1 and (x_renzokugiri <= 4 or gamemode == 2): # 最大16倍, 無制限(PBS) x_renzokugiri += 1 else: # 倍率リセット x_renzokugiri = 1 times = 2 ** (x_renzokugiri - 1) if x_critical_4 == 0 and x_yakedo == 0: rx_attack_4 = x_damage_4 * times * random.randint(217,255) // 255 elif x_critical_4 == 1 and x_yakedo == 0: rx_attack_4 = x_critical_damage_4 * times * random.randint(217,255) // 255 elif x_critical_4 == 0 and x_yakedo == 1: rx_attack_4 = bx_damage_4 * times * random.randint(217,255) // 255 elif x_critical_4 == 1 and x_yakedo == 1: rx_attack_4 = bx_critical_damage_4 * times * random.randint(217,255) // 255 elif x_sub_4 == 42: # 痛み分け pain_split = (x_hp_4 + y_hp_4) // 2 x_hp_4 = y_hp_4 = pain_split if x_hp_4 > x_max_hp: # 最大HPを超えない x_hp_4 = x_max_hp if y_hp_4 > y_max_hp: y_hp_4 = y_max_hp elif x_sub_4 in (50,51): # 守る・堪える, 後攻は失敗 rx_attack_4, x_protect = 0, 1 # 素早さ・命中率ダウン・防御or特防ダウンを省略 if x_bit_4 == 1: # ダメージの判定 y_hp_4 -= rx_attack_4 if x_sub_4 == 20: # 攻撃の反動ダメージ x_hp_4 -= rx_attack_4 // 4 elif x_sub_4 == 21: # HPドレイン x_hp_4 += rx_attack_4 // 2 if x_hp_4 > x_max_hp: # 最大HPを超えない x_hp_4 = x_max_hp if y_sub_4 == 51 and y_hp_4 <= 0 and y_protect > 1 and y_bit_4 == 1: # 堪える y_hp_4 = 1 if y_hachimaki == 1 and y_hp_4 <= 0 and random.randint(1,256) <= 30: # 鉢巻の抽選 y_hp_4 = 1 if y_hp_4 <= 0: # 相手の瀕死判定 x_count_4 += 1 continue elif x_sub_4 == 25 and x_bit_4 == 0: # 飛び蹴りの自傷 if gamemode != 2: # GB/N64 x_hp_4 -= rx_attack_4 // 8 elif gamemode == 2: # PBS x_hp_4 -= rx_attack_4 // 4 if x_hp_4 <= 0: # 自分の瀕死判定 y_count_4 += 1 continue if x_hirumi == 1: # 怯みの解除 x_hirumi = 0 # 追加効果の抽選 # 呪い以外を省略 if x_sub_4 == 12 and x_bit_4 == 1: # 呪いの付与 y_noroi = 1 x_hp_4 -= x_trunc_2 if x_hp_4 <= 0: # 自分の瀕死判定 y_count_4 += 1 continue # 自分のターン終了時(4B) if x_doku == 1: # 毒 x_hp_4 -= x_trunc_8 elif x_yakedo == 1: # 火傷 x_hp_4 -= x_trunc_8 elif x_moudoku > 0: # 猛毒 x_hp_4 -= x_trunc_16 * x_moudoku x_moudoku += 1 if x_yadorigi == 1: # 宿り木の種 x_hp_4 -= x_trunc_8 y_hp_4 += x_trunc_8 if y_hp_4 > y_max_hp: y_hp_4 = y_max_hp if x_akumu == 1 and x_nemuri > 0: # 悪夢 x_hp_4 -= x_trunc_4 if x_noroi == 1: # 呪い x_hp_4 -= x_trunc_4 if x_hp_4 <= 0: # 自分の瀕死判定 y_count_4 += 1 continue # 全体のターン終了時(4B) if x_sub_2 == 38 and x_bit_2 == 1: # 未来予知の判定 y_hp_4 -= x_damage_2 * random.randint(217,255) // 255 if y_hp_4 <= 0: # 行動順で瀕死の判定 x_count_4 += 1 continue if y_sub_2 == 38 and y_bit_2 == 1: x_hp_4 -= y_damage_2 * random.randint(217,255) // 255 if x_hp_4 <= 0: y_count_4 += 1 continue if suna_4 == 1: # 砂嵐の判定 if y_suna == 1: # 行動順で瀕死の判定 y_hp_4 -= y_trunc_8 if y_hp_4 <= 0: x_count_4 += 1 continue if x_suna == 1: x_hp_4 -= x_trunc_8 if x_hp_4 <= 0: y_count_4 += 1 continue # 食べ残し以降を省略 print('turn1(P1):',x_count_1 / trial * 100,'%') print('turn1(P2):',y_count_1 / trial * 100,'%') print('turn2(P1):',(x_count_1 + x_count_2) / trial * 100,'%') print('turn2(P2):',(y_count_1 + y_count_2) / trial * 100,'%') print('turn3(P1):',(x_count_1 + x_count_2 + x_count_3) / trial * 100,'%') print('turn3(P2):',(y_count_1 + y_count_2 + y_count_3) / trial * 100,'%') print('turn4(P1):',(x_count_1 + x_count_2 + x_count_3 + x_count_4) / trial * 100,'%') print('turn4(P2):',(y_count_1 + y_count_2 + y_count_3 + y_count_4) / trial * 100,'%') main()