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

ネクロニカのダイスボットを改善 #440

Merged
merged 11 commits into from
May 25, 2021

Conversation

GenKuzumochi
Copy link
Contributor

変更内容

  • NCNAでダイス数を省略可能に。(NC+1 = 1NC+1)
  • 1d10+x>=n の壊れた挙動を修正
    • 1d10+xを振ってn以上なら成功。11を超えると「大成功」と表示
    • 2d10以降の壊れた挙動は削除、通常のnd10として扱う
  • 1R10+1[1]のような形式も一応互換性を維持
  • Resultを使うように
  • テストを合理的な範囲に削減
  • リファクタリング

議論

https://discord.com/channels/597133335243784192/597133647749054464/818902737315692554

@codecov
Copy link

codecov bot commented Apr 29, 2021

Codecov Report

Merging #440 (997b701) into master (d5dffa9) will increase coverage by 0.10%.
The diff coverage is 99.38%.

❗ Current head 997b701 differs from pull request most recent head b84e9f8. Consider uploading reports for the commit b84e9f8 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #440      +/-   ##
==========================================
+ Coverage   95.24%   95.35%   +0.10%     
==========================================
  Files         288      290       +2     
  Lines       18679    18762      +83     
==========================================
+ Hits        17791    17890      +99     
+ Misses        888      872      -16     
Impacted Files Coverage Δ
lib/bcdice/game_system/MeikyuKingdomBasic.rb 67.88% <ø> (ø)
lib/bcdice/game_system/BlindMythos.rb 99.41% <96.77%> (-0.59%) ⬇️
lib/bcdice/game_system/BattleTech.rb 98.95% <97.50%> (-0.45%) ⬇️
lib/bcdice/common_command/barabara_dice/node.rb 100.00% <100.00%> (ø)
lib/bcdice/common_command/barabara_dice/result.rb 100.00% <100.00%> (ø)
lib/bcdice/game_system.rb 100.00% <100.00%> (ø)
lib/bcdice/game_system/Emoklore.rb 95.00% <100.00%> (+0.35%) ⬆️
lib/bcdice/game_system/GardenOrder.rb 100.00% <100.00%> (ø)
lib/bcdice/game_system/KemonoNoMori.rb 100.00% <100.00%> (+2.00%) ⬆️
lib/bcdice/game_system/Nechronica.rb 100.00% <100.00%> (+2.15%) ⬆️
... and 14 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d5dffa9...b84e9f8. Read the comment docs.

@blhsrwznrghfzpr
Copy link
Contributor

目標値?でエラーが出ます
REPLでの実行結果

[Nechronica]> 1d10+1>=?
comparison of Integer with String failed
/path/to/BCDice/lib/bcdice/game_system/Nechronica.rb:54:in `>='
/path/to/BCDice/lib/bcdice/game_system/Nechronica.rb:54:in `result_nechronica'
/path/to/BCDice/lib/bcdice/game_system/Nechronica.rb:48:in `result_nd10'
/path/to/BCDice/lib/bcdice/base.rb:216:in `check_result'
/path/to/BCDice/lib/bcdice/common_command/add_dice/node.rb:65:in `eval'
/path/to/BCDice/lib/bcdice/base.rb:239:in `block in eval_common_command'
/path/to/BCDice/lib/bcdice/base.rb:238:in `each'
/path/to/BCDice/lib/bcdice/base.rb:238:in `eval_common_command'
/path/to/BCDice/lib/bcdice/base.rb:170:in `eval'
/path/to/BCDice/lib/bcdice/repl.rb:151:in `eval_game_system'
/path/to/BCDice/lib/bcdice/repl.rb:104:in `eval_command'
/path/to/BCDice/lib/bcdice/repl.rb:82:in `run_once'
/path/to/BCDice/lib/bcdice/repl.rb:64:in `block in run'
/path/to/BCDice/lib/bcdice/repl.rb:63:in `loop'
/path/to/BCDice/lib/bcdice/repl.rb:63:in `run'
./bin/repl.rb:21:in `<main>'

下記のようなテストケースを追加してください

game_system = "Nechronica"
input = "1D10+1>=? 目標値?でバグらない"

@GenKuzumochi
Copy link
Contributor Author

ありがとうございます、>=? 見落としていました!
ついでに早速prefix_numberを使うようにしました。

@ysakasin ysakasin self-requested a review May 12, 2021 11:19
@ysakasin
Copy link
Member

@GenKuzumochi ありがとうございます。気になる点があったため、こちらで修正を加えました。

@blhsrwznrghfzpr レビューありがとうございます。

@ysakasin ysakasin merged commit a587a56 into bcdice:master May 25, 2021
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.

3 participants