home *** CD-ROM | disk | FTP | other *** search
/ Gambler 33 A / GAMBLERCD33A.BIN / Demos / CIVILCTP / setup / data / civdemo.ctp / ctp_data / default / aidata / aiploader.fli next >
Text File  |  1999-06-23  |  14KB  |  576 lines

  1. // aiploader.fli
  2.  
  3. // This is used to make sure the aips load in the right order.
  4. output primary_loaded[0.0, 2.0 ] = 0.0
  5.     tri yes_primary_loaded(primary_loaded, 1.0, 0.5)
  6.  
  7. // pick my aip
  8. output red_dog_test[0.0,2.0] = 0.0
  9.     tri yes_red_dog_test(red_dog_test, 1.0, 0.5)
  10.  
  11.     if(reddog1_count or reddog2_count or reddog3_count or reddog4_count)
  12.     {
  13.         yes_red_dog_test
  14.     }
  15.  
  16. action load("sally.aip") when (red_dog_test > 0.9)
  17. action load("nosally.aip") when (red_dog_test < 0.9)
  18.  
  19. action load("lowdist.aip") when (count < 5)
  20. action load("highdist.aip") when (count > 5)
  21.  
  22. output warmany_test[0.0, 2.0] = 0.0
  23.     tri yes_warmany(warmany_test, 1.0, 0.5)
  24.  
  25. output warfew_test[0.0, 2.0] = 0.0
  26.     tri yes_warfew(warfew_test, 1.0, 0.5)
  27.  
  28. output scifew_test[0.0, 2.0] = 0.0
  29.     tri yes_scifew(scifew_test, 1.0, 0.5)
  30.  
  31. output scimany_test[0.0, 2.0] = 0.0
  32.     tri yes_scimany(scimany_test, 1.0, 0.5)
  33.  
  34. if(yes_warrior and yes_settle_dense)
  35. {
  36.     yes_warmany
  37. }
  38.  
  39. if(yes_warrior and yes_settle_loose)
  40. {
  41.     yes_warfew
  42. }
  43.  
  44. if(yes_scientist and yes_settle_dense)
  45. {
  46.     yes_scimany
  47. }
  48.  
  49. if(yes_scientist and yes_settle_loose)
  50. {
  51.     yes_scifew
  52. }
  53.  
  54. output few_cities_test[0.0, 2.0] = 0.0
  55.     tri yes_few_cities(few_cities_test, 1.0, 0.5)
  56.  
  57. output fewplus_cities_test[0.0, 2.0] = 0.0
  58.     tri yes_fewplus_cities(fewplus_cities_test, 1.0, 0.5)
  59.  
  60. if(a1to5_num_cities or a3to7_num_cities or a5to9_num_cities)
  61.     {
  62.     yes_few_cities
  63.     }
  64.  
  65. if(a1to5_num_cities 
  66.     or a3to7_num_cities 
  67.     or a5to9_num_cities 
  68.     or a7to11_num_cities 
  69.     or a9to13_num_cities)
  70.     {
  71.     yes_fewplus_cities
  72.     }
  73.  
  74. output early_aip[0.0, 2.0] =0.0
  75.     tri found_early_aip(early_aip, 1.0, 0.5)
  76.  
  77. if(zero_at_war and (a48_96_map or a70_140_map or a64_128_map) 
  78.     and (a1_num_cities or a2_num_cities or a3to5_num_cities)
  79.     and not (chieftain or warlord or prince ))
  80.     {
  81.         yes_mass_settle_aip
  82.         found_early_aip
  83.         yes_primary_loaded
  84.     }
  85.  
  86. if(zero_at_war and (a48_96_map or a70_140_map or a64_128_map) 
  87.     and (a1_num_cities or a2_num_cities or a3to5_num_cities)
  88.     and (chieftain or warlord or prince ))
  89.     {
  90.         yes_mass_settle_sandbag_aip
  91.         found_early_aip
  92.         yes_primary_loaded
  93.     }
  94.  
  95. action load("masssettle.aip") when (mass_settle_aip > 0.8)
  96. action load("masssettle_sandbag.aip") when (mass_settle_sandbag_aip > 0.8)
  97.  
  98. if((human_capitol_ten_or_less or human_capitol_ten_to_fifteen or aover4unit_to_city_best_human_ratio) 
  99.     and yes_opening_gambit_time 
  100.     and yes_primary_loaded )
  101.     {
  102.         yes_citywall_aip
  103.     }
  104.  
  105. if((human_capitol_ten_or_less or human_capitol_ten_to_fifteen or aover4unit_to_city_best_human_ratio) 
  106.     and not a0to15_turns 
  107.     and yes_opening_gambit_time 
  108.     and yes_primary_loaded 
  109.     and not a35_or_more_turns)
  110.     {
  111.         yes_survival_mode_aip
  112.     }
  113.  
  114. //////////////////////
  115. //// LOAD MILFEW /////
  116. //////////////////////
  117.         
  118. if(not found_early_aip and yes_warfew )
  119.     {
  120.         yes_milfew_aip
  121.         yes_improvement_build_normal_aip
  122.         yes_primary_loaded
  123.     }
  124.  
  125. //////////////////////
  126. //// LOAD MILMANY ////
  127. //////////////////////
  128.  
  129. if(not found_early_aip and yes_warmany )
  130.     {
  131.         yes_milmany_aip
  132.         yes_improvement_build_normal_aip
  133.         yes_primary_loaded
  134.     }
  135.  
  136.  
  137. ///////////////////////
  138. ////  LOAD SCIFEW  ////
  139. ///////////////////////
  140.  
  141. if(not found_early_aip and yes_scifew )
  142.     {
  143.         yes_scifew_aip
  144.         yes_improvement_build_normal_aip
  145.         yes_primary_loaded
  146.     }
  147.  
  148.  
  149. ////////////////////////
  150. ////  LOAD SCIMANY  ////
  151. ////////////////////////
  152.  
  153. if(not found_early_aip and yes_scimany )
  154.     {
  155.         yes_scimany_aip
  156.         yes_improvement_build_normal_aip
  157.         yes_primary_loaded
  158.     }
  159.  
  160. ///////////////////////
  161. ////  LOAD CLERIC  ////
  162. ///////////////////////
  163.  
  164. if(not found_early_aip and yes_cleric )
  165.     {
  166.         yes_cleric_aip
  167.         yes_improvement_build_normal_aip
  168.         yes_primary_loaded
  169.     }
  170.  
  171. ///////////////////////
  172. ////  LOAD SLAVER  ////
  173. ///////////////////////
  174.  
  175. if(not found_early_aip and yes_slaver )
  176.     {
  177.         yes_slaver_aip
  178.         yes_improvement_build_normal_aip
  179.         yes_primary_loaded
  180.     }
  181.  
  182.  
  183. //////////////////////////////
  184. ////  Always load personality AIPS the first turn
  185. //////////////////////////////
  186.  
  187. if(first_turn and yes_warmany )
  188.     {
  189.         yes_milmany_aip
  190.     }
  191.  
  192. if(first_turn and yes_warfew )
  193.     {
  194.         yes_milfew_aip
  195.     }
  196.  
  197. if(first_turn and yes_scifew )
  198.     {
  199.         yes_scifew_aip
  200.     }
  201.  
  202. if(first_turn and yes_scimany )
  203.     {
  204.         yes_scimany_aip
  205.     }
  206.  
  207. if(first_turn and yes_cleric )
  208.     {
  209.         yes_cleric_aip
  210.     }        
  211.  
  212. if(first_turn and yes_slaver )
  213.     {    
  214.         yes_slaver_aip
  215.     }
  216.  
  217. //////////////////////////////
  218. ////  LOAD AIP COMMANDS  ////
  219. //////////////////////////////
  220.  
  221. action load ("slaver.aip") when (slaver_aip > 0.5)
  222. action load ("milmany.aip") when (milmany_aip > 0.5)
  223. action load ("milfew.aip") when (milfew_aip > 0.5)
  224. action load ("scimany.aip") when (scimany_aip > 0.5)
  225. action load ("scifew.aip") when (scifew_aip > 0.5)
  226. action load ("cleric.aip") when (cleric_aip > 0.5)
  227. action load ("improvement_build_normal.aip") when (improvement_build_normal_aip > 0.8)
  228.  
  229. //////////////////////////////
  230. ////  LOAD EARLY DEFENSE  ////
  231. //////////////////////////////
  232.  
  233. action load ("citywall.aip") when (citywall_aip > 0.9)
  234. action load ("survival_mode.aip") when (survival_mode_aip > 0.9)
  235.  
  236. action load("naval.aip") when (land_continents_full_of_friends > 0.65)
  237. action load("supernaval.aip") when (land_continents_full_of_friends > 0.9)
  238.  
  239. output settle_bonus_island[0.0, 1000001.0] = 0.0
  240.     tri    yes_settle_islands(settle_bonus_island, 100000.0, 0.1)
  241.  
  242.  
  243. if(full_continent_except_friends)
  244.     {
  245.         yes_settle_islands
  246.     }
  247. // added troops only to deal with no enough soldiers
  248.  
  249. output troops_only_aip[0.0, 2.0] = 0.0
  250.     tri yes_troops_only_aip(troops_only_aip, 1.0, 0.5)
  251.  
  252. /// rules for basic wars
  253.     if(start_war)
  254.     {
  255.         yes_getarmy_aip
  256.         yes_citywall_aip
  257.         build_no_settlers
  258.         yes_primary_loaded
  259.     }
  260.     if(phase1_war)
  261.     {
  262.         yes_getarmy_aip
  263.         yes_citywall_aip
  264.         yes_gather_aip
  265.         build_no_settlers
  266.         yes_primary_loaded
  267.     }
  268.     if(phase2_war)
  269.     {
  270.         yes_takecity_aip
  271.         yes_citywall_aip
  272.         yes_getarmy_aip
  273.         build_no_settlers
  274.         yes_primary_loaded
  275.     }
  276.     if(phase3_war)
  277.     {
  278.         yes_getarmy_aip
  279.         yes_citywall_aip
  280.         yes_fallback_aip
  281.         build_no_settlers
  282.         yes_primary_loaded
  283.     }
  284.     if(phase4_war)
  285.     {
  286.         yes_takecity_aip
  287.         yes_citywall_aip
  288.         build_no_settlers
  289.         yes_primary_loaded
  290.     }
  291.     if(phase5_war)
  292.     {
  293.         yes_getarmy_aip
  294.         yes_citywall_aip
  295.         yes_fallback_aip
  296.         yes_primary_loaded
  297.     }
  298. action load("getarmy.aip") when (getarmy_aip > 0.75)
  299. action load("gather.aip") when (gather_aip > 0.75)
  300. action load("takecity.aip") when (takecity_aip > 0.75)
  301. action load("fallback.aip") when (fallback_aip > 0.75)
  302. action load ("citywall.aip") when (citywall_aip > 0.9)
  303.  
  304. /////////////////////////////////////////////
  305. ////  CHECK FOR TOO MANY CITIES PENALTY  ////
  306. /////////////////////////////////////////////
  307.  
  308. output many_cities_test_happ[0.0, 2.0] = 0.0
  309.     tri too_many_cities_test_happ(many_cities_test_happ, 1.0, 0.5)
  310.  
  311. output many_cities_test_diff[0.0, 2.0] = 0.0
  312.     tri too_many_cities_test_diff(many_cities_test_diff, 1.0, 0.5)
  313.  
  314. output many_cities_test_total[0.0, 2.0] = 0.0
  315.     tri too_many_cities_test_total(many_cities_test_total, 1.0, 0.5)
  316.  
  317. output few_cities_test[0.0, 2.0] = 0.0
  318.     tri too_few_cities_test(few_cities_test, 1.0, 0.5)
  319.  
  320.  
  321. ///////////////////////////////////////////////////////////
  322. ////  DONT SETTLE IF WE WILL SUFFER HAPPINESS PENALTY  ////
  323. ///////////////////////////////////////////////////////////
  324.  
  325. if(    (neg3toneg1_city_delta 
  326.     or neg3minus_city_delta ) 
  327.     )
  328.     {
  329.         too_many_cities_test_happ
  330.         yes_no_settling_aip
  331.     }
  332.  
  333. if( neg3minus_city_delta )
  334. {
  335.     yes_siege_off_aip
  336. }
  337.  
  338. action load("siege_off.aip") when ( siege_off_aip > 0.75)
  339.  
  340. /////////////////////////////////////////////////////////////////////
  341. ////  DONT SETTLE IF CHIEFTAIN AND HUMAN HASNT MADE MANY CITIES  ////
  342. /////////////////////////////////////////////////////////////////////
  343.  
  344. output more_cities_than_human_test[0.0, 2.0] = 0.0
  345.     tri yes_more_cities_than_human_test(more_cities_than_human_test, 1.0, 0.5)
  346.  
  347. if(    i_have_two_or_more_cities_than_human 
  348.     and a0to100_turns )
  349. {
  350.     yes_more_cities_than_human_test
  351. }
  352.  
  353. if(    i_have_four_or_more_cities_than_human 
  354.     and a100to150_turns )
  355. {
  356.     yes_more_cities_than_human_test
  357. }
  358.  
  359.  
  360. if(    i_have_six_or_more_cities_than_human 
  361.     and a150to200_turns )
  362. {
  363.     yes_more_cities_than_human_test
  364. }
  365.  
  366.  
  367. if(    i_have_eight_or_more_cities_than_human 
  368.     and a200plus_turns )
  369. {
  370.     yes_more_cities_than_human_test
  371. }
  372.  
  373.  
  374. if(    ( yes_chieftain or warlord or prince)
  375.     and yes_more_cities_than_human_test
  376.     and not yes_can_sea_settle
  377.     and not yes_can_space_settle)
  378.     {
  379.         too_many_cities_test_diff
  380.     }
  381.  
  382. /////////////////////////////////////////////////
  383. ////  CHECK IF EITHER TOO MANY TEST IS TRUE  ////
  384. /////////////////////////////////////////////////
  385.  
  386. // they are getting tons of cities very early
  387. if(too_many_cities_test_diff or too_many_cities_test_happ)
  388. {
  389.     too_many_cities_test_total
  390. }
  391.  
  392. ///////////////////////////////////////////////////
  393. ////  ONLY STOP SETTLING AFTER OPENING OF GAME ////
  394. ///////////////////////////////////////////////////
  395.  
  396. if ( too_many_cities_test_total)
  397.     {
  398.         yes_no_settling_aip
  399.     }
  400.  
  401. action load ("no_settle.aip") when (no_settling_aip > 0.75)
  402.  
  403. if (not yes_no_settling_aip)
  404. {
  405.     yes_yes_settling_aip
  406. }
  407.  
  408. action load ("yes_settle.aip") when (yes_settling_aip > 0.75)
  409.  
  410. //////////////////////////////
  411. ////  EXPLORE A LOT EARLY ////
  412. //////////////////////////////
  413.  
  414. output one_explore_aip[0.0, 2.0] = 0.0
  415.     tri yes_one_explore_aip(one_explore_aip, 1.0, 0.5)
  416.  
  417. output two_explore_aip[0.0, 2.0] = 0.0
  418.     tri yes_two_explore_aip(two_explore_aip, 1.0, 0.5)
  419.  
  420. output normal_explore_aip[0.0, 2.0] = 0.0
  421.     tri yes_normal_explore_aip(normal_explore_aip, 1.0, 0.5)
  422.  
  423.  
  424. if    ( a1_num_cities )
  425. {    
  426.     yes_one_explore_aip
  427. }
  428.  
  429. if ( a2to3_num_cities )
  430. {
  431.     yes_two_explore_aip
  432. }
  433.  
  434. if (not yes_opening_game_strategy)
  435. {
  436.     yes_normal_explore_aip
  437. }
  438.  
  439. action load("one_explore.aip") when (one_explore_aip > 0.75)
  440. action load("two_explore.aip") when (two_explore_aip > 0.75)
  441. action load("normal_explore.aip") when (normal_explore_aip > 0.75)
  442.  
  443. //action load("citywall.aip") when (troops_only_aip > 0.75)
  444.  
  445.  
  446. //////////////////////////////////////////////////////////////////////////////////////////////
  447. ////  IF IM TOO STRONG, DONT BUILD MORE UNITS UNTIL I HAVE ALL THE BUILDINGS THAT I NEED  ////
  448. //// AND I AM NOT IN THE ANCIENT AGE 
  449. //// AND I AM NOT AT WAR WITH ANYONE
  450. //////////////////////////////////////////////////////////////////////////////////////////////
  451.  
  452.     if((i_am_stronger_2x_to_4x_than_strongest_human
  453.         or i_am_stronger_2x_to_4x_than_strongest)
  454.         and not_ancient_time 
  455.         and zero_at_war
  456.         and not yes_focus_on_units )
  457.     {
  458.         yes_build_troops_off_aip
  459.     }
  460.  
  461.  
  462. action load("build_troops_off.aip") when (build_troops_off_aip > 0.75)
  463. action load("build_troops_on.aip") when (build_troops_off_aip < 0.75)
  464.  
  465. //////////////////////////////////////////////////
  466. //// OCCASIONALLY INCREASE MINIMUM DEFENDERS  ////
  467. //////////////////////////////////////////////////
  468.  
  469. if( zero_at_war 
  470.     and high_count
  471.     and not med_count)
  472.     {
  473.         yes_pull_units_into_city_aip
  474.     }
  475.  
  476. action load("pull_units_into_city.aip") when ( pull_units_into_city_aip > 0.8)
  477. action load("defend_normal.aip") when (pull_units_into_city_aip < 0.9)
  478.  
  479. //////////////////////////////////////////////////
  480. //// DONT RUSH THE HUMAN ON EASY DIFF LEVELS  ////
  481. //////////////////////////////////////////////////
  482.  
  483. output special_actions_off_test[0.0, 2.0] = 0.0
  484.     tri yes_special_actions_off_test(special_actions_off_test, 1.0, 0.5)
  485.  
  486. output cleric_on_test[0.0, 2.0] = 0.0
  487.     tri yes_cleric_on_test(cleric_on_test, 1.0, 0.5)
  488.  
  489. output slave_on_test[0.0, 2.0] = 0.0
  490.     tri yes_slave_on_test(slave_on_test, 1.0, 0.5)
  491.  
  492.     if( (prince or warlord or chieftain)
  493.         and a0to50_turns )
  494.         {
  495.             yes_special_actions_off_test
  496.         }
  497.  
  498.     if ( not yes_special_actions_off_test
  499.         and ( yes_slaver or yes_warrior) )
  500.         {
  501.             yes_slave_on_test
  502.         }
  503.  
  504.     if ( not yes_special_actions_off_test
  505.         and  yes_cleric)
  506.         {
  507.             yes_cleric_on_test
  508.         }
  509.  
  510. action load("special_attacks_off.aip") when (special_actions_off_test > 0.75)
  511. action load("cleric_on.aip") when (cleric_on_test > 0.75)
  512. action load("slave_on.aip") when (slave_on_test > 0.75)
  513.  
  514. ////////////////////////////////////////////////////////////
  515. //// BUILD STUFF TO STOP POLLUTION IF I'VE MADE A PACT  ////
  516. ////////////////////////////////////////////////////////////
  517.  
  518. output green_me_test[0.0, 2.0] = 0.0
  519.     tri yes_green_me_test(green_me_test, 1.0, 0.5)
  520.  
  521. if(    yes_i_agreed_to_stop_polluting and
  522.     yes_primary_loaded ) 
  523. {
  524.     yes_green_me_test
  525. }
  526.  
  527. ///////////////////////////////////////////
  528. ////  IF IM TOO WEAK, BUILD MORE UNITS ////
  529. ///////////////////////////////////////////
  530.  
  531. output unit_focus_test [0.0, 2.0] = 0.0
  532.     tri yes_unit_focus_test ( unit_focus_test, 1.0, 0.5)
  533.  
  534. if( yes_focus_on_units
  535.     and yes_primary_loaded
  536.     and not found_early_aip)
  537.     {
  538.         yes_unit_focus_test
  539.     }
  540.  
  541. action load("unit_focus.aip") when (unit_focus_test > 0.75)
  542.  
  543. ////////////////////////////////////////////////////////////////////////
  544. ////  IF I'M TRYING TO GET CITY WALLS AND ITS EARLY IN THE GAME,    ////
  545. ////  THEN RESEARCH WHAT I NEED FOR CITY WALLS                        ////
  546. ////////////////////////////////////////////////////////////////////////
  547.  
  548. if(    yes_citywall_aip
  549.     and a0to50_turns )
  550. {
  551.     yes_citywall_science_aip
  552. }
  553.  
  554. action load("citywall_science.aip") when (citywall_science_aip > 0.75)
  555.  
  556. ////////////////////////////////////////////////////////
  557. ////  IF I'M HAVE THE UNITS TO PILLAGE, THEN DO IT    ////
  558. ////////////////////////////////////////////////////////
  559.  
  560. //if(    not zero_at_war
  561. //    and aover3unit_to_city_best_human_ratio 
  562. //    and not a0to100_turns )
  563. //{
  564. //    yes_pillage_high_five_aip
  565. //}
  566. //
  567. //action load("pillage_high_five.aip") when (pillage_high_five_aip > 0.75)
  568. //
  569. //if (not yes_pillage_five_high_aip)
  570. //{
  571. //    yes_pillage_normal_aip
  572. //}
  573. //
  574. //action load("pillage_normal.aip") when (pillage_normal_aip > 0.75)
  575.  
  576.