- Added a show_obituaries option to disable obituaries without disabling

other more important message types which have lower priority for some
  reason.
- Added a menu option for show_messages after accidentally switching it
  off far too often and wondering why no messages appear.
- Added crouching DoomPlayer sprites submitted by Enjay.
- Fixed DF_NO_CROUCH was not checked.
- Fixed: The intermission script parser had some of its cases in the
  keyword parser incorrectly sorted.
- Fixed: atterm was still defined to take a STACK_ARGS function argument.
- Added an AltFlash state for weapons.
- Turned FloatSpeed into an actor property and changed the value to 5
  for all floating Strife actors, as a comment in the source indicated.
(r114 below):
- Added GZDoom's code for Vavoom slope things because I wanted to test
  something with a map from Silent Steel.
- Added nocrouch and allowcrouch MAPINFO commands and a DF_NO_CROUCH
  dmflag.
- Added GZDoom's crouching code after cleaning it up so that adding
  crouching sprites will be easier.

SVN r115 (trunk)
This commit is contained in:
Christoph Oelckers 2006-05-15 15:28:46 +00:00
parent caed57baa5
commit afd6a1258f
62 changed files with 195 additions and 16 deletions

View file

@ -1,4 +1,14 @@
May 14, 2006 (Changes by Graf Zahl)
- Added a show_obituaries option to disable obituaries without disabling
other more important message types which have lower priority for some
reason.
- Added a menu option for show_messages after accidentally switching it
off far too often and wondering why no messages appear.
- Added crouching DoomPlayer sprites submitted by Enjay.
- Fixed DF_NO_CROUCH was not checked.
- Fixed: The intermission script parser had some of its cases in the
keyword parser incorrectly sorted.
- Fixed: atterm was still defined to take a STACK_ARGS function argument.
- Added an AltFlash state for weapons.
- Turned FloatSpeed into an actor property and changed the value to 5
for all floating Strife actors, as a comment in the source indicated.

View file

@ -87,6 +87,7 @@ public:
void Die (AActor *source, AActor *inflictor);
fixed_t JumpZ; // [GRB] Variable JumpZ
int crouchsprite;
};
class APlayerChunk : public APlayerPawn

View file

@ -6,6 +6,7 @@
#include "a_action.h"
#include "p_local.h"
#include "a_doomglobal.h"
#include "w_wad.h"
void A_Pain (AActor *);
void A_PlayerScream (AActor *);
@ -74,6 +75,9 @@ FState ADoomPlayer::States[] =
S_NORMAL (PLAY, 'W', 5, NULL , &States[S_HTIC_XDIE+8]),
S_NORMAL (PLAY, 'X', 5, NULL , &States[S_HTIC_XDIE+9]),
S_NORMAL (PLAY, 'Y', -1, NULL , NULL),
#define S_CROUCH (S_HTIC_XDIE+10) // only here so that the crouching sprite is entered into the sprite table.
S_NORMAL (PLYC, 'A', -1, NULL , NULL),
};
IMPLEMENT_ACTOR (ADoomPlayer, Doom, -1, 0)
@ -178,6 +182,31 @@ void A_PlayerScream (AActor *self)
S_SoundID (self, chan, sound, 1, ATTN_NORM);
}
AT_GAME_SET(DoomPlayer)
{
// Sets the crouching sprite.
// Exception: If the normal sprite is from a PWAD and the crouching sprite from ZDoom.pk3
// it is assumed that they don't match and the crouching sprite is disabled.
// This code is not executed when the player already has a crouch sprite (set by DECORATE.)
if (gameinfo.gametype == GAME_Doom && GetDefault<ADoomPlayer>()->crouchsprite == 0)
{
int spritenorm = Wads.CheckNumForName("PLAYA1", ns_sprites);
int spritecrouch = Wads.CheckNumForName("PLYCA1", ns_sprites);
if (spritenorm==-1 || spritecrouch ==-1) return;
int wadnorm = Wads.GetLumpFile(spritenorm);
int wadcrouch = Wads.GetLumpFile(spritenorm);
if (wadnorm > FWadCollection::IWAD_FILENUM && wadcrouch <= FWadCollection::IWAD_FILENUM)
{
// Question: Add an option / disable crouching or do what?
return;
}
}
GetDefault<ADoomPlayer>()->crouchsprite = ADoomPlayer::States[S_CROUCH].sprite.index;
}
//==========================================================================
//
// A_DoomSkinCheck1

View file

@ -87,6 +87,7 @@ CVAR (Float, mouse_sensitivity, 1.f, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
// Show messages has default, 0 = off, 1 = on
CVAR (Bool, show_messages, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CVAR (Bool, show_obituaries, true, CVAR_ARCHIVE)
extern int skullAnimCounter;
@ -762,6 +763,8 @@ static value_t MessageLevels[] = {
};
static menuitem_t MessagesItems[] = {
{ discrete, "Show messages", {&show_messages}, {2.0}, {0.0}, {0.0}, {OnOff} },
{ discrete, "Show obituaries", {&show_obituaries}, {2.0}, {0.0}, {0.0}, {OnOff} },
{ discrete, "Scale text in high res", {&con_scaletext}, {3.0}, {0.0}, {0.0}, {ScaleValues} },
{ discrete, "Minimum message level", {&msglevel}, {3.0}, {0.0}, {0.0}, {MessageLevels} },
{ discrete, "Center messages", {&con_centernotify}, {2.0}, {0.0}, {0.0}, {OnOff} },

View file

@ -67,6 +67,7 @@ static FRandom pr_switcher ("SwitchTarget");
CVAR (Bool, cl_showsprees, true, CVAR_ARCHIVE)
CVAR (Bool, cl_showmultikills, true, CVAR_ARCHIVE)
EXTERN_CVAR (Bool, show_obituaries)
//
// GET STUFF
@ -183,11 +184,8 @@ void ClientObituary (AActor *self, AActor *inflictor, AActor *attacker)
BOOL friendly;
int gender;
if (self->player == NULL)
return;
// No obituaries for voodoo dolls
if (self->player->mo != self)
// No obituaries for non-players, voodoo dolls or when not wanted
if (self->player == NULL || self->player->mo != self || !show_obituaries)
return;
gender = self->player->userinfo.gender;

View file

@ -158,20 +158,51 @@ void APlayerPawn::BeginPlay ()
void APlayerPawn::Tick()
{
int crouchspriteno;
// FIXME: Handle skins
if (sprite == SpawnState->sprite.index && crouchsprite > 0)
{
crouchspriteno = crouchsprite;
}
else
{
// no sprite -> squash the existing one
crouchspriteno = 0;
}
if (player != NULL && player->mo == this && player->morphTics == 0 && player->playerstate != PST_DEAD)
{
yscale = FixedMul(GetDefault()->yscale, player->crouchfactor);
height = FixedMul(GetDefault()->height, player->crouchfactor);
}
else
{
// Ensure that PlayerPawns not connected to a player or morphed players are always un-crouched.
yscale = GetDefault()->yscale;
if (health > 0) height = GetDefault()->height;
}
Super::Tick();
// Here's the place where crouching sprites should be handled
if (player->crouchfactor<FRACUNIT*3/4)
{
if (crouchsprite != 0)
{
sprite = crouchsprite;
yscale = GetDefault()->yscale;
}
else if (player->playerstate != PST_DEAD)
{
yscale = player->crouchfactor < FRACUNIT*3/4 ? GetDefault()->yscale/2 : GetDefault()->yscale;
}
}
else
{
if (sprite == crouchsprite)
{
sprite = SpawnState->sprite.index;
}
yscale = GetDefault()->yscale;
}
}
//===========================================================================
@ -1123,7 +1154,7 @@ void P_PlayerThink (player_t *player)
}
// Handle crouching
if (player->morphTics == 0)
if (player->morphTics == 0 && !(dmflags & DF_NO_CROUCH))
{
if (!(player->cheats & CF_TOTALLYFROZEN))
{

View file

@ -498,6 +498,7 @@ ACTOR(JumpIfInTargetInventory)
ACTOR(CountdownArg)
ACTOR(CustomMeleeAttack)
ACTOR(Light)
ACTOR(Burst)
#include "d_dehackedactions.h"
@ -686,6 +687,7 @@ AFuncDesc AFTable[]=
FUNC(A_TakeFromTarget, "Mx" )
FUNC(A_CountdownArg, "X")
FUNC(A_CustomMeleeAttack, "XXXsty" )
FUNC(A_Burst, "M")
};
//==========================================================================

View file

@ -78,6 +78,7 @@ static FRandom pr_grenade ("ThrowGrenade");
static FRandom pr_crailgun ("CustomRailgun");
static FRandom pr_spawndebris ("SpawnDebris");
static FRandom pr_jiggle ("Jiggle");
static FRandom pr_burst ("Burst");
// A truly awful hack to get to the state that called an action function
@ -1568,3 +1569,55 @@ void A_CountdownArg(AActor * self)
}
//============================================================================
//
// A_Burst
//
//============================================================================
void A_Burst (AActor *actor)
{
int i, numChunks;
AActor * mo;
int index=CheckIndex(1, NULL);
if (index<0) return;
const PClass * chunk = PClass::FindClass((ENamedName)StateParameters[index]);
if (chunk == NULL) return;
actor->momx = actor->momy = actor->momz = 0;
actor->height = actor->GetDefault()->height;
// [RH] In Hexen, this creates a random number of shards (range [24,56])
// with no relation to the size of the actor shattering. I think it should
// base the number of shards on the size of the dead thing, so bigger
// things break up into more shards than smaller things.
// An actor with radius 20 and height 64 creates ~40 chunks.
numChunks = MAX<int> (4, (actor->radius>>FRACBITS)*(actor->height>>FRACBITS)/32);
i = (pr_burst.Random2()) % (numChunks/4);
for (i = MAX (24, numChunks + i); i >= 0; i--)
{
mo = Spawn(chunk,
actor->x + (((pr_burst()-128)*actor->radius)>>7),
actor->y + (((pr_burst()-128)*actor->radius)>>7),
actor->z + (pr_burst()*actor->height/255));
if (mo)
{
mo->momz = FixedDiv(mo->z-actor->z, actor->height)<<2;
mo->momx = pr_burst.Random2 () << (FRACBITS-7);
mo->momy = pr_burst.Random2 () << (FRACBITS-7);
mo->RenderStyle = actor->RenderStyle;
mo->alpha = actor->alpha;
}
}
// [RH] Do some stuff to make this more useful outside Hexen
if (actor->flags4 & MF4_BOSSDEATH)
{
A_BossDeath (actor);
}
A_NoBlocking (actor);
actor->Destroy ();
}

View file

@ -479,6 +479,10 @@ void WI_LoadBackground(bool isenterpic)
an.levelname2[8]=0;
goto readanimation;
case 14: // NoAutostartMap
noautostartmap=true;
break;
readanimation:
SC_MustGetString();
strncpy(an.levelname,sc_String,8);
@ -486,10 +490,6 @@ void WI_LoadBackground(bool isenterpic)
SC_MustGetString();
caseval=SC_MustMatchString(WI_Cmd);
case 14: // NoAutostartMap
noautostartmap=true;
break;
default:
switch (caseval)
{

View file

@ -103,7 +103,7 @@ extern HCURSOR TheArrowCursor, TheInvisibleCursor;
void (*TermFuncs[MAX_TERMS])(void);
static int NumTerms;
void atterm (void (STACK_ARGS *func)(void))
void atterm (void (*func)(void))
{
// Make sure this function wasn't already registered.
for (int i = 0; i < NumTerms; ++i)
@ -148,7 +148,7 @@ static void UnCOM (void)
CoUninitialize ();
}
static void STACK_ARGS UnWTS (void)
static void UnWTS (void)
{
if (hwtsapi32 != 0)
{

BIN
wadsrc/crouch/plyca1.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plyca2a8.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plyca3a7.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plyca4a6.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plyca5.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycb1.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycb2b8.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycb3b7.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycb4b6.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycb5.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycc1.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycc2c8.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycc3c7.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycc4c6.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycc5.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycd1.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycd2d8.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycd3d7.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycd4d6.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycd5.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plyce1.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plyce2e8.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plyce3e7.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plyce4e6.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plyce5.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycf1.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycf2f8.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycf3f7.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycf4f6.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycf5.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycg1.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycg2g8.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycg3g7.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycg4g6.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycg5.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plych0.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plyci0.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycj0.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plyck0.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycl0.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycm0.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycn0.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plyco0.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycp0.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycq0.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycr0.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycs0.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plyct0.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycu0.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycv0.lmp Normal file

Binary file not shown.

BIN
wadsrc/crouch/plycw0.lmp Normal file

Binary file not shown.

View file

@ -134,7 +134,59 @@ sprites/iceca0.png iceca0.png
sprites/icecb0.png icecb0.png
sprites/icecc0.png icecc0.png
sprites/icecd0.png icecd0.png
S_END
# crouching DoomPlayer
sprites/plyca1.lmp crouch/plyca1.lmp
sprites/plyca2a8.lmp crouch/plyca2a8.lmp
sprites/plyca3a7.lmp crouch/plyca3a7.lmp
sprites/plyca4a6.lmp crouch/plyca4a6.lmp
sprites/plyca5.lmp crouch/plyca5.lmp
sprites/plycb1.lmp crouch/plycb1.lmp
sprites/plycb2b8.lmp crouch/plycb2b8.lmp
sprites/plycb3b7.lmp crouch/plycb3b7.lmp
sprites/plycb4b6.lmp crouch/plycb4b6.lmp
sprites/plycb5.lmp crouch/plycb5.lmp
sprites/plycc1.lmp crouch/plycc1.lmp
sprites/plycc2c8.lmp crouch/plycc2c8.lmp
sprites/plycc3c7.lmp crouch/plycc3c7.lmp
sprites/plycc4c6.lmp crouch/plycc4c6.lmp
sprites/plycc5.lmp crouch/plycc5.lmp
sprites/plycd1.lmp crouch/plycd1.lmp
sprites/plycd2d8.lmp crouch/plycd2d8.lmp
sprites/plycd3d7.lmp crouch/plycd3d7.lmp
sprites/plycd4d6.lmp crouch/plycd4d6.lmp
sprites/plycd5.lmp crouch/plycd5.lmp
sprites/plyce1.lmp crouch/plyce1.lmp
sprites/plyce2e8.lmp crouch/plyce2e8.lmp
sprites/plyce3e7.lmp crouch/plyce3e7.lmp
sprites/plyce4e6.lmp crouch/plyce4e6.lmp
sprites/plyce5.lmp crouch/plyce5.lmp
sprites/plycf1.lmp crouch/plycf1.lmp
sprites/plycf2f8.lmp crouch/plycf2f8.lmp
sprites/plycf3f7.lmp crouch/plycf3f7.lmp
sprites/plycf4f6.lmp crouch/plycf4f6.lmp
sprites/plycf5.lmp crouch/plycf5.lmp
sprites/plycg1.lmp crouch/plycg1.lmp
sprites/plycg2g8.lmp crouch/plycg2g8.lmp
sprites/plycg3g7.lmp crouch/plycg3g7.lmp
sprites/plycg4g6.lmp crouch/plycg4g6.lmp
sprites/plycg5.lmp crouch/plycg5.lmp
sprites/plych0.lmp crouch/plych0.lmp
sprites/plyci0.lmp crouch/plyci0.lmp
sprites/plycj0.lmp crouch/plycj0.lmp
sprites/plyck0.lmp crouch/plyck0.lmp
sprites/plycl0.lmp crouch/plycl0.lmp
sprites/plycm0.lmp crouch/plycm0.lmp
sprites/plycn0.lmp crouch/plycn0.lmp
sprites/plyco0.lmp crouch/plyco0.lmp
sprites/plycp0.lmp crouch/plycp0.lmp
sprites/plycq0.lmp crouch/plycq0.lmp
sprites/plycr0.lmp crouch/plycr0.lmp
sprites/plycs0.lmp crouch/plycs0.lmp
sprites/plyct0.lmp crouch/plyct0.lmp
sprites/plycu0.lmp crouch/plycu0.lmp
sprites/plycv0.lmp crouch/plycv0.lmp
sprites/plycw0.lmp crouch/plycw0.lmp
# The patch substituted when a corrupt patch is detected
graphics/-badpatc.lmp badpatch.lmp