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

[Garactier]ガラクティア追加 #749

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

JackyAniue
Copy link

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)
報告フェイズの増強可能施設を決定します。

@JackyAniue
Copy link
Author

バージョン1.03から1.04にアイテム表を更新しました。

Copy link
Member

@ysakasin ysakasin left a 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 を用いるように変更をお願いします。

@JackyAniue
Copy link
Author

ArithmeticEvaluator.eval は非推奨メソッドのため、 Arithmetic.eval を用いるように変更をお願いします。
修正いたしました。よろしくお願いいたします。

Comment on lines 317 to 321
if m[1]
modifier = Arithmetic.eval(m[1], RoundType::FLOOR)
else
modifier = 0
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rubyではifも式で、戻り値を持つので以下のような書き方が適切かと思います。

Suggested change
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

他の部分も同様に修正をお願いします。

Copy link
Member

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

承知しました急ぎ修正いたします

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修正、マージいたしました。(2つ目の案をいただきました)
ありがとうございます!

elsif fumble
Result.fumble("ファンブル")
else
Integer success_level = (total - 4) / 2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Integer success_level = (total - 4) / 2
success_level = (total - 4) / 2

Rubyでは整数と整数の割り算は整数になるため、 Integer が切り捨ての処理を意図しているならば不要です。

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

承知しました、修正いたします。

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

削除、修正行いました。
Ruby不勉強で何度も申し訳ありません。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants