bcdice / BCDice

The most popular TRPG dice command engine in Japan
https://bcdice.org
BSD 3-Clause "New" or "Revised" License
138 stars 183 forks source link

repeatコマンドで蓄積するrand_resultsを使うシステムがある #467

Closed ochaochaocha3 closed 3 years ago

ochaochaocha3 commented 3 years ago

以下のシステムで、repeat コマンドで蓄積する rand_results が使われていました。繰り返し実行したときに表示が乱れるかもしれません。

バトルテック

https://github.com/bcdice/BCDice/blob/7c0b4e7c4cc617d8b096b1a27c86b5947d8aed5e/lib/bcdice/game_system/BattleTech.rb#L337-L339

これは私のミスでした。すぐ上の values が出目の配列なので、それを join すれば大丈夫でした。

ニンジャスレイヤーTRPG

https://github.com/bcdice/BCDice/blob/7c0b4e7c4cc617d8b096b1a27c86b5947d8aed5e/lib/bcdice/game_system/NinjaSlayer.rb#L177-L179

BarabaraDice::Result#rands 経由。このメソッドで Randomizer#rand_results の結果が返ります。

元の実装より、BarabaraDice 扱いにするのは避けられなさそうです。そのため、対策として、加算ダイスのRandomizerと同様に BarabaraDice 内で最後の1回分の rand_resultsBarabaraDice::Result に記録することが考えられました。

鋼鉄のユグドラシル

https://github.com/bcdice/BCDice/blob/7c0b4e7c4cc617d8b096b1a27c86b5947d8aed5e/lib/bcdice/game_system/Yggdrasill.rb#L89-L91

すぐ上で AddDice::Randomizer を作っているので、それから rand_results をもってくれば問題ないでしょうか?

ysakasin commented 3 years ago

全て修正できたのでクローズします!