mirror of
https://github.com/ReactionQuake3/reaction.git
synced 2025-03-27 12:51:13 +00:00
Elder:
Updates for 0-05-xx + stuff to be released in 0-05-01 Server portion has stuff like fixed 3rb/semi-auto, fixed breakables, etc.
This commit is contained in:
parent
0d3a1a7009
commit
7d88ec6da0
11 changed files with 300 additions and 111 deletions
|
@ -1311,7 +1311,7 @@ char *eventnames[] = {
|
|||
"EV_GLOBAL_TEAM_SOUND",
|
||||
"EV_RQ3_SOUND", // Elder: play local sounds - primarily for kick
|
||||
|
||||
"EV_DMREWARD", // Duffman: To display expotional reward messages.
|
||||
"EV_DMREWARD", // Duffman: To display exponential reward messages.
|
||||
|
||||
"EV_BULLET_HIT_FLESH",
|
||||
"EV_BULLET_HIT_WALL",
|
||||
|
@ -1341,6 +1341,9 @@ char *eventnames[] = {
|
|||
"EV_POWERUP_REGEN",
|
||||
|
||||
"EV_GIB_PLAYER", // gib a previously living player
|
||||
"EV_BREAK_GLASS1", // Blaze: Breakable glass
|
||||
"EV_BREAK_GLASS2",
|
||||
"EV_BREAK_GLASS3",
|
||||
"EV_SCOREPLUM", // score plum
|
||||
|
||||
//#ifdef MISSIONPACK
|
||||
|
|
|
@ -10,6 +10,9 @@
|
|||
pmove_t *pm;
|
||||
pml_t pml;
|
||||
|
||||
//Elder: reduce x-y speed on ladders by this factor so it 'feels' more like Q2
|
||||
#define PM_LADDER_MOVE_REDUCTION 10
|
||||
|
||||
// movement parameters
|
||||
float pm_stopspeed = 100.0f;
|
||||
float pm_duckScale = 0.25f;
|
||||
|
@ -1950,10 +1953,15 @@ static void PM_Weapon( void ) {
|
|||
else
|
||||
{
|
||||
// else if they arn't pressing attack, then they just are running around
|
||||
|
||||
//Elder: put a delay in if finished bursting
|
||||
//if (pm->ps->stats[STAT_BURST] > 0)
|
||||
//pm->ps->weaponTime += 300;
|
||||
|
||||
pm->ps->weaponTime = 0;
|
||||
pm->ps->weaponstate = WEAPON_READY;
|
||||
|
||||
pm->ps->stats[STAT_BURST] = 0;
|
||||
//pm->ps->stats[STAT_BURST] = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1991,17 +1999,17 @@ static void PM_Weapon( void ) {
|
|||
// Elder: the client side portion is in
|
||||
// Homer: if weapon can set to be burst mode, check for burst value
|
||||
// M4
|
||||
if ( pm->ps->weapon == WP_M4 && pm->ps->stats[STAT_BURST] > 2 ) {
|
||||
return;
|
||||
}
|
||||
//if ( pm->ps->weapon == WP_M4 && pm->ps->stats[STAT_BURST] > 2 ) {
|
||||
//return;
|
||||
//}
|
||||
// MP5
|
||||
if ( pm->ps->weapon == WP_MP5 && pm->ps->stats[STAT_BURST] > 2 ) {
|
||||
return;
|
||||
}
|
||||
//if ( pm->ps->weapon == WP_MP5 && pm->ps->stats[STAT_BURST] > 2 ) {
|
||||
//return;
|
||||
//}
|
||||
// MK23
|
||||
if ( pm->ps->weapon == WP_PISTOL && pm->ps->stats[STAT_BURST] > 0 ) {
|
||||
return;
|
||||
}
|
||||
//if ( pm->ps->weapon == WP_PISTOL && pm->ps->stats[STAT_BURST] > 0 ) {
|
||||
//return;
|
||||
//}
|
||||
// end Homer
|
||||
|
||||
pm->ps->weaponstate = WEAPON_FIRING;
|
||||
|
@ -2299,8 +2307,8 @@ static void PM_LadderMove( void ) {
|
|||
wishvel[i] = scale * pml.forward[i]*pm->cmd.forwardmove +
|
||||
scale * pml.right[i]*pm->cmd.rightmove;
|
||||
//Elder: changed from a factor of 2 to 10
|
||||
wishvel[0] /= 10;
|
||||
wishvel[1] /= 10;
|
||||
wishvel[0] /= PM_LADDER_MOVE_REDUCTION;
|
||||
wishvel[1] /= PM_LADDER_MOVE_REDUCTION;
|
||||
wishvel[2] += scale * pm->cmd.upmove;
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,27 @@
|
|||
#define CROUCH_VIEWHEIGHT 12
|
||||
#define DEAD_VIEWHEIGHT -16
|
||||
|
||||
//Elder: New breakable bit definitions
|
||||
//No amount bits = Low ... both amount bits = Tons
|
||||
#define RQ3_DEBRIS_MEDIUM 0x00000001
|
||||
#define RQ3_DEBRIS_HIGH 0x00000002
|
||||
//No variation bits = original... both variation bits = variation 3
|
||||
#define RQ3_DEBRIS_VAR1 0x00000004
|
||||
#define RQ3_DEBRIS_VAR2 0x00000008
|
||||
//These are not "compressed"
|
||||
#define RQ3_DEBRIS_GLASS 0x00000010
|
||||
#define RQ3_DEBRIS_WOOD 0x00000020
|
||||
#define RQ3_DEBRIS_METAL 0x00000040
|
||||
#define RQ3_DEBRIS_CERAMIC 0x00000080
|
||||
#define RQ3_DEBRIS_PAPER 0x00000100
|
||||
#define RQ3_DEBRIS_BRICK 0x00000200
|
||||
#define RQ3_DEBRIS_CONCRETE 0x00000400
|
||||
#define RQ3_DEBRIS_POPCAN 0x00000800
|
||||
|
||||
|
||||
//Old debris definitions
|
||||
//Elder: debris bit parms to pass to break_glass - maybe I should enum this?
|
||||
/*
|
||||
#define RQ3_DEBRIS_SMALL 0x00000001
|
||||
#define RQ3_DEBRIS_MEDIUM 0x00000002
|
||||
#define RQ3_DEBRIS_LARGE 0x00000004
|
||||
|
@ -64,7 +84,7 @@
|
|||
#define RQ3_DEBRIS_VAR1 0x00002000
|
||||
#define RQ3_DEBRIS_VAR2 0x00004000
|
||||
#define RQ3_DEBRIS_VAR3 0x00008000
|
||||
|
||||
*/
|
||||
//Elder: to stop some of the hardcoding
|
||||
//This is some ammo amounts per clip/item pick up
|
||||
#define RQ3_SSG3000_CLIP 6
|
||||
|
@ -113,8 +133,8 @@
|
|||
//Elder: confused?
|
||||
|
||||
//Elder: used for STAT_KNIFE ... obsolete now
|
||||
#define RQ3_KNIFE_SLASH 0
|
||||
#define RQ3_KNIFE_THROW 1
|
||||
//#define RQ3_KNIFE_SLASH 0
|
||||
//#define RQ3_KNIFE_THROW 1
|
||||
|
||||
//Elder: from Action source, but changed defined names a bit
|
||||
#define RQ3_PISTOL_NAME "MK23 Pistol"
|
||||
|
@ -421,15 +441,11 @@ typedef enum {
|
|||
STAT_JUMPTIME, //Blaze RE: Double jump
|
||||
STAT_UNIQUEWEAPONS,
|
||||
STAT_FALLDAMAGE,
|
||||
// STAT_BANDAGE, //Elder: holds bandage need - moved to STAT_RQ3
|
||||
STAT_RQ3, //Blaze: Will hold a few flags for bandage, etc info
|
||||
// STAT_KNIFE, //Elder: knife throwing -- wasteful? then later rename STAT_RQ3 or something and use bits
|
||||
} statIndex_t;
|
||||
|
||||
//STAT_RQ3 stat info
|
||||
#define RQ3_LEGDAMAGE 1 //If this bit is set, the player has leg damage
|
||||
|
||||
//Elder: bandage states to pass to cgame - should remove STAT_BANDAGE
|
||||
//and integrate with STAT_RQ3
|
||||
#define RQ3_BANDAGE_NEED 2
|
||||
#define RQ3_BANDAGE_WORK 4
|
||||
//Elder: zoom stat - 1x = 0, 2x = zoom low, 4x = zoom_med, 6x = zoom_low + zoom_med
|
||||
|
@ -679,7 +695,9 @@ typedef enum {
|
|||
EV_POWERUP_REGEN,
|
||||
|
||||
EV_GIB_PLAYER, // gib a previously living player
|
||||
EV_BREAK_GLASS, // Blaze: Breakable glass
|
||||
EV_BREAK_GLASS1, // Blaze: Breakable glass
|
||||
EV_BREAK_GLASS2,
|
||||
EV_BREAK_GLASS3,
|
||||
EV_SCOREPLUM, // score plum
|
||||
|
||||
//#ifdef MISSIONPACK
|
||||
|
|
|
@ -534,7 +534,7 @@ void ClientTimerActions( gentity_t *ent, int msec ) {
|
|||
//Blaze: Do bandaging stuff
|
||||
if (ent->client->bleedtick > 1)
|
||||
{
|
||||
G_Printf("Bleedtick (%d) getting lowered by one (%d)\n", ent->client->bleedtick, client->timeResidual);
|
||||
//G_Printf("Bleedtick (%d) getting lowered by one (%d)\n", ent->client->bleedtick, client->timeResidual);
|
||||
ent->client->bleedtick--;
|
||||
}
|
||||
else if (ent->client->bleedtick == 1)
|
||||
|
@ -1024,6 +1024,56 @@ void ClientThink_real( gentity_t *ent ) {
|
|||
ent->client->pers.cmd.buttons |= BUTTON_GESTURE;
|
||||
}
|
||||
|
||||
//Elder: New 3rb Code
|
||||
//force fire button down if STAT_BURST is < proper amount
|
||||
//Otherwise release the button
|
||||
if ( (client->ps.weapon == WP_M4 &&
|
||||
(client->ps.persistant[PERS_WEAPONMODES] & RQ3_M4MODE) == RQ3_M4MODE) ||
|
||||
(client->ps.weapon == WP_MP5 &&
|
||||
(client->ps.persistant[PERS_WEAPONMODES] & RQ3_MP5MODE) == RQ3_MP5MODE))
|
||||
{
|
||||
int weaponNum = client->ps.weapon;
|
||||
|
||||
if (client->ps.ammo[weaponNum] == 0)
|
||||
{
|
||||
client->ps.stats[STAT_BURST] = 0;
|
||||
}
|
||||
else if (ucmd->buttons & BUTTON_ATTACK)// && client->ps.stats[STAT_BURST] > 0)
|
||||
{
|
||||
if ( client->ps.stats[STAT_BURST] >= 0 && client->ps.stats[STAT_BURST] < 3)
|
||||
ucmd->buttons |= BUTTON_ATTACK;
|
||||
else
|
||||
ucmd->buttons &= ~BUTTON_ATTACK;
|
||||
}
|
||||
else if (client->ps.stats[STAT_BURST] > 2)
|
||||
{
|
||||
client->ps.stats[STAT_BURST] = 0;
|
||||
client->ps.weaponTime += 300;
|
||||
}
|
||||
//Don't need?
|
||||
else if (client->ps.stats[STAT_BURST] > 0)
|
||||
ucmd->buttons |= BUTTON_ATTACK;
|
||||
}
|
||||
|
||||
//Elder: New semi-auto code
|
||||
if ( client->ps.weapon == WP_PISTOL &&
|
||||
(client->ps.persistant[PERS_WEAPONMODES] & RQ3_MK23MODE) == RQ3_MK23MODE)
|
||||
{
|
||||
if (client->ps.ammo[WP_PISTOL] == 0)
|
||||
{
|
||||
client->ps.stats[STAT_BURST] = 0;
|
||||
}
|
||||
else if ((ucmd->buttons & BUTTON_ATTACK) && client->ps.stats[STAT_BURST])
|
||||
{
|
||||
ucmd->buttons &= ~BUTTON_ATTACK;
|
||||
}
|
||||
else if (client->ps.stats[STAT_BURST])
|
||||
{
|
||||
client->ps.weaponTime += 200;
|
||||
client->ps.stats[STAT_BURST] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
// check for invulnerability expansion before doing the Pmove
|
||||
if (client->ps.powerups[PW_INVULNERABILITY] ) {
|
||||
|
@ -1154,7 +1204,7 @@ void ClientThink_real( gentity_t *ent ) {
|
|||
ent->client->fastReloads &&
|
||||
ent->client->reloadAttempts > 0)
|
||||
{
|
||||
//G_Printf("(%i) ClientThink: attempting fast-reload...\n", ent->s.clientNum);
|
||||
G_Printf("(%i) ClientThink: attempting M3 fast-reload...\n", ent->s.clientNum);
|
||||
Cmd_Reload( ent );
|
||||
}
|
||||
break;
|
||||
|
@ -1164,7 +1214,7 @@ void ClientThink_real( gentity_t *ent ) {
|
|||
ent->client->fastReloads &&
|
||||
ent->client->reloadAttempts > 0)
|
||||
{
|
||||
//G_Printf("(%i) ClientThink: attempting fast-reload...\n", ent->s.clientNum);
|
||||
G_Printf("(%i) ClientThink: attempting SSG fast-reload...\n", ent->s.clientNum);
|
||||
Cmd_Reload( ent );
|
||||
}
|
||||
/*
|
||||
|
|
|
@ -1692,6 +1692,8 @@ void Cmd_Reload( gentity_t *ent ) {
|
|||
int ammotoadd;
|
||||
int delay = 0;
|
||||
|
||||
G_Printf("(%i) Cmd_Reload: Attempting reload\n", ent->s.clientNum);
|
||||
|
||||
//Elder: added for redundant check but shouldn't need to come here - handled in cgame
|
||||
//if (ent->client->isBandaging == qtrue) {
|
||||
if ( (ent->client->ps.stats[STAT_RQ3] & RQ3_BANDAGE_WORK) == RQ3_BANDAGE_WORK) {
|
||||
|
@ -1701,6 +1703,10 @@ void Cmd_Reload( gentity_t *ent ) {
|
|||
return;
|
||||
}
|
||||
|
||||
//Prevent reloading while bursting
|
||||
if ( ent->client->ps.stats[STAT_BURST] > 0)
|
||||
return;
|
||||
|
||||
//Elder: release fire button
|
||||
//if ( (ent->client->buttons & BUTTON_ATTACK) == BUTTON_ATTACK)
|
||||
//ent->client->buttons &= ~BUTTON_ATTACK;
|
||||
|
@ -2300,8 +2306,8 @@ void Cmd_Drop_f( gentity_t *ent ) {
|
|||
else {
|
||||
//Elder: remove zoom bits
|
||||
Cmd_Unzoom(ent);
|
||||
ent->client->ps.stats[STAT_RQ3] &= ~RQ3_ZOOM_LOW;
|
||||
ent->client->ps.stats[STAT_RQ3] &= ~RQ3_ZOOM_MED;
|
||||
//ent->client->ps.stats[STAT_RQ3] &= ~RQ3_ZOOM_LOW;
|
||||
//ent->client->ps.stats[STAT_RQ3] &= ~RQ3_ZOOM_MED;
|
||||
//ent->client->zoomed=0;
|
||||
//G_AddEvent(ent,EV_ZOOM,0);
|
||||
ThrowWeapon( ent );
|
||||
|
@ -2421,7 +2427,8 @@ void ClientCommand( int clientNum ) {
|
|||
//Elder: add to reload queue if using fast-reloadable weapons
|
||||
if (ent->client->ps.weapon == WP_M3 || ent->client->ps.weapon == WP_SSG3000)
|
||||
ent->client->reloadAttempts++;
|
||||
Cmd_Reload( ent );
|
||||
G_Printf("Trying a reload...\n");
|
||||
Cmd_Reload( ent );
|
||||
}
|
||||
// End Duffman
|
||||
//Blaze's Open door command
|
||||
|
|
|
@ -583,8 +583,6 @@ void Touch_Item (gentity_t *ent, gentity_t *other, trace_t *trace) {
|
|||
if ( !BG_CanItemBeGrabbed( g_gametype.integer, &ent->s, &other->client->ps ) ) return;
|
||||
|
||||
|
||||
G_LogPrintf( "Item: %i %s\n", other->s.number, ent->item->classname );
|
||||
|
||||
predict = other->client->pers.predictItemPickup;
|
||||
|
||||
//Elder: should check if the item was recently thrown ... if it was, then
|
||||
|
@ -626,7 +624,7 @@ void Touch_Item (gentity_t *ent, gentity_t *other, trace_t *trace) {
|
|||
case WP_M4:
|
||||
case WP_SSG3000:
|
||||
//Elder: check to see if it's in mid-air
|
||||
if (other->client->ps.stats[STAT_UNIQUEWEAPONS] >= g_rxn_maxweapons.integer ||
|
||||
if (other->client->ps.stats[STAT_UNIQUEWEAPONS] >= g_RQ3_maxWeapons.integer ||
|
||||
ent->s.pos.trDelta[2] != 0)
|
||||
return;
|
||||
break;
|
||||
|
@ -692,15 +690,19 @@ void Touch_Item (gentity_t *ent, gentity_t *other, trace_t *trace) {
|
|||
if (ent->item->giTag == WP_MP5 || ent->item->giTag == WP_M4 ||
|
||||
ent->item->giTag == WP_M3 || ent->item->giTag == WP_HANDCANNON ||
|
||||
ent->item->giTag == WP_SSG3000) {
|
||||
if (other->client->ps.stats[STAT_UNIQUEWEAPONS] >= g_rxn_maxweapons.integer) {
|
||||
if (other->client->ps.stats[STAT_UNIQUEWEAPONS] >= g_RQ3_maxWeapons.integer) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
//Elder: Moved after checks so we don't print a billion log messages
|
||||
G_LogPrintf( "Item: %i %s\n", other->s.number, ent->item->classname );
|
||||
|
||||
|
||||
respawn = Pickup_Weapon(ent, other);
|
||||
|
||||
|
||||
|
||||
|
||||
//Elder: added pistol and knife condition
|
||||
if (ent->item->giTag == WP_GRENADE || ent->item->giTag == WP_PISTOL ||
|
||||
ent->item->giTag == WP_KNIFE) {
|
||||
|
|
|
@ -866,7 +866,7 @@ extern vmCvar_t g_singlePlayer;
|
|||
extern vmCvar_t g_proxMineTimeout;
|
||||
//Blaze: Reaction cvars
|
||||
extern vmCvar_t g_rxn_knifelimit;
|
||||
extern vmCvar_t g_rxn_maxweapons;
|
||||
extern vmCvar_t g_RQ3_maxWeapons;
|
||||
|
||||
void trap_Printf( const char *fmt );
|
||||
void trap_Error( const char *fmt );
|
||||
|
|
|
@ -63,7 +63,7 @@ vmCvar_t g_rankings;
|
|||
vmCvar_t g_listEntity;
|
||||
//Blaze: Reaction cvars
|
||||
vmCvar_t g_rxn_knifelimit;
|
||||
vmCvar_t g_rxn_maxweapons;
|
||||
vmCvar_t g_RQ3_maxWeapons;
|
||||
#ifdef MISSIONPACK
|
||||
vmCvar_t g_obeliskHealth;
|
||||
vmCvar_t g_obeliskRegenPeriod;
|
||||
|
@ -162,7 +162,7 @@ cvarTable_t gameCvarTable[] = {
|
|||
|
||||
{ &g_rankings, "g_rankings", "0", 0, 0, qfalse},
|
||||
//Blaze: Reaction stuff
|
||||
{ &g_rxn_maxweapons, "g_rxn_maxweapons", "1",0,0,qtrue}
|
||||
{ &g_RQ3_maxWeapons, "g_RQ3_maxWeapons", "1",0,0,qtrue}
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -331,89 +331,160 @@ Fires at either the target or the current direction.
|
|||
1 - medium: about 25 pieces
|
||||
2 - large: about 50 pieces
|
||||
3 - tons (watch out when using this)
|
||||
"variation" (0 to 3) allows you to pick one of 4 variations
|
||||
|
||||
*/
|
||||
void SP_func_breakable( gentity_t *ent ) {
|
||||
int amount=0;
|
||||
int health;
|
||||
int amount;
|
||||
int variation;
|
||||
int debris;
|
||||
int temp;
|
||||
|
||||
// Make it appear as the brush
|
||||
trap_SetBrushModel( ent, ent->model );
|
||||
// Lets give it 5 health if the mapper did not set its health
|
||||
|
||||
// Setup health of breakable
|
||||
G_SpawnInt( "health", "0", &health );
|
||||
if( health <= 0 )
|
||||
health = 5;
|
||||
|
||||
// Setup debris type
|
||||
G_SpawnInt( "debris", "0", &temp );
|
||||
|
||||
//Elder: hardcoded - I guess I should enum this
|
||||
if (temp < 0 || temp > 6)
|
||||
debris = RQ3_DEBRIS_GLASS;
|
||||
else
|
||||
debris = (1 << (temp + 4));
|
||||
switch (temp)
|
||||
{
|
||||
case 0:
|
||||
debris = RQ3_DEBRIS_GLASS;
|
||||
break;
|
||||
case 1:
|
||||
debris = RQ3_DEBRIS_WOOD;
|
||||
break;
|
||||
case 2:
|
||||
debris = RQ3_DEBRIS_METAL;
|
||||
break;
|
||||
case 3:
|
||||
debris = RQ3_DEBRIS_CERAMIC;
|
||||
break;
|
||||
case 4:
|
||||
debris = RQ3_DEBRIS_PAPER;
|
||||
break;
|
||||
case 5:
|
||||
debris = RQ3_DEBRIS_BRICK;
|
||||
break;
|
||||
case 6:
|
||||
debris = RQ3_DEBRIS_CONCRETE;
|
||||
break;
|
||||
default:
|
||||
debris = RQ3_DEBRIS_GLASS;
|
||||
break;
|
||||
}
|
||||
|
||||
// Setup amount type
|
||||
G_SpawnInt( "amount", "0", &temp );
|
||||
if (temp < 0 || temp > 3)
|
||||
amount = RQ3_DEBRIS_MEDIUM;
|
||||
else
|
||||
amount = (1 << amount);
|
||||
switch (temp)
|
||||
{
|
||||
case 0:
|
||||
amount = 0;
|
||||
break;
|
||||
case 1:
|
||||
amount = RQ3_DEBRIS_MEDIUM;
|
||||
break;
|
||||
case 2:
|
||||
amount = RQ3_DEBRIS_HIGH;
|
||||
break;
|
||||
case 3:
|
||||
amount = RQ3_DEBRIS_MEDIUM|RQ3_DEBRIS_HIGH;
|
||||
break;
|
||||
default:
|
||||
amount = RQ3_DEBRIS_MEDIUM;
|
||||
break;
|
||||
}
|
||||
|
||||
// Setup variation type
|
||||
G_SpawnInt( "variation", "0", &temp);
|
||||
switch (temp)
|
||||
{
|
||||
case 0:
|
||||
variation = 0;
|
||||
break;
|
||||
case 1:
|
||||
variation = RQ3_DEBRIS_VAR1;
|
||||
break;
|
||||
case 2:
|
||||
variation = RQ3_DEBRIS_VAR2;
|
||||
break;
|
||||
case 3:
|
||||
variation = RQ3_DEBRIS_VAR1|RQ3_DEBRIS_VAR2;
|
||||
break;
|
||||
default:
|
||||
variation = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
//Elder: merge the bits
|
||||
ent->s.eventParm = 0;
|
||||
//ent->s.eventParm |= debris;
|
||||
//ent->s.eventParm |= amount;
|
||||
ent->s.eventParm = debris + amount;
|
||||
|
||||
ent->s.eventParm = amount|variation|debris;
|
||||
|
||||
ent->health = health;
|
||||
// Let it take damage
|
||||
ent->takedamage = qtrue;
|
||||
|
||||
// Let it know it is a breakable object
|
||||
ent->s.eType = ET_BREAKABLE;
|
||||
|
||||
// If the mapper gave it a model, use it
|
||||
if ( ent->model2 ) {
|
||||
ent->s.modelindex2 = G_ModelIndex( ent->model2 );
|
||||
}
|
||||
// Link all ^this^ info into the ent
|
||||
|
||||
trap_LinkEntity (ent);
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
G_BreakGlass
|
||||
=================
|
||||
*/
|
||||
void G_BreakGlass(gentity_t *ent, vec3_t point, int mod) {
|
||||
/*
|
||||
=================
|
||||
G_BreakGlass
|
||||
|
||||
Create/process a breakable event entity
|
||||
Original by inolen, heavy modifications by Elder
|
||||
=================
|
||||
*/
|
||||
void G_BreakGlass( gentity_t *ent, vec3_t point, int mod )
|
||||
{
|
||||
gentity_t *tent;
|
||||
vec3_t size;
|
||||
vec3_t center;
|
||||
qboolean splashdmg;
|
||||
int eParm;
|
||||
// Get the center of the glass
|
||||
VectorSubtract(ent->r.maxs, ent->r.mins, size);
|
||||
VectorScale(size, 0.5, size);
|
||||
VectorAdd(ent->r.mins, size, center);
|
||||
vec3_t impactPoint;
|
||||
//Elder: for the bit-shifting
|
||||
int eParm;
|
||||
int shiftCount = 0;
|
||||
|
||||
//Elder:
|
||||
//eventParm can only hold a byte (8-bits/255)
|
||||
//eventParm can only transmit as a byte (8-bits/255)
|
||||
//So if we receive a huge one, we can knock it down (shift-op)
|
||||
//and count the number of times
|
||||
//Once it's below 255, we can send a more appropriate event
|
||||
//This way, the mappers can use a single func_breakable
|
||||
//while we process it on the server-side.
|
||||
//Besides, any bit-op is fast.
|
||||
//Places to stuff: eventParm, generic1
|
||||
|
||||
// If the glass has no more life, BREAK IT
|
||||
if( ent->health <= 0 ) {
|
||||
//Elder: using event param to specify debris type
|
||||
eParm = ent->s.eventParm;
|
||||
//G_Printf("Original eParm: %i \n", ent->s.eventParm);
|
||||
//Copy the first four bits and strip them out of the original
|
||||
eParm = ent->s.eventParm & 15;
|
||||
ent->s.eventParm &= ~eParm;
|
||||
|
||||
//Shift-op loop
|
||||
while (ent->s.eventParm > 255)
|
||||
{
|
||||
shiftCount++;
|
||||
ent->s.eventParm = ent->s.eventParm >> 4;
|
||||
}
|
||||
|
||||
eParm |= ent->s.eventParm;
|
||||
|
||||
//eParm should now be under 1 byte and shiftCount >= 0
|
||||
//G_Printf("New eParm: %i Shifts: %i\n", eParm, shiftCount);
|
||||
|
||||
G_Printf("eParm: %d\n", eParm);
|
||||
//Elder: free it after the eventParm assignment
|
||||
G_FreeEntity( ent );
|
||||
// Tell the program based on the gun if it has no splash dmg, no reason to ad ones with
|
||||
// splash dmg as qtrue as is that is the default
|
||||
|
||||
// Tell the program based on the gun if it was caused by splash damage
|
||||
switch( mod ) {
|
||||
//Elder: added + compacted
|
||||
case MOD_KNIFE:
|
||||
|
@ -426,36 +497,39 @@ void G_BreakGlass(gentity_t *ent, vec3_t point, int mod) {
|
|||
case MOD_SNIPER:
|
||||
case MOD_GAUNTLET:
|
||||
case MOD_KICK:
|
||||
//case MOD_SHOTGUN:
|
||||
//case MOD_MACHINEGUN:
|
||||
//case MOD_RAILGUN:
|
||||
//case MOD_LIGHTNING:
|
||||
splashdmg = qfalse;
|
||||
//Use actual impact point
|
||||
VectorCopy(point, impactPoint);
|
||||
break;
|
||||
default:
|
||||
splashdmg = qtrue;
|
||||
//Splash damage weapons: use center of the glass
|
||||
VectorSubtract(ent->r.maxs, ent->r.mins, size);
|
||||
VectorScale(size, 0.5, size);
|
||||
VectorAdd(ent->r.mins, size, impactPoint);
|
||||
break;
|
||||
}
|
||||
// Call the function to show the glass shards in cgame
|
||||
// center can be changed to point which will spawn the
|
||||
// where the killing bullet hit but wont work with Splash Damage weapons
|
||||
// so I just use the center of the glass
|
||||
switch( splashdmg ) {
|
||||
case qtrue:
|
||||
//Elder: use TempEntity2 to stuff params
|
||||
//tent = G_TempEntity( center, EV_BREAK_GLASS );
|
||||
tent = G_TempEntity2( center, EV_BREAK_GLASS, eParm );
|
||||
break;
|
||||
case qfalse:
|
||||
//tent = G_TempEntity( point, EV_BREAK_GLASS );
|
||||
tent = G_TempEntity2( point, EV_BREAK_GLASS, eParm );
|
||||
break;
|
||||
}
|
||||
//Elder: maybe we can use this to tell the client to spawn different debris
|
||||
//tent->s.eventParm = 0;
|
||||
|
||||
switch ( shiftCount )
|
||||
{
|
||||
case 0:
|
||||
tent = G_TempEntity2( impactPoint, EV_BREAK_GLASS1, eParm);
|
||||
break;
|
||||
case 1:
|
||||
tent = G_TempEntity2( impactPoint, EV_BREAK_GLASS2, eParm);
|
||||
break;
|
||||
case 2:
|
||||
tent = G_TempEntity2( impactPoint, EV_BREAK_GLASS3, eParm);
|
||||
break;
|
||||
default:
|
||||
G_Error("G_BreakGlass: shiftCount > 2\n");
|
||||
break;
|
||||
}
|
||||
|
||||
//Elder: use TempEntity2 to stuff params
|
||||
//tent = G_TempEntity( center, EV_BREAK_GLASS );
|
||||
tent->s.eventParm = eParm;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
static void PortalDie (gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int mod) {
|
||||
|
|
|
@ -114,6 +114,7 @@ qboolean G_TryPushingEntity( gentity_t *check, gentity_t *pusher, vec3_t move, v
|
|||
|
||||
block = G_TestEntityPosition( check );
|
||||
if (!block) {
|
||||
//G_Printf("G_TryPushingEntity: Push Ok\n");
|
||||
// pushed ok
|
||||
if ( check->client ) {
|
||||
VectorCopy( check->client->ps.origin, check->r.currentOrigin );
|
||||
|
@ -311,7 +312,7 @@ qboolean G_MoverPush( gentity_t *pusher, vec3_t move, vec3_t amove, gentity_t **
|
|||
|| check->r.absmin[2] >= maxs[2]
|
||||
|| check->r.absmax[0] <= mins[0]
|
||||
|| check->r.absmax[1] <= mins[1]
|
||||
|| check->r.absmax[2] <= mins[2] ) {
|
||||
|| check->r.absmax[2] <= mins[2]) {
|
||||
continue;
|
||||
}
|
||||
// see if the ent's bbox is inside the pusher's final position
|
||||
|
@ -333,6 +334,7 @@ qboolean G_MoverPush( gentity_t *pusher, vec3_t move, vec3_t amove, gentity_t **
|
|||
//But it has to PUSH the client off... I don't know how just yet :(
|
||||
if ( pusher->s.pos.trType == TR_SINE || pusher->s.apos.trType == TR_SINE ) {
|
||||
//Elder: debug code
|
||||
continue;
|
||||
G_Printf("RQ3: TR_SINE crusher code removed\n");
|
||||
//Elder: temp - player will stop the pendulum from going
|
||||
//Elder: removed qfalse and continue
|
||||
|
|
|
@ -116,6 +116,7 @@ qboolean JumpKick( gentity_t *ent )
|
|||
//Elder: toss a unique weapon if kicked
|
||||
//Todo: Need to make sure to cancel any reload attempts
|
||||
//Todo: need to send a message to attacker and target about weapon kick
|
||||
Cmd_Unzoom(traceEnt);
|
||||
ThrowWeapon(traceEnt);
|
||||
//trap_SendServerCommand( ent-g_entities, va("print \"You kicked %s's %s from his hands!\n\"", traceEnt->client->pers.netname, (traceEnt->client->ps.weapon)->pickup_name);
|
||||
//trap_SendServerCommand( targ-g_entities, va("print \"Head Damage.\n\""));
|
||||
|
@ -327,9 +328,37 @@ void Bullet_Fire (gentity_t *ent, float spread, int damage, int MOD ) {
|
|||
//Elder: removed - for some reason it's set to 0
|
||||
//damage *= s_quadFactor;
|
||||
|
||||
r = random() * M_PI * 2.0f;
|
||||
u = sin(r) * crandom() * spread * 16;
|
||||
r = cos(r) * crandom() * spread * 16;
|
||||
/* Original AQ2 code
|
||||
vectoangles (aimdir, dir);
|
||||
AngleVectors (dir, forward, right, up);
|
||||
|
||||
r = crandom()*hspread;
|
||||
u = crandom()*vspread;
|
||||
VectorMA (start, 8192, forward, end);
|
||||
VectorMA (end, r, right, end);
|
||||
VectorMA (end, u, up, end);
|
||||
*/
|
||||
|
||||
/* More AQ2 code to implement
|
||||
// change bullet's course when it enters water
|
||||
VectorSubtract (end, start, dir);
|
||||
vectoangles (dir, dir);
|
||||
AngleVectors (dir, forward, right, up);
|
||||
r = crandom()*hspread*2;
|
||||
u = crandom()*vspread*2;
|
||||
VectorMA (water_start, 8192, forward, end);
|
||||
VectorMA (end, r, right, end);
|
||||
VectorMA (end, u, up, end);
|
||||
*/
|
||||
|
||||
//Elder: original Q3 code -- note the first line and its use to reduce spread
|
||||
//r = random() * M_PI * 2.0f;
|
||||
//u = sin(r) * crandom() * spread * 16;
|
||||
//r = cos(r) * crandom() * spread * 16;
|
||||
|
||||
//FYI: multiply by 16 so we can reach the furthest ends of a "TA" sized map
|
||||
u = crandom() * spread * 16;
|
||||
r = crandom() * spread * 16;
|
||||
VectorMA (muzzle, 8192*16, forward, end);
|
||||
VectorMA (end, r, right, end);
|
||||
VectorMA (end, u, up, end);
|
||||
|
@ -1162,14 +1191,10 @@ void Weapon_Knife_Fire(gentity_t *ent)
|
|||
// Homer: if client is supposed to be slashing, go to that function instead
|
||||
if ( (ent->client->ps.persistant[PERS_WEAPONMODES] & RQ3_KNIFEMODE) == RQ3_KNIFEMODE ) {
|
||||
//Elder: added
|
||||
//ent->client->ps.stats[STAT_KNIFE] = RQ3_KNIFE_SLASH;
|
||||
Knife_Attack(ent,SLASH_DAMAGE);
|
||||
return;
|
||||
}
|
||||
|
||||
//Elder: added
|
||||
// ent->client->ps.stats[STAT_KNIFE] = RQ3_KNIFE_THROW;
|
||||
|
||||
// extra vertical velocity
|
||||
forward[2] += 0.2f;
|
||||
|
||||
|
|
Loading…
Reference in a new issue