Skip to content

Commit

Permalink
feat(generate-npc): 新增了对骰子表达式的支持
Browse files Browse the repository at this point in the history
  • Loading branch information
Raven-Book committed Sep 22, 2024
1 parent 74335bb commit 8601c4b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 26 deletions.
40 changes: 18 additions & 22 deletions docs/src/黑星的Macro合集/宏列表 第一弹.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,23 @@ setup.profiles = {
last: ['Smith', 'Doe', 'Johnson', 'Williams'], // 姓氏列表
favorite: ['蛋糕', '牛排', '香蕉'], // 喜欢的食物列表
race: [
{
value: "精灵",
prob: 0.5, // 概率50%
affects: {agility: 2}, // 增加2点敏捷
limits: {agility: {min: 5, max: 10}, strength: {min: 0, max: 5}} // 敏捷上下限5/10,力量上下限0/5
},
{
value: "侏儒",
prob: 0.5, // 概率50%
affects: {strength: -2}, // 减少2点力量
limits: {agility: {min: 0, max: 8}, strength: {min: -5, max: 5}} // 敏捷上下限0/8,力量上下限-5/5
}
],
{
value: '巨人',
prob: 0.02 // 巨人,用于测试expr
},
{
value: "精灵",
prob: 0.49, // 概率49%
affects: {agility: 2}, // 增加2点敏捷
limits: {agility: {min: 5, max: 10}, strength: {min: 0, max: 5}} // 敏捷上下限5/10,力量上下限0/5
},
{
value: "侏儒",
prob: 0.49, // 概率49%
affects: {strength: -2}, // 减少2点力量
limits: {agility: {min: 0, max: 8}, strength: {min: -5, max: 5}} // 敏捷上下限0/8,力量上下限-5/5
}
],
itinerary: [
'list', // 未支持格式,当前情况做占位符。如果缺少占位符,无法随机object。
{AM0700: "食堂", AM0800: "商业街"},
Expand All @@ -88,19 +92,11 @@ setup.profiles = {
};

setup.attrs = {
strength: {expr: "3d6*5"}, // 骰3个6面骰其结果成为5,无上下限限制
intelligence: {
min: 1,
max: 10 // 智力上下限1/10
},
strength: {
min: 1,
max: 10, // 力量上下限1/10
ranges: [
{min: 1, max: 3, prob: 0.3}, // 力量范围 1-3,概率 30%
{min: 4, max: 8, prob: 0.6}, // 力量范围 4-8,概率 60%
{min: 9, max: 10, prob: 0.1} // 力量范围 9-10,概率 10%
]
},
agility: {
min: 1,
max: 10, // 敏捷上下限1/10
Expand Down
4 changes: 2 additions & 2 deletions src/js/utils/generate-npc.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/js/utils/macro-utils.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8601c4b

Please sign in to comment.