-
Notifications
You must be signed in to change notification settings - Fork 180
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
『砂塵戦機アーガス 2nd Edition』のダイスを作成しました #641
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #641 +/- ##
=======================================
Coverage 95.60% 95.60%
=======================================
Files 340 341 +1
Lines 19542 19559 +17
Branches 5094 5094
=======================================
+ Hits 18683 18700 +17
Misses 859 859
☔ View full report in Codecov by Sentry. |
def eval_game_system_specific_command(command) | ||
roll_ippan(command) || | ||
roll_hit_check(command) || | ||
roll_tables(command, TABLES) || | ||
roll_tables(command, SECOND_ED_TABLES) | ||
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.
def eval_game_system_specific_command(command) | |
roll_ippan(command) || | |
roll_hit_check(command) || | |
roll_tables(command, TABLES) || | |
roll_tables(command, SECOND_ED_TABLES) | |
end | |
def eval_game_system_specific_command(command) | |
super(command) || | |
roll_tables(command, SECOND_ED_TABLES) | |
end |
オーバーライド前のメソッドを呼び出す super
を使うのが良いかと思います。
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.
そうでした!スッキリしますね。修正します。
"CAP" => DiceTable::RangeTable.new( | ||
"鹵獲結果表", | ||
"2D9", | ||
[ | ||
[0..2, '敵A:GuS を完全な状態で鹵獲︕ ※総合価格÷ 2 で売却可。'], | ||
[3..7, '敵A:GuS の兵装を鹵獲︕ ※敵A:GuS の装備している任意の兵装1つを獲得。'], | ||
[8..13, '使えそうな兵装を発見︕ ※1D10 を振り、出目の部位の兵装1つを獲得。'], | ||
[14..18, '残念、完全にスクラップだ……。※部品代として[バランス値×300]cdtを獲得。'], | ||
] | ||
), |
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.
DiceTable系はいわゆる D9 をサポートしていないので、2D9
だと本当に9面ダイスが2個振られてそれぞれ1〜9の目が出ることになってしまいます。
テストケースに value = 0
と書ける上に動作してしまうので、誤解させてすみません。
RangeTable
を継承するなどして動作を調整してもらうのが良いと思います。
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.
とりあえず、今の所ガンドックとアーガスくらいなので姑息な手段で済ませることにしました。
将来的にはサポートされると良いですね。
] | ||
), | ||
}.freeze | ||
register_prefix('-?\d*AG', 'OM', 'NM', TABLES.keys, SECOND_ED_TABLES.keys) |
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.
register_prefix('-?\d*AG', 'OM', 'NM', TABLES.keys, SECOND_ED_TABLES.keys) | |
register_prefix_from_super_class() | |
register_prefix(SECOND_ED_TABLES.keys) |
親クラスのprefixを引き継げる BCDice::Base.register_prefix_from_super_class
を使うのが良さそうです。
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.
ありがとうございます。こちらも修正します。
今までご指摘があった修正を行いました。 |
@Faceless192x ありがとうございます。マージしました! |
『砂塵戦機アーガス 2nd Edition』の専用ダイスの要望がありましたので、『砂塵戦機アーガス』のダイスを継承して2nd Ed.用のダイスを作成してみました。
rubocop通過済みです。
と、実際には「鹵獲結果表」以下の表を追加しただけになります。
このシステムはd10の扱いが所謂d9スタイルなのですが、表を作成していて「DiceTable::Table」や「DiceTable::RangeTable」がd9を想定していないことに気が付きました。(0では開始できない。0..1なら実行可能)
優先度は低いですが、頭に入れておくと良いかもしれませんね。
ともあれ、必要そうな表の実装が出来ましたのでpull requestを送ります。
お手隙の際にご確認ください。