Merge branch 'master' into scripting

Conflicts:
	src/actor.h
	src/g_hexen/a_clericstaff.cpp
	src/p_enemy.cpp
	src/p_interaction.cpp
	src/p_local.h
	src/p_mobj.cpp
	src/thingdef/thingdef_codeptr.cpp
This commit is contained in:
Christoph Oelckers 2016-01-17 20:57:55 +01:00
commit bf747075e8
179 changed files with 10280 additions and 4787 deletions

View file

@ -356,9 +356,10 @@ static void MakeFountain (AActor *actor, int color1, int color2)
angle_t an = M_Random()<<(24-ANGLETOFINESHIFT);
fixed_t out = FixedMul (actor->radius, M_Random()<<8);
particle->x = actor->x + FixedMul (out, finecosine[an]);
particle->y = actor->y + FixedMul (out, finesine[an]);
particle->z = actor->z + actor->height + FRACUNIT;
fixedvec3 pos = actor->Vec3Offset(FixedMul(out, finecosine[an]), FixedMul(out, finesine[an]), actor->height + FRACUNIT);
particle->x = pos.x;
particle->y = pos.y;
particle->z = pos.z;
if (out < actor->radius/8)
particle->velz += FRACUNIT*10/3;
else
@ -395,9 +396,10 @@ void P_RunEffect (AActor *actor, int effects)
{
// Rocket trail
fixed_t backx = actor->x - FixedMul (finecosine[(moveangle)>>ANGLETOFINESHIFT], actor->radius*2);
fixed_t backy = actor->y - FixedMul (finesine[(moveangle)>>ANGLETOFINESHIFT], actor->radius*2);
fixed_t backz = actor->z - (actor->height>>3) * (actor->velz>>16) + (2*actor->height)/3;
fixed_t backx = - FixedMul (finecosine[(moveangle)>>ANGLETOFINESHIFT], actor->radius*2);
fixed_t backy = - FixedMul (finesine[(moveangle)>>ANGLETOFINESHIFT], actor->radius*2);
fixed_t backz = - (actor->height>>3) * (actor->velz>>16) + (2*actor->height)/3;
angle_t an = (moveangle + ANG90) >> ANGLETOFINESHIFT;
int speed;
@ -405,9 +407,13 @@ void P_RunEffect (AActor *actor, int effects)
particle = JitterParticle (3 + (M_Random() & 31));
if (particle) {
fixed_t pathdist = M_Random()<<8;
particle->x = backx - FixedMul(actor->velx, pathdist);
particle->y = backy - FixedMul(actor->vely, pathdist);
particle->z = backz - FixedMul(actor->velz, pathdist);
fixedvec3 pos = actor->Vec3Offset(
backx - FixedMul(actor->velx, pathdist),
backy - FixedMul(actor->vely, pathdist),
backz - FixedMul(actor->velz, pathdist));
particle->x = pos.x;
particle->y = pos.y;
particle->z = pos.z;
speed = (M_Random () - 128) * (FRACUNIT/200);
particle->velx += FixedMul (speed, finecosine[an]);
particle->vely += FixedMul (speed, finesine[an]);
@ -420,9 +426,13 @@ void P_RunEffect (AActor *actor, int effects)
particle_t *particle = JitterParticle (3 + (M_Random() & 31));
if (particle) {
fixed_t pathdist = M_Random()<<8;
particle->x = backx - FixedMul(actor->velx, pathdist);
particle->y = backy - FixedMul(actor->vely, pathdist);
particle->z = backz - FixedMul(actor->velz, pathdist) + (M_Random() << 10);
fixedvec3 pos = actor->Vec3Offset(
backx - FixedMul(actor->velx, pathdist),
backy - FixedMul(actor->vely, pathdist),
backz - FixedMul(actor->velz, pathdist) + (M_Random() << 10));
particle->x = pos.x;
particle->y = pos.y;
particle->z = pos.z;
speed = (M_Random () - 128) * (FRACUNIT/200);
particle->velx += FixedMul (speed, finecosine[an]);
particle->vely += FixedMul (speed, finesine[an]);
@ -441,10 +451,12 @@ void P_RunEffect (AActor *actor, int effects)
{
// Grenade trail
P_DrawSplash2 (6,
actor->x - FixedMul (finecosine[(moveangle)>>ANGLETOFINESHIFT], actor->radius*2),
actor->y - FixedMul (finesine[(moveangle)>>ANGLETOFINESHIFT], actor->radius*2),
actor->z - (actor->height>>3) * (actor->velz>>16) + (2*actor->height)/3,
fixedvec3 pos = actor->Vec3Offset(
-FixedMul(finecosine[(moveangle) >> ANGLETOFINESHIFT], actor->radius * 2),
-FixedMul(finesine[(moveangle) >> ANGLETOFINESHIFT], actor->radius * 2),
-(actor->height >> 3) * (actor->velz >> 16) + (2 * actor->height) / 3);
P_DrawSplash2 (6, pos.x, pos.y, pos.z,
moveangle + ANG180, 2, 2);
}
if (effects & FX_FOUNTAINMASK)
@ -476,10 +488,11 @@ void P_RunEffect (AActor *actor, int effects)
if (particle != NULL)
{
angle_t ang = M_Random () << (32-ANGLETOFINESHIFT-8);
particle->x = actor->x + FixedMul (actor->radius, finecosine[ang]);
particle->y = actor->y + FixedMul (actor->radius, finesine[ang]);
fixedvec3 pos = actor->Vec3Offset(FixedMul (actor->radius, finecosine[ang]), FixedMul (actor->radius, finesine[ang]), 0);
particle->x = pos.x;
particle->y = pos.y;
particle->z = pos.z;
particle->color = *protectColors[M_Random() & 1];
particle->z = actor->z;
particle->velz = FRACUNIT;
particle->accz = M_Random () << 7;
particle->size = 1;
@ -620,8 +633,8 @@ void P_DrawRailTrail(AActor *source, const TVector3<double> &start, const TVecto
double r;
double dirz;
if (abs(mo->x - FLOAT2FIXED(start.X)) < 20 * FRACUNIT
&& (mo->y - FLOAT2FIXED(start.Y)) < 20 * FRACUNIT)
if (abs(mo->X() - FLOAT2FIXED(start.X)) < 20 * FRACUNIT
&& (mo->Y() - FLOAT2FIXED(start.Y)) < 20 * FRACUNIT)
{ // This player (probably) fired the railgun
S_Sound (mo, CHAN_WEAPON, sound, 1, ATTN_NORM);
}
@ -631,7 +644,7 @@ void P_DrawRailTrail(AActor *source, const TVector3<double> &start, const TVecto
// Only consider sound in 2D (for now, anyway)
// [BB] You have to divide by lengthsquared here, not multiply with it.
r = ((start.Y - FIXED2DBL(mo->y)) * (-dir.Y) - (start.X - FIXED2DBL(mo->x)) * (dir.X)) / lengthsquared;
r = ((start.Y - FIXED2DBL(mo->Y())) * (-dir.Y) - (start.X - FIXED2DBL(mo->X())) * (dir.X)) / lengthsquared;
r = clamp<double>(r, 0., 1.);
dirz = dir.Z;
@ -833,9 +846,13 @@ void P_DisconnectEffect (AActor *actor)
if (!p)
break;
p->x = actor->x + ((M_Random()-128)<<9) * (actor->radius>>FRACBITS);
p->y = actor->y + ((M_Random()-128)<<9) * (actor->radius>>FRACBITS);
p->z = actor->z + (M_Random()<<8) * (actor->height>>FRACBITS);
fixedvec3 pos = actor->Vec3Offset(
((M_Random()-128)<<9) * (actor->radius>>FRACBITS),
((M_Random()-128)<<9) * (actor->radius>>FRACBITS),
(M_Random()<<8) * (actor->height>>FRACBITS));
p->x = pos.x;
p->y = pos.y;
p->z = pos.z;
p->accz -= FRACUNIT/4096;
p->color = M_Random() < 128 ? maroon1 : maroon2;
p->size = 4;