CnC_Remastered_Collection

Command and Conquer: Red Alert
Log | Files | Refs | README | LICENSE

RULES.CPP (54443B)


      1 //
      2 // Copyright 2020 Electronic Arts Inc.
      3 //
      4 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is free 
      5 // software: you can redistribute it and/or modify it under the terms of 
      6 // the GNU General Public License as published by the Free Software Foundation, 
      7 // either version 3 of the License, or (at your option) any later version.
      8 
      9 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed 
     10 // in the hope that it will be useful, but with permitted additional restrictions 
     11 // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT 
     12 // distributed with this program. You should have received a copy of the 
     13 // GNU General Public License along with permitted additional restrictions 
     14 // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
     15 
     16 /* $Header: /CounterStrike/RULES.CPP 1     3/03/97 10:25a Joe_bostic $ */
     17 /***********************************************************************************************
     18  ***              C O N F I D E N T I A L  ---  W E S T W O O D  S T U D I O S               ***
     19  ***********************************************************************************************
     20  *                                                                                             *
     21  *                 Project Name : Command & Conquer                                            *
     22  *                                                                                             *
     23  *                    File Name : RULES.CPP                                                    *
     24  *                                                                                             *
     25  *                   Programmer : Joe L. Bostic                                                *
     26  *                                                                                             *
     27  *                   Start Date : 05/12/96                                                     *
     28  *                                                                                             *
     29  *                  Last Update : September 10, 1996 [JLB]                                     *
     30  *                                                                                             *
     31  *---------------------------------------------------------------------------------------------*
     32  * Functions:                                                                                  *
     33  *   Difficulty_Get -- Fetch the difficulty bias values.                                       *
     34  *   RulesClass::AI -- Processes the AI control constants from the database.                   *
     35  *   RulesClass::General -- Process the general main game rules.                               *
     36  *   RulesClass::Heap_Maximums -- Fetch and process the heap override values.                  *
     37  *   RulesClass::IQ -- Fetches the IQ control values from the INI database.                    *
     38  *   RulesClass::Land_Types -- Inits the land type values.                                     *
     39  *   RulesClass::MPlayer -- Fetch and process the multiplayer default settings.                *
     40  *   RulesClass::Powerups -- Process the powerup values from the database.                     *
     41  *   RulesClass::Process -- Fetch the bulk of the rule data from the control file.             *
     42  *   RulesClass::Recharge -- Process the super weapon recharge statistics.                     *
     43  *   RulesClass::RulesClass -- Default constructor for rules class object.                     *
     44  *   RulesClass::Themes -- Fetches the theme control values from the INI database.             *
     45  *   Techno_Get -- Get rule data common for all techno type objects.                           *
     46  *   _Scale_To_256 -- Scales a 1..100 number into a 1..255 number.                             *
     47  *   RulesClass::Difficulty -- Fetch the various difficulty group settings.                    *
     48  *   RulesClass::Objects -- Fetch all the object characteristic values.                        *
     49  * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
     50 
     51 
     52 #include	"function.h"
     53 #include	"vortex.h"
     54 
     55 
     56 /***********************************************************************************************
     57  * _Scale_To_256 -- Scales a 1..100 number into a 1..255 number.                               *
     58  *                                                                                             *
     59  *    This is a helper routine that will take a decimal percentage number and convert it       *
     60  *    into a game based fixed point number.                                                    *
     61  *                                                                                             *
     62  * INPUT:   val   -- Decimal percent number to convert.                                        *
     63  *                                                                                             *
     64  * OUTPUT:  Returns with the decimal percent number converted to a game fixed point number.    *
     65  *                                                                                             *
     66  * WARNINGS:   none                                                                            *
     67  *                                                                                             *
     68  * HISTORY:                                                                                    *
     69  *   06/17/1996 JLB : Created.                                                                 *
     70  *=============================================================================================*/
     71 static inline int _Scale_To_256(int val)
     72 {
     73 	val = fixed(100, 256) * val;
     74 	val = min(val, 255);
     75 	return(val);
     76 }
     77 
     78 
     79 /***********************************************************************************************
     80  * RulesClass::RulesClass -- Default constructor for rules class object.                       *
     81  *                                                                                             *
     82  *    This is the default constructor for the rules class object. Although it initializes the  *
     83  *    rule data with default values, it is expected that they will all be overridden by the    *
     84  *    rules control file.                                                                      *
     85  *                                                                                             *
     86  * INPUT:   none                                                                               *
     87  *                                                                                             *
     88  * OUTPUT:  none                                                                               *
     89  *                                                                                             *
     90  * WARNINGS:   none                                                                            *
     91  *                                                                                             *
     92  * HISTORY:                                                                                    *
     93  *   06/17/1996 JLB : Created.                                                                 *
     94  *=============================================================================================*/
     95 RulesClass::RulesClass(void) :
     96 	TurboBoost("1.5"),
     97 	AttackInterval(3),
     98 	AttackDelay(5),
     99 	PowerEmergencyFraction(fixed::_3_4),
    100 	BadgerBombCount(1),
    101 	AirstripRatio(".12"),
    102 	AirstripLimit(5),
    103 	HelipadRatio(".12"),
    104 	HelipadLimit(5),
    105 	TeslaRatio(".16"),
    106 	TeslaLimit(10),
    107 	AARatio(".14"),
    108 	AALimit(10),
    109 	DefenseRatio(".5"),
    110 	DefenseLimit(40),
    111 	WarRatio(".1"),
    112 	WarLimit(2),
    113 	BarracksRatio(".16"),
    114 	BarracksLimit(2),
    115 	RefineryLimit(4),
    116 	RefineryRatio(".16"),
    117 	BaseSizeAdd(3),
    118 	PowerSurplus(50),
    119 	InfantryReserve(2000),
    120 	InfantryBaseMult(2),
    121 	ChronoDuration(3),
    122 	WaterCrateChance(".2"),
    123 	SoloCrateMoney(2000),
    124 	GPSTechLevel(0),
    125 	UnitCrateType(UNIT_NONE),
    126 	PatrolTime(".016"),
    127 	TeamDelay(".6"),
    128 	CloakDelay(0),
    129 	GameSpeedBias(1),
    130 	NervousBias(1),
    131 	VortexRange(10*CELL_LEPTON_W),
    132 	VortexSpeed((MPHType)10),
    133 	VortexDamage(200),
    134 	VortexChance(".2"),
    135 	ExplosionSpread(fixed::_1_2),
    136 	SupressRadius(CELL_LEPTON_W),
    137 	ParaInfantryTechLevel(10),
    138 	SpyPlaneTechLevel(10),
    139 	ParaBombTechLevel(10),
    140 	MaxIQ(5),
    141 	IQSuperWeapons(4),
    142 	IQProduction(5),
    143 	IQGuardArea(4),
    144 	IQRepairSell(3),
    145 	IQCrush(2),
    146 	IQScatter(3),
    147 	IQContentScan(4),
    148 	IQAircraft(4),
    149 	IQHarvester(3),
    150 	IQSellBack(2),
    151 	SilverCrate(CRATE_HEAL_BASE),
    152 	WoodCrate(CRATE_MONEY),
    153 	WaterCrate(CRATE_MONEY),
    154 	CrateMinimum(1),
    155 	CrateMaximum(255),
    156 	LZScanRadius(16*CELL_LEPTON_W),
    157 	MPDefaultMoney(3000),
    158 	MPMaxMoney(10000),
    159 	IsMPShadowGrow(true),
    160 	IsMPBasesOn(true),
    161 	IsMPTiberiumGrow(true),
    162 	IsMPCrates(true),
    163 	IsMPAIPlayers(false),
    164 	IsMPCaptureTheFlag(false),
    165 	DropZoneRadius(4*CELL_LEPTON_W),
    166 	MessageDelay(".6"),
    167 	SavourDelay(".03"),
    168 	AVMineDamage(1200),
    169 	APMineDamage(1000),
    170 	MaxPlayers(8),
    171 	BaseDefenseDelay(fixed::_1_4),
    172 	SuspendPriority(20),
    173 	SuspendDelay(2),
    174 	SurvivorFraction(fixed::_1_2),
    175 	ReloadRate(".05"),
    176 	AutocreateTime(5),
    177 	BuildupTime(".05"),
    178 	OreDumpRate(2),
    179 	AtomDamage(1000),
    180 	IsComputerParanoid(true),
    181 	IsCurleyShuffle(false),
    182 	IsFlashLowPower(true),
    183 	IsCompEasyBonus(true),
    184 	IsFineDifficulty(false),
    185 	IsExplosiveHarvester(false),
    186 	IsMCVDeploy(false),
    187 	IsAllyReveal(true),
    188 	IsSeparate(false),
    189 	IsTreeTarget(false),
    190 	IsMineAware(true),
    191 	IsTGrowth(true),
    192 	IsTSpread(true),
    193 	IsNamed(false),
    194 	IsAutoCrush(false),
    195 	IsSmartDefense(false),
    196 	IsScatter(false),
    197 	IsChronoKill(true),
    198 	ProneDamageBias(fixed::_1_2),
    199 	QuakeDamagePercent(".33"),
    200 	QuakeChance(".2"),
    201 	GrowthRate(2),
    202 	ShroudRate(4),
    203 	CrateTime(10),
    204 	TimerWarning(2),
    205 	ChronoTechLevel(1),
    206 	SonarTime(14),
    207 	ChronoTime(3),
    208 	ParaBombTime(14),
    209 	ParaInfantryTime(2),
    210 	ParaSaboteurTime(14),
    211 	SpyTime(2),
    212 	IronCurtainTime(14),
    213 	GPSTime(1),
    214 	NukeTime(14),
    215 	SpeakDelay(2),
    216 	DamageDelay(1),
    217 	Gravity(3),
    218 	GapShroudRadius(10),
    219 	GapRegenInterval(".1"),
    220 	RadarJamRadius(10*CELL_LEPTON_W),
    221 	Incoming(MPH_IMMOBILE),
    222 	MinDamage(1),
    223 	MaxDamage(1000),
    224 	RepairStep(5),
    225 	RepairPercent(fixed::_1_4),
    226 	URepairStep(5),
    227 	URepairPercent(fixed::_1_4),
    228 	RepairRate(".016"),
    229 	ConditionGreen(1),
    230 	ConditionYellow(fixed::_1_2),
    231 	ConditionRed(fixed::_1_4),
    232 	RandomAnimateTime(".083"),
    233 	BailCount(28),
    234 	GoldValue(35),
    235 	GemValue(110),
    236 	AircraftMax(100),
    237 	AnimMax(100),
    238 	BuildingMax(500),
    239 	BulletMax(40),
    240 	FactoryMax(20),
    241 	InfantryMax(500),
    242 	OverlayMax(1),
    243 	SmudgeMax(1),
    244 	TeamMax(60),
    245 	TeamTypeMax(60),
    246 	TemplateMax(1),
    247 	TerrainMax(500),
    248 	TriggerMax(60),
    249 	UnitMax(500),
    250 	VesselMax(100),
    251 	ProjectileMax(20),
    252 	WeaponMax(20),
    253 	WarheadMax(20),
    254 	TrigTypeMax(80),
    255 	CloseEnoughDistance(0x0280),
    256 	StrayDistance(0x0200),
    257 	CrushDistance(0x0180),
    258 	CrateRadius(0x0280),
    259 	HomingScatter(0x0200),
    260 	BallisticScatter(0x0100),
    261 	RefundPercent(fixed::_1_2),
    262 	IronCurtainDuration(fixed::_1_2),
    263 	BridgeStrength(1000),
    264 	BuildSpeedBias(1),
    265 	C4Delay(".03"),
    266 	RepairThreshhold(1000),
    267 	PathDelay(".016"),
    268 	MovieTime(fixed::_1_4),
    269 	TiberiumShortScan(0x0600),
    270 	TiberiumLongScan(0x2000),
    271 	HealthBarDisplayMode(HB_SELECTED),
    272 	ResourceBarDisplayMode(RB_SELECTED)
    273 {
    274 #ifdef FIXIT_CSII	//	checked - ajw 9/28/98
    275 	NewUnitsEnabled = SecretUnitsEnabled = 0;
    276 	MTankDistance = 30;
    277 	QuakeUnitDamage = 0x080;
    278 	QuakeBuildingDamage = 0x040;
    279 	QuakeInfantryDamage = 0;
    280 	QuakeDelay      = 120;
    281 	ChronoTankDuration = 0x300;
    282 #ifdef FIXIT_ENGINEER	//	checked - ajw 9/28/98
    283 	EngineerDamage=(fixed)1 / (fixed)3;	// Amount of damage an engineer does
    284 	EngineerCaptureLevel=ConditionRed;	// Building damage level before engineer can capture
    285 #endif
    286 #ifdef FIXIT_CARRIER	//	checked - ajw 9/28/98
    287 	CarrierLaunchDelay = 60;
    288 #endif
    289 #endif
    290 }
    291 
    292 
    293 /***********************************************************************************************
    294  * Difficulty_Get -- Fetch the difficulty bias values.                                         *
    295  *                                                                                             *
    296  *    This will fetch the difficulty bias values for the section specified.                    *
    297  *                                                                                             *
    298  * INPUT:   ini   -- Reference the INI database to fetch the values from.                      *
    299  *                                                                                             *
    300  *          diff  -- Reference to the difficulty class object to fill in with the values.      *
    301  *                                                                                             *
    302  *          section  -- The section identifier to lift the values from.                        *
    303  *                                                                                             *
    304  * OUTPUT:  none                                                                               *
    305  *                                                                                             *
    306  * WARNINGS:   none                                                                            *
    307  *                                                                                             *
    308  * HISTORY:                                                                                    *
    309  *   07/11/1996 JLB : Created.                                                                 *
    310  *=============================================================================================*/
    311 static void Difficulty_Get(CCINIClass & ini, DifficultyClass & diff, char const * section)
    312 {
    313 	if (ini.Is_Present(section)) {
    314 		diff.FirepowerBias = ini.Get_Fixed(section, "FirePower", 1);
    315 		diff.GroundspeedBias = ini.Get_Fixed(section, "Groundspeed", 1);
    316 		diff.AirspeedBias = ini.Get_Fixed(section, "Airspeed", 1);
    317 		diff.ArmorBias = ini.Get_Fixed(section, "Armor", 1);
    318 		diff.ROFBias = ini.Get_Fixed(section, "ROF", 1);
    319 		diff.CostBias = ini.Get_Fixed(section, "Cost", 1);
    320 		diff.RepairDelay = ini.Get_Fixed(section, "RepairDelay", ".02");
    321 		diff.BuildDelay = ini.Get_Fixed(section, "BuildDelay", ".03");
    322 		diff.IsBuildSlowdown = ini.Get_Bool(section, "BuildSlowdown", false);
    323 		diff.BuildSpeedBias = ini.Get_Fixed(section, "BuildTime", 1);
    324 		diff.IsWallDestroyer = ini.Get_Bool(section, "DestroyWalls", true);
    325 		diff.IsContentScan = ini.Get_Bool(section, "ContentScan", false);
    326 	}
    327 }
    328 
    329 
    330 /***********************************************************************************************
    331  * RulesClass::Process -- Fetch the bulk of the rule data from the control file.               *
    332  *                                                                                             *
    333  *    This routine will fetch the rule data from the control file.                             *
    334  *                                                                                             *
    335  * INPUT:   file  -- Reference to the rule file to process.                                    *
    336  *                                                                                             *
    337  * OUTPUT:  bool; Was the rule file processed?                                                 *
    338  *                                                                                             *
    339  * WARNINGS:   none                                                                            *
    340  *                                                                                             *
    341  * HISTORY:                                                                                    *
    342  *   06/17/1996 JLB : Created.                                                                 *
    343  *=============================================================================================*/
    344 bool RulesClass::Process(CCINIClass & ini)
    345 {
    346 	BStart(BENCH_RULES);
    347 
    348 	General(ini);
    349 	MPlayer(ini);
    350 	Recharge(ini);
    351 	Heap_Maximums(ini);
    352 	AI(ini);
    353 	Powerups(ini);
    354 	Land_Types(ini);
    355 	Themes(ini);
    356 	IQ(ini);
    357 	Objects(ini);
    358 	Difficulty(ini);
    359 
    360 	BEnd(BENCH_RULES);
    361 
    362 	return(true);
    363 }
    364 
    365 
    366 /***********************************************************************************************
    367  * RulesClass::General -- Process the general main game rules.                                 *
    368  *                                                                                             *
    369  *    This fetches the control constants uses for regular game processing. Any game behavior   *
    370  *    controlling values that don't properly fit in any of the other catagories will be        *
    371  *    stored here.                                                                             *
    372  *                                                                                             *
    373  * INPUT:   ini   -- Reference to the database to fetch the values from.                       *
    374  *                                                                                             *
    375  * OUTPUT:  bool; Was the general section found and processed?                                 *
    376  *                                                                                             *
    377  * WARNINGS:   none                                                                            *
    378  *                                                                                             *
    379  * HISTORY:                                                                                    *
    380  *   08/08/1996 JLB : Created.                                                                 *
    381  *=============================================================================================*/
    382 bool RulesClass::General(CCINIClass & ini)
    383 {
    384 	static char const * const GENERAL = "General";
    385 #ifdef FIXIT_CSII	//	checked - ajw 9/28/98
    386 	static char const * const AFTERMATH = "Aftermath";
    387 
    388 	if(ini.Is_Present(AFTERMATH)) {
    389 //debugprint( "NewUnitsEnabled previously %i\n", NewUnitsEnabled );
    390 		NewUnitsEnabled = ini.Get_Int(AFTERMATH, "NewUnitsEnabled", 0);
    391 //debugprint( "NewUnitsEnabled set to %i by Rules\n", NewUnitsEnabled );
    392 		MTankDistance = ini.Get_Int(AFTERMATH,"MTankDistance",MTankDistance);
    393 		QuakeUnitDamage = ini.Get_Fixed(AFTERMATH, "QuakeUnitDamage", QuakeUnitDamage);
    394 		QuakeBuildingDamage = ini.Get_Fixed(AFTERMATH, "QuakeBuildingDamage", QuakeBuildingDamage);
    395 		QuakeInfantryDamage = ini.Get_Int(AFTERMATH,"QuakeInfantryDamage",QuakeInfantryDamage);
    396 		QuakeDelay      = ini.Get_Int(AFTERMATH,"QuakeDelay",QuakeDelay);
    397 		ChronoTankDuration = ini.Get_Fixed(AFTERMATH, "ChronoTankDuration", ChronoTankDuration);
    398 //Mono_Set_Cursor(0,0);Mono_Printf("Chrono duration: %08x \n",ChronoTankDuration);Keyboard->Get();Keyboard->Get();
    399 #ifdef FIXIT_CARRIER	//	checked - ajw 9/28/98
    400 		CarrierLaunchDelay = ini.Get_Int(AFTERMATH,"CarrierLaunchDelay",120);
    401 #endif
    402 #ifdef FIXIT_ENGINEER	//	checked - ajw 9/28/98
    403 		//	Engineer changing fields were specifically left out of Aftrmath.ini, thus these values are not found to set. ajw
    404 		//	Implies interesting security hole if user creates a separate Aftrmath.ini file!
    405 		EngineerDamage = ini.Get_Fixed(AFTERMATH, "EngineerDamage", EngineerDamage);	// Amount of damage an engineer does
    406 		EngineerCaptureLevel = ini.Get_Fixed(AFTERMATH, "EngineerCaptureLevel", EngineerCaptureLevel);	// Building damage level before engineer can capture
    407 #endif
    408 	}
    409 
    410 #endif
    411 
    412 	if (ini.Is_Present(GENERAL)) {
    413 		TurboBoost = ini.Get_Fixed(GENERAL, "TurboBoost", TurboBoost);
    414 		BadgerBombCount = ini.Get_Int(GENERAL, "BadgerBombCount", BadgerBombCount);
    415 		IsCurleyShuffle = ini.Get_Bool(GENERAL, "CurleyShuffle", IsCurleyShuffle);
    416 		IsFlashLowPower = ini.Get_Bool(GENERAL, "FlashLowPower", IsFlashLowPower);
    417 		IsChronoKill = ini.Get_Bool(GENERAL, "ChronoKillCargo", IsChronoKill);
    418 		ChronoDuration = ini.Get_Fixed(GENERAL, "ChronoDuration", ChronoDuration);
    419 		IsFineDifficulty = ini.Get_Bool(GENERAL, "FineDiffControl", IsFineDifficulty);
    420 		WaterCrateChance = ini.Get_Fixed(GENERAL, "WaterCrateChance", WaterCrateChance);
    421 		SoloCrateMoney = ini.Get_Int(GENERAL, "SoloCrateMoney", SoloCrateMoney);
    422 		ParaBombTechLevel = ini.Get_Int(GENERAL, "ParabombTech", ParaBombTechLevel);
    423 		GPSTechLevel = ini.Get_Int(GENERAL, "GPSTechLevel", GPSTechLevel);
    424 		UnitCrateType = ini.Get_UnitType(GENERAL, "UnitCrateType", UnitCrateType);
    425 		IsExplosiveHarvester = ini.Get_Fixed(GENERAL, "OreExplosive", IsExplosiveHarvester);
    426 		GapRegenInterval = ini.Get_Fixed(GENERAL, "GapRegenInterval", GapRegenInterval);
    427 		TeamDelay = ini.Get_Fixed(GENERAL, "TeamDelay", TeamDelay);
    428 		CloakDelay = ini.Get_Fixed(GENERAL, "SubmergeDelay", CloakDelay);
    429 		GameSpeedBias = ini.Get_Fixed(GENERAL, "GameSpeedBias", GameSpeedBias);
    430 		NervousBias = ini.Get_Fixed(GENERAL, "BaseBias", NervousBias);
    431 		ExplosionSpread = ini.Get_Fixed(GENERAL, "ExpSpread", ExplosionSpread);
    432 		SupressRadius = ini.Get_Lepton(GENERAL, "FireSupress", SupressRadius);
    433 		ParaInfantryTechLevel = ini.Get_Int(GENERAL, "ParaTech", ParaInfantryTechLevel);
    434 		SpyPlaneTechLevel = ini.Get_Int(GENERAL, "SpyPlaneTech", SpyPlaneTechLevel);
    435 		SilverCrate = ini.Get_CrateType(GENERAL, "SilverCrate", SilverCrate);
    436 		WoodCrate = ini.Get_CrateType(GENERAL, "WoodCrate", WoodCrate);
    437 		WaterCrate = ini.Get_CrateType(GENERAL, "WaterCrate", WaterCrate);
    438 		CrateMinimum = ini.Get_Int(GENERAL, "CrateMinimum", CrateMinimum);
    439 		CrateMaximum = ini.Get_Int(GENERAL, "CrateMaximum", CrateMaximum);
    440 		IsScatter = ini.Get_Bool(GENERAL, "PlayerScatter", IsScatter);
    441 		IsSmartDefense = ini.Get_Bool(GENERAL, "PlayerReturnFire", IsSmartDefense);
    442 		IsAutoCrush = ini.Get_Bool(GENERAL, "PlayerAutoCrush", IsAutoCrush);
    443 		IsNamed = ini.Get_Bool(GENERAL, "NamedCivilians", IsNamed);
    444 		IsTGrowth = ini.Get_Bool(GENERAL, "OreGrows", IsTGrowth);
    445 		IsTSpread = ini.Get_Bool(GENERAL, "OreSpreads", IsTSpread);
    446 		IsMineAware = ini.Get_Bool(GENERAL, "MineAware", IsMineAware);
    447 		IsTreeTarget = ini.Get_Bool(GENERAL, "TreeTargeting", IsTreeTarget);
    448 		IsSeparate = ini.Get_Bool(GENERAL, "SeparateAircraft", IsSeparate);
    449 		DropZoneRadius = ini.Get_Lepton(GENERAL, "DropZoneRadius", DropZoneRadius);
    450 		MessageDelay = ini.Get_Fixed(GENERAL, "MessageDelay", MessageDelay);
    451 		SavourDelay = ini.Get_Fixed(GENERAL, "SavourDelay", SavourDelay);
    452 		AVMineDamage = ini.Get_Int(GENERAL, "AVMineDamage", AVMineDamage);
    453 		APMineDamage = ini.Get_Int(GENERAL, "APMineDamage", APMineDamage);
    454 		BaseDefenseDelay = ini.Get_Fixed(GENERAL, "BaseDefenseDelay", BaseDefenseDelay);
    455 		SuspendPriority = ini.Get_Int(GENERAL, "SuspendPriority", SuspendPriority);
    456 		SuspendDelay = ini.Get_Fixed(GENERAL, "SuspendDelay", SuspendDelay);
    457 		SurvivorFraction = ini.Get_Fixed(GENERAL, "SurvivorRate", SurvivorFraction);
    458 		RadarJamRadius = ini.Get_Lepton(GENERAL, "RadarJamRadius", RadarJamRadius);
    459 		ReloadRate = ini.Get_Fixed(GENERAL, "ReloadRate", ReloadRate);
    460 		RandomAnimateTime = ini.Get_Fixed(GENERAL, "IdleActionFrequency", RandomAnimateTime);
    461 		BuildupTime = ini.Get_Fixed(GENERAL, "BuildupTime", BuildupTime);
    462 		OreDumpRate = ini.Get_Int(GENERAL, "OreTruckRate", OreDumpRate);
    463 		AtomDamage = ini.Get_Int(GENERAL, "AtomDamage", AtomDamage);
    464 		BailCount = ini.Get_Int(GENERAL, "BailCount", BailCount);
    465 		BallisticScatter = ini.Get_Lepton(GENERAL, "BallisticScatter", BallisticScatter);
    466 		BridgeStrength = ini.Get_Int(GENERAL, "BridgeStrength", BridgeStrength);
    467 		BuildSpeedBias = ini.Get_Fixed(GENERAL, "BuildSpeed", BuildSpeedBias);
    468 		ConditionGreen = 1;
    469 		ConditionRed = ini.Get_Fixed(GENERAL, "ConditionRed", ConditionRed);
    470 		ConditionYellow = ini.Get_Fixed(GENERAL, "ConditionYellow", ConditionYellow);
    471 		CrateRadius = ini.Get_Lepton(GENERAL, "CrateRadius", CrateRadius);
    472 		CrushDistance = ini.Get_Lepton(GENERAL, "Crush", CrushDistance);
    473 		DamageDelay = ini.Get_Fixed(GENERAL, "DamageDelay", DamageDelay);
    474 		GapShroudRadius = ini.Get_Int(GENERAL, "GapRadius", GapShroudRadius);
    475 		GemValue = ini.Get_Int(GENERAL, "GemValue", GemValue);
    476 		GoldValue = ini.Get_Int(GENERAL, "GoldValue", GoldValue);
    477 		Gravity = ini.Get_Int(GENERAL, "Gravity", Gravity);
    478 		GrowthRate = ini.Get_Fixed(GENERAL, "GrowthRate", GrowthRate);
    479 		HomingScatter = ini.Get_Lepton(GENERAL, "HomingScatter", HomingScatter);
    480 		Incoming = ini.Get_MPHType(GENERAL, "Incoming", MPH_IMMOBILE);
    481 		IronCurtainDuration = ini.Get_Fixed(GENERAL, "IronCurtain", IronCurtainDuration);
    482 		IsAllyReveal = ini.Get_Bool(GENERAL, "AllyReveal", IsAllyReveal);
    483 		IsMCVDeploy = ini.Get_Bool(GENERAL, "MCVUndeploy", IsMCVDeploy);
    484 		MaxDamage = ini.Get_Int(GENERAL, "MaxDamage", MaxDamage);
    485 		MinDamage = ini.Get_Int(GENERAL, "MinDamage", MinDamage);
    486 		ProneDamageBias = ini.Get_Fixed(GENERAL, "ProneDamage", ProneDamageBias);
    487 		QuakeDamagePercent = ini.Get_Fixed(GENERAL, "QuakeDamage", QuakeDamagePercent);
    488 		QuakeChance = ini.Get_Fixed(GENERAL, "QuakeChance", QuakeChance);
    489 		RefundPercent = ini.Get_Fixed(GENERAL, "RefundPercent", RefundPercent);
    490 		RepairPercent = ini.Get_Fixed(GENERAL, "RepairPercent", RepairPercent);
    491 		RepairStep = ini.Get_Int(GENERAL, "RepairStep", RepairStep);
    492 		URepairPercent = ini.Get_Fixed(GENERAL, "URepairPercent", URepairPercent);
    493 		URepairStep = ini.Get_Int(GENERAL, "URepairStep", URepairStep);
    494 		RepairRate = ini.Get_Fixed(GENERAL, "RepairRate", RepairRate);
    495 		ShroudRate = ini.Get_Fixed(GENERAL, "ShroudRate", ShroudRate);
    496 		SpeakDelay = ini.Get_Fixed(GENERAL, "SpeakDelay", SpeakDelay);
    497 		StrayDistance = ini.Get_Lepton(GENERAL, "Stray", StrayDistance);
    498 		CloseEnoughDistance = ini.Get_Lepton(GENERAL, "CloseEnough", CloseEnoughDistance);
    499 		TimerWarning = ini.Get_Fixed(GENERAL, "TimerWarning", TimerWarning);
    500 		MovieTime = ini.Get_Fixed(GENERAL, "MovieTime", MovieTime);
    501 		C4Delay = ini.Get_Fixed(GENERAL, "C4Delay", C4Delay);
    502 		ChronoTechLevel = ini.Get_Int(GENERAL, "ChronoTechLevel", ChronoTechLevel);
    503 		CrateTime = ini.Get_Fixed(GENERAL, "CrateRegen", CrateTime);
    504 		VortexRange = ini.Get_Lepton(GENERAL, "VortexRange", VortexRange);
    505 		VortexSpeed = MPHType(_Scale_To_256(ini.Get_Int(GENERAL, "VortexSpeed", VortexSpeed)));
    506 		VortexDamage = ini.Get_Int(GENERAL, "VortexDamage", VortexDamage);
    507 		VortexChance = ini.Get_Fixed(GENERAL, "VortexChance", VortexChance);
    508 
    509 		ChronalVortex.Set_Range(VortexRange / CELL_LEPTON_W);
    510 		ChronalVortex.Set_Speed(VortexSpeed);
    511 		ChronalVortex.Set_Damage(VortexDamage);
    512 
    513 		//ChronalVortex.Set_Range ( ini.Get_Int (GENERAL, "VortexRange", ChronalVortex.Get_Range() ) );
    514 		//ChronalVortex.Set_Speed ( ini.Get_Int (GENERAL, "VortexSpeed", ChronalVortex.Get_Speed() ) );
    515 		//ChronalVortex.Set_Damage ( ini.Get_Int (GENERAL, "VortexDamage", ChronalVortex.Get_Damage() ) );
    516 
    517 		return(true);
    518 	}
    519 	return(false);
    520 }
    521 
    522 
    523 /***********************************************************************************************
    524  * RulesClass::MPlayer -- Fetch and process the multiplayer default settings.                  *
    525  *                                                                                             *
    526  *    This is used to set the default settings for the multiplayer system.                     *
    527  *                                                                                             *
    528  * INPUT:   ini   -- Reference to the INI database.                                            *
    529  *                                                                                             *
    530  * OUTPUT:  bool; Was the multiplayer default override section found and processed?            *
    531  *                                                                                             *
    532  * WARNINGS:   none                                                                            *
    533  *                                                                                             *
    534  * HISTORY:                                                                                    *
    535  *   08/08/1996 JLB : Created.                                                                 *
    536  *=============================================================================================*/
    537 bool RulesClass::MPlayer(CCINIClass & ini)
    538 {
    539 	static char const * const MPLAYER = "MultiplayerDefaults";
    540 	if (ini.Is_Present(MPLAYER)) {
    541 		MPDefaultMoney = ini.Get_Int(MPLAYER, "Money", MPDefaultMoney);
    542 		MPMaxMoney = ini.Get_Int(MPLAYER, "MaxMoney", MPMaxMoney);
    543 		IsMPShadowGrow = ini.Get_Bool(MPLAYER, "ShadowGrow", IsMPShadowGrow);
    544 		IsMPBasesOn = ini.Get_Bool(MPLAYER, "Bases", IsMPBasesOn);
    545 		IsMPTiberiumGrow = ini.Get_Bool(MPLAYER, "OreGrows", IsMPTiberiumGrow);
    546 		IsMPCrates = ini.Get_Bool(MPLAYER, "Crates", IsMPCrates);
    547 		IsMPCaptureTheFlag = ini.Get_Bool(MPLAYER, "CaptureTheFlag", IsMPCaptureTheFlag);
    548 		return(true);
    549 	}
    550 	return(false);
    551 }
    552 
    553 
    554 /***********************************************************************************************
    555  * RulesClass::Recharge -- Process the super weapon recharge statistics.                       *
    556  *                                                                                             *
    557  *    Use this to set the recharge times for the various super weapons available.              *
    558  *                                                                                             *
    559  * INPUT:   ini   -- Reference to the database.                                                *
    560  *                                                                                             *
    561  * OUTPUT:  bool; Was the recharge section found and processed?                                *
    562  *                                                                                             *
    563  * WARNINGS:   none                                                                            *
    564  *                                                                                             *
    565  * HISTORY:                                                                                    *
    566  *   08/08/1996 JLB : Created.                                                                 *
    567  *=============================================================================================*/
    568 bool RulesClass::Recharge(CCINIClass & ini)
    569 {
    570 	static char const * const RECHARGE = "Recharge";
    571 	if (ini.Is_Present(RECHARGE)) {
    572 		SonarTime = ini.Get_Fixed(RECHARGE, "Sonar", SonarTime);
    573 		ChronoTime = ini.Get_Fixed(RECHARGE, "Chrono", ChronoTime);
    574 		ParaBombTime = ini.Get_Fixed(RECHARGE, "ParaBomb", ParaBombTime);
    575 		ParaInfantryTime = ini.Get_Fixed(RECHARGE, "Paratrooper", ParaInfantryTime);
    576 		SpyTime = ini.Get_Fixed(RECHARGE, "SpyPlane", SpyTime);
    577 		IronCurtainTime = ini.Get_Fixed(RECHARGE, "IronCurtain", IronCurtainTime);
    578 		GPSTime = ini.Get_Fixed(RECHARGE, "GPS", GPSTime);
    579 		NukeTime = ini.Get_Fixed(RECHARGE, "Nuke", NukeTime);
    580 		return(true);
    581 	}
    582 	return(false);
    583 }
    584 
    585 
    586 /***********************************************************************************************
    587  * RulesClass::Heap_Maximums -- Fetch and process the heap override values.                    *
    588  *                                                                                             *
    589  *    This fetches the maximum heap sizes from the database specified. The heaps will be       *
    590  *    initialized by this routine as indicated.                                                *
    591  *                                                                                             *
    592  * INPUT:   ini   -- Reference to the INI database.                                            *
    593  *                                                                                             *
    594  * OUTPUT:  bool; Was the maximum section found and processed?                                 *
    595  *                                                                                             *
    596  * WARNINGS:   This process is catastrophic to any data currently existing in the heaps        *
    597  *             modified. This should only be processed during the game initialization stage.   *
    598  *                                                                                             *
    599  * HISTORY:                                                                                    *
    600  *   08/08/1996 JLB : Created.                                                                 *
    601  *=============================================================================================*/
    602 bool RulesClass::Heap_Maximums(CCINIClass & ini)
    603 {
    604 	/*
    605 	**	Heap maximum values.
    606 	*/
    607 	static char const * const MAXIMUMS = "Maximums";
    608 	if (ini.Is_Present(MAXIMUMS)) {
    609 		MaxPlayers = ini.Get_Int(MAXIMUMS, "Players", MaxPlayers);
    610 		AircraftMax = ini.Get_Int(MAXIMUMS, "Aircraft", AircraftMax);
    611 		AnimMax = ini.Get_Int(MAXIMUMS, "Anim", AnimMax);
    612 		BuildingMax = ini.Get_Int(MAXIMUMS, "Building", BuildingMax);
    613 		BulletMax = ini.Get_Int(MAXIMUMS, "Bullet", BulletMax);
    614 		FactoryMax = ini.Get_Int(MAXIMUMS, "Factory", FactoryMax);
    615 		InfantryMax = ini.Get_Int(MAXIMUMS, "Infantry", InfantryMax);
    616 		OverlayMax = ini.Get_Int(MAXIMUMS, "Overlay", OverlayMax);
    617 		SmudgeMax = ini.Get_Int(MAXIMUMS, "Smudge", SmudgeMax);
    618 		TeamMax = ini.Get_Int(MAXIMUMS, "Team", TeamMax);
    619 		TeamTypeMax = ini.Get_Int(MAXIMUMS, "TeamType", TeamTypeMax);
    620 		TemplateMax = ini.Get_Int(MAXIMUMS, "Template", TemplateMax);
    621 		TerrainMax = ini.Get_Int(MAXIMUMS, "Terrain", TerrainMax);
    622 		TriggerMax = ini.Get_Int(MAXIMUMS, "Trigger", TriggerMax);
    623 		UnitMax = ini.Get_Int(MAXIMUMS, "Unit", UnitMax);
    624 		VesselMax = ini.Get_Int(MAXIMUMS, "Vessel", VesselMax);
    625 		ProjectileMax = ini.Get_Int(MAXIMUMS, "Projectile", ProjectileMax);
    626 		WeaponMax = ini.Get_Int(MAXIMUMS, "Weapon", WeaponMax);
    627 		WarheadMax = ini.Get_Int(MAXIMUMS, "Warhead", WarheadMax);
    628 		TrigTypeMax = ini.Get_Int(MAXIMUMS, "TrigType", TrigTypeMax);
    629 	}
    630 
    631 	/*
    632 	**	Special case: double maximum animations to accomodate lots of action
    633 	*/
    634 	AnimMax = max(AnimMax, 200);
    635 
    636 	/*
    637 	**	Any heaps that use the maximums that were just loaded, must
    638 	**	be initialized as necessary.
    639 	*/
    640 	Warheads.Set_Heap(WarheadMax);
    641 	new WarheadTypeClass("SA");
    642 	new WarheadTypeClass("HE");
    643 	new WarheadTypeClass("AP");
    644 	new WarheadTypeClass("Fire");
    645 	new WarheadTypeClass("HollowPoint");
    646 	new WarheadTypeClass("Super");
    647 	new WarheadTypeClass("Organic");
    648 	new WarheadTypeClass("Nuke");
    649 #ifdef FIXIT_CSII	//	checked - ajw 9/28/98
    650 	new WarheadTypeClass("Mechanical");
    651 #endif
    652 
    653 	Weapons.Set_Heap(WeaponMax);
    654 	new WeaponTypeClass("Colt45");
    655 	new WeaponTypeClass("ZSU-23");
    656 	new WeaponTypeClass("Vulcan");
    657 	new WeaponTypeClass("Maverick");
    658 	new WeaponTypeClass("Camera");
    659 	new WeaponTypeClass("FireballLauncher");
    660 	new WeaponTypeClass("Sniper");
    661 	new WeaponTypeClass("ChainGun");
    662 	new WeaponTypeClass("Pistol");
    663 	new WeaponTypeClass("M1Carbine");
    664 	new WeaponTypeClass("Dragon");
    665 	new WeaponTypeClass("Hellfire");
    666 	new WeaponTypeClass("Grenade");
    667 	new WeaponTypeClass("75mm");
    668 	new WeaponTypeClass("90mm");
    669 	new WeaponTypeClass("105mm");
    670 	new WeaponTypeClass("120mm");
    671 	new WeaponTypeClass("TurretGun");
    672 	new WeaponTypeClass("MammothTusk");
    673 	new WeaponTypeClass("155mm");
    674 	new WeaponTypeClass("M60mg");
    675 	new WeaponTypeClass("Napalm");
    676 	new WeaponTypeClass("TeslaZap");
    677 	new WeaponTypeClass("Nike");
    678 	new WeaponTypeClass("8Inch");
    679 	new WeaponTypeClass("Stinger");
    680 	new WeaponTypeClass("TorpTube");
    681 	new WeaponTypeClass("2Inch");
    682 	new WeaponTypeClass("DepthCharge");
    683 	new WeaponTypeClass("ParaBomb");
    684 	new WeaponTypeClass("DogJaw");
    685 	new WeaponTypeClass("Heal");
    686 	new WeaponTypeClass("SCUD");
    687 	new WeaponTypeClass("Flamer");
    688 	new WeaponTypeClass("RedEye");
    689 
    690 #ifdef FIXIT_ANTS
    691 	new WeaponTypeClass("Mandible");
    692 #endif
    693 
    694 #ifdef FIXIT_CSII	//	checked - ajw 9/28/98
    695 	new WeaponTypeClass("PortaTesla");
    696 	new WeaponTypeClass("GoodWrench");
    697 	new WeaponTypeClass("SubSCUD");
    698 	new WeaponTypeClass("TTankZap");
    699 	new WeaponTypeClass("APTusk");
    700 	new WeaponTypeClass("Democharge");
    701 #endif
    702 #ifdef FIXIT_CARRIER	//	checked - ajw 9/28/98
    703 	new WeaponTypeClass("AirAssault");
    704 #endif
    705 
    706 	return(true);
    707 }
    708 
    709 
    710 /***********************************************************************************************
    711  * RulesClass::AI -- Processes the AI control constants from the database.                     *
    712  *                                                                                             *
    713  *    This will examine the database specified and set the AI override values accordingly.     *
    714  *                                                                                             *
    715  * INPUT:   ini   -- Reference to the INI database that holds the AI overrides.                *
    716  *                                                                                             *
    717  * OUTPUT:  bool; Was the AI section found and processed?                                      *
    718  *                                                                                             *
    719  * WARNINGS:   none                                                                            *
    720  *                                                                                             *
    721  * HISTORY:                                                                                    *
    722  *   08/08/1996 JLB : Created.                                                                 *
    723  *=============================================================================================*/
    724 bool RulesClass::AI(CCINIClass & ini)
    725 {
    726 	static char const * const AI = "AI";
    727 	if (ini.Is_Present(AI)) {
    728 		AttackInterval = ini.Get_Fixed(AI, "AttackInterval", AttackInterval);
    729 		AttackDelay = ini.Get_Fixed(AI, "AttackDelay", AttackDelay);
    730 		PatrolTime = ini.Get_Fixed(AI, "PatrolScan", PatrolTime);
    731 		RepairThreshhold = ini.Get_Int(AI, "CreditReserve", RepairThreshhold);
    732 		PathDelay = ini.Get_Fixed(AI, "PathDelay", PathDelay);
    733 		TiberiumShortScan = ini.Get_Lepton(AI, "OreNearScan", TiberiumShortScan);
    734 		TiberiumLongScan = ini.Get_Lepton(AI, "OreFarScan", TiberiumLongScan);
    735 		AutocreateTime = ini.Get_Fixed(AI, "AutocreateTime", AutocreateTime);
    736 		InfantryReserve = ini.Get_Int(AI, "InfantryReserve", InfantryReserve);
    737 		InfantryBaseMult = ini.Get_Int(AI, "InfantryBaseMult", InfantryBaseMult);
    738 		PowerSurplus = ini.Get_Int(AI, "PowerSurplus", PowerSurplus);
    739 		BaseSizeAdd = ini.Get_Int(AI, "BaseSizeAdd", BaseSizeAdd);
    740 		RefineryRatio = ini.Get_Fixed(AI, "RefineryRatio", RefineryRatio);
    741 		RefineryLimit = ini.Get_Int(AI, "RefineryLimit", RefineryLimit);
    742 		BarracksRatio = ini.Get_Fixed(AI, "BarracksRatio", BarracksRatio);
    743 		BarracksLimit = ini.Get_Int(AI, "BarracksLimit", BarracksLimit);
    744 		WarRatio = ini.Get_Fixed(AI, "WarRatio", WarRatio);
    745 		WarLimit = ini.Get_Int(AI, "WarLimit", WarLimit);
    746 		DefenseRatio = ini.Get_Fixed(AI, "DefenseRatio", DefenseRatio);
    747 		DefenseLimit = ini.Get_Int(AI, "DefenseLimit", DefenseLimit);
    748 		AARatio = ini.Get_Fixed(AI, "AARatio", AARatio);
    749 		AALimit = ini.Get_Int(AI, "AALimit", AALimit);
    750 		TeslaRatio = ini.Get_Fixed(AI, "TeslaRatio", TeslaRatio);
    751 		TeslaLimit = ini.Get_Int(AI, "TeslaLimit", TeslaLimit);
    752 		HelipadRatio = ini.Get_Fixed(AI, "HelipadRatio", HelipadRatio);
    753 		HelipadLimit = ini.Get_Int(AI, "HelipadLimit", HelipadLimit);
    754 		AirstripRatio = ini.Get_Fixed(AI, "AirstripRatio", AirstripRatio);
    755 		AirstripLimit = ini.Get_Int(AI, "AirstripLimit", AirstripLimit);
    756 		IsCompEasyBonus = ini.Get_Bool(AI, "CompEasyBonus", IsCompEasyBonus);
    757 		IsComputerParanoid = ini.Get_Bool(AI, "Paranoid", IsComputerParanoid);
    758 		PowerEmergencyFraction = ini.Get_Fixed(AI, "PowerEmergency", PowerEmergencyFraction);
    759 		return(true);
    760 	}
    761 	return(false);
    762 }
    763 
    764 
    765 /***********************************************************************************************
    766  * RulesClass::Powerups -- Process the powerup values from the database.                       *
    767  *                                                                                             *
    768  *    This will examine the database and initialize the powerup override values accordingly.   *
    769  *                                                                                             *
    770  * INPUT:   ini   -- Reference to the INI database the the powerup values are to be            *
    771  *                   initialized from.                                                         *
    772  *                                                                                             *
    773  * OUTPUT:  bool; Was the powerup section found and processed?                                 *
    774  *                                                                                             *
    775  * WARNINGS:   none                                                                            *
    776  *                                                                                             *
    777  * HISTORY:                                                                                    *
    778  *   08/08/1996 JLB : Created.                                                                 *
    779  *=============================================================================================*/
    780 bool RulesClass::Powerups(CCINIClass & ini)
    781 {
    782 	static char const * const POWERUPS = "Powerups";
    783 	if (ini.Is_Present(POWERUPS)) {
    784 		for (CrateType crate = CRATE_FIRST; crate < CRATE_COUNT; crate++) {
    785 			char buffer[128];
    786 			if (ini.Get_String(POWERUPS, CrateNames[crate], "0,NONE", buffer, sizeof(buffer))) {
    787 
    788 				/*
    789 				**	Share odds.
    790 				*/
    791 				char * token = strtok(buffer, ",");
    792 				if (token) {
    793 					strtrim(token);
    794 					CrateShares[crate] = atoi(token);
    795 				}
    796 
    797 				/*
    798 				**	Animation to use.
    799 				*/
    800 				token = strtok(NULL, ",");
    801 				if (token) {
    802 					strtrim(token);
    803 					CrateAnims[crate] = Anim_From_Name(token);
    804 				}
    805 
    806 				/*
    807 				**	Optional data number.
    808 				*/
    809 				token = strtok(NULL, ",");
    810 				if (token != NULL) {
    811 					if (strpbrk(token, ".%") != NULL) {
    812 						CrateData[crate] = fixed(token) * 256;
    813 					} else {
    814 						strtrim(token);
    815 						CrateData[crate] = atoi(token);
    816 					}
    817 				}
    818 			}
    819 		}
    820 		return(true);
    821 	}
    822 	return(false);
    823 }
    824 
    825 
    826 /***********************************************************************************************
    827  * RulesClass::Land_Types -- Inits the land type values.                                       *
    828  *                                                                                             *
    829  *    This will set the land movement attributes from the database specified.                  *
    830  *                                                                                             *
    831  * INPUT:   ini   -- Reference to the database that has the land value overrides.              *
    832  *                                                                                             *
    833  * OUTPUT:  bool; Was the land type sections found and processed?                              *
    834  *                                                                                             *
    835  * WARNINGS:   none                                                                            *
    836  *                                                                                             *
    837  * HISTORY:                                                                                    *
    838  *   08/08/1996 JLB : Created.                                                                 *
    839  *=============================================================================================*/
    840 bool RulesClass::Land_Types(CCINIClass & ini)
    841 {
    842 	/*
    843 	**	Fetch the movement characteristic data for terrain types.
    844 	*/
    845 	for (LandType land = LAND_FIRST; land < LAND_COUNT; land++) {
    846 		static char const * _lands[LAND_COUNT] = {
    847 			"Clear",
    848 			"Road",
    849 			"Water",
    850 			"Rock",
    851 			"Wall",
    852 			"Ore",
    853 			"Beach",
    854 			"Rough",
    855 			"River"
    856 		};
    857 
    858 		GroundType * gptr = &Ground[land];
    859 
    860 		if (ini.Is_Present(_lands[land])) {
    861 			gptr->Cost[SPEED_FOOT] = ini.Get_Fixed(_lands[land], "Foot", 1);
    862 			gptr->Cost[SPEED_TRACK] = ini.Get_Fixed(_lands[land], "Track", 1);
    863 			gptr->Cost[SPEED_WHEEL] = ini.Get_Fixed(_lands[land], "Wheel", 1);
    864 			gptr->Cost[SPEED_WINGED] = fixed(1);
    865 			gptr->Cost[SPEED_FLOAT] = ini.Get_Fixed(_lands[land], "Float", 1);
    866 			gptr->Build = ini.Get_Bool(_lands[land], "Buildable", false);
    867 		}
    868 	}
    869 	return(true);
    870 }
    871 
    872 
    873 /***********************************************************************************************
    874  * RulesClass::Themes -- Fetches the theme control values from the INI database.               *
    875  *                                                                                             *
    876  *    The musical theme availability is controlled by the scenario and the player's house      *
    877  *    choice. These controls can be specified in the theme control section of the INI          *
    878  *    database.                                                                                *
    879  *                                                                                             *
    880  * INPUT:   ini   -- Reference to the INI database to process.                                 *
    881  *                                                                                             *
    882  * OUTPUT:  bool; Was the theme section found and processed?                                   *
    883  *                                                                                             *
    884  * WARNINGS:   none                                                                            *
    885  *                                                                                             *
    886  * HISTORY:                                                                                    *
    887  *   08/11/1996 JLB : Created.                                                                 *
    888  *=============================================================================================*/
    889 bool RulesClass::Themes(CCINIClass & ini)
    890 {
    891 	static char const * const THEMECONTROL = "ThemeControl";
    892 
    893 	if (ini.Is_Present(THEMECONTROL)) {
    894 		for (ThemeType theme = THEME_FIRST; theme < THEME_COUNT; theme++) {
    895 			if (ini.Is_Present(THEMECONTROL, Theme.Base_Name(theme))) {
    896 
    897 				char buffer[128];
    898 				int scen = 1;
    899 				int owners = HOUSEF_ALLIES | HOUSEF_SOVIET | HOUSEF_OTHERS;
    900 
    901 				ini.Get_String(THEMECONTROL, Theme.Base_Name(theme), "", buffer, sizeof(buffer));
    902 				char const * token = strtok(buffer, ",");
    903 				if (token != NULL) {
    904 					scen = atoi(token);
    905 				}
    906 
    907 				token = strtok(NULL, ",");
    908 				if (token != NULL) {
    909 					owners = Owner_From_Name(token);
    910 				}
    911 
    912 				Theme.Set_Theme_Data(theme, scen, owners);
    913 			}
    914 		}
    915 		return(true);
    916 	}
    917 	return(false);
    918 }
    919 
    920 
    921 /***********************************************************************************************
    922  * RulesClass::IQ -- Fetches the IQ control values from the INI database.                      *
    923  *                                                                                             *
    924  *    This will scan the database specified and retrieve the IQ control values from it. These  *
    925  *    IQ control values are what gives the IQ rating meaning. It fundimentally controls how    *
    926  *    the computer behaves.                                                                    *
    927  *                                                                                             *
    928  * INPUT:   ini   -- Reference to the INI database to read the IQ controls from.               *
    929  *                                                                                             *
    930  * OUTPUT:  bool; Was the IQ section found and processed?                                      *
    931  *                                                                                             *
    932  * WARNINGS:   none                                                                            *
    933  *                                                                                             *
    934  * HISTORY:                                                                                    *
    935  *   08/11/1996 JLB : Created.                                                                 *
    936  *=============================================================================================*/
    937 bool RulesClass::IQ(CCINIClass & ini)
    938 {
    939 	static char const * const IQCONTROL = "IQ";
    940 	if (ini.Is_Present(IQCONTROL)) {
    941 		MaxIQ = ini.Get_Int(IQCONTROL, "MaxIQLevels", MaxIQ);
    942 		IQSuperWeapons = ini.Get_Int(IQCONTROL, "SuperWeapons", IQSuperWeapons);
    943 		IQProduction = ini.Get_Int(IQCONTROL, "Production", IQProduction);
    944 		IQGuardArea = ini.Get_Int(IQCONTROL, "GuardArea", IQGuardArea);
    945 		IQRepairSell = ini.Get_Int(IQCONTROL, "RepairSell", IQRepairSell);
    946 		IQCrush = ini.Get_Int(IQCONTROL, "AutoCrush", IQCrush);
    947 		IQScatter = ini.Get_Int(IQCONTROL, "Scatter", IQScatter);
    948 		IQContentScan = ini.Get_Int(IQCONTROL, "ContentScan", IQContentScan);
    949 		IQAircraft = ini.Get_Int(IQCONTROL, "Aircraft", IQAircraft);
    950 		IQHarvester = ini.Get_Int(IQCONTROL, "Harvester", IQHarvester);
    951 		IQSellBack = ini.Get_Int(IQCONTROL, "SellBack", IQSellBack);
    952 
    953 		return(true);
    954 	}
    955 	return(false);
    956 }
    957 
    958 
    959 /***********************************************************************************************
    960  * RulesClass::Objects -- Fetch all the object characteristic values.                          *
    961  *                                                                                             *
    962  *    This will parse the specified INI database and fetch all the object characteristic       *
    963  *    values specified therein.                                                                *
    964  *                                                                                             *
    965  * INPUT:   ini   -- Reference to the ini database to scan.                                    *
    966  *                                                                                             *
    967  * OUTPUT:  none                                                                               *
    968  *                                                                                             *
    969  * WARNINGS:   none                                                                            *
    970  *                                                                                             *
    971  * HISTORY:                                                                                    *
    972  *   09/10/1996 JLB : Created.                                                                 *
    973  *=============================================================================================*/
    974 bool RulesClass::Objects(CCINIClass & ini)
    975 {
    976 	/*
    977 	**	Fetch the game object values from the rules file.
    978 	*/
    979 	for (int index = 0; index < Warheads.Count(); index++) {
    980 		Warheads.Ptr(index)->Read_INI(ini);
    981 	}
    982 
    983 	for (int proj = 0; proj < BulletTypes.Count(); proj++) {
    984 		BulletTypes.Ptr(proj)->Read_INI(ini);
    985 	}
    986 
    987 	for (int windex = 0; windex < Weapons.Count(); windex++) {
    988 		Weapons.Ptr(windex)->Read_INI(ini);
    989 	}
    990 
    991 	for (int uindex = 0; uindex < UnitTypes.Count(); uindex++) {
    992 		UnitTypes.Ptr(uindex)->Read_INI(ini);
    993 	}
    994 
    995 	for (int iindex = 0; iindex < InfantryTypes.Count(); iindex++) {
    996 		InfantryTypes.Ptr(iindex)->Read_INI(ini);
    997 	}
    998 
    999 	for (int vindex = 0; vindex < VesselTypes.Count(); vindex++) {
   1000 		VesselTypes.Ptr(vindex)->Read_INI(ini);
   1001 	}
   1002 
   1003 	for (int aindex = 0; aindex < AircraftTypes.Count(); aindex++) {
   1004 		AircraftTypes.Ptr(aindex)->Read_INI(ini);
   1005 	}
   1006 
   1007 	for (int bindex = 0; bindex < BuildingTypes.Count(); bindex++) {
   1008 		BuildingTypes.Ptr(bindex)->Read_INI(ini);
   1009 	}
   1010 
   1011 	/*
   1012 	**	Fetch the house attribute override values.
   1013 	*/
   1014 	for (HousesType house = HOUSE_FIRST; house < HOUSE_COUNT; house++) {
   1015 		HouseTypeClass::As_Reference(house).Read_INI(ini);
   1016 	}
   1017 
   1018 	/*
   1019 	**	Fetch the mission control values.
   1020 	*/
   1021 	for (MissionType mission = MISSION_FIRST; mission < MISSION_COUNT; mission++) {
   1022 		MissionControlClass * miss = &MissionControl[mission];
   1023 		miss->Mission = mission;
   1024 		miss->Read_INI(ini);
   1025 	}
   1026 
   1027 	return(true);
   1028 }
   1029 
   1030 
   1031 /***********************************************************************************************
   1032  * RulesClass::Difficulty -- Fetch the various difficulty group settings.                      *
   1033  *                                                                                             *
   1034  *    This routine is used to fetch the various group settings for the difficulty levels.      *
   1035  *                                                                                             *
   1036  * INPUT:   ini   -- Reference to the INI database that has the difficulty setting values.     *
   1037  *                                                                                             *
   1038  * OUTPUT:  bool; Was the difficulty section found and processed.                              *
   1039  *                                                                                             *
   1040  * WARNINGS:   none                                                                            *
   1041  *                                                                                             *
   1042  * HISTORY:                                                                                    *
   1043  *   09/10/1996 JLB : Created.                                                                 *
   1044  *=============================================================================================*/
   1045 bool RulesClass::Difficulty(CCINIClass & ini)
   1046 {
   1047 #if 0
   1048 	Difficulty_Get(ini, Diff[DIFF_EASY], "Easy");
   1049 	Difficulty_Get(ini, Diff[DIFF_NORMAL], "Normal");
   1050 	Difficulty_Get(ini, Diff[DIFF_HARD], "Difficult");
   1051 #endif
   1052 	return(true);
   1053 }
   1054 
   1055 
   1056 /***********************************************************************************************
   1057  * Is_MCV_Deploy -- Check if MCV can be deployed.                                              *
   1058  *                                                                                             *
   1059  *    This routine is used to check if the Construction Yard can revert back into an MCV.      *
   1060  *    It allows the special variables to override anything set by the rules.                   *
   1061  *                                                                                             *
   1062  * INPUT:   none                                                                               *
   1063  *                                                                                             *
   1064  * OUTPUT:  bool; Can the Construction Yard revert back into an MCV.                           *
   1065  *                                                                                             *
   1066  * WARNINGS:   none                                                                            *
   1067  *                                                                                             *
   1068  * HISTORY:                                                                                    *
   1069  *   10/24/2019 SKY : Created.                                                                 *
   1070  *=============================================================================================*/
   1071 bool Is_MCV_Deploy()
   1072 {
   1073 	return Special.UseMCVDeploy ? Special.IsMCVDeploy : Rule.IsMCVDeploy;
   1074 }