Skip to content

Commit

Permalink
Missile puff ptcgen issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Apr 29, 2003
1 parent 22c2830 commit b648407
Show file tree
Hide file tree
Showing 7 changed files with 143 additions and 69 deletions.
58 changes: 58 additions & 0 deletions doomsday/Defs/jDoom/Objects.ded
Expand Up @@ -11651,3 +11651,61 @@ State {
Frame = 32769;
Next state = "EXPLODE1";
}

# A_Tracer() spawns rocket puffs. This is copied from the original
# PUFF type.
Thing {
ID = "ROCKETPUFF";
DoomEd number = -1;
Spawn state = "ROCKETPUFF1";
See state = "NULL";
Pain state = "NULL";
Melee state = "NULL";
Missile state = "NULL";
Death state = "NULL";
Xdeath state = "NULL";
Raise state = "NULL";
See sound = "None";
Attack sound = "None";
Pain sound = "None";
Death sound = "None";
Active sound = "None";
Reaction time = 8;
Spawn health = 1000;
Radius = 8;
Height = 8;
Mass = 100;
Flags = "mf_noblockmap mf_nogravity mf_viewalign";
}

State {
ID = "ROCKETPUFF1";
Sprite = "PUFF";
Frame = 32768;
Tics = 4;
Next state = "ROCKETPUFF2";
}

State {
ID = "ROCKETPUFF2";
Sprite = "PUFF";
Frame = 1;
Tics = 4;
Next state = "ROCKETPUFF3";
}

State {
ID = "ROCKETPUFF3";
Sprite = "PUFF";
Frame = 2;
Tics = 4;
Next state = "ROCKETPUFF4";
}

State {
ID = "ROCKETPUFF4";
Sprite = "PUFF";
Frame = 3;
Tics = 4;
Next state = "NULL";
}
2 changes: 2 additions & 0 deletions doomsday/Doc/ChangeLog.txt
Expand Up @@ -19,6 +19,8 @@ jDoom:
+ cvar game-corpse-sliding: corpses slide down stairs and ledges
(defaults to zero due to some bad behaviour; e.g. exit room of D2/22)
* cvar game-corpsetime renamed to game-corpse-time
- A_Tracer() used to spawn puffs that were identical to bullet puffs,
this caused complications with particle generators

jHexen:
- fixed: sound sequence delays with repeating sounds (sequence updater
Expand Down
9 changes: 7 additions & 2 deletions doomsday/Include/jDoom/info.h
Expand Up @@ -1120,7 +1120,11 @@ typedef enum
S_TECH2LAMP4, // 966
S_SMALL_WHITE_LIGHT, // 967
S_TEMPSOUNDORIGIN1, // 968
NUMSTATES // 969
S_ROCKETPUFF1, // 969
S_ROCKETPUFF2, // 970
S_ROCKETPUFF3, // 971
S_ROCKETPUFF4, // 972
NUMSTATES // 973
} statenum_t;

// Map objects.
Expand Down Expand Up @@ -1265,7 +1269,8 @@ typedef enum
MT_MISC86, // 136
MT_LIGHTSOURCE, // 137
MT_TEMPSOUNDORIGIN, // 138
NUMMOBJTYPES // 139
MT_ROCKETPUFF, // 139
NUMMOBJTYPES // 140
} mobjtype_t;

// Text.
Expand Down
31 changes: 15 additions & 16 deletions doomsday/Include/jDoom/p_local.h
Expand Up @@ -140,22 +140,18 @@ extern int iquetail;

void P_RespawnSpecials (void);

mobj_t*
P_SpawnMobj
( fixed_t x,
fixed_t y,
fixed_t z,
mobjtype_t type );

void P_RemoveMobj (mobj_t* th);
boolean P_SetMobjState (mobj_t* mobj, statenum_t state);
void P_MobjThinker (mobj_t* mobj);

void P_SpawnPuff (fixed_t x, fixed_t y, fixed_t z);
void P_SpawnBlood (fixed_t x, fixed_t y, fixed_t z, int damage);
mobj_t* P_SpawnMissile (mobj_t* source, mobj_t* dest, mobjtype_t type);
void P_SpawnPlayerMissile (mobj_t* source, mobjtype_t type);
void P_SpawnPlayer (mapthing_t* mthing, int pnum);
mobj_t* P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type);

void P_RemoveMobj(mobj_t* th);
boolean P_SetMobjState(mobj_t* mobj, statenum_t state);
void P_MobjThinker(mobj_t* mobj);

void P_SpawnPuff(fixed_t x, fixed_t y, fixed_t z);
mobj_t* P_SpawnCustomPuff(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type);
void P_SpawnBlood(fixed_t x, fixed_t y, fixed_t z, int damage);
mobj_t* P_SpawnMissile(mobj_t* source, mobj_t* dest, mobjtype_t type);
void P_SpawnPlayerMissile(mobj_t* source, mobjtype_t type);
void P_SpawnPlayer(mapthing_t* mthing, int pnum);
mobj_t* P_SpawnTeleFog(int x, int y);

void P_SetDoomsdayFlags(mobj_t *mo);
Expand Down Expand Up @@ -341,6 +337,9 @@ void P_ExplodeMissile (mobj_t* mo);
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.2 2003/04/29 13:10:56 skyjake
// Missile puff ptcgen issue fixed
//
// Revision 1.1 2003/02/26 19:18:32 skyjake
// Initial checkin
//
Expand Down
7 changes: 3 additions & 4 deletions doomsday/Include/jDoom/p_mobj.h
Expand Up @@ -271,14 +271,13 @@ typedef struct mobj_s
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.3 2003/04/29 13:10:56 skyjake
// Missile puff ptcgen issue fixed
//
// Revision 1.2 2003/02/27 23:14:31 skyjake
// Obsolete jDoom files removed
//
// Revision 1.1 2003/02/26 19:18:32 skyjake
// Initial checkin
//
// Revision 1.1 2002/09/29 01:04:13 Jaakko
// Added all headers
//
//
//-----------------------------------------------------------------------------
67 changes: 34 additions & 33 deletions doomsday/Src/jDoom/p_enemy.c
Expand Up @@ -15,6 +15,9 @@
// for more details.
//
// $Log$
// Revision 1.3 2003/04/29 13:11:52 skyjake
// Missile puff ptcgen issue fixed
//
// Revision 1.2 2003/02/27 23:14:32 skyjake
// Obsolete jDoom files removed
//
Expand Down Expand Up @@ -1247,48 +1250,47 @@ void C_DECL A_Tracer (mobj_t* actor)
fixed_t slope;
mobj_t* dest;
mobj_t* th;

if (gametic & 3)
return;

if (gametic & 3) return;

// spawn a puff of smoke behind the rocket
P_SpawnPuff (actor->x, actor->y, actor->z);
P_SpawnCustomPuff(actor->x, actor->y, actor->z, MT_ROCKETPUFF);

th = P_SpawnMobj (actor->x-actor->momx,
actor->y-actor->momy,
actor->z, MT_SMOKE);
actor->z, MT_SMOKE);

th->momz = FRACUNIT;
th->tics -= P_Random()&3;
if (th->tics < 1)
th->tics = 1;
th->tics = 1;

// adjust direction
dest = actor->tracer;

if (!dest || dest->health <= 0)
return;
return;

// change angle
exact = R_PointToAngle2 (actor->x,
actor->y,
dest->x,
dest->y);

dest->x,
dest->y);
if (exact != actor->angle)
{
if (exact - actor->angle > 0x80000000)
{
actor->angle -= TRACEANGLE;
if (exact - actor->angle < 0x80000000)
actor->angle = exact;
}
else
{
actor->angle += TRACEANGLE;
if (exact - actor->angle > 0x80000000)
actor->angle = exact;
}
if (exact - actor->angle > 0x80000000)
{
actor->angle -= TRACEANGLE;
if (exact - actor->angle < 0x80000000)
actor->angle = exact;
}
else
{
actor->angle += TRACEANGLE;
if (exact - actor->angle > 0x80000000)
actor->angle = exact;
}
}

exact = actor->angle>>ANGLETOFINESHIFT;
Expand All @@ -1297,36 +1299,35 @@ void C_DECL A_Tracer (mobj_t* actor)

// change slope
dist = P_ApproxDistance (dest->x - actor->x,
dest->y - actor->y);
dest->y - actor->y);

dist = dist / actor->info->speed;

if (dist < 1)
dist = 1;

if (dist < 1) dist = 1;
slope = (dest->z+40*FRACUNIT - actor->z) / dist;

if (slope < actor->momz)
actor->momz -= FRACUNIT/8;
actor->momz -= FRACUNIT/8;
else
actor->momz += FRACUNIT/8;
actor->momz += FRACUNIT/8;
}


void C_DECL A_SkelWhoosh (mobj_t* actor)
{
if (!actor->target)
return;
return;
A_FaceTarget (actor);
S_StartSound(sfx_skeswg, actor);
}

void C_DECL A_SkelFist (mobj_t* actor)
{
int damage;

if (!actor->target)
return;
return;

A_FaceTarget (actor);

if (P_CheckMeleeRange (actor))
Expand Down
38 changes: 24 additions & 14 deletions doomsday/Src/jDoom/p_mobj.c
Expand Up @@ -15,6 +15,9 @@
// for more details.
//
// $Log$
// Revision 1.5 2003/04/29 13:11:53 skyjake
// Missile puff ptcgen issue fixed
//
// Revision 1.4 2003/04/26 14:44:02 skyjake
// Comment cleanup
//
Expand Down Expand Up @@ -1063,33 +1066,40 @@ void P_SpawnMapThing (mapthing_t* mthing)
//
extern fixed_t attackrange;

void
P_SpawnPuff
( fixed_t x,
fixed_t y,
fixed_t z )
//===========================================================================
// P_SpawnCustomPuff
//===========================================================================
mobj_t* P_SpawnCustomPuff(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
{
mobj_t* th;

// Clients do not spawn puffs.
if(IS_CLIENT) return;
if(IS_CLIENT) return NULL;

z += ((P_Random()-P_Random())<<10);
z += ((P_Random()-P_Random()) << 10);

th = P_SpawnMobj (x,y,z, MT_PUFF);
th = P_SpawnMobj(x, y, z, type);
th->momz = FRACUNIT;
th->tics -= P_Random()&3;

if (th->tics < 1)
th->tics = 1;
// Make it last at least one tic.
if(th->tics < 1) th->tics = 1;

return th;
}

//===========================================================================
// P_SpawnPuff
//===========================================================================
void P_SpawnPuff(fixed_t x, fixed_t y, fixed_t z)
{
mobj_t* th = P_SpawnCustomPuff(x, y, z, MT_PUFF);

// don't make punches spark on the wall
if (attackrange == MELEERANGE)
P_SetMobjState (th, S_PUFF3);
if(th && attackrange == MELEERANGE)
P_SetMobjState(th, S_PUFF3);
}



//===========================================================================
// P_SpawnBlood
//===========================================================================
Expand Down

0 comments on commit b648407

Please sign in to comment.