stobbsm / diceroll
掷任意大小的骰子
0.0.1
2016-07-23 05:54 UTC
Requires
- php: ^7.0
Requires (Dev)
- phpunit/phpunit: 5.4.7
This package is not auto-updated.
Last update: 2024-09-14 19:36:46 UTC
README
这是一个PHP类,用于在基于骰子的RPG中使用掷骰子,甚至只是掷骰子。
这个简单的库包含一个易于扩展的抽象类"Die",可以将D&D骰子字符串(d6+5,1d4,2d12等)解析为RPG中使用的作用。
最终,这将与其他我正在制作的软件配合使用,以便通过互联网轻松查看结果来运行一场活动。
安装
Composer - 在您的"require"部分中添加stobbsm/diceroll。
更新日志
-
0.0.1 - 初次发布
初始功能
- 7种可用的基本骰子大小(d4,d6,d8,d10,d12,d20,d100)
- 基本骰子字符串解析。例如:2d4+2将掷2个骰子,其值为1到4之间,然后加2到结果,最小值为4,最大值为10。
- 一个非常基础的命令行工具rolldice,可以一次性接受多个骰子字符串,并可选择以更可解析和可预测的格式输出。(我将用它来为一些愚蠢的游戏编写shell脚本)。
待办事项
- 消除从基类"Die"继承的类的奇怪使用来控制范围。这很丑,但我首先想要做一些可行和可预测的事情。要了解我的意思,请浏览源代码并查看"Dice"目录下的类。非常笨拙。
- 运行一些基准测试并优化我所做的,以使掷骰子不会拖慢运行在服务器上的速度。
版权
diceroll - 基于 PHP 的 RPG 骰子掷骰器
版权所有(C)2016 Matthew Stobbs matthew@sproutingcommunications.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://gnu.ac.cn/licenses/>.
许可协议为GNU通用公共许可证v3.0 (GPLv3)