bcdice 3.8.0 → 3.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -125,7 +125,7 @@ module BCDice
125
125
  "自然の猛威\n飛空艇は「D/4」のダメージを受ける。このダメージに《回避運動》のスキル効果を使用することはできない。\n 『塔』の上の人間は、いつか自然を人間が支配するときが来ると思っている。自然の力を身を以て体感する探空士に、そんな考えをもっているヤツはいない。",
126
126
  "シケ\n次のシーンでは、シーンプレイヤーは航行チェックを行うことができず、「操舵に専念する」を宣言することもできない。\n ぽつり、ぽつりと窓に雨粒が滴り落ちる。こうなってしまえば、フネを進めることはできない。この間に紅茶を1杯、というのもいいだろう。……ティータイムには生憎の空模様だがね。",
127
127
  "落雷\n飛空艇は「D/3」のダメージを受ける。このダメージに《回避運動》のスキル効果を使用することはできない。\n 突如、飛空艇を轟音と、閃光が包む。何事か、とキミが周囲を確認するより先に、フネに稲妻がほとばしり、どこかが焼ける焦げ臭い匂いが、キミの鼻腔をつく。これはまずいぞ。はやくこの空域を抜けるんだ!",
128
- "ゲリラ豪雨\n飛空艇は「D/3」のダメージを受ける。\n 暴風に呑まれまいと、出力最大で風雨を振り切る。エンジンは赤熱し、吐き出す蒸気が機関室を白く染める。……もってくれよ。こんなところで空に頬りだされるのはゴメンだ。",
128
+ "ゲリラ豪雨\n飛空艇は「D/3」のダメージを受ける。\n 暴風に呑まれまいと、出力最大で風雨を振り切る。エンジンは赤熱し、吐き出す蒸気が機関室を白く染める。……もってくれよ。こんなところで空に放り出されるのはゴメンだ。",
129
129
  "嵐の前触れ\n次のシーンでは、スポットのイベントタイプや、「その場に留まる」を宣言したかどうかにかかわらず、航行イベントを「航行イベント表:困難系」を使用して決定する。\n 突然目の前に現れたどす黒い雲。気圧計の針がみるみるうちに下がっていき、キミたちに不穏な前触れを告げる。これは、覚悟を決めなければならないかもしれない……。",
130
130
  "シケ\n次のシーンでは、シーンプレイヤーは航行チェックを行うことができず、「操舵に専念する」を宣言することもできない。\n ぽつり、ぽつりと窓に雨粒が滴り落ちる。こうなってしまえば、フネを進めることはできない。この間に紅茶を1杯、というのもいいだろう。……ティータイムには生憎の空模様だがね。",
131
131
  "気流+2\n飛空艇コマを2スポット分進める。\n このあたりは危険な空域らしいが、このくらいの風を則こなせなければ、プロとは言えない。事実、キミはそれをやってのけた。これが、探空士の仕事ぶりというものさ。",
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bcdice/game_system/SRS'
4
+
5
+ module BCDice
6
+ module GameSystem
7
+ class TenkaRyouran < SRS
8
+ # ゲームシステムの識別子
9
+ ID = 'TenkaRyouran'
10
+
11
+ # ゲームシステム名
12
+ NAME = '天下繚乱'
13
+
14
+ # ゲームシステム名の読みがな
15
+ SORT_KEY = 'てんかりようらん'
16
+
17
+ # 固有のコマンドの接頭辞を設定する
18
+ register_prefix('2D6', 'TR')
19
+
20
+ # 成功判定のエイリアスコマンドを設定する
21
+ set_aliases_for_srs_roll('TR')
22
+
23
+ HELP_MESSAGE = help_message()
24
+ end
25
+ end
26
+ end
@@ -14,49 +14,63 @@ module BCDice
14
14
 
15
15
  # ダイスボットの使い方
16
16
  HELP_MESSAGE = <<~MESSAGETEXT
17
- ・判定コマンド(nVMFx+x)
18
- 注意:Hungerダイスは内数として処理する。
19
- 例:9ダイスプールでHungerダイス3個ならば、通常ダイス6個、Hungerダイス3個となる。
20
- また、難易度は必要成功数を表す。
17
+ ・判定コマンド(nVMFx+x または nVMIxHx)
18
+ VMFコマンドはHungerダイスとダイスプールを個別に指定する。
19
+ VMIコマンドはHungerダイスをダイスプールの内数として指定する。
20
+
21
+ 例:難易度2、9ダイスプールでHungerダイス3個の場合、それぞれ以下のようなコマンドとなる。
22
+ 2VMF6+3
23
+ 2VMI9H3
21
24
 
22
25
  難易度指定:成功数のカウント、判定成功と失敗、Critical処理、Critical Winのチェックを行う
23
26
  (Hungerダイスがある場合)Messy CriticalとBestial Failureチェックを行う
24
27
  例) (難易度)VMF(通常ダイス)+(Hungerダイス)
25
28
  (難易度)VMF(通常ダイス)
29
+ (難易度)VMI(通常ダイス)H(Hungerダイス)
30
+ (難易度)VMI(通常ダイス)
26
31
 
27
32
  難易度省略:成功数のカウント、判定失敗、Critical処理、(Hungerダイスがある場合)Bestial Failureチェックを行う
28
33
  判定成功、Messy Criticalのチェックを行わない
29
34
  Critical Win、(Hungerダイスがある場合)Bestial Failure、Messy Criticalのヒントを出力
30
35
  例) VMF(通常ダイス)+(Hungerダイス)
31
36
  VMF(通常ダイス)
37
+ VMI(通常ダイス)H(Hungerダイス)
38
+ VMI(通常ダイス)
32
39
 
33
40
  難易度0指定:Critical処理と成功数のカウントを行い、全てのチェックを行わない
34
41
  例) 0VMF(通常ダイス)+(Hungerダイス)
35
42
  0VMF(通常ダイス)
43
+ 0VMI(通常ダイス)+(Hungerダイス)
44
+ 0VMI(通常ダイス)
36
45
 
37
46
  MESSAGETEXT
38
47
 
39
- DIFFICULTY_INDEX = 1
40
- DICE_POOL_INDEX = 3
41
- HUNGER_DICE_INDEX = 5
48
+ DIFFICULTY_INDEX = 1
49
+ DICE_POOL_HUNGER_DICE_NO_INCLUDED_INDEX = 5
50
+ HUNGER_DICE_NO_INCLUDED_INDEX = 7
51
+ COMMAND_HUNGER_DICE_INCLUDED_INDEX = 9
52
+ DICE_POOL_HUNGER_DICE_INCLUDED_INDEX = 10
53
+ HUNGER_DICE_INCLUDED_INDEX = 12
42
54
 
43
55
  # 難易度に指定可能な特殊値
44
56
  NOT_CHECK_SUCCESS = -1 # 判定成功にかかわるチェックを行わない(判定失敗に関わるチェックは行う)
45
57
 
46
- # ダイスボットで使用するコマンドを配列で列挙する
47
- register_prefix('\d*VMF')
58
+ register_prefix('\d*(VMF|(VMI\d*(H\d?)?))')
48
59
 
49
60
  def eval_game_system_specific_command(command)
50
- m = /\A(\d+)?(VMF)(\d+)(\+(\d+))?$/.match(command)
61
+ m = /\A(\d+)?(((VMF)(\d)(\+(\d+))?)|((VMI)(\d)(H(\d+))?))$/.match(command)
51
62
  unless m
52
63
  return ''
53
64
  end
54
65
 
55
- dice_pool = m[DICE_POOL_INDEX].to_i
66
+ dice_pool, hunger_dice_pool = get_dice_pools(m)
67
+ if dice_pool < 0
68
+ return "ダイスプールより多いHungerダイスは指定できません。"
69
+ end
70
+
56
71
  dice_text, success_dice, ten_dice, = make_dice_roll(dice_pool)
57
72
  result_text = "(#{dice_pool}D10"
58
73
 
59
- hunger_dice_pool = m[HUNGER_DICE_INDEX]&.to_i
60
74
  if hunger_dice_pool
61
75
  hunger_dice_text, hunger_success_dice, hunger_ten_dice, hunger_botch_dice = make_dice_roll(hunger_dice_pool)
62
76
 
@@ -79,6 +93,20 @@ module BCDice
79
93
 
80
94
  private
81
95
 
96
+ def get_dice_pools(m)
97
+ hunger_dice_included_command = m[COMMAND_HUNGER_DICE_INCLUDED_INDEX]
98
+ if hunger_dice_included_command && hunger_dice_included_command == "VMI"
99
+ # Hunger Diceを内数処理するの場合
100
+ hunger_dice_pool = m[HUNGER_DICE_INCLUDED_INDEX]&.to_i
101
+ dice_pool = m[DICE_POOL_HUNGER_DICE_INCLUDED_INDEX].to_i - (hunger_dice_pool || 0)
102
+ else
103
+ # Hunger DiceがPLによる内数指定の場合
104
+ hunger_dice_pool = m[HUNGER_DICE_NO_INCLUDED_INDEX]&.to_i
105
+ dice_pool = m[DICE_POOL_HUNGER_DICE_NO_INCLUDED_INDEX].to_i
106
+ end
107
+ return dice_pool, hunger_dice_pool
108
+ end
109
+
82
110
  def get_roll_result(result_text, success_dice, ten_dice, hunger_ten_dice, hunger_botch_dice, difficulty)
83
111
  result_text = "#{result_text} 成功数=#{success_dice}"
84
112
  is_critical = ten_dice >= 2
@@ -0,0 +1,133 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bcdice/base'
4
+
5
+ module BCDice
6
+ module GameSystem
7
+ class Ventangle < Base
8
+ # ゲームシステムの識別子
9
+ ID = 'Ventangle'
10
+
11
+ # ゲームシステム名
12
+ NAME = 'Ventangle'
13
+
14
+ # ゲームシステム名の読みがな
15
+ #
16
+ # 「ゲームシステム名の読みがなの設定方法」(docs/dicebot_sort_key.md)を参考にして
17
+ # 設定してください
18
+ SORT_KEY = 'うえんたんくる'
19
+
20
+ # ダイスボットの使い方
21
+ HELP_MESSAGE = <<~MESSAGETEXT
22
+ 基本書式 VTn@s#f$g>=T n=ダイス数(省略時2) s=スペシャル値(省略時12) f=ファンブル値(省略時2) g=レベルギャップ判定値(省略可) T=目標値(省略可)
23
+
24
+ 例:
25
+ VT デフォルトのスペシャル値・ファンブル値の判定を行う
26
+ VT@10#3 スペシャル値10、ファンブル値3の判定を行う
27
+ VT3@10#3 スペシャル値10、ファンブル値3の判定を、アドバンテージを1点消費してダイス3つで行う
28
+
29
+ VT>=5 デフォルトのスペシャル値・ファンブル値で目標値5の判定を行う
30
+ VT@10#3>=5 スペシャル値10、ファンブル値3で目標値5の判定を行う
31
+ VT@10#3$5>=5 スペシャル値10、ファンブル値3で目標値5の判定を行う。この際達成値が目標値より5以上大きい場合、ギャップボーナスを表示する
32
+ VT3@10#3>=5 スペシャル値10、ファンブル値3で目標値5の判定を、アドバンテージを1点消費してダイス3つで行う
33
+ VT3@10#3$4>=5 スペシャル値10、ファンブル値3で目標値5の判定を、アドバンテージを1点消費してダイス3つで行う。この際達成値が目標値より4以上大きい場合、ギャップボーナスを表示する
34
+ MESSAGETEXT
35
+
36
+ # 既定のスペシャル値
37
+ DEFAULT_SPECIAL_VALUE = 12
38
+ # 既定のファンブル値
39
+ DEFAULT_FUMBLE_VALUE = 2
40
+ # 規定のダイス個数
41
+ DEFAULT_DICE_NUM = 2
42
+
43
+ # ダイスボットで使用するコマンドを配列で列挙する
44
+ register_prefix('VT')
45
+
46
+ def eval_game_system_specific_command(command)
47
+ debug("eval_game_system_specific_command Begin")
48
+
49
+ parser = Command::Parser.new('VT', round_type: round_type)
50
+ .enable_critical
51
+ .enable_fumble
52
+ .enable_dollar
53
+ .enable_suffix_number
54
+ .restrict_cmp_op_to(nil, :>=)
55
+ cmd = parser.parse(command)
56
+
57
+ unless cmd
58
+ return nil
59
+ end
60
+
61
+ dice_num = cmd.suffix_number || DEFAULT_DICE_NUM
62
+ if dice_num < DEFAULT_DICE_NUM
63
+ return nil
64
+ end
65
+
66
+ dice_list = @randomizer.roll_barabara(dice_num, 6)
67
+ if dice_num > 2
68
+ # 出目の順序を保存して上位2つの出目を取得
69
+ j = 0 # 安定ソートのために利用 cf. https://docs.ruby-lang.org/ja/latest/method/Enumerable/i/sort_by.html
70
+ using_list = dice_list.map.with_index { |x, i| {index: i, value: x} }
71
+ .sort_by { |x| [x[:value], j += 1] }.reverse.take(2)
72
+ .sort_by { |x| x[:index] }.map { |x| x[:value] }
73
+ else
74
+ using_list = dice_list
75
+ end
76
+ dice_total = using_list.sum
77
+ total = dice_total + cmd.modify_number
78
+
79
+ result = compare(dice_total, total, cmd)
80
+
81
+ advantage_str =
82
+ if dice_num > 2
83
+ using_list.to_s
84
+ end
85
+
86
+ modifier_str =
87
+ if cmd.modify_number > 0
88
+ "#{dice_total}#{Format.modifier(cmd.modify_number)}"
89
+ end
90
+
91
+ level_gap_str =
92
+ if cmd.target_number && cmd.dollar && result.success? && (gap = total - cmd.target_number) >= cmd.dollar
93
+ "ギャップボーナス(#{gap})"
94
+ end
95
+
96
+ sequence = [
97
+ cmd.to_s,
98
+ dice_list.to_s,
99
+ advantage_str,
100
+ modifier_str,
101
+ total.to_s,
102
+ result.text,
103
+ level_gap_str,
104
+ ].compact
105
+
106
+ result.text = sequence.join(" > ")
107
+
108
+ return result
109
+ end
110
+
111
+ def compare(dice_total, total, cmd)
112
+ special = cmd.critical || DEFAULT_SPECIAL_VALUE
113
+ fumble = cmd.fumble || DEFAULT_FUMBLE_VALUE
114
+
115
+ if dice_total <= fumble
116
+ return Result.fumble('ファンブル')
117
+ elsif dice_total >= special
118
+ return Result.critical('スペシャル')
119
+ end
120
+
121
+ if cmd.target_number
122
+ if total.send(cmd.cmp_op, cmd.target_number)
123
+ return Result.success('成功')
124
+ else
125
+ return Result.failure('失敗')
126
+ end
127
+ else
128
+ return Result.new(nil)
129
+ end
130
+ end
131
+ end
132
+ end
133
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bcdice/game_system/Bloodorium"
4
+
5
+ module BCDice
6
+ module GameSystem
7
+ class WorldsEndFrontline < Bloodorium
8
+ # ゲームシステムの識別子
9
+ ID = 'WorldsEndFrontline'
10
+
11
+ # ゲームシステム名
12
+ NAME = 'ワールドエンドフロントライン'
13
+
14
+ # ゲームシステム名の読みがな
15
+ SORT_KEY = 'わあるとえんとふろんとらいん'
16
+
17
+ register_prefix_from_super_class()
18
+ end
19
+ end
20
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module BCDice
2
4
  module GameSystem
3
5
  class Cthulhu7th < Base
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "bcdice/result"
2
4
  require "bcdice/translate"
3
5
 
@@ -100,6 +100,7 @@ require "bcdice/game_system/GURPS"
100
100
  require "bcdice/game_system/GurpsFW"
101
101
  require "bcdice/game_system/HarnMaster"
102
102
  require "bcdice/game_system/HatsuneMiku"
103
+ require "bcdice/game_system/HeroScale"
103
104
  require "bcdice/game_system/Hieizan"
104
105
  require "bcdice/game_system/HouraiGakuen"
105
106
  require "bcdice/game_system/HuntersMoon"
@@ -211,6 +212,7 @@ require "bcdice/game_system/SwordWorld_SimplifiedChinese"
211
212
  require "bcdice/game_system/SwordWorld2_0_SimplifiedChinese"
212
213
  require "bcdice/game_system/SwordWorld2_5_SimplifiedChinese"
213
214
  require "bcdice/game_system/TalesFromTheLoop"
215
+ require "bcdice/game_system/TenkaRyouran"
214
216
  require "bcdice/game_system/TherapieSein"
215
217
  require "bcdice/game_system/TokumeiTenkousei"
216
218
  require "bcdice/game_system/TokyoGhostResearch"
@@ -225,6 +227,7 @@ require "bcdice/game_system/TwilightGunsmoke"
225
227
  require "bcdice/game_system/UnsungDuet"
226
228
  require "bcdice/game_system/Utakaze"
227
229
  require "bcdice/game_system/VampireTheMasquerade5th"
230
+ require "bcdice/game_system/Ventangle"
228
231
  require "bcdice/game_system/Villaciel"
229
232
  require "bcdice/game_system/VisionConnect"
230
233
  require "bcdice/game_system/WARPS"
@@ -233,6 +236,7 @@ require "bcdice/game_system/Warhammer"
233
236
  require "bcdice/game_system/Warhammer4"
234
237
  require "bcdice/game_system/WitchQuest"
235
238
  require "bcdice/game_system/WorldOfDarkness"
239
+ require "bcdice/game_system/WorldsEndFrontline"
236
240
  require "bcdice/game_system/YankeeYogSothoth"
237
241
  require "bcdice/game_system/YearZeroEngine"
238
242
  require "bcdice/game_system/Yggdrasill"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BCDice
4
- VERSION = "3.8.0"
4
+ VERSION = "3.10.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bcdice
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.8.0
4
+ version: 3.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - SAKATA Sinji
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-18 00:00:00.000000000 Z
11
+ date: 2023-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -237,6 +237,7 @@ files:
237
237
  - lib/bcdice/game_system/GurpsFW.rb
238
238
  - lib/bcdice/game_system/HarnMaster.rb
239
239
  - lib/bcdice/game_system/HatsuneMiku.rb
240
+ - lib/bcdice/game_system/HeroScale.rb
240
241
  - lib/bcdice/game_system/Hieizan.rb
241
242
  - lib/bcdice/game_system/HouraiGakuen.rb
242
243
  - lib/bcdice/game_system/HunterTheReckoning5th.rb
@@ -348,6 +349,7 @@ files:
348
349
  - lib/bcdice/game_system/SwordWorld2_5_SimplifiedChinese.rb
349
350
  - lib/bcdice/game_system/SwordWorld_SimplifiedChinese.rb
350
351
  - lib/bcdice/game_system/TalesFromTheLoop.rb
352
+ - lib/bcdice/game_system/TenkaRyouran.rb
351
353
  - lib/bcdice/game_system/TherapieSein.rb
352
354
  - lib/bcdice/game_system/TokumeiTenkousei.rb
353
355
  - lib/bcdice/game_system/TokyoGhostResearch.rb
@@ -362,6 +364,7 @@ files:
362
364
  - lib/bcdice/game_system/UnsungDuet.rb
363
365
  - lib/bcdice/game_system/Utakaze.rb
364
366
  - lib/bcdice/game_system/VampireTheMasquerade5th.rb
367
+ - lib/bcdice/game_system/Ventangle.rb
365
368
  - lib/bcdice/game_system/Villaciel.rb
366
369
  - lib/bcdice/game_system/VisionConnect.rb
367
370
  - lib/bcdice/game_system/WARPS.rb
@@ -370,6 +373,7 @@ files:
370
373
  - lib/bcdice/game_system/Warhammer4.rb
371
374
  - lib/bcdice/game_system/WitchQuest.rb
372
375
  - lib/bcdice/game_system/WorldOfDarkness.rb
376
+ - lib/bcdice/game_system/WorldsEndFrontline.rb
373
377
  - lib/bcdice/game_system/YankeeYogSothoth.rb
374
378
  - lib/bcdice/game_system/YearZeroEngine.rb
375
379
  - lib/bcdice/game_system/Yggdrasill.rb
@@ -448,7 +452,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
448
452
  - !ruby/object:Gem::Version
449
453
  version: '0'
450
454
  requirements: []
451
- rubygems_version: 3.4.5
455
+ rubygems_version: 3.4.12
452
456
  signing_key:
453
457
  specification_version: 4
454
458
  summary: BCDice is a rolling dice engine for TRPG