Skip to content

Commit

Permalink
Fixed jHeretic/jHexen: Minotaur floor fire moving too fast.
Browse files Browse the repository at this point in the history
  • Loading branch information
danij committed Jun 15, 2009
1 parent e2be205 commit 7bdb14d
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 36 deletions.
63 changes: 33 additions & 30 deletions doomsday/plugins/jheretic/src/p_enemy.c
Expand Up @@ -1372,17 +1372,17 @@ void C_DECL A_SorDBon(mobj_t *actor)
S_StartSound(SFX_SORDBON, NULL);
}

void C_DECL A_SorSightSnd(mobj_t *actor)
void C_DECL A_SorSightSnd(mobj_t* actor)
{
S_StartSound(SFX_SORSIT, NULL);
}

/**
* Minotaur Melee attack.
*/
void C_DECL A_MinotaurAtk1(mobj_t *actor)
void C_DECL A_MinotaurAtk1(mobj_t* actor)
{
player_t *player;
player_t* player;

if(!actor->target)
return;
Expand All @@ -1404,11 +1404,11 @@ void C_DECL A_MinotaurAtk1(mobj_t *actor)
/**
* Minotaur : Choose a missile attack.
*/
void C_DECL A_MinotaurDecide(mobj_t *actor)
void C_DECL A_MinotaurDecide(mobj_t* actor)
{
uint an;
mobj_t *target;
float dist;
uint an;
mobj_t* target;
float dist;

target = actor->target;
if(!target)
Expand Down Expand Up @@ -1452,15 +1452,15 @@ void C_DECL A_MinotaurDecide(mobj_t *actor)
}
}

void C_DECL A_MinotaurCharge(mobj_t *actor)
void C_DECL A_MinotaurCharge(mobj_t* actor)
{
mobj_t* puff;

if(actor->special1)
{
puff = P_SpawnMobj3fv(MT_PHOENIXPUFF, actor->pos, P_Random() << 24, 0);
puff = P_SpawnMobj3fv(MT_PHOENIXPUFF, actor->pos,
P_Random() << 24, 0);
puff->mom[MZ] = 2;

actor->special1--;
}
else
Expand All @@ -1473,11 +1473,9 @@ void C_DECL A_MinotaurCharge(mobj_t *actor)
/**
* Minotaur : Swing attack.
*/
void C_DECL A_MinotaurAtk2(mobj_t *actor)
void C_DECL A_MinotaurAtk2(mobj_t* actor)
{
mobj_t *mo;
angle_t angle;
float momZ;
mobj_t* mo;

if(!actor->target)
return;
Expand All @@ -1493,10 +1491,10 @@ void C_DECL A_MinotaurAtk2(mobj_t *actor)
mo = P_SpawnMissile(MT_MNTRFX1, actor, actor->target, true);
if(mo)
{
S_StartSound(SFX_MINAT2, mo);
angle_t angle = mo->angle;
float momZ = mo->mom[MZ];

momZ = mo->mom[MZ];
angle = mo->angle;
S_StartSound(SFX_MINAT2, mo);

P_SpawnMissileAngle(MT_MNTRFX1, actor, angle - (ANG45 / 8), momZ);
P_SpawnMissileAngle(MT_MNTRFX1, actor, angle + (ANG45 / 8), momZ);
Expand Down Expand Up @@ -1537,10 +1535,10 @@ void C_DECL A_MinotaurAtk3(mobj_t* actor)
* When an attempt is made to spawn MT_MNTRFX2 (the Maulotaur's
* ground flame) the z coordinate is set to ONFLOORZ but if the
* Maulotaur's feet are currently clipped (i.e., it is in a sector
* whose terrain info is set to clip) then FOOTCLIPSIZE is subtracted
* from the z coordinate. So when P_SpawnMobj is called,
* z != ONFLOORZ, so rather than being set to the height of the floor
* it is left at 2146838915 (float: 32758.162).
* whose terrain info is set to clip) then FOOTCLIPSIZE is
* subtracted from the z coordinate. So when P_SpawnMobj is called,
* z != ONFLOORZ, so rather than being set to the height of the
* floor it is left at 2146838915 (float: 32758.162).
*
* This in turn means that when P_TryMove is called (via
* P_CheckMissileSpawn), the test which is there to check whether a
Expand Down Expand Up @@ -1581,30 +1579,35 @@ void C_DECL A_MinotaurAtk3(mobj_t* actor)
}
}

void C_DECL A_MntrFloorFire(mobj_t *actor)
void C_DECL A_MntrFloorFire(mobj_t* actor)
{
mobj_t* mo;
float pos[3];
angle_t angle;

// Make sure we are on the floor.
actor->pos[VZ] = actor->floorZ;

pos[VX] = actor->pos[VX] + FIX2FLT((P_Random() - P_Random()) << 10);
pos[VY] = actor->pos[VY] + FIX2FLT((P_Random() - P_Random()) << 10);
pos[VX] = actor->pos[VX];
pos[VY] = actor->pos[VY];
pos[VZ] = 0;

pos[VX] += FIX2FLT((P_Random() - P_Random()) << 10);
pos[VY] += FIX2FLT((P_Random() - P_Random()) << 10);

angle = R_PointToAngle2(actor->pos[VX], actor->pos[VY],
pos[VX], pos[VY]);

mo = P_SpawnMobj3fv(MT_MNTRFX3, pos, angle, MTF_Z_FLOOR);

mo->target = actor->target;
mo->mom[MX] = 1.f / 16; // Force block checking.
if((mo = P_SpawnMobj3fv(MT_MNTRFX3, pos, angle, MTF_Z_FLOOR)))
{
mo->target = actor->target;
mo->mom[MX] = FIX2FLT(1); // Force block checking.

P_CheckMissileSpawn(mo);
P_CheckMissileSpawn(mo);
}
}

void C_DECL A_BeastAttack(mobj_t *actor)
void C_DECL A_BeastAttack(mobj_t* actor)
{
if(!actor->target)
return;
Expand Down
12 changes: 6 additions & 6 deletions doomsday/plugins/jhexen/src/p_enemy.c
Expand Up @@ -1329,7 +1329,7 @@ void C_DECL A_MinotaurAtk3(mobj_t *actor)
}
}

void C_DECL A_MntrFloorFire(mobj_t *actor)
void C_DECL A_MntrFloorFire(mobj_t* actor)
{
mobj_t* mo;
float pos[3];
Expand All @@ -1343,21 +1343,21 @@ void C_DECL A_MntrFloorFire(mobj_t *actor)
pos[VZ] = 0;

pos[VX] += FIX2FLT((P_Random() - P_Random()) << 10);
pos[VY] += FIX2FLT((P_Random() - P_Random()) << 10),
pos[VY] += FIX2FLT((P_Random() - P_Random()) << 10);

angle = R_PointToAngle2(actor->pos[VX], actor->pos[VY],
pos[VX], pos[VY]);

mo = P_SpawnMobj3fv(MT_MNTRFX3, pos, angle, MTF_Z_FLOOR);
if(mo)
if((mo = P_SpawnMobj3fv(MT_MNTRFX3, pos, angle, MTF_Z_FLOOR)))
{
mo->target = actor->target;
mo->mom[MX] = 1; // Force block checking.
mo->mom[MX] = FIX2FLT(1); // Force block checking.

P_CheckMissileSpawn(mo);
}
}

void C_DECL A_Scream(mobj_t *actor)
void C_DECL A_Scream(mobj_t* actor)
{
int sound;

Expand Down

0 comments on commit 7bdb14d

Please sign in to comment.