diff options
author | Tim Angus <tim@ngus.net> | 2002-06-25 02:43:12 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2002-06-25 02:43:12 +0000 |
commit | 5a9bee68cd17b2b725528a7604ff7ebc18796225 (patch) | |
tree | e315aae9ad1a803dd18c7d3ca87f366a480e6aac | |
parent | 6c1109ac122cf9a9da1c0f1f15af2a618a189541 (diff) |
Zap now seperate from Tesla
-rw-r--r-- | src/cgame/cg_event.c | 5 | ||||
-rw-r--r-- | src/cgame/cg_local.h | 2 | ||||
-rw-r--r-- | src/cgame/cg_main.c | 2 | ||||
-rw-r--r-- | src/cgame/cg_weapons.c | 29 | ||||
-rw-r--r-- | src/game/bg_misc.c | 1 | ||||
-rw-r--r-- | src/game/bg_public.h | 1 | ||||
-rw-r--r-- | src/game/g_weapon.c | 4 |
7 files changed, 42 insertions, 2 deletions
diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c index b3c05a66..8ae10e0c 100644 --- a/src/cgame/cg_event.c +++ b/src/cgame/cg_event.c @@ -962,6 +962,11 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) CG_TeslaTrail( es->origin2, es->pos.trBase, es->generic1, es->clientNum ); break; + case EV_ALIENZAP: + DEBUGNAME("EV_ALIENZAP"); + CG_AlienZap( es->origin2, es->pos.trBase, es->generic1, es->clientNum ); + break; + case EV_BULLET_HIT_WALL: DEBUGNAME("EV_BULLET_HIT_WALL"); ByteToDir( es->eventParm, dir ); diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index c836040a..77606128 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -1197,6 +1197,7 @@ extern vmCvar_t cg_debugAnim; extern vmCvar_t cg_debugPosition; extern vmCvar_t cg_debugEvents; extern vmCvar_t cg_teslaTrailTime; +extern vmCvar_t cg_alienZapTime; extern vmCvar_t cg_railTrailTime; extern vmCvar_t cg_errorDecay; extern vmCvar_t cg_nopredict; @@ -1478,6 +1479,7 @@ void CG_LasGunHit( vec3_t origin, int sourceEntityNum, vec3_t normal, qboolean f void CG_RailTrail( vec3_t start, vec3_t end ); void CG_TeslaTrail( vec3_t start, vec3_t end, int srcENum, int destENum ); +void CG_AlienZap( vec3_t start, vec3_t end, int srcENum, int destENum ); void CG_GrappleTrail( centity_t *ent, const weaponInfo_t *wi ); void CG_AddViewWeapon (playerState_t *ps); void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent ); diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index 1ffc578f..4e771b77 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -83,6 +83,7 @@ itemInfo_t cg_items[MAX_ITEMS]; buildableInfo_t cg_buildables[ BA_NUM_BUILDABLES ]; vmCvar_t cg_teslaTrailTime; +vmCvar_t cg_alienZapTime; vmCvar_t cg_railTrailTime; vmCvar_t cg_centertime; vmCvar_t cg_runpitch; @@ -228,6 +229,7 @@ static cvarTable_t cvarTable[] = { { &cg_addMarks, "cg_marks", "1", CVAR_ARCHIVE }, { &cg_lagometer, "cg_lagometer", "1", CVAR_ARCHIVE }, { &cg_teslaTrailTime, "cg_teslaTrailTime", "600", CVAR_ARCHIVE }, + { &cg_alienZapTime, "cg_alienZapTime", "500", CVAR_ARCHIVE }, { &cg_railTrailTime, "cg_railTrailTime", "400", CVAR_ARCHIVE }, { &cg_gun_x, "cg_gunX", "0", CVAR_CHEAT }, { &cg_gun_y, "cg_gunY", "0", CVAR_CHEAT }, diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c index 8909285b..cc5e745b 100644 --- a/src/cgame/cg_weapons.c +++ b/src/cgame/cg_weapons.c @@ -309,6 +309,35 @@ void CG_TeslaTrail( vec3_t start, vec3_t end, int srcENum, int destENum ) /* ========================== +CG_AlienZap +========================== +*/ +void CG_AlienZap( vec3_t start, vec3_t end, int srcENum, int destENum ) +{ + localEntity_t *le; + refEntity_t *re; + + //add a bunch of bolt segments + le = CG_AllocLocalEntity(); + re = &le->refEntity; + + le->leType = LE_LIGHTNING_BOLT; + le->startTime = cg.time; + le->endTime = cg.time + cg_alienZapTime.value; + le->lifeRate = 1.0 / ( le->endTime - le->startTime ); + re->customShader = cgs.media.lightningShader; + + le->srcENum = srcENum; + le->destENum = destENum; + le->vOffset = -4; + le->maxRange = BG_FindRangeForBuildable( BA_H_DEF3 ); + + VectorCopy( start, re->origin ); + VectorCopy( end, re->oldorigin ); +} + +/* +========================== CG_RocketTrail ========================== */ diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index d7422b09..a7f4d440 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -3332,6 +3332,7 @@ char *eventnames[] = { "EV_ITEM_EXPLOSION", //TA: human item explosions "EV_RAILTRAIL", "EV_TESLATRAIL", + "EV_ALIENZAP", "EV_SHOTGUN", "EV_BULLET", // otherEntity is the shooter diff --git a/src/game/bg_public.h b/src/game/bg_public.h index bbaf6e53..c474357e 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -545,6 +545,7 @@ typedef enum { EV_ITEM_EXPLOSION, //TA: human item explosions EV_RAILTRAIL, EV_TESLATRAIL, + EV_ALIENZAP, EV_SHOTGUN, EV_BULLET, // otherEntity is the shooter diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index 9e751209..f75a33d6 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -772,7 +772,7 @@ void areaZapFire( gentity_t *ent ) SnapVectorTowards( tr.endpos, muzzle ); // send railgun beam effect - tent = G_TempEntity( enemy->s.pos.trBase, EV_TESLATRAIL ); + tent = G_TempEntity( enemy->s.pos.trBase, EV_ALIENZAP ); VectorCopy( muzzle, tent->s.origin2 ); @@ -844,7 +844,7 @@ void directZapFire( gentity_t *ent ) SnapVectorTowards( tr.endpos, muzzle ); // send railgun beam effect - tent = G_TempEntity( target->s.pos.trBase, EV_TESLATRAIL ); + tent = G_TempEntity( target->s.pos.trBase, EV_ALIENZAP ); VectorCopy( muzzle, tent->s.origin2 ); |