gzdoom-last-svn/src/p_interaction.cpp

1564 lines
40 KiB
C++
Raw Normal View History

// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// $Id:$
//
// Copyright (C) 1993-1996 by id Software, Inc.
//
// This source is available for distribution and/or modification
// only under the terms of the DOOM Source Code License as
// published by id Software. All rights reserved.
//
// The source is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
// for more details.
//
// $Log:$
//
// DESCRIPTION:
// Handling interactions (i.e., collisions).
//
//-----------------------------------------------------------------------------
// Data.
#include "doomdef.h"
#include "gstrings.h"
#include "doomstat.h"
#include "m_random.h"
#include "i_system.h"
#include "announcer.h"
#include "am_map.h"
#include "c_console.h"
#include "c_dispatch.h"
#include "p_local.h"
#include "p_lnspec.h"
#include "p_effect.h"
#include "p_acs.h"
#include "b_bot.h" //Added by MC:
#include "ravenshared.h"
#include "a_hexenglobal.h"
#include "a_sharedglobal.h"
#include "a_pickups.h"
#include "gi.h"
#include "templates.h"
#include "sbar.h"
#include "s_sound.h"
#include "g_level.h"
#include "d_net.h"
#include "d_netinf.h"
static FRandom pr_obituary ("Obituary");
static FRandom pr_botrespawn ("BotRespawn");
static FRandom pr_killmobj ("ActorDie");
static FRandom pr_damagemobj ("ActorTakeDamage");
static FRandom pr_lightning ("LightningDamage");
static FRandom pr_poison ("PoisonDamage");
static FRandom pr_switcher ("SwitchTarget");
CVAR (Bool, cl_showsprees, true, CVAR_ARCHIVE)
CVAR (Bool, cl_showmultikills, true, CVAR_ARCHIVE)
EXTERN_CVAR (Bool, show_obituaries)
FName MeansOfDeath;
bool FriendlyFire;
//
// GET STUFF
//
//
// P_TouchSpecialThing
//
void P_TouchSpecialThing (AActor *special, AActor *toucher)
{
fixed_t delta = special->z - toucher->z;
if (delta > toucher->height || delta < -32*FRACUNIT)
{ // out of reach
return;
}
// Dead thing touching.
// Can happen with a sliding player corpse.
if (toucher->health <= 0)
return;
//Added by MC: Finished with this destination.
if (toucher->player != NULL && toucher->player->isbot && special == toucher->player->dest)
{
toucher->player->prev = toucher->player->dest;
toucher->player->dest = NULL;
}
special->Touch (toucher);
}
// [RH]
// SexMessage: Replace parts of strings with gender-specific pronouns
//
// The following expansions are performed:
// %g -> he/she/it
// %h -> him/her/it
// %p -> his/her/its
// %o -> other (victim)
// %k -> killer
//
void SexMessage (const char *from, char *to, int gender, const char *victim, const char *killer)
{
static const char *genderstuff[3][3] =
{
{ "he", "him", "his" },
{ "she", "her", "her" },
{ "it", "it", "its" }
};
static const int gendershift[3][3] =
{
{ 2, 3, 3 },
{ 3, 3, 3 },
{ 2, 2, 3 }
};
const char *subst = NULL;
do
{
if (*from != '%')
{
*to++ = *from;
}
else
{
int gendermsg = -1;
switch (from[1])
{
case 'g': gendermsg = 0; break;
case 'h': gendermsg = 1; break;
case 'p': gendermsg = 2; break;
case 'o': subst = victim; break;
case 'k': subst = killer; break;
}
if (subst != NULL)
{
size_t len = strlen (subst);
memcpy (to, subst, len);
to += len;
from++;
subst = NULL;
}
else if (gendermsg < 0)
{
*to++ = '%';
}
else
{
strcpy (to, genderstuff[gender][gendermsg]);
to += gendershift[gender][gendermsg];
from++;
}
}
} while (*from++);
}
// [RH]
// ClientObituary: Show a message when a player dies
//
void ClientObituary (AActor *self, AActor *inflictor, AActor *attacker)
{
FName mod;
const char *message;
const char *messagename;
char gendermessage[1024];
bool friendly;
int gender;
// 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;
// Treat voodoo dolls as unknown deaths
if (inflictor && inflictor->player == self->player)
MeansOfDeath = NAME_None;
if (multiplayer && !deathmatch)
FriendlyFire = true;
friendly = FriendlyFire;
mod = MeansOfDeath;
message = NULL;
messagename = NULL;
if (attacker == NULL || attacker->player != NULL)
{
if (mod == NAME_Telefrag)
{
if (AnnounceTelefrag (attacker, self))
return;
}
else
{
if (AnnounceKill (attacker, self))
return;
}
}
switch (mod)
{
case NAME_Suicide: messagename = "OB_SUICIDE"; break;
case NAME_Falling: messagename = "OB_FALLING"; break;
case NAME_Crush: messagename = "OB_CRUSH"; break;
case NAME_Exit: messagename = "OB_EXIT"; break;
case NAME_Drowning: messagename = "OB_WATER"; break;
case NAME_Slime: messagename = "OB_SLIME"; break;
case NAME_Fire: if (attacker == NULL) messagename = "OB_LAVA"; break;
}
if (messagename != NULL)
message = GStrings(messagename);
if (attacker != NULL && message == NULL)
{
if (attacker == self)
{
message = GStrings("OB_KILLEDSELF");
}
else if (attacker->player == NULL)
{
if (mod == NAME_Telefrag)
{
message = GStrings("OB_MONTELEFRAG");
}
else if (mod == NAME_Melee)
{
message = attacker->GetClass()->Meta.GetMetaString (AMETA_HitObituary);
if (message == NULL)
{
message = attacker->GetClass()->Meta.GetMetaString (AMETA_Obituary);
}
}
else
{
message = attacker->GetClass()->Meta.GetMetaString (AMETA_Obituary);
}
}
}
if (message == NULL && attacker != NULL && attacker->player != NULL)
{
if (friendly)
{
attacker->player->fragcount -= 2;
attacker->player->frags[attacker->player - players]++;
self = attacker;
gender = self->player->userinfo.gender;
Update to ZDoom r1083. Not fully tested yet! - Converted most sprintf (and all wsprintf) calls to either mysnprintf or FStrings, depending on the situation. - Changed the strings in the wbstartstruct to be FStrings. - Changed myvsnprintf() to output nothing if count is greater than INT_MAX. This is so that I can use a series of mysnprintf() calls and advance the pointer for each one. Once the pointer goes beyond the end of the buffer, the count will go negative, but since it's an unsigned type it will be seen as excessively huge instead. This should not be a problem, as there's no reason for ZDoom to be using text buffers larger than 2 GB anywhere. - Ripped out the disabled bit from FGameConfigFile::MigrateOldConfig(). - Changed CalcMapName() to return an FString instead of a pointer to a static buffer. - Changed startmap in d_main.cpp into an FString. - Changed CheckWarpTransMap() to take an FString& as the first argument. - Changed d_mapname in g_level.cpp into an FString. - Changed DoSubstitution() in ct_chat.cpp to place the substitutions in an FString. - Fixed: The MAPINFO parser wrote into the string buffer to construct a map name when given a Hexen map number. This was fine with the old scanner code, but only a happy coincidence prevents it from crashing with the new code. - Added the 'B' conversion specifier to StringFormat::VWorker() for printing binary numbers. - Added CMake support for building with MinGW, MSYS, and NMake. Linux support is probably broken until I get around to booting into Linux again. Niceties provided over the existing Makefiles they're replacing: * All command-line builds can use the same build system, rather than having a separate one for MinGW and another for Linux. * Microsoft's NMake tool is supported as a target. * Progress meters. * Parallel makes work from a fresh checkout without needing to be primed first with a single-threaded make. * Porting to other architectures should be simplified, whenever that day comes. - Replaced the makewad tool with zipdir. This handles the dependency tracking itself instead of generating an external makefile to do it, since I couldn't figure out how to generate a makefile with an external tool and include it with a CMake-generated makefile. Where makewad used a master list of files to generate the package file, zipdir just zips the entire contents of one or more directories. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@138 b0f79afe-0144-0410-b225-9a4edf0717df
2008-07-23 18:35:55 +00:00
mysnprintf (gendermessage, countof(gendermessage), "OB_FRIENDLY%c", '1' + (pr_obituary() & 3));
message = GStrings(gendermessage);
}
else
{
if (mod == NAME_Telefrag) message = GStrings("OB_MPTELEFRAG");
if (message == NULL)
{
if (inflictor != NULL)
{
message = inflictor->GetClass()->Meta.GetMetaString (AMETA_Obituary);
}
if (message == NULL && attacker->player->ReadyWeapon != NULL)
{
message = attacker->player->ReadyWeapon->GetClass()->Meta.GetMetaString (AMETA_Obituary);
}
if (message == NULL)
{
switch (mod)
{
case NAME_BFGSplash: messagename = "OB_MPBFG_SPLASH"; break;
case NAME_Railgun: messagename = "OB_RAILGUN"; break;
}
if (messagename != NULL)
message = GStrings(messagename);
}
}
}
}
else attacker = self; // for the message creation
if (message != NULL && message[0] == '$')
{
message=GStrings[message+1];
}
if (message == NULL)
{
message = GStrings("OB_DEFAULT");
}
SexMessage (message, gendermessage, gender,
self->player->userinfo.netname, attacker->player->userinfo.netname);
Printf (PRINT_MEDIUM, "%s\n", gendermessage);
}
//
// KillMobj
//
EXTERN_CVAR (Int, fraglimit)
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
static int GibHealth(AActor *actor)
{
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
return -abs(
actor->GetClass()->Meta.GetMetaInt (
AMETA_GibHealth,
- Fixed: player.damagescreencolor was not implemented for the GL renderer. Update to ZDoom r1190: - Gave the PlayerPawn base class a default damage fade color instead of hacking it into the actor when actually used. - Fixed: The DamageFade color was not saved in savegames. - Added Blzut3's patch for a real Chex Quest game mode. - Fixed: SKIP_SUPER doesn't work for inventory items so it must be disabled for them - Fixed: Chex Quest doesn't have a HELP2 screen so it must not be used in the gameinfo. - Fixed: Default blood color is no longer red so P_DrawSplash2 must get it from the gameinfo instead. - Added new French language texts by DoomKn1ght_. - Blood default color is set in the gameinfo now so that Chex Quest can default to green instead of red. - Fixed: The version of CheckNumForFullName that checks for a specific WAD did not work. - Moved MAPINFO names into gameinfo structure. - Added Chex Quest support. Credits go to fraggle for creating a Dehacked patch that does most of the work. The rest includes a new MAPINFO and removal of the drop items from the monsters being used. - Added Win64 support to the crash report generator. (Pity that Win32 cannot be as informative.) - Added and fixed Boss death submission for random spawner. - Added functions to FActorInfo that can set the damage factors and pain chances to reduce the chance of new errors when working with these features. - Fixed: The handling of the deprecated FIRERESIST flag didn't work. There were 3 problems: * Actor defaults have no class information so HandleDeprecatedFlags needs to be passed a pointer to the ActorInfo. * The DamageFactors list is only created when needed so the code needs to check if it already exists. * damage factors are stored as fixed_t but this set a float. - Fixed: Timidity::Renderer::reset_voices() must completely zero the voices. Because this wasn't done, note_on() could try to access the sample for a voice that had never been played yet and access random memory. There may be other places where it's a problem, but this is where I noticed it, by chance. - Added a traditional Strife color set for the automap. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@166 b0f79afe-0144-0410-b225-9a4edf0717df
2008-09-01 19:08:19 +00:00
gameinfo.gametype & GAME_DoomChex ?
-actor->SpawnHealth() :
-actor->SpawnHealth()/2));
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
}
void AActor::Die (AActor *source, AActor *inflictor)
{
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
// Handle possible unmorph on death
bool wasgibbed = (health < GibHealth(this));
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
AActor *realthis = NULL;
int realstyle = 0;
int realhealth = 0;
if (P_MorphedDeath(this, &realthis, &realstyle, &realhealth))
{
if (!(realstyle & MORPH_UNDOBYDEATHSAVES))
{
if (wasgibbed)
{
int realgibhealth = GibHealth(realthis);
if (realthis->health >= realgibhealth)
{
realthis->health = realgibhealth -1; // if morphed was gibbed, so must original be (where allowed)
}
}
realthis->Die(source, inflictor);
}
return;
}
// [SO] 9/2/02 -- It's rather funny to see an exploded player body with the invuln sparkle active :)
effects &= ~FX_RESPAWNINVUL;
//flags &= ~MF_INVINCIBLE;
if (debugfile && this->player)
{
static int dieticks[MAXPLAYERS];
int pnum = int(this->player-players);
if (dieticks[pnum] == gametic)
gametic=gametic;
dieticks[pnum] = gametic;
fprintf (debugfile, "died (%d) on tic %d (%s)\n", pnum, gametic,
this->player->cheats&CF_PREDICTING?"predicting":"real");
}
// [RH] Notify this actor's items.
for (AInventory *item = Inventory; item != NULL; )
{
AInventory *next = item->Inventory;
item->OwnerDied();
item = next;
}
if (flags & MF_MISSILE)
{ // [RH] When missiles die, they just explode
P_ExplodeMissile (this, NULL, NULL);
return;
}
// [RH] Set the target to the thing that killed it. Strife apparently does this.
if (source != NULL)
{
target = source;
}
flags &= ~(MF_SHOOTABLE|MF_FLOAT|MF_SKULLFLY);
if (!(flags4 & MF4_DONTFALL)) flags&=~MF_NOGRAVITY;
flags |= MF_DROPOFF;
Update to ZDoom r1052: - Fixed: Dead players didn't get the MF_CORPSE flag set. - Fixed: The internal definition of Floor_LowerToNearest had incorrect parameter settings. - Fixed: Heretic's ActivatedTimeBomb had the same spawn ID as the inventory item. - fixed: Heretic's mace did not have its spawn ID set. - For controls that are not bound, the customize controls menu now displays a black --- instead of ???. - Applied Gez's BossBrainPatch3. - Fixed: P_BulletSlope() did not return the linetarget. This effected the Sigil, A_JumpIfCloser, and A_JumpIfTargetInLOS. - Fixed all the new warnings tossed out by GCC 4.3. - Fixed: PickNext/PrevWeapon() did not check for NULL player actors. - Fixed compilation issues with GCC. - Removed special case for nobotnodes in MAPINFO. - Added support for ST's QUARTERGRAVITY flag. - Added a generalized version of Skulltag's A_CheckRailReload function. - Fixed: DrawImage didn't take 0 as a valid image index. - Added Gez's RandomSpawner submission with significant changes. - Added optional blocks for MAPINFO map definitions. ZDoom doesn't use this feature itself but it allows other ports based on ZDoom to implement their own sets of options without making such a MAPINFO unreadable by ZDoom. - Fixed: The mugshot would not reset on re-spawn. - Fixed: Picking up a weapon would sometimes not activate the grin. - Changed: Line_SetIdentification will ignore extended parameters when used in maps defined Hexen style in MAPINFO. - Fixed: Ambient sounds didn't pass their point of origin to S_StartSound. - Fixed: UseType was not properly set for textures defined in TEXTURES. - Fixed: You couldn't set an offset for sprites defined in TEXTURES. - Added read barriers to all actor pointers within player_t except for mo, ReadyWeapon and PendingWeapon. - Added a read barrier to player_t::PrewmorphWeapon. - Fixed: After spawning a deathmatch player P_PlayerStartStomp must be called. - Fixed: SpawnThings must check if the players were spawned before calling P_PlayerStartStomp. - Fixed typo in flat scroll interpolation. - Changed FImageCollection to return translated texture indices so that animated icons can be done with it. - Changed FImageCollection to use a TArray to hold its data. - Fixed: SetChanHeadSettings did an assignment instead of comparing the channel ID witg CHAN_CEILING. - Changed sound sequence names for animated doors to FNames. - Automatically fixed: DCeiling didn't properly serialize its texture id. - Replaced integers as texture ID representation with a specific new type to track down all potentially incorrect uses and remaining WORDs used for texture IDs so that more than 32767 or 65535 textures can be defined. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@124 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-28 13:29:59 +00:00
if ((flags3 & MF3_ISMONSTER) || FindState(NAME_Raise) != NULL || IsKindOf(RUNTIME_CLASS(APlayerPawn)))
{ // [RH] Only monsters get to be corpses.
// Objects with a raise state should get the flag as well so they can
// be revived by an Arch-Vile. Batman Doom needs this.
flags |= MF_CORPSE;
}
// [RH] Allow the death height to be overridden using metadata.
fixed_t metaheight = 0;
if (DamageType == NAME_Fire)
{
metaheight = GetClass()->Meta.GetMetaFixed (AMETA_BurnHeight);
}
if (metaheight == 0)
{
metaheight = GetClass()->Meta.GetMetaFixed (AMETA_DeathHeight);
}
if (metaheight != 0)
{
height = MAX<fixed_t> (metaheight, 0);
}
else
{
height >>= 2;
}
// [RH] If the thing has a special, execute and remove it
// Note that the thing that killed it is considered
// the activator of the script.
// New: In Hexen, the thing that died is the activator,
// so now a level flag selects who the activator gets to be.
// Everything is now moved to P_ActivateThingSpecial().
if (special && (!(flags & MF_SPECIAL) || (flags3 & MF3_ISMONSTER))
&& !(activationtype & THINGSPEC_NoDeathSpecial))
{
P_ActivateThingSpecial(this, source, true);
}
if (CountsAsKill())
level.killed_monsters++;
if (source && source->player)
{
if (CountsAsKill())
{ // count for intermission
source->player->killcount++;
}
// Don't count any frags at level start, because they're just telefrags
// resulting from insufficient deathmatch starts, and it wouldn't be
// fair to count them toward a player's score.
if (player && level.maptime)
{
source->player->frags[player - players]++;
if (player == source->player) // [RH] Cumulative frag count
{
char buff[256];
player->fragcount--;
if (deathmatch && player->spreecount >= 5 && cl_showsprees)
{
SexMessage (GStrings("SPREEKILLSELF"), buff,
player->userinfo.gender, player->userinfo.netname,
player->userinfo.netname);
StatusBar->AttachMessage (new DHUDMessageFadeOut (SmallFont, buff,
1.5f, 0.2f, 0, 0, CR_WHITE, 3.f, 0.5f), MAKE_ID('K','S','P','R'));
}
}
else
{
if ((dmflags2 & DF2_YES_LOSEFRAG) && deathmatch)
player->fragcount--;
++source->player->fragcount;
++source->player->spreecount;
if (source->player->morphTics)
{ // Make a super chicken
source->GiveInventoryType (RUNTIME_CLASS(APowerWeaponLevel2));
}
if (deathmatch && cl_showsprees)
{
const char *spreemsg;
char buff[256];
switch (source->player->spreecount)
{
case 5:
spreemsg = GStrings("SPREE5");
break;
case 10:
spreemsg = GStrings("SPREE10");
break;
case 15:
spreemsg = GStrings("SPREE15");
break;
case 20:
spreemsg = GStrings("SPREE20");
break;
case 25:
spreemsg = GStrings("SPREE25");
break;
default:
spreemsg = NULL;
break;
}
if (spreemsg == NULL && player->spreecount >= 5)
{
if (!AnnounceSpreeLoss (this))
{
SexMessage (GStrings("SPREEOVER"), buff, player->userinfo.gender,
player->userinfo.netname, source->player->userinfo.netname);
StatusBar->AttachMessage (new DHUDMessageFadeOut (SmallFont, buff,
1.5f, 0.2f, 0, 0, CR_WHITE, 3.f, 0.5f), MAKE_ID('K','S','P','R'));
}
}
else if (spreemsg != NULL)
{
if (!AnnounceSpree (source))
{
SexMessage (spreemsg, buff, player->userinfo.gender,
player->userinfo.netname, source->player->userinfo.netname);
StatusBar->AttachMessage (new DHUDMessageFadeOut (SmallFont, buff,
1.5f, 0.2f, 0, 0, CR_WHITE, 3.f, 0.5f), MAKE_ID('K','S','P','R'));
}
}
}
}
// [RH] Multikills
source->player->multicount++;
if (source->player->lastkilltime > 0)
{
if (source->player->lastkilltime < level.time - 3*TICRATE)
{
source->player->multicount = 1;
}
if (deathmatch &&
source->CheckLocalView (consoleplayer) &&
cl_showmultikills)
{
const char *multimsg;
switch (source->player->multicount)
{
case 1:
multimsg = NULL;
break;
case 2:
multimsg = GStrings("MULTI2");
break;
case 3:
multimsg = GStrings("MULTI3");
break;
case 4:
multimsg = GStrings("MULTI4");
break;
default:
multimsg = GStrings("MULTI5");
break;
}
if (multimsg != NULL)
{
char buff[256];
if (!AnnounceMultikill (source))
{
SexMessage (multimsg, buff, player->userinfo.gender,
player->userinfo.netname, source->player->userinfo.netname);
StatusBar->AttachMessage (new DHUDMessageFadeOut (SmallFont, buff,
1.5f, 0.8f, 0, 0, CR_RED, 3.f, 0.5f), MAKE_ID('M','K','I','L'));
}
}
}
}
source->player->lastkilltime = level.time;
// [RH] Implement fraglimit
if (deathmatch && fraglimit &&
fraglimit <= D_GetFragCount (source->player))
{
Printf ("%s\n", GStrings("TXT_FRAGLIMIT"));
G_ExitLevel (0, false);
}
}
}
else if (!multiplayer && CountsAsKill())
{
// count all monster deaths,
// even those caused by other monsters
players[0].killcount++;
}
if (player)
{
// [RH] Death messages
ClientObituary (this, inflictor, source);
// Death script execution, care of Skull Tag
FBehavior::StaticStartTypedScripts (SCRIPT_Death, this, true);
// [RH] Force a delay between death and respawn
player->respawn_time = level.time + TICRATE;
//Added by MC: Respawn bots
if (bglobal.botnum && consoleplayer == Net_Arbitrator && !demoplayback)
{
if (player->isbot)
player->t_respawn = (pr_botrespawn()%15)+((bglobal.botnum-1)*2)+TICRATE+1;
//Added by MC: Discard enemies.
for (int i = 0; i < MAXPLAYERS; i++)
{
if (players[i].isbot && this == players[i].enemy)
{
if (players[i].dest == players[i].enemy)
players[i].dest = NULL;
players[i].enemy = NULL;
}
}
player->spreecount = 0;
player->multicount = 0;
}
// count environment kills against you
if (!source)
{
player->frags[player - players]++;
player->fragcount--; // [RH] Cumulative frag count
}
flags &= ~MF_SOLID;
player->playerstate = PST_DEAD;
P_DropWeapon (player);
if (this == players[consoleplayer].camera && automapactive)
{
// don't die in auto map, switch view prior to dying
AM_Stop ();
}
// [GRB] Clear extralight. When you killed yourself with weapon that
// called A_Light1/2 before it called A_Light0, extraligh remained.
player->extralight = 0;
}
// [RH] If this is the unmorphed version of another monster, destroy this
// actor, because the morphed version is the one that will stick around in
// the level.
if (flags & MF_UNMORPHED)
{
Destroy ();
return;
}
FState *diestate = NULL;
if (DamageType != NAME_None)
{
diestate = FindState (NAME_Death, DamageType, true);
if (diestate == NULL)
{
if (DamageType == NAME_Ice)
{ // If an actor doesn't have an ice death, we can still give them a generic one.
if (!deh.NoAutofreeze && !(flags4 & MF4_NOICEDEATH) && (player || (flags3 & MF3_ISMONSTER)))
{
Update to ZDoom r1146 (warning: massive changes ahead!) - Removed DECORATE's ParseClass because it was only used to add data to fully internal actor classes which no longer exist. - Changed the state structure so that the Tics value doesn't need to be hacked into misc1 with SF_BIGTIC anymore. - Changed sprite processing so that sprite names are converted to indices during parsing so that an additional postprocessing step is no longer needed. - Fixed: Sprite names in DECORATE were case sensitive. - Exported AActor's defaults to DECORATE and removed all code for the internal property parser which is no longer needed. - Converted the Heresiarch to DECORATE. - Added an Active and Inactive state for monsters. - Made the speed a parameter to A_RaiseMobj and A_SinkMobj and deleted GetRaiseSpeed and GetSinkSpeed. - Added some remaining DECORATE conversions for Hexen by Karate Chris. - Changed Windows to use the performance counter instead of rdtsc. - Changed Linux to use clock_gettime for profiling instead of rdtsc. This avoids potential erroneous results on multicore and variable speed processors. - Converted the last of Hexen's inventory items to DECORATE so that I could export AInventory. - Removed AT_GAME_SET because it's no longer used anywhere. - Converted the last remaining global classes to DECORATE. - Fixed: Inventory.PickupFlash requires an class name as parameter not an integer. Some Hexen definitions got it wrong. - Converted Hexen's Pig to DECORATE. - Replaced the ActorInfo definitions of all internal inventory classes with DECORATE definitions. - Added option to specify a powerup's duration in second by using a negative number. - Added Gez's Freedoom detection patch. - SBARINFO update: * Added: The ability to have drawkeybar auto detect spacing. * Added: Offset parameter to drawkeybar to allow two key bars with different keys. * Added: Multi-row/column keybar parameters. Spacing can also be auto. These defualt to left to right/top to bottom but can be switched. * Added: Drawshadow flag to drawnumber. This will draw a solid color and translucent number under the normal number. * Added: hexenarmor to drawimage. This takes a parameter for a hexen armor type and will fade the image like the hexen status bar. * Added: centerbottom offset to draw(switchable)image. * Added: translucent flag to drawinventorybar. * Fixed: Accidentally removed flag from DrawTexture that allowed negative coordinates to work with fullscreenoffsets. Hopefully this is the last major bug in the fullscreenoffsets system. - Ported vlinetallasm4 to AMD64 assembly. Even with the increased number of registers AMD64 provides, this routine still needs to be written as self- modifying code for maximum performance. The additional registers do allow for further optimization over the x86 version by allowing all four pixels to be in flight at the same time. The end result is that AMD64 ASM is about 2.18 times faster than AMD64 C and about 1.06 times faster than x86 ASM. (For further comparison, AMD64 C and x86 C are practically the same for this function.) Should I port any more assembly to AMD64, mvlineasm4 is the most likely candidate, but it's not used enough at this point to bother. Also, this may or may not work with Linux at the moment, since it doesn't have the eh_handler metadata. Win64 is easier, since I just need to structure the function prologue and epilogue properly and use some assembler directives/macros to automatically generate the metadata. And that brings up another point: You need YASM to assemble the AMD64 code, because NASM doesn't support the Win64 metadata directives. - Replaced the ActorInfo definitions of several internal classes with DECORATE definitions - Converted teleport fog and destinations to DECORATE. - AActor::PreExplode is gone now that the last item that was using it has been converted. - Converted the Sigil and the remaining things in a_strifeitems.cpp to DECORATE. - Exported Point pushers, CustomSprite and AmbientSound to DECORATE. - Changed increased lightning damage for Centaurs into a damage factor. - Changed PoisonCloud and Lightning special treatment in P_DamageMobj to use damage types instead to keep dependencies on specific actor types out of the main engine code. - Added Korax DECORATE conversion by Gez and a few others by Karate Chris. - Removed FourthWeaponClass and based Hexen's fourth weapons on the generic weapon pieces. - Added DECORATE conversions for Hexen's Fighter weapons by Karate Chris. - Added aWeaponGiver class to generalize the standing AssaultGun. - converted a_Strifeweapons.cpp to DECORATE, except for the Sigil. - Added an SSE version of DoBlending. This is strictly C intrinsics. VC++ still throws around unneccessary register moves. GCC seems to be pretty close to optimal, requiring only about 2 cycles/color. They're both faster than my hand-written MMX routine, so I don't need to feel bad about not hand-optimizing this for x64 builds. - Removed an extra instruction from DoBlending_MMX, transposed two instructions, and unrolled it once, shaving off about 80 cycles from the time required to blend 256 palette entries. Why? Because I tried writing a C version of the routine using compiler intrinsics and was appalled by all the extra movq's VC++ added to the code. GCC was better, but still generated extra instructions. I only wanted a C version because I can't use inline assembly with VC++'s x64 compiler, and x64 assembly is a bit of a pain. (It's a pain because Linux and Windows have different calling conventions, and you need to maintain extra metadata for functions.) So, the assembly version stays and the C version stays out. - Converted the rest of a_strifestuff.cpp to DECORATE. - Fixed: AStalker::CheckMeleeRange did not perform all checks of AActor::CheckMeleeRange. I replaced this virtual override with a new flag MF5_NOVERTICALMELEERANGE so that this feature can also be used by other actors. - Converted Strife's Stalker to DECORATE. - Converted ArtiTeleport to DECORATE. - Removed the NoBlockingSet method from AActor because everything using it has been converted to DECORATE using DropItem instead. - Changed: Macil doesn't need the StrifeHumanoid's special death states so he might as well inherit directly from AActor. - Converted Strife's Coin, Oracle, Macil and StrifeHumanoid to DECORATE. Also moved the burning hand states to StrifePlayer where they really belong. - Added Gez's dropammofactor submission with some necessary changes. Also merged redundant ammo multiplication code from P_DropItem and ADehackedPickup::TryPickup. - Restricted native action function definitions to zdoom.pk3. - Fixed. The Firedemon was missing a game filter. - Added: disablegrin, disableouch, disablepain, and disablerampage flags to drawmugshot. - Fixed: LowerHealthCap did not work properly. - Fixed: Various bugs I noticed in the fullscreenoffsets code. - Removed all the pixel doubling r_detail modes, since the one platform they were intended to assist (486) actually sees very little benefit from them. - Rewrote CheckMMX in C and renamed it to CheckCPU. - Fixed: CPUID function 0x80000005 is specified to return detailed L1 cache only for AMD processors, so we must not use it on other architectures, or we end up overwriting the L1 cache line size with 0 or some other number we don't actually understand. - The x87 precision control is now explicitly set for double precision, since GCC defaults to extended precision instead, unlike Visual C++. - Converted Strife's Programmer, Loremaster and Thingstoblowup to DECORATE. - Fixed: Attacking a merchant in Strife didn't alert the enemies. - Removed AT_GAME_SET(PowerInvulnerable) due to the problems it caused. The two occurences in the code that depended on it were changed accordingly. Invulnerability colormaps are now being set by the items exclusively. - Changed many checks for the friendly Minotaur to a new flag MF5_SUMMONEDMONSTER so that it can hopefully be generalized to be usable elsewhere later. - Added Gez's submission for converting the Minotaur to DECORATE. - Fixed a few minor DECORATE bugs. - Changed coordinate storage for EntityBoss so that it works properly even when the pod is not used to spawn it. - Converted Strife's Spectres and Entity to DECORATE. - Added: fullscreenoffsets flag for status bars. This changes the coordinate system to be relative to the top left corner of the screen. This is useful for full screen status bars. - Changed: drawinventorybar will use the width of artibox or invcurs (strife) to determine the spacing. Let me know if this breaks any released mods. - Fixed: If a status bar height of 0 was specified in SBarInfo the wrong bar would be shown. - Fixed: If a static inventory bar was used the user still had to press invuse in order to get rid of the "overlay". - Fixed: forcescaled would not work if the height of the bar was 0. - Added: keyslot to drawswitchableimage. - Fixed: The transition effects for the log and keys popups were switched. - Converted Strife's Crusader, Inquisitor and spectral missiles to DECORATE. - Converted Strife's Acolytes, Rebels, Sentinel, Reaver and Templar to DECORATE. - Added DECORATE conversions for Hexen's Cleric weapons by Karate Chris. - Added a check to Zipdir that excludes files with a .orig extension. These can be left behind by patch.exe and create problems. - fixed: Unmorphing from chicken caused a crash when reading non-existent meta-data strings. - Converted the ScriptedMarines to DECORATE. - Fixed: DLightTransfer and DWallLightTransfer were declared as actors. - Converted the PhoenixRod and associated classes to DECORATE to make the Heretic conversion complete. - Converted the Minotaur's projectiles to DECORATE so that I can get rid of the AT_SPEED_SET code. - Converted Heretic's Blaster and SkullRod to DECORATE. - Converted the mace and all related actors to DECORATE and generalized the spawn function that only spawns one mace per level. - Moved Mace respawning code into AInventory so that it works properly for replacement actors. - Added more DECORATE conversions by Karate Chris. - Cleaned up the new bridge code and exported all related actors to DECORATE so that the exported code pointers can be used. - Separated Heretic's and Hexen's invulnerability items for stability reasons. - Fixed spurious warnings on 32-bit VC++ debug builds. - Made the subsong (order) number a proper parameter to MusInfo::Play() instead of requiring a separate SetPosition() call to do it. - Added Gez's submission for custom bridge things. - Fixed: ASpecialSpot must check the array's size before dividing by it. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@151 b0f79afe-0144-0410-b225-9a4edf0717df
2008-08-10 15:12:58 +00:00
diestate = FindState(NAME_GenericFreezeDeath);
}
}
}
}
if (diestate == NULL)
{
int flags4 = inflictor == NULL ? 0 : inflictor->flags4;
- Fixed: When walking on sloped 3D-floors, P_TryMove got the floor position from the sector's actual floor instead from the 3D-floor. - Fixed: Brightmaps were not disabled when fog was defined with a fadetable command in MAPINFO. Update to ZDoom r994: - Fixed: The compatibility searches for teleport destinations did not work properly when the teleporter had both a tid and a tag. Now, if a teleporter has a tag these are skipped because they are only present for Hexen compatibility. - Fixed: The first texture in a TEXTURE1 lump, although invalid when used elsewhere, must be usable as sky (see Requiem.wad's SKY3.) - Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for automatic fake contrast. - Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead of manipulating the sides' light values individually. This allows changing the fake contrast at run time and also allows adding individual relative lighting on top of it which is a planned UDMF feature. - Fixed: ActorStencilColor() did not set the palette part of the actor's fill color, so it would always produce black for STYLE_Shaded. - Added volume reduction for stereo sounds played in 3D to obtain levels closer to FMOD 3, which downmixed all stereo sounds to mono before playing them in 3D. Also added experimental 3D spread for stereo sounds so that you can actually hear them in stereo. - Reworked a few options that previously depended on LEVEL_HEXENFORMAT (actors being forced to the ground by instantly moving sectors, strife railing handling and shooting lines with a non-zero but unassigned tag.) With UDMF such semantics have to be handled diffently. - finalized UDMF 1.0 implementation. - Added Martin Howe's latest morph update. - Fixed: When R_DrawTiltedPlane() calculates the p vector, it can overflow if the view is near the bounds of the fixed point coordinate system. This happens because it rotates the view position around (0,0) according to the current viewangle, so the resultant coordinate may be outside the bounds of fixed point. All important math in this function is now done entirely in floating point. - Fixed: Slopes didn't draw right on 64-bit platforms. - Fixed: With hardware 2D, the console and menu need not reimplement palette flashes to ensure their visibility. - Fixed: DFlashFader::Destroy() did not call its super method. - Fixed: If a player was morphed into a class with a taller view height, their perceived view height would not change until they walked up a step. - Since KDIZD is the only mapset I know of that used reverb, and it didn't define any new ones of its own, I'm pre-emptively renaming the SNDEAX lump to REVERBS to remove any possible misunderstanding that this is something that requires EAX hardware support. (Ideally, it would have been REVERBDEF, but that's 10 characters long.) The eaxedit console command has also been renamed to reverbedit for the same reason. - Fixed: The Palette part of FRemapTable was not initialized with alpha values other than 0. I'm not sure if it would be better to fix this in the game palette that it copies from or not, but right now, they get set unconditionally to 255. - Fixed: M_DrawSave() and M_DrawLoad() need to use GetScaledWidth(), in case the texture is high-res. - Replaced all instances of "flags +=" in sbarinfo_parser.cpp with "flags |=" so that using the same flag multiple times will not have unexpected results. (sbarinfo update #21) - Added: sigil image type to correctly draw the sigil's icon. - Added: Strife inventory bar style. This is the only style that is radically different from the others. First of all it changes the SELECTBO to be INVCURS and draws it before the icons. Each box is changed to have a width of 35 pixels instead of 31 pixels. And the INVCURS graphic is drawn at (x-6, y-2). - Added: whennnotzero flag to drawnumber which will cause it to draw nothing if the value is 0. - Fixed: New mugshot code would not leave the god state when it was supposed to enter the rampage state. - Fixed: The ouch state was mostly broken. (SBarInfo Update #20) - Added: hasweaponpiece command to check for custom weapon pieces. - Added: usessecondaryammo command to check if the current weapon has a second ammo type. - Most of SBarInfo's mugshot scripting can be used with the default Doom status bar. - Fixed: By default drawmugshot would never come out of normal god mode state. In addition the state change to and from god mode was not quite as responsive as the original code. - Fixed: When FTextureManager::CheckForTexture finds a matching NULL texture it should always return 0, not the actual texture's index. - Fixed coordinate checks for objects on 3DMidtex lines. - Fixed: All translucent blending operations for CopyColors must treat an alpha of 0 so that the pixel is not modified or texture composition as intended will not work. - Fixed: 3D hardware texture filling did not copy pixels with 0 alpha, preserving whatever was underneath in the texture box previously. - Fixed: s_sound.cpp had its own idea of whether or not sounds were paused and did not entirely keep it in sync with the sound system's. This meant that when starting a new game from the menu, all sounds were played as menu sounds until you did something to pause the game, because s_sound.cpp thought sounds were unpaused, while the FMOD system thought they were. - I finally managed to test the translucency options for composite texture definitions in HIRESTEX. The feature should be complete now. - Fixed: A_CheckTargetInLOS used BAM angles instead of degrees which is the DECORATE convention. - Added Snowkate709's A_CheckTargetInLOS addition. - Added listmaps CCMD. - Revised underwater effect now uses a lowpass filter in combination with an optional freeverb unit. - Removed ResetEnvironment hack, since with software reverb, losing the existing reverb when focus is lost isn't a problem. - Commented out the TiMidity FIXME messages. - Fixed: FBarShader::GetColumn() passed incorrect information to the software renderer for horizontal bars. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@107 b0f79afe-0144-0410-b225-9a4edf0717df
2008-05-23 17:58:17 +00:00
int gibhealth = GibHealth(this);
// Don't pass on a damage type this actor cannot handle.
// (most importantly, prevent barrels from passing on ice damage.)
// Massacre must be preserved though.
if (DamageType != NAME_Massacre)
{
DamageType = NAME_None;
}
if ((health < gibhealth || flags4 & MF4_EXTREMEDEATH) && !(flags4 & MF4_NOEXTREMEDEATH))
{ // Extreme death
diestate = FindState (NAME_Death, NAME_Extreme, true);
// If a non-player, mark as extremely dead for the crash state.
if (diestate != NULL && player == NULL && health >= gibhealth)
{
health = gibhealth - 1;
}
// For players, mark the appropriate flag.
else if (player != NULL)
{
player->cheats |= CF_EXTREMELYDEAD;
}
}
if (diestate == NULL)
{ // Normal death
diestate = FindState (NAME_Death);
}
}
if (diestate != NULL)
{
SetState (diestate);
tics -= pr_killmobj() & 3;
if (tics < 1)
tics = 1;
}
else
{
Destroy();
}
}
//---------------------------------------------------------------------------
//
// PROC P_AutoUseHealth
//
//---------------------------------------------------------------------------
- version bump to 1.2.0. - fixed: Some of the dynamic light definitions for Hexen's switchable items were not correct. - fixed: Weapon sprites were all drawn fullbright if only one of the layers was set to bright. Update to ZDoom r1456 (2.3.0 plus one additional fix): - Fixed: AActor::SetOrigin must call P_FindFloorCeiling to get the true floor and ceiling heights. Otherwise the actor will fall right through 3DMidtex textures (and 3D-floors.) - Fixed: The TeleporterBeacon tried to enter its See state rather than its Drop state. Also changed it to fade out when it's done rather than disappearing abruptly. - Fixed: Strife's quest based line actions also work in Deathmatch. - Fixed: Gravity application was not correct. For actors with no vertical momentum the initial pull is supposed to be twice as strong as when vertical movement already takes place. - added invquery CCMD like in Strife. Also removed all underscores from the tag strings so that they can be printed properly. - Fixed: Skill baby was missing 'autousehealth' for all games. - Added a new CVAR: sv_disableautohealth - Autouse of health items is no longer hardwired to the default item classes. There's a new property HealthPickup.Autouse. 0 means no autouse, 1 a small Raven health item, 2 a large Raven health item and 3 a Strife item. - Removed an early-out in wallscan_striped() that is invalid when drawing a skybox. - fixed: nextmap and nextsecret CCMDs set skill to 0. - fixed: level.flags2 was not stored in savegames. Also bumped min. savegame version and removed old compatibility handlings. - The SFX Reverb unit is now moved so that it serves as an input to the water effect rather than as an input to the ChannelGroup Target Unit. This means the water effect is now applied after any room reverb, rather than in parallel with it. - Fixed: UI sounds should not have reverb applied to them. - Removed the delay for starting all sounds from one tic at exactly the same DSP position. Without also synchronizing the stopping of sounds, it can cause problems with things like the chainsaw where the sound is stopped and immediately restarted, causing occassional gaps between the stopping of the sound and the starting of the new one. (I added the start synchronization to combat flanging of paired moving polyobjects when moving around, but I think just removing velocity from the player for sound calculations takes care of that well enough.) - Added GCC headers for intptr_t to tarray.h. - Added MF5_PAINLESS flag for projectiles that don't make the target go into the pain state. - Changed DEM_ADDSLOTDEFAULT, DEM_ADDSLOT, and DEM_SETSLOT to be more space- efficient. - Fixed: player->oldbuttons was copied from the current button set at the end of P_PlayerThink(), well before ACS could ever get at it with GetPlayerInput. - Fixed: The map name display on the automap was incomplete. - Added FakeInventory.Respawns DECORATe property - Fixed: Unsetting the MF5_INCONVERSATION flag did not work when quitting the conversation by pressing Escape. - added ML_BLOCKPROJECTILE flag to lines. - Fixed: With opl_onechip set the second OPL chip was never set to anything valid so it contained an invalid pointer. There were also a few other places that simply assumed that the second chip is set to something valid. - Fixed: NPCs which are engaged in a conversation should not move. - Fixed: Player movement animation was not stopped when starting a conversation. - Added selective compression of network packets. Interestingly, most packets don't actually compress all that well, even the ones that aren't too short to possibly compress. (Maybe make the whole thing one long, never-ending zlib data stream with Z_SYNC_FLUSH used to chunk things at packet boundaries? That would probably help the compression ratio, but it would require changing the way the netcode determines sequence, which would be a much more invasive change.) - Fixed: Heretic's fullscreen HUD crashed when the player had armor without a valid icon. - Fixed: The StrifePlayer was missing a RunHealth setting. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@303 b0f79afe-0144-0410-b225-9a4edf0717df
2009-03-01 10:19:26 +00:00
static int CountHealth(TArray<AInventory *> &Items)
{
- version bump to 1.2.0. - fixed: Some of the dynamic light definitions for Hexen's switchable items were not correct. - fixed: Weapon sprites were all drawn fullbright if only one of the layers was set to bright. Update to ZDoom r1456 (2.3.0 plus one additional fix): - Fixed: AActor::SetOrigin must call P_FindFloorCeiling to get the true floor and ceiling heights. Otherwise the actor will fall right through 3DMidtex textures (and 3D-floors.) - Fixed: The TeleporterBeacon tried to enter its See state rather than its Drop state. Also changed it to fade out when it's done rather than disappearing abruptly. - Fixed: Strife's quest based line actions also work in Deathmatch. - Fixed: Gravity application was not correct. For actors with no vertical momentum the initial pull is supposed to be twice as strong as when vertical movement already takes place. - added invquery CCMD like in Strife. Also removed all underscores from the tag strings so that they can be printed properly. - Fixed: Skill baby was missing 'autousehealth' for all games. - Added a new CVAR: sv_disableautohealth - Autouse of health items is no longer hardwired to the default item classes. There's a new property HealthPickup.Autouse. 0 means no autouse, 1 a small Raven health item, 2 a large Raven health item and 3 a Strife item. - Removed an early-out in wallscan_striped() that is invalid when drawing a skybox. - fixed: nextmap and nextsecret CCMDs set skill to 0. - fixed: level.flags2 was not stored in savegames. Also bumped min. savegame version and removed old compatibility handlings. - The SFX Reverb unit is now moved so that it serves as an input to the water effect rather than as an input to the ChannelGroup Target Unit. This means the water effect is now applied after any room reverb, rather than in parallel with it. - Fixed: UI sounds should not have reverb applied to them. - Removed the delay for starting all sounds from one tic at exactly the same DSP position. Without also synchronizing the stopping of sounds, it can cause problems with things like the chainsaw where the sound is stopped and immediately restarted, causing occassional gaps between the stopping of the sound and the starting of the new one. (I added the start synchronization to combat flanging of paired moving polyobjects when moving around, but I think just removing velocity from the player for sound calculations takes care of that well enough.) - Added GCC headers for intptr_t to tarray.h. - Added MF5_PAINLESS flag for projectiles that don't make the target go into the pain state. - Changed DEM_ADDSLOTDEFAULT, DEM_ADDSLOT, and DEM_SETSLOT to be more space- efficient. - Fixed: player->oldbuttons was copied from the current button set at the end of P_PlayerThink(), well before ACS could ever get at it with GetPlayerInput. - Fixed: The map name display on the automap was incomplete. - Added FakeInventory.Respawns DECORATe property - Fixed: Unsetting the MF5_INCONVERSATION flag did not work when quitting the conversation by pressing Escape. - added ML_BLOCKPROJECTILE flag to lines. - Fixed: With opl_onechip set the second OPL chip was never set to anything valid so it contained an invalid pointer. There were also a few other places that simply assumed that the second chip is set to something valid. - Fixed: NPCs which are engaged in a conversation should not move. - Fixed: Player movement animation was not stopped when starting a conversation. - Added selective compression of network packets. Interestingly, most packets don't actually compress all that well, even the ones that aren't too short to possibly compress. (Maybe make the whole thing one long, never-ending zlib data stream with Z_SYNC_FLUSH used to chunk things at packet boundaries? That would probably help the compression ratio, but it would require changing the way the netcode determines sequence, which would be a much more invasive change.) - Fixed: Heretic's fullscreen HUD crashed when the player had armor without a valid icon. - Fixed: The StrifePlayer was missing a RunHealth setting. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@303 b0f79afe-0144-0410-b225-9a4edf0717df
2009-03-01 10:19:26 +00:00
int counted = 0;
for(unsigned i = 0; i < Items.Size(); i++)
{
counted += Items[i]->Amount * Items[i]->health;
}
return counted;
}
- version bump to 1.2.0. - fixed: Some of the dynamic light definitions for Hexen's switchable items were not correct. - fixed: Weapon sprites were all drawn fullbright if only one of the layers was set to bright. Update to ZDoom r1456 (2.3.0 plus one additional fix): - Fixed: AActor::SetOrigin must call P_FindFloorCeiling to get the true floor and ceiling heights. Otherwise the actor will fall right through 3DMidtex textures (and 3D-floors.) - Fixed: The TeleporterBeacon tried to enter its See state rather than its Drop state. Also changed it to fade out when it's done rather than disappearing abruptly. - Fixed: Strife's quest based line actions also work in Deathmatch. - Fixed: Gravity application was not correct. For actors with no vertical momentum the initial pull is supposed to be twice as strong as when vertical movement already takes place. - added invquery CCMD like in Strife. Also removed all underscores from the tag strings so that they can be printed properly. - Fixed: Skill baby was missing 'autousehealth' for all games. - Added a new CVAR: sv_disableautohealth - Autouse of health items is no longer hardwired to the default item classes. There's a new property HealthPickup.Autouse. 0 means no autouse, 1 a small Raven health item, 2 a large Raven health item and 3 a Strife item. - Removed an early-out in wallscan_striped() that is invalid when drawing a skybox. - fixed: nextmap and nextsecret CCMDs set skill to 0. - fixed: level.flags2 was not stored in savegames. Also bumped min. savegame version and removed old compatibility handlings. - The SFX Reverb unit is now moved so that it serves as an input to the water effect rather than as an input to the ChannelGroup Target Unit. This means the water effect is now applied after any room reverb, rather than in parallel with it. - Fixed: UI sounds should not have reverb applied to them. - Removed the delay for starting all sounds from one tic at exactly the same DSP position. Without also synchronizing the stopping of sounds, it can cause problems with things like the chainsaw where the sound is stopped and immediately restarted, causing occassional gaps between the stopping of the sound and the starting of the new one. (I added the start synchronization to combat flanging of paired moving polyobjects when moving around, but I think just removing velocity from the player for sound calculations takes care of that well enough.) - Added GCC headers for intptr_t to tarray.h. - Added MF5_PAINLESS flag for projectiles that don't make the target go into the pain state. - Changed DEM_ADDSLOTDEFAULT, DEM_ADDSLOT, and DEM_SETSLOT to be more space- efficient. - Fixed: player->oldbuttons was copied from the current button set at the end of P_PlayerThink(), well before ACS could ever get at it with GetPlayerInput. - Fixed: The map name display on the automap was incomplete. - Added FakeInventory.Respawns DECORATe property - Fixed: Unsetting the MF5_INCONVERSATION flag did not work when quitting the conversation by pressing Escape. - added ML_BLOCKPROJECTILE flag to lines. - Fixed: With opl_onechip set the second OPL chip was never set to anything valid so it contained an invalid pointer. There were also a few other places that simply assumed that the second chip is set to something valid. - Fixed: NPCs which are engaged in a conversation should not move. - Fixed: Player movement animation was not stopped when starting a conversation. - Added selective compression of network packets. Interestingly, most packets don't actually compress all that well, even the ones that aren't too short to possibly compress. (Maybe make the whole thing one long, never-ending zlib data stream with Z_SYNC_FLUSH used to chunk things at packet boundaries? That would probably help the compression ratio, but it would require changing the way the netcode determines sequence, which would be a much more invasive change.) - Fixed: Heretic's fullscreen HUD crashed when the player had armor without a valid icon. - Fixed: The StrifePlayer was missing a RunHealth setting. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@303 b0f79afe-0144-0410-b225-9a4edf0717df
2009-03-01 10:19:26 +00:00
static int UseHealthItems(TArray<AInventory *> &Items, int &saveHealth)
{
int saved = 0;
- version bump to 1.2.0. - fixed: Some of the dynamic light definitions for Hexen's switchable items were not correct. - fixed: Weapon sprites were all drawn fullbright if only one of the layers was set to bright. Update to ZDoom r1456 (2.3.0 plus one additional fix): - Fixed: AActor::SetOrigin must call P_FindFloorCeiling to get the true floor and ceiling heights. Otherwise the actor will fall right through 3DMidtex textures (and 3D-floors.) - Fixed: The TeleporterBeacon tried to enter its See state rather than its Drop state. Also changed it to fade out when it's done rather than disappearing abruptly. - Fixed: Strife's quest based line actions also work in Deathmatch. - Fixed: Gravity application was not correct. For actors with no vertical momentum the initial pull is supposed to be twice as strong as when vertical movement already takes place. - added invquery CCMD like in Strife. Also removed all underscores from the tag strings so that they can be printed properly. - Fixed: Skill baby was missing 'autousehealth' for all games. - Added a new CVAR: sv_disableautohealth - Autouse of health items is no longer hardwired to the default item classes. There's a new property HealthPickup.Autouse. 0 means no autouse, 1 a small Raven health item, 2 a large Raven health item and 3 a Strife item. - Removed an early-out in wallscan_striped() that is invalid when drawing a skybox. - fixed: nextmap and nextsecret CCMDs set skill to 0. - fixed: level.flags2 was not stored in savegames. Also bumped min. savegame version and removed old compatibility handlings. - The SFX Reverb unit is now moved so that it serves as an input to the water effect rather than as an input to the ChannelGroup Target Unit. This means the water effect is now applied after any room reverb, rather than in parallel with it. - Fixed: UI sounds should not have reverb applied to them. - Removed the delay for starting all sounds from one tic at exactly the same DSP position. Without also synchronizing the stopping of sounds, it can cause problems with things like the chainsaw where the sound is stopped and immediately restarted, causing occassional gaps between the stopping of the sound and the starting of the new one. (I added the start synchronization to combat flanging of paired moving polyobjects when moving around, but I think just removing velocity from the player for sound calculations takes care of that well enough.) - Added GCC headers for intptr_t to tarray.h. - Added MF5_PAINLESS flag for projectiles that don't make the target go into the pain state. - Changed DEM_ADDSLOTDEFAULT, DEM_ADDSLOT, and DEM_SETSLOT to be more space- efficient. - Fixed: player->oldbuttons was copied from the current button set at the end of P_PlayerThink(), well before ACS could ever get at it with GetPlayerInput. - Fixed: The map name display on the automap was incomplete. - Added FakeInventory.Respawns DECORATe property - Fixed: Unsetting the MF5_INCONVERSATION flag did not work when quitting the conversation by pressing Escape. - added ML_BLOCKPROJECTILE flag to lines. - Fixed: With opl_onechip set the second OPL chip was never set to anything valid so it contained an invalid pointer. There were also a few other places that simply assumed that the second chip is set to something valid. - Fixed: NPCs which are engaged in a conversation should not move. - Fixed: Player movement animation was not stopped when starting a conversation. - Added selective compression of network packets. Interestingly, most packets don't actually compress all that well, even the ones that aren't too short to possibly compress. (Maybe make the whole thing one long, never-ending zlib data stream with Z_SYNC_FLUSH used to chunk things at packet boundaries? That would probably help the compression ratio, but it would require changing the way the netcode determines sequence, which would be a much more invasive change.) - Fixed: Heretic's fullscreen HUD crashed when the player had armor without a valid icon. - Fixed: The StrifePlayer was missing a RunHealth setting. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@303 b0f79afe-0144-0410-b225-9a4edf0717df
2009-03-01 10:19:26 +00:00
while (Items.Size() > 0 && saveHealth > 0)
{
int maxhealth = 0;
int index = -1;
- version bump to 1.2.0. - fixed: Some of the dynamic light definitions for Hexen's switchable items were not correct. - fixed: Weapon sprites were all drawn fullbright if only one of the layers was set to bright. Update to ZDoom r1456 (2.3.0 plus one additional fix): - Fixed: AActor::SetOrigin must call P_FindFloorCeiling to get the true floor and ceiling heights. Otherwise the actor will fall right through 3DMidtex textures (and 3D-floors.) - Fixed: The TeleporterBeacon tried to enter its See state rather than its Drop state. Also changed it to fade out when it's done rather than disappearing abruptly. - Fixed: Strife's quest based line actions also work in Deathmatch. - Fixed: Gravity application was not correct. For actors with no vertical momentum the initial pull is supposed to be twice as strong as when vertical movement already takes place. - added invquery CCMD like in Strife. Also removed all underscores from the tag strings so that they can be printed properly. - Fixed: Skill baby was missing 'autousehealth' for all games. - Added a new CVAR: sv_disableautohealth - Autouse of health items is no longer hardwired to the default item classes. There's a new property HealthPickup.Autouse. 0 means no autouse, 1 a small Raven health item, 2 a large Raven health item and 3 a Strife item. - Removed an early-out in wallscan_striped() that is invalid when drawing a skybox. - fixed: nextmap and nextsecret CCMDs set skill to 0. - fixed: level.flags2 was not stored in savegames. Also bumped min. savegame version and removed old compatibility handlings. - The SFX Reverb unit is now moved so that it serves as an input to the water effect rather than as an input to the ChannelGroup Target Unit. This means the water effect is now applied after any room reverb, rather than in parallel with it. - Fixed: UI sounds should not have reverb applied to them. - Removed the delay for starting all sounds from one tic at exactly the same DSP position. Without also synchronizing the stopping of sounds, it can cause problems with things like the chainsaw where the sound is stopped and immediately restarted, causing occassional gaps between the stopping of the sound and the starting of the new one. (I added the start synchronization to combat flanging of paired moving polyobjects when moving around, but I think just removing velocity from the player for sound calculations takes care of that well enough.) - Added GCC headers for intptr_t to tarray.h. - Added MF5_PAINLESS flag for projectiles that don't make the target go into the pain state. - Changed DEM_ADDSLOTDEFAULT, DEM_ADDSLOT, and DEM_SETSLOT to be more space- efficient. - Fixed: player->oldbuttons was copied from the current button set at the end of P_PlayerThink(), well before ACS could ever get at it with GetPlayerInput. - Fixed: The map name display on the automap was incomplete. - Added FakeInventory.Respawns DECORATe property - Fixed: Unsetting the MF5_INCONVERSATION flag did not work when quitting the conversation by pressing Escape. - added ML_BLOCKPROJECTILE flag to lines. - Fixed: With opl_onechip set the second OPL chip was never set to anything valid so it contained an invalid pointer. There were also a few other places that simply assumed that the second chip is set to something valid. - Fixed: NPCs which are engaged in a conversation should not move. - Fixed: Player movement animation was not stopped when starting a conversation. - Added selective compression of network packets. Interestingly, most packets don't actually compress all that well, even the ones that aren't too short to possibly compress. (Maybe make the whole thing one long, never-ending zlib data stream with Z_SYNC_FLUSH used to chunk things at packet boundaries? That would probably help the compression ratio, but it would require changing the way the netcode determines sequence, which would be a much more invasive change.) - Fixed: Heretic's fullscreen HUD crashed when the player had armor without a valid icon. - Fixed: The StrifePlayer was missing a RunHealth setting. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@303 b0f79afe-0144-0410-b225-9a4edf0717df
2009-03-01 10:19:26 +00:00
// Find the largest item in the list
for(unsigned i = 0; i < Items.Size(); i++)
{
- version bump to 1.2.0. - fixed: Some of the dynamic light definitions for Hexen's switchable items were not correct. - fixed: Weapon sprites were all drawn fullbright if only one of the layers was set to bright. Update to ZDoom r1456 (2.3.0 plus one additional fix): - Fixed: AActor::SetOrigin must call P_FindFloorCeiling to get the true floor and ceiling heights. Otherwise the actor will fall right through 3DMidtex textures (and 3D-floors.) - Fixed: The TeleporterBeacon tried to enter its See state rather than its Drop state. Also changed it to fade out when it's done rather than disappearing abruptly. - Fixed: Strife's quest based line actions also work in Deathmatch. - Fixed: Gravity application was not correct. For actors with no vertical momentum the initial pull is supposed to be twice as strong as when vertical movement already takes place. - added invquery CCMD like in Strife. Also removed all underscores from the tag strings so that they can be printed properly. - Fixed: Skill baby was missing 'autousehealth' for all games. - Added a new CVAR: sv_disableautohealth - Autouse of health items is no longer hardwired to the default item classes. There's a new property HealthPickup.Autouse. 0 means no autouse, 1 a small Raven health item, 2 a large Raven health item and 3 a Strife item. - Removed an early-out in wallscan_striped() that is invalid when drawing a skybox. - fixed: nextmap and nextsecret CCMDs set skill to 0. - fixed: level.flags2 was not stored in savegames. Also bumped min. savegame version and removed old compatibility handlings. - The SFX Reverb unit is now moved so that it serves as an input to the water effect rather than as an input to the ChannelGroup Target Unit. This means the water effect is now applied after any room reverb, rather than in parallel with it. - Fixed: UI sounds should not have reverb applied to them. - Removed the delay for starting all sounds from one tic at exactly the same DSP position. Without also synchronizing the stopping of sounds, it can cause problems with things like the chainsaw where the sound is stopped and immediately restarted, causing occassional gaps between the stopping of the sound and the starting of the new one. (I added the start synchronization to combat flanging of paired moving polyobjects when moving around, but I think just removing velocity from the player for sound calculations takes care of that well enough.) - Added GCC headers for intptr_t to tarray.h. - Added MF5_PAINLESS flag for projectiles that don't make the target go into the pain state. - Changed DEM_ADDSLOTDEFAULT, DEM_ADDSLOT, and DEM_SETSLOT to be more space- efficient. - Fixed: player->oldbuttons was copied from the current button set at the end of P_PlayerThink(), well before ACS could ever get at it with GetPlayerInput. - Fixed: The map name display on the automap was incomplete. - Added FakeInventory.Respawns DECORATe property - Fixed: Unsetting the MF5_INCONVERSATION flag did not work when quitting the conversation by pressing Escape. - added ML_BLOCKPROJECTILE flag to lines. - Fixed: With opl_onechip set the second OPL chip was never set to anything valid so it contained an invalid pointer. There were also a few other places that simply assumed that the second chip is set to something valid. - Fixed: NPCs which are engaged in a conversation should not move. - Fixed: Player movement animation was not stopped when starting a conversation. - Added selective compression of network packets. Interestingly, most packets don't actually compress all that well, even the ones that aren't too short to possibly compress. (Maybe make the whole thing one long, never-ending zlib data stream with Z_SYNC_FLUSH used to chunk things at packet boundaries? That would probably help the compression ratio, but it would require changing the way the netcode determines sequence, which would be a much more invasive change.) - Fixed: Heretic's fullscreen HUD crashed when the player had armor without a valid icon. - Fixed: The StrifePlayer was missing a RunHealth setting. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@303 b0f79afe-0144-0410-b225-9a4edf0717df
2009-03-01 10:19:26 +00:00
if (Items[i]->health > maxhealth)
{
- version bump to 1.2.0. - fixed: Some of the dynamic light definitions for Hexen's switchable items were not correct. - fixed: Weapon sprites were all drawn fullbright if only one of the layers was set to bright. Update to ZDoom r1456 (2.3.0 plus one additional fix): - Fixed: AActor::SetOrigin must call P_FindFloorCeiling to get the true floor and ceiling heights. Otherwise the actor will fall right through 3DMidtex textures (and 3D-floors.) - Fixed: The TeleporterBeacon tried to enter its See state rather than its Drop state. Also changed it to fade out when it's done rather than disappearing abruptly. - Fixed: Strife's quest based line actions also work in Deathmatch. - Fixed: Gravity application was not correct. For actors with no vertical momentum the initial pull is supposed to be twice as strong as when vertical movement already takes place. - added invquery CCMD like in Strife. Also removed all underscores from the tag strings so that they can be printed properly. - Fixed: Skill baby was missing 'autousehealth' for all games. - Added a new CVAR: sv_disableautohealth - Autouse of health items is no longer hardwired to the default item classes. There's a new property HealthPickup.Autouse. 0 means no autouse, 1 a small Raven health item, 2 a large Raven health item and 3 a Strife item. - Removed an early-out in wallscan_striped() that is invalid when drawing a skybox. - fixed: nextmap and nextsecret CCMDs set skill to 0. - fixed: level.flags2 was not stored in savegames. Also bumped min. savegame version and removed old compatibility handlings. - The SFX Reverb unit is now moved so that it serves as an input to the water effect rather than as an input to the ChannelGroup Target Unit. This means the water effect is now applied after any room reverb, rather than in parallel with it. - Fixed: UI sounds should not have reverb applied to them. - Removed the delay for starting all sounds from one tic at exactly the same DSP position. Without also synchronizing the stopping of sounds, it can cause problems with things like the chainsaw where the sound is stopped and immediately restarted, causing occassional gaps between the stopping of the sound and the starting of the new one. (I added the start synchronization to combat flanging of paired moving polyobjects when moving around, but I think just removing velocity from the player for sound calculations takes care of that well enough.) - Added GCC headers for intptr_t to tarray.h. - Added MF5_PAINLESS flag for projectiles that don't make the target go into the pain state. - Changed DEM_ADDSLOTDEFAULT, DEM_ADDSLOT, and DEM_SETSLOT to be more space- efficient. - Fixed: player->oldbuttons was copied from the current button set at the end of P_PlayerThink(), well before ACS could ever get at it with GetPlayerInput. - Fixed: The map name display on the automap was incomplete. - Added FakeInventory.Respawns DECORATe property - Fixed: Unsetting the MF5_INCONVERSATION flag did not work when quitting the conversation by pressing Escape. - added ML_BLOCKPROJECTILE flag to lines. - Fixed: With opl_onechip set the second OPL chip was never set to anything valid so it contained an invalid pointer. There were also a few other places that simply assumed that the second chip is set to something valid. - Fixed: NPCs which are engaged in a conversation should not move. - Fixed: Player movement animation was not stopped when starting a conversation. - Added selective compression of network packets. Interestingly, most packets don't actually compress all that well, even the ones that aren't too short to possibly compress. (Maybe make the whole thing one long, never-ending zlib data stream with Z_SYNC_FLUSH used to chunk things at packet boundaries? That would probably help the compression ratio, but it would require changing the way the netcode determines sequence, which would be a much more invasive change.) - Fixed: Heretic's fullscreen HUD crashed when the player had armor without a valid icon. - Fixed: The StrifePlayer was missing a RunHealth setting. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@303 b0f79afe-0144-0410-b225-9a4edf0717df
2009-03-01 10:19:26 +00:00
index = i;
maxhealth = Items[i]->health;
}
}
- version bump to 1.2.0. - fixed: Some of the dynamic light definitions for Hexen's switchable items were not correct. - fixed: Weapon sprites were all drawn fullbright if only one of the layers was set to bright. Update to ZDoom r1456 (2.3.0 plus one additional fix): - Fixed: AActor::SetOrigin must call P_FindFloorCeiling to get the true floor and ceiling heights. Otherwise the actor will fall right through 3DMidtex textures (and 3D-floors.) - Fixed: The TeleporterBeacon tried to enter its See state rather than its Drop state. Also changed it to fade out when it's done rather than disappearing abruptly. - Fixed: Strife's quest based line actions also work in Deathmatch. - Fixed: Gravity application was not correct. For actors with no vertical momentum the initial pull is supposed to be twice as strong as when vertical movement already takes place. - added invquery CCMD like in Strife. Also removed all underscores from the tag strings so that they can be printed properly. - Fixed: Skill baby was missing 'autousehealth' for all games. - Added a new CVAR: sv_disableautohealth - Autouse of health items is no longer hardwired to the default item classes. There's a new property HealthPickup.Autouse. 0 means no autouse, 1 a small Raven health item, 2 a large Raven health item and 3 a Strife item. - Removed an early-out in wallscan_striped() that is invalid when drawing a skybox. - fixed: nextmap and nextsecret CCMDs set skill to 0. - fixed: level.flags2 was not stored in savegames. Also bumped min. savegame version and removed old compatibility handlings. - The SFX Reverb unit is now moved so that it serves as an input to the water effect rather than as an input to the ChannelGroup Target Unit. This means the water effect is now applied after any room reverb, rather than in parallel with it. - Fixed: UI sounds should not have reverb applied to them. - Removed the delay for starting all sounds from one tic at exactly the same DSP position. Without also synchronizing the stopping of sounds, it can cause problems with things like the chainsaw where the sound is stopped and immediately restarted, causing occassional gaps between the stopping of the sound and the starting of the new one. (I added the start synchronization to combat flanging of paired moving polyobjects when moving around, but I think just removing velocity from the player for sound calculations takes care of that well enough.) - Added GCC headers for intptr_t to tarray.h. - Added MF5_PAINLESS flag for projectiles that don't make the target go into the pain state. - Changed DEM_ADDSLOTDEFAULT, DEM_ADDSLOT, and DEM_SETSLOT to be more space- efficient. - Fixed: player->oldbuttons was copied from the current button set at the end of P_PlayerThink(), well before ACS could ever get at it with GetPlayerInput. - Fixed: The map name display on the automap was incomplete. - Added FakeInventory.Respawns DECORATe property - Fixed: Unsetting the MF5_INCONVERSATION flag did not work when quitting the conversation by pressing Escape. - added ML_BLOCKPROJECTILE flag to lines. - Fixed: With opl_onechip set the second OPL chip was never set to anything valid so it contained an invalid pointer. There were also a few other places that simply assumed that the second chip is set to something valid. - Fixed: NPCs which are engaged in a conversation should not move. - Fixed: Player movement animation was not stopped when starting a conversation. - Added selective compression of network packets. Interestingly, most packets don't actually compress all that well, even the ones that aren't too short to possibly compress. (Maybe make the whole thing one long, never-ending zlib data stream with Z_SYNC_FLUSH used to chunk things at packet boundaries? That would probably help the compression ratio, but it would require changing the way the netcode determines sequence, which would be a much more invasive change.) - Fixed: Heretic's fullscreen HUD crashed when the player had armor without a valid icon. - Fixed: The StrifePlayer was missing a RunHealth setting. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@303 b0f79afe-0144-0410-b225-9a4edf0717df
2009-03-01 10:19:26 +00:00
// Now apply the health items, using the same logic as Heretic and Hexen.
- version bump to 1.2.0. - fixed: Some of the dynamic light definitions for Hexen's switchable items were not correct. - fixed: Weapon sprites were all drawn fullbright if only one of the layers was set to bright. Update to ZDoom r1456 (2.3.0 plus one additional fix): - Fixed: AActor::SetOrigin must call P_FindFloorCeiling to get the true floor and ceiling heights. Otherwise the actor will fall right through 3DMidtex textures (and 3D-floors.) - Fixed: The TeleporterBeacon tried to enter its See state rather than its Drop state. Also changed it to fade out when it's done rather than disappearing abruptly. - Fixed: Strife's quest based line actions also work in Deathmatch. - Fixed: Gravity application was not correct. For actors with no vertical momentum the initial pull is supposed to be twice as strong as when vertical movement already takes place. - added invquery CCMD like in Strife. Also removed all underscores from the tag strings so that they can be printed properly. - Fixed: Skill baby was missing 'autousehealth' for all games. - Added a new CVAR: sv_disableautohealth - Autouse of health items is no longer hardwired to the default item classes. There's a new property HealthPickup.Autouse. 0 means no autouse, 1 a small Raven health item, 2 a large Raven health item and 3 a Strife item. - Removed an early-out in wallscan_striped() that is invalid when drawing a skybox. - fixed: nextmap and nextsecret CCMDs set skill to 0. - fixed: level.flags2 was not stored in savegames. Also bumped min. savegame version and removed old compatibility handlings. - The SFX Reverb unit is now moved so that it serves as an input to the water effect rather than as an input to the ChannelGroup Target Unit. This means the water effect is now applied after any room reverb, rather than in parallel with it. - Fixed: UI sounds should not have reverb applied to them. - Removed the delay for starting all sounds from one tic at exactly the same DSP position. Without also synchronizing the stopping of sounds, it can cause problems with things like the chainsaw where the sound is stopped and immediately restarted, causing occassional gaps between the stopping of the sound and the starting of the new one. (I added the start synchronization to combat flanging of paired moving polyobjects when moving around, but I think just removing velocity from the player for sound calculations takes care of that well enough.) - Added GCC headers for intptr_t to tarray.h. - Added MF5_PAINLESS flag for projectiles that don't make the target go into the pain state. - Changed DEM_ADDSLOTDEFAULT, DEM_ADDSLOT, and DEM_SETSLOT to be more space- efficient. - Fixed: player->oldbuttons was copied from the current button set at the end of P_PlayerThink(), well before ACS could ever get at it with GetPlayerInput. - Fixed: The map name display on the automap was incomplete. - Added FakeInventory.Respawns DECORATe property - Fixed: Unsetting the MF5_INCONVERSATION flag did not work when quitting the conversation by pressing Escape. - added ML_BLOCKPROJECTILE flag to lines. - Fixed: With opl_onechip set the second OPL chip was never set to anything valid so it contained an invalid pointer. There were also a few other places that simply assumed that the second chip is set to something valid. - Fixed: NPCs which are engaged in a conversation should not move. - Fixed: Player movement animation was not stopped when starting a conversation. - Added selective compression of network packets. Interestingly, most packets don't actually compress all that well, even the ones that aren't too short to possibly compress. (Maybe make the whole thing one long, never-ending zlib data stream with Z_SYNC_FLUSH used to chunk things at packet boundaries? That would probably help the compression ratio, but it would require changing the way the netcode determines sequence, which would be a much more invasive change.) - Fixed: Heretic's fullscreen HUD crashed when the player had armor without a valid icon. - Fixed: The StrifePlayer was missing a RunHealth setting. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@303 b0f79afe-0144-0410-b225-9a4edf0717df
2009-03-01 10:19:26 +00:00
int count = (saveHealth + maxhealth-1) / maxhealth;
for(int i = 0; i < count; i++)
{
- version bump to 1.2.0. - fixed: Some of the dynamic light definitions for Hexen's switchable items were not correct. - fixed: Weapon sprites were all drawn fullbright if only one of the layers was set to bright. Update to ZDoom r1456 (2.3.0 plus one additional fix): - Fixed: AActor::SetOrigin must call P_FindFloorCeiling to get the true floor and ceiling heights. Otherwise the actor will fall right through 3DMidtex textures (and 3D-floors.) - Fixed: The TeleporterBeacon tried to enter its See state rather than its Drop state. Also changed it to fade out when it's done rather than disappearing abruptly. - Fixed: Strife's quest based line actions also work in Deathmatch. - Fixed: Gravity application was not correct. For actors with no vertical momentum the initial pull is supposed to be twice as strong as when vertical movement already takes place. - added invquery CCMD like in Strife. Also removed all underscores from the tag strings so that they can be printed properly. - Fixed: Skill baby was missing 'autousehealth' for all games. - Added a new CVAR: sv_disableautohealth - Autouse of health items is no longer hardwired to the default item classes. There's a new property HealthPickup.Autouse. 0 means no autouse, 1 a small Raven health item, 2 a large Raven health item and 3 a Strife item. - Removed an early-out in wallscan_striped() that is invalid when drawing a skybox. - fixed: nextmap and nextsecret CCMDs set skill to 0. - fixed: level.flags2 was not stored in savegames. Also bumped min. savegame version and removed old compatibility handlings. - The SFX Reverb unit is now moved so that it serves as an input to the water effect rather than as an input to the ChannelGroup Target Unit. This means the water effect is now applied after any room reverb, rather than in parallel with it. - Fixed: UI sounds should not have reverb applied to them. - Removed the delay for starting all sounds from one tic at exactly the same DSP position. Without also synchronizing the stopping of sounds, it can cause problems with things like the chainsaw where the sound is stopped and immediately restarted, causing occassional gaps between the stopping of the sound and the starting of the new one. (I added the start synchronization to combat flanging of paired moving polyobjects when moving around, but I think just removing velocity from the player for sound calculations takes care of that well enough.) - Added GCC headers for intptr_t to tarray.h. - Added MF5_PAINLESS flag for projectiles that don't make the target go into the pain state. - Changed DEM_ADDSLOTDEFAULT, DEM_ADDSLOT, and DEM_SETSLOT to be more space- efficient. - Fixed: player->oldbuttons was copied from the current button set at the end of P_PlayerThink(), well before ACS could ever get at it with GetPlayerInput. - Fixed: The map name display on the automap was incomplete. - Added FakeInventory.Respawns DECORATe property - Fixed: Unsetting the MF5_INCONVERSATION flag did not work when quitting the conversation by pressing Escape. - added ML_BLOCKPROJECTILE flag to lines. - Fixed: With opl_onechip set the second OPL chip was never set to anything valid so it contained an invalid pointer. There were also a few other places that simply assumed that the second chip is set to something valid. - Fixed: NPCs which are engaged in a conversation should not move. - Fixed: Player movement animation was not stopped when starting a conversation. - Added selective compression of network packets. Interestingly, most packets don't actually compress all that well, even the ones that aren't too short to possibly compress. (Maybe make the whole thing one long, never-ending zlib data stream with Z_SYNC_FLUSH used to chunk things at packet boundaries? That would probably help the compression ratio, but it would require changing the way the netcode determines sequence, which would be a much more invasive change.) - Fixed: Heretic's fullscreen HUD crashed when the player had armor without a valid icon. - Fixed: The StrifePlayer was missing a RunHealth setting. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@303 b0f79afe-0144-0410-b225-9a4edf0717df
2009-03-01 10:19:26 +00:00
saved += maxhealth;
saveHealth -= maxhealth;
if (--Items[index]->Amount == 0)
{
- version bump to 1.2.0. - fixed: Some of the dynamic light definitions for Hexen's switchable items were not correct. - fixed: Weapon sprites were all drawn fullbright if only one of the layers was set to bright. Update to ZDoom r1456 (2.3.0 plus one additional fix): - Fixed: AActor::SetOrigin must call P_FindFloorCeiling to get the true floor and ceiling heights. Otherwise the actor will fall right through 3DMidtex textures (and 3D-floors.) - Fixed: The TeleporterBeacon tried to enter its See state rather than its Drop state. Also changed it to fade out when it's done rather than disappearing abruptly. - Fixed: Strife's quest based line actions also work in Deathmatch. - Fixed: Gravity application was not correct. For actors with no vertical momentum the initial pull is supposed to be twice as strong as when vertical movement already takes place. - added invquery CCMD like in Strife. Also removed all underscores from the tag strings so that they can be printed properly. - Fixed: Skill baby was missing 'autousehealth' for all games. - Added a new CVAR: sv_disableautohealth - Autouse of health items is no longer hardwired to the default item classes. There's a new property HealthPickup.Autouse. 0 means no autouse, 1 a small Raven health item, 2 a large Raven health item and 3 a Strife item. - Removed an early-out in wallscan_striped() that is invalid when drawing a skybox. - fixed: nextmap and nextsecret CCMDs set skill to 0. - fixed: level.flags2 was not stored in savegames. Also bumped min. savegame version and removed old compatibility handlings. - The SFX Reverb unit is now moved so that it serves as an input to the water effect rather than as an input to the ChannelGroup Target Unit. This means the water effect is now applied after any room reverb, rather than in parallel with it. - Fixed: UI sounds should not have reverb applied to them. - Removed the delay for starting all sounds from one tic at exactly the same DSP position. Without also synchronizing the stopping of sounds, it can cause problems with things like the chainsaw where the sound is stopped and immediately restarted, causing occassional gaps between the stopping of the sound and the starting of the new one. (I added the start synchronization to combat flanging of paired moving polyobjects when moving around, but I think just removing velocity from the player for sound calculations takes care of that well enough.) - Added GCC headers for intptr_t to tarray.h. - Added MF5_PAINLESS flag for projectiles that don't make the target go into the pain state. - Changed DEM_ADDSLOTDEFAULT, DEM_ADDSLOT, and DEM_SETSLOT to be more space- efficient. - Fixed: player->oldbuttons was copied from the current button set at the end of P_PlayerThink(), well before ACS could ever get at it with GetPlayerInput. - Fixed: The map name display on the automap was incomplete. - Added FakeInventory.Respawns DECORATe property - Fixed: Unsetting the MF5_INCONVERSATION flag did not work when quitting the conversation by pressing Escape. - added ML_BLOCKPROJECTILE flag to lines. - Fixed: With opl_onechip set the second OPL chip was never set to anything valid so it contained an invalid pointer. There were also a few other places that simply assumed that the second chip is set to something valid. - Fixed: NPCs which are engaged in a conversation should not move. - Fixed: Player movement animation was not stopped when starting a conversation. - Added selective compression of network packets. Interestingly, most packets don't actually compress all that well, even the ones that aren't too short to possibly compress. (Maybe make the whole thing one long, never-ending zlib data stream with Z_SYNC_FLUSH used to chunk things at packet boundaries? That would probably help the compression ratio, but it would require changing the way the netcode determines sequence, which would be a much more invasive change.) - Fixed: Heretic's fullscreen HUD crashed when the player had armor without a valid icon. - Fixed: The StrifePlayer was missing a RunHealth setting. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@303 b0f79afe-0144-0410-b225-9a4edf0717df
2009-03-01 10:19:26 +00:00
if (!(Items[index]->ItemFlags & IF_KEEPDEPLETED))
{
Items[index]->Destroy ();
}
Items.Delete(index);
break;
}
}
}
- version bump to 1.2.0. - fixed: Some of the dynamic light definitions for Hexen's switchable items were not correct. - fixed: Weapon sprites were all drawn fullbright if only one of the layers was set to bright. Update to ZDoom r1456 (2.3.0 plus one additional fix): - Fixed: AActor::SetOrigin must call P_FindFloorCeiling to get the true floor and ceiling heights. Otherwise the actor will fall right through 3DMidtex textures (and 3D-floors.) - Fixed: The TeleporterBeacon tried to enter its See state rather than its Drop state. Also changed it to fade out when it's done rather than disappearing abruptly. - Fixed: Strife's quest based line actions also work in Deathmatch. - Fixed: Gravity application was not correct. For actors with no vertical momentum the initial pull is supposed to be twice as strong as when vertical movement already takes place. - added invquery CCMD like in Strife. Also removed all underscores from the tag strings so that they can be printed properly. - Fixed: Skill baby was missing 'autousehealth' for all games. - Added a new CVAR: sv_disableautohealth - Autouse of health items is no longer hardwired to the default item classes. There's a new property HealthPickup.Autouse. 0 means no autouse, 1 a small Raven health item, 2 a large Raven health item and 3 a Strife item. - Removed an early-out in wallscan_striped() that is invalid when drawing a skybox. - fixed: nextmap and nextsecret CCMDs set skill to 0. - fixed: level.flags2 was not stored in savegames. Also bumped min. savegame version and removed old compatibility handlings. - The SFX Reverb unit is now moved so that it serves as an input to the water effect rather than as an input to the ChannelGroup Target Unit. This means the water effect is now applied after any room reverb, rather than in parallel with it. - Fixed: UI sounds should not have reverb applied to them. - Removed the delay for starting all sounds from one tic at exactly the same DSP position. Without also synchronizing the stopping of sounds, it can cause problems with things like the chainsaw where the sound is stopped and immediately restarted, causing occassional gaps between the stopping of the sound and the starting of the new one. (I added the start synchronization to combat flanging of paired moving polyobjects when moving around, but I think just removing velocity from the player for sound calculations takes care of that well enough.) - Added GCC headers for intptr_t to tarray.h. - Added MF5_PAINLESS flag for projectiles that don't make the target go into the pain state. - Changed DEM_ADDSLOTDEFAULT, DEM_ADDSLOT, and DEM_SETSLOT to be more space- efficient. - Fixed: player->oldbuttons was copied from the current button set at the end of P_PlayerThink(), well before ACS could ever get at it with GetPlayerInput. - Fixed: The map name display on the automap was incomplete. - Added FakeInventory.Respawns DECORATe property - Fixed: Unsetting the MF5_INCONVERSATION flag did not work when quitting the conversation by pressing Escape. - added ML_BLOCKPROJECTILE flag to lines. - Fixed: With opl_onechip set the second OPL chip was never set to anything valid so it contained an invalid pointer. There were also a few other places that simply assumed that the second chip is set to something valid. - Fixed: NPCs which are engaged in a conversation should not move. - Fixed: Player movement animation was not stopped when starting a conversation. - Added selective compression of network packets. Interestingly, most packets don't actually compress all that well, even the ones that aren't too short to possibly compress. (Maybe make the whole thing one long, never-ending zlib data stream with Z_SYNC_FLUSH used to chunk things at packet boundaries? That would probably help the compression ratio, but it would require changing the way the netcode determines sequence, which would be a much more invasive change.) - Fixed: Heretic's fullscreen HUD crashed when the player had armor without a valid icon. - Fixed: The StrifePlayer was missing a RunHealth setting. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@303 b0f79afe-0144-0410-b225-9a4edf0717df
2009-03-01 10:19:26 +00:00
return saved;
}
void P_AutoUseHealth(player_t *player, int saveHealth)
{
TArray<AInventory *> NormalHealthItems;
TArray<AInventory *> LargeHealthItems;
for(AInventory *inv = player->mo->Inventory; inv != NULL; inv = inv->Inventory)
{
if (inv->Amount > 0 && inv->IsKindOf(RUNTIME_CLASS(AHealthPickup)))
{
- version bump to 1.2.0. - fixed: Some of the dynamic light definitions for Hexen's switchable items were not correct. - fixed: Weapon sprites were all drawn fullbright if only one of the layers was set to bright. Update to ZDoom r1456 (2.3.0 plus one additional fix): - Fixed: AActor::SetOrigin must call P_FindFloorCeiling to get the true floor and ceiling heights. Otherwise the actor will fall right through 3DMidtex textures (and 3D-floors.) - Fixed: The TeleporterBeacon tried to enter its See state rather than its Drop state. Also changed it to fade out when it's done rather than disappearing abruptly. - Fixed: Strife's quest based line actions also work in Deathmatch. - Fixed: Gravity application was not correct. For actors with no vertical momentum the initial pull is supposed to be twice as strong as when vertical movement already takes place. - added invquery CCMD like in Strife. Also removed all underscores from the tag strings so that they can be printed properly. - Fixed: Skill baby was missing 'autousehealth' for all games. - Added a new CVAR: sv_disableautohealth - Autouse of health items is no longer hardwired to the default item classes. There's a new property HealthPickup.Autouse. 0 means no autouse, 1 a small Raven health item, 2 a large Raven health item and 3 a Strife item. - Removed an early-out in wallscan_striped() that is invalid when drawing a skybox. - fixed: nextmap and nextsecret CCMDs set skill to 0. - fixed: level.flags2 was not stored in savegames. Also bumped min. savegame version and removed old compatibility handlings. - The SFX Reverb unit is now moved so that it serves as an input to the water effect rather than as an input to the ChannelGroup Target Unit. This means the water effect is now applied after any room reverb, rather than in parallel with it. - Fixed: UI sounds should not have reverb applied to them. - Removed the delay for starting all sounds from one tic at exactly the same DSP position. Without also synchronizing the stopping of sounds, it can cause problems with things like the chainsaw where the sound is stopped and immediately restarted, causing occassional gaps between the stopping of the sound and the starting of the new one. (I added the start synchronization to combat flanging of paired moving polyobjects when moving around, but I think just removing velocity from the player for sound calculations takes care of that well enough.) - Added GCC headers for intptr_t to tarray.h. - Added MF5_PAINLESS flag for projectiles that don't make the target go into the pain state. - Changed DEM_ADDSLOTDEFAULT, DEM_ADDSLOT, and DEM_SETSLOT to be more space- efficient. - Fixed: player->oldbuttons was copied from the current button set at the end of P_PlayerThink(), well before ACS could ever get at it with GetPlayerInput. - Fixed: The map name display on the automap was incomplete. - Added FakeInventory.Respawns DECORATe property - Fixed: Unsetting the MF5_INCONVERSATION flag did not work when quitting the conversation by pressing Escape. - added ML_BLOCKPROJECTILE flag to lines. - Fixed: With opl_onechip set the second OPL chip was never set to anything valid so it contained an invalid pointer. There were also a few other places that simply assumed that the second chip is set to something valid. - Fixed: NPCs which are engaged in a conversation should not move. - Fixed: Player movement animation was not stopped when starting a conversation. - Added selective compression of network packets. Interestingly, most packets don't actually compress all that well, even the ones that aren't too short to possibly compress. (Maybe make the whole thing one long, never-ending zlib data stream with Z_SYNC_FLUSH used to chunk things at packet boundaries? That would probably help the compression ratio, but it would require changing the way the netcode determines sequence, which would be a much more invasive change.) - Fixed: Heretic's fullscreen HUD crashed when the player had armor without a valid icon. - Fixed: The StrifePlayer was missing a RunHealth setting. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@303 b0f79afe-0144-0410-b225-9a4edf0717df
2009-03-01 10:19:26 +00:00
int mode = static_cast<AHealthPickup*>(inv)->autousemode;
Update to ZDoom r1514: - Fixed: Altering a link type with Sector_SetLink did not work. - Fixed: player.crouchsprite had no proper means of unsetting the crouch sprite which is needed by the ChexPlayer. - Fixed: A_ChangeFlags must unlink the actor from the world before changing the NOBLOCKMAP and NOSECTOR flags. - Fixed: Dehacked string replacement did not check the clusters' finaleflats. - Changed the definition of several typedef'd structs so that they are properly named. - Limited DEHSUPP lump lookup to search zdoom.pk3 only. It will no longer be possible to load DEHSUPP lumps from user WADs. - Brought back the text-based DEHSUPP parser and changed it to be able to reference states by label. Also changed label names of DoomUnusedStates and added proper labels to all states that were previously forced to be the first state of an actor so that the old (limited) method could access them. This was done to address the following bug: - Fixed: The player's death states calling A_PlayerSkinCheck should not be part of the state set that is accessible by Dehacked. These will produce error messages when mapped to non-players. - Fixed: Reading the RNG states from a savegame calculated the amounts of RNGs in the savegame wrong. - Changed random seed initialization so that it uses the system's cryptographically secure random number generator, if available, instead of the current time. - Changed the random number generator from Lee Killough's algorithm to the SFMT607 variant of the Mersenne Twister. <http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/index.html> - Made fmodex.dll delay-loaded so the game should be runnable on Windows 95 again, though without sound. - Changed gameinfo_t and gameborder_t to be named structs instead of typedef'ed anonymous structs. - Fixed: P_AutoUseHealth() used autousemodes 0 and 1 instead of 1 and 2. - Fixed: SBARINFO did not recognize 5:4 aspect ratio. - Fixed: screenshot_dir was ignored. - Removed some obsolete code from G_InitLevelLocals that was causing problems with maps that have no name. - Fixed: The inner loop in AWeaponSlot::PickWeapon could endlessly loop when the counter variable became negative. - Fixed: Implicitly defined clusters were not initialized when being created. - Fixed: Item tossing did not work anymore. - Changed: Making the gameinfo customizable by MAPINFO requires different checks for map specific border flats. - removed gamemission variable because it wasn't used anywhere. - removed gamemode variable. All it was used for were some checks that really should depend on GI_MAPxx. - Externalized all internal gameinfo definitions. - added include to MAPINFO parser. - split IWAD detection code off from d_main.cpp into its own file. - disabled gamemission based switch filtering because it is not useful. - added GAMEINFO submission by Blzut3 with significant modifications. There is no GAMEINFO lump. Instead all information is placed in MAPINFO, except the data that is needed to decide which WADs to autoload. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@318 b0f79afe-0144-0410-b225-9a4edf0717df
2009-03-29 11:21:36 +00:00
if (mode == 1) NormalHealthItems.Push(inv);
else if (mode == 2) LargeHealthItems.Push(inv);
}
}
- version bump to 1.2.0. - fixed: Some of the dynamic light definitions for Hexen's switchable items were not correct. - fixed: Weapon sprites were all drawn fullbright if only one of the layers was set to bright. Update to ZDoom r1456 (2.3.0 plus one additional fix): - Fixed: AActor::SetOrigin must call P_FindFloorCeiling to get the true floor and ceiling heights. Otherwise the actor will fall right through 3DMidtex textures (and 3D-floors.) - Fixed: The TeleporterBeacon tried to enter its See state rather than its Drop state. Also changed it to fade out when it's done rather than disappearing abruptly. - Fixed: Strife's quest based line actions also work in Deathmatch. - Fixed: Gravity application was not correct. For actors with no vertical momentum the initial pull is supposed to be twice as strong as when vertical movement already takes place. - added invquery CCMD like in Strife. Also removed all underscores from the tag strings so that they can be printed properly. - Fixed: Skill baby was missing 'autousehealth' for all games. - Added a new CVAR: sv_disableautohealth - Autouse of health items is no longer hardwired to the default item classes. There's a new property HealthPickup.Autouse. 0 means no autouse, 1 a small Raven health item, 2 a large Raven health item and 3 a Strife item. - Removed an early-out in wallscan_striped() that is invalid when drawing a skybox. - fixed: nextmap and nextsecret CCMDs set skill to 0. - fixed: level.flags2 was not stored in savegames. Also bumped min. savegame version and removed old compatibility handlings. - The SFX Reverb unit is now moved so that it serves as an input to the water effect rather than as an input to the ChannelGroup Target Unit. This means the water effect is now applied after any room reverb, rather than in parallel with it. - Fixed: UI sounds should not have reverb applied to them. - Removed the delay for starting all sounds from one tic at exactly the same DSP position. Without also synchronizing the stopping of sounds, it can cause problems with things like the chainsaw where the sound is stopped and immediately restarted, causing occassional gaps between the stopping of the sound and the starting of the new one. (I added the start synchronization to combat flanging of paired moving polyobjects when moving around, but I think just removing velocity from the player for sound calculations takes care of that well enough.) - Added GCC headers for intptr_t to tarray.h. - Added MF5_PAINLESS flag for projectiles that don't make the target go into the pain state. - Changed DEM_ADDSLOTDEFAULT, DEM_ADDSLOT, and DEM_SETSLOT to be more space- efficient. - Fixed: player->oldbuttons was copied from the current button set at the end of P_PlayerThink(), well before ACS could ever get at it with GetPlayerInput. - Fixed: The map name display on the automap was incomplete. - Added FakeInventory.Respawns DECORATe property - Fixed: Unsetting the MF5_INCONVERSATION flag did not work when quitting the conversation by pressing Escape. - added ML_BLOCKPROJECTILE flag to lines. - Fixed: With opl_onechip set the second OPL chip was never set to anything valid so it contained an invalid pointer. There were also a few other places that simply assumed that the second chip is set to something valid. - Fixed: NPCs which are engaged in a conversation should not move. - Fixed: Player movement animation was not stopped when starting a conversation. - Added selective compression of network packets. Interestingly, most packets don't actually compress all that well, even the ones that aren't too short to possibly compress. (Maybe make the whole thing one long, never-ending zlib data stream with Z_SYNC_FLUSH used to chunk things at packet boundaries? That would probably help the compression ratio, but it would require changing the way the netcode determines sequence, which would be a much more invasive change.) - Fixed: Heretic's fullscreen HUD crashed when the player had armor without a valid icon. - Fixed: The StrifePlayer was missing a RunHealth setting. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@303 b0f79afe-0144-0410-b225-9a4edf0717df
2009-03-01 10:19:26 +00:00
int normalhealth = CountHealth(NormalHealthItems);
int largehealth = CountHealth(LargeHealthItems);
bool skilluse = !!G_SkillProperty(SKILLP_AutoUseHealth);
if (skilluse && normalhealth >= saveHealth)
{ // Use quartz flasks
player->health += UseHealthItems(NormalHealthItems, saveHealth);
}
else if (largehealth >= saveHealth)
{
// Use mystic urns
player->health += UseHealthItems(LargeHealthItems, saveHealth);
}
else if (skilluse && normalhealth + largehealth >= saveHealth)
{ // Use mystic urns and quartz flasks
player->health += UseHealthItems(NormalHealthItems, saveHealth);
if (saveHealth > 0) player->health += UseHealthItems(LargeHealthItems, saveHealth);
}
player->mo->health = player->health;
}
//============================================================================
//
// P_AutoUseStrifeHealth
//
//============================================================================
- version bump to 1.2.0. - fixed: Some of the dynamic light definitions for Hexen's switchable items were not correct. - fixed: Weapon sprites were all drawn fullbright if only one of the layers was set to bright. Update to ZDoom r1456 (2.3.0 plus one additional fix): - Fixed: AActor::SetOrigin must call P_FindFloorCeiling to get the true floor and ceiling heights. Otherwise the actor will fall right through 3DMidtex textures (and 3D-floors.) - Fixed: The TeleporterBeacon tried to enter its See state rather than its Drop state. Also changed it to fade out when it's done rather than disappearing abruptly. - Fixed: Strife's quest based line actions also work in Deathmatch. - Fixed: Gravity application was not correct. For actors with no vertical momentum the initial pull is supposed to be twice as strong as when vertical movement already takes place. - added invquery CCMD like in Strife. Also removed all underscores from the tag strings so that they can be printed properly. - Fixed: Skill baby was missing 'autousehealth' for all games. - Added a new CVAR: sv_disableautohealth - Autouse of health items is no longer hardwired to the default item classes. There's a new property HealthPickup.Autouse. 0 means no autouse, 1 a small Raven health item, 2 a large Raven health item and 3 a Strife item. - Removed an early-out in wallscan_striped() that is invalid when drawing a skybox. - fixed: nextmap and nextsecret CCMDs set skill to 0. - fixed: level.flags2 was not stored in savegames. Also bumped min. savegame version and removed old compatibility handlings. - The SFX Reverb unit is now moved so that it serves as an input to the water effect rather than as an input to the ChannelGroup Target Unit. This means the water effect is now applied after any room reverb, rather than in parallel with it. - Fixed: UI sounds should not have reverb applied to them. - Removed the delay for starting all sounds from one tic at exactly the same DSP position. Without also synchronizing the stopping of sounds, it can cause problems with things like the chainsaw where the sound is stopped and immediately restarted, causing occassional gaps between the stopping of the sound and the starting of the new one. (I added the start synchronization to combat flanging of paired moving polyobjects when moving around, but I think just removing velocity from the player for sound calculations takes care of that well enough.) - Added GCC headers for intptr_t to tarray.h. - Added MF5_PAINLESS flag for projectiles that don't make the target go into the pain state. - Changed DEM_ADDSLOTDEFAULT, DEM_ADDSLOT, and DEM_SETSLOT to be more space- efficient. - Fixed: player->oldbuttons was copied from the current button set at the end of P_PlayerThink(), well before ACS could ever get at it with GetPlayerInput. - Fixed: The map name display on the automap was incomplete. - Added FakeInventory.Respawns DECORATe property - Fixed: Unsetting the MF5_INCONVERSATION flag did not work when quitting the conversation by pressing Escape. - added ML_BLOCKPROJECTILE flag to lines. - Fixed: With opl_onechip set the second OPL chip was never set to anything valid so it contained an invalid pointer. There were also a few other places that simply assumed that the second chip is set to something valid. - Fixed: NPCs which are engaged in a conversation should not move. - Fixed: Player movement animation was not stopped when starting a conversation. - Added selective compression of network packets. Interestingly, most packets don't actually compress all that well, even the ones that aren't too short to possibly compress. (Maybe make the whole thing one long, never-ending zlib data stream with Z_SYNC_FLUSH used to chunk things at packet boundaries? That would probably help the compression ratio, but it would require changing the way the netcode determines sequence, which would be a much more invasive change.) - Fixed: Heretic's fullscreen HUD crashed when the player had armor without a valid icon. - Fixed: The StrifePlayer was missing a RunHealth setting. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@303 b0f79afe-0144-0410-b225-9a4edf0717df
2009-03-01 10:19:26 +00:00
CVAR(Bool, sv_disableautohealth, false, CVAR_ARCHIVE|CVAR_SERVERINFO)
void P_AutoUseStrifeHealth (player_t *player)
{
- version bump to 1.2.0. - fixed: Some of the dynamic light definitions for Hexen's switchable items were not correct. - fixed: Weapon sprites were all drawn fullbright if only one of the layers was set to bright. Update to ZDoom r1456 (2.3.0 plus one additional fix): - Fixed: AActor::SetOrigin must call P_FindFloorCeiling to get the true floor and ceiling heights. Otherwise the actor will fall right through 3DMidtex textures (and 3D-floors.) - Fixed: The TeleporterBeacon tried to enter its See state rather than its Drop state. Also changed it to fade out when it's done rather than disappearing abruptly. - Fixed: Strife's quest based line actions also work in Deathmatch. - Fixed: Gravity application was not correct. For actors with no vertical momentum the initial pull is supposed to be twice as strong as when vertical movement already takes place. - added invquery CCMD like in Strife. Also removed all underscores from the tag strings so that they can be printed properly. - Fixed: Skill baby was missing 'autousehealth' for all games. - Added a new CVAR: sv_disableautohealth - Autouse of health items is no longer hardwired to the default item classes. There's a new property HealthPickup.Autouse. 0 means no autouse, 1 a small Raven health item, 2 a large Raven health item and 3 a Strife item. - Removed an early-out in wallscan_striped() that is invalid when drawing a skybox. - fixed: nextmap and nextsecret CCMDs set skill to 0. - fixed: level.flags2 was not stored in savegames. Also bumped min. savegame version and removed old compatibility handlings. - The SFX Reverb unit is now moved so that it serves as an input to the water effect rather than as an input to the ChannelGroup Target Unit. This means the water effect is now applied after any room reverb, rather than in parallel with it. - Fixed: UI sounds should not have reverb applied to them. - Removed the delay for starting all sounds from one tic at exactly the same DSP position. Without also synchronizing the stopping of sounds, it can cause problems with things like the chainsaw where the sound is stopped and immediately restarted, causing occassional gaps between the stopping of the sound and the starting of the new one. (I added the start synchronization to combat flanging of paired moving polyobjects when moving around, but I think just removing velocity from the player for sound calculations takes care of that well enough.) - Added GCC headers for intptr_t to tarray.h. - Added MF5_PAINLESS flag for projectiles that don't make the target go into the pain state. - Changed DEM_ADDSLOTDEFAULT, DEM_ADDSLOT, and DEM_SETSLOT to be more space- efficient. - Fixed: player->oldbuttons was copied from the current button set at the end of P_PlayerThink(), well before ACS could ever get at it with GetPlayerInput. - Fixed: The map name display on the automap was incomplete. - Added FakeInventory.Respawns DECORATe property - Fixed: Unsetting the MF5_INCONVERSATION flag did not work when quitting the conversation by pressing Escape. - added ML_BLOCKPROJECTILE flag to lines. - Fixed: With opl_onechip set the second OPL chip was never set to anything valid so it contained an invalid pointer. There were also a few other places that simply assumed that the second chip is set to something valid. - Fixed: NPCs which are engaged in a conversation should not move. - Fixed: Player movement animation was not stopped when starting a conversation. - Added selective compression of network packets. Interestingly, most packets don't actually compress all that well, even the ones that aren't too short to possibly compress. (Maybe make the whole thing one long, never-ending zlib data stream with Z_SYNC_FLUSH used to chunk things at packet boundaries? That would probably help the compression ratio, but it would require changing the way the netcode determines sequence, which would be a much more invasive change.) - Fixed: Heretic's fullscreen HUD crashed when the player had armor without a valid icon. - Fixed: The StrifePlayer was missing a RunHealth setting. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@303 b0f79afe-0144-0410-b225-9a4edf0717df
2009-03-01 10:19:26 +00:00
TArray<AInventory *> Items;
- version bump to 1.2.0. - fixed: Some of the dynamic light definitions for Hexen's switchable items were not correct. - fixed: Weapon sprites were all drawn fullbright if only one of the layers was set to bright. Update to ZDoom r1456 (2.3.0 plus one additional fix): - Fixed: AActor::SetOrigin must call P_FindFloorCeiling to get the true floor and ceiling heights. Otherwise the actor will fall right through 3DMidtex textures (and 3D-floors.) - Fixed: The TeleporterBeacon tried to enter its See state rather than its Drop state. Also changed it to fade out when it's done rather than disappearing abruptly. - Fixed: Strife's quest based line actions also work in Deathmatch. - Fixed: Gravity application was not correct. For actors with no vertical momentum the initial pull is supposed to be twice as strong as when vertical movement already takes place. - added invquery CCMD like in Strife. Also removed all underscores from the tag strings so that they can be printed properly. - Fixed: Skill baby was missing 'autousehealth' for all games. - Added a new CVAR: sv_disableautohealth - Autouse of health items is no longer hardwired to the default item classes. There's a new property HealthPickup.Autouse. 0 means no autouse, 1 a small Raven health item, 2 a large Raven health item and 3 a Strife item. - Removed an early-out in wallscan_striped() that is invalid when drawing a skybox. - fixed: nextmap and nextsecret CCMDs set skill to 0. - fixed: level.flags2 was not stored in savegames. Also bumped min. savegame version and removed old compatibility handlings. - The SFX Reverb unit is now moved so that it serves as an input to the water effect rather than as an input to the ChannelGroup Target Unit. This means the water effect is now applied after any room reverb, rather than in parallel with it. - Fixed: UI sounds should not have reverb applied to them. - Removed the delay for starting all sounds from one tic at exactly the same DSP position. Without also synchronizing the stopping of sounds, it can cause problems with things like the chainsaw where the sound is stopped and immediately restarted, causing occassional gaps between the stopping of the sound and the starting of the new one. (I added the start synchronization to combat flanging of paired moving polyobjects when moving around, but I think just removing velocity from the player for sound calculations takes care of that well enough.) - Added GCC headers for intptr_t to tarray.h. - Added MF5_PAINLESS flag for projectiles that don't make the target go into the pain state. - Changed DEM_ADDSLOTDEFAULT, DEM_ADDSLOT, and DEM_SETSLOT to be more space- efficient. - Fixed: player->oldbuttons was copied from the current button set at the end of P_PlayerThink(), well before ACS could ever get at it with GetPlayerInput. - Fixed: The map name display on the automap was incomplete. - Added FakeInventory.Respawns DECORATe property - Fixed: Unsetting the MF5_INCONVERSATION flag did not work when quitting the conversation by pressing Escape. - added ML_BLOCKPROJECTILE flag to lines. - Fixed: With opl_onechip set the second OPL chip was never set to anything valid so it contained an invalid pointer. There were also a few other places that simply assumed that the second chip is set to something valid. - Fixed: NPCs which are engaged in a conversation should not move. - Fixed: Player movement animation was not stopped when starting a conversation. - Added selective compression of network packets. Interestingly, most packets don't actually compress all that well, even the ones that aren't too short to possibly compress. (Maybe make the whole thing one long, never-ending zlib data stream with Z_SYNC_FLUSH used to chunk things at packet boundaries? That would probably help the compression ratio, but it would require changing the way the netcode determines sequence, which would be a much more invasive change.) - Fixed: Heretic's fullscreen HUD crashed when the player had armor without a valid icon. - Fixed: The StrifePlayer was missing a RunHealth setting. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@303 b0f79afe-0144-0410-b225-9a4edf0717df
2009-03-01 10:19:26 +00:00
for(AInventory *inv = player->mo->Inventory; inv != NULL; inv = inv->Inventory)
{
- version bump to 1.2.0. - fixed: Some of the dynamic light definitions for Hexen's switchable items were not correct. - fixed: Weapon sprites were all drawn fullbright if only one of the layers was set to bright. Update to ZDoom r1456 (2.3.0 plus one additional fix): - Fixed: AActor::SetOrigin must call P_FindFloorCeiling to get the true floor and ceiling heights. Otherwise the actor will fall right through 3DMidtex textures (and 3D-floors.) - Fixed: The TeleporterBeacon tried to enter its See state rather than its Drop state. Also changed it to fade out when it's done rather than disappearing abruptly. - Fixed: Strife's quest based line actions also work in Deathmatch. - Fixed: Gravity application was not correct. For actors with no vertical momentum the initial pull is supposed to be twice as strong as when vertical movement already takes place. - added invquery CCMD like in Strife. Also removed all underscores from the tag strings so that they can be printed properly. - Fixed: Skill baby was missing 'autousehealth' for all games. - Added a new CVAR: sv_disableautohealth - Autouse of health items is no longer hardwired to the default item classes. There's a new property HealthPickup.Autouse. 0 means no autouse, 1 a small Raven health item, 2 a large Raven health item and 3 a Strife item. - Removed an early-out in wallscan_striped() that is invalid when drawing a skybox. - fixed: nextmap and nextsecret CCMDs set skill to 0. - fixed: level.flags2 was not stored in savegames. Also bumped min. savegame version and removed old compatibility handlings. - The SFX Reverb unit is now moved so that it serves as an input to the water effect rather than as an input to the ChannelGroup Target Unit. This means the water effect is now applied after any room reverb, rather than in parallel with it. - Fixed: UI sounds should not have reverb applied to them. - Removed the delay for starting all sounds from one tic at exactly the same DSP position. Without also synchronizing the stopping of sounds, it can cause problems with things like the chainsaw where the sound is stopped and immediately restarted, causing occassional gaps between the stopping of the sound and the starting of the new one. (I added the start synchronization to combat flanging of paired moving polyobjects when moving around, but I think just removing velocity from the player for sound calculations takes care of that well enough.) - Added GCC headers for intptr_t to tarray.h. - Added MF5_PAINLESS flag for projectiles that don't make the target go into the pain state. - Changed DEM_ADDSLOTDEFAULT, DEM_ADDSLOT, and DEM_SETSLOT to be more space- efficient. - Fixed: player->oldbuttons was copied from the current button set at the end of P_PlayerThink(), well before ACS could ever get at it with GetPlayerInput. - Fixed: The map name display on the automap was incomplete. - Added FakeInventory.Respawns DECORATe property - Fixed: Unsetting the MF5_INCONVERSATION flag did not work when quitting the conversation by pressing Escape. - added ML_BLOCKPROJECTILE flag to lines. - Fixed: With opl_onechip set the second OPL chip was never set to anything valid so it contained an invalid pointer. There were also a few other places that simply assumed that the second chip is set to something valid. - Fixed: NPCs which are engaged in a conversation should not move. - Fixed: Player movement animation was not stopped when starting a conversation. - Added selective compression of network packets. Interestingly, most packets don't actually compress all that well, even the ones that aren't too short to possibly compress. (Maybe make the whole thing one long, never-ending zlib data stream with Z_SYNC_FLUSH used to chunk things at packet boundaries? That would probably help the compression ratio, but it would require changing the way the netcode determines sequence, which would be a much more invasive change.) - Fixed: Heretic's fullscreen HUD crashed when the player had armor without a valid icon. - Fixed: The StrifePlayer was missing a RunHealth setting. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@303 b0f79afe-0144-0410-b225-9a4edf0717df
2009-03-01 10:19:26 +00:00
if (inv->Amount > 0 && inv->IsKindOf(RUNTIME_CLASS(AHealthPickup)))
{
int mode = static_cast<AHealthPickup*>(inv)->autousemode;
- version bump to 1.2.0. - fixed: Some of the dynamic light definitions for Hexen's switchable items were not correct. - fixed: Weapon sprites were all drawn fullbright if only one of the layers was set to bright. Update to ZDoom r1456 (2.3.0 plus one additional fix): - Fixed: AActor::SetOrigin must call P_FindFloorCeiling to get the true floor and ceiling heights. Otherwise the actor will fall right through 3DMidtex textures (and 3D-floors.) - Fixed: The TeleporterBeacon tried to enter its See state rather than its Drop state. Also changed it to fade out when it's done rather than disappearing abruptly. - Fixed: Strife's quest based line actions also work in Deathmatch. - Fixed: Gravity application was not correct. For actors with no vertical momentum the initial pull is supposed to be twice as strong as when vertical movement already takes place. - added invquery CCMD like in Strife. Also removed all underscores from the tag strings so that they can be printed properly. - Fixed: Skill baby was missing 'autousehealth' for all games. - Added a new CVAR: sv_disableautohealth - Autouse of health items is no longer hardwired to the default item classes. There's a new property HealthPickup.Autouse. 0 means no autouse, 1 a small Raven health item, 2 a large Raven health item and 3 a Strife item. - Removed an early-out in wallscan_striped() that is invalid when drawing a skybox. - fixed: nextmap and nextsecret CCMDs set skill to 0. - fixed: level.flags2 was not stored in savegames. Also bumped min. savegame version and removed old compatibility handlings. - The SFX Reverb unit is now moved so that it serves as an input to the water effect rather than as an input to the ChannelGroup Target Unit. This means the water effect is now applied after any room reverb, rather than in parallel with it. - Fixed: UI sounds should not have reverb applied to them. - Removed the delay for starting all sounds from one tic at exactly the same DSP position. Without also synchronizing the stopping of sounds, it can cause problems with things like the chainsaw where the sound is stopped and immediately restarted, causing occassional gaps between the stopping of the sound and the starting of the new one. (I added the start synchronization to combat flanging of paired moving polyobjects when moving around, but I think just removing velocity from the player for sound calculations takes care of that well enough.) - Added GCC headers for intptr_t to tarray.h. - Added MF5_PAINLESS flag for projectiles that don't make the target go into the pain state. - Changed DEM_ADDSLOTDEFAULT, DEM_ADDSLOT, and DEM_SETSLOT to be more space- efficient. - Fixed: player->oldbuttons was copied from the current button set at the end of P_PlayerThink(), well before ACS could ever get at it with GetPlayerInput. - Fixed: The map name display on the automap was incomplete. - Added FakeInventory.Respawns DECORATe property - Fixed: Unsetting the MF5_INCONVERSATION flag did not work when quitting the conversation by pressing Escape. - added ML_BLOCKPROJECTILE flag to lines. - Fixed: With opl_onechip set the second OPL chip was never set to anything valid so it contained an invalid pointer. There were also a few other places that simply assumed that the second chip is set to something valid. - Fixed: NPCs which are engaged in a conversation should not move. - Fixed: Player movement animation was not stopped when starting a conversation. - Added selective compression of network packets. Interestingly, most packets don't actually compress all that well, even the ones that aren't too short to possibly compress. (Maybe make the whole thing one long, never-ending zlib data stream with Z_SYNC_FLUSH used to chunk things at packet boundaries? That would probably help the compression ratio, but it would require changing the way the netcode determines sequence, which would be a much more invasive change.) - Fixed: Heretic's fullscreen HUD crashed when the player had armor without a valid icon. - Fixed: The StrifePlayer was missing a RunHealth setting. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@303 b0f79afe-0144-0410-b225-9a4edf0717df
2009-03-01 10:19:26 +00:00
if (mode == 3) Items.Push(inv);
}
}
if (!sv_disableautohealth)
{
while (Items.Size() > 0)
{
- version bump to 1.2.0. - fixed: Some of the dynamic light definitions for Hexen's switchable items were not correct. - fixed: Weapon sprites were all drawn fullbright if only one of the layers was set to bright. Update to ZDoom r1456 (2.3.0 plus one additional fix): - Fixed: AActor::SetOrigin must call P_FindFloorCeiling to get the true floor and ceiling heights. Otherwise the actor will fall right through 3DMidtex textures (and 3D-floors.) - Fixed: The TeleporterBeacon tried to enter its See state rather than its Drop state. Also changed it to fade out when it's done rather than disappearing abruptly. - Fixed: Strife's quest based line actions also work in Deathmatch. - Fixed: Gravity application was not correct. For actors with no vertical momentum the initial pull is supposed to be twice as strong as when vertical movement already takes place. - added invquery CCMD like in Strife. Also removed all underscores from the tag strings so that they can be printed properly. - Fixed: Skill baby was missing 'autousehealth' for all games. - Added a new CVAR: sv_disableautohealth - Autouse of health items is no longer hardwired to the default item classes. There's a new property HealthPickup.Autouse. 0 means no autouse, 1 a small Raven health item, 2 a large Raven health item and 3 a Strife item. - Removed an early-out in wallscan_striped() that is invalid when drawing a skybox. - fixed: nextmap and nextsecret CCMDs set skill to 0. - fixed: level.flags2 was not stored in savegames. Also bumped min. savegame version and removed old compatibility handlings. - The SFX Reverb unit is now moved so that it serves as an input to the water effect rather than as an input to the ChannelGroup Target Unit. This means the water effect is now applied after any room reverb, rather than in parallel with it. - Fixed: UI sounds should not have reverb applied to them. - Removed the delay for starting all sounds from one tic at exactly the same DSP position. Without also synchronizing the stopping of sounds, it can cause problems with things like the chainsaw where the sound is stopped and immediately restarted, causing occassional gaps between the stopping of the sound and the starting of the new one. (I added the start synchronization to combat flanging of paired moving polyobjects when moving around, but I think just removing velocity from the player for sound calculations takes care of that well enough.) - Added GCC headers for intptr_t to tarray.h. - Added MF5_PAINLESS flag for projectiles that don't make the target go into the pain state. - Changed DEM_ADDSLOTDEFAULT, DEM_ADDSLOT, and DEM_SETSLOT to be more space- efficient. - Fixed: player->oldbuttons was copied from the current button set at the end of P_PlayerThink(), well before ACS could ever get at it with GetPlayerInput. - Fixed: The map name display on the automap was incomplete. - Added FakeInventory.Respawns DECORATe property - Fixed: Unsetting the MF5_INCONVERSATION flag did not work when quitting the conversation by pressing Escape. - added ML_BLOCKPROJECTILE flag to lines. - Fixed: With opl_onechip set the second OPL chip was never set to anything valid so it contained an invalid pointer. There were also a few other places that simply assumed that the second chip is set to something valid. - Fixed: NPCs which are engaged in a conversation should not move. - Fixed: Player movement animation was not stopped when starting a conversation. - Added selective compression of network packets. Interestingly, most packets don't actually compress all that well, even the ones that aren't too short to possibly compress. (Maybe make the whole thing one long, never-ending zlib data stream with Z_SYNC_FLUSH used to chunk things at packet boundaries? That would probably help the compression ratio, but it would require changing the way the netcode determines sequence, which would be a much more invasive change.) - Fixed: Heretic's fullscreen HUD crashed when the player had armor without a valid icon. - Fixed: The StrifePlayer was missing a RunHealth setting. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@303 b0f79afe-0144-0410-b225-9a4edf0717df
2009-03-01 10:19:26 +00:00
int maxhealth = 0;
int index = -1;
// Find the largest item in the list
for(unsigned i = 0; i < Items.Size(); i++)
{
if (Items[i]->health > maxhealth)
{
index = i;
maxhealth = Items[i]->Amount;
}
}
while (player->health < 50)
{
if (!player->mo->UseInventory (Items[index]))
break;
}
if (player->health >= 50) return;
// Using all of this item was not enough so delete it and restart with the next best one
Items.Delete(index);
}
}
}
/*
=================
=
= P_DamageMobj
=
= Damages both enemies and players
= inflictor is the thing that caused the damage
= creature or missile, can be NULL (slime, etc)
= source is the thing to target after taking damage
= creature or NULL
= Source and inflictor are the same for melee attacks
= source can be null for barrel explosions and other environmental stuff
==================
*/
void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage, FName mod, int flags)
{
unsigned ang;
Update to ZDoom r1616: - Removed HaveFocus variable in preference of using GetForegroundWindow(). - Added Raw Input keyboard handling. - Split DirectInput keyboard handling into a separate file and class. I also switched it to buffered input, and the pause key seems to be properly cooked, so I don't need to look for it with WM_KEYDOWN/UP. Tab doesn't need to be special-cased either, because buffered input never passes on the Tab key when you press Alt+Tab. I have no idea why I special-cased Num Lock, but it seems to be working fine. By setting the exclusive mode to background, I can also avoid special code for releasing all keys when the window loses focus, because I'll still receive those events while the window is in the background. - Fixed: The Heretic "take weapons" cheat did not remove all the weapons at once. This is because destroying one weapon has a potential to destroy a sister weapon as well. If the sister weapon is the next one in line (as it typically is), it would process that one, not realizing it was no longer part of the inventory, and stop because its Inventory link was NULL. - Recoverable errors that are caught during the demo loop no longer shut off the menu. - Specifying non-existent directories with -savedir or the save_dir cvar now attempts to create them. - I_CheckNativeMouse() now checks the foreground window to determine if the mouse should be grabbed. This fixes the case where you start the game in the background and it grabs the mouse anyway. - Changed raw mouse grabbing to call ShowCursor() directly instead of through SetCursorState(), since changing the pointer isn't working with it (probably due to the lack of legacy mouse messages), and the others work fine by setting an invisible cursor. - Fixed: Raw mouse input passes wheel movements in an unsigned field, but the value is signed, so it requires a cast to use it. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@333 b0f79afe-0144-0410-b225-9a4edf0717df
2009-05-27 22:16:34 +00:00
player_t *player = NULL;
fixed_t thrust;
int temp;
int painchance = 0;
FState * woundstate = NULL;
PainChanceList * pc = NULL;
Update to ZDoom r1848: - Fixed: The deprecated flag handler for the old bounce flags needs to clear BOUNCE_MBF and BOUNCE_UseSeeSound, too, when clearing one of these flags. - Fixed: When adding the AVOIDMELEE code the code was accidentally changed so that friendly monsters could no longer acquire targets by themselves. - Renamed WIF_BOT_MELEE to WIF_MELEEWEAPON because it's no longer a bot only flag. - Added MBF's monster_backing feature as an actor flag: AVOIDMELEE. - Gez's misc. bugs patch: * Moves the dog sound out of the Doom-specific sounds in SNDINFO to address this, * Renames the dog actor to MBFHelperDog to prevent name conflicts, * Adds APROP_Score to CheckActorProperty, * Completes the randomspawner update (the reason I moved the recursion counter out of special1 was that I found some projectiles had this set to them, for example in A_LichAttack, but I forgot to add transfer for them), * Provides centered sprites for beta plasma balls if this is deemed deserving correction. - Added some pieces of MBF's friendly AI. - Cleaned up A_LookEx code and merged most of it with the base functions. The major difference was a common piece of code that was repeated 5 times throughout the code so I moved it into a subfunction. - Changed P_BlockmapSearch to pass a user parameter to its callback so that A_LookEx does not need to store its info inside the actor itself. - fixed: The linetarget CCMD duplicated all of the info CCMD. - fixed: PrintActorInfo crashed due to some incomplete implementation. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@458 b0f79afe-0144-0410-b225-9a4edf0717df
2009-09-16 21:17:17 +00:00
bool justhit = false;
Update to ZDoom r1831: fixed: The Dehacked flags parser fix from May 31 (r1624) was undone by yesterday's additions. Changed it so that the parser first checks for the presence of a '-' sign before deciding whether to use strtol or strtoul to convert the string into a number. - Added PinkSilver's A_LookEx fix. - added resources needed for MBF support. - removed unused score items from DECORATE file. - Fixed: Argument count for UsePuzzleItem was wrong. - Added a few things from Gez's experimental build: * MBF Dehacked emulation but removed the COMPATF_MBFDEHACKED flag because it wouldn't work and is more or less useless anyway. * MBF's dog (definition only, no sprites yet.) * User variables. There's an array of 10. They can be set and checked in both DECORATE and ACS. * Made the tag name changeable but eliminated the redundancy of having both the meta property and the individual actor's one. Having one is fully sufficient. TO BE FIXED: Names are case insensitive but this should better be case sensitive. Unfortunately there's currently nothing better than FName to store a string inside an actor without severely complicating matters. Also bumped savegame version to avoid problems with this change. * MBF grenade and bouncing code. * several compatibility options. * info CCMD to print extended actor information (not fully implemented yet) * summonmbf CCMD. * Beta BFG code pointer (but not the related missiles yet.) * PowerInvisibility enhancements. * ScoreItem with one significant change: Added a score variable that can be checked through ACS and DECORATE. The engine itself will do nothing with it. * Nailgun option for A_Explode. * A_PrintBold and A_Log. * A_SetSpecial. * Beta Lost Soul (added DoomEdNum 9037 to it) * A_Mushroom extensions * Vavoom compatible MAPINFO keynames. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@452 b0f79afe-0144-0410-b225-9a4edf0717df
2009-09-15 06:19:39 +00:00
if (target == NULL || !((target->flags & MF_SHOOTABLE) || (target->flags6 & MF6_VULNERABLE)))
{ // Shouldn't happen
return;
}
// Spectral targets only take damage from spectral projectiles.
Update to ZDoom r1757: - Added player MugShotMaxHealth property. Negative values use the player's max health as the mug shot max health, zero uses 100 as the mug shot max health, and positive values used directly as the mug shot max health. - Added buddha cheat. - Added TELEFRAG_DAMAGE constant, and changed the two places that still used 1000 as the threshold for god mode damage to use it instead. (Players with MF2_INVULNERABLE set already used 1000000 as their threshold.) - Added MF6_NOTELEFRAG flag. - Fixed: M_QuitResponse() tried to play a sound even when none was specified in the gameinfo. - Added Yes/No selections for Y/N messages so that you can answer them entirely with a joystick. - Fixed: Starting the menu at the title screen with a key other than Escape left the top level menu out of the menu stack. - Changed the save menu so that cancelling input of a new save name only deactivates that control and does not completely close the menus. - Fixed "any key" messages to override input to menus hidden beneath them and to work with joysticks. - Removed the input parameter from M_StartMessage and the corresponding messageNeedsInput global, because it was redundant. Any messages that want a Y/N response also supply a callback, and messages that don't care which key you press don't supply a callback. - Changed MKEY_Back so that it cancels out of text entry fields before backing to the previous menu, which it already did for the keyboard. - Changed the menu responder so that key downs always produce results, regardless of whether or not an equivalent key is already down. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@412 b0f79afe-0144-0410-b225-9a4edf0717df
2009-08-07 19:34:42 +00:00
if (target->flags4 & MF4_SPECTRAL && damage < TELEFRAG_DAMAGE)
{
if (inflictor == NULL || !(inflictor->flags4 & MF4_SPECTRAL))
{
return;
}
}
if (target->health <= 0)
{
if (inflictor && mod == NAME_Ice)
{
return;
}
else if (target->flags & MF_ICECORPSE) // frozen
{
target->tics = 1;
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
target->velx = target->vely = target->velz = 0;
}
return;
}
Update to ZDoom r1757: - Added player MugShotMaxHealth property. Negative values use the player's max health as the mug shot max health, zero uses 100 as the mug shot max health, and positive values used directly as the mug shot max health. - Added buddha cheat. - Added TELEFRAG_DAMAGE constant, and changed the two places that still used 1000 as the threshold for god mode damage to use it instead. (Players with MF2_INVULNERABLE set already used 1000000 as their threshold.) - Added MF6_NOTELEFRAG flag. - Fixed: M_QuitResponse() tried to play a sound even when none was specified in the gameinfo. - Added Yes/No selections for Y/N messages so that you can answer them entirely with a joystick. - Fixed: Starting the menu at the title screen with a key other than Escape left the top level menu out of the menu stack. - Changed the save menu so that cancelling input of a new save name only deactivates that control and does not completely close the menus. - Fixed "any key" messages to override input to menus hidden beneath them and to work with joysticks. - Removed the input parameter from M_StartMessage and the corresponding messageNeedsInput global, because it was redundant. Any messages that want a Y/N response also supply a callback, and messages that don't care which key you press don't supply a callback. - Changed MKEY_Back so that it cancels out of text entry fields before backing to the previous menu, which it already did for the keyboard. - Changed the menu responder so that key downs always produce results, regardless of whether or not an equivalent key is already down. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@412 b0f79afe-0144-0410-b225-9a4edf0717df
2009-08-07 19:34:42 +00:00
if ((target->flags2 & MF2_INVULNERABLE) && damage < TELEFRAG_DAMAGE && !(flags & DMG_FORCED))
{ // actor is invulnerable
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
if (target->player == NULL)
{
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
if (inflictor == NULL || !(inflictor->flags3 & MF3_FOILINVUL))
{
return;
}
}
else
{
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
// Players are optionally excluded from getting thrust by damage.
if (static_cast<APlayerPawn *>(target)->PlayerFlags & PPF_NOTHRUSTWHENINVUL)
{
return;
}
}
}
if (inflictor != NULL)
{
if (inflictor->flags5 & MF5_PIERCEARMOR) flags |= DMG_NO_ARMOR;
}
MeansOfDeath = mod;
FriendlyFire = false;
// [RH] Andy Baker's Stealth monsters
if (target->flags & MF_STEALTH)
{
target->alpha = OPAQUE;
target->visdir = -1;
}
if (target->flags & MF_SKULLFLY)
{
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
target->velx = target->vely = target->velz = 0;
}
Update to ZDoom r1600: - Fixed: When setting up a deep water sector with Transfer_Heights the floorclip information of all actors in the sector needs to be updated. - Fixed: A_CountdownArg and A_Die must ensure a certain kill. - Fixed: When using Win32 mouse, windowed mode, alt-tabbing away and then clicking on the window's title bar moved it practically off the screen. - Beginnings of i_input.cpp rewrite: Win32 and DirectInput mouse handling has been moved into classes. - Changed bounce flags into a property and added real bouncing sound properties. Compatibility modes to preserve use of the SeeSound are present and the old flags map to these. - Fixed: The SBARINFO parser compared an FString in the GAMEINFO with a NULL pointer and tried to load a lump with an empty name as statusbar script for non-Doom games. - Fixed: SetSoundPaused() still needs to call S_PauseSound() to pause music that isn't piped through the digital sound system. (Was removed in r1004.) - Added input buffering to the Implode and Shrink routines for a marked speedup. - Replaced the Shanno-Fano/Huffman reading routines from FZipExploder with ones of my own devising, based solely on the specs in the APPNOTE. - Found a copy of PKZIP 1.1 and verified that Implode support works with files that use a literal table and 8k dictionary, and that the just-added Shrink support works at all. - Replaced the bit-at-a-time Shannon-Fano decoder from GunZip.c64 with the word-at-a-time one from 7-Zip for a slight speedup when working with Imploded files. - Fixed: Monsters should not check the inventory for damage absorbtion when they have the MF5_NODAMAGE flag set. - Added patch for saving automap zoom. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@328 b0f79afe-0144-0410-b225-9a4edf0717df
2009-05-23 10:24:33 +00:00
if (!(flags & DMG_FORCED)) // DMG_FORCED skips all special damage checks
{
Update to ZDoom r1600: - Fixed: When setting up a deep water sector with Transfer_Heights the floorclip information of all actors in the sector needs to be updated. - Fixed: A_CountdownArg and A_Die must ensure a certain kill. - Fixed: When using Win32 mouse, windowed mode, alt-tabbing away and then clicking on the window's title bar moved it practically off the screen. - Beginnings of i_input.cpp rewrite: Win32 and DirectInput mouse handling has been moved into classes. - Changed bounce flags into a property and added real bouncing sound properties. Compatibility modes to preserve use of the SeeSound are present and the old flags map to these. - Fixed: The SBARINFO parser compared an FString in the GAMEINFO with a NULL pointer and tried to load a lump with an empty name as statusbar script for non-Doom games. - Fixed: SetSoundPaused() still needs to call S_PauseSound() to pause music that isn't piped through the digital sound system. (Was removed in r1004.) - Added input buffering to the Implode and Shrink routines for a marked speedup. - Replaced the Shanno-Fano/Huffman reading routines from FZipExploder with ones of my own devising, based solely on the specs in the APPNOTE. - Found a copy of PKZIP 1.1 and verified that Implode support works with files that use a literal table and 8k dictionary, and that the just-added Shrink support works at all. - Replaced the bit-at-a-time Shannon-Fano decoder from GunZip.c64 with the word-at-a-time one from 7-Zip for a slight speedup when working with Imploded files. - Fixed: Monsters should not check the inventory for damage absorbtion when they have the MF5_NODAMAGE flag set. - Added patch for saving automap zoom. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@328 b0f79afe-0144-0410-b225-9a4edf0717df
2009-05-23 10:24:33 +00:00
if (target->flags2 & MF2_DORMANT)
{
// Invulnerable, and won't wake up
return;
}
player = target->player;
if (player && damage > 1)
{
Update to ZDoom r1600: - Fixed: When setting up a deep water sector with Transfer_Heights the floorclip information of all actors in the sector needs to be updated. - Fixed: A_CountdownArg and A_Die must ensure a certain kill. - Fixed: When using Win32 mouse, windowed mode, alt-tabbing away and then clicking on the window's title bar moved it practically off the screen. - Beginnings of i_input.cpp rewrite: Win32 and DirectInput mouse handling has been moved into classes. - Changed bounce flags into a property and added real bouncing sound properties. Compatibility modes to preserve use of the SeeSound are present and the old flags map to these. - Fixed: The SBARINFO parser compared an FString in the GAMEINFO with a NULL pointer and tried to load a lump with an empty name as statusbar script for non-Doom games. - Fixed: SetSoundPaused() still needs to call S_PauseSound() to pause music that isn't piped through the digital sound system. (Was removed in r1004.) - Added input buffering to the Implode and Shrink routines for a marked speedup. - Replaced the Shanno-Fano/Huffman reading routines from FZipExploder with ones of my own devising, based solely on the specs in the APPNOTE. - Found a copy of PKZIP 1.1 and verified that Implode support works with files that use a literal table and 8k dictionary, and that the just-added Shrink support works at all. - Replaced the bit-at-a-time Shannon-Fano decoder from GunZip.c64 with the word-at-a-time one from 7-Zip for a slight speedup when working with Imploded files. - Fixed: Monsters should not check the inventory for damage absorbtion when they have the MF5_NODAMAGE flag set. - Added patch for saving automap zoom. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@328 b0f79afe-0144-0410-b225-9a4edf0717df
2009-05-23 10:24:33 +00:00
// Take half damage in trainer mode
damage = FixedMul(damage, G_SkillProperty(SKILLP_DamageFactor));
}
// Special damage types
if (inflictor)
{
if (inflictor->flags4 & MF4_SPECTRAL)
{
Update to ZDoom r1600: - Fixed: When setting up a deep water sector with Transfer_Heights the floorclip information of all actors in the sector needs to be updated. - Fixed: A_CountdownArg and A_Die must ensure a certain kill. - Fixed: When using Win32 mouse, windowed mode, alt-tabbing away and then clicking on the window's title bar moved it practically off the screen. - Beginnings of i_input.cpp rewrite: Win32 and DirectInput mouse handling has been moved into classes. - Changed bounce flags into a property and added real bouncing sound properties. Compatibility modes to preserve use of the SeeSound are present and the old flags map to these. - Fixed: The SBARINFO parser compared an FString in the GAMEINFO with a NULL pointer and tried to load a lump with an empty name as statusbar script for non-Doom games. - Fixed: SetSoundPaused() still needs to call S_PauseSound() to pause music that isn't piped through the digital sound system. (Was removed in r1004.) - Added input buffering to the Implode and Shrink routines for a marked speedup. - Replaced the Shanno-Fano/Huffman reading routines from FZipExploder with ones of my own devising, based solely on the specs in the APPNOTE. - Found a copy of PKZIP 1.1 and verified that Implode support works with files that use a literal table and 8k dictionary, and that the just-added Shrink support works at all. - Replaced the bit-at-a-time Shannon-Fano decoder from GunZip.c64 with the word-at-a-time one from 7-Zip for a slight speedup when working with Imploded files. - Fixed: Monsters should not check the inventory for damage absorbtion when they have the MF5_NODAMAGE flag set. - Added patch for saving automap zoom. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@328 b0f79afe-0144-0410-b225-9a4edf0717df
2009-05-23 10:24:33 +00:00
if (player != NULL)
{
if (!deathmatch && inflictor->health == -1)
return;
}
else if (target->flags4 & MF4_SPECTRAL)
{
if (inflictor->health == -2 && !target->IsHostile(inflictor))
return;
}
}
Update to ZDoom r1600: - Fixed: When setting up a deep water sector with Transfer_Heights the floorclip information of all actors in the sector needs to be updated. - Fixed: A_CountdownArg and A_Die must ensure a certain kill. - Fixed: When using Win32 mouse, windowed mode, alt-tabbing away and then clicking on the window's title bar moved it practically off the screen. - Beginnings of i_input.cpp rewrite: Win32 and DirectInput mouse handling has been moved into classes. - Changed bounce flags into a property and added real bouncing sound properties. Compatibility modes to preserve use of the SeeSound are present and the old flags map to these. - Fixed: The SBARINFO parser compared an FString in the GAMEINFO with a NULL pointer and tried to load a lump with an empty name as statusbar script for non-Doom games. - Fixed: SetSoundPaused() still needs to call S_PauseSound() to pause music that isn't piped through the digital sound system. (Was removed in r1004.) - Added input buffering to the Implode and Shrink routines for a marked speedup. - Replaced the Shanno-Fano/Huffman reading routines from FZipExploder with ones of my own devising, based solely on the specs in the APPNOTE. - Found a copy of PKZIP 1.1 and verified that Implode support works with files that use a literal table and 8k dictionary, and that the just-added Shrink support works at all. - Replaced the bit-at-a-time Shannon-Fano decoder from GunZip.c64 with the word-at-a-time one from 7-Zip for a slight speedup when working with Imploded files. - Fixed: Monsters should not check the inventory for damage absorbtion when they have the MF5_NODAMAGE flag set. - Added patch for saving automap zoom. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@328 b0f79afe-0144-0410-b225-9a4edf0717df
2009-05-23 10:24:33 +00:00
damage = inflictor->DoSpecialDamage (target, damage);
if (damage == -1)
{
Update to ZDoom r1600: - Fixed: When setting up a deep water sector with Transfer_Heights the floorclip information of all actors in the sector needs to be updated. - Fixed: A_CountdownArg and A_Die must ensure a certain kill. - Fixed: When using Win32 mouse, windowed mode, alt-tabbing away and then clicking on the window's title bar moved it practically off the screen. - Beginnings of i_input.cpp rewrite: Win32 and DirectInput mouse handling has been moved into classes. - Changed bounce flags into a property and added real bouncing sound properties. Compatibility modes to preserve use of the SeeSound are present and the old flags map to these. - Fixed: The SBARINFO parser compared an FString in the GAMEINFO with a NULL pointer and tried to load a lump with an empty name as statusbar script for non-Doom games. - Fixed: SetSoundPaused() still needs to call S_PauseSound() to pause music that isn't piped through the digital sound system. (Was removed in r1004.) - Added input buffering to the Implode and Shrink routines for a marked speedup. - Replaced the Shanno-Fano/Huffman reading routines from FZipExploder with ones of my own devising, based solely on the specs in the APPNOTE. - Found a copy of PKZIP 1.1 and verified that Implode support works with files that use a literal table and 8k dictionary, and that the just-added Shrink support works at all. - Replaced the bit-at-a-time Shannon-Fano decoder from GunZip.c64 with the word-at-a-time one from 7-Zip for a slight speedup when working with Imploded files. - Fixed: Monsters should not check the inventory for damage absorbtion when they have the MF5_NODAMAGE flag set. - Added patch for saving automap zoom. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@328 b0f79afe-0144-0410-b225-9a4edf0717df
2009-05-23 10:24:33 +00:00
return;
}
Update to ZDoom r1600: - Fixed: When setting up a deep water sector with Transfer_Heights the floorclip information of all actors in the sector needs to be updated. - Fixed: A_CountdownArg and A_Die must ensure a certain kill. - Fixed: When using Win32 mouse, windowed mode, alt-tabbing away and then clicking on the window's title bar moved it practically off the screen. - Beginnings of i_input.cpp rewrite: Win32 and DirectInput mouse handling has been moved into classes. - Changed bounce flags into a property and added real bouncing sound properties. Compatibility modes to preserve use of the SeeSound are present and the old flags map to these. - Fixed: The SBARINFO parser compared an FString in the GAMEINFO with a NULL pointer and tried to load a lump with an empty name as statusbar script for non-Doom games. - Fixed: SetSoundPaused() still needs to call S_PauseSound() to pause music that isn't piped through the digital sound system. (Was removed in r1004.) - Added input buffering to the Implode and Shrink routines for a marked speedup. - Replaced the Shanno-Fano/Huffman reading routines from FZipExploder with ones of my own devising, based solely on the specs in the APPNOTE. - Found a copy of PKZIP 1.1 and verified that Implode support works with files that use a literal table and 8k dictionary, and that the just-added Shrink support works at all. - Replaced the bit-at-a-time Shannon-Fano decoder from GunZip.c64 with the word-at-a-time one from 7-Zip for a slight speedup when working with Imploded files. - Fixed: Monsters should not check the inventory for damage absorbtion when they have the MF5_NODAMAGE flag set. - Added patch for saving automap zoom. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@328 b0f79afe-0144-0410-b225-9a4edf0717df
2009-05-23 10:24:33 +00:00
}
// Handle active damage modifiers (e.g. PowerDamage)
if (source != NULL && source->Inventory != NULL)
{
Update to ZDoom r1600: - Fixed: When setting up a deep water sector with Transfer_Heights the floorclip information of all actors in the sector needs to be updated. - Fixed: A_CountdownArg and A_Die must ensure a certain kill. - Fixed: When using Win32 mouse, windowed mode, alt-tabbing away and then clicking on the window's title bar moved it practically off the screen. - Beginnings of i_input.cpp rewrite: Win32 and DirectInput mouse handling has been moved into classes. - Changed bounce flags into a property and added real bouncing sound properties. Compatibility modes to preserve use of the SeeSound are present and the old flags map to these. - Fixed: The SBARINFO parser compared an FString in the GAMEINFO with a NULL pointer and tried to load a lump with an empty name as statusbar script for non-Doom games. - Fixed: SetSoundPaused() still needs to call S_PauseSound() to pause music that isn't piped through the digital sound system. (Was removed in r1004.) - Added input buffering to the Implode and Shrink routines for a marked speedup. - Replaced the Shanno-Fano/Huffman reading routines from FZipExploder with ones of my own devising, based solely on the specs in the APPNOTE. - Found a copy of PKZIP 1.1 and verified that Implode support works with files that use a literal table and 8k dictionary, and that the just-added Shrink support works at all. - Replaced the bit-at-a-time Shannon-Fano decoder from GunZip.c64 with the word-at-a-time one from 7-Zip for a slight speedup when working with Imploded files. - Fixed: Monsters should not check the inventory for damage absorbtion when they have the MF5_NODAMAGE flag set. - Added patch for saving automap zoom. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@328 b0f79afe-0144-0410-b225-9a4edf0717df
2009-05-23 10:24:33 +00:00
int olddam = damage;
source->Inventory->ModifyDamage(olddam, mod, damage, false);
if (olddam != damage && damage <= 0) return;
}
// Handle passive damage modifiers (e.g. PowerProtection)
if (target->Inventory != NULL)
{
int olddam = damage;
target->Inventory->ModifyDamage(olddam, mod, damage, true);
if (olddam != damage && damage <= 0) return;
}
Update to ZDoom r1600: - Fixed: When setting up a deep water sector with Transfer_Heights the floorclip information of all actors in the sector needs to be updated. - Fixed: A_CountdownArg and A_Die must ensure a certain kill. - Fixed: When using Win32 mouse, windowed mode, alt-tabbing away and then clicking on the window's title bar moved it practically off the screen. - Beginnings of i_input.cpp rewrite: Win32 and DirectInput mouse handling has been moved into classes. - Changed bounce flags into a property and added real bouncing sound properties. Compatibility modes to preserve use of the SeeSound are present and the old flags map to these. - Fixed: The SBARINFO parser compared an FString in the GAMEINFO with a NULL pointer and tried to load a lump with an empty name as statusbar script for non-Doom games. - Fixed: SetSoundPaused() still needs to call S_PauseSound() to pause music that isn't piped through the digital sound system. (Was removed in r1004.) - Added input buffering to the Implode and Shrink routines for a marked speedup. - Replaced the Shanno-Fano/Huffman reading routines from FZipExploder with ones of my own devising, based solely on the specs in the APPNOTE. - Found a copy of PKZIP 1.1 and verified that Implode support works with files that use a literal table and 8k dictionary, and that the just-added Shrink support works at all. - Replaced the bit-at-a-time Shannon-Fano decoder from GunZip.c64 with the word-at-a-time one from 7-Zip for a slight speedup when working with Imploded files. - Fixed: Monsters should not check the inventory for damage absorbtion when they have the MF5_NODAMAGE flag set. - Added patch for saving automap zoom. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@328 b0f79afe-0144-0410-b225-9a4edf0717df
2009-05-23 10:24:33 +00:00
DmgFactors * df = target->GetClass()->ActorInfo->DamageFactors;
if (df != NULL)
{
Update to ZDoom r1600: - Fixed: When setting up a deep water sector with Transfer_Heights the floorclip information of all actors in the sector needs to be updated. - Fixed: A_CountdownArg and A_Die must ensure a certain kill. - Fixed: When using Win32 mouse, windowed mode, alt-tabbing away and then clicking on the window's title bar moved it practically off the screen. - Beginnings of i_input.cpp rewrite: Win32 and DirectInput mouse handling has been moved into classes. - Changed bounce flags into a property and added real bouncing sound properties. Compatibility modes to preserve use of the SeeSound are present and the old flags map to these. - Fixed: The SBARINFO parser compared an FString in the GAMEINFO with a NULL pointer and tried to load a lump with an empty name as statusbar script for non-Doom games. - Fixed: SetSoundPaused() still needs to call S_PauseSound() to pause music that isn't piped through the digital sound system. (Was removed in r1004.) - Added input buffering to the Implode and Shrink routines for a marked speedup. - Replaced the Shanno-Fano/Huffman reading routines from FZipExploder with ones of my own devising, based solely on the specs in the APPNOTE. - Found a copy of PKZIP 1.1 and verified that Implode support works with files that use a literal table and 8k dictionary, and that the just-added Shrink support works at all. - Replaced the bit-at-a-time Shannon-Fano decoder from GunZip.c64 with the word-at-a-time one from 7-Zip for a slight speedup when working with Imploded files. - Fixed: Monsters should not check the inventory for damage absorbtion when they have the MF5_NODAMAGE flag set. - Added patch for saving automap zoom. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@328 b0f79afe-0144-0410-b225-9a4edf0717df
2009-05-23 10:24:33 +00:00
fixed_t * pdf = df->CheckKey(mod);
if (pdf== NULL && mod != NAME_None) pdf = df->CheckKey(NAME_None);
if (pdf != NULL)
{
damage = FixedMul(damage, *pdf);
if (damage <= 0) return;
}
}
damage = FixedMul(damage, target->DamageFactor);
if (damage <= 0) return;
Update to ZDoom r1600: - Fixed: When setting up a deep water sector with Transfer_Heights the floorclip information of all actors in the sector needs to be updated. - Fixed: A_CountdownArg and A_Die must ensure a certain kill. - Fixed: When using Win32 mouse, windowed mode, alt-tabbing away and then clicking on the window's title bar moved it practically off the screen. - Beginnings of i_input.cpp rewrite: Win32 and DirectInput mouse handling has been moved into classes. - Changed bounce flags into a property and added real bouncing sound properties. Compatibility modes to preserve use of the SeeSound are present and the old flags map to these. - Fixed: The SBARINFO parser compared an FString in the GAMEINFO with a NULL pointer and tried to load a lump with an empty name as statusbar script for non-Doom games. - Fixed: SetSoundPaused() still needs to call S_PauseSound() to pause music that isn't piped through the digital sound system. (Was removed in r1004.) - Added input buffering to the Implode and Shrink routines for a marked speedup. - Replaced the Shanno-Fano/Huffman reading routines from FZipExploder with ones of my own devising, based solely on the specs in the APPNOTE. - Found a copy of PKZIP 1.1 and verified that Implode support works with files that use a literal table and 8k dictionary, and that the just-added Shrink support works at all. - Replaced the bit-at-a-time Shannon-Fano decoder from GunZip.c64 with the word-at-a-time one from 7-Zip for a slight speedup when working with Imploded files. - Fixed: Monsters should not check the inventory for damage absorbtion when they have the MF5_NODAMAGE flag set. - Added patch for saving automap zoom. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@328 b0f79afe-0144-0410-b225-9a4edf0717df
2009-05-23 10:24:33 +00:00
damage = target->TakeSpecialDamage (inflictor, source, damage, mod);
}
if (damage == -1)
{
return;
}
// Push the target unless the source's weapon's kickback is 0.
Update to ZDoom r1831: fixed: The Dehacked flags parser fix from May 31 (r1624) was undone by yesterday's additions. Changed it so that the parser first checks for the presence of a '-' sign before deciding whether to use strtol or strtoul to convert the string into a number. - Added PinkSilver's A_LookEx fix. - added resources needed for MBF support. - removed unused score items from DECORATE file. - Fixed: Argument count for UsePuzzleItem was wrong. - Added a few things from Gez's experimental build: * MBF Dehacked emulation but removed the COMPATF_MBFDEHACKED flag because it wouldn't work and is more or less useless anyway. * MBF's dog (definition only, no sprites yet.) * User variables. There's an array of 10. They can be set and checked in both DECORATE and ACS. * Made the tag name changeable but eliminated the redundancy of having both the meta property and the individual actor's one. Having one is fully sufficient. TO BE FIXED: Names are case insensitive but this should better be case sensitive. Unfortunately there's currently nothing better than FName to store a string inside an actor without severely complicating matters. Also bumped savegame version to avoid problems with this change. * MBF grenade and bouncing code. * several compatibility options. * info CCMD to print extended actor information (not fully implemented yet) * summonmbf CCMD. * Beta BFG code pointer (but not the related missiles yet.) * PowerInvisibility enhancements. * ScoreItem with one significant change: Added a score variable that can be checked through ACS and DECORATE. The engine itself will do nothing with it. * Nailgun option for A_Explode. * A_PrintBold and A_Log. * A_SetSpecial. * Beta Lost Soul (added DoomEdNum 9037 to it) * A_Mushroom extensions * Vavoom compatible MAPINFO keynames. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@452 b0f79afe-0144-0410-b225-9a4edf0717df
2009-09-15 06:19:39 +00:00
// (i.e. Gauntlets/Chainsaw)
if (inflictor && inflictor != target // [RH] Not if hurting own self
&& !(target->flags & MF_NOCLIP)
Update to ZDoom r1017: - Fixed: MAPINFO's 'lookup' option should only work for actual strings but not for lump and file names. - Added a few 'activator == NULL' checks to some ACS functions. - Added line and vertex lists to polyobjects so that I can do some changes that won't work with only a seg list being maintained. (SBarInfo update #23) - Fixed: Drawing the amount of an inventory item in the player's inventory did not work - Added: PowerupTime to drawnumber and drawbar. You must specify a powerupgiver. Although drawnumber goes in seconds the powerup has left drawbar will use ticks for extra accuracy. - I have increased cross-port compatibility with Skulltag. If an unknown game mode is provided for sbarinfo's gamemode command it will ignore it and continue. - Added an option to consider intermission screens gameplay for purposes of capturing the mouse. - Changed: Telefragging should not thrust the victim if it isn't in precisely the same position as the killer. - fixed: A_SpawnItemEx must call P_TeleportMove before checking the spawned object's position. - Fixed: Ouch state was far to easy to achieve. - Made all the basic texture classes local to their implementation. They are not needed anywhere else. - Changed the HackHack hack for corrupt 256 pixel high textures that FMultiPatchTexture only calls a virtual function instead of doing any type checks of the patch itself. - Cleaned up the constant definitions in doomdata.h. - Moved the TEXTUREx structures from doomdata.h to multipatchtexture.cpp because they are used only in this one file. - Removed some more typedefs from r_defs.h and doomdata.h - Moved local polyobject data definitions from p_local.h to po_man.cpp. - Renamed player_s to player_t globally to get rid of the duplicate names for this class. - Added coordinate range checking to DCanvas::ParseDrawTextureTags() to avoid potential crashes in the situation that con_scaletext is 2 and somebody uses a hud message as if a hud size was specified, but forgot to actually set the hud size. - Consolidated the mug shot code shared by DSBarInfo and DDoomStatusBar into a single place. - Fixed: Setting an invalid mug shot state crashed the game. - Fixed my attempts to be clever with strings yesterday. - If an actor's current target temporarily goes unshootable, its threshold is now reset to 0, so it will more readily switch back to it. - Fixed: Deactivating the game no longer allows reverb effects to continue playing while the sound is paused. - Fixed: S_StartNamedSound() looked for SECF_SILENT in MoreFlags instead of Flags. - Fixed: DSBarInfo::updateState() and DDoomStatusBar::UpdateState() sprung leaks and didn't allocate enough space for the fullStateName string. - Disabled DUMB's mono destination mixers. It's not like I'm ever going to target an original SoundBlaster, so they're a waste of space to have around. This trims resample.obj down to ~60k now. - Fixed: PrtScn/SysRq key did not work on Linux. - Added an alternate module replay engine that uses foo_dumb's replayer, a heavily customized version of DUMB (Dynamic Universal Music Bibliotheque). It has been slightly modified by me: * Added support for Ogg Vorbis-compressed samples in XM files ala FMOD. * Removed excessive mallocs from the replay core. * Rerolled the loops in resample.c. Unrolling them made the object file ~250k large while providing little benefit. Even at ~100k, I think it's still larger than it ought to be, but I'll live with it for now. Other than that, it's essentially the same thing you'd hear in foobar2000, minus some subsong detection features. Release builds of the library look like they might even be slightly faster than FMOD, which is a plus. - Fixed: Timidity::font_add() did not release the file reader it created. - Fixed: The SF2 loader did not free the sample headers in its destructor. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@113 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-03 21:48:49 +00:00
&& !(inflictor->flags2 & MF2_NODMGTHRUST)
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
&& !(flags & DMG_THRUSTLESS)
&& (source == NULL || source->player == NULL || !(source->flags2 & MF2_NODMGTHRUST)))
{
int kickback;
if (!source || !source->player || !source->player->ReadyWeapon)
kickback = gameinfo.defKickback;
else
kickback = source->player->ReadyWeapon->Kickback;
if (kickback)
{
AActor *origin = (source && (flags & DMG_INFLICTOR_IS_PUFF))? source : inflictor;
ang = R_PointToAngle2 (origin->x, origin->y,
target->x, target->y);
Update to ZDoom r1669: - added a compatibility option to restore the original Heretic bug where a Minotaur couldn't spawn floor flames when standing in water having its feet clipped. - added vid_vsync to display options. - fixed: Animations of type 'Range' must be disabled if the textures don't come from the same definition unit (i.e both containing file and use type are identical.) - changed: Item pushing is now only done once per P_XYMovement call. - Increased the push factor of Heretic's pod to 0.5 so that its behavior more closely matches the original which depended on several bugs in the engine. - Removed damage thrust clamping in P_DamageMobj and changed the thrust calculation to use floats to prevent overflows. The prevention of the overflows was the only reason the clamping was done. - Added Raven's dagger-like vector sprite for the player to the automap code. - Changed wad namespacing so that wads with a missing end marker will be loaded as if they had one more lump with that end marker. This matches the behaviour of previously released ZDooms. (The warning is still present, so there's no excuse to release more wads like this.) - Moved Raw Input processing into a seperate method of FInputDevice so that all the devices can share the same setup code. - Removed F16 mapping for SDL, because I guess it's not present in SDL 1.2. - Added Gez's Skulltag feature patch, including: * BUMPSPECIAL flag: actors with this flag will run their special if collided on by a player * WEAPON.NOAUTOAIM flag, though it is restricted to attacks that spawn a missile (it will not affect autoaim settings for a hitscan or railgun, and that's deliberate) * A_FireSTGrenade codepointer, extended to be parameterizable * The grenade (as the default actor for A_FireSTGrenade) * Protective armors à la RedArmor: they work with a DamageFactor; for example to recreate the RedArmor from Skulltag, copy its code from skulltag.pk3 but remove the "native" keyword and add DamageFactor "Fire" 0.1 to its properties. - Fixed: I_ShutdownInput must NULL all pointers because it can be called twice if an ENDOOM screen is displayed. - Fixed: R_DrawSkyStriped used frontyScale without initializing it first. - Fixed: P_LineAttack may not check the puff actor for MF6_FORCEPAIN because it's not necessarily spawned yet. - Fixed: FWeaponSlots::PickNext/PrevWeapon must be limited to one iteration through the weapon slots. Otherwise they will hang if there's no weapons in a player's inventory. - Added Line_SetTextureScale. - Fixed: sv_smartaim 3 treated the player like a shootable decoration. - Added A_CheckIfInTargetLOS - Removed redundant A_CheckIfTargetInSight. - Fixed: The initial play of a GME song always started track 0. - Fixed: The RAWINPUT buffer that GetRawInputData() fills in is 40 bytes on Win32 but 48 bytes on Win64, so Raw Mouse on x64 builds was getting random data off the stack because I also interpreted the error return incorrectly. - added parameter to A_FadeOut so that removing the actor can be made an option. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@344 b0f79afe-0144-0410-b225-9a4edf0717df
2009-06-14 18:05:00 +00:00
// Calculate this as float to avoid overflows so that the
// clamping that had to be done here can be removed.
Update to ZDoom r1831: fixed: The Dehacked flags parser fix from May 31 (r1624) was undone by yesterday's additions. Changed it so that the parser first checks for the presence of a '-' sign before deciding whether to use strtol or strtoul to convert the string into a number. - Added PinkSilver's A_LookEx fix. - added resources needed for MBF support. - removed unused score items from DECORATE file. - Fixed: Argument count for UsePuzzleItem was wrong. - Added a few things from Gez's experimental build: * MBF Dehacked emulation but removed the COMPATF_MBFDEHACKED flag because it wouldn't work and is more or less useless anyway. * MBF's dog (definition only, no sprites yet.) * User variables. There's an array of 10. They can be set and checked in both DECORATE and ACS. * Made the tag name changeable but eliminated the redundancy of having both the meta property and the individual actor's one. Having one is fully sufficient. TO BE FIXED: Names are case insensitive but this should better be case sensitive. Unfortunately there's currently nothing better than FName to store a string inside an actor without severely complicating matters. Also bumped savegame version to avoid problems with this change. * MBF grenade and bouncing code. * several compatibility options. * info CCMD to print extended actor information (not fully implemented yet) * summonmbf CCMD. * Beta BFG code pointer (but not the related missiles yet.) * PowerInvisibility enhancements. * ScoreItem with one significant change: Added a score variable that can be checked through ACS and DECORATE. The engine itself will do nothing with it. * Nailgun option for A_Explode. * A_PrintBold and A_Log. * A_SetSpecial. * Beta Lost Soul (added DoomEdNum 9037 to it) * A_Mushroom extensions * Vavoom compatible MAPINFO keynames. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@452 b0f79afe-0144-0410-b225-9a4edf0717df
2009-09-15 06:19:39 +00:00
double fltthrust;
Update to ZDoom r1831: fixed: The Dehacked flags parser fix from May 31 (r1624) was undone by yesterday's additions. Changed it so that the parser first checks for the presence of a '-' sign before deciding whether to use strtol or strtoul to convert the string into a number. - Added PinkSilver's A_LookEx fix. - added resources needed for MBF support. - removed unused score items from DECORATE file. - Fixed: Argument count for UsePuzzleItem was wrong. - Added a few things from Gez's experimental build: * MBF Dehacked emulation but removed the COMPATF_MBFDEHACKED flag because it wouldn't work and is more or less useless anyway. * MBF's dog (definition only, no sprites yet.) * User variables. There's an array of 10. They can be set and checked in both DECORATE and ACS. * Made the tag name changeable but eliminated the redundancy of having both the meta property and the individual actor's one. Having one is fully sufficient. TO BE FIXED: Names are case insensitive but this should better be case sensitive. Unfortunately there's currently nothing better than FName to store a string inside an actor without severely complicating matters. Also bumped savegame version to avoid problems with this change. * MBF grenade and bouncing code. * several compatibility options. * info CCMD to print extended actor information (not fully implemented yet) * summonmbf CCMD. * Beta BFG code pointer (but not the related missiles yet.) * PowerInvisibility enhancements. * ScoreItem with one significant change: Added a score variable that can be checked through ACS and DECORATE. The engine itself will do nothing with it. * Nailgun option for A_Explode. * A_PrintBold and A_Log. * A_SetSpecial. * Beta Lost Soul (added DoomEdNum 9037 to it) * A_Mushroom extensions * Vavoom compatible MAPINFO keynames. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@452 b0f79afe-0144-0410-b225-9a4edf0717df
2009-09-15 06:19:39 +00:00
fltthrust = mod == NAME_MDK ? 10 : 32;
if (target->Mass > 0)
{
fltthrust = clamp((damage * 0.125 * kickback) / target->Mass, 0., fltthrust);
}
thrust = FLOAT2FIXED(fltthrust);
Update to ZDoom r1669: - added a compatibility option to restore the original Heretic bug where a Minotaur couldn't spawn floor flames when standing in water having its feet clipped. - added vid_vsync to display options. - fixed: Animations of type 'Range' must be disabled if the textures don't come from the same definition unit (i.e both containing file and use type are identical.) - changed: Item pushing is now only done once per P_XYMovement call. - Increased the push factor of Heretic's pod to 0.5 so that its behavior more closely matches the original which depended on several bugs in the engine. - Removed damage thrust clamping in P_DamageMobj and changed the thrust calculation to use floats to prevent overflows. The prevention of the overflows was the only reason the clamping was done. - Added Raven's dagger-like vector sprite for the player to the automap code. - Changed wad namespacing so that wads with a missing end marker will be loaded as if they had one more lump with that end marker. This matches the behaviour of previously released ZDooms. (The warning is still present, so there's no excuse to release more wads like this.) - Moved Raw Input processing into a seperate method of FInputDevice so that all the devices can share the same setup code. - Removed F16 mapping for SDL, because I guess it's not present in SDL 1.2. - Added Gez's Skulltag feature patch, including: * BUMPSPECIAL flag: actors with this flag will run their special if collided on by a player * WEAPON.NOAUTOAIM flag, though it is restricted to attacks that spawn a missile (it will not affect autoaim settings for a hitscan or railgun, and that's deliberate) * A_FireSTGrenade codepointer, extended to be parameterizable * The grenade (as the default actor for A_FireSTGrenade) * Protective armors à la RedArmor: they work with a DamageFactor; for example to recreate the RedArmor from Skulltag, copy its code from skulltag.pk3 but remove the "native" keyword and add DamageFactor "Fire" 0.1 to its properties. - Fixed: I_ShutdownInput must NULL all pointers because it can be called twice if an ENDOOM screen is displayed. - Fixed: R_DrawSkyStriped used frontyScale without initializing it first. - Fixed: P_LineAttack may not check the puff actor for MF6_FORCEPAIN because it's not necessarily spawned yet. - Fixed: FWeaponSlots::PickNext/PrevWeapon must be limited to one iteration through the weapon slots. Otherwise they will hang if there's no weapons in a player's inventory. - Added Line_SetTextureScale. - Fixed: sv_smartaim 3 treated the player like a shootable decoration. - Added A_CheckIfInTargetLOS - Removed redundant A_CheckIfTargetInSight. - Fixed: The initial play of a GME song always started track 0. - Fixed: The RAWINPUT buffer that GetRawInputData() fills in is 40 bytes on Win32 but 48 bytes on Win64, so Raw Mouse on x64 builds was getting random data off the stack because I also interpreted the error return incorrectly. - added parameter to A_FadeOut so that removing the actor can be made an option. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@344 b0f79afe-0144-0410-b225-9a4edf0717df
2009-06-14 18:05:00 +00:00
// make fall forwards sometimes
if ((damage < 40) && (damage > target->health)
&& (target->z - origin->z > 64*FRACUNIT)
&& (pr_damagemobj()&1)
// [RH] But only if not too fast and not flying
&& thrust < 10*FRACUNIT
&& !(target->flags & MF_NOGRAVITY))
{
ang += ANG180;
thrust *= 4;
}
ang >>= ANGLETOFINESHIFT;
- Update to ZDoom r1777: - fixed: WIF_STAFF2_KICKBACK did not work anymore because it depended on conditions that were changed some time ago. - fixed: The damage inflictor for a rail attack was the shooter, not the puff. - Fixed: Floor and ceiling huggers may not change their z-velocity when seeking. - Fixed: UDMF set the secret sector flag before parsing the sector's properties, resulting in it always being false. - Renamed sector's oldspecial variable to secretsector to better reflect its only use. - Fixed: A_BrainSpit stored as the SpawnShot's target the intended BossTarget, not itself contrarily to other projectile spawning functions. A_SpawnFly then used the target for CopyFriendliness, thinking it'll be the BossEye when in fact it wasn't. - Added Gez's submission for a DEHACKED hack introduced by Boom. (using code pointers of the form 'Pointer 0 (x statenumber)'. - fixed: Attaching 3DMidtex lines by sector tag did not work because lines were marked by index in the sector's line list but needed to be marked by line index in the global array. - fixed: On Linux ZDoom was creating a directory called "~.zdoom" for save files because of a missing slash. - fixed: UDMF was unable to read floating point values in exponential format because the C Mode scanner was missing a definition for them. - fixed: The recent changes for removing pointer aliasing got the end sequence info from an incorrect variable. To make this more robust the sequence index is now stored as a hexadecimal string to avoid storing binary data in a string. Also moved end sequence lookup from f_finale.cpp to the calling code so that the proper end sequences can be retrieved for secret exits, too. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@427 b0f79afe-0144-0410-b225-9a4edf0717df
2009-08-30 19:31:59 +00:00
if (source && source->player && (flags & DMG_INFLICTOR_IS_PUFF)
&& source->player->ReadyWeapon != NULL &&
(source->player->ReadyWeapon->WeaponFlags & WIF_STAFF2_KICKBACK))
{
// Staff power level 2
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
target->velx += FixedMul (10*FRACUNIT, finecosine[ang]);
target->vely += FixedMul (10*FRACUNIT, finesine[ang]);
if (!(target->flags & MF_NOGRAVITY))
{
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
target->velz += 5*FRACUNIT;
}
}
else
{
Update to ZDoom r1705: - ZDoom now disables the input method editor, since it has no east-Asian support, and having it open a composition window when you're only expecting a single keypress is not so good. - Fixed: Setting intermissioncounter to false in gameinfo drew all the stats at once, instead of revealing them one line at a time. - Fixed: The border definition in MAPINFO's gameinfo block used extra braces. - Added A_SetCrosshair. - Added A_WeaponBob. - Dropped the Hexen player classes' JumpZ down to 9, since the original value now works as it originally did. - MF2_NODMGTHRUST now works with players, too. (Previously, it was only for missiles.) Also added PPF_NOTHRUSTWHILEINVUL to prevent invulnerable players from being thrusted while taking damage. (Non-players were already unthrusted.) - A_ZoomFactor now scales turning with the FOV by default. ZOOM_NOSCALETURNING will leave it unaltered. - Added Gez's PowerInvisibility changes. - Fixed: clearflags did not clear flags6. - Added A_SetAngle, A_SetPitch, A_ScaleVelocity, and A_ChangeVelocity. - Enough with this "momentum" garbage. What Doom calls "momentum" is really velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. - Added A_ZoomFactor. This lets weapons scale their player's FOV. Each weapon maintains its own FOV scale independent from any other weapons the player may have. - Fixed: When parsing DECORATE functions that were not exported, the parser crashed after giving you the warning. - Fixed some improper preprocessor lines in autostart/autozend.cpp. - Added XInput support. For the benefit of people compiling with MinGW, the CMakeLists.txt checks for xinput.h and disables it if it cannot be found. (And much to my surprise, I accidentally discovered that if you have the DirectX SDK installed, those headers actually do work with GCC, though they add a few extra warnings.) git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@376 b0f79afe-0144-0410-b225-9a4edf0717df
2009-07-04 08:28:50 +00:00
target->velx += FixedMul (thrust, finecosine[ang]);
target->vely += FixedMul (thrust, finesine[ang]);
}
}
}
//
// player specific
//
if (player)
{
//Added by MC: Lets bots look allround for enemies if they survive an ambush.
if (player->isbot)
{
player->allround = true;
}
// end of game hell hack
if ((target->Sector->special & 255) == dDamage_End
&& damage >= target->health)
{
damage = target->health - 1;
}
Update to ZDoom r1600: - Fixed: When setting up a deep water sector with Transfer_Heights the floorclip information of all actors in the sector needs to be updated. - Fixed: A_CountdownArg and A_Die must ensure a certain kill. - Fixed: When using Win32 mouse, windowed mode, alt-tabbing away and then clicking on the window's title bar moved it practically off the screen. - Beginnings of i_input.cpp rewrite: Win32 and DirectInput mouse handling has been moved into classes. - Changed bounce flags into a property and added real bouncing sound properties. Compatibility modes to preserve use of the SeeSound are present and the old flags map to these. - Fixed: The SBARINFO parser compared an FString in the GAMEINFO with a NULL pointer and tried to load a lump with an empty name as statusbar script for non-Doom games. - Fixed: SetSoundPaused() still needs to call S_PauseSound() to pause music that isn't piped through the digital sound system. (Was removed in r1004.) - Added input buffering to the Implode and Shrink routines for a marked speedup. - Replaced the Shanno-Fano/Huffman reading routines from FZipExploder with ones of my own devising, based solely on the specs in the APPNOTE. - Found a copy of PKZIP 1.1 and verified that Implode support works with files that use a literal table and 8k dictionary, and that the just-added Shrink support works at all. - Replaced the bit-at-a-time Shannon-Fano decoder from GunZip.c64 with the word-at-a-time one from 7-Zip for a slight speedup when working with Imploded files. - Fixed: Monsters should not check the inventory for damage absorbtion when they have the MF5_NODAMAGE flag set. - Added patch for saving automap zoom. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@328 b0f79afe-0144-0410-b225-9a4edf0717df
2009-05-23 10:24:33 +00:00
if (!(flags & DMG_FORCED))
{
// check the real player, not a voodoo doll here for invulnerability effects
if (damage < TELEFRAG_DAMAGE && ((player->mo->flags2 & MF2_INVULNERABLE) ||
(player->cheats & CF_GODMODE)))
Update to ZDoom r1600: - Fixed: When setting up a deep water sector with Transfer_Heights the floorclip information of all actors in the sector needs to be updated. - Fixed: A_CountdownArg and A_Die must ensure a certain kill. - Fixed: When using Win32 mouse, windowed mode, alt-tabbing away and then clicking on the window's title bar moved it practically off the screen. - Beginnings of i_input.cpp rewrite: Win32 and DirectInput mouse handling has been moved into classes. - Changed bounce flags into a property and added real bouncing sound properties. Compatibility modes to preserve use of the SeeSound are present and the old flags map to these. - Fixed: The SBARINFO parser compared an FString in the GAMEINFO with a NULL pointer and tried to load a lump with an empty name as statusbar script for non-Doom games. - Fixed: SetSoundPaused() still needs to call S_PauseSound() to pause music that isn't piped through the digital sound system. (Was removed in r1004.) - Added input buffering to the Implode and Shrink routines for a marked speedup. - Replaced the Shanno-Fano/Huffman reading routines from FZipExploder with ones of my own devising, based solely on the specs in the APPNOTE. - Found a copy of PKZIP 1.1 and verified that Implode support works with files that use a literal table and 8k dictionary, and that the just-added Shrink support works at all. - Replaced the bit-at-a-time Shannon-Fano decoder from GunZip.c64 with the word-at-a-time one from 7-Zip for a slight speedup when working with Imploded files. - Fixed: Monsters should not check the inventory for damage absorbtion when they have the MF5_NODAMAGE flag set. - Added patch for saving automap zoom. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@328 b0f79afe-0144-0410-b225-9a4edf0717df
2009-05-23 10:24:33 +00:00
{ // player is invulnerable, so don't hurt him
return;
}
Update to ZDoom r1600: - Fixed: When setting up a deep water sector with Transfer_Heights the floorclip information of all actors in the sector needs to be updated. - Fixed: A_CountdownArg and A_Die must ensure a certain kill. - Fixed: When using Win32 mouse, windowed mode, alt-tabbing away and then clicking on the window's title bar moved it practically off the screen. - Beginnings of i_input.cpp rewrite: Win32 and DirectInput mouse handling has been moved into classes. - Changed bounce flags into a property and added real bouncing sound properties. Compatibility modes to preserve use of the SeeSound are present and the old flags map to these. - Fixed: The SBARINFO parser compared an FString in the GAMEINFO with a NULL pointer and tried to load a lump with an empty name as statusbar script for non-Doom games. - Fixed: SetSoundPaused() still needs to call S_PauseSound() to pause music that isn't piped through the digital sound system. (Was removed in r1004.) - Added input buffering to the Implode and Shrink routines for a marked speedup. - Replaced the Shanno-Fano/Huffman reading routines from FZipExploder with ones of my own devising, based solely on the specs in the APPNOTE. - Found a copy of PKZIP 1.1 and verified that Implode support works with files that use a literal table and 8k dictionary, and that the just-added Shrink support works at all. - Replaced the bit-at-a-time Shannon-Fano decoder from GunZip.c64 with the word-at-a-time one from 7-Zip for a slight speedup when working with Imploded files. - Fixed: Monsters should not check the inventory for damage absorbtion when they have the MF5_NODAMAGE flag set. - Added patch for saving automap zoom. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@328 b0f79afe-0144-0410-b225-9a4edf0717df
2009-05-23 10:24:33 +00:00
// [RH] Avoid friendly fire if enabled
if (source != NULL && player != source->player && target->IsTeammate (source))
{
FriendlyFire = true;
Update to ZDoom r1757: - Added player MugShotMaxHealth property. Negative values use the player's max health as the mug shot max health, zero uses 100 as the mug shot max health, and positive values used directly as the mug shot max health. - Added buddha cheat. - Added TELEFRAG_DAMAGE constant, and changed the two places that still used 1000 as the threshold for god mode damage to use it instead. (Players with MF2_INVULNERABLE set already used 1000000 as their threshold.) - Added MF6_NOTELEFRAG flag. - Fixed: M_QuitResponse() tried to play a sound even when none was specified in the gameinfo. - Added Yes/No selections for Y/N messages so that you can answer them entirely with a joystick. - Fixed: Starting the menu at the title screen with a key other than Escape left the top level menu out of the menu stack. - Changed the save menu so that cancelling input of a new save name only deactivates that control and does not completely close the menus. - Fixed "any key" messages to override input to menus hidden beneath them and to work with joysticks. - Removed the input parameter from M_StartMessage and the corresponding messageNeedsInput global, because it was redundant. Any messages that want a Y/N response also supply a callback, and messages that don't care which key you press don't supply a callback. - Changed MKEY_Back so that it cancels out of text entry fields before backing to the previous menu, which it already did for the keyboard. - Changed the menu responder so that key downs always produce results, regardless of whether or not an equivalent key is already down. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@412 b0f79afe-0144-0410-b225-9a4edf0717df
2009-08-07 19:34:42 +00:00
if (damage < TELEFRAG_DAMAGE)
Update to ZDoom r1600: - Fixed: When setting up a deep water sector with Transfer_Heights the floorclip information of all actors in the sector needs to be updated. - Fixed: A_CountdownArg and A_Die must ensure a certain kill. - Fixed: When using Win32 mouse, windowed mode, alt-tabbing away and then clicking on the window's title bar moved it practically off the screen. - Beginnings of i_input.cpp rewrite: Win32 and DirectInput mouse handling has been moved into classes. - Changed bounce flags into a property and added real bouncing sound properties. Compatibility modes to preserve use of the SeeSound are present and the old flags map to these. - Fixed: The SBARINFO parser compared an FString in the GAMEINFO with a NULL pointer and tried to load a lump with an empty name as statusbar script for non-Doom games. - Fixed: SetSoundPaused() still needs to call S_PauseSound() to pause music that isn't piped through the digital sound system. (Was removed in r1004.) - Added input buffering to the Implode and Shrink routines for a marked speedup. - Replaced the Shanno-Fano/Huffman reading routines from FZipExploder with ones of my own devising, based solely on the specs in the APPNOTE. - Found a copy of PKZIP 1.1 and verified that Implode support works with files that use a literal table and 8k dictionary, and that the just-added Shrink support works at all. - Replaced the bit-at-a-time Shannon-Fano decoder from GunZip.c64 with the word-at-a-time one from 7-Zip for a slight speedup when working with Imploded files. - Fixed: Monsters should not check the inventory for damage absorbtion when they have the MF5_NODAMAGE flag set. - Added patch for saving automap zoom. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@328 b0f79afe-0144-0410-b225-9a4edf0717df
2009-05-23 10:24:33 +00:00
{ // Still allow telefragging :-(
damage = (int)((float)damage * level.teamdamage);
if (damage <= 0)
return;
}
}
if (!(flags & DMG_NO_ARMOR) && player->mo->Inventory != NULL)
{
int newdam = damage;
player->mo->Inventory->AbsorbDamage (damage, mod, newdam);
damage = newdam;
if (damage <= 0)
Update to ZDoom r1600: - Fixed: When setting up a deep water sector with Transfer_Heights the floorclip information of all actors in the sector needs to be updated. - Fixed: A_CountdownArg and A_Die must ensure a certain kill. - Fixed: When using Win32 mouse, windowed mode, alt-tabbing away and then clicking on the window's title bar moved it practically off the screen. - Beginnings of i_input.cpp rewrite: Win32 and DirectInput mouse handling has been moved into classes. - Changed bounce flags into a property and added real bouncing sound properties. Compatibility modes to preserve use of the SeeSound are present and the old flags map to these. - Fixed: The SBARINFO parser compared an FString in the GAMEINFO with a NULL pointer and tried to load a lump with an empty name as statusbar script for non-Doom games. - Fixed: SetSoundPaused() still needs to call S_PauseSound() to pause music that isn't piped through the digital sound system. (Was removed in r1004.) - Added input buffering to the Implode and Shrink routines for a marked speedup. - Replaced the Shanno-Fano/Huffman reading routines from FZipExploder with ones of my own devising, based solely on the specs in the APPNOTE. - Found a copy of PKZIP 1.1 and verified that Implode support works with files that use a literal table and 8k dictionary, and that the just-added Shrink support works at all. - Replaced the bit-at-a-time Shannon-Fano decoder from GunZip.c64 with the word-at-a-time one from 7-Zip for a slight speedup when working with Imploded files. - Fixed: Monsters should not check the inventory for damage absorbtion when they have the MF5_NODAMAGE flag set. - Added patch for saving automap zoom. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@328 b0f79afe-0144-0410-b225-9a4edf0717df
2009-05-23 10:24:33 +00:00
{
// If MF&_FORCEPAIN is set make the player enter the pain state.
if (inflictor != NULL && (inflictor->flags6 & MF6_FORCEPAIN)) goto dopain;
return;
Update to ZDoom r1600: - Fixed: When setting up a deep water sector with Transfer_Heights the floorclip information of all actors in the sector needs to be updated. - Fixed: A_CountdownArg and A_Die must ensure a certain kill. - Fixed: When using Win32 mouse, windowed mode, alt-tabbing away and then clicking on the window's title bar moved it practically off the screen. - Beginnings of i_input.cpp rewrite: Win32 and DirectInput mouse handling has been moved into classes. - Changed bounce flags into a property and added real bouncing sound properties. Compatibility modes to preserve use of the SeeSound are present and the old flags map to these. - Fixed: The SBARINFO parser compared an FString in the GAMEINFO with a NULL pointer and tried to load a lump with an empty name as statusbar script for non-Doom games. - Fixed: SetSoundPaused() still needs to call S_PauseSound() to pause music that isn't piped through the digital sound system. (Was removed in r1004.) - Added input buffering to the Implode and Shrink routines for a marked speedup. - Replaced the Shanno-Fano/Huffman reading routines from FZipExploder with ones of my own devising, based solely on the specs in the APPNOTE. - Found a copy of PKZIP 1.1 and verified that Implode support works with files that use a literal table and 8k dictionary, and that the just-added Shrink support works at all. - Replaced the bit-at-a-time Shannon-Fano decoder from GunZip.c64 with the word-at-a-time one from 7-Zip for a slight speedup when working with Imploded files. - Fixed: Monsters should not check the inventory for damage absorbtion when they have the MF5_NODAMAGE flag set. - Added patch for saving automap zoom. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@328 b0f79afe-0144-0410-b225-9a4edf0717df
2009-05-23 10:24:33 +00:00
}
}
Update to ZDoom r1600: - Fixed: When setting up a deep water sector with Transfer_Heights the floorclip information of all actors in the sector needs to be updated. - Fixed: A_CountdownArg and A_Die must ensure a certain kill. - Fixed: When using Win32 mouse, windowed mode, alt-tabbing away and then clicking on the window's title bar moved it practically off the screen. - Beginnings of i_input.cpp rewrite: Win32 and DirectInput mouse handling has been moved into classes. - Changed bounce flags into a property and added real bouncing sound properties. Compatibility modes to preserve use of the SeeSound are present and the old flags map to these. - Fixed: The SBARINFO parser compared an FString in the GAMEINFO with a NULL pointer and tried to load a lump with an empty name as statusbar script for non-Doom games. - Fixed: SetSoundPaused() still needs to call S_PauseSound() to pause music that isn't piped through the digital sound system. (Was removed in r1004.) - Added input buffering to the Implode and Shrink routines for a marked speedup. - Replaced the Shanno-Fano/Huffman reading routines from FZipExploder with ones of my own devising, based solely on the specs in the APPNOTE. - Found a copy of PKZIP 1.1 and verified that Implode support works with files that use a literal table and 8k dictionary, and that the just-added Shrink support works at all. - Replaced the bit-at-a-time Shannon-Fano decoder from GunZip.c64 with the word-at-a-time one from 7-Zip for a slight speedup when working with Imploded files. - Fixed: Monsters should not check the inventory for damage absorbtion when they have the MF5_NODAMAGE flag set. - Added patch for saving automap zoom. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@328 b0f79afe-0144-0410-b225-9a4edf0717df
2009-05-23 10:24:33 +00:00
if (damage >= player->health
&& (G_SkillProperty(SKILLP_AutoUseHealth) || deathmatch)
&& !player->morphTics)
{ // Try to use some inventory health
P_AutoUseHealth (player, damage - player->health + 1);
}
}
player->health -= damage; // mirror mobj health here for Dave
// [RH] Make voodoo dolls and real players record the same health
target->health = player->mo->health -= damage;
Update to ZDoom r1600: - Fixed: When setting up a deep water sector with Transfer_Heights the floorclip information of all actors in the sector needs to be updated. - Fixed: A_CountdownArg and A_Die must ensure a certain kill. - Fixed: When using Win32 mouse, windowed mode, alt-tabbing away and then clicking on the window's title bar moved it practically off the screen. - Beginnings of i_input.cpp rewrite: Win32 and DirectInput mouse handling has been moved into classes. - Changed bounce flags into a property and added real bouncing sound properties. Compatibility modes to preserve use of the SeeSound are present and the old flags map to these. - Fixed: The SBARINFO parser compared an FString in the GAMEINFO with a NULL pointer and tried to load a lump with an empty name as statusbar script for non-Doom games. - Fixed: SetSoundPaused() still needs to call S_PauseSound() to pause music that isn't piped through the digital sound system. (Was removed in r1004.) - Added input buffering to the Implode and Shrink routines for a marked speedup. - Replaced the Shanno-Fano/Huffman reading routines from FZipExploder with ones of my own devising, based solely on the specs in the APPNOTE. - Found a copy of PKZIP 1.1 and verified that Implode support works with files that use a literal table and 8k dictionary, and that the just-added Shrink support works at all. - Replaced the bit-at-a-time Shannon-Fano decoder from GunZip.c64 with the word-at-a-time one from 7-Zip for a slight speedup when working with Imploded files. - Fixed: Monsters should not check the inventory for damage absorbtion when they have the MF5_NODAMAGE flag set. - Added patch for saving automap zoom. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@328 b0f79afe-0144-0410-b225-9a4edf0717df
2009-05-23 10:24:33 +00:00
if (player->health < 50 && !deathmatch && !(flags & DMG_FORCED))
{
P_AutoUseStrifeHealth (player);
player->mo->health = player->health;
}
Update to ZDoom r1757: - Added player MugShotMaxHealth property. Negative values use the player's max health as the mug shot max health, zero uses 100 as the mug shot max health, and positive values used directly as the mug shot max health. - Added buddha cheat. - Added TELEFRAG_DAMAGE constant, and changed the two places that still used 1000 as the threshold for god mode damage to use it instead. (Players with MF2_INVULNERABLE set already used 1000000 as their threshold.) - Added MF6_NOTELEFRAG flag. - Fixed: M_QuitResponse() tried to play a sound even when none was specified in the gameinfo. - Added Yes/No selections for Y/N messages so that you can answer them entirely with a joystick. - Fixed: Starting the menu at the title screen with a key other than Escape left the top level menu out of the menu stack. - Changed the save menu so that cancelling input of a new save name only deactivates that control and does not completely close the menus. - Fixed "any key" messages to override input to menus hidden beneath them and to work with joysticks. - Removed the input parameter from M_StartMessage and the corresponding messageNeedsInput global, because it was redundant. Any messages that want a Y/N response also supply a callback, and messages that don't care which key you press don't supply a callback. - Changed MKEY_Back so that it cancels out of text entry fields before backing to the previous menu, which it already did for the keyboard. - Changed the menu responder so that key downs always produce results, regardless of whether or not an equivalent key is already down. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@412 b0f79afe-0144-0410-b225-9a4edf0717df
2009-08-07 19:34:42 +00:00
if (player->health <= 0)
{
Update to ZDoom r1757: - Added player MugShotMaxHealth property. Negative values use the player's max health as the mug shot max health, zero uses 100 as the mug shot max health, and positive values used directly as the mug shot max health. - Added buddha cheat. - Added TELEFRAG_DAMAGE constant, and changed the two places that still used 1000 as the threshold for god mode damage to use it instead. (Players with MF2_INVULNERABLE set already used 1000000 as their threshold.) - Added MF6_NOTELEFRAG flag. - Fixed: M_QuitResponse() tried to play a sound even when none was specified in the gameinfo. - Added Yes/No selections for Y/N messages so that you can answer them entirely with a joystick. - Fixed: Starting the menu at the title screen with a key other than Escape left the top level menu out of the menu stack. - Changed the save menu so that cancelling input of a new save name only deactivates that control and does not completely close the menus. - Fixed "any key" messages to override input to menus hidden beneath them and to work with joysticks. - Removed the input parameter from M_StartMessage and the corresponding messageNeedsInput global, because it was redundant. Any messages that want a Y/N response also supply a callback, and messages that don't care which key you press don't supply a callback. - Changed MKEY_Back so that it cancels out of text entry fields before backing to the previous menu, which it already did for the keyboard. - Changed the menu responder so that key downs always produce results, regardless of whether or not an equivalent key is already down. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@412 b0f79afe-0144-0410-b225-9a4edf0717df
2009-08-07 19:34:42 +00:00
// [SP] Buddha cheat: if the player is about to die, rescue him to 1 health.
// This does not save the player if damage >= TELEFRAG_DAMAGE, still need to
// telefrag him right? ;) (Unfortunately the damage is "absorbed" by armor,
// but telefragging should still do enough damage to kill the player)
if ((player->cheats & CF_BUDDHA) && damage < TELEFRAG_DAMAGE)
{
target->health = player->health = 1;
}
else
{
player->health = 0;
}
}
player->LastDamageType = mod;
player->attacker = source;
player->damagecount += damage; // add damage after armor / invuln
if (player->damagecount > 100)
{
player->damagecount = 100; // teleport stomp does 10k points...
}
temp = damage < 100 ? damage : 100;
if (player == &players[consoleplayer])
{
I_Tactile (40,10,40+temp*2);
}
}
else
{
// Armor for monsters.
Update to ZDoom r1600: - Fixed: When setting up a deep water sector with Transfer_Heights the floorclip information of all actors in the sector needs to be updated. - Fixed: A_CountdownArg and A_Die must ensure a certain kill. - Fixed: When using Win32 mouse, windowed mode, alt-tabbing away and then clicking on the window's title bar moved it practically off the screen. - Beginnings of i_input.cpp rewrite: Win32 and DirectInput mouse handling has been moved into classes. - Changed bounce flags into a property and added real bouncing sound properties. Compatibility modes to preserve use of the SeeSound are present and the old flags map to these. - Fixed: The SBARINFO parser compared an FString in the GAMEINFO with a NULL pointer and tried to load a lump with an empty name as statusbar script for non-Doom games. - Fixed: SetSoundPaused() still needs to call S_PauseSound() to pause music that isn't piped through the digital sound system. (Was removed in r1004.) - Added input buffering to the Implode and Shrink routines for a marked speedup. - Replaced the Shanno-Fano/Huffman reading routines from FZipExploder with ones of my own devising, based solely on the specs in the APPNOTE. - Found a copy of PKZIP 1.1 and verified that Implode support works with files that use a literal table and 8k dictionary, and that the just-added Shrink support works at all. - Replaced the bit-at-a-time Shannon-Fano decoder from GunZip.c64 with the word-at-a-time one from 7-Zip for a slight speedup when working with Imploded files. - Fixed: Monsters should not check the inventory for damage absorbtion when they have the MF5_NODAMAGE flag set. - Added patch for saving automap zoom. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@328 b0f79afe-0144-0410-b225-9a4edf0717df
2009-05-23 10:24:33 +00:00
if (!(flags & (DMG_NO_ARMOR|DMG_FORCED)) && target->Inventory != NULL && damage > 0)
{
int newdam = damage;
target->Inventory->AbsorbDamage (damage, mod, newdam);
damage = newdam;
if (damage <= 0)
{
return;
}
}
target->health -= damage;
}
//
// the damage has been dealt; now deal with the consequences
//
// If the damaging player has the power of drain, give the player 50% of the damage
// done in health.
if ( source && source->player && source->player->cheats & CF_DRAIN)
{
if (!target->player || target->player != source->player)
{
if ( P_GiveBody( source, damage / 2 ))
{
S_Sound( source, CHAN_ITEM, "*drainhealth", 1, ATTN_NORM );
}
}
}
if (target->health <= 0)
{ // Death
target->special1 = damage;
// check for special fire damage or ice damage deaths
if (mod == NAME_Fire)
{
if (player && !player->morphTics)
{ // Check for flame death
if (!inflictor ||
((target->health > -50) && (damage > 25)) ||
Update to ZDoom r1146 (warning: massive changes ahead!) - Removed DECORATE's ParseClass because it was only used to add data to fully internal actor classes which no longer exist. - Changed the state structure so that the Tics value doesn't need to be hacked into misc1 with SF_BIGTIC anymore. - Changed sprite processing so that sprite names are converted to indices during parsing so that an additional postprocessing step is no longer needed. - Fixed: Sprite names in DECORATE were case sensitive. - Exported AActor's defaults to DECORATE and removed all code for the internal property parser which is no longer needed. - Converted the Heresiarch to DECORATE. - Added an Active and Inactive state for monsters. - Made the speed a parameter to A_RaiseMobj and A_SinkMobj and deleted GetRaiseSpeed and GetSinkSpeed. - Added some remaining DECORATE conversions for Hexen by Karate Chris. - Changed Windows to use the performance counter instead of rdtsc. - Changed Linux to use clock_gettime for profiling instead of rdtsc. This avoids potential erroneous results on multicore and variable speed processors. - Converted the last of Hexen's inventory items to DECORATE so that I could export AInventory. - Removed AT_GAME_SET because it's no longer used anywhere. - Converted the last remaining global classes to DECORATE. - Fixed: Inventory.PickupFlash requires an class name as parameter not an integer. Some Hexen definitions got it wrong. - Converted Hexen's Pig to DECORATE. - Replaced the ActorInfo definitions of all internal inventory classes with DECORATE definitions. - Added option to specify a powerup's duration in second by using a negative number. - Added Gez's Freedoom detection patch. - SBARINFO update: * Added: The ability to have drawkeybar auto detect spacing. * Added: Offset parameter to drawkeybar to allow two key bars with different keys. * Added: Multi-row/column keybar parameters. Spacing can also be auto. These defualt to left to right/top to bottom but can be switched. * Added: Drawshadow flag to drawnumber. This will draw a solid color and translucent number under the normal number. * Added: hexenarmor to drawimage. This takes a parameter for a hexen armor type and will fade the image like the hexen status bar. * Added: centerbottom offset to draw(switchable)image. * Added: translucent flag to drawinventorybar. * Fixed: Accidentally removed flag from DrawTexture that allowed negative coordinates to work with fullscreenoffsets. Hopefully this is the last major bug in the fullscreenoffsets system. - Ported vlinetallasm4 to AMD64 assembly. Even with the increased number of registers AMD64 provides, this routine still needs to be written as self- modifying code for maximum performance. The additional registers do allow for further optimization over the x86 version by allowing all four pixels to be in flight at the same time. The end result is that AMD64 ASM is about 2.18 times faster than AMD64 C and about 1.06 times faster than x86 ASM. (For further comparison, AMD64 C and x86 C are practically the same for this function.) Should I port any more assembly to AMD64, mvlineasm4 is the most likely candidate, but it's not used enough at this point to bother. Also, this may or may not work with Linux at the moment, since it doesn't have the eh_handler metadata. Win64 is easier, since I just need to structure the function prologue and epilogue properly and use some assembler directives/macros to automatically generate the metadata. And that brings up another point: You need YASM to assemble the AMD64 code, because NASM doesn't support the Win64 metadata directives. - Replaced the ActorInfo definitions of several internal classes with DECORATE definitions - Converted teleport fog and destinations to DECORATE. - AActor::PreExplode is gone now that the last item that was using it has been converted. - Converted the Sigil and the remaining things in a_strifeitems.cpp to DECORATE. - Exported Point pushers, CustomSprite and AmbientSound to DECORATE. - Changed increased lightning damage for Centaurs into a damage factor. - Changed PoisonCloud and Lightning special treatment in P_DamageMobj to use damage types instead to keep dependencies on specific actor types out of the main engine code. - Added Korax DECORATE conversion by Gez and a few others by Karate Chris. - Removed FourthWeaponClass and based Hexen's fourth weapons on the generic weapon pieces. - Added DECORATE conversions for Hexen's Fighter weapons by Karate Chris. - Added aWeaponGiver class to generalize the standing AssaultGun. - converted a_Strifeweapons.cpp to DECORATE, except for the Sigil. - Added an SSE version of DoBlending. This is strictly C intrinsics. VC++ still throws around unneccessary register moves. GCC seems to be pretty close to optimal, requiring only about 2 cycles/color. They're both faster than my hand-written MMX routine, so I don't need to feel bad about not hand-optimizing this for x64 builds. - Removed an extra instruction from DoBlending_MMX, transposed two instructions, and unrolled it once, shaving off about 80 cycles from the time required to blend 256 palette entries. Why? Because I tried writing a C version of the routine using compiler intrinsics and was appalled by all the extra movq's VC++ added to the code. GCC was better, but still generated extra instructions. I only wanted a C version because I can't use inline assembly with VC++'s x64 compiler, and x64 assembly is a bit of a pain. (It's a pain because Linux and Windows have different calling conventions, and you need to maintain extra metadata for functions.) So, the assembly version stays and the C version stays out. - Converted the rest of a_strifestuff.cpp to DECORATE. - Fixed: AStalker::CheckMeleeRange did not perform all checks of AActor::CheckMeleeRange. I replaced this virtual override with a new flag MF5_NOVERTICALMELEERANGE so that this feature can also be used by other actors. - Converted Strife's Stalker to DECORATE. - Converted ArtiTeleport to DECORATE. - Removed the NoBlockingSet method from AActor because everything using it has been converted to DECORATE using DropItem instead. - Changed: Macil doesn't need the StrifeHumanoid's special death states so he might as well inherit directly from AActor. - Converted Strife's Coin, Oracle, Macil and StrifeHumanoid to DECORATE. Also moved the burning hand states to StrifePlayer where they really belong. - Added Gez's dropammofactor submission with some necessary changes. Also merged redundant ammo multiplication code from P_DropItem and ADehackedPickup::TryPickup. - Restricted native action function definitions to zdoom.pk3. - Fixed. The Firedemon was missing a game filter. - Added: disablegrin, disableouch, disablepain, and disablerampage flags to drawmugshot. - Fixed: LowerHealthCap did not work properly. - Fixed: Various bugs I noticed in the fullscreenoffsets code. - Removed all the pixel doubling r_detail modes, since the one platform they were intended to assist (486) actually sees very little benefit from them. - Rewrote CheckMMX in C and renamed it to CheckCPU. - Fixed: CPUID function 0x80000005 is specified to return detailed L1 cache only for AMD processors, so we must not use it on other architectures, or we end up overwriting the L1 cache line size with 0 or some other number we don't actually understand. - The x87 precision control is now explicitly set for double precision, since GCC defaults to extended precision instead, unlike Visual C++. - Converted Strife's Programmer, Loremaster and Thingstoblowup to DECORATE. - Fixed: Attacking a merchant in Strife didn't alert the enemies. - Removed AT_GAME_SET(PowerInvulnerable) due to the problems it caused. The two occurences in the code that depended on it were changed accordingly. Invulnerability colormaps are now being set by the items exclusively. - Changed many checks for the friendly Minotaur to a new flag MF5_SUMMONEDMONSTER so that it can hopefully be generalized to be usable elsewhere later. - Added Gez's submission for converting the Minotaur to DECORATE. - Fixed a few minor DECORATE bugs. - Changed coordinate storage for EntityBoss so that it works properly even when the pod is not used to spawn it. - Converted Strife's Spectres and Entity to DECORATE. - Added: fullscreenoffsets flag for status bars. This changes the coordinate system to be relative to the top left corner of the screen. This is useful for full screen status bars. - Changed: drawinventorybar will use the width of artibox or invcurs (strife) to determine the spacing. Let me know if this breaks any released mods. - Fixed: If a status bar height of 0 was specified in SBarInfo the wrong bar would be shown. - Fixed: If a static inventory bar was used the user still had to press invuse in order to get rid of the "overlay". - Fixed: forcescaled would not work if the height of the bar was 0. - Added: keyslot to drawswitchableimage. - Fixed: The transition effects for the log and keys popups were switched. - Converted Strife's Crusader, Inquisitor and spectral missiles to DECORATE. - Converted Strife's Acolytes, Rebels, Sentinel, Reaver and Templar to DECORATE. - Added DECORATE conversions for Hexen's Cleric weapons by Karate Chris. - Added a check to Zipdir that excludes files with a .orig extension. These can be left behind by patch.exe and create problems. - fixed: Unmorphing from chicken caused a crash when reading non-existent meta-data strings. - Converted the ScriptedMarines to DECORATE. - Fixed: DLightTransfer and DWallLightTransfer were declared as actors. - Converted the PhoenixRod and associated classes to DECORATE to make the Heretic conversion complete. - Converted the Minotaur's projectiles to DECORATE so that I can get rid of the AT_SPEED_SET code. - Converted Heretic's Blaster and SkullRod to DECORATE. - Converted the mace and all related actors to DECORATE and generalized the spawn function that only spawns one mace per level. - Moved Mace respawning code into AInventory so that it works properly for replacement actors. - Added more DECORATE conversions by Karate Chris. - Cleaned up the new bridge code and exported all related actors to DECORATE so that the exported code pointers can be used. - Separated Heretic's and Hexen's invulnerability items for stability reasons. - Fixed spurious warnings on 32-bit VC++ debug builds. - Made the subsong (order) number a proper parameter to MusInfo::Play() instead of requiring a separate SetPosition() call to do it. - Added Gez's submission for custom bridge things. - Fixed: ASpecialSpot must check the array's size before dividing by it. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@151 b0f79afe-0144-0410-b225-9a4edf0717df
2008-08-10 15:12:58 +00:00
!(inflictor->flags5 & MF5_SPECIALFIREDAMAGE))
{
target->DamageType = NAME_Fire;
}
}
else
{
target->DamageType = NAME_Fire;
}
}
else
{
target->DamageType = mod;
}
Update to ZDoom r1146 (warning: massive changes ahead!) - Removed DECORATE's ParseClass because it was only used to add data to fully internal actor classes which no longer exist. - Changed the state structure so that the Tics value doesn't need to be hacked into misc1 with SF_BIGTIC anymore. - Changed sprite processing so that sprite names are converted to indices during parsing so that an additional postprocessing step is no longer needed. - Fixed: Sprite names in DECORATE were case sensitive. - Exported AActor's defaults to DECORATE and removed all code for the internal property parser which is no longer needed. - Converted the Heresiarch to DECORATE. - Added an Active and Inactive state for monsters. - Made the speed a parameter to A_RaiseMobj and A_SinkMobj and deleted GetRaiseSpeed and GetSinkSpeed. - Added some remaining DECORATE conversions for Hexen by Karate Chris. - Changed Windows to use the performance counter instead of rdtsc. - Changed Linux to use clock_gettime for profiling instead of rdtsc. This avoids potential erroneous results on multicore and variable speed processors. - Converted the last of Hexen's inventory items to DECORATE so that I could export AInventory. - Removed AT_GAME_SET because it's no longer used anywhere. - Converted the last remaining global classes to DECORATE. - Fixed: Inventory.PickupFlash requires an class name as parameter not an integer. Some Hexen definitions got it wrong. - Converted Hexen's Pig to DECORATE. - Replaced the ActorInfo definitions of all internal inventory classes with DECORATE definitions. - Added option to specify a powerup's duration in second by using a negative number. - Added Gez's Freedoom detection patch. - SBARINFO update: * Added: The ability to have drawkeybar auto detect spacing. * Added: Offset parameter to drawkeybar to allow two key bars with different keys. * Added: Multi-row/column keybar parameters. Spacing can also be auto. These defualt to left to right/top to bottom but can be switched. * Added: Drawshadow flag to drawnumber. This will draw a solid color and translucent number under the normal number. * Added: hexenarmor to drawimage. This takes a parameter for a hexen armor type and will fade the image like the hexen status bar. * Added: centerbottom offset to draw(switchable)image. * Added: translucent flag to drawinventorybar. * Fixed: Accidentally removed flag from DrawTexture that allowed negative coordinates to work with fullscreenoffsets. Hopefully this is the last major bug in the fullscreenoffsets system. - Ported vlinetallasm4 to AMD64 assembly. Even with the increased number of registers AMD64 provides, this routine still needs to be written as self- modifying code for maximum performance. The additional registers do allow for further optimization over the x86 version by allowing all four pixels to be in flight at the same time. The end result is that AMD64 ASM is about 2.18 times faster than AMD64 C and about 1.06 times faster than x86 ASM. (For further comparison, AMD64 C and x86 C are practically the same for this function.) Should I port any more assembly to AMD64, mvlineasm4 is the most likely candidate, but it's not used enough at this point to bother. Also, this may or may not work with Linux at the moment, since it doesn't have the eh_handler metadata. Win64 is easier, since I just need to structure the function prologue and epilogue properly and use some assembler directives/macros to automatically generate the metadata. And that brings up another point: You need YASM to assemble the AMD64 code, because NASM doesn't support the Win64 metadata directives. - Replaced the ActorInfo definitions of several internal classes with DECORATE definitions - Converted teleport fog and destinations to DECORATE. - AActor::PreExplode is gone now that the last item that was using it has been converted. - Converted the Sigil and the remaining things in a_strifeitems.cpp to DECORATE. - Exported Point pushers, CustomSprite and AmbientSound to DECORATE. - Changed increased lightning damage for Centaurs into a damage factor. - Changed PoisonCloud and Lightning special treatment in P_DamageMobj to use damage types instead to keep dependencies on specific actor types out of the main engine code. - Added Korax DECORATE conversion by Gez and a few others by Karate Chris. - Removed FourthWeaponClass and based Hexen's fourth weapons on the generic weapon pieces. - Added DECORATE conversions for Hexen's Fighter weapons by Karate Chris. - Added aWeaponGiver class to generalize the standing AssaultGun. - converted a_Strifeweapons.cpp to DECORATE, except for the Sigil. - Added an SSE version of DoBlending. This is strictly C intrinsics. VC++ still throws around unneccessary register moves. GCC seems to be pretty close to optimal, requiring only about 2 cycles/color. They're both faster than my hand-written MMX routine, so I don't need to feel bad about not hand-optimizing this for x64 builds. - Removed an extra instruction from DoBlending_MMX, transposed two instructions, and unrolled it once, shaving off about 80 cycles from the time required to blend 256 palette entries. Why? Because I tried writing a C version of the routine using compiler intrinsics and was appalled by all the extra movq's VC++ added to the code. GCC was better, but still generated extra instructions. I only wanted a C version because I can't use inline assembly with VC++'s x64 compiler, and x64 assembly is a bit of a pain. (It's a pain because Linux and Windows have different calling conventions, and you need to maintain extra metadata for functions.) So, the assembly version stays and the C version stays out. - Converted the rest of a_strifestuff.cpp to DECORATE. - Fixed: AStalker::CheckMeleeRange did not perform all checks of AActor::CheckMeleeRange. I replaced this virtual override with a new flag MF5_NOVERTICALMELEERANGE so that this feature can also be used by other actors. - Converted Strife's Stalker to DECORATE. - Converted ArtiTeleport to DECORATE. - Removed the NoBlockingSet method from AActor because everything using it has been converted to DECORATE using DropItem instead. - Changed: Macil doesn't need the StrifeHumanoid's special death states so he might as well inherit directly from AActor. - Converted Strife's Coin, Oracle, Macil and StrifeHumanoid to DECORATE. Also moved the burning hand states to StrifePlayer where they really belong. - Added Gez's dropammofactor submission with some necessary changes. Also merged redundant ammo multiplication code from P_DropItem and ADehackedPickup::TryPickup. - Restricted native action function definitions to zdoom.pk3. - Fixed. The Firedemon was missing a game filter. - Added: disablegrin, disableouch, disablepain, and disablerampage flags to drawmugshot. - Fixed: LowerHealthCap did not work properly. - Fixed: Various bugs I noticed in the fullscreenoffsets code. - Removed all the pixel doubling r_detail modes, since the one platform they were intended to assist (486) actually sees very little benefit from them. - Rewrote CheckMMX in C and renamed it to CheckCPU. - Fixed: CPUID function 0x80000005 is specified to return detailed L1 cache only for AMD processors, so we must not use it on other architectures, or we end up overwriting the L1 cache line size with 0 or some other number we don't actually understand. - The x87 precision control is now explicitly set for double precision, since GCC defaults to extended precision instead, unlike Visual C++. - Converted Strife's Programmer, Loremaster and Thingstoblowup to DECORATE. - Fixed: Attacking a merchant in Strife didn't alert the enemies. - Removed AT_GAME_SET(PowerInvulnerable) due to the problems it caused. The two occurences in the code that depended on it were changed accordingly. Invulnerability colormaps are now being set by the items exclusively. - Changed many checks for the friendly Minotaur to a new flag MF5_SUMMONEDMONSTER so that it can hopefully be generalized to be usable elsewhere later. - Added Gez's submission for converting the Minotaur to DECORATE. - Fixed a few minor DECORATE bugs. - Changed coordinate storage for EntityBoss so that it works properly even when the pod is not used to spawn it. - Converted Strife's Spectres and Entity to DECORATE. - Added: fullscreenoffsets flag for status bars. This changes the coordinate system to be relative to the top left corner of the screen. This is useful for full screen status bars. - Changed: drawinventorybar will use the width of artibox or invcurs (strife) to determine the spacing. Let me know if this breaks any released mods. - Fixed: If a status bar height of 0 was specified in SBarInfo the wrong bar would be shown. - Fixed: If a static inventory bar was used the user still had to press invuse in order to get rid of the "overlay". - Fixed: forcescaled would not work if the height of the bar was 0. - Added: keyslot to drawswitchableimage. - Fixed: The transition effects for the log and keys popups were switched. - Converted Strife's Crusader, Inquisitor and spectral missiles to DECORATE. - Converted Strife's Acolytes, Rebels, Sentinel, Reaver and Templar to DECORATE. - Added DECORATE conversions for Hexen's Cleric weapons by Karate Chris. - Added a check to Zipdir that excludes files with a .orig extension. These can be left behind by patch.exe and create problems. - fixed: Unmorphing from chicken caused a crash when reading non-existent meta-data strings. - Converted the ScriptedMarines to DECORATE. - Fixed: DLightTransfer and DWallLightTransfer were declared as actors. - Converted the PhoenixRod and associated classes to DECORATE to make the Heretic conversion complete. - Converted the Minotaur's projectiles to DECORATE so that I can get rid of the AT_SPEED_SET code. - Converted Heretic's Blaster and SkullRod to DECORATE. - Converted the mace and all related actors to DECORATE and generalized the spawn function that only spawns one mace per level. - Moved Mace respawning code into AInventory so that it works properly for replacement actors. - Added more DECORATE conversions by Karate Chris. - Cleaned up the new bridge code and exported all related actors to DECORATE so that the exported code pointers can be used. - Separated Heretic's and Hexen's invulnerability items for stability reasons. - Fixed spurious warnings on 32-bit VC++ debug builds. - Made the subsong (order) number a proper parameter to MusInfo::Play() instead of requiring a separate SetPosition() call to do it. - Added Gez's submission for custom bridge things. - Fixed: ASpecialSpot must check the array's size before dividing by it. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@151 b0f79afe-0144-0410-b225-9a4edf0717df
2008-08-10 15:12:58 +00:00
if (source && source->tracer && (source->flags5 & MF5_SUMMONEDMONSTER))
{ // Minotaur's kills go to his master
// Make sure still alive and not a pointer to fighter head
if (source->tracer->player && (source->tracer->player->mo == source->tracer))
{
source = source->tracer;
}
}
target->Die (source, inflictor);
return;
}
woundstate = target->FindState(NAME_Wound, mod);
if (woundstate != NULL)
{
int woundhealth = RUNTIME_TYPE(target)->Meta.GetMetaInt (AMETA_WoundHealth, 6);
if (target->health <= woundhealth)
{
target->SetState (woundstate);
return;
}
}
if (!(target->flags5 & MF5_NOPAIN) && (inflictor == NULL || !(inflictor->flags5 & MF5_PAINLESS)) &&
!G_SkillProperty(SKILLP_NoPain) && !(target->flags & MF_SKULLFLY))
{
pc = target->GetClass()->ActorInfo->PainChances;
painchance = target->PainChance;
if (pc != NULL)
{
BYTE * ppc = pc->CheckKey(mod);
if (ppc != NULL)
{
painchance = *ppc;
}
}
if ((damage > target->PainThreshold && pr_damagemobj() < painchance) ||
(inflictor != NULL && (inflictor->flags6 & MF6_FORCEPAIN)))
{
dopain:
if (mod == NAME_Electric)
{
if (pr_lightning() < 96)
{
justhit = true;
FState * painstate = target->FindState(NAME_Pain, mod);
if (painstate != NULL) target->SetState (painstate);
}
else
{ // "electrocute" the target
target->renderflags |= RF_FULLBRIGHT;
if ((target->flags3 & MF3_ISMONSTER) && pr_lightning() < 128)
{
target->Howl ();
}
}
}
else
{
justhit = true;
FState * painstate = target->FindState(NAME_Pain, mod);
if (painstate != NULL) target->SetState (painstate);
if (mod == NAME_PoisonCloud)
{
if ((target->flags3 & MF3_ISMONSTER) && pr_poison() < 128)
{
target->Howl ();
}
}
}
}
}
target->reactiontime = 0; // we're awake now...
if (source)
{
if (source == target->target)
{
target->threshold = BASETHRESHOLD;
if (target->state == target->SpawnState && target->SeeState != NULL)
{
target->SetState (target->SeeState);
}
}
else if (source != target->target && target->OkayToSwitchTarget (source))
{
// Target actor is not intent on another actor,
// so make him chase after source
// killough 2/15/98: remember last enemy, to prevent
// sleeping early; 2/21/98: Place priority on players
if (target->lastenemy == NULL ||
(target->lastenemy->player == NULL && target->TIDtoHate == 0) ||
target->lastenemy->health <= 0)
{
target->lastenemy = target->target; // remember last enemy - killough
}
target->target = source;
target->threshold = BASETHRESHOLD;
if (target->state == target->SpawnState && target->SeeState != NULL)
{
target->SetState (target->SeeState);
}
}
}
Update to ZDoom r1848: - Fixed: The deprecated flag handler for the old bounce flags needs to clear BOUNCE_MBF and BOUNCE_UseSeeSound, too, when clearing one of these flags. - Fixed: When adding the AVOIDMELEE code the code was accidentally changed so that friendly monsters could no longer acquire targets by themselves. - Renamed WIF_BOT_MELEE to WIF_MELEEWEAPON because it's no longer a bot only flag. - Added MBF's monster_backing feature as an actor flag: AVOIDMELEE. - Gez's misc. bugs patch: * Moves the dog sound out of the Doom-specific sounds in SNDINFO to address this, * Renames the dog actor to MBFHelperDog to prevent name conflicts, * Adds APROP_Score to CheckActorProperty, * Completes the randomspawner update (the reason I moved the recursion counter out of special1 was that I found some projectiles had this set to them, for example in A_LichAttack, but I forgot to add transfer for them), * Provides centered sprites for beta plasma balls if this is deemed deserving correction. - Added some pieces of MBF's friendly AI. - Cleaned up A_LookEx code and merged most of it with the base functions. The major difference was a common piece of code that was repeated 5 times throughout the code so I moved it into a subfunction. - Changed P_BlockmapSearch to pass a user parameter to its callback so that A_LookEx does not need to store its info inside the actor itself. - fixed: The linetarget CCMD duplicated all of the info CCMD. - fixed: PrintActorInfo crashed due to some incomplete implementation. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@458 b0f79afe-0144-0410-b225-9a4edf0717df
2009-09-16 21:17:17 +00:00
// killough 11/98: Don't attack a friend, unless hit by that friend.
if (justhit && (target->target == source || !target->target || !target->IsFriend(target->target)))
target->flags |= MF_JUSTHIT; // fight back!
}
bool AActor::OkayToSwitchTarget (AActor *other)
{
if (other == this)
return false; // [RH] Don't hate self (can happen when shooting barrels)
if (!(other->flags & MF_SHOOTABLE))
return false; // Don't attack things that can't be hurt
if ((flags4 & MF4_NOTARGETSWITCH) && target != NULL)
return false; // Don't switch target if not allowed
if ((master != NULL && other->IsA(master->GetClass())) || // don't attack your master (or others of its type)
(other->master != NULL && IsA(other->master->GetClass()))) // don't attack your minion (or those of others of your type)
{
if (!IsHostile (other) && // allow target switch if other is considered hostile
(other->tid != TIDtoHate || TIDtoHate == 0) && // or has the tid we hate
other->TIDtoHate == TIDtoHate) // or has different hate information
{
return false;
}
}
if ((other->flags3 & MF3_NOTARGET) &&
(other->tid != TIDtoHate || TIDtoHate == 0) &&
!IsHostile (other))
return false;
if (threshold != 0 && !(flags4 & MF4_QUICKTORETALIATE))
return false;
if (IsFriend (other))
{ // [RH] Friendlies don't target other friendlies
return false;
}
int infight;
- Added ZDoom's new sound code now that $limit is working again Update to ZDoom r853 - Increased the limit for 'imp/active' to 6. This sound definitely benefits from a higher limit. - Fixed: $limit should not apply to sounds played from the menu. - Fixed: The SNDSEQ parser tried to set bDoorSound before actually creating the sound sequence data. - Changed Lemon so that it always writes the header. It still kept recompiling the grammar over and over again once it had been changed locally. - Fixed: ANIMATED allowed animations between different texture types. - Added a debuganimated CCMD that can be used to output some information if a WAD shows broken animations. - Removed xlat_parser.h from the repository. Lemon was always being run on xlat_parser.y because both files had the same time stamp after an update, and Lemon only rewrites the header file if it's changed. - Added $volume SNDINFO command. This is multiplied with the volume the sound is played at to arrive at the final volume (before distance attenuation). - Added the CHAN_AREA flag to disable 3D panning within the min distance of a sound. Sector sound sequences (except doors) use this flag. - Added the CHAN_LOOP flag to replace the S_Looped* sound functions. - Fixed: THe handling for enum values in Xlat was incorrect. The rule with value assignment must set the counter one higher than the current value. - Fixed: The definition of enums in the Xlat grammar was right-recursive which could create stack overflows in the parser. Made it left-recursive as recommended in Lemon's docs. - Added Thomas's submissions for decal assignment to puffs and NOINFIGHTING flag. - Reverted changes of r715 in v_collection.cpp because they broke loading of status bar face graphics belonging to skins. SBARINFO update #15 - Fixed: Monospacing fonts wasn't quite correct. - Fixed: The new mug shot code forgot to use the first arg of drawmugshot (the one that picks the default sprite prefix). - Added: lowerHealthCap variable to SBarInfo, which is set to true by default. - Added: ininventory event to SBarInfo to detect if one or two items are in (or not in) the player's inventory. - Added: The ability to print global vars using drawnumber. I need someone to test it though. - Added: aspectratio command to detect what the user's aspect ratio is. - Added: missing spacing argument to drawstring. - Changed the sbarinfo display routine for drawnumber to not use cmd.value to store what it is about to display. Now it uses a new variable. - More conversions from DrawImage to screen->DrawTexture. I think only the inventory bar drawing functions have to be changed now. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@78 b0f79afe-0144-0410-b225-9a4edf0717df
2008-03-25 16:19:31 +00:00
if (flags5 & MF5_NOINFIGHTING) infight=-1;
- Update to ZDoom r1401: - Made improvements so that the FOptionalMapinfoData class is easier to use. - Moved the MF_INCHASE recursion check from A_Look() into A_Chase(). This lets A_Look() always put the actor into its see state. This problem could be heard by an Archvile's resurrectee playing its see sound but failing to enter its see state because it was called from A_Chase(). - Fixed: SBARINFO used different rounding modes for the background and foreground of the DrawBar command. - Bumped MINSAVEVER to coincide with the new MAPINFO merge. - Added a fflush() call after the logfile write in I_FatalError so that the error text is visible in the file while the error dialog is displayed. - moved all code related to global ACS variables to p_acs.cpp where it belongs. - fixed: The nextmap and nextsecret CCMDs need to call G_DeferedInitNew instead of G_InitNew. - rewrote the MAPINFO parser: * split level_info_t::flags into 2 DWORDS so that I don't have to deal with 64 bit values later. * split off skill code into its own file * created a parser class for MAPINFO * replaced all uses of ReplaceString in level_info_t with FStrings and made the specialaction data a TArray so that levelinfos can be handled without error prone maintenance functions. * split of parser code from g_level.cpp * const-ified parameters to F_StartFinale. * Changed how G_MaybeLookupLevelName works and made it return an FString. * removed 64 character limit on level names. - Changed DECORATE replacements so that they aren't overridden by Dehacked. - Fixed: The damage factor for 'normal' damage is supposed to be applied to all damage types that don't have a specific damage factor. - Changed FMOD init() to allocate some virtual channels. - Fixed clipping in D3DFB::DrawTextureV() for good by using a scissor test. - Fixed: D3DFB::DrawTextureV() did not properly adjust the texture coordinate for lclip and rclip. - Added weapdrop ccmd. - Centered the compatibility mode option in the comptibility options menu. - Added button mappings for 8 mouse buttons on SDL. It works with my system, but Linux being Linux, there are no guarantees that it's appropriate for other systems. - Fixed: SDL input code did not generate GUI events for the mousewheel, so it could not be used to scroll the console buffer. - Added Blzut3's statusbar maintenance patch. - fixed sound origin of the Mage Wand's missile. - Added APROP_Dropped actor property. - Fixed: The compatmode CVAR needs CVAR_NOINITCALL so that the compatibility flags don't get reset each start. - Fixed: compatmode Doom(strict) was missing COMPAT_CROSSDROPOFF - More GCC warning removal, the most egregious of which was the security vulnerability "format not a string literal and no format arguments". - Changed the CMake script to search for fmod libraries by full name instead of assuming a symbolic link has been placed for the latest version. It can also find a non-installed copy of FMOD if it is placed local to the ZDoom source tree. - Fixed: Some OPL state needs to be restored before calculating rhythm. Also, since only the rhythm section uses the RNG, it doesn't need to be advanced for the normal voice processing. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@297 b0f79afe-0144-0410-b225-9a4edf0717df
2009-02-05 00:06:30 +00:00
else if (level.flags2 & LEVEL2_TOTALINFIGHTING) infight=1;
else if (level.flags2 & LEVEL2_NOINFIGHTING) infight=-1;
else infight = infighting;
if (infight < 0 && other->player == NULL && !IsHostile (other))
{
return false; // infighting off: Non-friendlies don't target other non-friendlies
}
if (TIDtoHate != 0 && TIDtoHate == other->TIDtoHate)
return false; // [RH] Don't target "teammates"
if (other->player != NULL && (flags4 & MF4_NOHATEPLAYERS))
return false; // [RH] Don't target players
if (target != NULL && target->health > 0 &&
TIDtoHate != 0 && target->tid == TIDtoHate && pr_switcher() < 128 &&
P_CheckSight (this, target))
return false; // [RH] Don't be too quick to give up things we hate
return true;
}
//==========================================================================
//
// P_PoisonPlayer - Sets up all data concerning poisoning
//
//==========================================================================
bool P_PoisonPlayer (player_t *player, AActor *poisoner, AActor *source, int poison)
{
if((player->cheats&CF_GODMODE) || (player->mo->flags2 & MF2_INVULNERABLE))
{
return false;
}
if (source != NULL && source->player != player && player->mo->IsTeammate (source))
{
poison = (int)((float)poison * level.teamdamage);
}
if (poison > 0)
{
player->poisoncount += poison;
player->poisoner = poisoner;
if(player->poisoncount > 100)
{
player->poisoncount = 100;
}
}
return true;
}
//==========================================================================
//
// P_PoisonDamage - Similar to P_DamageMobj
//
//==========================================================================
void P_PoisonDamage (player_t *player, AActor *source, int damage,
bool playPainSound)
{
AActor *target;
AActor *inflictor;
target = player->mo;
inflictor = source;
if (target->health <= 0)
{
return;
}
Update to ZDoom r1757: - Added player MugShotMaxHealth property. Negative values use the player's max health as the mug shot max health, zero uses 100 as the mug shot max health, and positive values used directly as the mug shot max health. - Added buddha cheat. - Added TELEFRAG_DAMAGE constant, and changed the two places that still used 1000 as the threshold for god mode damage to use it instead. (Players with MF2_INVULNERABLE set already used 1000000 as their threshold.) - Added MF6_NOTELEFRAG flag. - Fixed: M_QuitResponse() tried to play a sound even when none was specified in the gameinfo. - Added Yes/No selections for Y/N messages so that you can answer them entirely with a joystick. - Fixed: Starting the menu at the title screen with a key other than Escape left the top level menu out of the menu stack. - Changed the save menu so that cancelling input of a new save name only deactivates that control and does not completely close the menus. - Fixed "any key" messages to override input to menus hidden beneath them and to work with joysticks. - Removed the input parameter from M_StartMessage and the corresponding messageNeedsInput global, because it was redundant. Any messages that want a Y/N response also supply a callback, and messages that don't care which key you press don't supply a callback. - Changed MKEY_Back so that it cancels out of text entry fields before backing to the previous menu, which it already did for the keyboard. - Changed the menu responder so that key downs always produce results, regardless of whether or not an equivalent key is already down. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@412 b0f79afe-0144-0410-b225-9a4edf0717df
2009-08-07 19:34:42 +00:00
if (damage < TELEFRAG_DAMAGE && ((target->flags2 & MF2_INVULNERABLE) ||
(player->cheats & CF_GODMODE)))
{ // target is invulnerable
return;
}
if (player)
{
// Take half damage in trainer mode
damage = FixedMul(damage, G_SkillProperty(SKILLP_DamageFactor));
}
if (damage >= player->health
&& (G_SkillProperty(SKILLP_AutoUseHealth) || deathmatch)
&& !player->morphTics)
{ // Try to use some inventory health
P_AutoUseHealth (player, damage - player->health+1);
}
player->health -= damage; // mirror mobj health here for Dave
if (player->health < 50 && !deathmatch)
{
P_AutoUseStrifeHealth (player);
}
if (player->health < 0)
{
player->health = 0;
}
player->attacker = source;
//
// do the damage
//
target->health -= damage;
if (target->health <= 0)
{ // Death
Update to ZDoom r1757: - Added player MugShotMaxHealth property. Negative values use the player's max health as the mug shot max health, zero uses 100 as the mug shot max health, and positive values used directly as the mug shot max health. - Added buddha cheat. - Added TELEFRAG_DAMAGE constant, and changed the two places that still used 1000 as the threshold for god mode damage to use it instead. (Players with MF2_INVULNERABLE set already used 1000000 as their threshold.) - Added MF6_NOTELEFRAG flag. - Fixed: M_QuitResponse() tried to play a sound even when none was specified in the gameinfo. - Added Yes/No selections for Y/N messages so that you can answer them entirely with a joystick. - Fixed: Starting the menu at the title screen with a key other than Escape left the top level menu out of the menu stack. - Changed the save menu so that cancelling input of a new save name only deactivates that control and does not completely close the menus. - Fixed "any key" messages to override input to menus hidden beneath them and to work with joysticks. - Removed the input parameter from M_StartMessage and the corresponding messageNeedsInput global, because it was redundant. Any messages that want a Y/N response also supply a callback, and messages that don't care which key you press don't supply a callback. - Changed MKEY_Back so that it cancels out of text entry fields before backing to the previous menu, which it already did for the keyboard. - Changed the menu responder so that key downs always produce results, regardless of whether or not an equivalent key is already down. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@412 b0f79afe-0144-0410-b225-9a4edf0717df
2009-08-07 19:34:42 +00:00
if ( player->cheats & CF_BUDDHA )
{ // [SP] Save the player...
player->health = target->health = 1;
}
else
{
target->special1 = damage;
if (player && inflictor && !player->morphTics)
{ // Check for flame death
if ((inflictor->DamageType == NAME_Fire)
&& (target->health > -50) && (damage > 25))
{
target->DamageType = NAME_Fire;
}
else target->DamageType = inflictor->DamageType;
}
Update to ZDoom r1757: - Added player MugShotMaxHealth property. Negative values use the player's max health as the mug shot max health, zero uses 100 as the mug shot max health, and positive values used directly as the mug shot max health. - Added buddha cheat. - Added TELEFRAG_DAMAGE constant, and changed the two places that still used 1000 as the threshold for god mode damage to use it instead. (Players with MF2_INVULNERABLE set already used 1000000 as their threshold.) - Added MF6_NOTELEFRAG flag. - Fixed: M_QuitResponse() tried to play a sound even when none was specified in the gameinfo. - Added Yes/No selections for Y/N messages so that you can answer them entirely with a joystick. - Fixed: Starting the menu at the title screen with a key other than Escape left the top level menu out of the menu stack. - Changed the save menu so that cancelling input of a new save name only deactivates that control and does not completely close the menus. - Fixed "any key" messages to override input to menus hidden beneath them and to work with joysticks. - Removed the input parameter from M_StartMessage and the corresponding messageNeedsInput global, because it was redundant. Any messages that want a Y/N response also supply a callback, and messages that don't care which key you press don't supply a callback. - Changed MKEY_Back so that it cancels out of text entry fields before backing to the previous menu, which it already did for the keyboard. - Changed the menu responder so that key downs always produce results, regardless of whether or not an equivalent key is already down. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@412 b0f79afe-0144-0410-b225-9a4edf0717df
2009-08-07 19:34:42 +00:00
target->Die (source, source);
return;
}
}
if (!(level.time&63) && playPainSound)
{
FState * painstate = target->FindState(NAME_Pain, target->DamageType);
if (painstate != NULL) target->SetState (painstate);
}
/*
if((P_Random() < target->info->painchance)
&& !(target->flags&MF_SKULLFLY))
{
target->flags |= MF_JUSTHIT; // fight back!
P_SetMobjState(target, target->info->painstate);
}
*/
return;
}
bool CheckCheatmode ();
CCMD (kill)
{
if (argv.argc() > 1)
{
if (CheckCheatmode ())
return;
if (!stricmp (argv[1], "monsters"))
{
// Kill all the monsters
if (CheckCheatmode ())
return;
Net_WriteByte (DEM_GENERICCHEAT);
Net_WriteByte (CHT_MASSACRE);
}
else
{
Net_WriteByte (DEM_KILLCLASSCHEAT);
Net_WriteString (argv[1]);
}
}
else
{
// If suiciding is disabled, then don't do it.
if (dmflags2 & DF2_NOSUICIDE)
return;
// Kill the player
Net_WriteByte (DEM_SUICIDE);
}
C_HideConsole ();
}