From f0f976c4f5dbcf6c104536435b068c25f23e01d9 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Tue, 16 Jan 2007 03:04:00 +0000 Subject: [PATCH] - Added a summonfoe CCMD, which is analagous to summonfriend but forces the summoned creature to be hostile instead. SVN r453 (trunk) --- docs/rh-log.txt | 2 ++ src/d_net.cpp | 22 ++++++++++++++++------ src/d_protocol.h | 1 + src/info.cpp | 18 ++++++++++++++++++ src/version.h | 4 ++-- 5 files changed, 39 insertions(+), 8 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 82b5bae71b..88ba2cd72d 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,6 @@ 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. - 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. diff --git a/src/d_net.cpp b/src/d_net.cpp index 452b37abcc..c661572840 100644 --- a/src/d_net.cpp +++ b/src/d_net.cpp @@ -2089,6 +2089,7 @@ void Net_DoCommand (int type, BYTE **stream, int player) case DEM_SUMMON: case DEM_SUMMONFRIEND: + case DEM_SUMMONFOE: { 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->y + FixedMul (def->radius * 2 + source->radius, finesine[source->angle>>ANGLETOFINESHIFT]), 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_SUMMON: case DEM_SUMMONFRIEND: + case DEM_SUMMONFOE: case DEM_SPRAY: case DEM_MORPHEX: skip = strlen ((char *)(*stream)) + 1; diff --git a/src/d_protocol.h b/src/d_protocol.h index 8b739fc34e..c164d0c108 100644 --- a/src/d_protocol.h +++ b/src/d_protocol.h @@ -143,6 +143,7 @@ enum EDemoCommand DEM_CHECKAUTOSAVE, // 41 Check if the user has autosaves enabled. Ignored for demoplayback. DEM_DOAUTOSAVE, // 42 An autosave should be made 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 diff --git a/src/info.cpp b/src/info.cpp index 5cd50bc389..6e24688bd5 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -745,3 +745,21 @@ CCMD (summonfriend) 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()); + } +} diff --git a/src/version.h b/src/version.h index 8a2980fcec..95458dcea3 100644 --- a/src/version.h +++ b/src/version.h @@ -54,7 +54,7 @@ // Version identifier for network games. // Bump it every time you do a release unless you're certain you // didn't change anything that will affect sync. -#define NETGAMEVERSION 211 +#define NETGAMEVERSION 212 // Version stored in the ini's [LastRun] section. // Bump it if you made some configuration change that you want to @@ -64,7 +64,7 @@ // Protocol version used in demos. // Bump it if you change existing DEM_ commands or add new ones. // Otherwise, it should be safe to leave it alone. -#define DEMOGAMEVERSION 0x207 +#define DEMOGAMEVERSION 0x208 // Minimum demo version we can play. // Bump it whenever you change or remove existing DEM_ commands.