先查命令表,根据我以前的修改经验,难度是用level显示的
查到[(int )] aiGetWorldDifficulty( void ): Returns the world difficulty level.
在AI文件查找这个命令aiGetWorldDifficulty(根据前人留下的经验,AI文件在AI3/aiMain.xs
找到float difficulty = aiGetWorldDifficulty(); intDifficulty = difficulty;
然后
算了,不装逼了我没学过c++也没研究过switch循环;
直觉告诉我,下面那几句就是让分(cDifficultyExpert是变量,对应switch循环)
int intDifficulty = -1; float difficulty = aiGetWorldDifficulty(); float diffRemainder = -1.0; intDifficulty = difficulty; diffRemainder = difficulty - intDifficulty;
// Call the rule once as a function, to get all the pop limits set up. popManager();
aiEcho("I see "+kbUnitCount(cMyID, cUnitTypeHomeCityWaterSpawnFlag)+" water flags.");
//-- setup the handicaps. // baseLineHandicap is a global multiplier that we can use to adjust all up or down. Probably will remain at 1.0. // startingHandicap is the handicap set at game launch in the UI, i.e. boost this player 10% == 1.10. That needs to be // multiplied by the appropriate difficulty for each level. float startingHandicap = kbGetPlayerHandicap(cMyID); switch(intDifficulty) { case cDifficultySandbox: // Sandbox { kbSetPlayerHandicap( cMyID, startingHandicap * baselineHandicap * 0.3 ); // Set handicap to a small fraction of baseline, i.e. minus 70%. gDelayAttacks = true; // Prevent attacks...actually stays that way, never turns true. cvOkToBuildForts = false; break; } case cDifficultyEasy: // Easiest { if (gSPC == true) kbSetPlayerHandicap( cMyID, startingHandicap * baselineHandicap * 0.5 ); // minus 50 percent for scenarios else kbSetPlayerHandicap( cMyID, startingHandicap * baselineHandicap * 0.4 ); // minus 60 percent
gDelayAttacks = true; cvOkToBuildForts = false; xsEnableRule("delayAttackMonitor"); // Wait until I am attacked, then let slip the hounds of war. break; } case cDifficultyModerate: // Moderate { if (gSPC == true) kbSetPlayerHandicap( cMyID, startingHandicap * baselineHandicap * 0.75 ); // minus 25% for scenarios else kbSetPlayerHandicap( cMyID, startingHandicap * baselineHandicap * 0.65 ); // minus 35% break; } case cDifficultyHard: // Hard { kbSetPlayerHandicap( cMyID, startingHandicap * baselineHandicap * 1.0 ); // 1.0 handicap at hard, i.e. no bonus break; } case cDifficultyExpert: // Expert { kbSetPlayerHandicap( cMyID, startingHandicap * baselineHandicap * 1.5 ); // +50% boost. break; } }
Expert就是专家级,把1.5倍改成1.0就是
case cDifficultyExpert: // Expert { kbSetPlayerHandicap( cMyID, startingHandicap * baselineHandicap * 1.0 ); // +50% boost. break; }
|