game = $game;
$this->players = $game->getLib('beta5/player');
$this->alliance = $game->getLib('beta5/alliance');
}
public function getSLink() { return ""; }
public function getRLink() { return ""; }
public function getReplyLink() { return ""; }
public function getSender() { return "LegacyWorlds"; }
public function getRecipient() {
$name = $this->players->call('getName', $this->player);
return utf8entities($name);
}
public function getSubject() {
// Get the team's data if needed
if (!is_null($this->data['team'])) {
$this->team = $this->alliance->call('get', $this->data['team']);
}
// Create the subject
switch ($this->data['msg_type']) :
default:
case 0: $rv = "Welcome!"; break;
case 1: $rv = "A player joined the team"; break;
case 2: $rv = "We are holding the targets"; break;
case 3: $rv = $this->team['name'] . " has the targets!"; break;
case 4: $rv = "Targets lost - we must retake"; break;
case 5:
case 6: $rv = "Targets lost"; break;
case 7: $rv = $this->team['name'] . " could lose the targets"; break;
case 8:
case 9: $rv = $this->team['name'] . " lost the targets"; break;
case 10: $rv = "We are still holding!"; break;
case 11: $rv = $this->team['name'] . " is still holding!"; break;
case 12: $rv = "Victory!... sort of."; break;
case 13: $rv = $this->team['name'] . " owned us"; break;
case 14: $rv = "WE HAVE WON THE GAME!"; break;
case 15: $rv = "We were defeated :'("; break;
endswitch;
return $rv;
}
public function getContents() {
// Get the team's data if needed
if (!is_null($this->data['team']) && is_null($this->team)) {
$this->team = $this->alliance->call('get', $this->data['team']);
}
// Generate the contents
$generators = array(
"Welcome", "Join",
"Hold", "OthersHold",
"LostGrace", "Lost", "GraceExpired",
"OthersLostGrace", "OthersLost", "OthersGraceExpired",
"Half", "OthersHalf",
"Win", "Lose",
"WonGame", "LostGame"
);
$v = "msg" . $generators[$this->data['msg_type']];
ob_start();
$this->$v();
$rv = ob_get_contents();
ob_end_clean();
return $rv;
}
private function msgWelcome() {
$game = $this->players->game;
?>
Welcome to this special King of the Hills LegacyWorlds game!
You have been assigned to [=$this->team['tag']?>], the
=strtolower($this->team['name'])?>.
Before you start playing, a few explanations on this special minigame may be required.
Here, the goal is for your team to control special star systems called targets for
=$game->params['v2time']?> hours in a row. If you succeed, the team will earn
=$game->params['v2points']?> points.
params['v2grace']) {
?>
However, if you lose control on the targets, you will still have
=$game->params['v2grace']?> hours to recover them without restarting the
countdown to victory. Of course, the time during which your team no longer holds the
targets does not count in the race towards victory.
When a team wins a round, the targets are made neutral again, and their factories and turrets
are reset. All planets which had been destroyed by Wormhole Supernovas are restored, and all
planets a team owns in another team's territory are neutralized. Players who no longer had
planets are respawned at their original location. In addition, fleets are equalized so that
no-one starts the new round with more fleets than the others.
The first team to reach 100 points will win the game.
players->call('getName', $this->data['time_stamp']);
?>
A new player, '>=utf8entities($name)?>,
has been assigned to the =strtolower($this->team['name'])?>.
Our team is now holding all the targets! We must hold them until
=gmstrftime("%H:%M", $this->data['time_stamp'] + 60)?> (=gmstrftime("%d/%m/%Y", $this->data['time_stamp'])?>)
to win this round.
=$this->team['tag']?>, the =strtolower($this->team['name'])?>, is now holding all the targets!
We must retake them at all cost, otherwise the =strtolower($this->team['name'])?> will win this round at
=gmstrftime("%H:%M", $this->data['time_stamp'] + 60)?> (=gmstrftime("%d/%m/%Y", $this->data['time_stamp'])?>).
Our team is no longer holding the targets... If we do not retake them before
=gmstrftime("%H:%M", $this->data['time_stamp'] - 60)?> (=gmstrftime("%d/%m/%Y", $this->data['time_stamp'])?>),
the countdown to victory will be reset and we'll need to do it all over again...
Our team is no longer holding the targets :-(
The countdown to victory has been reset and we need to start all over again...
Our team is no longer holding the targets, and we lost our chance to retake them in time...
The countdown to victory has been reset and we need to start all over again...
=$this->team['tag']?>, the =strtolower($this->team['name'])?>, is no longer holding the targets!
However, if they retake the targets before =gmstrftime("%H:%M", $this->data['time_stamp'] - 60)?>
(=gmstrftime("%d/%m/%Y", $this->data['time_stamp'])?>),
the countdown to their victory will start again ... We must prevent them from retaking!
=$this->team['tag']?>, the =strtolower($this->team['name'])?>, is no longer holding the targets!
The countdown has been cancelled!
=$this->team['tag']?>, the =strtolower($this->team['name'])?>, is no longer holding the targets and
didn't manage to retake them in time! The countdown has been cancelled!
Our team is now holding all the targets! We must hold them until
=gmstrftime("%H:%M", $this->data['time_stamp'] + 60)?> (=gmstrftime("%d/%m/%Y", $this->data['time_stamp'])?>)
to win this round.
=$this->team['tag']?>, the =strtolower($this->team['name'])?>, is still holding all the targets!
We must retake them at all cost, otherwise the =strtolower($this->team['name'])?> will win this round at
=gmstrftime("%H:%M", $this->data['time_stamp'] + 60)?> (=gmstrftime("%d/%m/%Y", $this->data['time_stamp'])?>).
Our team has just won a round of the game!
As a consequence, the map has been reset and everyone has been respawned...
Keep sharp, the battle isn't over yet.
We just lost a round of the game to [=$this->team['tag']?>], the =strtolower($this->team['name'])?>.
As a consequence, the map has been reset and everyone has been respawned...
We still stand a chance of winning!
The game is finished - AND WE WON!
The game is finished - but we lost. [=$this->team['tag']?>], the =strtolower($this->team['name'])?>,
overpowered us.