差分
ナビゲーションに移動
検索に移動
157行目:
157行目:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
0ヴ (トーク) による版 176 を取り消し
</syntaxhighlight>
</syntaxhighlight>
== setCollectRandResult ==
https://github.com/torgtaitai/BCDice/blob/86b8dd03ae00f8ea6a8787f9f514a5d83b2e3d41/src/bcdiceCore.rb#L1046-L1052
出目を記録するかどうかを設定するメソッドのようだが、実際には、引数 <code>b</code> に <code>true</code> を設定すると記録スロットを初期化するという動作になっている。<code>false</code> を設定すると記録スロットが <code>nil</code> でクリアされる。
<syntaxhighlight lang="ruby">
def setCollectRandResult(b)
if( b )
@randResults = []
else
@randResults = nil
end
end
</syntaxhighlight>
== dice_command ==
https://github.com/torgtaitai/BCDice/blob/86b8dd03ae00f8ea6a8787f9f514a5d83b2e3d41/src/bcdiceCore.rb#L769-L801
ダイスロールを実行する。以下の順で、実行できる処理があればそれを実行し、できなければ次の処理を試すことを繰り返す。
# 指定されたゲームシステムの固有コマンド
# D66ロール
# 加算ロール <code><var>x</var>D<var>n</var></code>
# バラバラロール <code><var>x</var>B<var></var></code>
# 個数振り足しロール <code><var>x</var>R<var>n</var></code>
# 上方無限ロール <code><var>x</var>U<var>n</var></code>
# ランダム選択 <code>choice[<var>A</var>, <var>B</var>, ...]</code>
# 独自の表から項目を引く
戻り値は、結果のメッセージと、シークレットロールかどうか。すべての処理に失敗した場合は結果のメッセージが <code>"1"</code> となることに注意。これはPerl時代の名残りと思われる。
<syntaxhighlight lang="ruby">
def dice_command # ダイスコマンドの分岐処理
arg = @message.upcase
debug('dice_command arg', arg)
output, secret = @diceBot.dice_command(@message, @nick_e)
return output, secret if( output != '1' )
output, secret = rollD66(arg)
return output, secret unless( output.nil? )
output, secret = checkAddRoll(arg)
return output, secret unless( output.nil? )
output, secret = checkBDice(arg)
return output, secret unless( output.nil? )
output, secret = checkRnDice(arg)
return output, secret unless( output.nil? )
output, secret = checkUpperRoll(arg)
return output, secret unless( output.nil? )
output, secret = checkChoiceCommand(arg)
return output, secret unless( output.nil? )
output, secret = getTableDataResult(arg)
return output, secret unless( output.nil? )
output = '1'
secret = false
return output, secret
end
</syntaxhighlight>
{{DEFAULTSORT:BCDice くらす}}
{{DEFAULTSORT:BCDice くらす}}
[[Category:BCDice/内部処理]]
[[Category:BCDice/内部処理]]