예제 #1
0
function Show_Components()
{
    global $db;
    global $game;
    global $SHIP_TORSO, $UNIT_DESCRIPTION, $UNIT_DATA, $UNIT_NAME, $NEXT_TICK, $ACTUAL_TICK;
    global $ship_components;
    // res1,res2,res3,res4,unit1,unit2,unit3,unit4,unit5,unit6
    //$game->out('<br><b>Debuggen: Diese Meldung m�sst ihr nicht melden - Secius // Torso:'.$_POST['ship_torso']);
    if (!isset($_POST['ship_torso']) || empty($_POST['ship_torso']) && $game->player['user_race'] == 8) {
        $game->out('<br><b>' . constant($game->sprache("TEXT53")) . '</b><br>' . Show_Torso());
        return;
    }
    $game->out('
<script language="JavaScript">

function RoundNum(num)
{
return Math.round(num*Math.pow(10,2))/Math.pow(10,2);	
}


var Cat1 = new Array(0,0,0,0,0,0,0,0,0,0,0);
var Cat2 = new Array(0,0,0,0,0,0,0,0,0,0,0);
var Cat3 = new Array(0,0,0,0,0,0,0,0,0,0,0);
var Cat4 = new Array(0,0,0,0,0,0,0,0,0,0,0);
var Cat5 = new Array(0,0,0,0,0,0,0,0,0,0,0);
var Cat6 = new Array(0,0,0,0,0,0,0,0,0,0,0);
var Cat7 = new Array(0,0,0,0,0,0,0,0,0,0,0);
var Cat8=  new Array(0,0,0,0,0,0,0,0,0,0,0);
var Cat9 = new Array(0,0,0,0,0,0,0,0,0,0,0);
var Cat10 = new Array(0,0,0,0,0,0,0,0,0,0,0);
var Cat1S = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
var Cat2S = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
var Cat3S = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
var Cat4S = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
var Cat5S = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
var Cat6S = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
var Cat7S = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
var Cat8S = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
var Cat9S = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
var Cat10S = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
var CatName = new Array("-","-","-","-","-","-","-","-","-","-");

function Change()
{
var i=0;
var price = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
var skill = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
for (i=0;i<11;i++)
{ 
 if ((i==5 || i==6 ||i==7 || i==8) && Cat1S[14]!=1) {price[i+6]+=Cat1[i]; price[i]=Cat1[i];} else if ((i==5 || i==6 ||i==7 || i==8)) {price[i+6]+=Cat1[i];} else {price[i]+=Cat1[i];}
 if ((i==5 || i==6 ||i==7 || i==8) && Cat2S[14]!=1) {price[i+6]+=Cat2[i]; price[i]+=Cat2[i];} else if ((i==5 || i==6 ||i==7 || i==8)) {price[i+6]+=Cat2[i];} else {price[i]+=Cat2[i];}
 if ((i==5 || i==6 ||i==7 || i==8) && Cat3S[14]!=1) {price[i+6]+=Cat3[i]; price[i]+=Cat3[i];} else if ((i==5 || i==6 ||i==7 || i==8)) {price[i+6]+=Cat3[i];} else {price[i]+=Cat3[i];}
 if ((i==5 || i==6 ||i==7 || i==8) && Cat4S[14]!=1) {price[i+6]+=Cat4[i]; price[i]+=Cat4[i];} else if ((i==5 || i==6 ||i==7 || i==8)) {price[i+6]+=Cat4[i];} else {price[i]+=Cat4[i];}
 if ((i==5 || i==6 ||i==7 || i==8) && Cat5S[14]!=1) {price[i+6]+=Cat5[i]; price[i]+=Cat5[i];} else if ((i==5 || i==6 ||i==7 || i==8)) {price[i+6]+=Cat5[i];} else {price[i]+=Cat5[i];}
 if ((i==5 || i==6 ||i==7 || i==8) && Cat6S[14]!=1) {price[i+6]+=Cat6[i]; price[i]+=Cat6[i];} else if ((i==5 || i==6 ||i==7 || i==8)) {price[i+6]+=Cat6[i];} else {price[i]+=Cat6[i];}
 if ((i==5 || i==6 ||i==7 || i==8) && Cat7S[14]!=1) {price[i+6]+=Cat7[i]; price[i]+=Cat7[i];} else if ((i==5 || i==6 ||i==7 || i==8)) {price[i+6]+=Cat7[i];} else {price[i]+=Cat7[i];}
 if ((i==5 || i==6 ||i==7 || i==8) && Cat8S[14]!=1) {price[i+6]+=Cat8[i]; price[i]+=Cat8[i];} else if ((i==5 || i==6 ||i==7 || i==8)) {price[i+6]+=Cat8[i];} else {price[i]+=Cat8[i];}
 if ((i==5 || i==6 ||i==7 || i==8) && Cat9S[14]!=1) {price[i+6]+=Cat9[i]; price[i]+=Cat9[i];} else if ((i==5 || i==6 ||i==7 || i==8)) {price[i+6]+=Cat9[i];} else {price[i]+=Cat9[i];}
 if ((i==5 || i==6 ||i==7 || i==8) && Cat10S[14]!=1) {price[i+6]+=Cat10[i]; price[i]+=Cat10[i];} else if ((i==5 || i==6 ||i==7 || i==8)) {price[i+6]+=Cat10[i];} else {price[i]+=Cat10[i];}
 
 }
for (i=0;i<18;i++)
{
 skill[i]=Cat1S[i];
 skill[i]+=Cat2S[i];
 skill[i]+=Cat3S[i];
 skill[i]+=Cat4S[i];
 skill[i]+=Cat5S[i];
 skill[i]+=Cat6S[i];
 skill[i]+=Cat7S[i];
 skill[i]+=Cat8S[i];
 skill[i]+=Cat9S[i];
 skill[i]+=Cat10S[i];
}


document.getElementById( "price1" ).firstChild.nodeValue = price[0]+' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][0] . ';
document.getElementById( "price2" ).firstChild.nodeValue = price[1]+' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][1] . ';
document.getElementById( "price3" ).firstChild.nodeValue = price[2]+' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][2] . ';
document.getElementById( "price4" ).firstChild.nodeValue = price[3]+' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][30] . ';
document.getElementById( "price5" ).firstChild.nodeValue = price[4]+' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][13] * TICK_DURATION . ';

document.getElementById( "price6" ).firstChild.nodeValue = price[5]+' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][3] . ';
document.getElementById( "price7" ).firstChild.nodeValue = price[6]+' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][4] . ';
document.getElementById( "price8" ).firstChild.nodeValue = price[7]+' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][5] . ';
document.getElementById( "price9" ).firstChild.nodeValue = price[8]+' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][6] . ';

document.getElementById( "price6a" ).firstChild.nodeValue = price[11]+' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][7] . ';
document.getElementById( "price7a" ).firstChild.nodeValue = price[12]+' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][8] . ';
document.getElementById( "price8a" ).firstChild.nodeValue = price[13]+' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][9] . ';
document.getElementById( "price9a" ).firstChild.nodeValue = price[14]+' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][10] . ';

document.getElementById( "price10" ).firstChild.nodeValue = price[9]+' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][11] . ';
document.getElementById( "price11" ).firstChild.nodeValue = price[10]+' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][12] . ';
document.getElementById( "comp1" ).firstChild.nodeValue = CatName[0];
document.getElementById( "comp2" ).firstChild.nodeValue = CatName[1];
document.getElementById( "comp3" ).firstChild.nodeValue = CatName[2];
document.getElementById( "comp4" ).firstChild.nodeValue = CatName[3];
document.getElementById( "comp5" ).firstChild.nodeValue = CatName[4];
document.getElementById( "comp6" ).firstChild.nodeValue = CatName[5];
document.getElementById( "comp7" ).firstChild.nodeValue = CatName[6];
document.getElementById( "comp8" ).firstChild.nodeValue = CatName[7];
document.getElementById( "comp9" ).firstChild.nodeValue = CatName[8];
document.getElementById( "comp10" ).firstChild.nodeValue = CatName[9];

document.getElementById( "skill1" ).firstChild.nodeValue = skill[0]+' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][14] . ';
document.getElementById( "skill2" ).firstChild.nodeValue = skill[1]+' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][15] . ';
document.getElementById( "skill3" ).firstChild.nodeValue = skill[2]+' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][16] . ';
document.getElementById( "skill4" ).firstChild.nodeValue = skill[3]+' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][17] . ';
document.getElementById( "skill5" ).firstChild.nodeValue = skill[4]+' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][18] . ';
document.getElementById( "skill6" ).firstChild.nodeValue = skill[5]+' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][19] . ';
document.getElementById( "skill7" ).firstChild.nodeValue = skill[6]+' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][20] . ';
document.getElementById( "skill8" ).firstChild.nodeValue = skill[7]+' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][21] . ';
document.getElementById( "skill9" ).firstChild.nodeValue = skill[8]+' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][22] . ';
document.getElementById( "skill10" ).firstChild.nodeValue =RoundNum(skill[9]+' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][23] . ');
if (skill[9]+' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][23] . ' > 9.99) document.getElementById( "skill10" ).firstChild.nodeValue=9.99;
document.getElementById( "skilla1" ).firstChild.nodeValue = skill[10]+' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][24] . ';
document.getElementById( "skilla2" ).firstChild.nodeValue = skill[11]+' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][25] . ';
document.getElementById( "skilla3" ).firstChild.nodeValue = skill[12]+' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][26] . ';
document.getElementById( "skilla4" ).firstChild.nodeValue = skill[13]+' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][27] . ';
document.getElementById( "skilla6" ).firstChild.nodeValue = skill[15]+' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][32] . ';
document.getElementById( "skilla7" ).firstChild.nodeValue = skill[16]+' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][33] . ';    
document.getElementById( "skilla8" ).firstChild.nodeValue = skill[17]+' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][34] . ';    
//document.getElementById( "skilla5" ).firstChild.nodeValue = skill[14]+' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][28] . ';



}

function UpdateCategory1(svalue, id)  {Cat1[id]=svalue; }
function UpdateCategory2(svalue, id)  {Cat2[id]=svalue; }
function UpdateCategory3(svalue, id)  {Cat3[id]=svalue; }
function UpdateCategory4(svalue, id)  {Cat4[id]=svalue; }
function UpdateCategory5(svalue, id)  {Cat5[id]=svalue; }
function UpdateCategory6(svalue, id)  {Cat6[id]=svalue; }
function UpdateCategory7(svalue, id)  {Cat7[id]=svalue; }
function UpdateCategory8(svalue, id)  {Cat8[id]=svalue; }
function UpdateCategory9(svalue, id)  {Cat9[id]=svalue; }
function UpdateCategory10(svalue, id) {Cat10[id]=svalue; }
function UpdateCategory1S(svalue, id)  {Cat1S[id]=svalue; }
function UpdateCategory2S(svalue, id)  {Cat2S[id]=svalue; }
function UpdateCategory3S(svalue, id)  {Cat3S[id]=svalue; }
function UpdateCategory4S(svalue, id)  {Cat4S[id]=svalue; }
function UpdateCategory5S(svalue, id)  {Cat5S[id]=svalue; }
function UpdateCategory6S(svalue, id)  {Cat6S[id]=svalue; }
function UpdateCategory7S(svalue, id)  {Cat7S[id]=svalue; }
function UpdateCategory8S(svalue, id)  {Cat8S[id]=svalue; }
function UpdateCategory9S(svalue, id)  {Cat9S[id]=svalue; }
function UpdateCategory10S(svalue, id) {Cat10S[id]=svalue; }


function UpdateCompleteCategory1(val1,val2,val3,val4,val5,val6,val7,val8,val9,val10,val11,skill1,skill2,skill3,skill4,skill5,skill6,skill7,skill8,skill9,skill10,skill11,skill12,skill13,skill14,skill15,skill16,skill17,skill18,name)
{
CatName[0]=name;
UpdateCategory1(val1,0);
UpdateCategory1(val2,1);
UpdateCategory1(val3,2);
UpdateCategory1(val4,3);
UpdateCategory1(val5,4);
UpdateCategory1(val6,5);
UpdateCategory1(val7,6);
UpdateCategory1(val8,7);
UpdateCategory1(val9,8);
UpdateCategory1(val10,9);
UpdateCategory1(val11,10);
');
    for ($t = 0; $t < 18; $t++) {
        $game->out('UpdateCategory1S(skill' . ($t + 1) . ',' . $t . ');');
    }
    $game->out('
Change();
}
function UpdateCompleteCategory2(val1,val2,val3,val4,val5,val6,val7,val8,val9,val10,val11,skill1,skill2,skill3,skill4,skill5,skill6,skill7,skill8,skill9,skill10,skill11,skill12,skill13,skill14,skill15,skill16,skill17,skill18,name)
{
CatName[1]=name;
UpdateCategory2(val1,0);
UpdateCategory2(val2,1);
UpdateCategory2(val3,2);
UpdateCategory2(val4,3);
UpdateCategory2(val5,4);
UpdateCategory2(val6,5);
UpdateCategory2(val7,6);
UpdateCategory2(val8,7);
UpdateCategory2(val9,8);
UpdateCategory2(val10,9);
UpdateCategory2(val11,10);
');
    for ($t = 0; $t < 18; $t++) {
        $game->out('UpdateCategory2S(skill' . ($t + 1) . ',' . $t . ');');
    }
    $game->out('
Change();
}
function UpdateCompleteCategory3(val1,val2,val3,val4,val5,val6,val7,val8,val9,val10,val11,skill1,skill2,skill3,skill4,skill5,skill6,skill7,skill8,skill9,skill10,skill11,skill12,skill13,skill14,skill15,skill16,skill17,skill18,name)
{
CatName[2]=name;
UpdateCategory3(val1,0);
UpdateCategory3(val2,1);
UpdateCategory3(val3,2);
UpdateCategory3(val4,3);
UpdateCategory3(val5,4);
UpdateCategory3(val6,5);
UpdateCategory3(val7,6);
UpdateCategory3(val8,7);
UpdateCategory3(val9,8);
UpdateCategory3(val10,9);
UpdateCategory3(val11,10);
');
    for ($t = 0; $t < 18; $t++) {
        $game->out('UpdateCategory3S(skill' . ($t + 1) . ',' . $t . ');');
    }
    $game->out('
Change();
}
function UpdateCompleteCategory4(val1,val2,val3,val4,val5,val6,val7,val8,val9,val10,val11,skill1,skill2,skill3,skill4,skill5,skill6,skill7,skill8,skill9,skill10,skill11,skill12,skill13,skill14,skill15,skill16,skill17,skill18,name)
{
CatName[3]=name;
UpdateCategory4(val1,0);
UpdateCategory4(val2,1);
UpdateCategory4(val3,2);
UpdateCategory4(val4,3);
UpdateCategory4(val5,4);
UpdateCategory4(val6,5);
UpdateCategory4(val7,6);
UpdateCategory4(val8,7);
UpdateCategory4(val9,8);
UpdateCategory4(val10,9);
UpdateCategory4(val11,10);
');
    for ($t = 0; $t < 18; $t++) {
        $game->out('UpdateCategory4S(skill' . ($t + 1) . ',' . $t . ');');
    }
    $game->out('
Change();
}
function UpdateCompleteCategory5(val1,val2,val3,val4,val5,val6,val7,val8,val9,val10,val11,skill1,skill2,skill3,skill4,skill5,skill6,skill7,skill8,skill9,skill10,skill11,skill12,skill13,skill14,skill15,skill16,skill17,skill18,name)
{
CatName[4]=name;
UpdateCategory5(val1,0);
UpdateCategory5(val2,1);
UpdateCategory5(val3,2);
UpdateCategory5(val4,3);
UpdateCategory5(val5,4);
UpdateCategory5(val6,5);
UpdateCategory5(val7,6);
UpdateCategory5(val8,7);
UpdateCategory5(val9,8);
UpdateCategory5(val10,9);
UpdateCategory5(val11,10);
');
    for ($t = 0; $t < 18; $t++) {
        $game->out('UpdateCategory5S(skill' . ($t + 1) . ',' . $t . ');');
    }
    $game->out('
Change();
}
function UpdateCompleteCategory6(val1,val2,val3,val4,val5,val6,val7,val8,val9,val10,val11,skill1,skill2,skill3,skill4,skill5,skill6,skill7,skill8,skill9,skill10,skill11,skill12,skill13,skill14,skill15,skill16,skill17,skill18,name)
{
CatName[5]=name;
UpdateCategory6(val1,0);
UpdateCategory6(val2,1);
UpdateCategory6(val3,2);
UpdateCategory6(val4,3);
UpdateCategory6(val5,4);
UpdateCategory6(val6,5);
UpdateCategory6(val7,6);
UpdateCategory6(val8,7);
UpdateCategory6(val9,8);
UpdateCategory6(val10,9);
UpdateCategory6(val11,10);
');
    for ($t = 0; $t < 18; $t++) {
        $game->out('UpdateCategory6S(skill' . ($t + 1) . ',' . $t . ');');
    }
    $game->out('
Change();
}
function UpdateCompleteCategory7(val1,val2,val3,val4,val5,val6,val7,val8,val9,val10,val11,skill1,skill2,skill3,skill4,skill5,skill6,skill7,skill8,skill9,skill10,skill11,skill12,skill13,skill14,skill15,skill16,skill17,skill18,name)
{
CatName[6]=name;
UpdateCategory7(val1,0);
UpdateCategory7(val2,1);
UpdateCategory7(val3,2);
UpdateCategory7(val4,3);
UpdateCategory7(val5,4);
UpdateCategory7(val6,5);
UpdateCategory7(val7,6);
UpdateCategory7(val8,7);
UpdateCategory7(val9,8);
UpdateCategory7(val10,9);
UpdateCategory7(val11,10);
');
    for ($t = 0; $t < 18; $t++) {
        $game->out('UpdateCategory7S(skill' . ($t + 1) . ',' . $t . ');');
    }
    $game->out('
Change();
}
function UpdateCompleteCategory8(val1,val2,val3,val4,val5,val6,val7,val8,val9,val10,val11,skill1,skill2,skill3,skill4,skill5,skill6,skill7,skill8,skill9,skill10,skill11,skill12,skill13,skill14,skill15,skill16,skill17,skill18,name)
{
CatName[7]=name;
UpdateCategory8(val1,0);
UpdateCategory8(val2,1);
UpdateCategory8(val3,2);
UpdateCategory8(val4,3);
UpdateCategory8(val5,4);
UpdateCategory8(val6,5);
UpdateCategory8(val7,6);
UpdateCategory8(val8,7);
UpdateCategory8(val9,8);
UpdateCategory8(val10,9);
UpdateCategory8(val11,10);
');
    for ($t = 0; $t < 18; $t++) {
        $game->out('UpdateCategory8S(skill' . ($t + 1) . ',' . $t . ');');
    }
    $game->out('
Change();
}
function UpdateCompleteCategory9(val1,val2,val3,val4,val5,val6,val7,val8,val9,val10,val11,skill1,skill2,skill3,skill4,skill5,skill6,skill7,skill8,skill9,skill10,skill11,skill12,skill13,skill14,skill15,skill16,skill17,skill18,name)
{
CatName[8]=name;
UpdateCategory9(val1,0);
UpdateCategory9(val2,1);
UpdateCategory9(val3,2);
UpdateCategory9(val4,3);
UpdateCategory9(val5,4);
UpdateCategory9(val6,5);
UpdateCategory9(val7,6);
UpdateCategory9(val8,7);
UpdateCategory9(val9,8);
UpdateCategory9(val10,9);
UpdateCategory9(val11,10);
');
    for ($t = 0; $t < 18; $t++) {
        $game->out('UpdateCategory9S(skill' . ($t + 1) . ',' . $t . ');');
    }
    $game->out('
Change();
}
function UpdateCompleteCategory10(val1,val2,val3,val4,val5,val6,val7,val8,val9,val10,val11,skill1,skill2,skill3,skill4,skill5,skill6,skill7,skill8,skill9,skill10,skill11,skill12,skill13,skill14,skill15,skill16,skill17,skill18,name)
{
CatName[9]=name;
UpdateCategory10(val1,0);
UpdateCategory10(val2,1);
UpdateCategory10(val3,2);
UpdateCategory10(val4,3);
UpdateCategory10(val5,4);
UpdateCategory10(val6,5);
UpdateCategory10(val7,6);
UpdateCategory10(val8,7);
UpdateCategory10(val9,8);
UpdateCategory10(val10,9);
UpdateCategory10(val11,10);
');
    for ($t = 0; $t < 18; $t++) {
        $game->out('UpdateCategory10S(skill' . ($t + 1) . ',' . $t . ');');
    }
    $game->out('
Change();
}


function getRadioByValue (radioButtonOrGroup, value) {
  if (!radioButtonOrGroup.length) { // single button
    if (radioButtonOrGroup.value == value)
      return radioButtonOrGroup;
    else
      return null;
  }
  else {
    for (var b = 0; b < radioButtonOrGroup.length; b++)
      if (radioButtonOrGroup[b].value == value)
        return radioButtonOrGroup[b];
    return null;
  }
}


function CheckEnergy()
{
var skill = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);

for (i=0;i<18;i++)
{
 skill[i]=Cat1S[i];
 skill[i]+=Cat2S[i];
 skill[i]+=Cat3S[i];
 skill[i]+=Cat4S[i];
 skill[i]+=Cat5S[i];
 skill[i]+=Cat6S[i];
 skill[i]+=Cat7S[i];
 skill[i]+=Cat8S[i];
 skill[i]+=Cat9S[i];
 skill[i]+=Cat10S[i];
}
skill[13]+=' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][27] . ';
skill[12]+=' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][26] . ';
if (skill[13]>skill[12])
{
alert("' . constant($game->sprache("TEXT54")) . ' ("+skill[13]+"/"+skill[12]+")!");
return false;
}


if (getRadioByValue(document.build_2.c1,91).checked)
if (!getRadioByValue(document.build_2.c6,98).checked)
{
alert("' . constant($game->sprache("TEXT55")) . '");
return false;
}


return true;
}

</script>

<table border=0 cellpadding=2 cellspacing=2 width=500 class="style_outer">
<tr><td align="center">

<span class="sub_caption">' . constant($game->sprache("TEXT1")) . ':</span>
<br><span class="sub_caption2">(2/3) ' . constant($game->sprache("TEXT56")) . '</span><br><br>

');
    $game->out('
<table boder=0 cellpadding=1 cellspacing=1>
<tr><td width=250 valign=top>

');
    $game->out('
<form name="build_2" method="post" action="' . parse_link('a=ship_template&view=create') . '">');
    foreach ($ship_components[$game->player['user_race']] as $key => $components) {
        $game->out('
<table boder=0 cellpadding=0 cellspacing=0 class="style_inner">
<tr><td width=300>
<span class="text_large">' . $components['name'] . '</span><br>
');
        $part1 = '<input type="radio" name="c' . ($key + 1) . '" value="-1" checked="checked"';
        $part2 = 'onClick ="return UpdateCompleteCategory' . ($key + 1) . '(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\'-\');">' . constant($game->sprache("TEXT57"));
        $game->out($part1 . ' ' . $part2 . ' [<a href="javascript:void(0);" onclick="return overlib(\'\', CAPTION, \'' . constant($game->sprache("TEXT57")) . '\', WIDTH, 400, ' . OVERLIB_STANDARD . ');" onmouseout="return nd();">' . constant($game->sprache("TEXT58")) . '</a>]<br>');
        for ($t = 0; $t < count($components) - 1; $t++) {
            if (ComponentMetRequirements($key, $t, $components[$t], $_POST['ship_torso'])) {
                $comp = $components[$t];
                $part1 = '<input type="radio" name="c' . ($key + 1) . '" value="' . $t . '"';
                $part2 = 'onClick ="return UpdateCompleteCategory' . ($key + 1) . '(' . $comp['resource_1'] . ',' . $comp['resource_2'] . ',' . $comp['resource_3'] . ',' . $comp['resource_4'] . ',' . $comp['buildtime'] * TICK_DURATION . ',' . $comp['unit_1'] . ',' . $comp['unit_2'] . ',' . $comp['unit_3'] . ',' . $comp['unit_4'] . ',' . $comp['unit_5'] . ',' . $comp['unit_6'] . ',' . $comp['value_1'] . ',' . $comp['value_2'] . ',' . $comp['value_3'] . ',' . $comp['value_4'] . ',' . $comp['value_5'] . ',' . $comp['value_6'] . ',' . $comp['value_7'] . ',' . $comp['value_8'] . ',' . $comp['value_9'] . ',' . $comp['value_10'] . ',' . $comp['value_11'] . ',' . $comp['value_12'] . ',' . $comp['value_13'] . ',' . $comp['value_14'] . ',' . $comp['value_15'] . ',' . $comp['value_16'] . ',' . $comp['value_17'] . ',' . $comp['value_18'] . ',\'' . $comp['name'] . '\');">' . $comp['name'];
                $game->out($part1 . ' ' . $part2 . ' [<a href="javascript:void(0);" onclick="return overlib(\'' . CreateInfoText($comp) . '\', CAPTION, \'' . $comp['name'] . '\', WIDTH, 400, ' . OVERLIB_STANDARD . ');" onmouseout="return nd();">' . constant($game->sprache("TEXT58")) . '</a>]<br>');
            }
        }
        $game->out('<br></td></tr></table>');
    }
    $game->out('
</td>
<td valign=top>

<table border=0 cellpadding=0 cellspacing=0 class="style_inner">
<tr valign=top>
<td width=240>
<u><span class="sub_caption2">' . constant($game->sprache("TEXT25")) . '</u>&nbsp;' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][29] . '</span><br>
<img src="' . FIXED_GFX_PATH . 'ship' . $game->player['user_race'] . '_' . $_POST['ship_torso'] . '.jpg"><br><br>
<span class="text_large">' . constant($game->sprache("TEXT26")) . '</span><br>
<i id="comp1">-</i><br>
<i id="comp2">-</i><br>
<i id="comp3">-</i><br>
<i id="comp4">-</i><br>
<i id="comp5">-</i><br>
<i id="comp6">-</i><br>
<i id="comp7">-</i><br>
<i id="comp8">-</i><br>
<i id="comp9">-</i><br>
<i id="comp10">-</i>

<br><br>
<span class="text_large">' . constant($game->sprache("TEXT4")) . '</span><br>
<u>' . constant($game->sprache("TEXT30")) . '</u><br><img src="' . $game->GFX_PATH . 'menu_metal_small.gif"><b id="price1">' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][0] . '</b>
&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_mineral_small.gif"><b id="price2">' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][1] . '</b>
&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_latinum_small.gif"><b id="price3">' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][2] . '</b>
&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_worker_small.gif"><b id="price4">' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][30] . '</b><br>
<img src="' . $game->GFX_PATH . 'menu_unit5_small.gif"><b id="price10">' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][11] . '</b>
&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit6_small.gif"><b id="price11">' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][12] . '</b><br>
<u>' . constant($game->sprache("TEXT5")) . '</u><b id="price5">' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][13] * TICK_DURATION . '</b> ' . constant($game->sprache("TEXT6")) . '<br>
<u>' . constant($game->sprache("TEXT31")) . '</u><br>
<img src="' . $game->GFX_PATH . 'menu_unit1_small.gif"><b id="price6">' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][3] . '</b>
&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit2_small.gif"><b id="price7">' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][4] . '</b>
&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit3_small.gif"><b id="price8">' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][5] . '</b>
&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit4_small.gif"><b id="price9">' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][6] . '</b><br><br>
<u>' . constant($game->sprache("TEXT59")) . '</u><br>
<img src="' . $game->GFX_PATH . 'menu_unit1_small.gif"><b id="price6a">' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][7] . '</b>
&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit2_small.gif"><b id="price7a">' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][8] . '</b>
&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit3_small.gif"><b id="price8a">' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][9] . '</b>
&nbsp;&nbsp;<img src="' . $game->GFX_PATH . 'menu_unit4_small.gif"><b id="price9a">' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][10] . '</b>
<br><br>
<span class="text_large">' . constant($game->sprache("TEXT60")) . '</span><br>
<table border=0 cellpadding=0 cellspacing=0><tr valign=top><td width=125>
<u>' . constant($game->sprache("TEXT8")) . '</u> <b id="skill1">' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][14] . '</b><br>
<u>' . constant($game->sprache("TEXT9")) . '</u> <b id="skill2">' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][15] . '</b><br>
<u>' . constant($game->sprache("TEXT10")) . '</u> <b id="skill3">' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][16] . '</b><br>
<u>' . constant($game->sprache("TEXT11")) . '</u> <b id="skill4">' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][17] . '</b><br>
<u>' . constant($game->sprache("TEXT12")) . '</u> <b id="skill5">' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][18] . '</b><br>
</td><td width=125>
<u>' . constant($game->sprache("TEXT13")) . '</u> <b id="skill6">' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][19] . '</b><br>
<u>' . constant($game->sprache("TEXT14")) . '</u> <b id="skill7">' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][20] . '</b><br>
<u>' . constant($game->sprache("TEXT15")) . '</u> <b id="skill8">' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][21] . '</b><br>
<u>' . constant($game->sprache("TEXT16")) . '</u> <b id="skill9">' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][22] . '</b><br>
<u>' . constant($game->sprache("TEXT94")) . '</u> <b id="skilla6">' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][32] . '</b><br>    
<u>' . constant($game->sprache("TEXT95")) . '</u> <b id="skilla7">' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][33] . '</b><br>    
</td></tr>
<tr valign=top><td width=100>
<u>' . constant($game->sprache("TEXT17")) . '</u> <b id="skill10">' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][23] . '</b><br>
<u>' . constant($game->sprache("TEXT18")) . '</u> <b id="skilla1">' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][24] . '</b><br>
<u>' . constant($game->sprache("TEXT19")) . '</u> <b id="skilla2">' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][25] . '</b><br>
</td><td width=100>
<u>' . constant($game->sprache("TEXT85")) . '</u> <b id="skilla8">' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][34] . '</b><br>
<u>' . constant($game->sprache("TEXT61")) . '</u><br><b id="skilla4">' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][27] . '</b>/<b id="skilla3">' . $SHIP_TORSO[$game->player['user_race']][$_POST['ship_torso']][26] . '</b></td></tr></table>
</td>
</tr></table>

</td></tr></table>
<input type=hidden name="ship_torso" value="' . $_POST['ship_torso'] . '">
<br>
<br>
<input class="button_nosize" type="submit" name="step1" value="(1/3) ' . constant($game->sprache("TEXT51")) . '">&nbsp;&nbsp;&nbsp;
<input class="button_nosize" onClick="return CheckEnergy()" type="submit" name="step3" value="(3/3) ' . constant($game->sprache("TEXT52")) . '">
</form></td></tr></table>');
}
예제 #2
0
function TemplateMetRequirementsText($template)
{
    global $game;
    //global $ship_components;
    if ($game->player['user_points'] < GlobalTorsoReq($template['ship_torso'])) {
        $game->out('<tr><td>' . constant($game->sprache("TEXT0")) . ' ' . GlobalTorsoReq($template['ship_torso']) . ' ' . constant($game->sprache("TEXT1")) . '</td></tr>');
    }
    if ($game->planet['planet_points'] < LocalTorsoReq($template['ship_torso'])) {
        $game->out('<tr><td>' . constant($game->sprache("TEXT0")) . ' ' . LocalTorsoReq($template['ship_torso']) . ' ' . constant($game->sprache("TEXT2")) . '</td></tr>');
    }
    if (!ComponentMetRequirements(0, $template['component_1'], $template['ship_torso'])) {
    }
    if (!ComponentMetRequirements(1, $template['component_2'], $template['ship_torso'])) {
    }
    if (!ComponentMetRequirements(2, $template['component_3'], $template['ship_torso'])) {
    }
    if (!ComponentMetRequirements(3, $template['component_4'], $template['ship_torso'])) {
    }
    if (!ComponentMetRequirements(4, $template['component_5'], $template['ship_torso'])) {
    }
    if (!ComponentMetRequirements(5, $template['component_6'], $template['ship_torso'])) {
    }
    if (!ComponentMetRequirements(6, $template['component_7'], $template['ship_torso'])) {
    }
    if (!ComponentMetRequirements(7, $template['component_8'], $template['ship_torso'])) {
    }
    if (!ComponentMetRequirements(8, $template['component_9'], $template['ship_torso'])) {
    }
    if (!ComponentMetRequirements(9, $template['component_10'], $template['ship_torso'])) {
    }
    //if ($game->planet['planet_points']<TorsoRequirements($template['ship_torso'],0) || $game->player['user_points']<TorsoRequirements($template['ship_torso'],0)) return 0;
    //echo $template['ship_torso'];
    //return 1;
}