Merge pull request #4 from rheit/master

This commit is contained in:
MajorCooke 2014-09-29 14:23:28 -05:00
commit 7a6e704af6
12 changed files with 180 additions and 43 deletions

View file

@ -109,6 +109,9 @@ Note: All <bool> fields default to false unless mentioned otherwise.
clipmidtex = <bool>; // Line's mid textures are clipped to floor and ceiling.
wrapmidtex = <bool>; // Line's mid textures are wrapped.
midtex3d = <bool>; // Actors can walk on mid texture.
midtex3dimpassible = <bool>;// Used in conjuction with midtex3d - causes the mid
// texture to behave like an impassible line (projectiles
// pass through it).
checkswitchrange = <bool>; // Switches can only be activated when vertically reachable.
blockprojectiles = <bool>; // Line blocks all projectiles
blockuse = <bool>; // Line blocks all use actions

View file

@ -56,6 +56,13 @@ AActor *COPY_AAPTR(AActor *origin, int selector)
case AAPTR_TRACER: return origin->tracer;
case AAPTR_FRIENDPLAYER:
return origin->FriendPlayer ? AAPTR_RESOLVE_PLAYERNUM(origin->FriendPlayer - 1) : NULL;
case AAPTR_GET_LINETARGET:
{
AActor *gettarget = NULL;
P_BulletSlope(origin, &gettarget);
return gettarget;
}
}
}

View file

@ -36,12 +36,13 @@ enum AAPTR
AAPTR_PLAYER8 = 0x2000,
AAPTR_FRIENDPLAYER = 0x4000,
AAPTR_GET_LINETARGET = 0x8000,
AAPTR_PLAYER_SELECTORS =
AAPTR_PLAYER_GETTARGET|AAPTR_PLAYER_GETCONVERSATION,
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_PLAYER1|AAPTR_PLAYER2|AAPTR_PLAYER3|AAPTR_PLAYER4|

View file

@ -162,6 +162,7 @@ enum ELineFlags
ML_BLOCKUSE = 0x02000000, // blocks all use actions through this line
ML_BLOCKSIGHT = 0x04000000, // blocks monster line of sight
ML_BLOCKHITSCAN = 0x08000000, // blocks hitscan attacks
ML_3DMIDTEX_IMPASS = 0x10000000, // [TP] if 3D midtex, behaves like a height-restricted ML_BLOCKING
};

View file

@ -299,6 +299,7 @@ xx(ACS_NamedExecuteWithResult)
xx(CallACS)
xx(Sqrt)
xx(CheckClass)
xx(IsPointerEqual)
// Various actor names which are used internally
xx(MapSpot)
@ -419,6 +420,7 @@ xx(Passuse)
xx(Repeatspecial)
xx(Conversation)
xx(Locknumber)
xx(Midtex3dimpassible)
xx(Playercross)
xx(Playeruse)

View file

@ -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)
{
// [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;
open.abovemidtex = false;

View file

@ -4373,6 +4373,8 @@ enum EACSFunctions
ACSF_GetArmorInfo,
ACSF_DropInventory,
ACSF_PickActor,
ACSF_IsPointerEqual,
ACSF_CanRaiseActor,
/* Zandronum's - these must be skipped when we reach 99!
-100:ResetMap(0),
@ -5630,6 +5632,42 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
}
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:
break;
}

View file

@ -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_RemoveThing(AActor * actor);
bool P_Thing_Raise(AActor *thing);
bool P_Thing_CanRaise(AActor *thing);
const PClass *P_GetSpawnableType(int spawnnum);
//

View file

@ -445,6 +445,40 @@ bool P_Thing_Raise(AActor *thing)
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)
{
if (actor != NULL)

View file

@ -1030,11 +1030,16 @@ public:
Flag(ld->flags, ML_BLOCKHITSCAN, key);
continue;
// [Dusk] lock number
// [TP] Locks the special with a key
case NAME_Locknumber:
ld->locknumber = CheckInt(key);
continue;
// [TP] Causes a 3d midtex to behave like an impassible line
case NAME_Midtex3dimpassible:
Flag(ld->flags, ML_3DMIDTEX_IMPASS, key);
continue;
default:
break;
}
@ -1081,6 +1086,10 @@ public:
{
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);
}
}
//===========================================================================

View file

@ -261,3 +261,36 @@ class FxGlobalFunctionCall_CheckClass : public FxGlobalFunctionCall
};
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);

View file

@ -279,24 +279,25 @@ Const Int BLOCKF_USE = 128;
// Pointer constants, bitfield-enabled
Const Int AAPTR_DEFAULT = 0;
Const Int AAPTR_NULL = 1;
Const Int AAPTR_TARGET = 2;
Const Int AAPTR_MASTER = 4;
Const Int AAPTR_TRACER = 8;
Const Int AAPTR_NULL = 0x1;
Const Int AAPTR_TARGET = 0x2;
Const Int AAPTR_MASTER = 0x4;
Const Int AAPTR_TRACER = 0x8;
Const Int AAPTR_PLAYER_GETTARGET = 16;
Const Int AAPTR_PLAYER_GETCONVERSATION = 32;
Const Int AAPTR_PLAYER_GETTARGET = 0x10;
Const Int AAPTR_PLAYER_GETCONVERSATION = 0x20;
Const Int AAPTR_PLAYER1 = 64;
Const Int AAPTR_PLAYER2 = 128;
Const Int AAPTR_PLAYER3 = 256;
Const Int AAPTR_PLAYER4 = 512;
Const Int AAPTR_PLAYER5 = 1024;
Const Int AAPTR_PLAYER6 = 2048;
Const Int AAPTR_PLAYER7 = 4096;
Const Int AAPTR_PLAYER8 = 8192;
Const Int AAPTR_PLAYER1 = 0x40;
Const Int AAPTR_PLAYER2 = 0x80;
Const Int AAPTR_PLAYER3 = 0x100;
Const Int AAPTR_PLAYER4 = 0x200;
Const Int AAPTR_PLAYER5 = 0x400;
Const Int AAPTR_PLAYER6 = 0x800;
Const Int AAPTR_PLAYER7 = 0x1000;
Const Int AAPTR_PLAYER8 = 0x2000;
Const Int AAPTR_FRIENDPLAYER = 16384;
Const Int AAPTR_FRIENDPLAYER = 0x4000;
Const Int AAPTR_LINETARGET = 0x8000;
// Pointer operation flags