Files
source/legion cfg.cpp
T
Wanne e64d5a2fa6 MERGED source code from development trunk revision 4545 up to latest current revision 4882
Development Trunk: https://ja2svn.dyndns.org/source/ja2/branches/Wanne/JA2%201.13%20MP
A detailed list of all the features (changes) is visible in the history log of the development trunk:

INFO: The source code for the official 2011 release (4870) has been branched here:
https://ja2svn.dyndns.org/source/ja2/branches/JA2_rev.4870_2011

This commit contains the following features:

*** Externalized Vehicles ***
o Now with this feature we can add/remove vehicles
o New XML File: TableData\Vehicles.xml
o Added a new function parameter to lua file Scripts\Overhead lua to set up the helicopter in method: SetUpHelicopterForPlayer()
o Added example mini (Docs\Externalized Vehicles Example.zip) mod which adds 2 additional vehicles (hummer and ice-cream truck to sector A9)

*** Up to 255 save slots ***
- There is a "Next" and "Prev" button where you can scroll through the save slots
- It is now possible to load the automatic save (SAVE_EVERY_N_HOURS) from the load screen. This is the first slot after the quickload slot
- Added the 2 alternate players end turn saves (which can be enabled/disabled in option screen) to the save/load game form

*** New Feature: Externalized emails from Emails.edt to XML***
o This feature can be enabled/disabled in the Source:
--> See email.cpp: If "ReadXMLEmail" == FALSE, then normal way (read from Email.edt) otherwise read from XML files
o 2 new XML files: TableData\Email\EmailMercAvailable.xml and EmailMercLevelUp.xml
o Renamed SenderNamesList.xml to EmailSenderNamesList.xml and moved from TableData folder to TableData\Email folder
o Names for mercenaries are get from the file MercProfiles.xml and different names get from the file EmailSenderNamesList.xml

*** Externalized Hidden Towns (Tixa, Orta) ***
o Now it is possible to add new hidden towns (locations)
o See file: TableData/Map/Cities.xml
o New variable in TableData/Map/Cities.xml
- hiddenTown:   0 = show on strategy map, 1 = Hide on strategy map
- townIcon:     1 = on, 0 = off (This is the icon you see on the strategy map)
- szIconFile:   The path to the sti icon file (eg: interface\prison.sti, interface\my_icon.sti)
- iconPosition: The x,y position of the icon on the strategy map

*** Encyclopedia and Briefing Room, reachable from the laptop ***
o 2 new ja2_options.ini properties: BRIEFING_ROOM, ENCYCLOPEDIA
o demonstration video: http://www.youtube.com/watch?v=7CIXdXWLrAo
o Added Example usage of the Briefing Room
- Extract it in your JA2 1.13 folder and use the latest development executable
- The briefing room can be reached from the laptop. Enter SN5631 for the code and then click the "Exit" button
- See "Info_BriefingRoom.txt" and "BriefingRoom_Mission1.png"

*** Improved interrupt system (IIS) ***
o This system changes the way interrupts work. See: http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=290787#Post290787
o Option system (see ja2_options.ini: IMPROVED_INTERRUPT_SYSTEM)
o A few more settings for the interrupt system in ja2_options.ini
o INFO: Multiplayer games always use the "old" interrupt system, not matter what the user selects in the ja2_options.ini

*** Walking and sidestepping with weapon raised ***
o Enable/disable the walking/sidestepping with raised weapon in ja2_options.ini: ALLOW_WALKING_WITH_WEAPON_RAISED
o You can set an AP/BP modifier when walking/sidestepping with weapon raised in APBPConstants.ini: AP_MODIFIER_WEAPON_READY
o The following feature apply when you walk/sidestep with weapon raised:
-> limited angle of view, but you can see more farther when the weapon has a scope
-> better change for interrupts if you see an enemy
-> less APs and BPs when shooting, because the weapon is already raised
-> It should cost more APs when walking. Maybe you can export the additional AP and BP modifier to the APBPConstants.ini

*** Increase squad size to 8 (800x600) and 8 and 10 (1024x768) ***
o Squad sizes (dependend on the screen resolution) can be selected in the start new game screen
o In a multiplayer game, the squad size will always be 6, because it does not work with more soldiers/squad

*** Added UB-1.13 source code ***
o Merged the UB-1.13 source code (Revision: 4721) from svn: http://subversion.assembla.com/svn/ub-source113
o If you want to build UB-EXE or UB-MapEditor, just enable the 2 defines (JA2UB and JA2UBMAPS) in "builddefines.h"
o The UB-Verion reads from "ja2_UB.ini" instead of "ja2.ini"
o There are 2 new XML files
- Layout\LayoutMainMenu.xml
- MapAction\ActionItems.xml
o There are 2 new LUA-Script files
- Scripts\ExplosionControl.lua
- Scripts\InterfaceDialogue.lua

*** Hide enemy health text / enemy hit count ***
o ja2_options.ini: HIDE_ENEMY_HEALTH_TEXT, HIDE_ENEMY_HIT_COUNT
o both new settings only have effect in a singleplayer game
o see: http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=128840&page=1


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4885 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2012-01-18 11:19:01 +00:00

316 lines
15 KiB
C++

//legion 2
#ifdef PRECOMPILEDHEADERS
#include "Types.h"
#include "types.h"
#include "Strategic All.h"
#include "XML.h"
#include "INIReader.h"
#include "GameSettings.h"
#include "Soldier Profile.h"
#include "XML.h"
#include "Item Types.h"
#include "Items.h"
#include "Game Event Hook.h"
#include "faces.h"
#include "Language Defines.h"
#include "Types.h"
#include "Map Screen Interface Map.h"
#include "legion cfg.h" //legion2
//#include "XMLWriter.h"
#else
#include "Types.h"
#include "types.h"
#include "Campaign Init.h"
#include "Random.h"
#include "Campaign Types.h"
#include "Queen Command.h"
#include "overhead.h"
#include "Strategic Movement.h"
#include "Strategic Status.h"
#include "GameSettings.h"
#include "Creature Spreading.h"
#include "Strategic AI.h"
#include "XML.h"
#include "INIReader.h"
#include "Game init.h"
#include "Game Event Hook.h"
#include "sgp.h"
#include "jascreens.h"
#include "laptop.h"
#include "worlddef.h"
#include "Soldier Control.h"
#include "overhead.h"
#include "fade screen.h"
#include "gamescreen.h"
#include "email.h"
#include "Game Clock.h"
#include "soldier profile.h"
#include "strategicmap.h"
#include "game init.h"
#include "animation data.h"
#include "finances.h"
#include "soldier create.h"
#include "Soldier Init List.h"
#include "music control.h"
#include "strategic.h"
#include "history.h"
#include "merc entering.h"
#include "Squads.h"
#include "Campaign Init.h"
#include "Strategic Town Loyalty.h"
#include "Strategic Mines.h"
#include "gameloop.h"
#include "Random.h"
#include "Map Screen Interface.h"
#include "Tactical Save.h"
#include "Campaign Types.h"
#include "Message.h"
#include "Game Event Hook.h"
#include "Strategic Movement.h"
#include "Creature Spreading.h"
#include "Quests.h"
#include "Strategic AI.h"
#include "sound control.h"
#include "Laptopsave.h"
#include "AimMembers.h"
#include "dialogue control.h"
#include "npc.h"
#include "Init.h"
#include "GameSettings.h"
#include "INIReader.h"
#include "Soldier Profile.h"
#include "XML.h"
#include "Item Types.h"
#include "Items.h"
#include "text.h"
#include "GameSettings.h"
#endif
#ifdef JA2UB
#include "Ja25 Strategic Ai.h"
#include "Ja25Update.h"
#endif
#include "legion cfg.h" //legion2
#include "Campaign Types.h"
#include "Interface.h"
#include "Map Screen Interface Map.h"
#include "renderworld.h"
#include "aim.h"
#include "connect.h"
#include "expat.h"
#include "XMLWriter.h"
#include "Debug Control.h"
#include <vfs/Core/vfs.h>
GAME_LEGION_OPTIONS gGameLegionOptions;
#define GAME_LEGION_OPTIONS_FILE "UB_Options.ini"
void LoadGameLegionOptions();
#ifdef JA2UB
void RandomAddEnemy( UINT8 SectorX, UINT8 SectorY, UINT8 Level );
#endif
void RandomStats ();
#ifdef JA2UB
void RandomAddEnemy( UINT8 SectorX, UINT8 SectorY, UINT8 Level )
{
UNDERGROUND_SECTORINFO *pSector;
UINT8 ubNumAdmins = 0;
UINT8 ubNumTroops = 0;
UINT8 ubNumElites = 0;
if ( Level != 0 )
{
pSector = FindUnderGroundSector( SectorX, SectorY, Level );
if ( pSector )
{
if ( pSector->fVisited != TRUE )
{
switch( gGameOptions.ubDifficultyLevel )
{
case DIF_LEVEL_EASY:
ubNumAdmins = Random( 0 );
ubNumTroops = 10 + Random( 5 );
ubNumElites = Random( 4 );
SetNumberJa25EnemiesInSector( SectorX, SectorY, Level, ubNumAdmins, ubNumTroops, ubNumElites );
break;
case DIF_LEVEL_MEDIUM:
ubNumAdmins = Random( 0 );
ubNumTroops = 15 + Random( 8 );
ubNumElites = 1 + Random( 2 );
SetNumberJa25EnemiesInSector( SectorX, SectorY, Level, ubNumAdmins, ubNumTroops, ubNumElites );
break;
case DIF_LEVEL_HARD:
ubNumAdmins = Random( 0 );
ubNumTroops = 20 + Random( 7 );
ubNumElites = 2 + Random( 2 );
SetNumberJa25EnemiesInSector( SectorX, SectorY, Level, ubNumAdmins, ubNumTroops, ubNumElites );
break;
case DIF_LEVEL_INSANE:
ubNumAdmins = Random( 0 );
ubNumTroops = 20 + Random( 3 );
ubNumElites = 6 + Random( 3 );
SetNumberJa25EnemiesInSector( SectorX, SectorY, Level, ubNumAdmins, ubNumTroops, ubNumElites );
break;
}
}
}
}
else
{
if ( !GetSectorFlagStatus( SectorX, SectorY, Level, SF_ALREADY_VISITED ) )
{
switch( gGameOptions.ubDifficultyLevel )
{
case DIF_LEVEL_EASY:
ubNumAdmins = Random( 0 );
ubNumTroops = 10 + Random( 5 );
ubNumElites = Random( 4 );
SetNumberJa25EnemiesInSector( SectorX, SectorY, Level, ubNumAdmins, ubNumTroops, ubNumElites );
break;
case DIF_LEVEL_MEDIUM:
ubNumAdmins = Random( 0 );
ubNumTroops = 15 + Random( 8 );
ubNumElites = 1 + Random( 2 );
SetNumberJa25EnemiesInSector( SectorX, SectorY, Level, ubNumAdmins, ubNumTroops, ubNumElites );
break;
case DIF_LEVEL_HARD:
ubNumAdmins = Random( 0 );
ubNumTroops = 23 + Random( 7);
ubNumElites = 2 + Random( 2 );
SetNumberJa25EnemiesInSector( SectorX, SectorY, Level, ubNumAdmins, ubNumTroops, ubNumElites );
break;
case DIF_LEVEL_INSANE:
ubNumAdmins = Random( 0 );
ubNumTroops = 20 + Random( 3 );
ubNumElites = 6 + Random( 3 );
SetNumberJa25EnemiesInSector( SectorX, SectorY, Level, ubNumAdmins, ubNumTroops, ubNumElites );
break;
}
}
}
}
#endif
void LoadGameLegionOptions()
{
#ifdef JA2UB
JA2_5_START_SECTOR_X = gGameExternalOptions.ubDefaultArrivalSectorX;
JA2_5_START_SECTOR_Y = gGameExternalOptions.ubDefaultArrivalSectorY;
#endif
gGameLegionOptions.MercStartingGear25XML = TRUE;
gGameLegionOptions.LOCATEGRIDNO = gGameExternalOptions.iInitialMercArrivalLocation;
gGameLegionOptions.LOCATEGRIDNO2 = 0;
gGameLegionOptions.OLDUBInventory = FALSE;
CIniReader iniReader(GAME_LEGION_OPTIONS_FILE);
// -----------------------
// Unfinished Business
// -----------------------
gGameLegionOptions.BorderTown = iniReader.ReadBoolean("Unfinished Business Settings","BORDER_TOWN", TRUE);
gGameLegionOptions.BorderMine = iniReader.ReadBoolean("Unfinished Business Settings","BORDER_MINE", TRUE);
gGameLegionOptions.BorderTeams = iniReader.ReadBoolean("Unfinished Business Settings","BORDER_TEAMS", TRUE);
gGameLegionOptions.BorderMilitia = iniReader.ReadBoolean("Unfinished Business Settings","BORDER_MILITIA", FALSE);
gGameLegionOptions.BorderAirspace = iniReader.ReadBoolean("Unfinished Business Settings","BORDER_AIRSPACE", TRUE);
gGameLegionOptions.BorderItem = iniReader.ReadBoolean("Unfinished Business Settings","BORDER_ITEM", TRUE);
gGameLegionOptions.EventAttackInitialSectorIfPlayerStillThere = iniReader.ReadBoolean("Unfinished Business Settings","EVENT_ATTACK_INITIAL_SECTOR_IF_PLAYER_STILL_THERE", TRUE);
gGameLegionOptions.HandleAddingEnemiesToTunnelMaps = iniReader.ReadBoolean("Unfinished Business Settings","HANDLE_ADDING_ENEMIES_TO_TUNNEL_MAPS", TRUE);
gGameLegionOptions.ubEndDefaultSectorX = iniReader.ReadInteger("Unfinished Business Settings","DEFAULT_END_SECTOR_X", 16, 1, 16);
gGameLegionOptions.ubEndDefaultSectorY = iniReader.ReadInteger("Unfinished Business Settings","DEFAULT_END_SECTOR_Y", 11, 1, 16);
gGameLegionOptions.ubEndDefaultSectorZ = iniReader.ReadInteger("Unfinished Business Settings","DEFAULT_END_SECTOR_Z", 0, 0, 16);
gGameLegionOptions.AutoResolove = iniReader.ReadBoolean("Unfinished Business Settings","AUTO_RESOLVE", FALSE);
gGameLegionOptions.InitialHeliGridNo[ 0 ] = iniReader.ReadInteger("Unfinished Business Settings","INITIAL_HELICOPTER_GRIDNO_1", 14947);
gGameLegionOptions.InitialHeliGridNo[ 1 ] = iniReader.ReadInteger("Unfinished Business Settings","INITIAL_HELICOPTER_GRIDNO_2", 15584);
gGameLegionOptions.InitialHeliGridNo[ 2 ] = iniReader.ReadInteger("Unfinished Business Settings","INITIAL_HELICOPTER_GRIDNO_3", 15754);
gGameLegionOptions.InitialHeliGridNo[ 3 ] = iniReader.ReadInteger("Unfinished Business Settings","INITIAL_HELICOPTER_GRIDNO_4", 16232);
gGameLegionOptions.InitialHeliGridNo[ 4 ] = iniReader.ReadInteger("Unfinished Business Settings","INITIAL_HELICOPTER_GRIDNO_5", 16067);
gGameLegionOptions.InitialHeliGridNo[ 5 ] = iniReader.ReadInteger("Unfinished Business Settings","INITIAL_HELICOPTER_GRIDNO_6", 16230);
gGameLegionOptions.InitialHeliGridNo[ 6 ] = iniReader.ReadInteger("Unfinished Business Settings","INITIAL_HELICOPTER_GRIDNO_7", 15272);
gGameLegionOptions.InitalHeliRandomTimes[ 0 ] = iniReader.ReadInteger("Unfinished Business Settings","INITIAL_HELICOPTER_RANDOM_TIME_1", 1300);
gGameLegionOptions.InitalHeliRandomTimes[ 1 ] = iniReader.ReadInteger("Unfinished Business Settings","INITIAL_HELICOPTER_RANDOM_TIME_2", 2000);
gGameLegionOptions.InitalHeliRandomTimes[ 2 ] = iniReader.ReadInteger("Unfinished Business Settings","INITIAL_HELICOPTER_RANDOM_TIME_3", 2750);
gGameLegionOptions.InitalHeliRandomTimes[ 3 ] = iniReader.ReadInteger("Unfinished Business Settings","INITIAL_HELICOPTER_RANDOM_TIME_4", 3400);
gGameLegionOptions.InitalHeliRandomTimes[ 4 ] = iniReader.ReadInteger("Unfinished Business Settings","INITIAL_HELICOPTER_RANDOM_TIME_5", 4160);
gGameLegionOptions.InitalHeliRandomTimes[ 5 ] = iniReader.ReadInteger("Unfinished Business Settings","INITIAL_HELICOPTER_RANDOM_TIME_6", 4700);
gGameLegionOptions.InitalHeliRandomTimes[ 6 ] = iniReader.ReadInteger("Unfinished Business Settings","INITIAL_HELICOPTER_RANDOM_TIME_7", 5630);
gGameLegionOptions.InGameHeliCrash = iniReader.ReadBoolean("Unfinished Business Settings","ENABLE_UB_HELICOPTER_CRASH", TRUE);
gGameLegionOptions.JerryQuotes = iniReader.ReadBoolean("Unfinished Business Settings","JERRY_QUOTES", TRUE);
gGameLegionOptions.InJerry = iniReader.ReadBoolean("Unfinished Business Settings","JERRY", TRUE);
gGameLegionOptions.JerryGridNo = iniReader.ReadInteger("Unfinished Business Settings","JERRY_GRIDNO", 15109);
gGameLegionOptions.InGameHeli = iniReader.ReadBoolean("Unfinished Business Settings","ENABLE_JA2_HELICOPTER_LANDING", FALSE);
gGameLegionOptions.SwitchInMorrisAreaGridNo = iniReader.ReadInteger("Unfinished Business Settings","SWITCH_IN_MORRIS_AREA_GRIDNO", 15231);
gGameLegionOptions.SwitchToLaunchMisslesGridNo1 = iniReader.ReadInteger("Unfinished Business Settings","SWITCH_TO_LAUNCH_MISSLES_GRIDNO_1", 14268);
gGameLegionOptions.SwitchToLaunchMisslesGridNo2 = iniReader.ReadInteger("Unfinished Business Settings","SWITCH_TO_LAUNCH_MISSLES_GRIDNO_2", 15708);
gGameLegionOptions.RadioLocatorsGridNo1 = iniReader.ReadInteger("Unfinished Business Settings","RADIO_LOCATORS_GRIDNO_1", 15070);
gGameLegionOptions.RadioLocatorsGridNo2 = iniReader.ReadInteger("Unfinished Business Settings","RADIO_LOCATORS_GRIDNO_2", 14744);
gGameLegionOptions.PowergenSectorGridNo1 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_GRIDNO_1", 15100);
gGameLegionOptions.PowergenSectorGridNo2 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_GRIDNO_2", 12220);
gGameLegionOptions.PowergenSectorGridNo3 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_GRIDNO_3", 14155);
gGameLegionOptions.PowergenSectorGridNo4 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_GRIDNO_4", 13980);
gGameLegionOptions.PowergenSectorExitgridGridNo = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_EXITGRID_GRIDNO", 19749);
gGameLegionOptions.PowergenFanSoundGridNo1 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_FAN_SOUND_GRIDNO_1", 10979);
gGameLegionOptions.PowergenFanSoundGridNo2 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_FAN_SOUND_GRIDNO_2", 19749);
gGameLegionOptions.StartFanbackupAgainGridNo = iniReader.ReadInteger("Unfinished Business Settings","START_FANBACKUP_AGAIN_GRIDNO", 10980);
gGameLegionOptions.StopPowergenFanGridNo = iniReader.ReadInteger("Unfinished Business Settings","STOP_POWERGEN_FAN_GRIDNO", 10980);
//sec J13
gGameLegionOptions.FanGridNo[0] = iniReader.ReadInteger("Unfinished Business Settings","FAN_GRIDNO_1", 10978);
gGameLegionOptions.FanGridNo[1] = iniReader.ReadInteger("Unfinished Business Settings","FAN_GRIDNO_2", 10979);
gGameLegionOptions.FanGridNo[2] = iniReader.ReadInteger("Unfinished Business Settings","FAN_GRIDNO_3", 10980);
gGameLegionOptions.FanGridNo[3] = iniReader.ReadInteger("Unfinished Business Settings","FAN_GRIDNO_4", 10818);
gGameLegionOptions.FanGridNo[4] = iniReader.ReadInteger("Unfinished Business Settings","FAN_GRIDNO_5", 10819);
gGameLegionOptions.FanGridNo[5] = iniReader.ReadInteger("Unfinished Business Settings","FAN_GRIDNO_6", 10820);
gGameLegionOptions.FanGridNo[6] = iniReader.ReadInteger("Unfinished Business Settings","FAN_GRIDNO_7", 10658);
gGameLegionOptions.FanGridNo[7] = iniReader.ReadInteger("Unfinished Business Settings","FAN_GRIDNO_8", 10659);
gGameLegionOptions.FanGridNo[8] = iniReader.ReadInteger("Unfinished Business Settings","FAN_GRIDNO_9", 10660);
if ( gGameLegionOptions.InGameHeli == TRUE )
gGameLegionOptions.InGameHeliCrash = FALSE;
if ( gGameLegionOptions.InGameHeliCrash == TRUE )
gGameLegionOptions.InGameHeli = FALSE;
if ( gGameLegionOptions.InGameHeli == TRUE && gGameLegionOptions.InGameHeliCrash == TRUE )
{
gGameLegionOptions.InGameHeliCrash = TRUE;
gGameLegionOptions.InGameHeli = FALSE;
}
// -----------------------
// Campaign
// -----------------------
gGameLegionOptions.EnemyXML = iniReader.ReadBoolean("Campaign Settings","USE_ENEMY_ARMY_XMLS", TRUE);
gGameLegionOptions.AddRandomEnemyToSector = iniReader.ReadBoolean("Campaign Settings","ADD_RANDOM_ENEMY_TO_SECTOR", FALSE);
gGameLegionOptions.StrategicMovementCostsXML = iniReader.ReadBoolean("Campaign Settings","STRATEGIC_MOVEMENT_COSTS_XML", FALSE);
gGameLegionOptions.MakeStrategicMovementCosts = iniReader.ReadBoolean("Campaign Settings","MAKE_STRATEGIC_MOVEMENT_COSTS", FALSE);
gGameLegionOptions.LaptopQuestEnabled = iniReader.ReadBoolean("Campaign Settings","LAPTOP_QUEST", TRUE);
gGameLegionOptions.pJA2UB = iniReader.ReadBoolean("Campaign Settings","JA2UB", TRUE);
gGameLegionOptions.fDeadMerc = iniReader.ReadBoolean("Campaign Settings","NOTIFY_ON_DEAD_AIM_MERCS", FALSE);
// -----------------------
// Laptop
// -----------------------
gGameLegionOptions.LaptopIMPPassJA2 = iniReader.ReadBoolean("Laptop Settings","IMP_PASS_JA2", FALSE);
gGameLegionOptions.LaptopIMPPassUB = iniReader.ReadBoolean("Laptop Settings","IMP_PASS_UB", TRUE);
gGameLegionOptions.LaptopLinkInsurance = iniReader.ReadBoolean("Laptop Settings","LINK_INSURANCE", FALSE);
gGameLegionOptions.LaptopLinkFuneral = iniReader.ReadBoolean("Laptop Settings","LINK_FUNERAL", TRUE);
gGameLegionOptions.LaptopLinkBobby = iniReader.ReadBoolean("Laptop Settings","LINK_BOBBY", FALSE);
gGameLegionOptions.fBobbyRSite = iniReader.ReadBoolean("Laptop Settings","BOBBY_SITE_ACCESSED", FALSE);
}