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

『砂塵戦機アーガス 2nd Edition』のダイスを作成しました #641

Merged
merged 7 commits into from
Sep 3, 2023

Conversation

Faceless192x
Copy link
Contributor

『砂塵戦機アーガス 2nd Edition』の専用ダイスの要望がありましたので、『砂塵戦機アーガス』のダイスを継承して2nd Ed.用のダイスを作成してみました。
 rubocop通過済みです。

    ・一般判定Lv(チャンス出目0→判定0) nAG+x
       nは習得レベル、Lv0の場合nの省略可能。xは判定値修正(数式による修正可)、省略した場合はレベル修正0
       例)AG:習得レベル0の一般技能、1AG+1:習得レベル1・判定値修正+1の技能、AG+2-1:習得レベル0・判定値修正2-1の技能、(1-1)AG:習得レベル1・レベル修正-1の技能

    ・適正距離での命中判定(チャンス出目0→判定0、HR算出)OM+y@z
       yは命中補正値(数式可)、zはクリティカル値。クリティカル値省略時は0
       HRの算出時には、HRが大きくなる場合に出目0を10に読み替えます。
       例)OM+18-6@2:命中補正値+18-6でクリティカル値2、適正距離の判定

    ・非適正距離での命中判定(チャンス出目0→判定0、HR算出)NM+y@z
       yは命中補正値(数式可)、zはクリティカル値。クリティカル値省略時は0
       HRの算出時には、HRが大きくなる場合に出目0を10に読み替えます。
       例)NM+4-3:命中補正値+4-3で非適正距離の判定

    ・クリティカル表   CR
    ・鹵獲結果表     CAP
    ・幕間クエスト表   INT
    ・サルベージ表    SAL
    ・赤字ペナルティー表 DEF
    ・特殊戦況表     SPE

    ※通常の1D10などの10面ダイスにおいて出目10の読み替えはしません。コマンドのみです。
     ページ参照は、何もない場合は「ルールブック」、wは「西風旅徨」を示します。

 と、実際には「鹵獲結果表」以下の表を追加しただけになります。

 このシステムはd10の扱いが所謂d9スタイルなのですが、表を作成していて「DiceTable::Table」や「DiceTable::RangeTable」がd9を想定していないことに気が付きました。(0では開始できない。0..1なら実行可能)
 優先度は低いですが、頭に入れておくと良いかもしれませんね。

 ともあれ、必要そうな表の実装が出来ましたのでpull requestを送ります。
 お手隙の際にご確認ください。

@codecov
Copy link

codecov bot commented Sep 2, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (825b399) 95.60% compared to head (48527a2) 95.60%.

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           
Files Changed Coverage Δ
lib/bcdice/game_system.rb 100.00% <100.00%> (ø)
lib/bcdice/game_system/SajinsenkiAGuS2E.rb 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines 50 to 55
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
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
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 を使うのが良いかと思います。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

そうでした!スッキリしますね。修正します。

Comment on lines 58 to 67
"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を獲得。'],
]
),
Copy link
Member

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 を継承するなどして動作を調整してもらうのが良いと思います。

Copy link
Contributor Author

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)
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
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 を使うのが良さそうです。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ありがとうございます。こちらも修正します。

@Faceless192x
Copy link
Contributor Author

今までご指摘があった修正を行いました。
お手隙の時に、ご確認ください。

@ysakasin ysakasin merged commit 434f573 into bcdice:master Sep 3, 2023
8 checks passed
@ysakasin
Copy link
Member

ysakasin commented Sep 3, 2023

@Faceless192x ありがとうございます。マージしました!

@Faceless192x Faceless192x deleted the feature/AGuS2E branch September 3, 2023 23:21
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.

None yet

2 participants