game = $game; $this->players = $game->getLib('beta5/player'); } function getSender() { return "Economic Advisor"; } function getSLink() { return ""; } function getRecipient() { return utf8entities($this->players->call('getName', $this->player)); } function getRLink() { return ""; } function getSubject() { $v = ($this->data['is_sale'] == 'f') ? "bought" : "sold"; if (is_null($this->data['p_name'])) { return "Fleet '" . utf8entities($this->data['f_name']) . " has been $v"; } return "Planet " . utf8entities($this->data['p_name']) . " has been $v"; } function getReplyLink() { return ""; } function getContents() { $p = $this->players->call('get', $this->data['pl_id'], true); $sale = ($this->data['is_sale'] == 'f'); $pq = ($p['quit'] == 0); $fp = ($this->data['f_power'] != "") ? number_format($this->data['f_power']) : ""; if (is_null($this->data['p_name'])) { if ($this->data['is_sale'] == 't') { $s = "We just lost control of our fleet " . utf8entities($this->data['f_name']) . " (fleet power: $fp).
It has been sold to " . ($pq ? "" : "") . "" . utf8entities($this->data['pl_name']) . "" . ($pq?"":"") . "."; } else { $s = "We just gained control of the fleet " . utf8entities($this->data['f_name']) . " (fleet power: $fp).
It has been obtained from " . ($pq ? "" : "") . "" . utf8entities($this->data['pl_name']) . "" . ($pq?"":"") . "."; } } elseif ($this->data['is_sale'] == 't') { $s = "We just lost control of our planet " . utf8entities($this->data['p_name']) . ""; if (!is_null($this->data['f_name'])) { $s .= " along with the " . utf8entities($this->data['f_name']) . " fleet (power: $fp)"; } $s .= ".
It has been sold to " . ($pq ? "" : "") . "" . utf8entities($this->data['pl_name']) . "" . ($pq?"":"") . "."; } else { $s = "We just gained control on planet " . utf8entities($this->data['p_name']) . ""; if (!is_null($this->data['f_name'])) { $s .= " and on the " . utf8entities($this->data['f_name']) . " fleet (power: $fp)"; } $s .= ".
We bought it from " . ($pq ? "" : "") . "" . utf8entities($this->data['pl_name']) . "" . ($pq?"":"") . "."; } return $s; } } ?>