Example #1
0
    /////////////////////////////////////////////////////////////////////////////
    /////////////////////////////////////////////////////////////////////////////
    default:
        $template->throwError("Modus " . $modus . "ist nicht verfügbar. CaveID :" . $caveID);
        break;
}
// init tutorial
$tutorial = new Tutorial();
$tutorialFinish = $tutorial->checkFinish($ownCaves[$caveID]);
if (!$tutorial->noTutorial) {
    $finish = Request::getVar('tutorial', '');
    if ($tutorialFinish && $finish == 'finish' && Request::isPost('postConfirm')) {
        $tutorial->setFinish($ownCaves[$caveID]);
        $tutorialFinish = $tutorial->checkFinish($ownCaves[$caveID]);
    }
    $template->addVar('tutorial', array('show' => true, 'content' => $tutorial->msg, 'finish' => $tutorialFinish, 'open' => $tutorialFinish || $finish == 'finish' ? 'true' : 'false'));
} else {
    $template->addVar('tutorial', array('show' => false));
}
// prepare resource bar
$resources = array();
if ($template->getShowResource() && isset($resourceTypeList)) {
    foreach ($resourceTypeList as $resource) {
        $amount = floor($ownCaves[$caveID][$resource->dbFieldName]);
        $delta = $ownCaves[$caveID][$resource->dbFieldName . "_delta"];
        if ($amount > 0 || $delta > 0) {
            if ($delta > 0) {
                $delta = "+" . $delta;
            }
            $resources['resources'][] = array('dbFieldName' => $resource->dbFieldName, 'name' => $resource->name, 'amount' => $amount, 'delta' => $delta, 'safe_storage' => round(eval('return ' . formula_parseToPHP("{$resource->saveStorage};", '$ownCaves[$caveID]'))), 'max_level' => round(eval('return ' . formula_parseToPHP("{$resource->maxLevel};", '$ownCaves[$caveID]'))));
        }
Example #2
0
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 */
/** Set flag that this is a parent file */
define("_VALID_UA", 1);
require_once "config.inc.php";
require_once "include/page.inc.php";
require_once "include/db.functions.php";
require_once "include/export.inc.php";
require_once "include/rules/game.rules.php";
require_once "include/time.inc.php";
require_once "include/basic.lib.php";
require_once "include/movement.lib.php";
require_once "include/artefact.inc.php";
require_once "include/template.inc.php";
require_once "include/basic.lib.php";
page_start();
init_buildings();
init_defenseSystems();
init_resources();
init_units();
init_sciences();
$template = new Template();
$template->setFile('export.tmpl');
$content = export_switch();
$template->addVar('content', $content);
$template->render();
page_end();
Example #3
0
File: main.php Project: norter/Game
    /////////////////////////////////////////////////////////////////////////////
    /////////////////////////////////////////////////////////////////////////////
    /////////////////////////////////////////////////////////////////////////////
    default:
        $template->throwError("Modus " . $modus . "ist nicht verfügbar. CaveID :" . $caveID);
        break;
}
// init tutorial
$tutorial = new Tutorial();
$tutorialFinish = $tutorial->checkFinish($ownCaves[$caveID]);
if (!$tutorial->noTutorial) {
    if ($tutorialFinish && Request::isPost('nextTutorial')) {
        $tutorial->setFinish($ownCaves[$caveID]);
        $tutorialFinish = $tutorial->checkFinish($ownCaves[$caveID]);
    }
    $template->addVar('tutorial', array('show' => true, 'content' => $tutorialFinish ? $tutorial->finishMsg : $tutorial->startMsg, 'finish' => $tutorialFinish, 'open' => $tutorialFinish || Request::isPost('nextTutorial') ? 'true' : 'false'));
} else {
    $template->addVar('tutorial', array('show' => false));
}
// prepare resource bar
$resources = array();
if ($template->getShowRresource() && isset($resourceTypeList)) {
    foreach ($resourceTypeList as $resource) {
        $amount = floor($ownCaves[$caveID][$resource->dbFieldName]);
        if (!$resource->nodocumentation || $amount > 0) {
            $delta = $ownCaves[$caveID][$resource->dbFieldName . "_delta"];
            if ($delta > 0) {
                $delta = "+" . $delta;
            }
            $resources['resources'][] = array('dbFieldName' => $resource->dbFieldName, 'name' => $resource->name, 'amount' => $amount, 'delta' => $delta, 'safe_storage' => round(eval('return ' . formula_parseToPHP("{$resource->saveStorage};", '$ownCaves[$caveID]'))), 'max_level' => round(eval('return ' . formula_parseToPHP("{$resource->maxLevel};", '$ownCaves[$caveID]'))));
        }