Skip to content

Commit

Permalink
Adjusting rates.
Browse files Browse the repository at this point in the history
  • Loading branch information
lemming552 committed Dec 5, 2013
1 parent 137a275 commit 4110f6a
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions lib/Lacuna/DB/Result/Spies.pm
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,8 @@ sub is_available {
my $train_time = DateTime->now->subtract_datetime($self->started_assignment);
my $minutes = $train_time->minutes();
my $train_cnt = $db->resultset('Spies')->search({task => "$task"})->count;
my $boost = (time < $self->empire->spy_training_boost->epoch) ? 1.25 : 1;
my $points_hour = $train_bld->level * 2 * $boost;
my $boost = (time < $self->empire->spy_training_boost->epoch) ? 1.5 : 1;
my $points_hour = $train_bld->level * $boost;
my $points_to_add = int( ($points_hour * $minutes)/60/$train_cnt);
my $remain_min = $minutes - int(($points_to_add * 60 * $train_cnt)/$points_hour);
if ($points_to_add > 0) {
Expand Down
4 changes: 2 additions & 2 deletions lib/Lacuna/RPC/Building/IntelTraining.pm
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ around 'view' => sub {
my $empire = $self->get_empire_by_session($session_id);
my $building = $self->get_building($empire, $building_id, skip_offline => 1);
my $out = $orig->($self, $empire, $building);
my $boost = (time < $empire->spy_training_boost->epoch) ? 1.25 : 1;
my $points_per = $building->level * 2 * $boost;
my $boost = (time < $empire->spy_training_boost->epoch) ? 1.5 : 1;
my $points_per = $building->level * $boost;
$out->{spies} = {
points_per => $points_per,
in_training => $building->spies_in_training_count,
Expand Down
4 changes: 2 additions & 2 deletions lib/Lacuna/RPC/Building/MayhemTraining.pm
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ around 'view' => sub {
my $empire = $self->get_empire_by_session($session_id);
my $building = $self->get_building($empire, $building_id, skip_offline => 1);
my $out = $orig->($self, $empire, $building);
my $boost = (time < $empire->spy_training_boost->epoch) ? 1.25 : 1;
my $points_per = $building->level * 2 * $boost;
my $boost = (time < $empire->spy_training_boost->epoch) ? 1.5 : 1;
my $points_per = $building->level * $boost;
$out->{spies} = {
points_per => $points_per,
in_training => $building->spies_in_training_count,
Expand Down
4 changes: 2 additions & 2 deletions lib/Lacuna/RPC/Building/PoliticsTraining.pm
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ around 'view' => sub {
my $empire = $self->get_empire_by_session($session_id);
my $building = $self->get_building($empire, $building_id, skip_offline => 1);
my $out = $orig->($self, $empire, $building);
my $boost = (time < $empire->spy_training_boost->epoch) ? 1.25 : 1;
my $points_per = $building->level * 2 * $boost;
my $boost = (time < $empire->spy_training_boost->epoch) ? 1.5 : 1;
my $points_per = $building->level * $boost;
$out->{spies} = {
points_per => $points_per,
in_training => $building->spies_in_training_count,
Expand Down
4 changes: 2 additions & 2 deletions lib/Lacuna/RPC/Building/TheftTraining.pm
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ around 'view' => sub {
my $empire = $self->get_empire_by_session($session_id);
my $building = $self->get_building($empire, $building_id, skip_offline => 1);
my $out = $orig->($self, $empire, $building);
my $boost = (time < $empire->spy_training_boost->epoch) ? 1.25 : 1;
my $points_per = $building->level * 2 * $boost;
my $boost = (time < $empire->spy_training_boost->epoch) ? 1.5 : 1;
my $points_per = $building->level * $boost;
$out->{spies} = {
points_per => $points_per,
in_training => $building->spies_in_training_count,
Expand Down
16 changes: 8 additions & 8 deletions lib/Lacuna/RPC/Empire.pm
Original file line number Diff line number Diff line change
Expand Up @@ -752,14 +752,14 @@ sub view_boosts {
return {
status => $self->format_status($empire),
boosts => {
food => format_date($empire->food_boost),
happiness => format_date($empire->happiness_boost),
water => format_date($empire->water_boost),
ore => format_date($empire->ore_boost),
energy => format_date($empire->energy_boost),
storage => format_date($empire->storage_boost),
building => format_date($empire->building_boost),
building => format_date($empire->spy_training_boost),
food => format_date($empire->food_boost),
happiness => format_date($empire->happiness_boost),
water => format_date($empire->water_boost),
ore => format_date($empire->ore_boost),
energy => format_date($empire->energy_boost),
storage => format_date($empire->storage_boost),
building => format_date($empire->building_boost),
spy_training => format_date($empire->spy_training_boost),
}
};
}
Expand Down

0 comments on commit 4110f6a

Please sign in to comment.