Skip to content

Commit 645eb1a

Browse files
authored
Merge pull request #772 from FredGreenfield/RQG_add_simple_command
[RuneQuest:Roleplaying in Glorantha] 略記判定コマンドを追加
2 parents 968c6b0 + 3789f6f commit 645eb1a

File tree

2 files changed

+164
-6
lines changed

2 files changed

+164
-6
lines changed

lib/bcdice/game_system/RuneQuestRoleplayingInGlorantha.rb

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@ class RuneQuestRoleplayingInGlorantha < Base
1515
# ダイスボットの使い方
1616
HELP_MESSAGE = <<~MESSAGETEXT
1717
・判定コマンド 決定的成功、効果的成功、ファンブルを含めた判定を行う。
18-
RQG<=成功率
18+
RQG<=成功率 (基本書式)
19+
RQG成功率 (省略記法)
1920
20-
例1:RQG<=80 (技能値80で判定)
21+
例1:RQG<=80 (技能値80で判定)
2122
例2:RQG<=80+20 (技能値100で判定)
23+
例3:RQG80 (省略書式で技能値80の判定)
24+
例4:RQG80+20 (省略書式で技能値100の判定)
2225
2326
・抵抗判定コマンド(能動-受動) 決定的成功、効果的成功、ファンブルを含めた判定を行う。
2427
RES(能動能力-受動能力)m増強値
@@ -55,18 +58,18 @@ def eval_game_system_specific_command(command)
5558

5659
# 技能などの一般判定
5760
def do_ability_roll(command)
58-
m = %r{\A(RQG)(<=([+-/*\d]+))?$}.match(command)
61+
m = %r{\A(RQG)((<=)?([+-/*\d]+))?$}.match(command)
5962
unless m
6063
return nil
6164
end
6265

6366
roll_value = @randomizer.roll_once(100)
64-
unless m[3]
67+
unless m[4]
6568
# RQGのみ指定された場合は1d100を振ったのと同じ挙動
6669
return "(1D100) > #{roll_value}"
6770
end
6871

69-
ability_value = Arithmetic.eval(m[3], RoundType::ROUND)
72+
ability_value = Arithmetic.eval(m[4], RoundType::ROUND)
7073
result_prefix_str = "(1D100<=#{ability_value}) >"
7174

7275
if ability_value == 0

test/data/RuneQuestRoleplayingInGlorantha.toml

Lines changed: 156 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1467,7 +1467,7 @@ rands = [
14671467
# 98の出目は失敗
14681468
[[ test ]]
14691469
game_system = "RuneQuestRoleplayingInGlorantha"
1470-
input = "RSA11"
1470+
input = "RSA11"
14711471
output = "(1D100<=55) > 98 > 失敗\n決定的成功、効果的成功、ファンブルは未処理。必要なら確認すること。"
14721472
failure = true
14731473
rands = [
@@ -1494,6 +1494,161 @@ rands = [
14941494
{ sides = 100, value = 100 },
14951495
]
14961496

1497+
#======= RQG省略書式コマンド =======#
1498+
1499+
# 失敗(技能値0は判定できない=失敗とする)
1500+
[[ test ]]
1501+
game_system = "RuneQuestRoleplayingInGlorantha"
1502+
input = "RQG0"
1503+
output = "(1D100<=0) > 失敗"
1504+
failure = true
1505+
rands = [
1506+
{ sides = 100, value = 1 },
1507+
]
1508+
1509+
# 成功
1510+
[[ test ]]
1511+
game_system = "RuneQuestRoleplayingInGlorantha"
1512+
input = "RQG67"
1513+
output = "(1D100<=67) > 67 > 成功"
1514+
success = true
1515+
rands = [
1516+
{ sides = 100, value = 67 },
1517+
]
1518+
1519+
# 失敗
1520+
[[ test ]]
1521+
game_system = "RuneQuestRoleplayingInGlorantha"
1522+
input = "RQG67"
1523+
output = "(1D100<=67) > 68 > 失敗"
1524+
failure = true
1525+
rands = [
1526+
{ sides = 100, value = 68 },
1527+
]
1528+
1529+
# ファンブル(00の出目でファンブル)
1530+
[[ test ]]
1531+
game_system = "RuneQuestRoleplayingInGlorantha"
1532+
input = "RQG120"
1533+
output = "(1D100<=120) > 100 > ファンブル"
1534+
failure = true
1535+
fumble = true
1536+
rands = [
1537+
{ sides = 100, value = 100 },
1538+
]
1539+
1540+
# 決定的成功(境界の出目)
1541+
[[ test ]]
1542+
game_system = "RuneQuestRoleplayingInGlorantha"
1543+
input = "RQG70"
1544+
output = "(1D100<=70) > 4 > 決定的成功"
1545+
success = true
1546+
critical = true
1547+
rands = [
1548+
{ sides = 100, value = 4 },
1549+
]
1550+
1551+
# 決定的成功にならず効果的成功になる(境界の出目)
1552+
[[ test ]]
1553+
game_system = "RuneQuestRoleplayingInGlorantha"
1554+
input = "RQG70"
1555+
output = "(1D100<=70) > 5 > 効果的成功"
1556+
success = true
1557+
rands = [
1558+
{ sides = 100, value = 5 },
1559+
]
1560+
1561+
# 四則演算 全部入り(成功率40%)
1562+
[[ test ]]
1563+
game_system = "RuneQuestRoleplayingInGlorantha"
1564+
input = "RQG60*2/4+20-10"
1565+
output = "(1D100<=40) > 40 > 成功"
1566+
success = true
1567+
rands = [
1568+
{ sides = 100, value = 40 },
1569+
]
1570+
1571+
#======= RQG省略書式シークレットコマンド =======#
1572+
1573+
# 失敗(技能値0は判定できない=失敗とする)
1574+
[[ test ]]
1575+
game_system = "RuneQuestRoleplayingInGlorantha"
1576+
input = "SRQG0"
1577+
output = "(1D100<=0) > 失敗"
1578+
failure = true
1579+
secret = true
1580+
rands = [
1581+
{ sides = 100, value = 1 },
1582+
]
1583+
1584+
# 成功
1585+
[[ test ]]
1586+
game_system = "RuneQuestRoleplayingInGlorantha"
1587+
input = "SRQG67"
1588+
output = "(1D100<=67) > 67 > 成功"
1589+
success = true
1590+
secret = true
1591+
rands = [
1592+
{ sides = 100, value = 67 },
1593+
]
1594+
1595+
# 失敗
1596+
[[ test ]]
1597+
game_system = "RuneQuestRoleplayingInGlorantha"
1598+
input = "SRQG67"
1599+
output = "(1D100<=67) > 68 > 失敗"
1600+
failure = true
1601+
secret = true
1602+
rands = [
1603+
{ sides = 100, value = 68 },
1604+
]
1605+
1606+
# ファンブル(00の出目でファンブル)
1607+
[[ test ]]
1608+
game_system = "RuneQuestRoleplayingInGlorantha"
1609+
input = "SRQG120"
1610+
output = "(1D100<=120) > 100 > ファンブル"
1611+
failure = true
1612+
fumble = true
1613+
secret = true
1614+
rands = [
1615+
{ sides = 100, value = 100 },
1616+
]
1617+
1618+
# 決定的成功(境界の出目)
1619+
[[ test ]]
1620+
game_system = "RuneQuestRoleplayingInGlorantha"
1621+
input = "SRQG70"
1622+
output = "(1D100<=70) > 4 > 決定的成功"
1623+
success = true
1624+
critical = true
1625+
secret = true
1626+
rands = [
1627+
{ sides = 100, value = 4 },
1628+
]
1629+
1630+
# 決定的成功にならず効果的成功になる(境界の出目)
1631+
[[ test ]]
1632+
game_system = "RuneQuestRoleplayingInGlorantha"
1633+
input = "SRQG70"
1634+
output = "(1D100<=70) > 5 > 効果的成功"
1635+
success = true
1636+
secret = true
1637+
rands = [
1638+
{ sides = 100, value = 5 },
1639+
]
1640+
1641+
# 四則演算 全部入り(成功率40%)
1642+
[[ test ]]
1643+
game_system = "RuneQuestRoleplayingInGlorantha"
1644+
input = "SRQG60*2/4+20-10"
1645+
output = "(1D100<=40) > 40 > 成功"
1646+
success = true
1647+
secret = true
1648+
rands = [
1649+
{ sides = 100, value = 40 },
1650+
]
1651+
14971652
#===== バグ対応 ======#
14981653

14991654
#【技能540%の時、出目96以上で効果的成功になる問題対応】

0 commit comments

Comments
 (0)