From 2c2b77754557ee054100f20c6ea2dc4b43ee8d64 Mon Sep 17 00:00:00 2001 From: Bryce Hutchings Date: Sun, 26 May 2002 05:16:56 +0000 Subject: [PATCH] pressure --- reaction/cgame/cg_effects.c | 15 ++++++++++++++- reaction/cgame/cg_event.c | 5 ++++- reaction/game/g_misc.c | 23 ++++++++++++++++------- 3 files changed, 34 insertions(+), 9 deletions(-) diff --git a/reaction/cgame/cg_effects.c b/reaction/cgame/cg_effects.c index 03d6a24e..e97b46d1 100644 --- a/reaction/cgame/cg_effects.c +++ b/reaction/cgame/cg_effects.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.31 2002/05/26 05:16:12 niceass +// pressure +// // Revision 1.30 2002/05/19 21:27:51 blaze // added force and buoyancy to breakables // @@ -1334,7 +1337,7 @@ void CG_BreakBreakable( centity_t *cent,int eParam, int number ) { } -void CG_Pressure( vec3_t origin, vec3_t dir, centity_t *cent ) +void CG_Pressure( vec3_t origin, vec3_t dir, int type, int speed ) { localEntity_t *le; refEntity_t *re; @@ -1342,6 +1345,16 @@ void CG_Pressure( vec3_t origin, vec3_t dir, centity_t *cent ) le = CG_AllocLocalEntity(); re = &le->refEntity; le->leType = LE_PRESSURE; + + if (type == 1) + le->leFlags = LEF_WATER; + else if (type == 2) + le->leFlags = LEF_FLAME; + else + le->leFlags = LEF_STEAM; + + le->size = (float)speed; // Size holds the speed.... yes... + VectorCopy(origin, le->pos.trBase); VectorCopy(dir, le->pos.trDelta); le->startTime = cg.time; diff --git a/reaction/cgame/cg_event.c b/reaction/cgame/cg_event.c index 1aa3fae4..dd8949c9 100644 --- a/reaction/cgame/cg_event.c +++ b/reaction/cgame/cg_event.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.57 2002/05/26 05:15:36 niceass +// pressure +// // Revision 1.56 2002/05/12 22:13:43 makro // Impact sounds // @@ -2617,7 +2620,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) { case EV_PRESSURE: DEBUGNAME("EV_PRESSURE"); ByteToDir(es->eventParm, dir); - CG_Pressure( position, dir, cent ); + CG_Pressure( position, dir, es->frame, es->powerups ); break; case EV_STOPLOOPINGSOUND: diff --git a/reaction/game/g_misc.c b/reaction/game/g_misc.c index 374ac369..6483aecf 100644 --- a/reaction/game/g_misc.c +++ b/reaction/game/g_misc.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.47 2002/05/26 05:16:56 niceass +// pressure +// // Revision 1.46 2002/05/25 16:31:18 blaze // moved breakable stuff over to config strings // @@ -877,8 +880,8 @@ void G_BreakGlass( gentity_t *ent, gentity_t *inflictor, gentity_t *attacker, ve } void SP_func_pressure( gentity_t *ent ) { + char *type; // Make it appear as the brush - G_Printf("Creating Pressure entity\n"); trap_SetBrushModel( ent, ent->model ); trap_LinkEntity (ent); @@ -886,10 +889,17 @@ void SP_func_pressure( gentity_t *ent ) { VectorCopy( ent->s.origin, ent->r.currentOrigin ); ent->s.eType = ET_PRESSURE; - G_SpawnInt( "speed", "0", &ent->size); + G_SpawnInt( "speed", "0", &ent->mass); // mass will hold speed... yeah... + G_SpawnString( "type", "steam", &type); - // ent->spawnflags - // flame, steam, water + if (ent->mass == 0) ent->mass = 200; + + if (!Q_stricmp(type, "water")) // bounce will hold pressure type... yeah... + ent->bounce = 1; + else if (!Q_stricmp(type, "flame") || !Q_stricmp(type, "fire")) + ent->bounce = 2; + else // steam is default + ent->bounce = 0; // ent->s.frame holds type // ent->s.powerups holds speed @@ -901,9 +911,8 @@ void G_CreatePressure(vec3_t origin, vec3_t normal, gentity_t *ent) { tent = G_TempEntity( origin, EV_PRESSURE ); tent->s.eventParm = DirToByte( normal ); - tent->s.frame = ent->spawnflags; // 1 = water, 2 = steam, 4 = fire - tent->s.powerups = ent->size; // speed of pressure - G_Printf("Game: %d and %d\n", tent->s.frame, tent->s.powerups); + tent->s.frame = ent->bounce; // 1 = water, 2 = flame, 0 = steam + tent->s.powerups = ent->mass; // speed of pressure }