- Added a summonfoe CCMD, which is analagous to summonfriend but forces the

summoned creature to be hostile instead.


SVN r453 (trunk)
This commit is contained in:
Randy Heit 2007-01-16 03:04:00 +00:00
parent de18276b24
commit f0f976c4f5
5 changed files with 39 additions and 8 deletions

View file

@ -1,4 +1,6 @@
January 15, 2007 January 15, 2007
- Added a summonfoe CCMD, which is analagous to summonfriend but forces the
summoned creature to be hostile instead.
- Changed the default snd_output under Linux to OSS. - Changed the default snd_output under Linux to OSS.
- Added a GTK+ version of the IWAD selection dialog box. That brings the - Added a GTK+ version of the IWAD selection dialog box. That brings the
Linux port one step closer to feature parity with the Windows version. Linux port one step closer to feature parity with the Windows version.

View file

@ -2089,6 +2089,7 @@ void Net_DoCommand (int type, BYTE **stream, int player)
case DEM_SUMMON: case DEM_SUMMON:
case DEM_SUMMONFRIEND: case DEM_SUMMONFRIEND:
case DEM_SUMMONFOE:
{ {
const PClass *typeinfo; const PClass *typeinfo;
@ -2110,15 +2111,23 @@ void Net_DoCommand (int type, BYTE **stream, int player)
source->x + FixedMul (def->radius * 2 + source->radius, finecosine[source->angle>>ANGLETOFINESHIFT]), source->x + FixedMul (def->radius * 2 + source->radius, finecosine[source->angle>>ANGLETOFINESHIFT]),
source->y + FixedMul (def->radius * 2 + source->radius, finesine[source->angle>>ANGLETOFINESHIFT]), source->y + FixedMul (def->radius * 2 + source->radius, finesine[source->angle>>ANGLETOFINESHIFT]),
source->z + 8 * FRACUNIT, ALLOW_REPLACE); source->z + 8 * FRACUNIT, ALLOW_REPLACE);
if (spawned != NULL && type == DEM_SUMMONFRIEND) if (spawned != NULL)
{ {
if (spawned->CountsAsKill()) if (type == DEM_SUMMONFRIEND)
{ {
level.total_monsters--; if (spawned->CountsAsKill())
{
level.total_monsters--;
}
spawned->FriendPlayer = player + 1;
spawned->flags |= MF_FRIENDLY;
spawned->LastHeard = players[player].mo;
}
else if (type == DEM_SUMMONFOE)
{
spawned->FriendPlayer = 0;
spawned->flags &= ~MF_FRIENDLY;
} }
spawned->FriendPlayer = player + 1;
spawned->flags |= MF_FRIENDLY;
spawned->LastHeard = players[player].mo;
} }
} }
} }
@ -2315,6 +2324,7 @@ void Net_SkipCommand (int type, BYTE **stream)
case DEM_CHANGEMAP: case DEM_CHANGEMAP:
case DEM_SUMMON: case DEM_SUMMON:
case DEM_SUMMONFRIEND: case DEM_SUMMONFRIEND:
case DEM_SUMMONFOE:
case DEM_SPRAY: case DEM_SPRAY:
case DEM_MORPHEX: case DEM_MORPHEX:
skip = strlen ((char *)(*stream)) + 1; skip = strlen ((char *)(*stream)) + 1;

View file

@ -143,6 +143,7 @@ enum EDemoCommand
DEM_CHECKAUTOSAVE, // 41 Check if the user has autosaves enabled. Ignored for demoplayback. DEM_CHECKAUTOSAVE, // 41 Check if the user has autosaves enabled. Ignored for demoplayback.
DEM_DOAUTOSAVE, // 42 An autosave should be made DEM_DOAUTOSAVE, // 42 An autosave should be made
DEM_MORPHEX, // 43 String: The class to morph to. DEM_MORPHEX, // 43 String: The class to morph to.
DEM_SUMMONFOE, // 44 String: Thing to fabricate
}; };
// The following are implemented by cht_DoCheat in m_cheat.cpp // The following are implemented by cht_DoCheat in m_cheat.cpp

View file

@ -745,3 +745,21 @@ CCMD (summonfriend)
Net_WriteString (type->TypeName.GetChars()); Net_WriteString (type->TypeName.GetChars());
} }
} }
CCMD (summonfoe)
{
if (CheckCheatmode ())
return;
if (argv.argc() > 1)
{
const PClass *type = PClass::FindClass (argv[1]);
if (type == NULL)
{
Printf ("Unknown class '%s'\n", argv[1]);
return;
}
Net_WriteByte (DEM_SUMMONFOE);
Net_WriteString (type->TypeName.GetChars());
}
}

View file

@ -54,7 +54,7 @@
// Version identifier for network games. // Version identifier for network games.
// Bump it every time you do a release unless you're certain you // Bump it every time you do a release unless you're certain you
// didn't change anything that will affect sync. // didn't change anything that will affect sync.
#define NETGAMEVERSION 211 #define NETGAMEVERSION 212
// Version stored in the ini's [LastRun] section. // Version stored in the ini's [LastRun] section.
// Bump it if you made some configuration change that you want to // Bump it if you made some configuration change that you want to
@ -64,7 +64,7 @@
// Protocol version used in demos. // Protocol version used in demos.
// Bump it if you change existing DEM_ commands or add new ones. // Bump it if you change existing DEM_ commands or add new ones.
// Otherwise, it should be safe to leave it alone. // Otherwise, it should be safe to leave it alone.
#define DEMOGAMEVERSION 0x207 #define DEMOGAMEVERSION 0x208
// Minimum demo version we can play. // Minimum demo version we can play.
// Bump it whenever you change or remove existing DEM_ commands. // Bump it whenever you change or remove existing DEM_ commands.