mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 07:12:02 +00:00
Merge pull request #4 from rheit/master
This commit is contained in:
commit
7a6e704af6
12 changed files with 180 additions and 43 deletions
|
@ -92,30 +92,33 @@ Note: All <bool> fields default to false unless mentioned otherwise.
|
||||||
|
|
||||||
linedef
|
linedef
|
||||||
{
|
{
|
||||||
alpha = <float>; // Translucency of this line, default is 1.0
|
alpha = <float>; // Translucency of this line, default is 1.0
|
||||||
renderstyle = <string>; // Render style, can be "translucent" or "add",
|
renderstyle = <string>; // Render style, can be "translucent" or "add",
|
||||||
// default is "translucent".
|
// default is "translucent".
|
||||||
playeruseback = <bool>; // New SPAC flag, true = player can use from back side.
|
playeruseback = <bool> ; // New SPAC flag, true = player can use from back side.
|
||||||
anycross = <bool>; // New SPAC flag, true = any non-projectile
|
anycross = <bool>; // New SPAC flag, true = any non-projectile
|
||||||
// crossing will trigger this line
|
// crossing will trigger this line
|
||||||
monsteractivate = <bool>; // Monsters can trigger this line.
|
monsteractivate = <bool>; // Monsters can trigger this line.
|
||||||
// For compatibility only because this flag's
|
// For compatibility only because this flag's
|
||||||
// semantics can not be fully reproduced with
|
// semantics can not be fully reproduced with
|
||||||
// explicit trigger flags.
|
// explicit trigger flags.
|
||||||
blockplayers = <bool>; // Line blocks players' movement.
|
blockplayers = <bool>; // Line blocks players' movement.
|
||||||
blockeverything = <bool>; // Line blocks everything.
|
blockeverything = <bool>; // Line blocks everything.
|
||||||
firstsideonly = <bool>; // Line can only be triggered from the front side.
|
firstsideonly = <bool>; // Line can only be triggered from the front side.
|
||||||
zoneboundary = <bool>; // Line is a boundary for sound reverb zones.
|
zoneboundary = <bool>; // Line is a boundary for sound reverb zones.
|
||||||
clipmidtex = <bool>; // Line's mid textures are clipped to floor and ceiling.
|
clipmidtex = <bool>; // Line's mid textures are clipped to floor and ceiling.
|
||||||
wrapmidtex = <bool>; // Line's mid textures are wrapped.
|
wrapmidtex = <bool>; // Line's mid textures are wrapped.
|
||||||
midtex3d = <bool>; // Actors can walk on mid texture.
|
midtex3d = <bool>; // Actors can walk on mid texture.
|
||||||
checkswitchrange = <bool>;// Switches can only be activated when vertically reachable.
|
midtex3dimpassible = <bool>;// Used in conjuction with midtex3d - causes the mid
|
||||||
blockprojectiles = <bool>;// Line blocks all projectiles
|
// texture to behave like an impassible line (projectiles
|
||||||
blockuse = <bool>; // Line blocks all use actions
|
// pass through it).
|
||||||
blocksight = <bool>; // Line blocks monster line of sight
|
checkswitchrange = <bool>; // Switches can only be activated when vertically reachable.
|
||||||
blockhitscan = <bool>; // Line blocks hitscan attacks
|
blockprojectiles = <bool>; // Line blocks all projectiles
|
||||||
locknumber = <int>; // Line special is locked
|
blockuse = <bool>; // Line blocks all use actions
|
||||||
arg0str = <string>; // Alternate string-based version of arg0
|
blocksight = <bool>; // Line blocks monster line of sight
|
||||||
|
blockhitscan = <bool>; // Line blocks hitscan attacks
|
||||||
|
locknumber = <int>; // Line special is locked
|
||||||
|
arg0str = <string>; // Alternate string-based version of arg0
|
||||||
|
|
||||||
transparent = <bool>; // true = line is a Strife transparent line (alpha 0.25)
|
transparent = <bool>; // true = line is a Strife transparent line (alpha 0.25)
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,13 @@ AActor *COPY_AAPTR(AActor *origin, int selector)
|
||||||
case AAPTR_TRACER: return origin->tracer;
|
case AAPTR_TRACER: return origin->tracer;
|
||||||
case AAPTR_FRIENDPLAYER:
|
case AAPTR_FRIENDPLAYER:
|
||||||
return origin->FriendPlayer ? AAPTR_RESOLVE_PLAYERNUM(origin->FriendPlayer - 1) : NULL;
|
return origin->FriendPlayer ? AAPTR_RESOLVE_PLAYERNUM(origin->FriendPlayer - 1) : NULL;
|
||||||
|
|
||||||
|
case AAPTR_GET_LINETARGET:
|
||||||
|
{
|
||||||
|
AActor *gettarget = NULL;
|
||||||
|
P_BulletSlope(origin, &gettarget);
|
||||||
|
return gettarget;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,12 +36,13 @@ enum AAPTR
|
||||||
AAPTR_PLAYER8 = 0x2000,
|
AAPTR_PLAYER8 = 0x2000,
|
||||||
|
|
||||||
AAPTR_FRIENDPLAYER = 0x4000,
|
AAPTR_FRIENDPLAYER = 0x4000,
|
||||||
|
AAPTR_GET_LINETARGET = 0x8000,
|
||||||
|
|
||||||
AAPTR_PLAYER_SELECTORS =
|
AAPTR_PLAYER_SELECTORS =
|
||||||
AAPTR_PLAYER_GETTARGET|AAPTR_PLAYER_GETCONVERSATION,
|
AAPTR_PLAYER_GETTARGET|AAPTR_PLAYER_GETCONVERSATION,
|
||||||
|
|
||||||
AAPTR_GENERAL_SELECTORS =
|
AAPTR_GENERAL_SELECTORS =
|
||||||
AAPTR_TARGET|AAPTR_MASTER|AAPTR_TRACER|AAPTR_FRIENDPLAYER,
|
AAPTR_TARGET|AAPTR_MASTER|AAPTR_TRACER|AAPTR_FRIENDPLAYER|AAPTR_GET_LINETARGET,
|
||||||
|
|
||||||
AAPTR_STATIC_SELECTORS =
|
AAPTR_STATIC_SELECTORS =
|
||||||
AAPTR_PLAYER1|AAPTR_PLAYER2|AAPTR_PLAYER3|AAPTR_PLAYER4|
|
AAPTR_PLAYER1|AAPTR_PLAYER2|AAPTR_PLAYER3|AAPTR_PLAYER4|
|
||||||
|
|
|
@ -162,6 +162,7 @@ enum ELineFlags
|
||||||
ML_BLOCKUSE = 0x02000000, // blocks all use actions through this line
|
ML_BLOCKUSE = 0x02000000, // blocks all use actions through this line
|
||||||
ML_BLOCKSIGHT = 0x04000000, // blocks monster line of sight
|
ML_BLOCKSIGHT = 0x04000000, // blocks monster line of sight
|
||||||
ML_BLOCKHITSCAN = 0x08000000, // blocks hitscan attacks
|
ML_BLOCKHITSCAN = 0x08000000, // blocks hitscan attacks
|
||||||
|
ML_3DMIDTEX_IMPASS = 0x10000000, // [TP] if 3D midtex, behaves like a height-restricted ML_BLOCKING
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -299,6 +299,7 @@ xx(ACS_NamedExecuteWithResult)
|
||||||
xx(CallACS)
|
xx(CallACS)
|
||||||
xx(Sqrt)
|
xx(Sqrt)
|
||||||
xx(CheckClass)
|
xx(CheckClass)
|
||||||
|
xx(IsPointerEqual)
|
||||||
|
|
||||||
// Various actor names which are used internally
|
// Various actor names which are used internally
|
||||||
xx(MapSpot)
|
xx(MapSpot)
|
||||||
|
@ -419,6 +420,7 @@ xx(Passuse)
|
||||||
xx(Repeatspecial)
|
xx(Repeatspecial)
|
||||||
xx(Conversation)
|
xx(Conversation)
|
||||||
xx(Locknumber)
|
xx(Locknumber)
|
||||||
|
xx(Midtex3dimpassible)
|
||||||
|
|
||||||
xx(Playercross)
|
xx(Playercross)
|
||||||
xx(Playeruse)
|
xx(Playeruse)
|
||||||
|
@ -597,4 +599,4 @@ xx(NeverSwitchOnPickup)
|
||||||
xx(MoveBob)
|
xx(MoveBob)
|
||||||
xx(StillBob)
|
xx(StillBob)
|
||||||
xx(PlayerClass)
|
xx(PlayerClass)
|
||||||
xx(Wi_NoAutostartMap)
|
xx(Wi_NoAutostartMap)
|
||||||
|
|
|
@ -258,6 +258,13 @@ bool P_GetMidTexturePosition(const line_t *line, int sideno, fixed_t *ptextop, f
|
||||||
|
|
||||||
bool P_LineOpening_3dMidtex(AActor *thing, const line_t *linedef, FLineOpening &open, bool restrict)
|
bool P_LineOpening_3dMidtex(AActor *thing, const line_t *linedef, FLineOpening &open, bool restrict)
|
||||||
{
|
{
|
||||||
|
// [TP] Impassible-like 3dmidtextures do not block missiles
|
||||||
|
if ((linedef->flags & ML_3DMIDTEX_IMPASS)
|
||||||
|
&& (thing->flags & MF_MISSILE || thing->BounceFlags & BOUNCE_MBF))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
fixed_t tt, tb;
|
fixed_t tt, tb;
|
||||||
|
|
||||||
open.abovemidtex = false;
|
open.abovemidtex = false;
|
||||||
|
|
|
@ -4373,6 +4373,8 @@ enum EACSFunctions
|
||||||
ACSF_GetArmorInfo,
|
ACSF_GetArmorInfo,
|
||||||
ACSF_DropInventory,
|
ACSF_DropInventory,
|
||||||
ACSF_PickActor,
|
ACSF_PickActor,
|
||||||
|
ACSF_IsPointerEqual,
|
||||||
|
ACSF_CanRaiseActor,
|
||||||
|
|
||||||
/* Zandronum's - these must be skipped when we reach 99!
|
/* Zandronum's - these must be skipped when we reach 99!
|
||||||
-100:ResetMap(0),
|
-100:ResetMap(0),
|
||||||
|
@ -5630,6 +5632,42 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ACSF_IsPointerEqual:
|
||||||
|
{
|
||||||
|
int tid1 = 0, tid2 = 0;
|
||||||
|
switch (argCount)
|
||||||
|
{
|
||||||
|
case 4: tid2 = args[3];
|
||||||
|
case 3: tid1 = args[2];
|
||||||
|
}
|
||||||
|
|
||||||
|
actor = SingleActorFromTID(tid1, activator);
|
||||||
|
AActor * actor2 = tid2 == tid1 ? actor : SingleActorFromTID(tid2, activator);
|
||||||
|
|
||||||
|
return COPY_AAPTR(actor, args[0]) == COPY_AAPTR(actor2, args[1]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ACSF_CanRaiseActor:
|
||||||
|
if (argCount >= 1) {
|
||||||
|
if (args[0] == 0) {
|
||||||
|
actor = SingleActorFromTID(args[0], activator);
|
||||||
|
if (actor != NULL) {
|
||||||
|
return P_Thing_CanRaise(actor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FActorIterator iterator(args[0]);
|
||||||
|
bool canraiseall = false;
|
||||||
|
while ((actor = iterator.Next()))
|
||||||
|
{
|
||||||
|
canraiseall = !P_Thing_CanRaise(actor) | canraiseall;
|
||||||
|
}
|
||||||
|
|
||||||
|
return !canraiseall;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -171,6 +171,7 @@ int P_Thing_Damage (int tid, AActor *whofor0, int amount, FName type);
|
||||||
void P_Thing_SetVelocity(AActor *actor, fixed_t vx, fixed_t vy, fixed_t vz, bool add, bool setbob);
|
void P_Thing_SetVelocity(AActor *actor, fixed_t vx, fixed_t vy, fixed_t vz, bool add, bool setbob);
|
||||||
void P_RemoveThing(AActor * actor);
|
void P_RemoveThing(AActor * actor);
|
||||||
bool P_Thing_Raise(AActor *thing);
|
bool P_Thing_Raise(AActor *thing);
|
||||||
|
bool P_Thing_CanRaise(AActor *thing);
|
||||||
const PClass *P_GetSpawnableType(int spawnnum);
|
const PClass *P_GetSpawnableType(int spawnnum);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -445,6 +445,40 @@ bool P_Thing_Raise(AActor *thing)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool P_Thing_CanRaise(AActor *thing)
|
||||||
|
{
|
||||||
|
FState * RaiseState = thing->GetRaiseState();
|
||||||
|
if (RaiseState == NULL)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
AActor *info = thing->GetDefault();
|
||||||
|
|
||||||
|
// Check against real height and radius
|
||||||
|
int oldflags = thing->flags;
|
||||||
|
fixed_t oldheight = thing->height;
|
||||||
|
fixed_t oldradius = thing->radius;
|
||||||
|
|
||||||
|
thing->flags |= MF_SOLID;
|
||||||
|
thing->height = info->height;
|
||||||
|
thing->radius = info->radius;
|
||||||
|
|
||||||
|
bool check = P_CheckPosition (thing, thing->x, thing->y);
|
||||||
|
|
||||||
|
// Restore checked properties
|
||||||
|
thing->flags = oldflags;
|
||||||
|
thing->radius = oldradius;
|
||||||
|
thing->height = oldheight;
|
||||||
|
|
||||||
|
if (!check)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void P_Thing_SetVelocity(AActor *actor, fixed_t vx, fixed_t vy, fixed_t vz, bool add, bool setbob)
|
void P_Thing_SetVelocity(AActor *actor, fixed_t vx, fixed_t vy, fixed_t vz, bool add, bool setbob)
|
||||||
{
|
{
|
||||||
if (actor != NULL)
|
if (actor != NULL)
|
||||||
|
|
|
@ -1030,11 +1030,16 @@ public:
|
||||||
Flag(ld->flags, ML_BLOCKHITSCAN, key);
|
Flag(ld->flags, ML_BLOCKHITSCAN, key);
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// [Dusk] lock number
|
// [TP] Locks the special with a key
|
||||||
case NAME_Locknumber:
|
case NAME_Locknumber:
|
||||||
ld->locknumber = CheckInt(key);
|
ld->locknumber = CheckInt(key);
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// [TP] Causes a 3d midtex to behave like an impassible line
|
||||||
|
case NAME_Midtex3dimpassible:
|
||||||
|
Flag(ld->flags, ML_3DMIDTEX_IMPASS, key);
|
||||||
|
continue;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1081,6 +1086,10 @@ public:
|
||||||
{
|
{
|
||||||
ld->args[1] = -FName(arg1str);
|
ld->args[1] = -FName(arg1str);
|
||||||
}
|
}
|
||||||
|
if ((ld->flags & ML_3DMIDTEX_IMPASS) && !(ld->flags & ML_3DMIDTEX)) // [TP]
|
||||||
|
{
|
||||||
|
Printf ("Line %d has midtex3dimpassible without midtex3d.\n", index);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
|
@ -260,4 +260,37 @@ class FxGlobalFunctionCall_CheckClass : public FxGlobalFunctionCall
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
GLOBALFUNCTION_ADDER(CheckClass);
|
GLOBALFUNCTION_ADDER(CheckClass);
|
||||||
|
|
||||||
|
//==========================================================================
|
||||||
|
//
|
||||||
|
// Function: ispointerequal
|
||||||
|
//
|
||||||
|
//==========================================================================
|
||||||
|
|
||||||
|
class FxGlobalFunctionCall_IsPointerEqual : public FxGlobalFunctionCall
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
GLOBALFUNCTION_DEFINE(IsPointerEqual);
|
||||||
|
|
||||||
|
FxExpression *Resolve(FCompileContext& ctx)
|
||||||
|
{
|
||||||
|
CHECKRESOLVED();
|
||||||
|
|
||||||
|
if (!ResolveArgs(ctx, 2, 2, true))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
ValueType = VAL_Int;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
ExpVal EvalExpression(AActor *self)
|
||||||
|
{
|
||||||
|
ExpVal ret;
|
||||||
|
ret.Type = VAL_Int;
|
||||||
|
ret.Int = COPY_AAPTR(self, (*ArgList)[0]->EvalExpression(self).GetInt()) == COPY_AAPTR(self, (*ArgList)[1]->EvalExpression(self).GetInt());
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
GLOBALFUNCTION_ADDER(IsPointerEqual);
|
|
@ -279,24 +279,25 @@ Const Int BLOCKF_USE = 128;
|
||||||
// Pointer constants, bitfield-enabled
|
// Pointer constants, bitfield-enabled
|
||||||
|
|
||||||
Const Int AAPTR_DEFAULT = 0;
|
Const Int AAPTR_DEFAULT = 0;
|
||||||
Const Int AAPTR_NULL = 1;
|
Const Int AAPTR_NULL = 0x1;
|
||||||
Const Int AAPTR_TARGET = 2;
|
Const Int AAPTR_TARGET = 0x2;
|
||||||
Const Int AAPTR_MASTER = 4;
|
Const Int AAPTR_MASTER = 0x4;
|
||||||
Const Int AAPTR_TRACER = 8;
|
Const Int AAPTR_TRACER = 0x8;
|
||||||
|
|
||||||
Const Int AAPTR_PLAYER_GETTARGET = 16;
|
Const Int AAPTR_PLAYER_GETTARGET = 0x10;
|
||||||
Const Int AAPTR_PLAYER_GETCONVERSATION = 32;
|
Const Int AAPTR_PLAYER_GETCONVERSATION = 0x20;
|
||||||
|
|
||||||
Const Int AAPTR_PLAYER1 = 64;
|
Const Int AAPTR_PLAYER1 = 0x40;
|
||||||
Const Int AAPTR_PLAYER2 = 128;
|
Const Int AAPTR_PLAYER2 = 0x80;
|
||||||
Const Int AAPTR_PLAYER3 = 256;
|
Const Int AAPTR_PLAYER3 = 0x100;
|
||||||
Const Int AAPTR_PLAYER4 = 512;
|
Const Int AAPTR_PLAYER4 = 0x200;
|
||||||
Const Int AAPTR_PLAYER5 = 1024;
|
Const Int AAPTR_PLAYER5 = 0x400;
|
||||||
Const Int AAPTR_PLAYER6 = 2048;
|
Const Int AAPTR_PLAYER6 = 0x800;
|
||||||
Const Int AAPTR_PLAYER7 = 4096;
|
Const Int AAPTR_PLAYER7 = 0x1000;
|
||||||
Const Int AAPTR_PLAYER8 = 8192;
|
Const Int AAPTR_PLAYER8 = 0x2000;
|
||||||
|
|
||||||
Const Int AAPTR_FRIENDPLAYER = 16384;
|
Const Int AAPTR_FRIENDPLAYER = 0x4000;
|
||||||
|
Const Int AAPTR_LINETARGET = 0x8000;
|
||||||
|
|
||||||
// Pointer operation flags
|
// Pointer operation flags
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue