コード例 #1
0
ファイル: report.php プロジェクト: antt1995/starkicktraders
echo "<TR BGCOLOR=\"$color_line1\"><TD><i>$l_shipavg</i></TD><TD align=center>$l_level " . NUMBER($shipavg, 2) . "</TD><td></td></TR>";
echo "</TABLE><P>";

//echo "</TD><TD VALIGN=TOP>";
echo "<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1 WIDTH=\"100%\">";
$holds_used = $shipinfo[ship_ore] + $shipinfo[ship_organics] + $shipinfo[ship_goods] + $shipinfo[ship_colonists];
$holds_max = NUM_HOLDS($shipinfo[hull]);
echo "<TR BGCOLOR=\"$color_header\"><TD><B>$l_holds</B></TD><TD ALIGN=RIGHT><B>" . NUMBER($holds_used) . " / " . NUMBER($holds_max) . "</B></TD></TR>";
echo "<TR BGCOLOR=\"$color_line1\"><TD>$l_ore</TD><TD ALIGN=RIGHT>" . NUMBER($shipinfo[ship_ore]) . "</TD></TR>";
echo "<TR BGCOLOR=\"$color_line2\"><TD>$l_organics</TD><TD ALIGN=RIGHT>" . NUMBER($shipinfo[ship_organics]) . "</TD></TR>";
echo "<TR BGCOLOR=\"$color_line1\"><TD>$l_goods</TD><TD ALIGN=RIGHT>" . NUMBER($shipinfo[ship_goods]) . "</TD></TR>";
echo "<TR BGCOLOR=\"$color_line2\"><TD>$l_colonists</TD><TD ALIGN=RIGHT>" . NUMBER($shipinfo[ship_colonists]) . "</TD></TR>";
//echo "<TR><TD>&nbsp;</TD></TR>";
echo "</TABLE><P>";
echo "<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1 WIDTH=\"100%\">";
$armour_pts_max = NUM_ARMOUR($shipinfo[armour]);
$ship_fighters_max = NUM_FIGHTERS($shipinfo[computer]);
$torps_max = NUM_TORPEDOES($shipinfo[torp_launchers]);
echo "<TR BGCOLOR=\"$color_header\"><TD COLSPAN=2 align=center><B>$l_arm_weap</B></TD></TR>";
echo "<TR BGCOLOR=\"$color_line1\"><TD>$l_armourpts</TD><TD ALIGN=RIGHT>" . NUMBER($shipinfo[armour_pts]) . " / " . NUMBER($armour_pts_max) . "</TD></TR>";
echo "<TR BGCOLOR=\"$color_line2\"><TD>$l_fighters</TD><TD ALIGN=RIGHT>" . NUMBER($shipinfo[ship_fighters]) . " / " . NUMBER($ship_fighters_max) . "</TD></TR>";
echo "<TR BGCOLOR=\"$color_line1\"><TD>$l_torps</TD><TD ALIGN=RIGHT>" . NUMBER($shipinfo[torps]) . " / " . NUMBER($torps_max) . "</TD></TR>";
//echo "<TR><TD>&nbsp;</TD></TR>";
echo "</TABLE><p>";
//echo "</TD><TD VALIGN=TOP>";
echo "<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1 WIDTH=\"100%\">";
$energy_max = NUM_ENERGY($shipinfo[power]);
echo "<TR BGCOLOR=\"$color_header\"><TD><B>$l_energy</B></TD><TD ALIGN=RIGHT><B>" . NUMBER($shipinfo[ship_energy]) . " / " . NUMBER($energy_max) . "</B></TD></TR>";
echo "</TABLE><P>";
echo "<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1 WIDTH=\"100%\">";
echo "<TR BGCOLOR=\"$color_header\"><TD COLSPAN=2 align=center><B>$l_devices</B></TD></TR>";
コード例 #2
0
function createFur($orders)
{
	global $db,$dbtables,$sector_max;
      // Create A New Furangee
     // Create Furangee Name
	$nametry = 1;
	$namecheck = false;
	while ((!$namecheck) and ($nametry <= 9)) {
		$Sylable1 = array("Ak","Al","Ar","B","Br","D","F","Fr","G","Gr","K","Kr","N","Ol","Om","P","Qu","R","S","Z");
		$Sylable2 = array("a","ar","aka","aza","e","el","i","in","int","ili","ish","ido","ir","o","oi","or","os","ov","u","un");
		$Sylable3 = array("ag","al","ak","ba","dar","g","ga","k","ka","kar","kil","l","n","nt","ol","r","s","ta","til","x");
		$sy1roll = rand(0,19);
    	$sy2roll = rand(0,19);
		$sy3roll = rand(0,19);
		$character = $Sylable1[$sy1roll] . $Sylable2[$sy2roll] . $Sylable3[$sy3roll];
		$emailname = str_replace(" ","_",$character) . "@furangee";
		$resultnm = $db->Execute ("select email from $dbtables[players] where email='$emailname'");
		if (!$resultnm->EOF) {
			echo "Email exists for $character [$emailname]<br>";
			$nametry++;
		} else {
			$namecheck=true;
		}
	}
	if ($namecheck == false) {
		echo "Failed to create Furangee!<br>";
		return;
	}	
	// Create Ship Name
	$shipname = "Furangee- " . $character; 
	// Select Random Sector
	$sector = rand(1,$sector_max); 
	$furlevel = rand(3,30);
    $active="on";
	$aggression=0; // 0 = Peaceful 1 = Attack Sometimes 2=Attack Always
	$makepass="******";
   	$maxenergy = NUM_ENERGY($furlevel);
    $maxarmour = NUM_ARMOUR($furlevel);
    $maxfighters = NUM_FIGHTERS($furlevel);
    $maxtorps = NUM_TORPEDOES($furlevel);
    $maxcloak = min(22,$furlevel);
    $stamp=date("Y-m-d H:i:s");
	// *****************************************************************************
	// *** ADD FURANGEE RECORD TO ships TABLE ... MODIFY IF ships SCHEMA CHANGES ***
	// *****************************************************************************
	$result2 = $db->Execute("INSERT INTO $dbtables[players] (`player_id`, `character_name`, `password`, `email`,  `credits`, `sector`,  `on_planet`,`turns_used`, `last_login`, `rating`, `score`, `team`, `team_invite`, `interface`, `ip_address`, `planet_id`, `preset1`, `preset2`, `preset3`, `trade_colonists`, `trade_fighters`, `trade_torps`, `trade_energy`, `cleared_defences`, `lang`, `alerts`,  `alert2`, `subscribed`, `ore_price`, `organics_price`, `goods_price`, `energy_price`, `currentship`,`preset4`,`preset5`,`preset6`) VALUES ('', '$character', '$makepass', '$emailname','10000000', '$sector','N', '3000', '$stamp', '0', '0', '0', '0', 'N', '127.0.0.1', '0', '0', '0', '0', 'N', 'N', 'N', 'N', NULL, '$default_lang', 'N', 'N', NULL, '0', '0', '0', '0', '1',0,0,0)");
	$res = $db->Execute("SELECT player_id from $dbtables[players] WHERE email='$emailname'");
  	$player_id = $res->fields[player_id]; 
	$shiptype=20; // We have a special furangee ship now.
	if ($furlevel > 16) {
		$ewd = rand(1,2);
	} else {
		$ewd = 0;
	}
	$result3 = $db->Execute("INSERT INTO $dbtables[ships] (`ship_id`, `player_id`, `type`, `ship_name`, `ship_destroyed`, `hull`, `engines`, `power`, `computer`, `sensors`, `beams`, `torp_launchers`, `torps`, `shields`, `armour`, `armour_pts`, `cloak`, `sector`, `ship_ore`, `ship_organics`, `ship_goods`, `ship_energy`, `ship_colonists`, `ship_fighters`, `tow`, `on_planet`, `dev_warpedit`, `dev_genesis`, `dev_beacon`, `dev_emerwarp`, `dev_escapepod`, `dev_fuelscoop`, `dev_minedeflector`, `planet_id`, `cleared_defences`, `dev_lssd`, `dev_sectorwmd`) VALUES ('', $player_id, '$shiptype', '$shipname', 'N', $furlevel,$furlevel,$furlevel,$furlevel,$furlevel,$furlevel,$furlevel,$maxtorps,$furlevel,$furlevel,$maxarmour,$maxcloak, $sector,0,0,0,$maxenergy,0,$maxfighters, '0', 'N', '0', '0', '0', '$ewd', 'N', 'N', '0', '0', NULL, 'N', 'N')"); 
    $result4 = $db->Execute("UPDATE $dbtables[players] SET currentship=LAST_INSERT_ID() WHERE player_id=$player_id");
    if(!$result2 | !result3) {
       	echo $db->ErrorMsg() . "<br>";
    } else {
       	echo "Level $furlevel Furangee has been created.<BR>";
		// Choose a preferance
		$commods = array("ore","goods","organics");
		$prefer = $commods[rand(0,2)];
   		$result3 = $db->Execute("INSERT INTO $dbtables[furangee] (furangee_id,active,aggression,orders,prefer) VALUES('$emailname','Y','$aggression','$orders','$prefer')");
   		if(!$result3) {
    	   	echo $db->ErrorMsg() . "<br>";
  		} else {
    	  	echo "$emailname with orders $orders<br>";
   		}
	}
}
コード例 #3
0
        if ($errflag==0)
        {
          $makepass="";
          $syllables="er,in,tia,wol,fe,pre,vet,jo,nes,al,len,son,cha,ir,ler,bo,ok,tio,nar,sim,ple,bla,ten,toe,cho,co,lat,spe,ak,er,po,co,lor,pen,cil,li,ght,wh,at,the,he,ck,is,mam,bo,no,fi,ve,any,way,pol,iti,cs,ra,dio,sou,rce,sea,rch,pa,per,com,bo,sp,eak,st,fi,rst,gr,oup,boy,ea,gle,tr,ail,bi,ble,brb,pri,dee,kay,en,be,se";
          $syllable_array=explode(",", $syllables);
          srand((double)microtime()*1000000);
          for ($count=1;$count<=4;$count++) {
            if (rand()%10 == 1) {
              $makepass .= sprintf("%0.0f",(rand()%50)+1);
            } else {
              $makepass .= sprintf("%s",$syllable_array[rand()%62]);
            }
          }
          if ($furlevel=='') $furlevel=0;
          $maxenergy = NUM_ENERGY($furlevel);
          $maxarmour = NUM_ARMOUR($furlevel);
          $maxfighters = NUM_FIGHTERS($furlevel);
          $maxtorps = NUM_TORPEDOES($furlevel);
          $stamp=date("Y-m-d H:i:s");
// *****************************************************************************
// *** ADD FURANGEE RECORD TO ships TABLE ... MODIFY IF ships SCHEMA CHANGES ***
// *****************************************************************************
		$result2 = $db->Execute("INSERT INTO $dbtables[players] (`player_id`, `character_name`, `password`, `email`,  `credits`, `sector`,  `on_planet`,`turns_used`, `last_login`, `rating`, `score`, `team`, `team_invite`, `interface`, `ip_address`, `planet_id`, `preset1`, `preset2`, `preset3`, `trade_colonists`, `trade_fighters`, `trade_torps`, `trade_energy`, `cleared_defences`, `lang`, `alerts`,  `alert2`, `subscribed`, `ore_price`, `organics_price`, `goods_price`, `energy_price`, `currentship`,`preset4`,`preset5`,`preset6`) VALUES ('', '$character', '$makepass', '$emailname','10000000', '$sector','N', '3000', '$stamp', '0', '0', '0', '0', 'N', '127.0.0.1', '0', '0', '0', '0', 'N', 'N', 'N', 'N', NULL, '$default_lang', 'N', 'N', NULL, '0', '0', '0', '0', '1',0,0,0)");
		$res = $db->Execute("SELECT player_id from $dbtables[players] WHERE email='$emailname'");
  		$player_id = $res->fields[player_id]; 
		// Calculate ship type
		$shipavg = $furlevel;
		if($shipavg < 4)
		   $shiptype = 1;
		elseif($shipavg < 6)
		   $shiptype = 2;
コード例 #4
0
function furangeeregen()
{
  // *******************************
  // *** SETUP GENERAL VARIABLES ***
  // *******************************
  global $playerinfo;
  global $shipinfo;
  global $furangeeisdead;
  global $db, $dbtables;

  // *******************************
  // *** LETS REGENERATE ENERGY ****
  // *******************************
  $maxenergy = NUM_ENERGY($shipinfo[power]);
  if ($shipinfo[ship_energy] <= ($maxenergy - 50))  // *** STOP REGEN WHEN WITHIN 50 OF MAX ***
  {                                                   // *** REGEN HALF OF REMAINING ENERGY ***
    $shipinfo[ship_energy] = $shipinfo[ship_energy] + round(($maxenergy - $shipinfo[ship_energy])/2);
    $gene = "regenerated Energy to $shipinfo[ship_energy] units,";
  }

  // *******************************
  // *** LETS REGENERATE ARMOUR ****
  // *******************************
  $maxarmour = NUM_ARMOUR($shipinfo[armour]);
  if ($shipinfo[armour_pts] <= ($maxarmour - 50))  // *** STOP REGEN WHEN WITHIN 50 OF MAX ***
  {                                                  // *** REGEN HALF OF REMAINING ARMOUR ***
    $shipinfo[armour_pts] = $shipinfo[armour_pts] + round(($maxarmour - $shipinfo[armour_pts])/2);
    $gena = "regenerated Armour to $shipinfo[armour_pts] points,";
  }

  // *******************************
  // *** LETS BUY FIGHTERS/TORPS ***
  // *******************************

  // *******************************
  // *** FURANGEE PAY 6/FIGHTER ****
  // *******************************
  if ($shipinfo[ship_fighters] < 0) {
  	playerlog($playerinfo[player_id], LOG_RAW, "Furangee had ".NUMBER($shipinfo[ship_fighters])." FIGHTERS!");
	$shipinfo[ship_fighters] = 0;
  }
  
  $available_fighters = NUM_FIGHTERS($shipinfo[computer]) - $shipinfo[ship_fighters];
  if ($available_fighters > 100000) {
    $available_fighters = round($available_fighters/6);
  }
  if (($playerinfo[credits]>5) && ($available_fighters>0))
  {
    if (round($playerinfo[credits]/50)>$available_fighters)
    {
      $purchase = ($available_fighters*50);
      $playerinfo[credits] = $playerinfo[credits] - $purchase;
      $shipinfo[ship_fighters] = $shipinfo[ship_fighters] + $available_fighters;
      $genf = "purchased $available_fighters fighters for $purchase credits,";
    }
    if (round($playerinfo[credits]/50)<=$available_fighters)
    {
      $purchase = round($playerinfo[credits]/50);
      $shipinfo[ship_fighters] = $shipinfo[ship_fighters] + $purchase/50;
      $genf = "purchased $purchase fighters for $playerinfo[credits] credits,";
      $playerinfo[credits] = 0;
    }
  } 

  // *******************************
  // *** FURANGEE PAY 3/TORPEDO ****
  // *******************************
  $available_torpedoes = (NUM_TORPEDOES($shipinfo[torp_launchers]) - $shipinfo[torps]);
  if ($available_torpedoes > 10000) {
	$available_torpedoes = round($available_torpedoes/6);
  }
  if (($playerinfo[credits]>24) && ($available_torpedoes>0))
  {
    if (round($playerinfo[credits]/25)>$available_torpedoes)
    {
      $purchase = $available_torpedoes*25;
      $playerinfo[credits] = $playerinfo[credits] - $purchase;
      $shipinfo[torps] = $shipinfo[torps] + $available_torpedoes;
      $gent = "purchased $available_torpedoes torpedoes for $purchase credits,";
    }
    if (round($playerinfo[credits]/25)<=$available_torpedoes)
    {
      $purchase = (round($playerinfo[credits]/25));
      $shipinfo[torps] = $shipinfo[torps] + $purchase;
      $gent = "purchased $purchase torpedoes for $playerinfo[credits] credits,";
      $playerinfo[credits] = 0;
    }
  } 

  // *********************************
  // *** UPDATE FURANGEE RECORD ******
  // *********************************
  $db->Execute ("UPDATE $dbtables[players] SET credits=$playerinfo[credits] WHERE player_id=$playerinfo[player_id]");
  $db->Execute ("UPDATE $dbtables[ships] SET ship_energy=$shipinfo[ship_energy], armour_pts=$shipinfo[armour_pts], ship_fighters=$shipinfo[ship_fighters], torps=$shipinfo[torps] WHERE player_id=$playerinfo[player_id] AND ship_id=$playerinfo[currentship]");
 if (!$genf=='' || !$gent=='')
 {
    playerlog($playerinfo[player_id], LOG_RAW, "Furangee $genf $gent and has been updated."); 
 }

}