#!/usr/local/bin/perl
$worldx = 128;
$worldy = 128;
$m_m_p_d = 1000;
$s_p_etu = 12;
$etu_per_update = 50;
$fgrate= 0.0012;
$fcrate = 0.0013;
$eatrate= 0.0010;
$babyeat = 0.0120;
$obrate = 0.005;
$uwbrate = 0.0035;
$bankint= 0.25;
$money_civ = 0.0083333;
$money_uw = 0.0037777;
$money_mil = -0.0833333;
$money_res = -0.0083333;
$hap_cons = 5000;
$edu_cons = 4000;
$hap_avg = 48;
$edu_avg = 196;
$easy_tech = 0.75;
$hard_tech = 0.0;
$tech_log_base = 1.0;
$ally_factor = 64.0;
$level_age_rate = 96.0;
$btu_build_rate = 0.0004;
$max_btus= 512;

open(VERSION,"ver");
while(<VERSION>)
 {
 if (/^World size is ([0-9]*) by ([0-9]*)\.$/o)
   {
   $worldx = $1;
   $worldy = $2;   
   }
 elsif (/^An Empire time unit is ([0-9]*) seconds* long\.$/o)
   {
   $s_p_etu = $1;
   }
 elsif (/^An update consists of ([0-9]*) empire time units\.$/o)
   {
   $etu_per_update=$1;
   }
 elsif (/^Each country is allowed to be logged in ([0-9]*) minutes a day\.$/o)
   {
   $m_m_p_d=$1;
   }
 elsif (/^It takes ([0-9.]*) civilians to produce a BTU in one time unit\.$/o)
   {
   $btu_build_rate=1/($1*100);
   }
 elsif (/^A non-aggi, 100 fertility sector can grow ([0-9.]*) food per etu\.$/o)
   {
   $fgrate=$1/100;
   }
 elsif (/^1000 civilians will harvest ([0-9.]*) food per etu\.$/o)
   {
   $fcrate=$1/1000;
   }
 elsif (/^1000 civilians will give birth to ([0-9.]*) babies per etu\.$/o)
   {
   $obrate=$1/1000;
   }
 elsif (/^1000 uncompensated workers will give birth to ([0-9.]*) babies\.$/o)
   {
   $uwbrate=$1/1000;
   }
 elsif (/^In one time unit, 1000 people eat ([0-9.]*) units of food\.$/o)
   {
   $eatrate=$1/1000;
   }
 elsif (/^1000 babies eat ([0-9.]*) units of food becoming adults\.$/o)
   {
   $babyeat=$1/1000;
   }
 elsif (/^Banks pay \$([0-9.]*) in interest per 1000 gold bars per etu\.$/o)
   {
   $bankint=$1/1000;
   }
 elsif (/^1000 civilians generate \$([0-9.]*), uncompensated workers \$([0-9.]*) each time unit\.$/o)
   {
   $money_civ = $1/1000;
   $money_uw = $2/1000;
   }
 elsif (/^1000 active military cost \$([0-9.]*), reserves cost \$([0-9.]*)\.$/o)
   {
   $money_mil=-$1/1000;
   $money_res=-$2/1000;
   }
 elsif (/^Happiness p\.e\. requires 1 happy stroller per ([0-9.]*) civ\.$/o)
   {
   $hap_cons=$1;
   }
 elsif (/^Education p\.e\. requires 1 class of graduates per ([0-9.]*) civ\.$/o)
   {
   $edu_cons=$1;
   }
 elsif (/^Happiness is averaged over ([0-9]*) time units\.$/o)
   {
   $hap_avg=$1;
   }
 elsif (/^Education is averaged over ([0-9]*) time units\.$/o)
   {
   $edu_avg=$1;
   }
 elsif (/^The technology.research boost you get from your allies is ([0-9.]*)%\.$/o)
   {
   $ally_factor=100/$1;
   }
 elsif (/^Nation levels \(tech etc\.\) decline 1% every ([0-9.]*) time units\.$/o)
   {
   $level_age_rate=$1;
   }
 elsif (/^Tech Buildup is limited to logrithmic growth \(base ([0-9.]*)\) after ([0-9.]*)\.$/o)
   {
   $tech_log_base=$1;
   $easy_tech=$2-$1;
   }
 }
close(VERSION);
