diff options
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/bg_misc.c | 4 | ||||
-rw-r--r-- | src/game/bg_pmove.c | 28 | ||||
-rw-r--r-- | src/game/bg_public.h | 11 | ||||
-rw-r--r-- | src/game/g_buildable.c | 16 | ||||
-rw-r--r-- | src/game/g_cmds.c | 12 | ||||
-rw-r--r-- | src/game/g_missile.c | 12 | ||||
-rw-r--r-- | src/game/g_weapon.c | 16 |
7 files changed, 71 insertions, 28 deletions
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index eca4e53d..70136c4d 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -2615,8 +2615,8 @@ weaponAttributes_t bg_weapons[ ] = 0, //int price; ( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages SLOT_WEAPON, //int slots; - "groundpound", //char *weaponName; - "Ground Pound", //char *weaponHumanName; + "charge", //char *weaponName; + "Charge", //char *weaponHumanName; 0, //int quan; 0, //int clips; 0, //int maxClips; diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index 31f76844..39ac8c12 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -484,7 +484,8 @@ static qboolean PM_CheckPounce( void ) { vec3_t forward; - if( pm->ps->weapon != WP_POUNCE && pm->ps->weapon != WP_POUNCE_UPG ) + if( pm->ps->weapon != WP_POUNCE && + pm->ps->weapon != WP_POUNCE_UPG ) return qfalse; if( pm->cmd.buttons & BUTTON_ATTACK2 ) @@ -545,11 +546,14 @@ static qboolean PM_CheckJump( void ) return qfalse; //can't jump and pounce charge at the same time - if( ( pm->ps->weapon == WP_POUNCE || pm->ps->weapon == WP_POUNCE_UPG ) && pm->ps->stats[ STAT_MISC ] > 0 ) + if( ( pm->ps->weapon == WP_POUNCE || + pm->ps->weapon == WP_POUNCE_UPG ) && + pm->ps->stats[ STAT_MISC ] > 0 ) return qfalse; //can't jump and charge at the same time - if( ( pm->ps->weapon == WP_CHARGE ) && pm->ps->stats[ STAT_MISC ] > 0 ) + if( ( pm->ps->weapon == WP_CHARGE ) && + pm->ps->stats[ STAT_MISC ] > 0 ) return qfalse; if( ( pm->ps->stats[ STAT_PTEAM ] == PTE_HUMANS ) && @@ -2483,11 +2487,11 @@ Generates weapon events and modifes the weapon counter */ static void PM_Weapon( void ) { - int addTime = 200; //default addTime - should never be used - int ammo, clips, maxclips; - qboolean attack1 = qfalse; - qboolean attack2 = qfalse; - qboolean attack3 = qfalse; + int addTime = 200; //default addTime - should never be used + int ammo, clips, maxclips; + qboolean attack1 = qfalse; + qboolean attack2 = qfalse; + qboolean attack3 = qfalse; // don't allow attack until all buttons are up if( pm->ps->pm_flags & PMF_RESPAWNED ) @@ -2695,6 +2699,7 @@ static void PM_Weapon( void ) return; } + pm->ps->generic1 = WPM_TERTIARY; PM_AddEvent( EV_FIRE_WEAPON3 ); addTime = BG_FindRepeatRate3ForWeapon( pm->ps->weapon ); } @@ -2709,6 +2714,7 @@ static void PM_Weapon( void ) { if( BG_WeaponHasAltMode( pm->ps->weapon ) ) { + pm->ps->generic1 = WPM_SECONDARY; PM_AddEvent( EV_FIRE_WEAPON2 ); addTime = BG_FindRepeatRate2ForWeapon( pm->ps->weapon ); } @@ -2721,6 +2727,7 @@ static void PM_Weapon( void ) } else if( attack1 ) { + pm->ps->generic1 = WPM_PRIMARY; PM_AddEvent( EV_FIRE_WEAPON ); addTime = BG_FindRepeatRate1ForWeapon( pm->ps->weapon ); } @@ -2731,12 +2738,14 @@ static void PM_Weapon( void ) switch( pm->ps->weapon ) { case WP_VENOM: + pm->ps->generic1 = WPM_PRIMARY; PM_AddEvent( EV_FIRE_WEAPON ); addTime = BG_FindRepeatRate1ForWeapon( pm->ps->weapon ); break; case WP_POUNCE: case WP_POUNCE_UPG: + pm->ps->generic1 = WPM_SECONDARY; PM_AddEvent( EV_FIRE_WEAPON2 ); addTime = BG_FindRepeatRate2ForWeapon( pm->ps->weapon ); break; @@ -2971,7 +2980,8 @@ void trap_SnapVector( float *v ); void PmoveSingle (pmove_t *pmove) { - int ammo, clips, maxclips; + int ammo, clips, maxclips; + pm = pmove; BG_unpackAmmoArray( pm->ps->weapon, pm->ps->ammo, pm->ps->powerups, &ammo, &clips, &maxclips ); diff --git a/src/game/bg_public.h b/src/game/bg_public.h index ad7404df..def97d26 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -313,6 +313,17 @@ typedef enum typedef enum { + WPM_NONE, + + WPM_PRIMARY, + WPM_SECONDARY, + WPM_TERTIARY, + + WPM_NUM_WEAPONMODES +} weaponMode_t; + +typedef enum +{ WP_NONE, WP_VENOM, diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index 50b64f1c..2d4a19c7 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -1280,10 +1280,12 @@ Use for human power repeater */ void HRpt_Use( gentity_t *self, gentity_t *other, gentity_t *activator ) { - int maxAmmo, maxClips; - int ammo, clips; - + int maxAmmo, maxClips; + int ammo, clips; + weapon_t weapon; playerState_t *ps = &activator->client->ps; + + weapon = ps->weapon; if( !self->spawned ) return; @@ -1291,15 +1293,15 @@ void HRpt_Use( gentity_t *self, gentity_t *other, gentity_t *activator ) if( activator->client->lastRefilTime + ENERGY_REFIL_TIME > level.time ) return; - if( !BG_FindUsesEnergyForWeapon( ps->weapon ) ) + if( !BG_FindUsesEnergyForWeapon( weapon ) ) return; - BG_FindAmmoForWeapon( ps->weapon, &maxAmmo, NULL, &maxClips ); + BG_FindAmmoForWeapon( weapon, &maxAmmo, NULL, &maxClips ); if( BG_gotItem( UP_BATTPACK, ps->stats ) ) maxAmmo = (int)( (float)maxAmmo * BATTPACK_MODIFIER ); - BG_unpackAmmoArray( ps->weapon, ps->ammo, ps->powerups, &ammo, &clips, NULL ); + BG_unpackAmmoArray( weapon, ps->ammo, ps->powerups, &ammo, &clips, NULL ); if( ammo == maxAmmo && clips < maxClips ) { @@ -1313,7 +1315,7 @@ void HRpt_Use( gentity_t *self, gentity_t *other, gentity_t *activator ) if( ammo > maxAmmo ) ammo = maxAmmo; - BG_packAmmoArray( ps->weapon, ps->ammo, ps->powerups, ammo, clips, maxClips ); + BG_packAmmoArray( weapon, ps->ammo, ps->powerups, ammo, clips, maxClips ); G_AddEvent( activator, EV_RPTUSE_SOUND, 0 ); activator->client->lastRefilTime = level.time; diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 9c2c7143..12cc7dff 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -1170,7 +1170,8 @@ void Cmd_Destroy_f( gentity_t *ent, qboolean deconstruct ) else G_FreeEntity( traceEnt ); - ent->client->ps.stats[ STAT_MISC ] += BG_FindBuildDelayForWeapon( ent->s.weapon ) >> 1; + ent->client->ps.stats[ STAT_MISC ] += + BG_FindBuildDelayForWeapon( ent->s.weapon ) >> 1; } } } @@ -1728,11 +1729,10 @@ void Cmd_Test_f( gentity_t *ent ) if( !CheatsOk( ent ) ) return; - G_Printf( "%d %d %d\n", - ent->client->sess.sessionTeam, - ent->client->ps.stats[ STAT_PTEAM ], - ent->client->ps.persistant[ PERS_TEAM ] - ); + ent->client->ps.stats[ STAT_STATE ] |= SS_POISONCLOUDED; + ent->client->lastPoisonCloudedTime = level.time; + ent->client->lastPoisonCloudedClient = ent; + G_AddPredictableEvent( ent, EV_POISONCLOUD, 0 ); } /* diff --git a/src/game/g_missile.c b/src/game/g_missile.c index 8eb4169f..ac2a46e8 100644 --- a/src/game/g_missile.c +++ b/src/game/g_missile.c @@ -76,7 +76,8 @@ void G_ExplodeMissile( gentity_t *ent ) ent->s.eType = ET_GENERAL; //TA: tired... can't be fucked... hack - if( ent->s.weapon != WP_LOCKBLOB_LAUNCHER && ent->s.weapon != WP_FLAMER ) + if( ent->s.weapon != WP_LOCKBLOB_LAUNCHER && + ent->s.weapon != WP_FLAMER ) G_AddEvent( ent, EV_MISSILE_MISS, DirToByte( dir ) ); ent->freeAfterEvent = qtrue; @@ -292,6 +293,7 @@ gentity_t *fire_flamer( gentity_t *self, vec3_t start, vec3_t dir ) bolt->s.eType = ET_MISSILE; bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN; bolt->s.weapon = WP_FLAMER; + bolt->s.generic1 = self->s.generic1; //weaponMode bolt->r.ownerNum = self->s.number; bolt->parent = self; bolt->damage = FLAMER_DMG; @@ -335,6 +337,7 @@ gentity_t *fire_blaster( gentity_t *self, vec3_t start, vec3_t dir ) bolt->s.eType = ET_MISSILE; bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN; bolt->s.weapon = WP_BLASTER; + bolt->s.generic1 = self->s.generic1; //weaponMode bolt->r.ownerNum = self->s.number; bolt->parent = self; bolt->damage = BLASTER_DMG; @@ -377,6 +380,7 @@ gentity_t *fire_pulseRifle( gentity_t *self, vec3_t start, vec3_t dir ) bolt->s.eType = ET_MISSILE; bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN; bolt->s.weapon = WP_PULSE_RIFLE; + bolt->s.generic1 = self->s.generic1; //weaponMode bolt->r.ownerNum = self->s.number; bolt->parent = self; bolt->damage = PRIFLE_DMG; @@ -421,12 +425,12 @@ gentity_t *fire_luciferCannon( gentity_t *self, vec3_t start, vec3_t dir, int da bolt->s.eType = ET_MISSILE; bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN; bolt->s.weapon = WP_LUCIFER_CANNON; + bolt->s.generic1 = self->s.generic1; //weaponMode bolt->r.ownerNum = self->s.number; bolt->parent = self; bolt->damage = localDamage; bolt->splashDamage = localDamage / 2; bolt->splashRadius = localDamage; - bolt->s.generic1 = damage; bolt->methodOfDeath = MOD_LCANNON; bolt->splashMethodOfDeath = MOD_LCANNON_SPLASH; bolt->clipmask = MASK_SHOT; @@ -554,6 +558,7 @@ gentity_t *fire_hive( gentity_t *self, vec3_t start, vec3_t dir ) bolt->s.eFlags |= EF_BOUNCE|EF_NO_BOUNCE_SOUND; bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN; bolt->s.weapon = WP_HIVE; + bolt->s.generic1 = WPM_PRIMARY; //weaponMode bolt->r.ownerNum = self->s.number; bolt->parent = self; bolt->damage = HIVE_DMG; @@ -593,6 +598,7 @@ gentity_t *fire_lockblob( gentity_t *self, vec3_t start, vec3_t dir ) bolt->s.eType = ET_MISSILE; bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN; bolt->s.weapon = WP_LOCKBLOB_LAUNCHER; + bolt->s.generic1 = self->s.generic1; //weaponMode bolt->r.ownerNum = self->s.number; bolt->parent = self; bolt->damage = 0; @@ -630,6 +636,7 @@ gentity_t *fire_slowBlob( gentity_t *self, vec3_t start, vec3_t dir ) bolt->s.eType = ET_MISSILE; bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN; bolt->s.weapon = WP_POUNCE_UPG; + bolt->s.generic1 = self->s.generic1; //weaponMode bolt->r.ownerNum = self->s.number; bolt->parent = self; bolt->damage = DRAGOON_SLOWBLOB_DMG; @@ -668,6 +675,7 @@ gentity_t *fire_paraLockBlob( gentity_t *self, vec3_t start, vec3_t dir ) bolt->s.eType = ET_MISSILE; bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN; bolt->s.weapon = WP_LOCKBLOB_LAUNCHER; + bolt->s.generic1 = self->s.generic1; //weaponMode bolt->r.ownerNum = self->s.number; bolt->parent = self; bolt->damage = 0; diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index 1b1de4ab..6adf48a1 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -96,6 +96,7 @@ void meleeAttack( gentity_t *ent, float range, int damage, meansOfDeath_t mod ) tent->s.otherEntityNum = traceEnt->s.number; tent->s.eventParm = DirToByte( tr.plane.normal ); tent->s.weapon = ent->s.weapon; + tent->s.generic1 = ent->s.generic1; //weaponMode } if ( traceEnt->takedamage ) @@ -188,11 +189,14 @@ void massDriverFire( gentity_t *ent ) tent->s.otherEntityNum = traceEnt->s.number; tent->s.eventParm = DirToByte( tr.plane.normal ); tent->s.weapon = ent->s.weapon; + tent->s.generic1 = ent->s.generic1; //weaponMode } else { tent = G_TempEntity( tr.endpos, EV_MISSILE_MISS ); tent->s.eventParm = DirToByte( tr.plane.normal ); + tent->s.weapon = ent->s.weapon; + tent->s.generic1 = ent->s.generic1; //weaponMode } if( traceEnt->takedamage ) @@ -316,18 +320,21 @@ void lasGunFire( gentity_t *ent ) // snap the endpos to integers, but nudged towards the line SnapVectorTowards( tr.endpos, muzzle ); - // send bullet impact + // send impact if( traceEnt->takedamage && traceEnt->client ) { tent = G_TempEntity( tr.endpos, EV_MISSILE_HIT ); tent->s.otherEntityNum = traceEnt->s.number; tent->s.eventParm = DirToByte( tr.plane.normal ); tent->s.weapon = ent->s.weapon; + tent->s.generic1 = ent->s.generic1; //weaponMode } else { tent = G_TempEntity( tr.endpos, EV_MISSILE_MISS ); tent->s.eventParm = DirToByte( tr.plane.normal ); + tent->s.weapon = ent->s.weapon; + tent->s.generic1 = ent->s.generic1; //weaponMode } tent->s.otherEntityNum = ent->s.number; @@ -370,6 +377,7 @@ void painSawFire( gentity_t *ent ) tent->s.otherEntityNum = traceEnt->s.number; tent->s.eventParm = DirToByte( tr.plane.normal ); tent->s.weapon = ent->s.weapon; + tent->s.generic1 = ent->s.generic1; //weaponMode } if ( traceEnt->takedamage ) @@ -545,7 +553,8 @@ void buildFire( gentity_t *ent, dynMenu_t menu ) if( G_ValidateBuild( ent, ent->client->ps.stats[ STAT_BUILDABLE ] & ~SB_VALID_TOGGLEBIT ) ) { ent->client->ps.stats[ STAT_BUILDABLE ] = BA_NONE; - ent->client->ps.stats[ STAT_MISC ] += BG_FindBuildDelayForWeapon( ent->s.weapon ); + ent->client->ps.stats[ STAT_MISC ] += + BG_FindBuildDelayForWeapon( ent->s.weapon ); } return; } @@ -605,6 +614,7 @@ qboolean CheckVenomAttack( gentity_t *ent ) tent->s.otherEntityNum = traceEnt->s.number; tent->s.eventParm = DirToByte( tr.plane.normal ); tent->s.weapon = ent->s.weapon; + tent->s.generic1 = ent->s.generic1; //weaponMode } G_Damage( traceEnt, ent, ent, forward, tr.endpos, SOLDIER_BITE_DMG, DAMAGE_NO_KNOCKBACK, MOD_SOLDIER_BITE ); @@ -748,6 +758,7 @@ qboolean CheckPounceAttack( gentity_t *ent ) tent->s.otherEntityNum = traceEnt->s.number; tent->s.eventParm = DirToByte( tr.plane.normal ); tent->s.weapon = ent->s.weapon; + tent->s.generic1 = ent->s.generic1; //weaponMode } if( !traceEnt->takedamage ) @@ -949,6 +960,7 @@ void ChargeAttack( gentity_t *ent, gentity_t *victim ) tent->s.otherEntityNum = victim->s.number; tent->s.eventParm = DirToByte( normal ); tent->s.weapon = ent->s.weapon; + tent->s.generic1 = ent->s.generic1; //weaponMode } if( !victim->takedamage ) |