mirror of
https://github.com/1dot13/source.git
synced 2026-09-02 14:36:06 +02:00
New Feature: Added up to 15 game difficulty settings (by Jazz)
- Externalized the difficulty setings to "TableData\DifficultySettings.xml" file - Some INI Settings (ja2_options.ini, CTHConstants.ini and Creature_Settings.ini) moved from INI file to this xml file - see #define DIFFICULTY_SETTING git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7447 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -36,6 +36,9 @@
|
||||
#include "Strategic Mines.h"
|
||||
#include "connect.h"
|
||||
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
#include "GameInitOptionsScreen.h"
|
||||
#endif
|
||||
|
||||
#ifdef JA2BETAVERSION
|
||||
BOOLEAN gfClearCreatureQuest = FALSE;
|
||||
@@ -345,6 +348,10 @@ void InitCreatureQuest()
|
||||
}
|
||||
#endif
|
||||
giHabitatedDistance = 0;
|
||||
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
giPopulationModifier = zDeffSetting[gGameOptions.ubDifficultyLevel].iCreaturePopulationModifier;
|
||||
#else
|
||||
switch( gGameOptions.ubDifficultyLevel )
|
||||
{
|
||||
case DIF_LEVEL_EASY:
|
||||
@@ -360,7 +367,8 @@ void InitCreatureQuest()
|
||||
giPopulationModifier = INSANE_POPULATION_MODIFIER;
|
||||
break;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//Determine which of the maps are infectible by creatures. Infectible mines
|
||||
//are those that are player controlled and unlimited. We don't want the creatures to
|
||||
//infect the mine that runs out.
|
||||
@@ -508,6 +516,11 @@ void InitCreatureQuest()
|
||||
curr->uiFlags |= SF_PENDING_ALTERNATE_MAP;
|
||||
|
||||
//Now determine how often we will spread the creatures.
|
||||
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
i = zDeffSetting[gGameOptions.ubDifficultyLevel].iQueenInitBonusSpread;
|
||||
AddPeriodStrategicEvent( EVENT_CREATURE_SPREAD, zDeffSetting[gGameOptions.ubDifficultyLevel].iCreatureSpreadTime, 0 );
|
||||
#else
|
||||
switch( gGameOptions.ubDifficultyLevel )
|
||||
{
|
||||
case DIF_LEVEL_EASY:
|
||||
@@ -527,6 +540,7 @@ void InitCreatureQuest()
|
||||
AddPeriodStrategicEvent( EVENT_CREATURE_SPREAD, INSANE_SPREAD_TIME_IN_MINUTES, 0 );
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
//Set things up so that the creatures can plan attacks on helpless miners and civilians while
|
||||
//they are sleeping. They do their planning at 10PM every day, and decide to attack sometime
|
||||
@@ -637,6 +651,11 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"CreatureSpreading1");
|
||||
case DIF_LEVEL_INSANE: //200%
|
||||
iAbsoluteMaxPopulation *= 2;
|
||||
break;
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
default:
|
||||
iAbsoluteMaxPopulation /= 2; //Half
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
//Calculate the desired max population percentage based purely on current distant to creature range.
|
||||
@@ -682,6 +701,9 @@ void SpreadCreatures()
|
||||
}
|
||||
|
||||
//queen just produced a litter of creature larvae. Let's do some spreading now.
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
usNewCreatures = (UINT16)( zDeffSetting[gGameOptions.ubDifficultyLevel].iQueenReproductionBase + Random( 1 + zDeffSetting[gGameOptions.ubDifficultyLevel].iQueenReproductionBonus ));
|
||||
#else
|
||||
switch( gGameOptions.ubDifficultyLevel )
|
||||
{
|
||||
case DIF_LEVEL_EASY:
|
||||
@@ -697,6 +719,7 @@ void SpreadCreatures()
|
||||
usNewCreatures = (UINT16)(INSANE_QUEEN_REPRODUCTION_BASE + Random( 1 + INSANE_QUEEN_REPRODUCTION_BONUS ));
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
while( usNewCreatures-- )
|
||||
{
|
||||
@@ -1737,6 +1760,14 @@ void CreatureNightPlanning()
|
||||
ubNumCreatures = CreaturesInUndergroundSector( ubSectorID , 1 );
|
||||
|
||||
//10% chance for each creature with difficulty modifier to decide it's time to attack.
|
||||
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
i = zDeffSetting[gGameOptions.ubDifficultyLevel].iCreatureTownAggressiveness;
|
||||
if( ubNumCreatures > 1 && ubNumCreatures * 10 + i > (INT32)PreRandom( 100 ) )
|
||||
{
|
||||
AddStrategicEvent( EVENT_CREATURE_ATTACK, GetWorldTotalMin() + 1 + PreRandom( 429 ), ubSectorID );
|
||||
}
|
||||
#else
|
||||
switch( gGameOptions.ubDifficultyLevel )
|
||||
{
|
||||
case DIF_LEVEL_EASY:
|
||||
@@ -1768,6 +1799,7 @@ void CreatureNightPlanning()
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
//if( ubNumCreatures > 1 && ubNumCreatures * 10 > (INT32)PreRandom( 100 ) )
|
||||
//{ //10% chance for each creature to decide it's time to attack.
|
||||
// AddStrategicEvent( EVENT_CREATURE_ATTACK, GetWorldTotalMin() + 1 + PreRandom( 429 ), ubSectorID );
|
||||
|
||||
Reference in New Issue
Block a user