This repository has been archived on 2024-07-18. You can view files and clone it, but cannot push or open issues or pull requests.
lwb5/scripts/game/beta5/fleet/library/getUpkeep.inc

23 lines
471 B
PHP

<?php
class beta5_fleet_getUpkeep {
function beta5_fleet_getUpkeep($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
$this->rules = $this->lib->game->getLib('beta5/rules');
}
// Computes a fleet's upkeep
function run($pl, $g, $f, $c, $b) {
$r = $this->rules->call('get', $pl);
$fu = $g * $r['gaship_upkeep'];
$fu += $f * $r['fighter_upkeep'];
$fu += $c * $r['cruiser_upkeep'];
$fu += $b * $r['bcruiser_upkeep'];
return $fu;
}
}
?>