Added Man vs Machine game type

This commit is contained in:
jsalmon3 2002-11-16 02:10:49 +00:00
parent 458d735355
commit ddfcb54ca9
4 changed files with 30 additions and 10 deletions

View file

@ -978,6 +978,7 @@
<LI>Fixed bug #638383: Freecraft memfill on some puds (from Jimmy Salmon).
<LI>Fixed bug #634359: Click while in comment makes invisible (from
Jimmy Salmon).
<LI>Added Man vs Machine game type (from Jimmy Salmon).
<LI>+++
</UL>
</UL>

View file

@ -160,9 +160,6 @@ local void LoadMap(const char* filename,WorldMap* map)
/**
** Free for all
**
** @todo FIXME: It is not necessary to use send command, the setup is
** executed on all machines.
*/
local void GameTypeFreeForAll(void)
{
@ -180,9 +177,6 @@ local void GameTypeFreeForAll(void)
/**
** Top vs Bottom
**
** @todo FIXME: It is not necessary to use send command, the setup is
** executed on all machines.
*/
local void GameTypeTopVsBottom(void)
{
@ -209,9 +203,6 @@ local void GameTypeTopVsBottom(void)
/**
** Left vs Right
**
** @todo FIXME: It is not necessary to use send command, the setup is
** executed on all machines.
*/
local void GameTypeLeftVsRight(void)
{
@ -236,6 +227,30 @@ local void GameTypeLeftVsRight(void)
}
}
/**
** Man vs Machine
*/
local void GameTypeManVsMachine(void)
{
int i;
int j;
for (i=0; i<15; i++) {
if (Players[i].Type!=PlayerPerson && Players[i].Type!=PlayerComputer ) {
continue;
}
for (j=0; j<15; j++) {
if (i != j) {
if (Players[i].Type==Players[j].Type) {
CommandDiplomacy(i,DiplomacyAllied,j);
} else {
CommandDiplomacy(i,DiplomacyEnemy,j);
}
}
}
}
}
/**
** CreateGame.
**
@ -342,6 +357,9 @@ global void CreateGame(char* filename, WorldMap* map)
case SettingsGameTypeLeftVsRight:
GameTypeLeftVsRight();
break;
case SettingsGameTypeManVsMachine:
GameTypeManVsMachine();
break;
// Future game type ideas
#if 0

View file

@ -43,7 +43,7 @@
/// Network protocol minor version (maximal 99)
#define NetworkProtocolMinorVersion 4
/// Network protocol patch level (maximal 99)
#define NetworkProtocolPatchLevel 9
#define NetworkProtocolPatchLevel 10
/// Network protocol version (1,2,3) -> 10203
#define NetworkProtocolVersion \
(NetworkProtocolMajorVersion*10000+NetworkProtocolMinorVersion*100 \

View file

@ -97,6 +97,7 @@ enum _game_types_ {
SettingsGameTypeFreeForAll,
SettingsGameTypeTopVsBottom,
SettingsGameTypeLeftVsRight,
SettingsGameTypeManVsMachine,
// Future game type ideas
#if 0