esnya / bcdice-js Goto Github PK
View Code? Open in Web Editor NEW[DEPRECATED] BCDice for JavaScript (Browser/Node.js)
License: MIT License
[DEPRECATED] BCDice for JavaScript (Browser/Node.js)
License: MIT License
require('bcdice-js')
is too slow!!!
テスト通らないもの一覧
[
'_InsaneScp',
'ArsMagica',
'AceKillerGene',
'BloodMoon',
'Cthulhu7th',
'Cthulhu7th_Korean',
'DetatokoSaga',
'DetatokoSaga_Korean',
'Dracurouge',
'Dracurouge_Korean',
'EarthDawn3',
'EarthDawn4',
'EclipsePhase',
'Elysion',
'FilledWith',
'GardenOrder',
'GurpsFW',
'IthaWenUa',
'Kamigakari',
'KillDeathBusiness',
'KillDeathBusiness_Korean',
'MagicaLogia',
'MetalHeadExtream',
'OneWayHeroics',
'Oukahoushin3rd',
'Peekaboo',
'PlotTest',
'Ryutama',
'ShinMegamiTenseiKakuseihen',
'Skynauts',
'SwordWorld2_0',
'SwordWorld2_5',
'Warhammer',
'None',
'SevenFortressMobius',
'NightWizard',
'NightWizard3rd',
'Postman',
'StellarKnights',
]
クトゥルフ神話TRPGにおいて技能判定でよく用いる cc<=80
のような大小比較ができない。
どどんとふやBCDice-APIではできているため、bcdice-js固有の問題だと思われる。ねこ卓でも同様の問題が発生している。
const BCDice = require('bcdice-js').BCDice;
const bcdice = new BCDice();
bcdice.setGameByTitle('Cthulhu');
bcdice.setMessage('cc<=80');
console.log('cc<=80', bcdice.dice_command());
cc<=80 [ ': (1D100) > 67', false ]
(1D100<=80) > 71 > 成功
https://bcdice.herokuapp.com/v1/diceroll?system=Cthulhu&command=cc%3C=80
Cthulhu.rb
における cc
コマンドは、 1d100
のエイリアスおよび追加機能になっている。この判定は Cthulhu#getCheckResultで行なっており、大小比較があるかの判断もこのメソッド内で行なっている。
大小比較の存在判断は正規表現を用いて行われているが、bcdice-js経由だと、これらの判定をすり抜けてしまっているように見える。
https://github.com/torgtaitai/BCDice/blob/e52a91ffe5ad7db35c651a18e0ffe8025be266f7/src/diceBot/Cthulhu.rb#L100
こんにちは、bcdice-jsの使用者です。
このプロジェクトはとても便利だと思います。
しかし、node.jsに対するK40+24@8$12r10gfの結果は怪しい。
そして、ダイス目の修正は働いていないようです。
r10が含まれていると、結果は常に1です。
bcdice.setGameByTitle('SwordWorld2_5');
bcdice.setMessage('K20R10');
console.log('K20R10', bcdice.dice_command());
(初めの時がSwordWorldを使用したら大丈夫です
bcdice.setGameByTitle('SwordWorld');
bcdice.setMessage('K40+24@8$12r10gf ');
console.log('K40+24@8$12r10gf ', bcdice.dice_command());)
例
5dx@7
クリティカル値が参照されない5dx+2@7
クリティカル値は参照されるが 補正値が参照されない5dx@7+2
クリティカル値、補正値 両方が参照されない
Hi, i am the user of bcdice-js.
Thank you for your project.
It is very useful.
But I have try K40+24@8$12r10gf on node.js
it just return 1
and ダイス目の修正 seem dont work.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.