home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 8 (DVD) / XENIADVD08.iso / Fragzone / Files / AOM_MiniCampaign.exe / AI / aomMKcvFuncs.xs < prev    next >
Encoding:
Text File  |  2003-01-13  |  2.4 KB  |  76 lines

  1.  
  2. // This file contains change functions to be called for each control variable.  Simple ones simply change the value.
  3. // More complex ones do some minor surgery to make sure the running script deals with the change properly.
  4.  
  5. // Functions are listed in alphabetic order
  6.  
  7. // cvMaxAge setting function.
  8. void setMaxAge(int age = cAge4)
  9. {
  10.    cvMaxAge = age;
  11.  
  12.    if (kbGetAge() >= age)  // We're there or beyond, turn off the age upgrades
  13.    {
  14.          aiSetPauseAllAgeUpgrades(true);  
  15.          aiEcho("Suspending age upgrades");
  16.    }
  17.    else
  18.    {     // We're not at that age yet, turn off the pause if it was already set
  19.       if (aiGetPauseAllAgeUpgrades(true))
  20.       {
  21.          aiEcho("Enabling age upgrades");
  22.          aiSetPauseAllAgeUpgrades(false);
  23.       }
  24.    }
  25. }
  26.  
  27.  
  28. // cvOkToAttack set function.  Use this to set the variable at any time other than the initial setParameters() function.
  29. void setOkToAttack(bool value = true)
  30. {
  31.    cvOkToAttack = value;
  32.  
  33.    if (value == true)     // We've decided to fight after all
  34.    {
  35.       aiEcho("cvOkToAttack is now true.");
  36.       if (gLandAttackGoalID >= 0)      // We have an attack plan
  37.          aiPlanSetVariableBool(gLandAttackGoalID, cGoalPlanIdleAttack, 0, false);       // Permit attacks
  38.       if (gRushGoalID >= 0)  // We have a rush attack plan
  39.          aiPlanSetVariableBool(gRushGoalID, cGoalPlanIdleAttack, 0, false);       // Authorize the rush
  40.    }
  41.    else                          // We're tired of fighting
  42.    {
  43.       aiEcho("cvOkToAttack is now false.");
  44.       if (gLandAttackGoalID >= 0)      // We have an attack plan
  45.          aiPlanSetVariableBool(gLandAttackGoalID, cGoalPlanIdleAttack, 0, true);       // Prevent attacks
  46.       if (gRushGoalID >= 0)  // We have a rush attack plan
  47.          aiPlanSetVariableBool(gRushGoalID, cGoalPlanIdleAttack, 0, true);       // Prevent rush
  48.    }
  49. }
  50.  
  51.  
  52.  
  53. // cvOkToTrainArmy set function.  Use this to set the variable at any time other than the initial setParameters() function.
  54. void setOkToTrainArmy(bool value = true)
  55. {
  56.    // Content TBD
  57. }
  58.  
  59.  
  60.  
  61. void setOkToResign(bool value = true)
  62. {
  63.    if (value == true)
  64.       xsEnableRule("ShouldIResign");
  65.    // If false, the rule will automatically shut itself off.
  66. }
  67.  
  68.  
  69.  
  70. // cvOkToTrainGatherers set function.  Use this to set the variable at any time other than the initial setParameters() function.
  71. void setOkToTrainGatherers(bool value = true)
  72. {
  73.    // Content TBD
  74. }
  75.  
  76.