kostaspt / ivcalculator
This package is abandoned and no longer maintained.
No replacement package was suggested.
Find the possible IVs of a Pokémon.
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
Find the possible IVs of a Pokémon.
Installation
You can install this package via composer using:
$ composer require kostaspt/ivcalculator
Usage
<?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 } ] ] */
The $results
variable is a Collection, so you can use it like this:
echo $results->get('name'); // Outputs: Dragonite
or
echo $results->get('perfection')->get('average'); // Outputs: 0.73
or
$highestIV = $results->get('ivs')->last(); echo $highestIV->perfection; // Outputs: 0.8
Usage (Command Line)
You can install this package via composer globally using:
$ composer require global kostaspt/ivcalculator
Then, just run:
$ ivcalculator analyze 'Dragonite' 3280 149 9000
Credit
Heavily inspired by andromedado/pokemon-go-iv-calculator