Hello, this post is under development.
This is not Instant Buy buildings/research/ships/defenses
This MOD enable function 'FastBuildingFromQueue' like Buildings and Research to setup time queue in 0, its mean finish time to build ships / defenses /missiles
includes\pages\game\ShowShipyardPage.class.php
ADD this function, no replace:
Display All
Find:
Replace:
styles\theme\nsc\templates\game\page.shipyard.default.tpl
Find:
Replace:
Display All
Thank you @Songoku for help with this MOD.
Regards.
This is not Instant Buy buildings/research/ships/defenses
This MOD enable function 'FastBuildingFromQueue' like Buildings and Research to setup time queue in 0, its mean finish time to build ships / defenses /missiles
includes\pages\game\ShowShipyardPage.class.php
ADD this function, no replace:
PHP Source Code
- //instant build ships/defenses/missiles
- private function FastBuildingFromQueue()
- {
- global $PLANET, $USER, $resource;
- $CurrentQueue = unserialize($PLANET['b_hangar_id']);
- if (empty($CurrentQueue)){
- $PLANET['b_hangar_id'] = '';
- $PLANET['b_hangar'] = 0;
- return;
- }
- $Element = $CurrentQueue[0][0];
- $BuildMode = $CurrentQueue[0][4];
- $fast = $resource[$Element];
- $NeededDm = 10 + ((400*($PLANET['b_hangar']-TIMESTAMP))/3600);
- if($NeededDm < 10)
- $NeededDm=10;
- if ($USER['darkmatter'] >= $NeededDm){
- $USER['darkmatter'] -= $NeededDm;
- Database::get()->update($sql, array(':planetId' => $PLANET['id']));
- array_shift($CurrentQueue);
- if (count($CurrentQueue) == 0) {
- $PLANET['b_hangar'] = 0;
- $PLANET['b_hangar_id'] = '';
- }else{
- $BuildEndTime = TIMESTAMP;
- $NewQueueArray = array();
- foreach($CurrentQueue as $ListIDArray) {
- $BuildEndTime += BuildFunctions::getBuildingTime($USER, $PLANET, $ListIDArray[0], NULL, $ListIDArray[4] == 'destroy');
- $ListIDArray[3] = $BuildEndTime;
- $NewQueueArray[] = $ListIDArray;
- }
- if(!empty($NewQueueArray)) {
- $PLANET['b_EndTime'] = TIMESTAMP;
- $PLANET['b_EndTime_id'] = serialize($NewQueueArray);
- $this->ecoObj->setData($USER, $PLANET);
- $this->ecoObj->SetNextQueueElementOnTop();
- list($USER, $PLANET) = $this->ecoObj->getData();
- }else{
- $PLANET['b_EndTime'] = 0;
- $PLANET['b_EndTime_id'] = '';
- }
- }
- return true;
- }
- }
Find:
PHP Source Code
- <div class="element_row {if $List@first}active_row{/if}" style="background:url({$dpath}gebaeude/{$ID}.gif)">
- <div class="right_hand">
- {if $List@first}
- <span class="onlistretit">{$LNG.tech.{$ID}}</span>
- <form action="game.php?page=shipyard&mode={$mode}" method="post" class="build_form">
- <input type="hidden" name="action" value="delete">
- <input type="hidden" name="auftr[]" value="{$List@iteration - 1}">
- <button type="submit" class="del tooltip" data-tooltip-content="{$LNG.bd_cancel_warning}"></button>
- </form>
- {else}
PHP Source Code
- {if $List@first}
- <span class="onlistretit">{$LNG.tech.{$ID}}</span>
- <form action="game.php?page=shipyard&mode={$mode}" method="post" class="build_form">
- <input type="hidden" name="action" value="delete">
- <input type="hidden" name="auftr[]" value="{$List@iteration - 1}">
- <button type="submit" class="del tooltip" data-tooltip-content="{$LNG.bd_cancel_warning}"></button>
- </form>
- <form action="game.php?page=shipyard" method="post" class="build_form">
- <input type="hidden" name="queuetype" value="1">
- <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}{shortly_number($need_dm)}{/if} {$LNG.tech.921}" style="float: right; line-height: 43px;">
- <img src="{$dpath}img/iconav/up.png" alt="" width="16" height="16">
- </button>
- </form>
- {else}
Regards.
The post was edited 11 times, last by Zuno ().