Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RuneQuest:Roleplaying in Glorantha]「失敗」判定の優先順位バグ修正 #645

Merged
merged 2 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions lib/bcdice/game_system/RuneQuestRoleplayingInGlorantha.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ def do_resistance_active_characteristic_roll(command)
note_str = "クリティカル/スペシャル、ファンブルは未処理。必要なら確認すること。"

if roll_value >= 96
# 96-99は無条件で失敗
# 96以上は無条件で失敗
Result.failure("#{result_prefix_str} 失敗\n#{note_str}")
elsif roll_value <= 5 || roll_value <= modifiy_value
# 02-05あるいは修正値以下は無条件で成功
# 05以下あるいは修正値以下は無条件で成功
Result.success("#{result_prefix_str} 成功\n#{note_str}")
else
# 上記全てが当てはまらない時に突破可能な能力値を算出
Expand All @@ -151,15 +151,18 @@ def get_roll_result(result_str, success_value, roll_value)
elsif (roll_value == 100) || (roll_value >= (100 - funmble_value + 1))
# ファンブル(00は必ずファンブル)
Result.fumble("#{result_str} ファンブル")
elsif roll_value >= 96 || ((roll_value > success_value) && (roll_value > 5))
# 失敗(96以上は必ず失敗、出目が01-05ではなく技能値より上なら失敗)
Result.failure("#{result_str} 失敗")
elsif roll_value <= special_value
# スペシャル
Result.success("#{result_str} スペシャル")
elsif (roll_value <= 95) && ((roll_value <= 5) || (roll_value <= success_value))
# 成功(02-05は必ず成功で、96-99は必ず失敗)
elsif (roll_value <= 5) || (roll_value <= success_value)
# 成功(05以下は必ず成功)
Result.success("#{result_str} 成功")
else
# 失敗
Result.failure("#{result_str} 失敗")
# ここには到達しないはずだが、念のため捕捉
Result.failure("#{result_str} エラー")
end
end
end
Expand Down
24 changes: 24 additions & 0 deletions test/data/RuneQuestRoleplayingInGlorantha.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1493,3 +1493,27 @@ failure = true
rands = [
{ sides = 100, value = 100 },
]

#===== バグ対応 ======#

#【技能540%の時、出目96以上でスペシャルになる問題対応】
# 96は計算上スペシャルだが、96以上の出目は失敗
[[ test ]]
game_system = "RuneQuestRoleplayingInGlorantha"
input = "RQG<=540"
output = "(1D100<=540) > 96 > 失敗"
failure = true
rands = [
{ sides = 100, value = 96 },
]

#【技能540%の時、出目96以上でスペシャルになる問題対応】
# 95は計算上スペシャル
[[ test ]]
game_system = "RuneQuestRoleplayingInGlorantha"
input = "RQG<=540"
output = "(1D100<=540) > 95 > スペシャル"
success = true
rands = [
{ sides = 100, value = 95 },
]
Loading