This commit is contained in:
Christoph Oelckers 2013-07-22 23:01:58 +02:00
commit ba2faee125
16 changed files with 80 additions and 47 deletions

View File

@ -140,6 +140,7 @@ public:
int SpawnMask;
FNameNoInit MorphWeapon;
fixed_t AttackZOffset; // attack height, relative to player center
fixed_t UseRange; // [NS] Distance at which player can +use
const PClass *FlechetteType;
// [CW] Fades for when you are being damaged.

View File

@ -112,6 +112,9 @@ FRandom pr_acs ("ACS");
#define NOT_FLOOR 8
#define NOT_CEILING 16
// LineAtack flags
#define FHF_NORANDOMPUFFZ 1
// SpawnDecal flags
#define SDF_ABSANGLE 1
#define SDF_PERMANENT 2
@ -4966,10 +4969,13 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args, const
FName pufftype = argCount > 4 && args[4]? FName(FBehavior::StaticLookupString(args[4])) : NAME_BulletPuff;
FName damagetype = argCount > 5 && args[5]? FName(FBehavior::StaticLookupString(args[5])) : NAME_None;
fixed_t range = argCount > 6 && args[6]? args[6] : MISSILERANGE;
int flags = argCount > 7 && args[7]? args[7] : 0;
int fhflags = (flags & FHF_NORANDOMPUFFZ)? LAF_NORANDOMPUFFZ : 0;
if (args[0] == 0)
{
P_LineAttack(activator, angle, range, pitch, damage, damagetype, pufftype);
P_LineAttack(activator, angle, range, pitch, damage, damagetype, pufftype, fhflags);
}
else
{
@ -4978,7 +4984,7 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args, const
while ((source = it.Next()) != NULL)
{
P_LineAttack(activator, angle, range, pitch, damage, damagetype, pufftype);
P_LineAttack(activator, angle, range, pitch, damage, damagetype, pufftype, fhflags);
}
}
}
@ -5556,7 +5562,8 @@ int DLevelScript::RunScript ()
case PCD_PUSHFUNCTION:
{
int funcnum = NEXTBYTE;
PushToStack(funcnum | activeBehavior->GetLibraryID());
// Not technically a string, but since we use the same tagging mechanism
PushToStack(TAGSTR(funcnum));
break;
}
case PCD_CALL:
@ -5572,7 +5579,7 @@ int DLevelScript::RunScript ()
if(pcd == PCD_CALLSTACK)
{
funcnum = STACK(1);
module = FBehavior::StaticGetModule(funcnum>>16);
module = FBehavior::StaticGetModule(funcnum>>LIBRARYID_SHIFT);
--sp;
funcnum &= 0xFFFF; // Clear out tag
@ -8449,7 +8456,8 @@ scriptwait:
case PCD_SAVESTRING:
// Saves the string
{
PushToStack(GlobalACSStrings.AddString(work, Stack, sp));
const int str = GlobalACSStrings.AddString(work, Stack, sp);
PushToStack(str);
STRINGBUILDER_FINISH(work);
}
break;

View File

@ -4359,14 +4359,17 @@ bool P_NoWayTraverse (AActor *usething, fixed_t endx, fixed_t endy)
void P_UseLines (player_t *player)
{
angle_t angle;
fixed_t x1, y1;
fixed_t x1, y1, usedist;
bool foundline;
foundline = false;
angle = player->mo->angle >> ANGLETOFINESHIFT;
x1 = player->mo->x + (USERANGE>>FRACBITS)*finecosine[angle];
y1 = player->mo->y + (USERANGE>>FRACBITS)*finesine[angle];
usedist = player->mo->UseRange;
// [NS] Now queries the Player's UseRange.
x1 = player->mo->x + FixedMul(usedist, finecosine[angle]);
y1 = player->mo->y + FixedMul(usedist, finesine[angle]);
// old code:
//
@ -4398,13 +4401,20 @@ void P_UseLines (player_t *player)
bool P_UsePuzzleItem (AActor *PuzzleItemUser, int PuzzleItemType)
{
int angle;
fixed_t x1, y1, x2, y2;
fixed_t x1, y1, x2, y2, usedist;
angle = PuzzleItemUser->angle>>ANGLETOFINESHIFT;
x1 = PuzzleItemUser->x;
y1 = PuzzleItemUser->y;
x2 = x1+(USERANGE>>FRACBITS)*finecosine[angle];
y2 = y1+(USERANGE>>FRACBITS)*finesine[angle];
// [NS] If it's a Player, get their UseRange.
if (PuzzleItemUser->player)
usedist = PuzzleItemUser->player->mo->UseRange;
else
usedist = USERANGE;
x2 = x1 + FixedMul(usedist, finecosine[angle]);
y2 = y1 + FixedMul(usedist, finesine[angle]);
FPathTraverse it(x1, y1, x2, y2, PT_ADDLINES|PT_ADDTHINGS);
intercept_t *in;

View File

@ -473,6 +473,10 @@ void APlayerPawn::Serialize (FArchive &arc)
{
arc << GruntSpeed << FallingScreamMinSpeed << FallingScreamMaxSpeed;
}
if (SaveVersion >= 4502)
{
arc << UseRange;
}
}
//===========================================================================

View File

@ -1318,7 +1318,7 @@ void FMODSoundRenderer::DumpDriverCaps(FMOD_CAPS caps, int minfrequency, int max
{
Printf("\n");
}
if (caps & FMOD_CAPS_REVERB_LIMITED) Printf("TEXTCOLOR_OLIVE Limited reverb\n");
if (caps & FMOD_CAPS_REVERB_LIMITED) Printf(TEXTCOLOR_OLIVE " Limited reverb\n");
}
//==========================================================================

View File

@ -2410,6 +2410,15 @@ DEFINE_CLASS_PROPERTY_PREFIX(player, viewheight, F, PlayerPawn)
defaults->ViewHeight = z;
}
//==========================================================================
//
//==========================================================================
DEFINE_CLASS_PROPERTY_PREFIX(player, userange, F, PlayerPawn)
{
PROP_FIXED_PARM(z, 0);
defaults->UseRange = z;
}
//==========================================================================
//
//==========================================================================

View File

@ -76,7 +76,7 @@ const char *GetVersionString();
// Use 4500 as the base git save version, since it's higher than the
// SVN revision ever got.
#define SAVEVER 4501
#define SAVEVER 4502
#define SAVEVERSTRINGIFY2(x) #x
#define SAVEVERSTRINGIFY(x) SAVEVERSTRINGIFY2(x)

View File

@ -24,6 +24,7 @@ Actor PlayerPawn : Actor native
Player.GruntSpeed 12
Player.FallingScreamSpeed 35,40
Player.ViewHeight 41
Player.UseRange 64
Player.ForwardMove 1,1
Player.SideMove 1,1
Player.ColorRange 0,0