Changeset 113

Show
Ignore:
Timestamp:
04/23/07 21:32:22 (3 years ago)
Author:
eevee
Message:

Once again starting something and then leaving it to rot forever. Woo.

Location:
veekun/trunk
Files:
1 added
1 modified

Legend:

Unmodified
Added
Removed
  • veekun/trunk/lib/Vee/Controller/Dex/Utils.pm

    r109 r113  
    243243=head2 damage 
    244244 
    245 Calculates parents for an egg move. 
     245Calculates damage. 
    246246 
    247247=cut 
     
    273273} 
    274274 
     275=head2 iv 
     276 
     277Calculates IVs. 
     278 
     279=cut 
     280 
     281sub iv : Path('calculators/iv') : Args(0) { 
     282    my ($self, $c) = @_; 
     283    my $s = $c->stash; 
     284 
     285    my $params = $c->req->params; 
     286    if (%{ $params }) { 
     287        my @ivs; 
     288        for my $iv (0 .. 31) { 
     289            my $stat = ingame_stats($params->{base}, $params->{level}, $iv, 0); 
     290            warn "$iv $stat"; 
     291            $ivs[$iv] = ($stat == $params->{stat}); 
     292        } 
     293        $s->{ivs} = \@ivs; 
     294    } 
     295 
     296    $s->{page_title} = 'IV Calculator'; 
     297    $s->{extra_css}  = 'dex'; 
     298    $s->{template}   = 'dex/utils/iv.tt'; 
     299} 
     300 
    275301=head1 AUTHOR 
    276302