Skip to content

Commit

Permalink
プラグイン Detatoko 修正
Browse files Browse the repository at this point in the history
* "constracts.rb"において、コピー元のファイルから消し忘れた要らない部分を削除した。
* ".ds"コマンドにおいて、フラグを指定しなおかつ判定値がフラグ以下だった場合の出力を2行に分けた。
  • Loading branch information
koi-chan committed Mar 14, 2015
1 parent 5b34eba commit fb2274d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
7 changes: 0 additions & 7 deletions lib/rgrb/plugin/detatoko/constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@ module Plugin
module Detatoko
# コマンドのパターンの最後を表す正規表現
END_RE = /(?:[\s ]|$)/

# 表名を表す正規表現
TABLE_RE = /[-_0-9A-Za-z]+/
# 表のリストを表す正規表現
TABLES_RE = /(#{TABLE_RE}(?: +#{TABLE_RE})*)/o
# 変数を表す正規表現
VARIABLE_RE = /%%(#{TABLE_RE})%%/o
end
end
end
6 changes: 3 additions & 3 deletions lib/rgrb/plugin/detatoko/generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ def skill_decision(skill_rank, calc, solid, flag)
message << " = "
message << eval("#{decision.to_f} #{calc} #{solid}").ceil.to_s
unless flag == 0
message << " (フラグ:#{flag}"
message << " (フラグ:#{flag})"
if decision <= flag
message << " 気力ダメージ発生:#{@random.rand(1..6)}"
message << "\n" \
"フラグ以下 -> 気力ダメージ = #{@random.rand(1..6)}"
end
message << ")"
end

message
Expand Down
7 changes: 4 additions & 3 deletions lib/rgrb/plugin/detatoko/irc_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ def initialize(*args)
# スキルランクから判定値を得る
# @return [void]
def skill_decision(m, skill_rank, calc = '+', solid = 0, flag = 0)
header = "#{@header}[#{m.user.nick}]<判定値>: "
message = @generator.skill_decision(skill_rank.to_i, calc, solid.to_i, flag.to_i)
m.target.send(header + message, true)
header = "#{@header}[#{m.user.nick}]: "
@generator.skill_decision(skill_rank.to_i, calc, solid.to_i, flag.to_i).each_line { |line|
m.target.send(header + line.chomp, true)
}
end

# skill_decision の固定値なし・フラグあり用ラッパー
Expand Down

0 comments on commit fb2274d

Please sign in to comment.