Closed ochaochaocha3 closed 3 years ago
以下のシステムで、repeat コマンドで蓄積する rand_results が使われていました。繰り返し実行したときに表示が乱れるかもしれません。
repeat
rand_results
https://github.com/bcdice/BCDice/blob/7c0b4e7c4cc617d8b096b1a27c86b5947d8aed5e/lib/bcdice/game_system/BattleTech.rb#L337-L339
これは私のミスでした。すぐ上の values が出目の配列なので、それを join すれば大丈夫でした。
values
join
https://github.com/bcdice/BCDice/blob/7c0b4e7c4cc617d8b096b1a27c86b5947d8aed5e/lib/bcdice/game_system/NinjaSlayer.rb#L177-L179
BarabaraDice::Result#rands 経由。このメソッドで Randomizer#rand_results の結果が返ります。
BarabaraDice::Result#rands
Randomizer#rand_results
元の実装より、BarabaraDice 扱いにするのは避けられなさそうです。そのため、対策として、加算ダイスのRandomizerと同様に BarabaraDice 内で最後の1回分の rand_results を BarabaraDice::Result に記録することが考えられました。
BarabaraDice
BarabaraDice::Result
https://github.com/bcdice/BCDice/blob/7c0b4e7c4cc617d8b096b1a27c86b5947d8aed5e/lib/bcdice/game_system/Yggdrasill.rb#L89-L91
すぐ上で AddDice::Randomizer を作っているので、それから rand_results をもってくれば問題ないでしょうか?
AddDice::Randomizer
全て修正できたのでクローズします!
以下のシステムで、
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_results
をBarabaraDice::Result
に記録することが考えられました。鋼鉄のユグドラシル
https://github.com/bcdice/BCDice/blob/7c0b4e7c4cc617d8b096b1a27c86b5947d8aed5e/lib/bcdice/game_system/Yggdrasill.rb#L89-L91
すぐ上で
AddDice::Randomizer
を作っているので、それからrand_results
をもってくれば問題ないでしょうか?