class BCDice::GameSystem::SwordWorld2_0
Constants
- HELP_MESSAGE
ダイスボットの使い方
- ID
ゲームシステムの識別子
- NAME
ゲームシステム名
- SORT_KEY
ゲームシステム名の読みがな
Public Class Methods
new(command)
click to toggle source
Calls superclass method
BCDice::GameSystem::SwordWorld::new
# File lib/bcdice/game_system/SwordWorld2_0.rb, line 73 def initialize(command) super(command) @rating_table = 2 end
Public Instance Methods
eval_game_system_specific_command(command)
click to toggle source
Calls superclass method
BCDice::GameSystem::SwordWorld#eval_game_system_specific_command
# File lib/bcdice/game_system/SwordWorld2_0.rb, line 78 def eval_game_system_specific_command(command) case command when /^Gr(\d+)?/i if command =~ /^Gr(\d+)/i growth(Regexp.last_match(1).to_i) else growth end when /^2D6?@\d+/i transcendent_parser = Command::Parser.new(/2D6?/i, round_type: BCDice::RoundType::CEIL) .enable_critical .restrict_cmp_op_to(nil, :>=, :>) cmd = transcendent_parser.parse(command) unless cmd return nil end node = TranscendentTest.new(cmd.critical, cmd.modify_number, cmd.cmp_op, cmd.target_number) node.execute(@randomizer) when 'FT' get_fumble_table when 'TT' get_tangle_table else super(command) end end
get_ability_by_dice(dice)
click to toggle source
# File lib/bcdice/game_system/SwordWorld2_0.rb, line 135 def get_ability_by_dice(dice) ['器用度', '敏捷度', '筋力', '生命力', '知力', '精神力'][dice - 1] end
get_fumble_table()
click to toggle source
# File lib/bcdice/game_system/SwordWorld2_0.rb, line 139 def get_fumble_table() table = [ 'この表を2回振り、その両方を適用する。(同じ出目による影響は累積しない)。この自動失敗により得られる経験点は、+50点される', 'ダメージに、攻撃者を強化している「剣のかけら」の数が追加される', 'ダメージに、攻撃者の「レベル」が追加される', 'ダメージ決定を2回行い、より高い方を採用する', '合算ダメージを2倍する', '防護点無効' ] text, num = get_table_by_1d6(table) return "防御ファンブル表(#{num}) → #{text}" end
get_tangle_table()
click to toggle source
# File lib/bcdice/game_system/SwordWorld2_0.rb, line 152 def get_tangle_table() table = [ '頭や顔:牙や噛みつきなどにおける命中力判定及び、魔法の行使やブレスに-2のペナルティ修正を受ける', '武器や盾:武器の使用不可、又は盾の回避力修正及び防護点を無効化する', '腕や手:武器や爪などにおける命中力判定に-2のペナルティ修正、盾を持つ腕方の腕ならその盾の回避力修正及び防護点を無効化する', '脚や足:移動不可、更に回避力判定に-2のペナルティ修正を受ける ※両足に絡んでも累積しない', '胴体:生命・精神抵抗力を基準値に用いる判定を除き、あらゆる行為判定に-1のペナルティ修正を受ける', '特殊:尻尾や翼などに命中。絡められた部位を使用する判定において-2のペナルティ修正、またはそこが使えていたことによるボーナス修正を失う ※存在しない場合は決め直し' ] text, num = get_table_by_1d6(table) return "絡み効果表(#{num}) → #{text}" end
growth(count = 1)
click to toggle source
# File lib/bcdice/game_system/SwordWorld2_0.rb, line 121 def growth(count = 1) ((1..count).map { growth_step }).join " | " end
growth_step()
click to toggle source
# File lib/bcdice/game_system/SwordWorld2_0.rb, line 125 def growth_step d1 = @randomizer.roll_once(6) d2 = @randomizer.roll_once(6) a1 = get_ability_by_dice(d1) a2 = get_ability_by_dice(d2) return a1 != a2 ? "[#{d1},#{d2}]->(#{a1} or #{a2})" : "[#{d1},#{d2}]->(#{a1})" end
rating_parser()
click to toggle source
# File lib/bcdice/game_system/SwordWorld2_0.rb, line 107 def rating_parser return RatingParser.new(version: :v2_0) end
rollDice(command)
click to toggle source
Calls superclass method
BCDice::GameSystem::SwordWorld#rollDice
# File lib/bcdice/game_system/SwordWorld2_0.rb, line 111 def rollDice(command) unless command.greatest_fortune return super(command) end dice = @randomizer.roll_once(6) return dice * 2, "#{dice},#{dice}" end