SRPG Studio

SRPG Studio

评价数不足
Dice-Power.js
   
奖励
收藏
已收藏
取消收藏
RESOURCES: plugin
文件大小
发表于
4.805 KB
2022 年 4 月 21 日 上午 7:52
1 项改动说明 ( 查看 )

订阅以下载
Dice-Power.js

描述
This script changes the damage formula to use a D&D-inspired Dice system; however, this is purely the damage at the moment.

By default, weapons will deal 1d4 damage. If you wish to change this, set the following custom parameters on weapon types. Weapons can also be set, and will override their weapon types.

{dice:1, damage:6}

The dice custom parameter is how many dice will be rolled. The damage custom parameter is how many sides each die will have - in effect, how much damage a single die can inflict at maximum.

So, the custom parameters above would deal 1d6 damage. Additionally, if you give your weapon a Might stat, that will be treated as bonus damage, so a Sword with these parameters and 3 Might will deal 1d6+3 damage.

You can also get this script on my GitHub![raw.githubusercontent.com]
The main repo can be found here![github.com]
6 条留言
Tarruvi 2023 年 11 月 15 日 上午 6:51 
That's alright, thanks though!
Maplewood  [作者] 2023 年 11 月 14 日 下午 4:28 
@Tarruvi
It's working as intended then. I haven't really had time or energy to work on this plugin in a long time, and I know it's incomplete; I wanted to replicate aspects of D&D 5e's combat formula.

If you'd like to edit it yourself you have my full permission.
Tarruvi 2023 年 11 月 11 日 下午 6:13 
This plugin is close to what I was looking for, but I'm having trouble adding a character's Strength value + the die's output, into an attack. Since it appears the damage being dealt is solely using the dice, without the Str value.

Is there a way to add the Str value into the equation?
VorpalJoe 2023 年 1 月 7 日 下午 9:10 
Thanks for the answer @Maplewood ! I wasn't expecting to have a positive answer since it seems to be the biggest pain for everyone trying to program it from scratch. I've seen glimpses of solution on the web that explained the mathematics, if I find anything back I'll post it there in case it might help you.

It was stuff like that, but more code-oriented : https://sciencing.com/calculate-dice-probabilities-5858157.html

Until then, have a nice one and keep on coding. :zomv:
Maplewood  [作者] 2023 年 1 月 1 日 上午 9:23 
@VorpalJoe this plugin is incredibly basic and really only changes the damage formula to slightly resemble 5e D&D, and I'm aware of some issues with it that I haven't been able to resolve yet.

The internal formula basically just uses JavaScript's math.random
VorpalJoe 2023 年 1 月 1 日 上午 8:42 
What kind of formula are you using to generate individual rolls for each die? I remember reading about it needing special rules to make sure the numbers made sense. I've been looking for something to simulate TabletopRPG mechanics, but nothing that was trying to be as close as possible to the real probabilities.

For example, would it be possible to extrapolate from your plugin to create effects related to certain dice combinations? For example; if 1-2-3 then X, if 6-6-6 then Y, etc.