th3mouk / pokemongo-iv-calc
计算精灵宝可梦Go IV的最准确PHP库
1.7.0
2017-10-30 16:01 UTC
Requires
- php: ^7.1
- symfony/console: ^3.2
- tightenco/collect: ^5.3
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.0
- peridot-php/leo: ^1.6
- peridot-php/peridot: ^1.18
README
这个PHP库是计算宝可梦IV值最准确的。
安装
composer require th3mouk/pokemongo-iv-calc
使用方法
从命令行
php bin/ivcalculator calculate bulbasaur 515 59 2500 4 3 def php bin/ivcalculator calculate bulbasaur xxx xx 2500 4 3 def atk hp
使用类
$pokemon = (new Calculator())->calculate( $input->getArgument('name'), (int) $input->getArgument('cp'), (int) $input->getArgument('hp'), (int) $input->getArgument('dusts'), (int) $input->getArgument('global'), (int) $input->getArgument('max-stats'), $input->getArgument('bests'), (bool) $input->getOption('upgraded') );
为了操作不同的IV组合,我使用了 Illuminate\Collection。
所以 pokemon->getIvCombinaisons()
将返回一个易于操作的Collection。
参数
其中
1
是最差的评价(IV小于8或全局小于50%)
和
4
是最佳范围(IV大于15或全局IV大于80%)
助手
只需使用静态助手,第一个参数是宝可梦等级,第二个是你的训练师等级。
尘土计算器
Helpers::dustsToMax(20.5, 20)
糖果计算器
Helpers::candiesToMax(23, 27)
CP计算器
Helpers::calculateCP(238, 184, 171, 29, true)
贡献
在提交之前,请运行 vendor/bin/php-cs-fixer fix .
命令,并更新测试套件。
要启动测试套件
php vendor/bin/peridot tests
请
欢迎改进这个库。