th3mouk/pokemongo-iv-calc

计算精灵宝可梦Go IV的最准确PHP库

1.7.0 2017-10-30 16:01 UTC

This package is auto-updated.

Last update: 2024-08-26 02:16:06 UTC


README

这个PHP库是计算宝可梦IV值最准确的。

Latest Stable Version Latest Unstable Version Total Downloads License

SensioLabsInsight Build Status Scrutinizer Code Quality

安装

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。

参数

  • 宝可梦的英文名称 🇬🇧
  • CP
  • HP
  • 尘土
  • 1/2/3/4 查看步骤
  • 1/2/3/4 查看步骤
  • 完成命令,输入教练给出的统计数据(atk 和/或 def 和/或 hp

其中

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

欢迎改进这个库。