Source Files

Discussion in 'Press Start' started by The Exception, Mar 1, 2007.

  1. The Exception

    The Exception The One Who Will Be Administrator Super Moderator

    Joined:
    Apr 10, 2004
    Messages:
    21,942
    Likes Received:
    6,161
    Trophy Points:
    83
    Ratings:
    +6,317
    These are the source files for the game if anyone is curious and wants to poke around.
     
    • Agree Agree x 1
  2. NAHTMMM

    NAHTMMM Perpetually sondering

    Joined:
    Mar 29, 2004
    Messages:
    14,714
    Likes Received:
    4,914
    Trophy Points:
    83
    Occupation:
    dork
    Location:
    Wisconsin
    Ratings:
    +9,942
    Looks like the "planetary apocalypse" thing would only affect planets with large populations.

    At least 5% of a sector's mines are going to hit you (if they bother with you at all, of course).

    Looks like default settings are for Ore and Goods ports to be more common than Organics and Energy ports. Explains all the streaks of 3+ Goods or Ore ports ;) . . .

    [?=This looks like the part pertaining to salvage.]
    PHP:
    $salv_credits $targetinfo['credits'];
                }

              
    $free_ore round($targetinfo['ship_ore']/2);
              
    $free_organics round($targetinfo['ship_organics']/2);
              
    $free_goods round($targetinfo['ship_goods']/2);
              
    $free_holds NUM_HOLDS($playerinfo['hull']) - $playerinfo['ship_ore'
    $playerinfo['ship_organics'] - $playerinfo['ship_goods'] - $playerinfo['ship_colonists'];
              if(
    $free_holds $free_goods)
              {
                
    $salv_goods=$free_goods;
                
    $free_holds=$free_holds-$free_goods;
              }
              elseif(
    $free_holds 0)
              {
                
    $salv_goods=$free_holds;
                
    $free_holds=0;
              }
              else
              {
                
    $salv_goods=0;
              }
              if(
    $free_holds $free_ore)
              {
                
    $salv_ore=$free_ore;
                
    $free_holds=$free_holds-$free_ore;
              }
              elseif(
    $free_holds 0)
              {
                
    $salv_ore=$free_holds;
                
    $free_holds=0;
              }
              else
              {
                
    $salv_ore=0;
              }
              if(
    $free_holds $free_organics)
              {
                
    $salv_organics=$free_organics;
                
    $free_holds=$free_holds-$free_organics;
              }
              elseif(
    $free_holds 0)
              {
                
    $salv_organics=$free_holds;
                
    $free_holds=0;
              }
              else
              {
                
    $salv_organics=0;
              }
              
    $ship_value=$upgrade_cost*(round(mypw($upgrade_factor$targetinfo['hull']))+round(mypw($upgrade_factor$targetinfo['engines']))
    +
    round(mypw($upgrade_factor$targetinfo['power']))+round(mypw($upgrade_factor$targetinfo['computer']))+round(mypw($upgrade_factor,$targetinfo['sensors']))
    +
    round(mypw($upgrade_factor,$targetinfo['beams']))+round(mypw($upgrade_factor$targetinfo['torp_launchers']))
    +
    round(mypw($upgrade_factor,$targetinfo['shields']))+round(mypw($upgrade_factor$targetinfo['armor']))+round(mypw($upgrade_factor$targetinfo['cloak'])));
              
    $ship_salvage_rate=rand(10,20);
              
    $ship_salvage=$ship_value*$ship_salvage_rate/100+$salv_credits;  
    //added credits for xenobe - 0 if normal player - GunSlinger

              
    $l_att_ysalv=str_replace("[salv_ore]",$salv_ore,$l_att_ysalv);
              
    $l_att_ysalv=str_replace("[salv_organics]",$salv_organics,$l_att_ysalv);
              
    $l_att_ysalv=str_replace("[salv_goods]",$salv_goods,$l_att_ysalv);
              
    $l_att_ysalv=str_replace("[ship_salvage_rate]",$ship_salvage_rate,$l_att_ysalv);
              
    $l_att_ysalv=str_replace("[ship_salvage]",$ship_salvage,$l_att_ysalv);
              
    $l_att_ysalv=str_replace("[rating_change]",NUMBER(abs($rating_change)),$l_att_ysalv);
    Or maybe not, the next section of that file seems to cover the same ground. :unsure: . . .Wow, that all looks totally readable once it's formatted properly :whacko:[/?]
     
  3. The Original Faceman

    The Original Faceman Lasagna Artist

    Joined:
    Mar 29, 2004
    Messages:
    40,856
    Likes Received:
    16,995
    Trophy Points:
    83
    Gender:
    Male
    Ratings:
    +28,818
    I'm a year off from a law degree and have no idea what that is.

    Do you recommend suicide?
     
  4. CaptainChewbacca

    CaptainChewbacca Lord of Rodly Might

    Joined:
    Apr 3, 2004
    Messages:
    5,614
    Likes Received:
    2,005
    Trophy Points:
    0
    Ratings:
    +2,007
    Weirdness. I was hit by 100% of a system's mines. That shouldn't happen.
     
  5. NAHTMMM

    NAHTMMM Perpetually sondering

    Joined:
    Mar 29, 2004
    Messages:
    14,714
    Likes Received:
    4,914
    Trophy Points:
    83
    Occupation:
    dork
    Location:
    Wisconsin
    Ratings:
    +9,942
    What's this?? There might actually be a consistent function determining how long it takes to realspace between given sectors?!? :soma:

    PHP:
    $deg pi() / 180;

    if(isset(
    $destination))
    {
      
    $destination round(abs($destination));
    }

      
    $result2 $db->Execute("SELECT angle1,angle2,distance FROM $dbtables[universe] WHERE sector_id=$playerinfo[sector]");
      
    $start $result2->fields;
      
    $result3 $db->Execute("SELECT angle1,angle2,distance FROM $dbtables[universe] WHERE sector_id=$destination");
      
    $finish $result3->fields;
      
    $sa1 $start[angle1] * $deg;
      
    $sa2 $start[angle2] * $deg;
      
    $fa1 $finish[angle1] * $deg;
      
    $fa2 $finish[angle2] * $deg;
      
    $x = ($start[distance] * sin($sa1) * cos($sa2)) - ($finish[distance] * sin($fa1) * cos($fa2));
      
    $y = ($start[distance] * sin($sa1) * sin($sa2)) - ($finish[distance] * sin($fa1) * sin($fa2));
      
    $z = ($start[distance] * cos($sa1)) - ($finish[distance] * cos($fa1));
      
    $distance round(sqrt(mypw($x2) + mypw($y2) + mypw($z2)));
      
    $shipspeed mypw($level_factor$playerinfo[engines]);
      
    $triptime round($distance $shipspeed);
      if(
    $triptime == && $destination != $playerinfo[sector])
      {
        
    $triptime 1;
      }
      if(
    $destination == $playerinfo[sector])
      {
        
    $triptime 0;
        
    $energyscooped 0;
      }
    And the energy scooped = 100 * distance traveled.
     
  6. NAHTMMM

    NAHTMMM Perpetually sondering

    Joined:
    Mar 29, 2004
    Messages:
    14,714
    Likes Received:
    4,914
    Trophy Points:
    83
    Occupation:
    dork
    Location:
    Wisconsin
    Ratings:
    +9,942
    HA! I win! :crosis: Nav computer's ability does increase according to the triangular numbers.
     
  7. CaptainChewbacca

    CaptainChewbacca Lord of Rodly Might

    Joined:
    Apr 3, 2004
    Messages:
    5,614
    Likes Received:
    2,005
    Trophy Points:
    0
    Ratings:
    +2,007
    Yes, you... 'win'.