This commit is contained in:
Christoph Oelckers 2015-08-12 10:08:01 +02:00
commit 5a7afad0b3
12 changed files with 120 additions and 24 deletions

View file

@ -360,6 +360,20 @@ static FColorCVar *cv_overlay[] = {
&am_ovsecretsectorcolor
};
CCMD(am_restorecolors)
{
for (unsigned i = 0; i < countof(cv_standard); i++)
{
cv_standard[i]->ResetToDefault();
}
for (unsigned i = 0; i < countof(cv_overlay); i++)
{
cv_overlay[i]->ResetToDefault();
}
}
#define NOT_USED 1,0,0 // use almost black as indicator for an unused color
static unsigned char DoomColors[]= {

View file

@ -2082,6 +2082,33 @@ static int KillAll(const PClass *cls)
}
return killcount;
}
static int RemoveClass(const PClass *cls)
{
AActor *actor;
int removecount = 0;
bool player = false;
TThinkerIterator<AActor> iterator(cls);
while ((actor = iterator.Next()))
{
if (actor->IsA(cls))
{
// [MC]Do not remove LIVE players.
if (actor->player != NULL)
{
player = true;
continue;
}
removecount++;
actor->ClearCounters();
actor->Destroy();
}
}
if (player)
Printf("Cannot remove live players!\n");
return removecount;
}
// [RH] Execute a special "ticcmd". The type byte should
// have already been read, and the stream is positioned
@ -2555,6 +2582,27 @@ void Net_DoCommand (int type, BYTE **stream, int player)
}
break;
case DEM_REMOVE:
{
char *classname = ReadString(stream);
int removecount = 0;
const PClass *cls = PClass::FindClass(classname);
if (cls != NULL && cls->ActorInfo != NULL)
{
removecount = RemoveClass(cls);
const PClass *cls_rep = cls->GetReplacement();
if (cls != cls_rep)
{
removecount += RemoveClass(cls_rep);
}
Printf("Removed %d actors of type %s.\n", removecount, classname);
}
else
{
Printf("%s is not an actor class.\n", classname);
}
}
break;
case DEM_CONVREPLY:
case DEM_CONVCLOSE:
@ -2680,6 +2728,7 @@ void Net_SkipCommand (int type, BYTE **stream)
case DEM_SUMMONFRIEND:
case DEM_SUMMONFOE:
case DEM_SUMMONMBF:
case DEM_REMOVE:
case DEM_SPRAY:
case DEM_MORPHEX:
case DEM_KILLCLASSCHEAT:

View file

@ -164,6 +164,7 @@ enum EDemoCommand
DEM_RUNNAMEDSCRIPT, // 65 String: Script name, Byte: Arg count + Always flag; each arg is a 4-byte int
DEM_REVERTCAMERA, // 66
DEM_SETSLOTPNUM, // 67 Byte: player number, the rest is the same as DEM_SETSLOT
DEM_REMOVE, // 68
};
// The following are implemented by cht_DoCheat in m_cheat.cpp

View file

@ -1145,18 +1145,3 @@ private:
float mMaximum;
float mStep;
};
#ifndef NO_IMP
CCMD(am_restorecolors)
{
if (DMenu::CurrentMenu != NULL && DMenu::CurrentMenu->IsKindOf(RUNTIME_CLASS(DOptionMenu)))
{
DOptionMenu *m = (DOptionMenu*)DMenu::CurrentMenu;
const FOptionMenuDescriptor *desc = m->GetDescriptor();
// Find the color cvars by scanning the MapColors menu.
for (unsigned i = 0; i < desc->mItems.Size(); ++i)
{
desc->mItems[i]->SetValue(FOptionMenuItemColorPicker::CPF_RESET, 0);
}
}
}
#endif

View file

@ -3595,7 +3595,7 @@ int DoGetMasterTID (AActor *self)
else return 0;
}
static AActor *SingleActorFromTID (int tid, AActor *defactor)
AActor *SingleActorFromTID (int tid, AActor *defactor)
{
if (tid == 0)
{

View file

@ -1841,3 +1841,22 @@ CCMD (kill)
}
C_HideConsole ();
}
CCMD(remove)
{
if (argv.argc() == 2)
{
if (CheckCheatmode())
return;
Net_WriteByte(DEM_REMOVE);
Net_WriteString(argv[1]);
C_HideConsole();
}
else
{
Printf("Usage: remove <actor class name>\n");
return;
}
}

View file

@ -73,6 +73,7 @@
#include "p_setup.h"
#include "gstrings.h"
AActor *SingleActorFromTID (int tid, AActor *defactor);
static FRandom pr_camissile ("CustomActorfire");
static FRandom pr_camelee ("CustomMelee");
@ -1856,6 +1857,9 @@ enum SIX_Flags
SIXF_ORIGINATOR = 0x00800000,
SIXF_TRANSFERSPRITEFRAME = 0x01000000,
SIXF_TRANSFERROLL = 0x02000000,
SIXF_ISTARGET = 0x04000000,
SIXF_ISMASTER = 0x08000000,
SIXF_ISTRACER = 0x10000000,
};
static bool InitSpawnedItem(AActor *self, AActor *mo, int flags)
@ -2013,6 +2017,18 @@ static bool InitSpawnedItem(AActor *self, AActor *mo, int flags)
mo->roll = self->roll;
}
if (flags & SIXF_ISTARGET)
{
self->target = mo;
}
if (flags & SIXF_ISMASTER)
{
self->master = mo;
}
if (flags & SIXF_ISTRACER)
{
self->tracer = mo;
}
return true;
}
@ -3001,6 +3017,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Respawn)
fixed_t oldz = self->z;
self->flags |= MF_SOLID;
self->height = self->GetDefault()->height;
self->radius = self->GetDefault()->radius;
CALL_ACTION(A_RestoreSpecialPosition, self);
if (flags & RSF_TELEFRAG)

View file

@ -61,11 +61,11 @@ const char *GetVersionString();
// 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 0x21B
#define DEMOGAMEVERSION 0x21C
// Minimum demo version we can play.
// Bump it whenever you change or remove existing DEM_ commands.
#define MINDEMOVERSION 0x21B
#define MINDEMOVERSION 0x21C
// SAVEVER is the version of the information stored in level snapshots.
// Note that SAVEVER is not directly comparable to VERSION.
@ -76,7 +76,7 @@ const char *GetVersionString();
// Use 4500 as the base git save version, since it's higher than the
// SVN revision ever got.
#define SAVEVER 4523
#define SAVEVER 4524
#define SAVEVERSTRINGIFY2(x) #x
#define SAVEVERSTRINGIFY(x) SAVEVERSTRINGIFY2(x)

View file

@ -1959,9 +1959,9 @@ void WI_drawStats (void)
}
else
{
screen->DrawText (BigFont, CR_UNTRANSLATED, 50, 65, "KILLS", DTA_Clean, true, DTA_Shadow, true, TAG_DONE);
screen->DrawText (BigFont, CR_UNTRANSLATED, 50, 90, "ITEMS", DTA_Clean, true, DTA_Shadow, true, TAG_DONE);
screen->DrawText (BigFont, CR_UNTRANSLATED, 50, 115, "SECRETS", DTA_Clean, true, DTA_Shadow, true, TAG_DONE);
screen->DrawText (BigFont, CR_UNTRANSLATED, 50, 65, GStrings("TXT_IMKILLS"), DTA_Clean, true, DTA_Shadow, true, TAG_DONE);
screen->DrawText (BigFont, CR_UNTRANSLATED, 50, 90, GStrings("TXT_IMITEMS"), DTA_Clean, true, DTA_Shadow, true, TAG_DONE);
screen->DrawText (BigFont, CR_UNTRANSLATED, 50, 115, GStrings("TXT_IMSECRETS"), DTA_Clean, true, DTA_Shadow, true, TAG_DONE);
int countpos = gameinfo.gametype==GAME_Strife? 285:270;
if (sp_state >= 2)
@ -1978,7 +1978,7 @@ void WI_drawStats (void)
}
if (sp_state >= 8)
{
screen->DrawText (BigFont, CR_UNTRANSLATED, 85, 160, "TIME",
screen->DrawText (BigFont, CR_UNTRANSLATED, 85, 160, GStrings("TXT_IMTIME"),
DTA_Clean, true, DTA_Shadow, true, TAG_DONE);
WI_drawTime (249, 160, cnt_time);
if (wi_showtotaltime)

View file

@ -74,6 +74,9 @@ const int SXF_NOPOINTERS = 1 << 22;
const int SXF_ORIGINATOR = 1 << 23;
const int SXF_TRANSFERSPRITEFRAME = 1 << 24;
const int SXF_TRANSFERROLL = 1 << 25;
const int SXF_ISTARGET = 1 << 26;
const int SXF_ISMASTER = 1 << 27;
const int SXF_ISTRACER = 1 << 28;
// Flags for A_Chase
const int CHF_FASTCHASE = 1;

View file

@ -8,7 +8,7 @@
$rolloff * 200 1200
$playersound player male *death dspldeth
$playersound player male *xdeath dspdiehi
$playersound player male *xdeath dsplxdth
$playersound player male *gibbed dsslop
$playersound player male *pain100 dsplpain
$playersounddup player male *pain75 *pain100

View file

@ -1281,6 +1281,14 @@ TXT_LEADBOOTSOFF = "LEAD BOOTS OFF";
TXT_LIGHTER = "You feel lighter";
TXT_GRAVITY = "Gravity weighs you down";
// Raven intermission
TXT_IMKILLS = "KILLS";
TXT_IMITEMS = "ITEMS";
TXT_IMSECRETS = "SECRETS";
TXT_IMTIME = "TIME";
RAVENQUITMSG = "ARE YOU SURE YOU WANT TO QUIT?";
// Hexen strings