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/msgformat/en/abandon.inc

70 lines
1.2 KiB
PHP
Raw Normal View History

2016-01-10 11:01:49 +01:00
<?php
class msgformat_abandon {
function msgformat_abandon($game) {
$this->game = $game;
$this->players = $game->getLib('beta5/player');
}
function getSender() {
return 'Military Advisor';
}
function getSLink() {
return "";
}
function getRecipient() {
$name = $this->players->call('getName', $this->player);
return utf8entities($name);
}
function getRLink() {
return "";
}
function getSubject() {
if (is_array($this->data[0])) {
$c = count($this->data);
} else {
$c = 1;
}
return "$c planet" . ($c>1?"s":"") . " abandoned";
}
function getReplyLink() {
return "";
}
function getContents() {
if (is_array($this->data[0])) {
$data = $this->data;
} else {
$data = array($this->data);
}
$c = count($data);
$str = "Sir! Our forces have completed the evacuation of planet" . ($c>1?"s":"") . " ";
for ($i=0;$i<$c;$i++) {
if ($i > 0) {
if ($i == $c - 1) {
$str .= ' and ';
} else {
$str .= ', ';
}
}
$str .= "<a href='planet?id={$data[$i]['p_id']}'><b>"
. utf8entities($data[$i]['p_name']) . "</b></a>";
}
$str .= ". The citizens of th" . ($c>1?"ese":"is") . " world" . ($c>1?"s":"")
. " are left to fend for themselves.";
return $str;
}
}
?>