mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 23:02:08 +00:00
- 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. SVN r1014 (trunk)
This commit is contained in:
parent
8d5d742287
commit
29380f70b3
9 changed files with 92 additions and 29 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
June 2, 2008 (Changes by Graf Zahl)
|
||||||
|
- 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.
|
||||||
|
|
||||||
June 1, 2008 (Changes by Graf Zahl)
|
June 1, 2008 (Changes by Graf Zahl)
|
||||||
- Fixed: Ouch state was far to easy to achieve.
|
- Fixed: Ouch state was far to easy to achieve.
|
||||||
- Made all the basic texture classes local to their implementation.
|
- Made all the basic texture classes local to their implementation.
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
#ifndef __GAMECONFIGFILE_H__
|
#ifndef __GAMECONFIGFILE_H__
|
||||||
#define __GAMECONFIGFILE_H__
|
#define __GAMECONFIGFILE_H__
|
||||||
|
|
||||||
|
#include "doomtype.h"
|
||||||
#include "configfile.h"
|
#include "configfile.h"
|
||||||
|
|
||||||
class DArgs;
|
class DArgs;
|
||||||
|
|
|
@ -982,7 +982,8 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
|
||||||
// (i.e. Guantlets/Chainsaw)
|
// (i.e. Guantlets/Chainsaw)
|
||||||
if (inflictor && inflictor != target // [RH] Not if hurting own self
|
if (inflictor && inflictor != target // [RH] Not if hurting own self
|
||||||
&& !(target->flags & MF_NOCLIP)
|
&& !(target->flags & MF_NOCLIP)
|
||||||
&& !(inflictor->flags2 & MF2_NODMGTHRUST))
|
&& !(inflictor->flags2 & MF2_NODMGTHRUST)
|
||||||
|
&& !(flags & DMG_THRUSTLESS))
|
||||||
{
|
{
|
||||||
int kickback;
|
int kickback;
|
||||||
|
|
||||||
|
|
|
@ -441,8 +441,12 @@ bool P_GiveBody (AActor *actor, int num);
|
||||||
void P_PoisonPlayer (player_t *player, AActor *poisoner, AActor *source, int poison);
|
void P_PoisonPlayer (player_t *player, AActor *poisoner, AActor *source, int poison);
|
||||||
void P_PoisonDamage (player_t *player, AActor *source, int damage, bool playPainSound);
|
void P_PoisonDamage (player_t *player, AActor *source, int damage, bool playPainSound);
|
||||||
|
|
||||||
#define DMG_NO_ARMOR 1
|
enum EDmgFlags
|
||||||
#define DMG_INFLICTOR_IS_PUFF 2
|
{
|
||||||
|
DMG_NO_ARMOR = 1,
|
||||||
|
DMG_INFLICTOR_IS_PUFF = 2,
|
||||||
|
DMG_THRUSTLESS = 4,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// ===== PO_MAN =====
|
// ===== PO_MAN =====
|
||||||
|
|
|
@ -247,7 +247,8 @@ bool P_TeleportMove (AActor *thing, fixed_t x, fixed_t y, fixed_t z, bool telefr
|
||||||
|
|
||||||
spechit.Clear ();
|
spechit.Clear ();
|
||||||
|
|
||||||
bool StompAlwaysFrags = thing->player || (level.flags & LEVEL_MONSTERSTELEFRAG) || telefrag;
|
bool StompAlwaysFrags = thing->player || (thing->flags2 & MF2_TELESTOMP) ||
|
||||||
|
(level.flags & LEVEL_MONSTERSTELEFRAG) || telefrag;
|
||||||
|
|
||||||
FBoundingBox box(x, y, thing->radius);
|
FBoundingBox box(x, y, thing->radius);
|
||||||
FBlockLinesIterator it(box);
|
FBlockLinesIterator it(box);
|
||||||
|
@ -291,9 +292,9 @@ bool P_TeleportMove (AActor *thing, fixed_t x, fixed_t y, fixed_t z, bool telefr
|
||||||
|
|
||||||
// monsters don't stomp things except on boss level
|
// monsters don't stomp things except on boss level
|
||||||
// [RH] Some Heretic/Hexen monsters can telestomp
|
// [RH] Some Heretic/Hexen monsters can telestomp
|
||||||
if (StompAlwaysFrags || (thing->flags2 & MF2_TELESTOMP))
|
if (StompAlwaysFrags)
|
||||||
{
|
{
|
||||||
P_DamageMobj (th, thing, thing, 1000000, NAME_Telefrag);
|
P_DamageMobj (th, thing, thing, 1000000, NAME_Telefrag, DMG_THRUSTLESS);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -280,13 +280,33 @@ static void MouseRead ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CUSTOM_CVAR(Int, mouse_capturemode, 1, CVAR_GLOBALCONFIG|CVAR_ARCHIVE)
|
||||||
|
{
|
||||||
|
if (self < 0) self = 0;
|
||||||
|
else if (self > 2) self = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool inGame()
|
||||||
|
{
|
||||||
|
switch (mouse_capturemode)
|
||||||
|
{
|
||||||
|
default:
|
||||||
|
case 0:
|
||||||
|
return gamestate == GS_LEVEL;
|
||||||
|
case 1:
|
||||||
|
return gamestate == GS_LEVEL || gamestate == GS_INTERMISSION || gamestate == GS_FINALE;
|
||||||
|
case 2:
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void I_CheckNativeMouse ()
|
static void I_CheckNativeMouse ()
|
||||||
{
|
{
|
||||||
bool focus = (SDL_GetAppState() & (SDL_APPINPUTFOCUS|SDL_APPACTIVE))
|
bool focus = (SDL_GetAppState() & (SDL_APPINPUTFOCUS|SDL_APPACTIVE))
|
||||||
== (SDL_APPINPUTFOCUS|SDL_APPACTIVE);
|
== (SDL_APPINPUTFOCUS|SDL_APPACTIVE);
|
||||||
bool fs = (SDL_GetVideoSurface ()->flags & SDL_FULLSCREEN) != 0;
|
bool fs = (SDL_GetVideoSurface ()->flags & SDL_FULLSCREEN) != 0;
|
||||||
|
|
||||||
bool wantNative = !focus || !use_mouse || (!fs && (GUICapture || paused || demoplayback || gamestate != GS_LEVEL));
|
bool wantNative = !focus || !use_mouse || (!fs && (GUICapture || paused || demoplayback || !inGame()));
|
||||||
|
|
||||||
if (wantNative != NativeMouse)
|
if (wantNative != NativeMouse)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1350,14 +1350,27 @@ void A_TakeFromTarget(AActor * self)
|
||||||
// Common code for A_SpawnItem and A_SpawnItemEx
|
// Common code for A_SpawnItem and A_SpawnItemEx
|
||||||
//
|
//
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
enum SIX_Flags
|
||||||
|
{
|
||||||
|
SIXF_TRANSFERTRANSLATION=1,
|
||||||
|
SIXF_ABSOLUTEPOSITION=2,
|
||||||
|
SIXF_ABSOLUTEANGLE=4,
|
||||||
|
SIXF_ABSOLUTEMOMENTUM=8,
|
||||||
|
SIXF_SETMASTER=16,
|
||||||
|
SIXF_NOCHECKPOSITION=32,
|
||||||
|
SIXF_TELEFRAG=64,
|
||||||
|
// 128 is used by Skulltag!
|
||||||
|
SIXF_TRANSFERAMBUSHFLAG=256,
|
||||||
|
};
|
||||||
|
|
||||||
static void InitSpawnedItem(AActor *self, AActor *mo, INTBOOL transfer_translation, INTBOOL setmaster, INTBOOL nocheckpos)
|
|
||||||
|
static void InitSpawnedItem(AActor *self, AActor *mo, int flags)
|
||||||
{
|
{
|
||||||
if (mo)
|
if (mo)
|
||||||
{
|
{
|
||||||
AActor * originator = self;
|
AActor * originator = self;
|
||||||
|
|
||||||
if (transfer_translation && !(mo->flags2 & MF2_DONTTRANSLATE))
|
if ((flags & SIXF_TRANSFERTRANSLATION) && !(mo->flags2 & MF2_DONTTRANSLATE))
|
||||||
{
|
{
|
||||||
mo->Translation = self->Translation;
|
mo->Translation = self->Translation;
|
||||||
}
|
}
|
||||||
|
@ -1365,9 +1378,16 @@ static void InitSpawnedItem(AActor *self, AActor *mo, INTBOOL transfer_translati
|
||||||
mo->angle=self->angle;
|
mo->angle=self->angle;
|
||||||
while (originator && isMissile(originator)) originator = originator->target;
|
while (originator && isMissile(originator)) originator = originator->target;
|
||||||
|
|
||||||
|
if (flags & SIXF_TELEFRAG)
|
||||||
|
{
|
||||||
|
P_TeleportMove(mo, mo->x, mo->y, mo->z, true);
|
||||||
|
// This is needed to ensure consistent behavior.
|
||||||
|
// Otherwise it will only spawn if nothing gets telefragged
|
||||||
|
flags |= SIXF_NOCHECKPOSITION;
|
||||||
|
}
|
||||||
if (mo->flags3&MF3_ISMONSTER)
|
if (mo->flags3&MF3_ISMONSTER)
|
||||||
{
|
{
|
||||||
if (!nocheckpos && !P_TestMobjLocation(mo))
|
if (!(flags&SIXF_NOCHECKPOSITION) && !P_TestMobjLocation(mo))
|
||||||
{
|
{
|
||||||
// The monster is blocked so don't spawn it at all!
|
// The monster is blocked so don't spawn it at all!
|
||||||
if (mo->CountsAsKill()) level.total_monsters--;
|
if (mo->CountsAsKill()) level.total_monsters--;
|
||||||
|
@ -1381,7 +1401,7 @@ static void InitSpawnedItem(AActor *self, AActor *mo, INTBOOL transfer_translati
|
||||||
{
|
{
|
||||||
// If this is a monster transfer all friendliness information
|
// If this is a monster transfer all friendliness information
|
||||||
mo->CopyFriendliness(originator, true);
|
mo->CopyFriendliness(originator, true);
|
||||||
if (setmaster) mo->master = originator; // don't let it attack you (optional)!
|
if (flags&SIXF_SETMASTER) mo->master = originator; // don't let it attack you (optional)!
|
||||||
}
|
}
|
||||||
else if (originator->player)
|
else if (originator->player)
|
||||||
{
|
{
|
||||||
|
@ -1459,7 +1479,8 @@ void A_SpawnItem(AActor * self)
|
||||||
self->y + FixedMul(distance, finesine[self->angle>>ANGLETOFINESHIFT]),
|
self->y + FixedMul(distance, finesine[self->angle>>ANGLETOFINESHIFT]),
|
||||||
self->z - self->floorclip + zheight, ALLOW_REPLACE);
|
self->z - self->floorclip + zheight, ALLOW_REPLACE);
|
||||||
|
|
||||||
InitSpawnedItem(self, mo, transfer_translation, useammo, false);
|
int flags = (transfer_translation? SIXF_TRANSFERTRANSLATION:0) + (useammo? SIXF_SETMASTER:0);
|
||||||
|
InitSpawnedItem(self, mo, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
@ -1469,19 +1490,6 @@ void A_SpawnItem(AActor * self)
|
||||||
// Enhanced spawning function
|
// Enhanced spawning function
|
||||||
//
|
//
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
enum SIX_Flags
|
|
||||||
{
|
|
||||||
SIXF_TRANSFERTRANSLATION=1,
|
|
||||||
SIXF_ABSOLUTEPOSITION=2,
|
|
||||||
SIXF_ABSOLUTEANGLE=4,
|
|
||||||
SIXF_ABSOLUTEMOMENTUM=8,
|
|
||||||
SIXF_SETMASTER=16,
|
|
||||||
SIXF_NOCHECKPOSITION=32,
|
|
||||||
SIXF_TELEFRAG=64,
|
|
||||||
// 128 is used by Skulltag!
|
|
||||||
SIXF_TRANSFERAMBUSHFLAG=256,
|
|
||||||
};
|
|
||||||
|
|
||||||
void A_SpawnItemEx(AActor * self)
|
void A_SpawnItemEx(AActor * self)
|
||||||
{
|
{
|
||||||
FState * CallingState;
|
FState * CallingState;
|
||||||
|
@ -1541,14 +1549,13 @@ void A_SpawnItemEx(AActor * self)
|
||||||
}
|
}
|
||||||
|
|
||||||
AActor * mo = Spawn( missile, x, y, self->z + self->floorclip + zofs, ALLOW_REPLACE);
|
AActor * mo = Spawn( missile, x, y, self->z + self->floorclip + zofs, ALLOW_REPLACE);
|
||||||
InitSpawnedItem(self, mo, (flags & SIXF_TRANSFERTRANSLATION), (flags&SIXF_SETMASTER), (flags&SIXF_NOCHECKPOSITION));
|
InitSpawnedItem(self, mo, flags);
|
||||||
if (mo)
|
if (mo)
|
||||||
{
|
{
|
||||||
mo->momx=xmom;
|
mo->momx=xmom;
|
||||||
mo->momy=ymom;
|
mo->momy=ymom;
|
||||||
mo->momz=zmom;
|
mo->momz=zmom;
|
||||||
mo->angle=Angle;
|
mo->angle=Angle;
|
||||||
if (flags & SIXF_TELEFRAG) P_TeleportMove(mo, mo->x, mo->y, mo->z, true);
|
|
||||||
if (flags & SIXF_TRANSFERAMBUSHFLAG) mo->flags = (mo->flags&~MF_AMBUSH) | (self->flags & MF_AMBUSH);
|
if (flags & SIXF_TRANSFERAMBUSHFLAG) mo->flags = (mo->flags&~MF_AMBUSH) | (self->flags & MF_AMBUSH);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -415,10 +415,31 @@ static void I_CheckGUICapture ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CUSTOM_CVAR(Int, mouse_capturemode, 1, CVAR_GLOBALCONFIG|CVAR_ARCHIVE)
|
||||||
|
{
|
||||||
|
if (self < 0) self = 0;
|
||||||
|
else if (self > 2) self = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool inGame()
|
||||||
|
{
|
||||||
|
switch (mouse_capturemode)
|
||||||
|
{
|
||||||
|
default:
|
||||||
|
case 0:
|
||||||
|
return gamestate == GS_LEVEL;
|
||||||
|
case 1:
|
||||||
|
return gamestate == GS_LEVEL || gamestate == GS_INTERMISSION || gamestate == GS_FINALE;
|
||||||
|
case 2:
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void I_CheckNativeMouse (bool preferNative)
|
void I_CheckNativeMouse (bool preferNative)
|
||||||
{
|
{
|
||||||
bool wantNative = !HaveFocus ||
|
bool wantNative = !HaveFocus ||
|
||||||
((!screen || !screen->IsFullscreen()) && (gamestate != GS_LEVEL || GUICapture || paused || preferNative || !use_mouse || demoplayback));
|
((!screen || !screen->IsFullscreen()) &&
|
||||||
|
(!inGame() || GUICapture || paused || preferNative || !use_mouse || demoplayback));
|
||||||
|
|
||||||
//Printf ("%d %d %d\n", wantNative, preferNative, NativeMouse);
|
//Printf ("%d %d %d\n", wantNative, preferNative, NativeMouse);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue