Changeset 262 for veekun/trunk/lib/Vee/Bot.pm
- Timestamp:
- 07/19/07 11:46:56 (3 years ago)
- Files:
-
- 1 modified
-
veekun/trunk/lib/Vee/Bot.pm (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
veekun/trunk/lib/Vee/Bot.pm
r229 r262 95 95 (\d+) \s+ 96 96 with 97 ( (?: \s+ \d+ ){6} )97 ( (?: \s+ \d+ (?: \+ \d+ )? ){6} ) 98 98 $/ix); 99 99 … … 101 101 # didn't match 102 102 return "Syntax for that command is 'ivs for {nature} {pokemon} " . 103 "at level {level} with {hp} {atk} {def} {spatk} {spdef} {spd}'."; 103 "at level {level} with {hp} {atk} {def} {spatk} {spdef} {spd}'. " . 104 "You may specify EVs as +{effort} immediately after a stat."; 104 105 } 105 106 106 107 # I cheat here and use the special ' ' delimeter to avoid the leading empty 107 108 # string I'd get otherwise. It IS documented, trust me. 108 my @stats = split ' ', $stats; 109 my (@stats, @evs); 110 for my $stat_string (split ' ', $stats) { 111 my ($iv, $ev) = split /\+/, $stat_string; 112 push @stats, $iv; 113 push @evs, $ev || 0; 114 } 109 115 110 116 my $pokemon_id = get_pokemon($pokemon_name) … … 136 142 my ($min, $max); 137 143 for my $iv (0 .. 31) { 138 my $calculated = $func->($base, $level, $iv, 0);144 my $calculated = $func->($base, $level, $iv, $evs[$s]); 139 145 $calculated = int( $calculated * $nature_changes[$s] ); 140 146 if ($calculated == $stats[$s]) { … … 149 155 150 156 for my $iv (reverse $min .. 31) { 151 my $calculated = $func->($base, $level, $iv, 0);157 my $calculated = $func->($base, $level, $iv, $evs[$s]); 152 158 $calculated = int( $calculated * $nature_changes[$s] ); 153 159 if ($calculated == $stats[$s]) {
