kostaspt / ivcalculator
该包已被 废弃 且不再维护。未建议替代包。
查找宝可梦的可能IV值。
0.2.0
2016-09-17 19:14 UTC
Requires
- php: ^7.0
- symfony/console: ^3.1
- tightenco/collect: ^5.2
Requires (Dev)
- larapack/dd: ^1.0
- phpunit/phpunit: ^5.5
This package is not auto-updated.
Last update: 2022-02-01 13:00:49 UTC
README
查找宝可梦的可能IV值。
安装
您可以通过composer使用以下命令安装此包:
$ composer require kostaspt/ivcalculator
使用方法
<?php require_once 'vendor/autoload.php'; $ivCalculator = new IVCalculator\IVCalculator(); // Pokemon, CP, HP, Stardust needed for power up, Was powered up before? $results = $ivCalculator->evaluate('Dragonite', 3280, 149, 9000, false); var_dump($results->toArray()); /* Outputs: array:4 [ "id" => 149 "name" => "Dragonite" "perfection" => array:3 [ "max" => 0.62 "min" => 0.8 "average" => 0.73 ] "ivs" => array:5 [ 4 => IVCalculator\Entities\IV {#56 +attackIV: 13 +defenseIV: 6 +staminaIV: 9 +level: 76 +perfection: 0.62 } 1 => IVCalculator\Entities\IV {#59 +attackIV: 15 +defenseIV: 8 +staminaIV: 10 +level: 74 +perfection: 0.73 } 3 => IVCalculator\Entities\IV {#57 +attackIV: 9 +defenseIV: 15 +staminaIV: 10 +level: 75 +perfection: 0.75 } 2 => IVCalculator\Entities\IV {#58 +attackIV: 12 +defenseIV: 12 +staminaIV: 11 +level: 74 +perfection: 0.77 } 0 => IVCalculator\Entities\IV {#60 +attackIV: 15 +defenseIV: 9 +staminaIV: 12 +level: 73 +perfection: 0.8 } ] ] */
$results
变量是一个 集合,因此您可以如此使用它
echo $results->get('name'); // Outputs: Dragonite
或
echo $results->get('perfection')->get('average'); // Outputs: 0.73
或
$highestIV = $results->get('ivs')->last(); echo $highestIV->perfection; // Outputs: 0.8
命令行使用方法
您可以通过composer全局安装此包
$ composer require global kostaspt/ivcalculator
然后,只需运行
$ ivcalculator analyze 'Dragonite' 3280 149 9000