Some changed stuff

This commit is contained in:
P3rlE 2022-02-14 19:19:42 +01:00
parent 4e0d283892
commit fc96a4a2ca
4 changed files with 140 additions and 118 deletions

View file

@ -25,61 +25,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define MISSILE_PRESTEP_TIME 50
/*
================
G_HomingMissile
================
*/
#define ROCKET_SPEED 650
void rocket_think( gentity_t *ent )
{
gentity_t *target = NULL;
gentity_t *rad = NULL;
vec3_t dir, dir2, raddir, start;
while ((rad = findradius(rad, ent->r.currentOrigin, 1000)) != NULL)
{
if (!rad->client)
continue;
if (rad == ent->parent)
continue;
if (rad->health <= 0)
continue;
if (rad->client->sess.sessionTeam == TEAM_SPECTATOR)
continue;
if ( (g_gametype.integer == GT_TEAM || g_gametype.integer == GT_CTF || g_gametype.integer == GT_DOMINATION ) && rad->client->sess.sessionTeam == rad->parent->client->sess.sessionTeam)
continue;
if (!visible (ent, rad))
continue;
VectorSubtract(rad->r.currentOrigin, ent->r.currentOrigin, raddir);
raddir[2] += 16;
if ((target == NULL) || (VectorLength(raddir) < VectorLength(dir)))
{
target = rad;
VectorCopy(raddir, dir);
}
}
if (target != NULL)
{
VectorCopy( ent->r.currentOrigin, start );
VectorCopy( ent->r.currentAngles, dir2 );
VectorNormalize(dir);
VectorScale(dir, 0.2, dir);
VectorAdd(dir, dir2, dir);
VectorNormalize(dir);
VectorCopy( start, ent->s.pos.trBase );
VectorScale( dir, 400, ent->s.pos.trDelta );
SnapVector( ent->s.pos.trDelta );
VectorCopy (start, ent->r.currentOrigin);
VectorCopy (dir, ent->r.currentAngles);
}
ent->nextthink = level.time + 100;
}
/*
=================
@ -843,47 +788,6 @@ gentity_t *fire_plasma_bounce (gentity_t *self, vec3_t start, vec3_t dir) {
return bolt;
}
/*
=================
fire_grenade
=================
*/
gentity_t *fire_grenade (gentity_t *self, vec3_t start, vec3_t dir) {
gentity_t *bolt;
VectorNormalize (dir);
bolt = G_Spawn();
bolt->classname = "grenade";
bolt->nextthink = level.time + 2500;
bolt->think = G_ExplodeMissile;
bolt->s.eType = ET_MISSILE;
bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN;
bolt->s.weapon = WP_GRENADE_LAUNCHER;
bolt->s.eFlags = EF_BOUNCE_HALF;
bolt->r.ownerNum = self->s.number;
bolt->parent = self;
//bolt->damage = 100; //TBB - too high for short reload
bolt->damage = 40; //TBB
//bolt->splashDamage = 100; //TBB - too high for short reload
bolt->splashDamage = 20; //TBB
bolt->splashRadius = 150;
bolt->methodOfDeath = MOD_GRENADE;
bolt->splashMethodOfDeath = MOD_GRENADE_SPLASH;
bolt->clipmask = MASK_SHOT;
bolt->target_ent = NULL;
bolt->s.pos.trType = TR_GRAVITY;
bolt->s.pos.trTime = level.time - MISSILE_PRESTEP_TIME; // move a bit on the very first frame
VectorCopy( start, bolt->s.pos.trBase );
VectorScale( dir, 800, bolt->s.pos.trDelta );
SnapVector( bolt->s.pos.trDelta ); // save net bandwidth
VectorCopy (start, bolt->r.currentOrigin);
return bolt;
}
/*
=================
fire_cluster_grenade
@ -968,6 +872,47 @@ gentity_t *fire_cluster_grenade2 (gentity_t *self, vec3_t start, vec3_t dir) {
return bolt;
}
/*
=================
fire_grenade
=================
*/
gentity_t *fire_grenade (gentity_t *self, vec3_t start, vec3_t dir) {
gentity_t *bolt;
VectorNormalize (dir);
bolt = G_Spawn();
bolt->classname = "grenade";
bolt->nextthink = level.time + 2500;
bolt->think = G_ExplodeMissile;
bolt->s.eType = ET_MISSILE;
bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN;
bolt->s.weapon = WP_GRENADE_LAUNCHER;
bolt->s.eFlags = EF_BOUNCE_HALF;
bolt->r.ownerNum = self->s.number;
bolt->parent = self;
bolt->damage = 40;
bolt->splashDamage = 20;
bolt->splashRadius = 150;
bolt->methodOfDeath = MOD_GRENADE;
bolt->splashMethodOfDeath = MOD_GRENADE_SPLASH;
bolt->clipmask = MASK_SHOT;
bolt->target_ent = NULL;
bolt->s.pos.trType = TR_GRAVITY;
bolt->s.pos.trTime = level.time - MISSILE_PRESTEP_TIME; // move a bit on the very first frame
VectorCopy( start, bolt->s.pos.trBase );
VectorScale( dir, 800, bolt->s.pos.trDelta );
SnapVector( bolt->s.pos.trDelta ); // save net bandwidth
VectorCopy (start, bolt->r.currentOrigin);
return bolt;
}
//=============================================================================
@ -1014,6 +959,8 @@ gentity_t *fire_bfg (gentity_t *self, vec3_t start, vec3_t dir) {
//=============================================================================
/*
=================
fire_rocket
@ -1050,6 +997,61 @@ gentity_t *fire_rocket (gentity_t *self, vec3_t start, vec3_t dir) {
return bolt;
}
/*
================
G_HomingMissile
================
*/
#define ROCKET_SPEED 650
void rocket_think( gentity_t *ent )
{
gentity_t *target = NULL;
gentity_t *rad = NULL;
vec3_t dir, dir2, raddir, start;
while ((rad = findradius(rad, ent->r.currentOrigin, 1000)) != NULL)
{
if (!rad->client)
continue;
if (rad == ent->parent)
continue;
if (rad->health <= 0)
continue;
if (rad->client->sess.sessionTeam == TEAM_SPECTATOR)
continue;
if ( (g_gametype.integer == GT_TEAM || g_gametype.integer == GT_CTF || g_gametype.integer == GT_DOMINATION ) && rad->client->sess.sessionTeam == rad->parent->client->sess.sessionTeam)
continue;
if (!visible (ent, rad))
continue;
VectorSubtract(rad->r.currentOrigin, ent->r.currentOrigin, raddir);
raddir[2] += 16;
if ((target == NULL) || (VectorLength(raddir) < VectorLength(dir)))
{
target = rad;
VectorCopy(raddir, dir);
}
}
if (target != NULL)
{
VectorCopy( ent->r.currentOrigin, start );
VectorCopy( ent->r.currentAngles, dir2 );
VectorNormalize(dir);
VectorScale(dir, 0.2, dir);
VectorAdd(dir, dir2, dir);
VectorNormalize(dir);
VectorCopy( start, ent->s.pos.trBase );
VectorScale( dir, 400, ent->s.pos.trDelta );
SnapVector( ent->s.pos.trDelta );
VectorCopy (start, ent->r.currentOrigin);
VectorCopy (dir, ent->r.currentAngles);
}
ent->nextthink = level.time + 100;
}
/*
=================
fire_homing_rocket

View file

@ -734,7 +734,7 @@ void weapon_telefrag_fire (gentity_t *ent,vec3_t muzzle,vec3_t forward,vec3_t ri
trace_t trace;
gentity_t *tent;
gentity_t *traceEnt;
int damage = 1000;
int damage = 50;
int hits = 0;
int passent = ent->s.number;
@ -807,7 +807,7 @@ void weapon_telefrag_fire (gentity_t *ent,vec3_t muzzle,vec3_t forward,vec3_t ri
}
tent->s.clientNum = ent->s.clientNum;
// give the shooter a reward sound if they have made two railgun hits in a row
// give the shooter a reward sound if they have made two telefrag hits in a row
if ( hits == 0 )
{
// complete miss

View file

@ -67,7 +67,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define BASETA "missionpack"
#ifndef PRODUCT_VERSION
#define PRODUCT_VERSION "v0.3c_r478"
#define PRODUCT_VERSION "v0.3c_r481"
#endif

View file

@ -886,29 +886,49 @@ q3rallycode
engine\cross-make-mingw64.sh
[Open project files]
0=engine\code\qcommon\q_shared.h
1=engine\code\game\g_weapon.c
2=engine\code\game\g_missile.c
3=engine\code\game\g_local.h
4=engine\code\cgame\cg_main.c
5=engine\code\cgame\cg_playerstate.c
1=engine\code\game\g_missile.c
2=engine\code\game\g_local.h
3=engine\code\cgame\cg_event.c
4=engine\code\game\bg_misc.c
5=engine\code\game\bg_public.h
6=engine\code\cgame\cg_effects.c
7=engine\code\cgame\cg_rally_tools.c
8=engine\code\cgame\cg_weapons.c
9=engine\code\game\g_client.c
10=engine\code\game\g_items.c
[Selected Project Files]
Main=
Selected=engine\code\game\g_weapon.c
Selected=engine\code\game\g_missile.c
[engine\code\qcommon\q_shared.h]
TopLine=46
TopLine=58
Caret=36,70
[engine\code\game\g_weapon.c]
TopLine=699
Caret=35,710
[engine\code\game\g_missile.c]
TopLine=1066
Caret=1,1077
TopLine=1065
Caret=26,896
[engine\code\game\g_local.h]
TopLine=26
TopLine=627
Caret=30,42
[engine\code\cgame\cg_main.c]
TopLine=769
Caret=89,775
[engine\code\cgame\cg_playerstate.c]
TopLine=86
Caret=1,50
[engine\code\cgame\cg_event.c]
TopLine=1069
Caret=1,1085
[engine\code\game\bg_misc.c]
TopLine=1633
Caret=1,1651
[engine\code\game\bg_public.h]
TopLine=373
Caret=1,385
[engine\code\cgame\cg_effects.c]
TopLine=1121
Caret=1,1137
[engine\code\cgame\cg_rally_tools.c]
TopLine=160
Caret=1,166
[engine\code\cgame\cg_weapons.c]
TopLine=43
Caret=1,55
[engine\code\game\g_client.c]
TopLine=472
Caret=1,488
[engine\code\game\g_items.c]
TopLine=1044
Caret=1,1060