1. build queue acceleration for darkmatter
[Blocked Image: https://clip2net.com/clip/m500486/00e97-clip-71kb.jpg]
Display Spoiler
in \includes\pages\game\ShowBuildingsPage.class.php
before
add
Display All
after
add
before
add
after
add
in \styles\templates\game\page.buildings.default.tpl
after
add
in your lang INGAME.php
add
Good luck
[Blocked Image: https://clip2net.com/clip/m500486/00e97-clip-71kb.jpg]
in \includes\pages\game\ShowBuildingsPage.class.php
before
add
PHP Source Code: ShowBuildingsPage.class.php
- private function FastBuildingFromQueue()
- {
- global $PLANET, $USER, $resource;
- $CurrentQueue = unserialize($PLANET['b_building_id']);
- if (empty($CurrentQueue)){
- $PLANET['b_building_id'] = '';
- $PLANET['b_building'] = 0;
- return;
- }
- $Element = $CurrentQueue[0][0];
- $BuildMode = $CurrentQueue[0][4];
- $fast = $resource[$Element];
- if ($PLANET['planet_type']==3){
- $NeededDm = (1000*(($PLANET['b_building']-TIMESTAMP)/3600));
- }else{
- $NeededDm = (200*(($PLANET['b_building']-TIMESTAMP)/3600));
- }
- if($NeededDm < 10)
- $NeededDm=10;
- if ($USER['darkmatter'] >= $NeededDm){
- $USER['darkmatter'] -= $NeededDm;
- if ($BuildMode == 'destroy'){
- $PLANET['field_current'] -=1;
- $PLANET[$resource[$Element]] -= 1;
- $sql = "UPDATE %%PLANETS%% SET ".$fast." = ".$fast." - 1 WHERE id = :planetId;";
- }
- else{
- $PLANET['field_current'] +=1;
- $PLANET[$resource[$Element]] += 1;
- $sql = "UPDATE %%PLANETS%% SET ".$fast." = ".$fast." + 1 WHERE id = :planetId;";
- }
- Database::get()->update($sql, array(':planetId' => $PLANET['id']));
- array_shift($CurrentQueue);
- if (count($CurrentQueue) == 0) {
- $PLANET['b_building'] = 0;
- $PLANET['b_building_id'] = '';
- }else{
- $BuildEndTime = TIMESTAMP;
- $NewQueueArray = array();
- foreach($CurrentQueue as $ListIDArray) {
- if($Element == $ListIDArray[0])
- continue;
- $BuildEndTime += BuildFunctions::getBuildingTime($USER, $PLANET, $ListIDArray[0], NULL, $ListIDArray[4] == 'destroy');
- $ListIDArray[3] = $BuildEndTime;
- $NewQueueArray[] = $ListIDArray;
- }
- if(!empty($NewQueueArray)) {
- $PLANET['b_building'] = TIMESTAMP;
- $PLANET['b_building_id'] = serialize($NewQueueArray);
- $this->ecoObj->setData($USER, $PLANET);
- $this->ecoObj->SetNextQueueElementOnTop();
- list($USER, $PLANET) = $this->ecoObj->getData();
- }else{
- $PLANET['b_building'] = 0;
- $PLANET['b_building_id'] = '';
- }
- }
- return true;
- }
- }
before
after
in \styles\templates\game\page.buildings.default.tpl
after
add
HTML Source Code: page.buildings.default.tpl
- <form action="game.php?page=buildings" method="post" class="build_form">
- <input type="hidden" name="cmd" value="fast">
- <button type="submit" class="build_submit onlist tooltip" data-tooltip-content="{$LNG.cost} : {if $need_dm<10}{10}{else}{($need_dm)}{/if} {$LNG.dm}">{$LNG.acceleration}</button>
- </form>
in your lang INGAME.php
add
Good luck
[tt][spoiler][/spoiler]
[/tt] The post was edited 6 times, last by Kaizoku ().