BalanceOfPower

 view release on metacpan or  search on metacpan

lib/BalanceOfPower/Role/Shopper.pm  view on Meta::CPAN

45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
    }
}
 
sub calculate_price
{
    my $self = shift;
    my $y = shift;
    my $type = shift;
    my $nation = shift;
 
    #Price formula is MaxPrice - (( MaxPrice - MinPrice) / MaxValue) * Value
    #MaxPrice and MinPrice are constant
 
    my $min_price = PRICE_RANGES->{$type}->[0];
    my $max_price = PRICE_RANGES->{$type}->[1];
 
    my $max_value = $self->get_stat_for_price($y, $type);
    return SHOP_PRICE_FACTOR if($max_value == 0);
 
    my $value $self->get_stat_for_price($y, $type, $nation);



( run in 0.517 second using v1.01-cache-2.11-cpan-eab888a1d7d )