-
Notifications
You must be signed in to change notification settings - Fork 191
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
[Garactier]ガラクティア追加 #749
base: master
Are you sure you want to change the base?
[Garactier]ガラクティア追加 #749
Conversation
バージョン1.03から1.04にアイテム表を更新しました。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ArithmeticEvaluator.eval
は非推奨メソッドのため、 Arithmetic.eval
を用いるように変更をお願いします。
|
lib/bcdice/game_system/Garactier.rb
Outdated
if m[1] | ||
modifier = Arithmetic.eval(m[1], RoundType::FLOOR) | ||
else | ||
modifier = 0 | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rubyではifも式で、戻り値を持つので以下のような書き方が適切かと思います。
if m[1] | |
modifier = Arithmetic.eval(m[1], RoundType::FLOOR) | |
else | |
modifier = 0 | |
end | |
modifier = if m[1] | |
Arithmetic.eval(m[1], RoundType::FLOOR) | |
else | |
0 | |
end |
他の部分も同様に修正をお願いします。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
もしくは、以下のようにしてしまうのも手です。
modifier = Arithmetic.eval(m[1] || "", RoundType::FLOOR) || 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
承知しました急ぎ修正いたします
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修正、マージいたしました。(2つ目の案をいただきました)
ありがとうございます!
lib/bcdice/game_system/Garactier.rb
Outdated
elsif fumble | ||
Result.fumble("ファンブル") | ||
else | ||
Integer success_level = (total - 4) / 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Integer success_level = (total - 4) / 2 | |
success_level = (total - 4) / 2 |
Rubyでは整数と整数の割り算は整数になるため、 Integer
が切り捨ての処理を意図しているならば不要です。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
承知しました、修正いたします。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
削除、修正行いました。
Ruby不勉強で何度も申し訳ありません。
TRPGシステム『ガラクティア』のダイスボットを追加いたしました。
ルールブック(https://booth.pm/ja/items/6164092)
ルールブック無料版(https://booth.pm/ja/items/6164662)
Kuuto7様の#745と拙作#746をマージしたものとなります。
よろしくお願いいたします。
ガラクティアVer1.03
x:基準値
y:目標値
x, yについては四則演算の入力が可能
■達成値の算出(GRx)
クリティカル・ファンブルの判定、達成値の表示を行う。
■通常判定(GRx>=y)
通常の判定を行う。
■命中判定(GRHx>=y)
命中判定を行う。
■回避判定(GRDx>=y)
回避判定を行う。
■抵抗判定(GRMx>=y)
抵抗判定を行う。
■探索成功マスレベル算出(GRSx)
探索・索敵判定時の最大成功マスレベル(ML)を算出する
■ 表
アイテム決定表(ITMn)
ランクnのアイテム表を振る。例)ITM2 ランク2アイテム表
上級アイテムの判定も行います。
命中部位決定表(BUI)
命中時の部位を決定します。
増強可能施設決定表(SST)
報告フェイズの増強可能施設を決定します。