mirror of
https://github.com/ReactionQuake3/reaction.git
synced 2024-11-22 20:31:11 +00:00
Removed the MISSIONPACK ifdefs and missionpack only code.
This commit is contained in:
parent
287485115f
commit
f3db6be4d2
27 changed files with 142 additions and 5704 deletions
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.7 2002/06/16 17:37:59 jbravo
|
||||
// Removed the MISSIONPACK ifdefs and missionpack only code.
|
||||
//
|
||||
// Revision 1.6 2002/04/01 12:45:54 makro
|
||||
// Changed some weapon names
|
||||
//
|
||||
|
@ -54,11 +57,6 @@
|
|||
#include "syn.h" //synonyms
|
||||
#include "match.h" //string matching types and vars
|
||||
|
||||
// for the voice chats
|
||||
#ifdef MISSIONPACK // bk001205
|
||||
#include "../../ui/menudef.h"
|
||||
#endif
|
||||
|
||||
#define TIME_BETWEENCHATTING 25
|
||||
|
||||
|
||||
|
@ -313,23 +311,6 @@ char *BotWeaponNameForMeansOfDeath(int mod) {
|
|||
case MOD_BFG_SPLASH:
|
||||
return "BFG10K";
|
||||
break;
|
||||
#ifdef MISSIONPACK
|
||||
case MOD_NAIL:
|
||||
return "Nailgun";
|
||||
break;
|
||||
case MOD_CHAINGUN:
|
||||
return "Chaingun";
|
||||
break;
|
||||
case MOD_PROXIMITY_MINE:
|
||||
return "Proximity Launcher";
|
||||
break;
|
||||
case MOD_KAMIKAZE:
|
||||
return "Kamikaze";
|
||||
break;
|
||||
case MOD_JUICED:
|
||||
return "Prox mine";
|
||||
break;
|
||||
#endif
|
||||
case MOD_GRAPPLE:
|
||||
return "Grapple";
|
||||
break;
|
||||
|
@ -384,11 +365,7 @@ BotRandomWeaponName
|
|||
char *BotRandomWeaponName(void) {
|
||||
int rnd;
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
rnd = random() * 11.9;
|
||||
#else
|
||||
rnd = random() * 8.9;
|
||||
#endif
|
||||
switch(rnd) {
|
||||
//Makro - changed to RQ3 weapon names
|
||||
/*
|
||||
|
@ -400,11 +377,6 @@ char *BotRandomWeaponName(void) {
|
|||
case 5: return "Plasmagun";
|
||||
case 6: return "Railgun";
|
||||
case 7: return "Lightning Gun";
|
||||
#ifdef MISSIONPACK
|
||||
case 8: return "Nailgun";
|
||||
case 9: return "Chaingun";
|
||||
case 10: return "Proximity Launcher";
|
||||
#endif
|
||||
default: return "BFG10K";
|
||||
*/
|
||||
case 0:
|
||||
|
@ -724,10 +696,6 @@ int BotChat_Death(bot_state_t *bs) {
|
|||
BotAI_BotInitialChat(bs, "death_suicide", BotRandomOpponentName(bs), NULL);
|
||||
else if (bs->botdeathtype == MOD_TELEFRAG)
|
||||
BotAI_BotInitialChat(bs, "death_telefrag", name, NULL);
|
||||
#ifdef MISSIONPACK
|
||||
else if (bs->botdeathtype == MOD_KAMIKAZE && trap_BotNumInitialChats(bs->cs, "death_kamikaze"))
|
||||
BotAI_BotInitialChat(bs, "death_kamikaze", name, NULL);
|
||||
#endif
|
||||
else {
|
||||
if ((bs->botdeathtype == MOD_GAUNTLET ||
|
||||
bs->botdeathtype == MOD_RAILGUN ||
|
||||
|
@ -818,10 +786,6 @@ int BotChat_Kill(bot_state_t *bs) {
|
|||
else if (bs->enemydeathtype == MOD_TELEFRAG) {
|
||||
BotAI_BotInitialChat(bs, "kill_telefrag", name, NULL);
|
||||
}
|
||||
#ifdef MISSIONPACK
|
||||
else if (bs->botdeathtype == MOD_KAMIKAZE && trap_BotNumInitialChats(bs->cs, "kill_kamikaze"))
|
||||
BotAI_BotInitialChat(bs, "kill_kamikaze", name, NULL);
|
||||
#endif
|
||||
//choose between insult and praise
|
||||
else if (random() < trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_CHAT_INSULT, 0, 1)) {
|
||||
BotAI_BotInitialChat(bs, "kill_insult", name, NULL);
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.8 2002/06/16 17:37:59 jbravo
|
||||
// Removed the MISSIONPACK ifdefs and missionpack only code.
|
||||
//
|
||||
// Revision 1.7 2002/04/06 21:42:19 makro
|
||||
// Changes to bot code. New surfaceparm system.
|
||||
//
|
||||
|
@ -108,18 +111,6 @@ void BotPrintTeamGoal(bot_state_t *bs) {
|
|||
BotAI_Print(PRT_MESSAGE, "%s: I'm gonna try to return the flag for %1.0f secs\n", netname, t);
|
||||
break;
|
||||
}
|
||||
#ifdef MISSIONPACK
|
||||
case LTG_ATTACKENEMYBASE:
|
||||
{
|
||||
BotAI_Print(PRT_MESSAGE, "%s: I'm gonna attack the enemy base for %1.0f secs\n", netname, t);
|
||||
break;
|
||||
}
|
||||
case LTG_HARVEST:
|
||||
{
|
||||
BotAI_Print(PRT_MESSAGE, "%s: I'm gonna harvest for %1.0f secs\n", netname, t);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
case LTG_DEFENDKEYAREA:
|
||||
{
|
||||
BotAI_Print(PRT_MESSAGE, "%s: I'm gonna defend a key area for %1.0f secs\n", netname, t);
|
||||
|
@ -849,12 +840,6 @@ void BotMatch_GetFlag(bot_state_t *bs, bot_match_t *match) {
|
|||
if (!ctf_redflag.areanum || !ctf_blueflag.areanum)
|
||||
return;
|
||||
}
|
||||
#ifdef MISSIONPACK
|
||||
else if (gametype == GT_1FCTF) {
|
||||
if (!ctf_neutralflag.areanum || !ctf_redflag.areanum || !ctf_blueflag.areanum)
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
return;
|
||||
}
|
||||
|
@ -899,14 +884,7 @@ void BotMatch_AttackEnemyBase(bot_state_t *bs, bot_match_t *match) {
|
|||
|
||||
if (gametype == GT_CTF) {
|
||||
BotMatch_GetFlag(bs, match);
|
||||
}
|
||||
#ifdef MISSIONPACK
|
||||
else if (gametype == GT_1FCTF || gametype == GT_OBELISK || gametype == GT_HARVESTER) {
|
||||
if (!redobelisk.areanum || !blueobelisk.areanum)
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
//if not addressed to this bot
|
||||
|
@ -935,50 +913,6 @@ void BotMatch_AttackEnemyBase(bot_state_t *bs, bot_match_t *match) {
|
|||
#endif //DEBUG
|
||||
}
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
/*
|
||||
==================
|
||||
BotMatch_Harvest
|
||||
==================
|
||||
*/
|
||||
void BotMatch_Harvest(bot_state_t *bs, bot_match_t *match) {
|
||||
char netname[MAX_MESSAGE_SIZE];
|
||||
int client;
|
||||
|
||||
if (gametype == GT_HARVESTER) {
|
||||
if (!neutralobelisk.areanum || !redobelisk.areanum || !blueobelisk.areanum)
|
||||
return;
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
//if not addressed to this bot
|
||||
if (!BotAddressedToBot(bs, match)) return;
|
||||
//
|
||||
trap_BotMatchVariable(match, NETNAME, netname, sizeof(netname));
|
||||
//
|
||||
client = FindClientByName(netname);
|
||||
//
|
||||
bs->decisionmaker = client;
|
||||
bs->ordered = qtrue;
|
||||
bs->order_time = FloatTime();
|
||||
//set the time to send a message to the team mates
|
||||
bs->teammessage_time = FloatTime() + 2 * random();
|
||||
//set the ltg type
|
||||
bs->ltgtype = LTG_HARVEST;
|
||||
//set the team goal time
|
||||
bs->teamgoal_time = FloatTime() + TEAM_HARVEST_TIME;
|
||||
bs->harvestaway_time = 0;
|
||||
//
|
||||
BotSetTeamStatus(bs);
|
||||
// remember last ordered task
|
||||
BotRememberLastOrderedTask(bs);
|
||||
#ifdef DEBUG
|
||||
BotPrintTeamGoal(bs);
|
||||
#endif //DEBUG
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
==================
|
||||
BotMatch_RushBase
|
||||
|
@ -991,14 +925,7 @@ void BotMatch_RushBase(bot_state_t *bs, bot_match_t *match) {
|
|||
if (gametype == GT_CTF) {
|
||||
if (!ctf_redflag.areanum || !ctf_blueflag.areanum)
|
||||
return;
|
||||
}
|
||||
#ifdef MISSIONPACK
|
||||
else if (gametype == GT_1FCTF || gametype == GT_HARVESTER) {
|
||||
if (!redobelisk.areanum || !blueobelisk.areanum)
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
//if not addressed to this bot
|
||||
|
@ -1083,12 +1010,7 @@ void BotMatch_ReturnFlag(bot_state_t *bs, bot_match_t *match) {
|
|||
int client;
|
||||
|
||||
//if not in CTF mode
|
||||
if (
|
||||
gametype != GT_CTF
|
||||
#ifdef MISSIONPACK
|
||||
&& gametype != GT_1FCTF
|
||||
#endif
|
||||
)
|
||||
if (gametype != GT_CTF)
|
||||
return;
|
||||
//if not addressed to this bot
|
||||
if (!BotAddressedToBot(bs, match))
|
||||
|
@ -1453,18 +1375,6 @@ void BotMatch_WhatAreYouDoing(bot_state_t *bs, bot_match_t *match) {
|
|||
BotAI_BotInitialChat(bs, "returningflag", NULL);
|
||||
break;
|
||||
}
|
||||
#ifdef MISSIONPACK
|
||||
case LTG_ATTACKENEMYBASE:
|
||||
{
|
||||
BotAI_BotInitialChat(bs, "attackingenemybase", NULL);
|
||||
break;
|
||||
}
|
||||
case LTG_HARVEST:
|
||||
{
|
||||
BotAI_BotInitialChat(bs, "harvesting", NULL);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
default:
|
||||
{
|
||||
BotAI_BotInitialChat(bs, "roaming", NULL);
|
||||
|
@ -1569,19 +1479,6 @@ void BotMatch_WhereAreYou(bot_state_t *bs, bot_match_t *match) {
|
|||
RQ3_BANDOLIER_NAME,
|
||||
"Red Flag",
|
||||
"Blue Flag",
|
||||
#ifdef MISSIONPACK
|
||||
"Nailgun",
|
||||
"Prox Launcher",
|
||||
"Chaingun",
|
||||
"Scout",
|
||||
"Guard",
|
||||
"Doubler",
|
||||
"Ammo Regen",
|
||||
"Neutral Flag",
|
||||
"Red Obelisk",
|
||||
"Blue Obelisk",
|
||||
"Neutral Obelisk",
|
||||
#endif
|
||||
NULL
|
||||
};
|
||||
//
|
||||
|
@ -1601,11 +1498,7 @@ void BotMatch_WhereAreYou(bot_state_t *bs, bot_match_t *match) {
|
|||
}
|
||||
}
|
||||
if (bestitem != -1) {
|
||||
if (gametype == GT_CTF
|
||||
#ifdef MISSIONPACK
|
||||
|| gametype == GT_1FCTF
|
||||
#endif
|
||||
) {
|
||||
if (gametype == GT_CTF) {
|
||||
redtt = trap_AAS_AreaTravelTimeToGoalArea(bs->areanum, bs->origin, ctf_redflag.areanum, TFL_DEFAULT);
|
||||
bluett = trap_AAS_AreaTravelTimeToGoalArea(bs->areanum, bs->origin, ctf_blueflag.areanum, TFL_DEFAULT);
|
||||
if (redtt < (redtt + bluett) * 0.4) {
|
||||
|
@ -1617,23 +1510,7 @@ void BotMatch_WhereAreYou(bot_state_t *bs, bot_match_t *match) {
|
|||
else {
|
||||
BotAI_BotInitialChat(bs, "location", nearbyitems[bestitem], NULL);
|
||||
}
|
||||
}
|
||||
#ifdef MISSIONPACK
|
||||
else if (gametype == GT_OBELISK || gametype == GT_HARVESTER) {
|
||||
redtt = trap_AAS_AreaTravelTimeToGoalArea(bs->areanum, bs->origin, redobelisk.areanum, TFL_DEFAULT);
|
||||
bluett = trap_AAS_AreaTravelTimeToGoalArea(bs->areanum, bs->origin, blueobelisk.areanum, TFL_DEFAULT);
|
||||
if (redtt < (redtt + bluett) * 0.4) {
|
||||
BotAI_BotInitialChat(bs, "teamlocation", nearbyitems[bestitem], "red", NULL);
|
||||
}
|
||||
else if (bluett < (redtt + bluett) * 0.4) {
|
||||
BotAI_BotInitialChat(bs, "teamlocation", nearbyitems[bestitem], "blue", NULL);
|
||||
}
|
||||
else {
|
||||
BotAI_BotInitialChat(bs, "location", nearbyitems[bestitem], NULL);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
} else {
|
||||
BotAI_BotInitialChat(bs, "location", nearbyitems[bestitem], NULL);
|
||||
}
|
||||
trap_BotMatchVariable(match, NETNAME, netname, sizeof(netname));
|
||||
|
@ -1759,45 +1636,37 @@ void BotMatch_CTF(bot_state_t *bs, bot_match_t *match) {
|
|||
char flag[128], netname[MAX_NETNAME];
|
||||
|
||||
if (gametype == GT_CTF) {
|
||||
trap_BotMatchVariable(match, FLAG, flag, sizeof(flag));
|
||||
if (match->subtype & ST_GOTFLAG) {
|
||||
if (!Q_stricmp(flag, "red")) {
|
||||
bs->redflagstatus = 1;
|
||||
if (BotTeam(bs) == TEAM_BLUE) {
|
||||
trap_BotMatchVariable(match, NETNAME, netname, sizeof(netname));
|
||||
bs->flagcarrier = ClientFromName(netname);
|
||||
trap_BotMatchVariable(match, FLAG, flag, sizeof(flag));
|
||||
if (match->subtype & ST_GOTFLAG) {
|
||||
if (!Q_stricmp(flag, "red")) {
|
||||
bs->redflagstatus = 1;
|
||||
if (BotTeam(bs) == TEAM_BLUE) {
|
||||
trap_BotMatchVariable(match, NETNAME, netname, sizeof(netname));
|
||||
bs->flagcarrier = ClientFromName(netname);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
bs->blueflagstatus = 1;
|
||||
if (BotTeam(bs) == TEAM_RED) {
|
||||
trap_BotMatchVariable(match, NETNAME, netname, sizeof(netname));
|
||||
bs->flagcarrier = ClientFromName(netname);
|
||||
else {
|
||||
bs->blueflagstatus = 1;
|
||||
if (BotTeam(bs) == TEAM_RED) {
|
||||
trap_BotMatchVariable(match, NETNAME, netname, sizeof(netname));
|
||||
bs->flagcarrier = ClientFromName(netname);
|
||||
}
|
||||
}
|
||||
bs->flagstatuschanged = 1;
|
||||
bs->lastflagcapture_time = FloatTime();
|
||||
}
|
||||
bs->flagstatuschanged = 1;
|
||||
bs->lastflagcapture_time = FloatTime();
|
||||
}
|
||||
else if (match->subtype & ST_CAPTUREDFLAG) {
|
||||
bs->redflagstatus = 0;
|
||||
bs->blueflagstatus = 0;
|
||||
bs->flagcarrier = 0;
|
||||
bs->flagstatuschanged = 1;
|
||||
}
|
||||
else if (match->subtype & ST_RETURNEDFLAG) {
|
||||
if (!Q_stricmp(flag, "red")) bs->redflagstatus = 0;
|
||||
else bs->blueflagstatus = 0;
|
||||
bs->flagstatuschanged = 1;
|
||||
}
|
||||
}
|
||||
#ifdef MISSIONPACK
|
||||
else if (gametype == GT_1FCTF) {
|
||||
if (match->subtype & ST_1FCTFGOTFLAG) {
|
||||
trap_BotMatchVariable(match, NETNAME, netname, sizeof(netname));
|
||||
bs->flagcarrier = ClientFromName(netname);
|
||||
else if (match->subtype & ST_CAPTUREDFLAG) {
|
||||
bs->redflagstatus = 0;
|
||||
bs->blueflagstatus = 0;
|
||||
bs->flagcarrier = 0;
|
||||
bs->flagstatuschanged = 1;
|
||||
}
|
||||
else if (match->subtype & ST_RETURNEDFLAG) {
|
||||
if (!Q_stricmp(flag, "red")) bs->redflagstatus = 0;
|
||||
else bs->blueflagstatus = 0;
|
||||
bs->flagstatuschanged = 1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void BotMatch_EnterGame(bot_state_t *bs, bot_match_t *match) {
|
||||
|
@ -1870,20 +1739,6 @@ int BotMatchMessage(bot_state_t *bs, char *message) {
|
|||
BotMatch_GetFlag(bs, &match);
|
||||
break;
|
||||
}
|
||||
#ifdef MISSIONPACK
|
||||
//CTF & 1FCTF & Obelisk & Harvester
|
||||
case MSG_ATTACKENEMYBASE:
|
||||
{
|
||||
BotMatch_AttackEnemyBase(bs, &match);
|
||||
break;
|
||||
}
|
||||
//Harvester
|
||||
case MSG_HARVEST:
|
||||
{
|
||||
BotMatch_Harvest(bs, &match);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
//CTF & 1FCTF & Harvester
|
||||
case MSG_RUSHBASE: //ctf rush to the base
|
||||
{
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.29 2002/06/16 17:37:59 jbravo
|
||||
// Removed the MISSIONPACK ifdefs and missionpack only code.
|
||||
//
|
||||
// Revision 1.28 2002/06/05 19:16:22 makro
|
||||
// Made bots choose the ssg in teamplay
|
||||
//
|
||||
|
@ -1102,203 +1105,6 @@ int BotGetLongTermGoal(bot_state_t *bs, int tfl, int retreat, bot_goal_t *goal)
|
|||
}
|
||||
}
|
||||
#endif //CTF
|
||||
#ifdef MISSIONPACK
|
||||
else if (gametype == GT_1FCTF) {
|
||||
if (bs->ltgtype == LTG_GETFLAG) {
|
||||
//check for bot typing status message
|
||||
if (bs->teammessage_time && bs->teammessage_time < FloatTime()) {
|
||||
BotAI_BotInitialChat(bs, "captureflag_start", NULL);
|
||||
trap_BotEnterChat(bs->cs, 0, CHAT_TEAM);
|
||||
BotVoiceChatOnly(bs, -1, VOICECHAT_ONGETFLAG);
|
||||
bs->teammessage_time = 0;
|
||||
}
|
||||
memcpy(goal, &ctf_neutralflag, sizeof(bot_goal_t));
|
||||
//if touching the flag
|
||||
if (trap_BotTouchingGoal(bs->origin, goal)) {
|
||||
bs->ltgtype = 0;
|
||||
}
|
||||
//stop after 3 minutes
|
||||
if (bs->teamgoal_time < FloatTime()) {
|
||||
bs->ltgtype = 0;
|
||||
}
|
||||
return qtrue;
|
||||
}
|
||||
//if rushing to the base
|
||||
if (bs->ltgtype == LTG_RUSHBASE) {
|
||||
switch(BotTeam(bs)) {
|
||||
case TEAM_RED: memcpy(goal, &ctf_blueflag, sizeof(bot_goal_t)); break;
|
||||
case TEAM_BLUE: memcpy(goal, &ctf_redflag, sizeof(bot_goal_t)); break;
|
||||
default: bs->ltgtype = 0; return qfalse;
|
||||
}
|
||||
//if not carrying the flag anymore
|
||||
if (!Bot1FCTFCarryingFlag(bs)) {
|
||||
bs->ltgtype = 0;
|
||||
}
|
||||
//quit rushing after 2 minutes
|
||||
if (bs->teamgoal_time < FloatTime()) {
|
||||
bs->ltgtype = 0;
|
||||
}
|
||||
//if touching the base flag the bot should loose the enemy flag
|
||||
if (trap_BotTouchingGoal(bs->origin, goal)) {
|
||||
bs->ltgtype = 0;
|
||||
}
|
||||
BotAlternateRoute(bs, goal);
|
||||
return qtrue;
|
||||
}
|
||||
//attack the enemy base
|
||||
if (bs->ltgtype == LTG_ATTACKENEMYBASE &&
|
||||
bs->attackaway_time < FloatTime()) {
|
||||
//check for bot typing status message
|
||||
if (bs->teammessage_time && bs->teammessage_time < FloatTime()) {
|
||||
BotAI_BotInitialChat(bs, "attackenemybase_start", NULL);
|
||||
trap_BotEnterChat(bs->cs, 0, CHAT_TEAM);
|
||||
BotVoiceChatOnly(bs, -1, VOICECHAT_ONOFFENSE);
|
||||
bs->teammessage_time = 0;
|
||||
}
|
||||
switch(BotTeam(bs)) {
|
||||
case TEAM_RED: memcpy(goal, &ctf_blueflag, sizeof(bot_goal_t)); break;
|
||||
case TEAM_BLUE: memcpy(goal, &ctf_redflag, sizeof(bot_goal_t)); break;
|
||||
default: bs->ltgtype = 0; return qfalse;
|
||||
}
|
||||
//quit rushing after 2 minutes
|
||||
if (bs->teamgoal_time < FloatTime()) {
|
||||
bs->ltgtype = 0;
|
||||
}
|
||||
//if touching the base flag the bot should loose the enemy flag
|
||||
if (trap_BotTouchingGoal(bs->origin, goal)) {
|
||||
bs->attackaway_time = FloatTime() + 2 + 5 * random();
|
||||
}
|
||||
return qtrue;
|
||||
}
|
||||
//returning flag
|
||||
if (bs->ltgtype == LTG_RETURNFLAG) {
|
||||
//check for bot typing status message
|
||||
if (bs->teammessage_time && bs->teammessage_time < FloatTime()) {
|
||||
BotAI_BotInitialChat(bs, "returnflag_start", NULL);
|
||||
trap_BotEnterChat(bs->cs, 0, CHAT_TEAM);
|
||||
BotVoiceChatOnly(bs, -1, VOICECHAT_ONRETURNFLAG);
|
||||
bs->teammessage_time = 0;
|
||||
}
|
||||
//
|
||||
if (bs->teamgoal_time < FloatTime()) {
|
||||
bs->ltgtype = 0;
|
||||
}
|
||||
//just roam around
|
||||
return BotGetItemLongTermGoal(bs, tfl, goal);
|
||||
}
|
||||
}
|
||||
else if (gametype == GT_OBELISK) {
|
||||
if (bs->ltgtype == LTG_ATTACKENEMYBASE &&
|
||||
bs->attackaway_time < FloatTime()) {
|
||||
|
||||
//check for bot typing status message
|
||||
if (bs->teammessage_time && bs->teammessage_time < FloatTime()) {
|
||||
BotAI_BotInitialChat(bs, "attackenemybase_start", NULL);
|
||||
trap_BotEnterChat(bs->cs, 0, CHAT_TEAM);
|
||||
BotVoiceChatOnly(bs, -1, VOICECHAT_ONOFFENSE);
|
||||
bs->teammessage_time = 0;
|
||||
}
|
||||
switch(BotTeam(bs)) {
|
||||
case TEAM_RED: memcpy(goal, &blueobelisk, sizeof(bot_goal_t)); break;
|
||||
case TEAM_BLUE: memcpy(goal, &redobelisk, sizeof(bot_goal_t)); break;
|
||||
default: bs->ltgtype = 0; return qfalse;
|
||||
}
|
||||
//if the bot no longer wants to attack the obelisk
|
||||
if (BotFeelingBad(bs) > 50) {
|
||||
return BotGetItemLongTermGoal(bs, tfl, goal);
|
||||
}
|
||||
//if touching the obelisk
|
||||
if (trap_BotTouchingGoal(bs->origin, goal)) {
|
||||
bs->attackaway_time = FloatTime() + 3 + 5 * random();
|
||||
}
|
||||
// or very close to the obelisk
|
||||
VectorSubtract(bs->origin, goal->origin, dir);
|
||||
if (VectorLengthSquared(dir) < Square(60)) {
|
||||
bs->attackaway_time = FloatTime() + 3 + 5 * random();
|
||||
}
|
||||
//quit rushing after 2 minutes
|
||||
if (bs->teamgoal_time < FloatTime()) {
|
||||
bs->ltgtype = 0;
|
||||
}
|
||||
BotAlternateRoute(bs, goal);
|
||||
//just move towards the obelisk
|
||||
return qtrue;
|
||||
}
|
||||
}
|
||||
else if (gametype == GT_HARVESTER) {
|
||||
//if rushing to the base
|
||||
if (bs->ltgtype == LTG_RUSHBASE) {
|
||||
switch(BotTeam(bs)) {
|
||||
case TEAM_RED: memcpy(goal, &blueobelisk, sizeof(bot_goal_t)); break;
|
||||
case TEAM_BLUE: memcpy(goal, &redobelisk, sizeof(bot_goal_t)); break;
|
||||
default: BotGoHarvest(bs); return qfalse;
|
||||
}
|
||||
//if not carrying any cubes
|
||||
if (!BotHarvesterCarryingCubes(bs)) {
|
||||
BotGoHarvest(bs);
|
||||
return qfalse;
|
||||
}
|
||||
//quit rushing after 2 minutes
|
||||
if (bs->teamgoal_time < FloatTime()) {
|
||||
BotGoHarvest(bs);
|
||||
return qfalse;
|
||||
}
|
||||
//if touching the base flag the bot should loose the enemy flag
|
||||
if (trap_BotTouchingGoal(bs->origin, goal)) {
|
||||
BotGoHarvest(bs);
|
||||
return qfalse;
|
||||
}
|
||||
BotAlternateRoute(bs, goal);
|
||||
return qtrue;
|
||||
}
|
||||
//attack the enemy base
|
||||
if (bs->ltgtype == LTG_ATTACKENEMYBASE &&
|
||||
bs->attackaway_time < FloatTime()) {
|
||||
//check for bot typing status message
|
||||
if (bs->teammessage_time && bs->teammessage_time < FloatTime()) {
|
||||
BotAI_BotInitialChat(bs, "attackenemybase_start", NULL);
|
||||
trap_BotEnterChat(bs->cs, 0, CHAT_TEAM);
|
||||
BotVoiceChatOnly(bs, -1, VOICECHAT_ONOFFENSE);
|
||||
bs->teammessage_time = 0;
|
||||
}
|
||||
switch(BotTeam(bs)) {
|
||||
case TEAM_RED: memcpy(goal, &blueobelisk, sizeof(bot_goal_t)); break;
|
||||
case TEAM_BLUE: memcpy(goal, &redobelisk, sizeof(bot_goal_t)); break;
|
||||
default: bs->ltgtype = 0; return qfalse;
|
||||
}
|
||||
//quit rushing after 2 minutes
|
||||
if (bs->teamgoal_time < FloatTime()) {
|
||||
bs->ltgtype = 0;
|
||||
}
|
||||
//if touching the base flag the bot should loose the enemy flag
|
||||
if (trap_BotTouchingGoal(bs->origin, goal)) {
|
||||
bs->attackaway_time = FloatTime() + 2 + 5 * random();
|
||||
}
|
||||
return qtrue;
|
||||
}
|
||||
//harvest cubes
|
||||
if (bs->ltgtype == LTG_HARVEST &&
|
||||
bs->harvestaway_time < FloatTime()) {
|
||||
//check for bot typing status message
|
||||
if (bs->teammessage_time && bs->teammessage_time < FloatTime()) {
|
||||
BotAI_BotInitialChat(bs, "harvest_start", NULL);
|
||||
trap_BotEnterChat(bs->cs, 0, CHAT_TEAM);
|
||||
BotVoiceChatOnly(bs, -1, VOICECHAT_ONOFFENSE);
|
||||
bs->teammessage_time = 0;
|
||||
}
|
||||
memcpy(goal, &neutralobelisk, sizeof(bot_goal_t));
|
||||
//
|
||||
if (bs->teamgoal_time < FloatTime()) {
|
||||
bs->ltgtype = 0;
|
||||
}
|
||||
//
|
||||
if (trap_BotTouchingGoal(bs->origin, goal)) {
|
||||
bs->harvestaway_time = FloatTime() + 4 + 3 * random();
|
||||
}
|
||||
return qtrue;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
//normal goal stuff
|
||||
return BotGetItemLongTermGoal(bs, tfl, goal);
|
||||
}
|
||||
|
@ -1648,12 +1454,6 @@ int BotSelectActivateWeapon(bot_state_t *bs) {
|
|||
else if (bs->inventory[INVENTORY_MP5] > 0 && bs->inventory[INVENTORY_MP5AMMO] > 0)
|
||||
// return WEAPONINDEX_MP5;
|
||||
return WP_MP5;
|
||||
#ifdef MISSIONPACK
|
||||
else if (bs->inventory[INVENTORY_CHAINGUN] > 0 && bs->inventory[INVENTORY_BELT] > 0)
|
||||
return WEAPONINDEX_CHAINGUN;
|
||||
else if (bs->inventory[INVENTORY_NAILGUN] > 0 && bs->inventory[INVENTORY_NAILS] > 0)
|
||||
return WEAPONINDEX_NAILGUN;
|
||||
#endif
|
||||
else if (bs->inventory[INVENTORY_SSG3000] > 0 && bs->inventory[INVENTORY_SSG3000AMMO] > 0)
|
||||
// return WEAPONINDEX_SSG3000;
|
||||
return WP_SSG3000;
|
||||
|
@ -2280,17 +2080,6 @@ int AINode_Seek_LTG(bot_state_t *bs)
|
|||
range = 50;
|
||||
}
|
||||
#endif //CTF
|
||||
#ifdef MISSIONPACK
|
||||
else if (gametype == GT_1FCTF) {
|
||||
if (Bot1FCTFCarryingFlag(bs))
|
||||
range = 50;
|
||||
}
|
||||
else if (gametype == GT_HARVESTER) {
|
||||
if (BotHarvesterCarryingCubes(bs))
|
||||
range = 80;
|
||||
}
|
||||
#endif
|
||||
//
|
||||
if (BotNearbyGoal(bs, bs->tfl, &goal, range)) {
|
||||
trap_BotResetLastAvoidReach(bs->ms);
|
||||
//get the goal at the top of the stack
|
||||
|
@ -2472,13 +2261,6 @@ int AINode_Battle_Fight(bot_state_t *bs) {
|
|||
VectorCopy(entinfo.origin, target);
|
||||
// if not a player enemy
|
||||
if (bs->enemy >= MAX_CLIENTS) {
|
||||
#ifdef MISSIONPACK
|
||||
// if attacking an obelisk
|
||||
if ( bs->enemy == redobelisk.entitynum ||
|
||||
bs->enemy == blueobelisk.entitynum ) {
|
||||
target[2] += 16;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
//update the reachability area and origin if possible
|
||||
areanum = BotPointAreaNum(target);
|
||||
|
@ -2770,13 +2552,6 @@ int AINode_Battle_Retreat(bot_state_t *bs) {
|
|||
VectorCopy(entinfo.origin, target);
|
||||
// if not a player enemy
|
||||
if (bs->enemy >= MAX_CLIENTS) {
|
||||
#ifdef MISSIONPACK
|
||||
// if attacking an obelisk
|
||||
if ( bs->enemy == redobelisk.entitynum ||
|
||||
bs->enemy == blueobelisk.entitynum ) {
|
||||
target[2] += 16;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
//update the reachability area and origin if possible
|
||||
areanum = BotPointAreaNum(target);
|
||||
|
@ -2844,17 +2619,6 @@ int AINode_Battle_Retreat(bot_state_t *bs) {
|
|||
range = 50;
|
||||
}
|
||||
#endif //CTF
|
||||
#ifdef MISSIONPACK
|
||||
else if (gametype == GT_1FCTF) {
|
||||
if (Bot1FCTFCarryingFlag(bs))
|
||||
range = 50;
|
||||
}
|
||||
else if (gametype == GT_HARVESTER) {
|
||||
if (BotHarvesterCarryingCubes(bs))
|
||||
range = 80;
|
||||
}
|
||||
#endif
|
||||
//
|
||||
if (BotNearbyGoal(bs, bs->tfl, &goal, range)) {
|
||||
trap_BotResetLastAvoidReach(bs->ms);
|
||||
//time the bot gets to pick up the nearby goal item
|
||||
|
@ -2973,13 +2737,6 @@ int AINode_Battle_NBG(bot_state_t *bs) {
|
|||
VectorCopy(entinfo.origin, target);
|
||||
// if not a player enemy
|
||||
if (bs->enemy >= MAX_CLIENTS) {
|
||||
#ifdef MISSIONPACK
|
||||
// if attacking an obelisk
|
||||
if ( bs->enemy == redobelisk.entitynum ||
|
||||
bs->enemy == blueobelisk.entitynum ) {
|
||||
target[2] += 16;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
//update the reachability area and origin if possible
|
||||
areanum = BotPointAreaNum(target);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.9 2002/06/16 17:37:59 jbravo
|
||||
// Removed the MISSIONPACK ifdefs and missionpack only code.
|
||||
//
|
||||
// Revision 1.8 2002/05/30 21:18:28 makro
|
||||
// Bots should reload/bandage when roaming around
|
||||
// Added "pathtarget" key to all the entities
|
||||
|
@ -74,10 +77,6 @@ qboolean EntityIsDead(aas_entityinfo_t *entinfo);
|
|||
qboolean EntityIsInvisible(aas_entityinfo_t *entinfo);
|
||||
//returns true if the entity is shooting
|
||||
qboolean EntityIsShooting(aas_entityinfo_t *entinfo);
|
||||
#ifdef MISSIONPACK
|
||||
//returns true if this entity has the kamikaze
|
||||
qboolean EntityHasKamikaze(aas_entityinfo_t *entinfo);
|
||||
#endif
|
||||
// set a user info key/value pair
|
||||
void BotSetUserInfo(bot_state_t *bs, char *key, char *value);
|
||||
// set the team status (offense, defense etc.)
|
||||
|
@ -159,19 +158,6 @@ void BotCTFSeekGoals(bot_state_t *bs);
|
|||
//set ctf goals (defend base, get enemy flag) during retreat
|
||||
void BotCTFRetreatGoals(bot_state_t *bs);
|
||||
//
|
||||
#ifdef MISSIONPACK
|
||||
int Bot1FCTFCarryingFlag(bot_state_t *bs);
|
||||
int BotHarvesterCarryingCubes(bot_state_t *bs);
|
||||
void Bot1FCTFSeekGoals(bot_state_t *bs);
|
||||
void Bot1FCTFRetreatGoals(bot_state_t *bs);
|
||||
void BotObeliskSeekGoals(bot_state_t *bs);
|
||||
void BotObeliskRetreatGoals(bot_state_t *bs);
|
||||
void BotGoHarvest(bot_state_t *bs);
|
||||
void BotHarvesterSeekGoals(bot_state_t *bs);
|
||||
void BotHarvesterRetreatGoals(bot_state_t *bs);
|
||||
int BotTeamCubeCarrierVisible(bot_state_t *bs);
|
||||
int BotEnemyCubeCarrierVisible(bot_state_t *bs);
|
||||
#endif
|
||||
//get a random alternate route goal towards the given base
|
||||
int BotGetAlternateRouteGoal(bot_state_t *bs, int base);
|
||||
//returns either the alternate route goal or the given goal
|
||||
|
@ -222,11 +208,3 @@ extern vmCvar_t bot_challenge;
|
|||
|
||||
extern bot_goal_t ctf_redflag;
|
||||
extern bot_goal_t ctf_blueflag;
|
||||
#ifdef MISSIONPACK
|
||||
extern bot_goal_t ctf_neutralflag;
|
||||
extern bot_goal_t redobelisk;
|
||||
extern bot_goal_t blueobelisk;
|
||||
extern bot_goal_t neutralobelisk;
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.10 2002/06/16 17:37:59 jbravo
|
||||
// Removed the MISSIONPACK ifdefs and missionpack only code.
|
||||
//
|
||||
// Revision 1.9 2002/05/18 14:52:16 makro
|
||||
// Bot stuff. Other stuff. Just... stuff :p
|
||||
//
|
||||
|
@ -305,21 +308,6 @@ void BotReportStatus(bot_state_t *bs) {
|
|||
else strcpy(flagstatus, S_COLOR_BLUE"F ");
|
||||
}
|
||||
}
|
||||
#ifdef MISSIONPACK
|
||||
else if (gametype == GT_1FCTF) {
|
||||
if (Bot1FCTFCarryingFlag(bs)) {
|
||||
if (BotTeam(bs) == TEAM_RED) strcpy(flagstatus, S_COLOR_RED"F ");
|
||||
else strcpy(flagstatus, S_COLOR_BLUE"F ");
|
||||
}
|
||||
}
|
||||
else if (gametype == GT_HARVESTER) {
|
||||
if (BotHarvesterCarryingCubes(bs)) {
|
||||
if (BotTeam(bs) == TEAM_RED) Com_sprintf(flagstatus, sizeof(flagstatus), S_COLOR_RED"%2d", bs->inventory[INVENTORY_REDCUBE]);
|
||||
else Com_sprintf(flagstatus, sizeof(flagstatus), S_COLOR_BLUE"%2d", bs->inventory[INVENTORY_BLUECUBE]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
switch(bs->ltgtype) {
|
||||
case LTG_TEAMHELP:
|
||||
{
|
||||
|
@ -454,19 +442,6 @@ void BotSetInfoConfigString(bot_state_t *bs) {
|
|||
strcpy(carrying, "F ");
|
||||
}
|
||||
}
|
||||
#ifdef MISSIONPACK
|
||||
else if (gametype == GT_1FCTF) {
|
||||
if (Bot1FCTFCarryingFlag(bs)) {
|
||||
strcpy(carrying, "F ");
|
||||
}
|
||||
}
|
||||
else if (gametype == GT_HARVESTER) {
|
||||
if (BotHarvesterCarryingCubes(bs)) {
|
||||
if (BotTeam(bs) == TEAM_RED) Com_sprintf(carrying, sizeof(carrying), "%2d", bs->inventory[INVENTORY_REDCUBE]);
|
||||
else Com_sprintf(carrying, sizeof(carrying), "%2d", bs->inventory[INVENTORY_BLUECUBE]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
switch(bs->ltgtype) {
|
||||
case LTG_TEAMHELP:
|
||||
|
@ -1022,17 +997,6 @@ int BotAI(int client, float thinktime) {
|
|||
args[strlen(args)-1] = '\0';
|
||||
trap_BotQueueConsoleMessage(bs->cs, CMS_CHAT, args);
|
||||
}
|
||||
#ifdef MISSIONPACK
|
||||
else if (!Q_stricmp(buf, "vchat")) {
|
||||
BotVoiceChatCommand(bs, SAY_ALL, args);
|
||||
}
|
||||
else if (!Q_stricmp(buf, "vtchat")) {
|
||||
BotVoiceChatCommand(bs, SAY_TEAM, args);
|
||||
}
|
||||
else if (!Q_stricmp(buf, "vtell")) {
|
||||
BotVoiceChatCommand(bs, SAY_TELL, args);
|
||||
}
|
||||
#endif
|
||||
else if (!Q_stricmp(buf, "scores"))
|
||||
{ /*FIXME: parse scores?*/ }
|
||||
else if (!Q_stricmp(buf, "clientLevelShot"))
|
||||
|
@ -1381,10 +1345,6 @@ int BotAILoadMap( int restart ) {
|
|||
return qtrue;
|
||||
}
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
void ProximityMine_Trigger( gentity_t *trigger, gentity_t *other, trace_t *trace );
|
||||
#endif
|
||||
|
||||
/*
|
||||
==================
|
||||
BotAIStartFrame
|
||||
|
@ -1507,16 +1467,6 @@ int BotAIStartFrame(int time) {
|
|||
trap_BotLibUpdateEntity(i, NULL);
|
||||
continue;
|
||||
}
|
||||
#ifdef MISSIONPACK
|
||||
// never link prox mine triggers
|
||||
if (ent->r.contents == CONTENTS_TRIGGER) {
|
||||
if (ent->touch == ProximityMine_Trigger) {
|
||||
trap_BotLibUpdateEntity(i, NULL);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
//
|
||||
memset(&state, 0, sizeof(bot_entitystate_t));
|
||||
//
|
||||
VectorCopy(ent->r.currentOrigin, state.origin);
|
||||
|
@ -1651,10 +1601,6 @@ int BotInitLibrary(void) {
|
|||
//cd directory
|
||||
trap_Cvar_VariableStringBuffer("fs_cdpath", buf, sizeof(buf));
|
||||
if (strlen(buf)) trap_BotLibVarSet("cddir", buf);
|
||||
//
|
||||
#ifdef MISSIONPACK
|
||||
trap_BotLibDefine("MISSIONPACK");
|
||||
#endif
|
||||
//setup the bot library
|
||||
return trap_BotLibSetup();
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.6 2002/06/16 17:37:59 jbravo
|
||||
// Removed the MISSIONPACK ifdefs and missionpack only code.
|
||||
//
|
||||
// Revision 1.5 2002/04/04 18:06:44 makro
|
||||
// Improved door code. Bots reply to radio treport from teammates.
|
||||
// Improved reloading code.
|
||||
|
@ -79,14 +82,7 @@ void BotVoiceChat_GetFlag(bot_state_t *bs, int client, int mode) {
|
|||
if (gametype == GT_CTF) {
|
||||
if (!ctf_redflag.areanum || !ctf_blueflag.areanum)
|
||||
return;
|
||||
}
|
||||
#ifdef MISSIONPACK
|
||||
else if (gametype == GT_1FCTF) {
|
||||
if (!ctf_neutralflag.areanum || !ctf_redflag.areanum || !ctf_blueflag.areanum)
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
//
|
||||
|
@ -119,51 +115,24 @@ BotVoiceChat_Offense
|
|||
==================
|
||||
*/
|
||||
void BotVoiceChat_Offense(bot_state_t *bs, int client, int mode) {
|
||||
if ( gametype == GT_CTF
|
||||
#ifdef MISSIONPACK
|
||||
|| gametype == GT_1FCTF
|
||||
#endif
|
||||
) {
|
||||
if ( gametype == GT_CTF ) {
|
||||
BotVoiceChat_GetFlag(bs, client, mode);
|
||||
return;
|
||||
}
|
||||
#ifdef MISSIONPACK
|
||||
if (gametype == GT_HARVESTER) {
|
||||
//
|
||||
bs->decisionmaker = client;
|
||||
bs->ordered = qtrue;
|
||||
bs->order_time = FloatTime();
|
||||
//set the time to send a message to the team mates
|
||||
bs->teammessage_time = FloatTime() + 2 * random();
|
||||
//set the ltg type
|
||||
bs->ltgtype = LTG_HARVEST;
|
||||
//set the team goal time
|
||||
bs->teamgoal_time = FloatTime() + TEAM_HARVEST_TIME;
|
||||
bs->harvestaway_time = 0;
|
||||
//
|
||||
BotSetTeamStatus(bs);
|
||||
// remember last ordered task
|
||||
BotRememberLastOrderedTask(bs);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
//
|
||||
bs->decisionmaker = client;
|
||||
bs->ordered = qtrue;
|
||||
bs->order_time = FloatTime();
|
||||
//set the time to send a message to the team mates
|
||||
bs->teammessage_time = FloatTime() + 2 * random();
|
||||
//set the ltg type
|
||||
bs->ltgtype = LTG_ATTACKENEMYBASE;
|
||||
//set the team goal time
|
||||
bs->teamgoal_time = FloatTime() + TEAM_ATTACKENEMYBASE_TIME;
|
||||
bs->attackaway_time = 0;
|
||||
//
|
||||
BotSetTeamStatus(bs);
|
||||
// remember last ordered task
|
||||
BotRememberLastOrderedTask(bs);
|
||||
}
|
||||
bs->decisionmaker = client;
|
||||
bs->ordered = qtrue;
|
||||
bs->order_time = FloatTime();
|
||||
//set the time to send a message to the team mates
|
||||
bs->teammessage_time = FloatTime() + 2 * random();
|
||||
//set the ltg type
|
||||
bs->ltgtype = LTG_ATTACKENEMYBASE;
|
||||
//set the team goal time
|
||||
bs->teamgoal_time = FloatTime() + TEAM_ATTACKENEMYBASE_TIME;
|
||||
bs->attackaway_time = 0;
|
||||
//
|
||||
BotSetTeamStatus(bs);
|
||||
// remember last ordered task
|
||||
BotRememberLastOrderedTask(bs);
|
||||
#ifdef DEBUG
|
||||
BotPrintTeamGoal(bs);
|
||||
#endif //DEBUG
|
||||
|
@ -175,30 +144,13 @@ BotVoiceChat_Defend
|
|||
==================
|
||||
*/
|
||||
void BotVoiceChat_Defend(bot_state_t *bs, int client, int mode) {
|
||||
#ifdef MISSIONPACK
|
||||
if ( gametype == GT_OBELISK || gametype == GT_HARVESTER) {
|
||||
//
|
||||
switch(BotTeam(bs)) {
|
||||
case TEAM_RED: memcpy(&bs->teamgoal, &redobelisk, sizeof(bot_goal_t)); break;
|
||||
case TEAM_BLUE: memcpy(&bs->teamgoal, &blueobelisk, sizeof(bot_goal_t)); break;
|
||||
default: return;
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (gametype == GT_CTF
|
||||
#ifdef MISSIONPACK
|
||||
|| gametype == GT_1FCTF
|
||||
#endif
|
||||
) {
|
||||
//
|
||||
if (gametype == GT_CTF ) {
|
||||
switch(BotTeam(bs)) {
|
||||
case TEAM_RED: memcpy(&bs->teamgoal, &ctf_redflag, sizeof(bot_goal_t)); break;
|
||||
case TEAM_BLUE: memcpy(&bs->teamgoal, &ctf_blueflag, sizeof(bot_goal_t)); break;
|
||||
default: return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
//
|
||||
|
@ -387,12 +339,7 @@ BotVoiceChat_ReturnFlag
|
|||
*/
|
||||
void BotVoiceChat_ReturnFlag(bot_state_t *bs, int client, int mode) {
|
||||
//if not in CTF mode
|
||||
if (
|
||||
gametype != GT_CTF
|
||||
#ifdef MISSIONPACK
|
||||
&& gametype != GT_1FCTF
|
||||
#endif
|
||||
) {
|
||||
if (gametype != GT_CTF) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.40 2002/06/16 17:37:59 jbravo
|
||||
// Removed the MISSIONPACK ifdefs and missionpack only code.
|
||||
//
|
||||
// Revision 1.39 2002/05/29 13:49:25 makro
|
||||
// Elevators/doors
|
||||
//
|
||||
|
@ -593,271 +596,6 @@ Only in CTF games
|
|||
"",
|
||||
""
|
||||
},
|
||||
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
/*QUAKED holdable_kamikaze (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
|
||||
*/
|
||||
{
|
||||
"holdable_kamikaze",
|
||||
"sound/items/holdable.wav",
|
||||
{ "models/powerups/kamikazi.md3",
|
||||
0, 0, 0},
|
||||
/* icon */ "icons/kamikaze",
|
||||
/* pickup */ "Kamikaze",
|
||||
60,
|
||||
IT_HOLDABLE,
|
||||
HI_KAMIKAZE,
|
||||
/* precache */ "",
|
||||
/* sounds */ "sound/items/kamikazerespawn.wav"
|
||||
},
|
||||
|
||||
/*QUAKED holdable_portal (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
|
||||
*/
|
||||
{
|
||||
"holdable_portal",
|
||||
"sound/items/holdable.wav",
|
||||
{ "models/powerups/holdable/porter.md3",
|
||||
0, 0, 0},
|
||||
/* icon */ "icons/portal",
|
||||
/* pickup */ "Portal",
|
||||
60,
|
||||
IT_HOLDABLE,
|
||||
HI_PORTAL,
|
||||
/* precache */ "",
|
||||
/* sounds */ ""
|
||||
},
|
||||
|
||||
/*QUAKED holdable_invulnerability (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
|
||||
*/
|
||||
{
|
||||
"holdable_invulnerability",
|
||||
"sound/items/holdable.wav",
|
||||
{ "models/powerups/holdable/invulnerability.md3",
|
||||
0, 0, 0},
|
||||
/* icon */ "icons/invulnerability",
|
||||
/* pickup */ "Invulnerability",
|
||||
60,
|
||||
IT_HOLDABLE,
|
||||
HI_INVULNERABILITY,
|
||||
/* precache */ "",
|
||||
/* sounds */ ""
|
||||
},
|
||||
|
||||
/*QUAKED ammo_nails (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
|
||||
*/
|
||||
{
|
||||
"ammo_nails",
|
||||
"sound/misc/am_pkup.wav",
|
||||
{ "models/powerups/ammo/nailgunam.md3",
|
||||
0, 0, 0},
|
||||
/* icon */ "icons/icona_nailgun",
|
||||
/* pickup */ "Nails",
|
||||
20,
|
||||
IT_AMMO,
|
||||
WP_NAILGUN,
|
||||
/* precache */ "",
|
||||
/* sounds */ ""
|
||||
},
|
||||
|
||||
/*QUAKED ammo_mines (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
|
||||
*/
|
||||
{
|
||||
"ammo_mines",
|
||||
"sound/misc/am_pkup.wav",
|
||||
{ "models/powerups/ammo/proxmineam.md3",
|
||||
0, 0, 0},
|
||||
/* icon */ "icons/icona_proxlauncher",
|
||||
/* pickup */ "Proximity Mines",
|
||||
10,
|
||||
IT_AMMO,
|
||||
WP_PROX_LAUNCHER,
|
||||
/* precache */ "",
|
||||
/* sounds */ ""
|
||||
},
|
||||
|
||||
/*QUAKED ammo_belt (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
|
||||
*/
|
||||
{
|
||||
"ammo_belt",
|
||||
"sound/misc/am_pkup.wav",
|
||||
{ "models/powerups/ammo/chaingunam.md3",
|
||||
0, 0, 0},
|
||||
/* icon */ "icons/icona_chaingun",
|
||||
/* pickup */ "Chaingun Belt",
|
||||
100,
|
||||
IT_AMMO,
|
||||
WP_CHAINGUN,
|
||||
/* precache */ "",
|
||||
/* sounds */ ""
|
||||
},
|
||||
|
||||
//
|
||||
// PERSISTANT POWERUP ITEMS
|
||||
//
|
||||
/*QUAKED item_scout (.3 .3 1) (-16 -16 -16) (16 16 16) suspended redTeam blueTeam
|
||||
*/
|
||||
{
|
||||
"item_scout",
|
||||
"sound/items/scout.wav",
|
||||
{ "models/powerups/scout.md3",
|
||||
0, 0, 0 },
|
||||
/* icon */ "icons/scout",
|
||||
/* pickup */ "Scout",
|
||||
30,
|
||||
IT_PERSISTANT_POWERUP,
|
||||
PW_SCOUT,
|
||||
/* precache */ "",
|
||||
/* sounds */ ""
|
||||
},
|
||||
|
||||
/*QUAKED item_guard (.3 .3 1) (-16 -16 -16) (16 16 16) suspended redTeam blueTeam
|
||||
*/
|
||||
{
|
||||
"item_guard",
|
||||
"sound/items/guard.wav",
|
||||
{ "models/powerups/guard.md3",
|
||||
0, 0, 0 },
|
||||
/* icon */ "icons/guard",
|
||||
/* pickup */ "Guard",
|
||||
30,
|
||||
IT_PERSISTANT_POWERUP,
|
||||
PW_GUARD,
|
||||
/* precache */ "",
|
||||
/* sounds */ ""
|
||||
},
|
||||
|
||||
/*QUAKED item_doubler (.3 .3 1) (-16 -16 -16) (16 16 16) suspended redTeam blueTeam
|
||||
*/
|
||||
{
|
||||
"item_doubler",
|
||||
"sound/items/doubler.wav",
|
||||
{ "models/powerups/doubler.md3",
|
||||
0, 0, 0 },
|
||||
/* icon */ "icons/doubler",
|
||||
/* pickup */ "Doubler",
|
||||
30,
|
||||
IT_PERSISTANT_POWERUP,
|
||||
PW_DOUBLER,
|
||||
/* precache */ "",
|
||||
/* sounds */ ""
|
||||
},
|
||||
|
||||
/*QUAKED item_doubler (.3 .3 1) (-16 -16 -16) (16 16 16) suspended redTeam blueTeam
|
||||
*/
|
||||
{
|
||||
"item_ammoregen",
|
||||
"sound/items/ammoregen.wav",
|
||||
{ "models/powerups/ammo.md3",
|
||||
0, 0, 0 },
|
||||
/* icon */ "icons/ammo_regen",
|
||||
/* pickup */ "Ammo Regen",
|
||||
30,
|
||||
IT_PERSISTANT_POWERUP,
|
||||
PW_AMMOREGEN,
|
||||
/* precache */ "",
|
||||
/* sounds */ ""
|
||||
},
|
||||
|
||||
/*QUAKED team_CTF_neutralflag (0 0 1) (-16 -16 -16) (16 16 16)
|
||||
Only in One Flag CTF games
|
||||
*/
|
||||
{
|
||||
"team_CTF_neutralflag",
|
||||
NULL,
|
||||
{ "models/flags/n_flag.md3",
|
||||
0, 0, 0 },
|
||||
/* icon */ "icons/iconf_neutral1",
|
||||
/* pickup */ "Neutral Flag",
|
||||
0,
|
||||
IT_TEAM,
|
||||
PW_NEUTRALFLAG,
|
||||
/* precache */ "",
|
||||
/* sounds */ ""
|
||||
},
|
||||
|
||||
{
|
||||
"item_redcube",
|
||||
"sound/misc/am_pkup.wav",
|
||||
{ "models/powerups/orb/r_orb.md3",
|
||||
0, 0, 0 },
|
||||
/* icon */ "icons/iconh_rorb",
|
||||
/* pickup */ "Red Cube",
|
||||
0,
|
||||
IT_TEAM,
|
||||
0,
|
||||
/* precache */ "",
|
||||
/* sounds */ ""
|
||||
},
|
||||
|
||||
{
|
||||
"item_bluecube",
|
||||
"sound/misc/am_pkup.wav",
|
||||
{ "models/powerups/orb/b_orb.md3",
|
||||
0, 0, 0 },
|
||||
/* icon */ "icons/iconh_borb",
|
||||
/* pickup */ "Blue Cube",
|
||||
0,
|
||||
IT_TEAM,
|
||||
0,
|
||||
/* precache */ "",
|
||||
/* sounds */ ""
|
||||
},
|
||||
/*QUAKED weapon_nailgun (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
|
||||
*/
|
||||
{
|
||||
"weapon_nailgun",
|
||||
"sound/misc/w_pkup.wav",
|
||||
{ "models/weapons/nailgun/nailgun.md3",
|
||||
0, 0, 0},
|
||||
/* icon */ "icons/iconw_nailgun",
|
||||
/* pickup */ "Nailgun",
|
||||
10,
|
||||
IT_WEAPON,
|
||||
WP_NAILGUN,
|
||||
/* precache */ "",
|
||||
/* sounds */ ""
|
||||
},
|
||||
|
||||
/*QUAKED weapon_prox_launcher (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
|
||||
*/
|
||||
{
|
||||
"weapon_prox_launcher",
|
||||
"sound/misc/w_pkup.wav",
|
||||
{ "models/weapons/proxmine/proxmine.md3",
|
||||
0, 0, 0},
|
||||
/* icon */ "icons/iconw_proxlauncher",
|
||||
/* pickup */ "Prox Launcher",
|
||||
5,
|
||||
IT_WEAPON,
|
||||
WP_PROX_LAUNCHER,
|
||||
/* precache */ "",
|
||||
//Elder: removing so we get rid of those error messages
|
||||
/* sounds */ /*"sound/weapons/proxmine/wstbtick.wav "
|
||||
"sound/weapons/proxmine/wstbactv.wav "
|
||||
"sound/weapons/proxmine/wstbimpl.wav "
|
||||
"sound/weapons/proxmine/wstbimpm.wav "
|
||||
"sound/weapons/proxmine/wstbimpd.wav "
|
||||
"sound/weapons/proxmine/wstbactv.wav"*/
|
||||
},
|
||||
|
||||
/*QUAKED weapon_chaingun (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
|
||||
*/
|
||||
{
|
||||
"weapon_chaingun",
|
||||
"sound/misc/w_pkup.wav",
|
||||
{ "models/weapons/vulcan/vulcan.md3",
|
||||
0, 0, 0},
|
||||
/* icon */ "icons/iconw_chaingun",
|
||||
/* pickup */ "Chaingun",
|
||||
80,
|
||||
IT_WEAPON,
|
||||
WP_CHAINGUN,
|
||||
/* precache */ "",
|
||||
/* sounds */ "sound/weapons/vulcan/wvulwind.wav"
|
||||
},
|
||||
#endif
|
||||
|
||||
// end of list marker
|
||||
{NULL}
|
||||
};
|
||||
|
@ -1064,9 +802,6 @@ This needs to be the same for client side prediction and server use.
|
|||
|
||||
qboolean BG_CanItemBeGrabbed( int gametype, const entityState_t *ent, const playerState_t *ps ) {
|
||||
gitem_t *item;
|
||||
#ifdef MISSIONPACK
|
||||
int upperBound;
|
||||
#endif
|
||||
|
||||
if ( ent->modelindex < 1 || ent->modelindex >= bg_numItems ) {
|
||||
Com_Error( ERR_DROP, "BG_CanItemBeGrabbed: index out of range" );
|
||||
|
@ -1097,38 +832,14 @@ qboolean BG_CanItemBeGrabbed( int gametype, const entityState_t *ent, const play
|
|||
return qtrue;
|
||||
|
||||
case IT_ARMOR:
|
||||
#ifdef MISSIONPACK
|
||||
if( bg_itemlist[ps->stats[STAT_PERSISTANT_POWERUP]].giTag == PW_SCOUT ) {
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
// we also clamp armor to the maxhealth for handicapping
|
||||
if( bg_itemlist[ps->stats[STAT_PERSISTANT_POWERUP]].giTag == PW_GUARD ) {
|
||||
upperBound = ps->stats[STAT_MAX_HEALTH];
|
||||
}
|
||||
else {
|
||||
upperBound = ps->stats[STAT_MAX_HEALTH] * 2;
|
||||
}
|
||||
|
||||
if ( ps->stats[STAT_ARMOR] >= upperBound ) {
|
||||
return qfalse;
|
||||
}
|
||||
#else
|
||||
if ( ps->stats[STAT_ARMOR] >= 200){//2 times max healthps->stats[STAT_MAX_HEALTH] * 2 ) {
|
||||
return qfalse;
|
||||
}
|
||||
#endif
|
||||
return qtrue;
|
||||
|
||||
case IT_HEALTH:
|
||||
// small and mega healths will go over the max, otherwise
|
||||
// don't pick up if already at max
|
||||
#ifdef MISSIONPACK
|
||||
if( bg_itemlist[ps->stats[STAT_PERSISTANT_POWERUP]].giTag == PW_GUARD ) {
|
||||
upperBound = ps->stats[STAT_MAX_HEALTH];
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if ( item->quantity == 5 || item->quantity == 100 ) {
|
||||
if ( ps->stats[STAT_HEALTH] >= 200) { //200 is max health x 2 ps->stats[STAT_MAX_HEALTH] * 2 ) {
|
||||
return qfalse;
|
||||
|
@ -1144,42 +855,7 @@ qboolean BG_CanItemBeGrabbed( int gametype, const entityState_t *ent, const play
|
|||
case IT_POWERUP:
|
||||
return qtrue; // powerups are always picked up
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
case IT_PERSISTANT_POWERUP:
|
||||
// can only hold one item at a time
|
||||
if ( ps->stats[STAT_PERSISTANT_POWERUP] ) {
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
// check team only
|
||||
if( ( ent->generic1 & 2 ) && ( ps->persistant[PERS_TEAM] != TEAM_RED ) ) {
|
||||
return qfalse;
|
||||
}
|
||||
if( ( ent->generic1 & 4 ) && ( ps->persistant[PERS_TEAM] != TEAM_BLUE ) ) {
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
return qtrue;
|
||||
#endif
|
||||
|
||||
case IT_TEAM: // team items, such as flags
|
||||
#ifdef MISSIONPACK
|
||||
if( gametype == GT_1FCTF ) {
|
||||
// neutral flag can always be picked up
|
||||
if( item->giTag == PW_NEUTRALFLAG ) {
|
||||
return qtrue;
|
||||
}
|
||||
if (ps->persistant[PERS_TEAM] == TEAM_RED) {
|
||||
if (item->giTag == PW_BLUEFLAG && ps->powerups[PW_NEUTRALFLAG] ) {
|
||||
return qtrue;
|
||||
}
|
||||
} else if (ps->persistant[PERS_TEAM] == TEAM_BLUE) {
|
||||
if (item->giTag == PW_REDFLAG && ps->powerups[PW_NEUTRALFLAG] ) {
|
||||
return qtrue;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if( gametype == GT_CTF ) {
|
||||
// ent->modelindex2 is non-zero on items if they are dropped
|
||||
// we need to know this because we can pick up our dropped flag (and return it)
|
||||
|
@ -1197,11 +873,6 @@ qboolean BG_CanItemBeGrabbed( int gametype, const entityState_t *ent, const play
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
if( gametype == GT_HARVESTER ) {
|
||||
return qtrue;
|
||||
}
|
||||
#endif
|
||||
return qfalse;
|
||||
|
||||
case IT_HOLDABLE:
|
||||
|
@ -1448,8 +1119,6 @@ char *eventnames[] = {
|
|||
"EV_CHIP_GLASS", // Blaze: this even just breaks it a little bit.
|
||||
"EV_PRESSURE_WATER", // NiceAss: Shot an ent under pressure with water
|
||||
"EV_SCOREPLUM", // score plum
|
||||
|
||||
//#ifdef MISSIONPACK
|
||||
"EV_PROXIMITY_MINE_STICK",
|
||||
"EV_PROXIMITY_MINE_TRIGGER",
|
||||
"EV_KAMIKAZE", // kamikaze explodes
|
||||
|
@ -1457,8 +1126,6 @@ char *eventnames[] = {
|
|||
"EV_INVUL_IMPACT", // invulnerability sphere impact
|
||||
"EV_JUICED", // invulnerability juiced effect
|
||||
"EV_LIGHTNINGBOLT", // lightning bolt bounced of invulnerability sphere
|
||||
//#endif
|
||||
|
||||
"EV_DEBUG_LINE",
|
||||
"EV_STOPLOOPINGSOUND",
|
||||
"EV_TAUNT"
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.78 2002/06/16 17:37:59 jbravo
|
||||
// Removed the MISSIONPACK ifdefs and missionpack only code.
|
||||
//
|
||||
// Revision 1.77 2002/06/11 03:09:28 niceass
|
||||
// +attack cancels reloads
|
||||
//
|
||||
|
@ -3116,12 +3119,6 @@ void PmoveSingle (pmove_t *pmove) {
|
|||
PM_DropTimers();
|
||||
CheckLadder(); // ARTHUR TOMLIN check and see if they're on a ladder
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
if ( pm->ps->powerups[PW_INVULNERABILITY] ) {
|
||||
PM_InvulnerabilityMove();
|
||||
} else
|
||||
#endif
|
||||
|
||||
if ( pm->ps->powerups[PW_FLIGHT] ) {
|
||||
// flight powerup doesn't allow jump and has different friction
|
||||
PM_FlyMove();
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.79 2002/06/16 17:37:59 jbravo
|
||||
// Removed the MISSIONPACK ifdefs and missionpack only code.
|
||||
//
|
||||
// Revision 1.78 2002/06/12 22:32:24 slicer
|
||||
// Even better way to improve the Cvar Anti-Cheat System
|
||||
//
|
||||
|
@ -649,9 +652,6 @@ void Pmove (pmove_t *pmove);
|
|||
typedef enum {
|
||||
STAT_HEALTH,
|
||||
STAT_HOLDABLE_ITEM, // Elder: Used to hold unique items in Reaction
|
||||
#ifdef MISSIONPACK
|
||||
STAT_PERSISTANT_POWERUP,
|
||||
#endif
|
||||
STAT_WEAPONS, // 16 bit fields
|
||||
STAT_ARMOR, // Elder: technically we don't need this anymore
|
||||
STAT_DEAD_YAW, // look this direction when dead (FIXME: get rid of?)
|
||||
|
@ -724,9 +724,6 @@ typedef enum {
|
|||
|
||||
// entityState_t->eFlags
|
||||
#define EF_DEAD 0x00000001 // don't draw a foe marker over players with EF_DEAD
|
||||
#ifdef MISSIONPACK
|
||||
#define EF_TICKING 0x00000002 // used to make players play the prox mine ticking sound
|
||||
#endif
|
||||
#define EF_HANDCANNON_SMOKED 0x00000002 // Elder: HC Smoke
|
||||
#define EF_TELEPORT_BIT 0x00000004 // toggled every time the origin abruptly changes
|
||||
#define EF_AWARD_EXCELLENT 0x00000008 // draw an excellent sprite
|
||||
|
@ -817,22 +814,6 @@ Combat Knife
|
|||
WP_AKIMBO,
|
||||
WP_KNIFE,
|
||||
WP_GRENADE,
|
||||
/*
|
||||
WP_KNIFE,
|
||||
WP_PISTOL,
|
||||
WP_M4,
|
||||
WP_SSG3000,
|
||||
WP_MP5,
|
||||
WP_M3,
|
||||
WP_HANDCANNON,
|
||||
WP_AKIMBO,
|
||||
WP_GRENADE,
|
||||
*/
|
||||
#ifdef MISSIONPACK
|
||||
WP_NAILGUN,
|
||||
WP_PROX_LAUNCHER,
|
||||
WP_CHAINGUN,
|
||||
#endif
|
||||
|
||||
WP_NUM_WEAPONS
|
||||
} weapon_t;
|
||||
|
@ -1093,7 +1074,6 @@ typedef enum {
|
|||
EV_PRESSURE, // NiceAss: an entity under pressure
|
||||
EV_SCOREPLUM, // score plum
|
||||
|
||||
//#ifdef MISSIONPACK
|
||||
EV_PROXIMITY_MINE_STICK,
|
||||
EV_PROXIMITY_MINE_TRIGGER,
|
||||
EV_KAMIKAZE, // kamikaze explodes
|
||||
|
@ -1102,7 +1082,6 @@ typedef enum {
|
|||
EV_INVUL_IMPACT, // invulnerability sphere impact
|
||||
EV_JUICED, // invulnerability juiced effect
|
||||
EV_LIGHTNINGBOLT, // lightning bolt bounced of invulnerability sphere
|
||||
//#endif
|
||||
|
||||
EV_DEBUG_LINE,
|
||||
EV_STOPLOOPINGSOUND,
|
||||
|
@ -1284,13 +1263,6 @@ typedef enum {
|
|||
MOD_SUICIDE,
|
||||
MOD_TARGET_LASER,
|
||||
MOD_TRIGGER_HURT,
|
||||
#ifdef MISSIONPACK
|
||||
MOD_NAIL,
|
||||
MOD_CHAINGUN,
|
||||
MOD_PROXIMITY_MINE,
|
||||
MOD_KAMIKAZE,
|
||||
MOD_JUICED,
|
||||
#endif
|
||||
MOD_GRAPPLE,
|
||||
//Blaze: Reaction Deaths
|
||||
MOD_KNIFE,
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.76 2002/06/16 17:38:00 jbravo
|
||||
// Removed the MISSIONPACK ifdefs and missionpack only code.
|
||||
//
|
||||
// Revision 1.75 2002/06/05 15:17:51 jbravo
|
||||
// Gibbed players now vanish (gibs with them tho :() and suicide is no
|
||||
// longer -2 frags. Added Obit handling for telefrags and better handling
|
||||
|
@ -411,13 +414,6 @@ G_SetClientSound
|
|||
===============
|
||||
*/
|
||||
void G_SetClientSound( gentity_t *ent ) {
|
||||
#ifdef MISSIONPACK
|
||||
if( ent->s.eFlags & EF_TICKING ) {
|
||||
//Elder: removed
|
||||
//ent->client->ps.loopSound = G_SoundIndex( "sound/weapons/proxmine/wstbtick.wav");
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (ent->waterlevel && (ent->watertype&(CONTENTS_LAVA|CONTENTS_SLIME)) ) {
|
||||
ent->client->ps.loopSound = level.snd_fry;
|
||||
} else {
|
||||
|
@ -706,9 +702,6 @@ Actions that happen once a second
|
|||
*/
|
||||
void ClientTimerActions( gentity_t *ent, int msec ) {
|
||||
gclient_t *client;
|
||||
#ifdef MISSIONPACK
|
||||
int maxHealth;
|
||||
#endif
|
||||
|
||||
client = ent->client;
|
||||
client->timeResidual += msec;
|
||||
|
@ -720,31 +713,6 @@ void ClientTimerActions( gentity_t *ent, int msec ) {
|
|||
// ent->client->isbleeding = qfalse;
|
||||
|
||||
// regenerate
|
||||
#ifdef MISSIONPACK
|
||||
if( bg_itemlist[client->ps.stats[STAT_PERSISTANT_POWERUP]].giTag == PW_GUARD ) {
|
||||
maxHealth = client->ps.stats[STAT_MAX_HEALTH] / 2;
|
||||
}
|
||||
else if ( client->ps.powerups[PW_REGEN] ) {
|
||||
maxHealth = client->ps.stats[STAT_MAX_HEALTH];
|
||||
}
|
||||
else {
|
||||
maxHealth = 0;
|
||||
}
|
||||
if( maxHealth ) {
|
||||
if ( ent->health < maxHealth ) {
|
||||
ent->health += 15;
|
||||
if ( ent->health > maxHealth * 1.1 ) {
|
||||
ent->health = maxHealth * 1.1;
|
||||
}
|
||||
G_AddEvent( ent, EV_POWERUP_REGEN, 0 );
|
||||
} else if ( ent->health < maxHealth * 2) {
|
||||
ent->health += 5;
|
||||
if ( ent->health > maxHealth * 2 ) {
|
||||
ent->health = maxHealth * 2;
|
||||
}
|
||||
G_AddEvent( ent, EV_POWERUP_REGEN, 0 );
|
||||
}
|
||||
#else
|
||||
if ( client->ps.powerups[PW_REGEN] ) {
|
||||
if ( ent->health < 100) { //max health 100 client->ps.stats[STAT_MAX_HEALTH]) {
|
||||
ent->health += 15;
|
||||
|
@ -759,7 +727,6 @@ void ClientTimerActions( gentity_t *ent, int msec ) {
|
|||
}
|
||||
G_AddEvent( ent, EV_POWERUP_REGEN, 0 );
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
// count down health when over max
|
||||
if ( ent->health > 100 ) { //max is 100 client->ps.stats[STAT_MAX_HEALTH] ) {
|
||||
|
@ -795,46 +762,6 @@ void ClientTimerActions( gentity_t *ent, int msec ) {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
if( bg_itemlist[client->ps.stats[STAT_PERSISTANT_POWERUP]].giTag == PW_AMMOREGEN ) {
|
||||
int w, max, inc, t, i;
|
||||
int weapList[]={WP_MACHINEGUN,WP_SHOTGUN,WP_GRENADE_LAUNCHER,WP_ROCKET_LAUNCHER,WP_LIGHTNING,WP_RAILGUN,WP_PLASMAGUN,WP_BFG,WP_NAILGUN,WP_PROX_LAUNCHER,WP_CHAINGUN};
|
||||
int weapCount = sizeof(weapList) / sizeof(int);
|
||||
//
|
||||
for (i = 0; i < weapCount; i++) {
|
||||
w = weapList[i];
|
||||
|
||||
switch(w) {
|
||||
case WP_MACHINEGUN: max = 50; inc = 4; t = 1000; break;
|
||||
case WP_SHOTGUN: max = 10; inc = 1; t = 1500; break;
|
||||
case WP_GRENADE_LAUNCHER: max = 10; inc = 1; t = 2000; break;
|
||||
case WP_ROCKET_LAUNCHER: max = 10; inc = 1; t = 1750; break;
|
||||
case WP_LIGHTNING: max = 50; inc = 5; t = 1500; break;
|
||||
case WP_RAILGUN: max = 10; inc = 1; t = 1750; break;
|
||||
case WP_PLASMAGUN: max = 50; inc = 5; t = 1500; break;
|
||||
case WP_BFG: max = 10; inc = 1; t = 4000; break;
|
||||
case WP_NAILGUN: max = 10; inc = 1; t = 1250; break;
|
||||
case WP_PROX_LAUNCHER: max = 5; inc = 1; t = 2000; break;
|
||||
case WP_CHAINGUN: max = 100; inc = 5; t = 1000; break;
|
||||
default: max = 0; inc = 0; t = 1000; break;
|
||||
}
|
||||
client->ammoTimes[w] += msec;
|
||||
if ( client->ps.ammo[w] >= max ) {
|
||||
client->ammoTimes[w] = 0;
|
||||
}
|
||||
if ( client->ammoTimes[w] >= t ) {
|
||||
while ( client->ammoTimes[w] >= t )
|
||||
client->ammoTimes[w] -= t;
|
||||
client->ps.ammo[w] += inc;
|
||||
if ( client->ps.ammo[w] > max ) {
|
||||
client->ps.ammo[w] = max;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -994,28 +921,6 @@ void ClientEvents( gentity_t *ent, int oldEventSequence ) {
|
|||
ent->client->ps.powerups[ j ] = 0;
|
||||
}
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
if ( g_gametype.integer == GT_HARVESTER ) {
|
||||
if ( ent->client->ps.generic1 > 0 ) {
|
||||
if ( ent->client->sess.sessionTeam == TEAM_RED ) {
|
||||
item = BG_FindItem( "Blue Cube" );
|
||||
} else {
|
||||
item = BG_FindItem( "Red Cube" );
|
||||
}
|
||||
if ( item ) {
|
||||
for ( j = 0; j < ent->client->ps.generic1; j++ ) {
|
||||
drop = Drop_Item( ent, item, 0 );
|
||||
if ( ent->client->sess.sessionTeam == TEAM_RED ) {
|
||||
drop->spawnflags = TEAM_BLUE;
|
||||
} else {
|
||||
drop->spawnflags = TEAM_RED;
|
||||
}
|
||||
}
|
||||
}
|
||||
ent->client->ps.generic1 = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
SelectSpawnPoint( ent->client->ps.origin, origin, angles );
|
||||
TeleportPlayer( ent, origin, angles );
|
||||
break;
|
||||
|
@ -1025,27 +930,6 @@ void ClientEvents( gentity_t *ent, int oldEventSequence ) {
|
|||
|
||||
break;
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
case EV_USE_ITEM3: // kamikaze
|
||||
// make sure the invulnerability is off
|
||||
ent->client->invulnerabilityTime = 0;
|
||||
// start the kamikze
|
||||
G_StartKamikaze( ent );
|
||||
break;
|
||||
|
||||
case EV_USE_ITEM4: // portal
|
||||
if( ent->client->portalID ) {
|
||||
DropPortalSource( ent );
|
||||
}
|
||||
else {
|
||||
DropPortalDestination( ent );
|
||||
}
|
||||
break;
|
||||
case EV_USE_ITEM5: // invulnerability
|
||||
ent->client->invulnerabilityTime = level.time + 10000;
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -1053,49 +937,6 @@ void ClientEvents( gentity_t *ent, int oldEventSequence ) {
|
|||
|
||||
}
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
/*
|
||||
==============
|
||||
StuckInOtherClient
|
||||
==============
|
||||
*/
|
||||
static int StuckInOtherClient(gentity_t *ent) {
|
||||
int i;
|
||||
gentity_t *ent2;
|
||||
|
||||
ent2 = &g_entities[0];
|
||||
for ( i = 0; i < MAX_CLIENTS; i++, ent2++ ) {
|
||||
if ( ent2 == ent ) {
|
||||
continue;
|
||||
}
|
||||
if ( !ent2->inuse ) {
|
||||
continue;
|
||||
}
|
||||
if ( !ent2->client ) {
|
||||
continue;
|
||||
}
|
||||
if ( ent2->health <= 0 ) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
if (ent2->r.absmin[0] > ent->r.absmax[0])
|
||||
continue;
|
||||
if (ent2->r.absmin[1] > ent->r.absmax[1])
|
||||
continue;
|
||||
if (ent2->r.absmin[2] > ent->r.absmax[2])
|
||||
continue;
|
||||
if (ent2->r.absmax[0] < ent->r.absmin[0])
|
||||
continue;
|
||||
if (ent2->r.absmax[1] < ent->r.absmin[1])
|
||||
continue;
|
||||
if (ent2->r.absmax[2] < ent->r.absmin[2])
|
||||
continue;
|
||||
return qtrue;
|
||||
}
|
||||
return qfalse;
|
||||
}
|
||||
#endif
|
||||
|
||||
void BotTestSolid(vec3_t origin);
|
||||
/*
|
||||
=============
|
||||
|
@ -1343,12 +1184,6 @@ void ClientThink_real( gentity_t *ent ) {
|
|||
// set speed
|
||||
client->ps.speed = g_speed.value;
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
if( bg_itemlist[client->ps.stats[STAT_PERSISTANT_POWERUP]].giTag == PW_SCOUT ) {
|
||||
client->ps.speed *= 1.5;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if ( client->ps.powerups[PW_HASTE] ) {
|
||||
client->ps.speed *= 1.3;
|
||||
}
|
||||
|
@ -1365,33 +1200,6 @@ void ClientThink_real( gentity_t *ent ) {
|
|||
|
||||
//Elder: 3rb Code moved to bg_pmove.c (resides in PM_Weapon)
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
// check for invulnerability expansion before doing the Pmove
|
||||
if (client->ps.powerups[PW_INVULNERABILITY] ) {
|
||||
if ( !(client->ps.pm_flags & PMF_INVULEXPAND) ) {
|
||||
vec3_t mins = { -42, -42, -42 };
|
||||
vec3_t maxs = { 42, 42, 42 };
|
||||
vec3_t oldmins, oldmaxs;
|
||||
|
||||
VectorCopy (ent->r.mins, oldmins);
|
||||
VectorCopy (ent->r.maxs, oldmaxs);
|
||||
// expand
|
||||
VectorCopy (mins, ent->r.mins);
|
||||
VectorCopy (maxs, ent->r.maxs);
|
||||
trap_LinkEntity(ent);
|
||||
// check if this would get anyone stuck in this player
|
||||
if ( !StuckInOtherClient(ent) ) {
|
||||
// set flag so the expanded size will be set in PM_CheckDuck
|
||||
client->ps.pm_flags |= PMF_INVULEXPAND;
|
||||
}
|
||||
// set back
|
||||
VectorCopy (oldmins, ent->r.mins);
|
||||
VectorCopy (oldmaxs, ent->r.maxs);
|
||||
trap_LinkEntity(ent);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
pm.ps = &client->ps;
|
||||
pm.cmd = *ucmd;
|
||||
|
||||
|
@ -1426,28 +1234,12 @@ void ClientThink_real( gentity_t *ent ) {
|
|||
|
||||
VectorCopy( client->ps.origin, client->oldOrigin );
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
if (level.intermissionQueued != 0 && g_singlePlayer.integer) {
|
||||
if ( level.time - level.intermissionQueued >= 1000 ) {
|
||||
pm.cmd.buttons = 0;
|
||||
pm.cmd.forwardmove = 0;
|
||||
pm.cmd.rightmove = 0;
|
||||
pm.cmd.upmove = 0;
|
||||
if ( level.time - level.intermissionQueued >= 2000 && level.time - level.intermissionQueued <= 2500 ) {
|
||||
trap_SendConsoleCommand( EXEC_APPEND, "centerview\n");
|
||||
}
|
||||
ent->client->ps.pm_type = PM_SPINTERMISSION;
|
||||
}
|
||||
}
|
||||
Pmove (&pm);
|
||||
#else
|
||||
// JBravo: setting lca in pm if appropriate
|
||||
if(g_RQ3_lca.integer == 1)
|
||||
pm.lca = qtrue;
|
||||
else
|
||||
pm.lca = qfalse;
|
||||
Pmove (&pm);
|
||||
#endif
|
||||
|
||||
if ( (pm.cmd.upmove > 10 ) &&
|
||||
(pm.waterlevel == 0) &&
|
||||
|
@ -1809,25 +1601,6 @@ void ClientEndFrame( gentity_t *ent ) {
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
// set powerup for player animation
|
||||
if( bg_itemlist[ent->client->ps.stats[STAT_PERSISTANT_POWERUP]].giTag == PW_GUARD ) {
|
||||
ent->client->ps.powerups[PW_GUARD] = level.time;
|
||||
}
|
||||
if( bg_itemlist[ent->client->ps.stats[STAT_PERSISTANT_POWERUP]].giTag == PW_SCOUT ) {
|
||||
ent->client->ps.powerups[PW_SCOUT] = level.time;
|
||||
}
|
||||
if( bg_itemlist[ent->client->ps.stats[STAT_PERSISTANT_POWERUP]].giTag == PW_DOUBLER ) {
|
||||
ent->client->ps.powerups[PW_DOUBLER] = level.time;
|
||||
}
|
||||
if( bg_itemlist[ent->client->ps.stats[STAT_PERSISTANT_POWERUP]].giTag == PW_AMMOREGEN ) {
|
||||
ent->client->ps.powerups[PW_AMMOREGEN] = level.time;
|
||||
}
|
||||
if ( ent->client->invulnerabilityTime > level.time ) {
|
||||
ent->client->ps.powerups[PW_INVULNERABILITY] = level.time;
|
||||
}
|
||||
#endif
|
||||
|
||||
// save network bandwidth
|
||||
#if 0
|
||||
if ( !g_synchronousClients->integer && ent->client->ps.pm_type == PM_NORMAL ) {
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.7 2002/06/16 17:38:00 jbravo
|
||||
// Removed the MISSIONPACK ifdefs and missionpack only code.
|
||||
//
|
||||
// Revision 1.6 2002/01/11 19:48:30 jbravo
|
||||
// Formatted the source in non DOS format.
|
||||
//
|
||||
|
@ -38,10 +41,6 @@ void UpdateTournamentInfo( void ) {
|
|||
int playerClientNum;
|
||||
int n, accuracy, perfect, msglen;
|
||||
int buflen;
|
||||
#ifdef MISSIONPACK // bk001205
|
||||
int score1, score2;
|
||||
qboolean won;
|
||||
#endif
|
||||
char buf[32];
|
||||
char msg[MAX_STRING_CHARS];
|
||||
|
||||
|
@ -65,11 +64,7 @@ void UpdateTournamentInfo( void ) {
|
|||
CalculateRanks();
|
||||
|
||||
if ( level.clients[playerClientNum].sess.sessionTeam == TEAM_SPECTATOR ) {
|
||||
#ifdef MISSIONPACK
|
||||
Com_sprintf( msg, sizeof(msg), "postgame %i %i 0 0 0 0 0 0 0 0 0 0 0", level.numNonSpectatorClients, playerClientNum );
|
||||
#else
|
||||
Com_sprintf( msg, sizeof(msg), "postgame %i %i 0 0 0 0 0 0", level.numNonSpectatorClients, playerClientNum );
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
if( player->client->accuracy_shots ) {
|
||||
|
@ -78,44 +73,12 @@ void UpdateTournamentInfo( void ) {
|
|||
else {
|
||||
accuracy = 0;
|
||||
}
|
||||
#ifdef MISSIONPACK
|
||||
won = qfalse;
|
||||
if (g_gametype.integer >= GT_CTF) {
|
||||
score1 = level.teamScores[TEAM_RED];
|
||||
score2 = level.teamScores[TEAM_BLUE];
|
||||
if (level.clients[playerClientNum].sess.sessionTeam == TEAM_RED) {
|
||||
won = (level.teamScores[TEAM_RED] > level.teamScores[TEAM_BLUE]);
|
||||
} else {
|
||||
won = (level.teamScores[TEAM_BLUE] > level.teamScores[TEAM_RED]);
|
||||
}
|
||||
} else {
|
||||
if (&level.clients[playerClientNum] == &level.clients[ level.sortedClients[0] ]) {
|
||||
won = qtrue;
|
||||
score1 = level.clients[ level.sortedClients[0] ].ps.persistant[PERS_SCORE];
|
||||
score2 = level.clients[ level.sortedClients[1] ].ps.persistant[PERS_SCORE];
|
||||
} else {
|
||||
score2 = level.clients[ level.sortedClients[0] ].ps.persistant[PERS_SCORE];
|
||||
score1 = level.clients[ level.sortedClients[1] ].ps.persistant[PERS_SCORE];
|
||||
}
|
||||
}
|
||||
if (won && player->client->ps.persistant[PERS_KILLED] == 0) {
|
||||
perfect = 1;
|
||||
} else {
|
||||
perfect = 0;
|
||||
}
|
||||
Com_sprintf( msg, sizeof(msg), "postgame %i %i %i %i %i %i %i %i %i %i %i %i %i %i", level.numNonSpectatorClients, playerClientNum, accuracy,
|
||||
player->client->ps.persistant[PERS_IMPRESSIVE_COUNT], player->client->ps.persistant[PERS_EXCELLENT_COUNT],player->client->ps.persistant[PERS_DEFEND_COUNT],
|
||||
player->client->ps.persistant[PERS_ASSIST_COUNT], player->client->ps.persistant[PERS_GAUNTLET_FRAG_COUNT], player->client->ps.persistant[PERS_SCORE],
|
||||
perfect, score1, score2, level.time, player->client->ps.persistant[PERS_CAPTURES] );
|
||||
|
||||
#else
|
||||
perfect = ( level.clients[playerClientNum].ps.persistant[PERS_RANK] == 0 && player->client->ps.persistant[PERS_KILLED] == 0 ) ? 1 : 0;
|
||||
//Blaze: Removed because it uses the persistant stats stuff
|
||||
/* Com_sprintf( msg, sizeof(msg), "postgame %i %i %i %i %i %i %i %i", level.numNonSpectatorClients, playerClientNum, accuracy,
|
||||
player->client->ps.persistant[PERS_IMPRESSIVE_COUNT], player->client->ps.persistant[PERS_EXCELLENT_COUNT],
|
||||
player->client->ps.persistant[PERS_GAUNTLET_FRAG_COUNT], player->client->ps.persistant[PERS_SCORE],
|
||||
perfect );*/
|
||||
#endif
|
||||
}
|
||||
|
||||
msglen = strlen( msg );
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.93 2002/06/16 17:38:00 jbravo
|
||||
// Removed the MISSIONPACK ifdefs and missionpack only code.
|
||||
//
|
||||
// Revision 1.92 2002/06/13 20:59:35 slicer
|
||||
// Setting ( for real ) gender on DM
|
||||
//
|
||||
|
@ -630,10 +633,6 @@ just like the existing corpse to leave behind.
|
|||
=============
|
||||
*/
|
||||
void CopyToBodyQue( gentity_t *ent ) {
|
||||
#ifdef MISSIONPACK
|
||||
gentity_t *e;
|
||||
int i;
|
||||
#endif
|
||||
gentity_t *body;
|
||||
int contents;
|
||||
|
||||
|
@ -1016,23 +1015,11 @@ void ClientUserinfoChanged( int clientNum ) {
|
|||
}
|
||||
|
||||
// set max health
|
||||
#ifdef MISSIONPACK
|
||||
if (client->ps.powerups[PW_GUARD]) {
|
||||
client->pers.maxHealth = 200;
|
||||
} else {
|
||||
health = atoi( Info_ValueForKey( userinfo, "handicap" ) );
|
||||
client->pers.maxHealth = health;
|
||||
if ( client->pers.maxHealth < 1 || client->pers.maxHealth > 100 ) {
|
||||
client->pers.maxHealth = 100;
|
||||
}
|
||||
}
|
||||
#else
|
||||
health = atoi( Info_ValueForKey( userinfo, "handicap" ) );
|
||||
client->pers.maxHealth = health;
|
||||
if ( client->pers.maxHealth < 1 || client->pers.maxHealth > 100 ) {
|
||||
client->pers.maxHealth = 100;
|
||||
}
|
||||
#endif
|
||||
//client->ps.stats[STAT_MAX_HEALTH] = client->pers.maxHealth;
|
||||
|
||||
// set model
|
||||
|
@ -1164,18 +1151,6 @@ void ClientUserinfoChanged( int clientNum ) {
|
|||
}
|
||||
*/
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
if (g_gametype.integer >= GT_TEAM) {
|
||||
client->pers.teamInfo = qtrue;
|
||||
} else {
|
||||
s = Info_ValueForKey( userinfo, "teamoverlay" );
|
||||
if ( ! *s || atoi( s ) != 0 ) {
|
||||
client->pers.teamInfo = qtrue;
|
||||
} else {
|
||||
client->pers.teamInfo = qfalse;
|
||||
}
|
||||
}
|
||||
#else
|
||||
// teamInfo
|
||||
s = Info_ValueForKey( userinfo, "teamoverlay" );
|
||||
if ( ! *s || atoi( s ) != 0 ) {
|
||||
|
@ -1183,7 +1158,6 @@ void ClientUserinfoChanged( int clientNum ) {
|
|||
} else {
|
||||
client->pers.teamInfo = qfalse;
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
s = Info_ValueForKey( userinfo, "cg_pmove_fixed" );
|
||||
if ( !*s || atoi( s ) == 0 ) {
|
||||
|
@ -1952,13 +1926,6 @@ void ClientDisconnect( int clientNum ) {
|
|||
// They don't get to take powerups with them!
|
||||
// Especially important for stuff like CTF flags
|
||||
TossClientItems ( ent );
|
||||
#ifdef MISSIONPACK
|
||||
TossClientPersistantPowerups( ent );
|
||||
if( g_gametype.integer == GT_HARVESTER ) {
|
||||
TossClientCubes( ent );
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
// JBravo: Make this more like AQ
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.96 2002/06/16 17:38:00 jbravo
|
||||
// Removed the MISSIONPACK ifdefs and missionpack only code.
|
||||
//
|
||||
// Revision 1.95 2002/06/13 21:03:31 jbravo
|
||||
// MOre gibfixes
|
||||
//
|
||||
|
@ -422,89 +425,6 @@ void TossClientItems( gentity_t *self ) {
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
|
||||
/*
|
||||
=================
|
||||
TossClientCubes
|
||||
=================
|
||||
*/
|
||||
extern gentity_t *neutralObelisk;
|
||||
|
||||
void TossClientCubes( gentity_t *self ) {
|
||||
gitem_t *item;
|
||||
gentity_t *drop;
|
||||
vec3_t velocity;
|
||||
vec3_t angles;
|
||||
vec3_t origin;
|
||||
|
||||
self->client->ps.generic1 = 0;
|
||||
|
||||
// this should never happen but we should never
|
||||
// get the server to crash due to skull being spawned in
|
||||
if (!G_EntitiesFree()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if( self->client->sess.sessionTeam == TEAM_RED ) {
|
||||
item = BG_FindItem( "Red Cube" );
|
||||
}
|
||||
else {
|
||||
item = BG_FindItem( "Blue Cube" );
|
||||
}
|
||||
|
||||
angles[YAW] = (float)(level.time % 360);
|
||||
angles[PITCH] = 0; // always forward
|
||||
angles[ROLL] = 0;
|
||||
|
||||
AngleVectors( angles, velocity, NULL, NULL );
|
||||
VectorScale( velocity, 150, velocity );
|
||||
velocity[2] += 200 + crandom() * 50;
|
||||
|
||||
if( neutralObelisk ) {
|
||||
VectorCopy( neutralObelisk->s.pos.trBase, origin );
|
||||
origin[2] += 44;
|
||||
} else {
|
||||
VectorClear( origin ) ;
|
||||
}
|
||||
|
||||
drop = LaunchItem( item, origin, velocity );
|
||||
|
||||
drop->nextthink = level.time + g_cubeTimeout.integer * 1000;
|
||||
drop->think = G_FreeEntity;
|
||||
drop->spawnflags = self->client->sess.sessionTeam;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
TossClientPersistantPowerups
|
||||
=================
|
||||
*/
|
||||
void TossClientPersistantPowerups( gentity_t *ent ) {
|
||||
gentity_t *powerup;
|
||||
|
||||
if( !ent->client ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if( !ent->client->persistantPowerup ) {
|
||||
return;
|
||||
}
|
||||
|
||||
powerup = ent->client->persistantPowerup;
|
||||
|
||||
powerup->r.svFlags &= ~SVF_NOCLIENT;
|
||||
powerup->s.eFlags &= ~EF_NODRAW;
|
||||
powerup->r.contents = CONTENTS_TRIGGER;
|
||||
trap_LinkEntity( powerup );
|
||||
|
||||
ent->client->ps.stats[STAT_PERSISTANT_POWERUP] = 0;
|
||||
ent->client->persistantPowerup = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
==================
|
||||
LookAtKiller
|
||||
|
@ -604,11 +524,6 @@ char *modNames[] = {
|
|||
"MOD_SUICIDE",
|
||||
"MOD_TARGET_LASER",
|
||||
"MOD_TRIGGER_HURT",
|
||||
#ifdef MISSIONPACK
|
||||
"MOD_NAIL",
|
||||
"MOD_CHAINGUN",
|
||||
"MOD_PROXIMITY_MINE",
|
||||
#endif
|
||||
"MOD_GRAPPLE",
|
||||
//Blaze: Reaction MOD's
|
||||
"MOD_KNIFE",
|
||||
|
@ -625,37 +540,6 @@ char *modNames[] = {
|
|||
|
||||
};
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
/*
|
||||
==================
|
||||
Kamikaze_DeathActivate
|
||||
==================
|
||||
*/
|
||||
void Kamikaze_DeathActivate( gentity_t *ent ) {
|
||||
G_StartKamikaze(ent);
|
||||
G_FreeEntity(ent);
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
Kamikaze_DeathTimer
|
||||
==================
|
||||
*/
|
||||
void Kamikaze_DeathTimer( gentity_t *self ) {
|
||||
gentity_t *ent;
|
||||
|
||||
ent = G_Spawn();
|
||||
ent->classname = "kamikaze timer";
|
||||
VectorCopy(self->s.pos.trBase, ent->s.pos.trBase);
|
||||
ent->r.svFlags |= SVF_NOCLIENT;
|
||||
ent->think = Kamikaze_DeathActivate;
|
||||
ent->nextthink = level.time + 5 * 1000;
|
||||
|
||||
ent->activator = self;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
==================
|
||||
CheckAlmostCapture
|
||||
|
@ -1199,13 +1083,6 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
|||
CheckAlmostScored( self, attacker );
|
||||
}
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
if ((self->client->ps.eFlags & EF_TICKING) && self->activator) {
|
||||
self->client->ps.eFlags &= ~EF_TICKING;
|
||||
self->activator->think = G_FreeEntity;
|
||||
self->activator->nextthink = level.time;
|
||||
}
|
||||
#endif
|
||||
self->client->ps.pm_type = PM_DEAD;
|
||||
|
||||
if (attacker) {
|
||||
|
@ -1479,12 +1356,6 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
|||
}
|
||||
}
|
||||
}
|
||||
#ifdef MISSIONPACK
|
||||
TossClientPersistantPowerups( self );
|
||||
if( g_gametype.integer == GT_HARVESTER ) {
|
||||
TossClientCubes( self );
|
||||
}
|
||||
#endif
|
||||
|
||||
// JBravo: no need for automatic scoreboard on deaths.
|
||||
if (g_gametype.integer != GT_TEAMPLAY) {
|
||||
|
@ -1843,45 +1714,6 @@ int RaySphereIntersections( vec3_t origin, float radius, vec3_t point, vec3_t di
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
/*
|
||||
================
|
||||
G_InvulnerabilityEffect
|
||||
================
|
||||
*/
|
||||
int G_InvulnerabilityEffect( gentity_t *targ, vec3_t dir, vec3_t point, vec3_t impactpoint, vec3_t bouncedir ) {
|
||||
gentity_t *impact;
|
||||
vec3_t intersections[2], vec;
|
||||
int n;
|
||||
|
||||
if ( !targ->client ) {
|
||||
return qfalse;
|
||||
}
|
||||
VectorCopy(dir, vec);
|
||||
VectorInverse(vec);
|
||||
// sphere model radius = 42 units
|
||||
n = RaySphereIntersections( targ->client->ps.origin, 42, point, vec, intersections);
|
||||
if (n > 0) {
|
||||
impact = G_TempEntity( targ->client->ps.origin, EV_INVUL_IMPACT );
|
||||
VectorSubtract(intersections[0], targ->client->ps.origin, vec);
|
||||
vectoangles(vec, impact->s.angles);
|
||||
impact->s.angles[0] += 90;
|
||||
if (impact->s.angles[0] > 360)
|
||||
impact->s.angles[0] -= 360;
|
||||
if ( impactpoint ) {
|
||||
VectorCopy( intersections[0], impactpoint );
|
||||
}
|
||||
if ( bouncedir ) {
|
||||
VectorCopy( vec, bouncedir );
|
||||
VectorNormalize( bouncedir );
|
||||
}
|
||||
return qtrue;
|
||||
}
|
||||
else {
|
||||
return qfalse;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
============
|
||||
G_Damage
|
||||
|
@ -1917,11 +1749,6 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
|
|||
int bulletRotation, impactRotation;
|
||||
gentity_t *tent;
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
vec3_t bouncedir, impactpoint;
|
||||
#endif
|
||||
|
||||
|
||||
if (!targ->takedamage) {
|
||||
return;
|
||||
}
|
||||
|
@ -1943,16 +1770,6 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
|
|||
return;
|
||||
}
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
if ( targ->client && mod != MOD_JUICED) {
|
||||
if ( targ->client->invulnerabilityTime > level.time) {
|
||||
if ( dir && point ) {
|
||||
G_InvulnerabilityEffect( targ, dir, point, impactpoint, bouncedir );
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// Elder: respawn protection -- only for gunfire though!
|
||||
// No safety from falling!
|
||||
// NiceAss: Or TELEFAGS!
|
||||
|
@ -2028,12 +1845,6 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
|
|||
return;
|
||||
}
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
if( g_gametype.integer == GT_OBELISK && CheckObeliskAttack( targ, attacker ) ) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
client = targ->client;
|
||||
|
||||
if (client) {
|
||||
|
@ -2167,11 +1978,7 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
|
|||
|
||||
// if TF_NO_FRIENDLY_FIRE is set, don't do damage to the target
|
||||
// if the attacker was on the same team
|
||||
#ifdef MISSIONPACK
|
||||
if ( mod != MOD_JUICED && targ != attacker && !(dflags & DAMAGE_NO_TEAM_PROTECTION) && OnSameTeam (targ, attacker) ) {
|
||||
#else
|
||||
if (targ != attacker && OnSameTeam(targ, attacker)) {
|
||||
#endif
|
||||
// JBravo: more FF tweaks
|
||||
if (g_friendlyFire.integer == 2 && level.team_round_going) {
|
||||
return;
|
||||
|
@ -2179,17 +1986,6 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
|
|||
if (level.team_round_going)
|
||||
Add_TeamWound(attacker, targ, mod);
|
||||
}
|
||||
#ifdef MISSIONPACK
|
||||
if (mod == MOD_PROXIMITY_MINE) {
|
||||
if (inflictor && inflictor->parent && OnSameTeam(targ, inflictor->parent)) {
|
||||
return;
|
||||
}
|
||||
if (targ == attacker) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// check for godmode
|
||||
if (targ->flags & FL_GODMODE) {
|
||||
return;
|
||||
|
@ -2215,11 +2011,7 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
|
|||
}
|
||||
|
||||
// See if it's the player hurting the emeny flag carrier
|
||||
#ifdef MISSIONPACK
|
||||
if( g_gametype.integer == GT_CTF || g_gametype.integer == GT_1FCTF ) {
|
||||
#else
|
||||
if (g_gametype.integer == GT_CTF) {
|
||||
#endif
|
||||
Team_CheckHurtCarrier(targ, attacker);
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.39 2002/06/16 17:38:00 jbravo
|
||||
// Removed the MISSIONPACK ifdefs and missionpack only code.
|
||||
//
|
||||
// Revision 1.38 2002/05/27 06:50:58 niceass
|
||||
// removed kamakazi code
|
||||
//
|
||||
|
@ -146,81 +149,6 @@ int Pickup_Powerup( gentity_t *ent, gentity_t *other ) {
|
|||
|
||||
//======================================================================
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
int Pickup_PersistantPowerup( gentity_t *ent, gentity_t *other ) {
|
||||
int clientNum;
|
||||
char userinfo[MAX_INFO_STRING];
|
||||
float handicap;
|
||||
int max;
|
||||
|
||||
other->client->ps.stats[STAT_PERSISTANT_POWERUP] = ent->item - bg_itemlist;
|
||||
other->client->persistantPowerup = ent;
|
||||
|
||||
switch( ent->item->giTag ) {
|
||||
case PW_GUARD:
|
||||
clientNum = other->client->ps.clientNum;
|
||||
trap_GetUserinfo( clientNum, userinfo, sizeof(userinfo) );
|
||||
handicap = atof( Info_ValueForKey( userinfo, "handicap" ) );
|
||||
if( handicap<=0.0f || handicap>100.0f) {
|
||||
handicap = 100.0f;
|
||||
}
|
||||
max = (int)(2 * handicap);
|
||||
|
||||
other->health = max;
|
||||
other->client->ps.stats[STAT_HEALTH] = max;
|
||||
other->client->ps.stats[STAT_MAX_HEALTH] = max;
|
||||
other->client->ps.stats[STAT_ARMOR] = max;
|
||||
other->client->pers.maxHealth = max;
|
||||
|
||||
break;
|
||||
|
||||
case PW_SCOUT:
|
||||
clientNum = other->client->ps.clientNum;
|
||||
trap_GetUserinfo( clientNum, userinfo, sizeof(userinfo) );
|
||||
handicap = atof( Info_ValueForKey( userinfo, "handicap" ) );
|
||||
if( handicap<=0.0f || handicap>100.0f) {
|
||||
handicap = 100.0f;
|
||||
}
|
||||
other->client->pers.maxHealth = handicap;
|
||||
other->client->ps.stats[STAT_ARMOR] = 0;
|
||||
break;
|
||||
|
||||
case PW_DOUBLER:
|
||||
clientNum = other->client->ps.clientNum;
|
||||
trap_GetUserinfo( clientNum, userinfo, sizeof(userinfo) );
|
||||
handicap = atof( Info_ValueForKey( userinfo, "handicap" ) );
|
||||
if( handicap<=0.0f || handicap>100.0f) {
|
||||
handicap = 100.0f;
|
||||
}
|
||||
other->client->pers.maxHealth = handicap;
|
||||
break;
|
||||
case PW_AMMOREGEN:
|
||||
clientNum = other->client->ps.clientNum;
|
||||
trap_GetUserinfo( clientNum, userinfo, sizeof(userinfo) );
|
||||
handicap = atof( Info_ValueForKey( userinfo, "handicap" ) );
|
||||
if( handicap<=0.0f || handicap>100.0f) {
|
||||
handicap = 100.0f;
|
||||
}
|
||||
other->client->pers.maxHealth = handicap;
|
||||
memset(other->client->ammoTimes, 0, sizeof(other->client->ammoTimes));
|
||||
break;
|
||||
default:
|
||||
clientNum = other->client->ps.clientNum;
|
||||
trap_GetUserinfo( clientNum, userinfo, sizeof(userinfo) );
|
||||
handicap = atof( Info_ValueForKey( userinfo, "handicap" ) );
|
||||
if( handicap<=0.0f || handicap>100.0f) {
|
||||
handicap = 100.0f;
|
||||
}
|
||||
other->client->pers.maxHealth = handicap;
|
||||
break;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
#endif
|
||||
|
||||
int Pickup_Holdable( gentity_t *ent, gentity_t *other ) {
|
||||
|
||||
//Elder: why it's implemented like this I have no idea
|
||||
|
@ -469,12 +397,6 @@ int Pickup_Health (gentity_t *ent, gentity_t *other) {
|
|||
int quantity;
|
||||
|
||||
// small and mega healths will go over the max
|
||||
#ifdef MISSIONPACK
|
||||
if( other->client && bg_itemlist[other->client->ps.stats[STAT_PERSISTANT_POWERUP]].giTag == PW_GUARD ) {
|
||||
max = other->client->ps.stats[STAT_MAX_HEALTH];
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if ( ent->item->quantity != 5 && ent->item->quantity != 100 ) {
|
||||
max = 100;// max health is 100 other->client->ps.stats[STAT_MAX_HEALTH];
|
||||
} else {
|
||||
|
@ -504,28 +426,10 @@ int Pickup_Health (gentity_t *ent, gentity_t *other) {
|
|||
//======================================================================
|
||||
|
||||
int Pickup_Armor( gentity_t *ent, gentity_t *other ) {
|
||||
#ifdef MISSIONPACK
|
||||
int upperBound;
|
||||
|
||||
other->client->ps.stats[STAT_ARMOR] += ent->item->quantity;
|
||||
|
||||
if( other->client && bg_itemlist[other->client->ps.stats[STAT_PERSISTANT_POWERUP]].giTag == PW_GUARD ) {
|
||||
upperBound = other->client->ps.stats[STAT_MAX_HEALTH];
|
||||
}
|
||||
else {
|
||||
upperBound = other->client->ps.stats[STAT_MAX_HEALTH] * 2;
|
||||
}
|
||||
|
||||
if ( other->client->ps.stats[STAT_ARMOR] > upperBound ) {
|
||||
other->client->ps.stats[STAT_ARMOR] = upperBound;
|
||||
}
|
||||
#else
|
||||
other->client->ps.stats[STAT_ARMOR] += ent->item->quantity;
|
||||
if ( other->client->ps.stats[STAT_ARMOR] > 200) {//max health in this case is 200 other->client->ps.stats[STAT_MAX_HEALTH] * 2 ) {
|
||||
other->client->ps.stats[STAT_ARMOR] = 200; //max health is 200 in this case other->client->ps.stats[STAT_MAX_HEALTH] * 2;
|
||||
}
|
||||
#endif
|
||||
|
||||
return RESPAWN_ARMOR;
|
||||
}
|
||||
|
||||
|
@ -816,11 +720,6 @@ void Touch_Item (gentity_t *ent, gentity_t *other, trace_t *trace) {
|
|||
respawn = Pickup_Powerup(ent, other);
|
||||
predict = qfalse;
|
||||
break;
|
||||
#ifdef MISSIONPACK
|
||||
case IT_PERSISTANT_POWERUP:
|
||||
respawn = Pickup_PersistantPowerup(ent, other);
|
||||
break;
|
||||
#endif
|
||||
case IT_TEAM:
|
||||
respawn = Pickup_Team(ent, other);
|
||||
break;
|
||||
|
@ -967,12 +866,7 @@ gentity_t *LaunchItem( gitem_t *item, vec3_t origin, vec3_t velocity, int xr_fla
|
|||
dropped->s.eFlags |= EF_BOUNCE_HALF;
|
||||
}
|
||||
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
if ((g_gametype.integer == GT_CTF || g_gametype.integer == GT_1FCTF) && item->giType == IT_TEAM) { // Special case for CTF flags
|
||||
#else
|
||||
if (g_gametype.integer == GT_CTF && item->giType == IT_TEAM) { // Special case for CTF flags
|
||||
#endif
|
||||
dropped->think = Team_DroppedFlagThink;
|
||||
dropped->nextthink = level.time + 30000;
|
||||
Team_CheckDroppedItem( dropped );
|
||||
|
@ -1205,65 +1099,6 @@ void G_CheckTeamItems( void ) {
|
|||
G_Printf( S_COLOR_YELLOW "WARNING: No team_CTF_blueflag in map" );
|
||||
}
|
||||
}
|
||||
#ifdef MISSIONPACK
|
||||
if( g_gametype.integer == GT_1FCTF ) {
|
||||
gitem_t *item;
|
||||
|
||||
// check for all three flags
|
||||
item = BG_FindItem( "Red Flag" );
|
||||
if ( !item || !itemRegistered[ item - bg_itemlist ] ) {
|
||||
G_Printf( S_COLOR_YELLOW "WARNING: No team_CTF_redflag in map" );
|
||||
}
|
||||
item = BG_FindItem( "Blue Flag" );
|
||||
if ( !item || !itemRegistered[ item - bg_itemlist ] ) {
|
||||
G_Printf( S_COLOR_YELLOW "WARNING: No team_CTF_blueflag in map" );
|
||||
}
|
||||
item = BG_FindItem( "Neutral Flag" );
|
||||
if ( !item || !itemRegistered[ item - bg_itemlist ] ) {
|
||||
G_Printf( S_COLOR_YELLOW "WARNING: No team_CTF_neutralflag in map" );
|
||||
}
|
||||
}
|
||||
|
||||
if( g_gametype.integer == GT_OBELISK ) {
|
||||
gentity_t *ent;
|
||||
|
||||
// check for the two obelisks
|
||||
ent = NULL;
|
||||
ent = G_Find( ent, FOFS(classname), "team_redobelisk" );
|
||||
if( !ent ) {
|
||||
G_Printf( S_COLOR_YELLOW "WARNING: No team_redobelisk in map" );
|
||||
}
|
||||
|
||||
ent = NULL;
|
||||
ent = G_Find( ent, FOFS(classname), "team_blueobelisk" );
|
||||
if( !ent ) {
|
||||
G_Printf( S_COLOR_YELLOW "WARNING: No team_blueobelisk in map" );
|
||||
}
|
||||
}
|
||||
|
||||
if( g_gametype.integer == GT_HARVESTER ) {
|
||||
gentity_t *ent;
|
||||
|
||||
// check for all three obelisks
|
||||
ent = NULL;
|
||||
ent = G_Find( ent, FOFS(classname), "team_redobelisk" );
|
||||
if( !ent ) {
|
||||
G_Printf( S_COLOR_YELLOW "WARNING: No team_redobelisk in map" );
|
||||
}
|
||||
|
||||
ent = NULL;
|
||||
ent = G_Find( ent, FOFS(classname), "team_blueobelisk" );
|
||||
if( !ent ) {
|
||||
G_Printf( S_COLOR_YELLOW "WARNING: No team_blueobelisk in map" );
|
||||
}
|
||||
|
||||
ent = NULL;
|
||||
ent = G_Find( ent, FOFS(classname), "team_neutralobelisk" );
|
||||
if( !ent ) {
|
||||
G_Printf( S_COLOR_YELLOW "WARNING: No team_neutralobelisk in map" );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1294,13 +1129,6 @@ void ClearRegisteredItems( void ) {
|
|||
RegisterItem( BG_FindItemForWeapon( WP_AKIMBO ) );
|
||||
RegisterItem( BG_FindItemForWeapon( WP_GRENADE ) );
|
||||
}
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
if( g_gametype.integer == GT_HARVESTER ) {
|
||||
RegisterItem( BG_FindItem( "Red Cube" ) );
|
||||
RegisterItem( BG_FindItem( "Blue Cube" ) );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1392,12 +1220,6 @@ void G_SpawnItem (gentity_t *ent, gitem_t *item) {
|
|||
G_SoundIndex( "sound/items/poweruprespawn.wav" );
|
||||
G_SpawnFloat( "noglobalsound", "0", &ent->speed);
|
||||
}
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
if ( item->giType == IT_PERSISTANT_POWERUP ) {
|
||||
ent->s.generic1 = ent->spawnflags;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.93 2002/06/16 17:38:00 jbravo
|
||||
// Removed the MISSIONPACK ifdefs and missionpack only code.
|
||||
//
|
||||
// Revision 1.92 2002/06/13 17:01:30 slicer
|
||||
// Radio Gender changes according to model gender
|
||||
//
|
||||
|
@ -368,11 +371,6 @@ struct gentity_s {
|
|||
gentity_t *teamchain; // next entity in team
|
||||
gentity_t *teammaster; // master of the team
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
int kamikazeTime;
|
||||
int kamikazeShockTime;
|
||||
#endif
|
||||
|
||||
int watertype;
|
||||
int waterlevel;
|
||||
int noise_index;
|
||||
|
@ -605,13 +603,6 @@ struct gclient_s {
|
|||
qboolean kevlarHit; // Elder: kevlar hit -- FIXME: poor implementation
|
||||
int knife_sound; // NiceAss: What did the player hit while slashing?
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
gentity_t *persistantPowerup;
|
||||
int portalID;
|
||||
int ammoTimes[WP_NUM_WEAPONS];
|
||||
int invulnerabilityTime;
|
||||
#endif
|
||||
|
||||
char *areabits;
|
||||
struct camera_s *camera;
|
||||
// JBravo adding TP stuff
|
||||
|
@ -727,9 +718,6 @@ typedef struct {
|
|||
gentity_t *locationHead; // head of the location list
|
||||
int bodyQueIndex; // dead bodies
|
||||
gentity_t *bodyQue[BODY_QUEUE_SIZE];
|
||||
#ifdef MISSIONPACK
|
||||
int portalSequence;
|
||||
#endif
|
||||
// Slicer: Matchmode
|
||||
float matchTime;
|
||||
qboolean team1ready;
|
||||
|
@ -884,9 +872,6 @@ qboolean G_RadiusDamage (vec3_t origin, gentity_t *attacker, float damage, float
|
|||
int G_InvulnerabilityEffect( gentity_t *targ, vec3_t dir, vec3_t point, vec3_t impactpoint, vec3_t bouncedir );
|
||||
void body_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int meansOfDeath );
|
||||
void TossClientItems( gentity_t *self );
|
||||
#ifdef MISSIONPACK
|
||||
void TossClientPersistantPowerups( gentity_t *self );
|
||||
#endif
|
||||
void TossClientCubes( gentity_t *self );
|
||||
|
||||
// damage flags
|
||||
|
@ -894,9 +879,6 @@ void TossClientCubes( gentity_t *self );
|
|||
#define DAMAGE_NO_ARMOR 0x00000002 // armour does not protect from this damage
|
||||
#define DAMAGE_NO_KNOCKBACK 0x00000004 // do not affect velocity, just view angles
|
||||
#define DAMAGE_NO_PROTECTION 0x00000008 // armor, shields, invulnerability, and godmode have no effect
|
||||
#ifdef MISSIONPACK
|
||||
#define DAMAGE_NO_TEAM_PROTECTION 0x00000010 // armor, shields, invulnerability, and godmode have no effect
|
||||
#endif
|
||||
//Elder: Changed from 0x00000016 to 0x00000020
|
||||
#define DAMAGE_NO_LOCATIONAL 0x00000020 // Generic damage (shotguns, grenades, kicks)
|
||||
|
||||
|
@ -913,11 +895,6 @@ gentity_t *fire_grenade (gentity_t *self, vec3_t start, vec3_t aimdir);
|
|||
//gentity_t *fire_rocket (gentity_t *self, vec3_t start, vec3_t dir);
|
||||
//gentity_t *fire_bfg (gentity_t *self, vec3_t start, vec3_t dir);
|
||||
//gentity_t *fire_grapple (gentity_t *self, vec3_t start, vec3_t dir);
|
||||
#ifdef MISSIONPACK
|
||||
gentity_t *fire_nail( gentity_t *self, vec3_t start, vec3_t forward, vec3_t right, vec3_t up );
|
||||
gentity_t *fire_prox( gentity_t *self, vec3_t start, vec3_t aimdir );
|
||||
#endif
|
||||
|
||||
|
||||
//
|
||||
// g_mover.c
|
||||
|
@ -936,11 +913,6 @@ void trigger_teleporter_touch (gentity_t *self, gentity_t *other, trace_t *trace
|
|||
// g_misc.c
|
||||
//
|
||||
void TeleportPlayer( gentity_t *player, vec3_t origin, vec3_t angles );
|
||||
#ifdef MISSIONPACK
|
||||
void DropPortalSource( gentity_t *ent );
|
||||
void DropPortalDestination( gentity_t *ent );
|
||||
#endif
|
||||
|
||||
void G_BreakGlass( gentity_t *ent, gentity_t *inflictor, gentity_t *attacker, vec3_t point, int mod, int damage );//Blaze: Breakable glass
|
||||
void G_RunDlight ( gentity_t *ent ); // Elder: dlight running
|
||||
void G_EvaluateTrajectory( const trajectory_t *tr, int atTime, vec3_t result );
|
||||
|
@ -1008,9 +980,6 @@ qboolean G_FilterPacket (char *from);
|
|||
//
|
||||
void FireWeapon( gentity_t *ent );
|
||||
void ReloadWeapon ( gentity_t *ent, int stage ); // Elder: added
|
||||
#ifdef MISSIONPACK
|
||||
void G_StartKamikaze( gentity_t *ent );
|
||||
#endif
|
||||
|
||||
//
|
||||
// p_hud.c
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.82 2002/06/16 17:38:00 jbravo
|
||||
// Removed the MISSIONPACK ifdefs and missionpack only code.
|
||||
//
|
||||
// Revision 1.81 2002/06/13 23:54:40 assimon
|
||||
// Dont ask what i changed...better for your health. Now comments work properly.
|
||||
//
|
||||
|
@ -327,19 +330,6 @@ vmCvar_t g_RQ3_radioRepeatTime;
|
|||
vmCvar_t g_RQ3_radioBan;
|
||||
vmCvar_t g_RQ3_radioFlood;
|
||||
vmCvar_t g_RQ3_radioFloodTime;
|
||||
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
vmCvar_t g_obeliskHealth;
|
||||
vmCvar_t g_obeliskRegenPeriod;
|
||||
vmCvar_t g_obeliskRegenAmount;
|
||||
vmCvar_t g_obeliskRespawnDelay;
|
||||
vmCvar_t g_cubeTimeout;
|
||||
vmCvar_t g_redteam;
|
||||
vmCvar_t g_blueteam;
|
||||
vmCvar_t g_singlePlayer;
|
||||
vmCvar_t g_proxMineTimeout;
|
||||
#endif
|
||||
// NiceAss: Taken out of the missionpack
|
||||
vmCvar_t g_enableBreath;
|
||||
// JBravo: ditto
|
||||
|
@ -413,19 +403,6 @@ static cvarTable_t gameCvarTable[] = {
|
|||
{ &g_allowVote, "g_allowVote", "0", CVAR_ARCHIVE, 0, qfalse },
|
||||
{ &g_listEntity, "g_listEntity", "0", 0, 0, qfalse },
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
{ &g_obeliskHealth, "g_obeliskHealth", "2500", 0, 0, qfalse },
|
||||
{ &g_obeliskRegenPeriod, "g_obeliskRegenPeriod", "1", 0, 0, qfalse },
|
||||
{ &g_obeliskRegenAmount, "g_obeliskRegenAmount", "15", 0, 0, qfalse },
|
||||
{ &g_obeliskRespawnDelay, "g_obeliskRespawnDelay", "10", CVAR_SERVERINFO, 0, qfalse },
|
||||
|
||||
{ &g_cubeTimeout, "g_cubeTimeout", "30", 0, 0, qfalse },
|
||||
{ &g_redteam, "g_redteam", "Stroggs", CVAR_ARCHIVE | CVAR_SERVERINFO | CVAR_USERINFO , 0, qtrue, qtrue },
|
||||
{ &g_blueteam, "g_blueteam", "Pagans", CVAR_ARCHIVE | CVAR_SERVERINFO | CVAR_USERINFO , 0, qtrue, qtrue },
|
||||
{ &g_singlePlayer, "ui_singlePlayerActive", "", 0, 0, qfalse, qfalse },
|
||||
|
||||
{ &g_proxMineTimeout, "g_proxMineTimeout", "20000", 0, 0, qfalse },
|
||||
#endif
|
||||
// NiceAss: Taken out of the missionpack
|
||||
{ &g_enableBreath, "g_enableBreath", "0", CVAR_SERVERINFO, 0, qfalse },
|
||||
// JBravo: ditto
|
||||
|
@ -624,17 +601,6 @@ void G_FindTeams( void ) {
|
|||
}
|
||||
|
||||
void G_RemapTeamShaders() {
|
||||
#ifdef MISSIONPACK
|
||||
char string[1024];
|
||||
float f = level.time * 0.001;
|
||||
Com_sprintf( string, sizeof(string), "team_icon/%s_red", g_redteam.string );
|
||||
AddRemap("textures/ctf2/redteam01", string, f);
|
||||
AddRemap("textures/ctf2/redteam02", string, f);
|
||||
Com_sprintf( string, sizeof(string), "team_icon/%s_blue", g_blueteam.string );
|
||||
AddRemap("textures/ctf2/blueteam01", string, f);
|
||||
AddRemap("textures/ctf2/blueteam02", string, f);
|
||||
trap_SetConfigstring(CS_SHADERSTATE, BuildShaderStateConfig());
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -1499,18 +1465,11 @@ void BeginIntermission( void ) {
|
|||
level.intermissiontime = level.time;
|
||||
FindIntermissionPoint();
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
if (g_singlePlayer.integer) {
|
||||
trap_Cvar_Set("ui_singlePlayerActive", "0");
|
||||
UpdateTournamentInfo();
|
||||
}
|
||||
#else
|
||||
// if single player game
|
||||
if ( g_gametype.integer == GT_SINGLE_PLAYER ) {
|
||||
UpdateTournamentInfo();
|
||||
SpawnModelsOnVictoryPads();
|
||||
}
|
||||
#endif
|
||||
|
||||
// move all clients to the intermission point
|
||||
for (i=0 ; i< level.maxclients ; i++) {
|
||||
|
@ -1663,9 +1622,7 @@ Append information about this game to the log file
|
|||
void LogExit( const char *string ) {
|
||||
int i, numSorted;
|
||||
gclient_t *cl;
|
||||
#ifdef MISSIONPACK // bk001205
|
||||
qboolean won = qtrue;
|
||||
#endif
|
||||
|
||||
G_LogPrintf( "Exit: %s\n", string );
|
||||
|
||||
level.intermissionQueued = level.time;
|
||||
|
@ -1700,13 +1657,6 @@ void LogExit( const char *string ) {
|
|||
ping = cl->ps.ping < 999 ? cl->ps.ping : 999;
|
||||
|
||||
G_LogPrintf( "score: %i ping: %i client: %i %s\n", cl->ps.persistant[PERS_SCORE], ping, level.sortedClients[i], cl->pers.netname );
|
||||
#ifdef MISSIONPACK
|
||||
if (g_singlePlayer.integer && g_gametype.integer == GT_TOURNAMENT) {
|
||||
if (g_entities[cl - level.clients].r.svFlags & SVF_BOT && cl->ps.persistant[PERS_RANK] == 0) {
|
||||
won = qfalse;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Don't print bot statistics
|
||||
if ( g_RQ3_statLog.integer && !(g_entities[cl - level.clients].r.svFlags & SVF_BOT) )
|
||||
|
@ -1763,17 +1713,6 @@ void LogExit( const char *string ) {
|
|||
G_LogPrintf( "-----------------------------------\n");
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
if (g_singlePlayer.integer) {
|
||||
if (g_gametype.integer >= GT_CTF) {
|
||||
won = level.teamScores[TEAM_RED] > level.teamScores[TEAM_BLUE];
|
||||
}
|
||||
trap_SendConsoleCommand( EXEC_APPEND, (won) ? "spWin\n" : "spLose\n" );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -1946,18 +1885,10 @@ void CheckExitRules( void ) {
|
|||
}
|
||||
|
||||
if ( level.intermissionQueued ) {
|
||||
#ifdef MISSIONPACK
|
||||
int time = (g_singlePlayer.integer) ? SP_INTERMISSION_DELAY_TIME : INTERMISSION_DELAY_TIME;
|
||||
if ( level.time - level.intermissionQueued >= time ) {
|
||||
level.intermissionQueued = 0;
|
||||
BeginIntermission();
|
||||
}
|
||||
#else
|
||||
if ( level.time - level.intermissionQueued >= INTERMISSION_DELAY_TIME ) {
|
||||
level.intermissionQueued = 0;
|
||||
BeginIntermission();
|
||||
}
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.56 2002/06/16 17:38:00 jbravo
|
||||
// Removed the MISSIONPACK ifdefs and missionpack only code.
|
||||
//
|
||||
// Revision 1.55 2002/06/09 05:16:58 niceass
|
||||
// pressure change
|
||||
//
|
||||
|
@ -971,151 +974,6 @@ void G_CreatePressure(vec3_t origin, vec3_t normal, gentity_t *ent) {
|
|||
tent->s.powerups = ent->mass; // speed of pressure
|
||||
}
|
||||
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
static void PortalDie (gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int mod) {
|
||||
G_FreeEntity( self );
|
||||
//FIXME do something more interesting
|
||||
}
|
||||
|
||||
|
||||
void DropPortalDestination( gentity_t *player ) {
|
||||
gentity_t *ent;
|
||||
vec3_t snapped;
|
||||
|
||||
// create the portal destination
|
||||
ent = G_Spawn();
|
||||
ent->s.modelindex = G_ModelIndex( "models/powerups/teleporter/tele_exit.md3" );
|
||||
|
||||
VectorCopy( player->s.pos.trBase, snapped );
|
||||
SnapVector( snapped );
|
||||
G_SetOrigin( ent, snapped );
|
||||
VectorCopy( player->r.mins, ent->r.mins );
|
||||
VectorCopy( player->r.maxs, ent->r.maxs );
|
||||
|
||||
ent->classname = "hi_portal destination";
|
||||
ent->s.pos.trType = TR_STATIONARY;
|
||||
|
||||
ent->r.contents = CONTENTS_CORPSE;
|
||||
ent->takedamage = qtrue;
|
||||
ent->health = 200;
|
||||
ent->die = PortalDie;
|
||||
|
||||
VectorCopy( player->s.apos.trBase, ent->s.angles );
|
||||
|
||||
ent->think = G_FreeEntity;
|
||||
ent->nextthink = level.time + 2 * 60 * 1000;
|
||||
|
||||
trap_LinkEntity( ent );
|
||||
|
||||
player->client->portalID = ++level.portalSequence;
|
||||
ent->count = player->client->portalID;
|
||||
|
||||
// give the item back so they can drop the source now
|
||||
player->client->ps.stats[STAT_HOLDABLE_ITEM] = BG_FindItem( "Portal" ) - bg_itemlist;
|
||||
}
|
||||
|
||||
|
||||
static void PortalTouch( gentity_t *self, gentity_t *other, trace_t *trace) {
|
||||
gentity_t *destination;
|
||||
|
||||
// see if we will even let other try to use it
|
||||
if( other->health <= 0 ) {
|
||||
return;
|
||||
}
|
||||
if( !other->client ) {
|
||||
return;
|
||||
}
|
||||
// if( other->client->ps.persistant[PERS_TEAM] != self->spawnflags ) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
if ( other->client->ps.powerups[PW_NEUTRALFLAG] ) { // only happens in One Flag CTF
|
||||
Drop_Item( other, BG_FindItemForPowerup( PW_NEUTRALFLAG ), 0 );
|
||||
other->client->ps.powerups[PW_NEUTRALFLAG] = 0;
|
||||
}
|
||||
else if ( other->client->ps.powerups[PW_REDFLAG] ) { // only happens in standard CTF
|
||||
Drop_Item( other, BG_FindItemForPowerup( PW_REDFLAG ), 0 );
|
||||
other->client->ps.powerups[PW_REDFLAG] = 0;
|
||||
}
|
||||
else if ( other->client->ps.powerups[PW_BLUEFLAG] ) { // only happens in standard CTF
|
||||
Drop_Item( other, BG_FindItemForPowerup( PW_BLUEFLAG ), 0 );
|
||||
other->client->ps.powerups[PW_BLUEFLAG] = 0;
|
||||
}
|
||||
|
||||
// find the destination
|
||||
destination = NULL;
|
||||
while( (destination = G_Find(destination, FOFS(classname), "hi_portal destination")) != NULL ) {
|
||||
if( destination->count == self->count ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// if there is not one, die!
|
||||
if( !destination ) {
|
||||
if( self->pos1[0] || self->pos1[1] || self->pos1[2] ) {
|
||||
TeleportPlayer( other, self->pos1, self->s.angles );
|
||||
}
|
||||
G_Damage( other, other, other, NULL, NULL, 100000, DAMAGE_NO_PROTECTION, MOD_TELEFRAG );
|
||||
return;
|
||||
}
|
||||
|
||||
TeleportPlayer( other, destination->s.pos.trBase, destination->s.angles );
|
||||
}
|
||||
|
||||
|
||||
static void PortalEnable( gentity_t *self ) {
|
||||
self->touch = PortalTouch;
|
||||
self->think = G_FreeEntity;
|
||||
self->nextthink = level.time + 2 * 60 * 1000;
|
||||
}
|
||||
|
||||
|
||||
void DropPortalSource( gentity_t *player ) {
|
||||
gentity_t *ent;
|
||||
gentity_t *destination;
|
||||
vec3_t snapped;
|
||||
|
||||
// create the portal source
|
||||
ent = G_Spawn();
|
||||
ent->s.modelindex = G_ModelIndex( "models/powerups/teleporter/tele_enter.md3" );
|
||||
|
||||
VectorCopy( player->s.pos.trBase, snapped );
|
||||
SnapVector( snapped );
|
||||
G_SetOrigin( ent, snapped );
|
||||
VectorCopy( player->r.mins, ent->r.mins );
|
||||
VectorCopy( player->r.maxs, ent->r.maxs );
|
||||
|
||||
ent->classname = "hi_portal source";
|
||||
ent->s.pos.trType = TR_STATIONARY;
|
||||
|
||||
ent->r.contents = CONTENTS_CORPSE | CONTENTS_TRIGGER;
|
||||
ent->takedamage = qtrue;
|
||||
ent->health = 200;
|
||||
ent->die = PortalDie;
|
||||
|
||||
trap_LinkEntity( ent );
|
||||
|
||||
ent->count = player->client->portalID;
|
||||
player->client->portalID = 0;
|
||||
|
||||
// ent->spawnflags = player->client->ps.persistant[PERS_TEAM];
|
||||
|
||||
ent->nextthink = level.time + 1000;
|
||||
ent->think = PortalEnable;
|
||||
|
||||
// find the destination
|
||||
destination = NULL;
|
||||
while( (destination = G_Find(destination, FOFS(classname), "hi_portal destination")) != NULL ) {
|
||||
if( destination->count == ent->count ) {
|
||||
VectorCopy( destination->s.pos.trBase, ent->pos1 );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
================
|
||||
G_EvaluateTrajectory
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.28 2002/06/16 17:38:00 jbravo
|
||||
// Removed the MISSIONPACK ifdefs and missionpack only code.
|
||||
//
|
||||
// Revision 1.27 2002/06/11 15:52:21 makro
|
||||
// Fixed knife + unbreakable breakables/breakables with high health bug
|
||||
//
|
||||
|
@ -122,177 +125,6 @@ void G_ExplodeMissile( gentity_t *ent ) {
|
|||
trap_LinkEntity( ent );
|
||||
}
|
||||
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
/*
|
||||
================
|
||||
ProximityMine_Explode
|
||||
================
|
||||
*/
|
||||
static void ProximityMine_Explode( gentity_t *mine ) {
|
||||
G_ExplodeMissile( mine );
|
||||
// if the prox mine has a trigger free it
|
||||
if (mine->activator) {
|
||||
G_FreeEntity(mine->activator);
|
||||
mine->activator = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
ProximityMine_Die
|
||||
================
|
||||
*/
|
||||
static void ProximityMine_Die( gentity_t *ent, gentity_t *inflictor, gentity_t *attacker, int damage, int mod ) {
|
||||
ent->think = ProximityMine_Explode;
|
||||
ent->nextthink = level.time + 1;
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
ProximityMine_Trigger
|
||||
================
|
||||
*/
|
||||
void ProximityMine_Trigger( gentity_t *trigger, gentity_t *other, trace_t *trace ) {
|
||||
vec3_t v;
|
||||
gentity_t *mine;
|
||||
|
||||
if( !other->client ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// trigger is a cube, do a distance test now to act as if it's a sphere
|
||||
VectorSubtract( trigger->s.pos.trBase, other->s.pos.trBase, v );
|
||||
if( VectorLength( v ) > trigger->parent->splashRadius ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if ( g_gametype.integer >= GT_TEAM ) {
|
||||
// don't trigger same team mines
|
||||
if (trigger->parent->s.generic1 == other->client->sess.sessionTeam) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// ok, now check for ability to damage so we don't get triggered thru walls, closed doors, etc...
|
||||
if( !CanDamage( other, trigger->s.pos.trBase ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// trigger the mine!
|
||||
mine = trigger->parent;
|
||||
mine->s.loopSound = 0;
|
||||
G_AddEvent( mine, EV_PROXIMITY_MINE_TRIGGER, 0 );
|
||||
mine->nextthink = level.time + 500;
|
||||
|
||||
G_FreeEntity( trigger );
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
ProximityMine_Activate
|
||||
================
|
||||
*/
|
||||
static void ProximityMine_Activate( gentity_t *ent ) {
|
||||
gentity_t *trigger;
|
||||
float r;
|
||||
|
||||
ent->think = ProximityMine_Explode;
|
||||
ent->nextthink = level.time + g_proxMineTimeout.integer;
|
||||
|
||||
ent->takedamage = qtrue;
|
||||
ent->health = 1;
|
||||
ent->die = ProximityMine_Die;
|
||||
|
||||
//Elder: removed
|
||||
//ent->s.loopSound = G_SoundIndex( "sound/weapons/proxmine/wstbtick.wav" );
|
||||
|
||||
// build the proximity trigger
|
||||
trigger = G_Spawn ();
|
||||
|
||||
trigger->classname = "proxmine_trigger";
|
||||
|
||||
r = ent->splashRadius;
|
||||
VectorSet( trigger->r.mins, -r, -r, -r );
|
||||
VectorSet( trigger->r.maxs, r, r, r );
|
||||
|
||||
G_SetOrigin( trigger, ent->s.pos.trBase );
|
||||
|
||||
trigger->parent = ent;
|
||||
trigger->r.contents = CONTENTS_TRIGGER;
|
||||
trigger->touch = ProximityMine_Trigger;
|
||||
|
||||
trap_LinkEntity (trigger);
|
||||
|
||||
// set pointer to trigger so the entity can be freed when the mine explodes
|
||||
ent->activator = trigger;
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
ProximityMine_ExplodeOnPlayer
|
||||
================
|
||||
*/
|
||||
static void ProximityMine_ExplodeOnPlayer( gentity_t *mine ) {
|
||||
gentity_t *player;
|
||||
|
||||
player = mine->enemy;
|
||||
player->client->ps.eFlags &= ~EF_TICKING;
|
||||
|
||||
if ( player->client->invulnerabilityTime > level.time ) {
|
||||
G_Damage( player, mine->parent, mine->parent, vec3_origin, mine->s.origin, 1000, DAMAGE_NO_KNOCKBACK, MOD_JUICED );
|
||||
player->client->invulnerabilityTime = 0;
|
||||
G_TempEntity( player->client->ps.origin, EV_JUICED );
|
||||
}
|
||||
else {
|
||||
G_SetOrigin( mine, player->s.pos.trBase );
|
||||
// make sure the explosion gets to the client
|
||||
mine->r.svFlags &= ~SVF_NOCLIENT;
|
||||
mine->splashMethodOfDeath = MOD_PROXIMITY_MINE;
|
||||
G_ExplodeMissile( mine );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
ProximityMine_Player
|
||||
================
|
||||
*/
|
||||
static void ProximityMine_Player( gentity_t *mine, gentity_t *player ) {
|
||||
if( mine->s.eFlags & EF_NODRAW ) {
|
||||
return;
|
||||
}
|
||||
|
||||
G_AddEvent( mine, EV_PROXIMITY_MINE_STICK, 0 );
|
||||
|
||||
if( player->s.eFlags & EF_TICKING ) {
|
||||
player->activator->splashDamage += mine->splashDamage;
|
||||
player->activator->splashRadius *= 1.50;
|
||||
mine->think = G_FreeEntity;
|
||||
mine->nextthink = level.time;
|
||||
return;
|
||||
}
|
||||
|
||||
player->client->ps.eFlags |= EF_TICKING;
|
||||
player->activator = mine;
|
||||
|
||||
mine->s.eFlags |= EF_NODRAW;
|
||||
mine->r.svFlags |= SVF_NOCLIENT;
|
||||
mine->s.pos.trType = TR_LINEAR;
|
||||
VectorClear( mine->s.pos.trDelta );
|
||||
|
||||
mine->enemy = player;
|
||||
mine->think = ProximityMine_ExplodeOnPlayer;
|
||||
if ( player->client->invulnerabilityTime > level.time ) {
|
||||
mine->nextthink = level.time + 2 * 1000;
|
||||
}
|
||||
else {
|
||||
mine->nextthink = level.time + 10 * 1000;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
================
|
||||
G_MissileImpact
|
||||
|
@ -302,10 +134,7 @@ void G_MissileImpact( gentity_t *ent, trace_t *trace ) {
|
|||
gentity_t *other;
|
||||
qboolean hitClient = qfalse;
|
||||
vec3_t velocity;
|
||||
#ifdef MISSIONPACK
|
||||
vec3_t forward, impactpoint, bouncedir;
|
||||
int eFlags;
|
||||
#endif
|
||||
|
||||
//Elder: added for thrown knife condition
|
||||
gitem_t *xr_item;
|
||||
gentity_t *xr_drop;
|
||||
|
@ -331,26 +160,6 @@ void G_MissileImpact( gentity_t *ent, trace_t *trace ) {
|
|||
}
|
||||
*/
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
if ( other->takedamage ) {
|
||||
if ( ent->s.weapon != WP_PROX_LAUNCHER ) {
|
||||
if ( other->client && other->client->invulnerabilityTime > level.time ) {
|
||||
//
|
||||
VectorCopy( ent->s.pos.trDelta, forward );
|
||||
VectorNormalize( forward );
|
||||
if (G_InvulnerabilityEffect( other, forward, ent->s.pos.trBase, impactpoint, bouncedir )) {
|
||||
VectorCopy( bouncedir, trace->plane.normal );
|
||||
eFlags = ent->s.eFlags & EF_BOUNCE_HALF;
|
||||
ent->s.eFlags &= ~EF_BOUNCE_HALF;
|
||||
G_BounceMissile( ent, trace );
|
||||
ent->s.eFlags |= eFlags;
|
||||
}
|
||||
ent->target_ent = other;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// impact damage
|
||||
if (other->takedamage) {
|
||||
// FIXME: wrong damage direction?
|
||||
|
@ -380,43 +189,6 @@ void G_MissileImpact( gentity_t *ent, trace_t *trace ) {
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
if( ent->s.weapon == WP_PROX_LAUNCHER ) {
|
||||
if( ent->s.pos.trType != TR_GRAVITY ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// if it's a player, stick it on to them (flag them and remove this entity)
|
||||
if( other->s.eType == ET_PLAYER && other->health > 0 ) {
|
||||
ProximityMine_Player( ent, other );
|
||||
return;
|
||||
}
|
||||
|
||||
SnapVectorTowards( trace->endpos, ent->s.pos.trBase );
|
||||
G_SetOrigin( ent, trace->endpos );
|
||||
ent->s.pos.trType = TR_STATIONARY;
|
||||
VectorClear( ent->s.pos.trDelta );
|
||||
|
||||
G_AddEvent( ent, EV_PROXIMITY_MINE_STICK, trace->surfaceFlags );
|
||||
|
||||
ent->think = ProximityMine_Activate;
|
||||
ent->nextthink = level.time + 2000;
|
||||
|
||||
vectoangles( trace->plane.normal, ent->s.angles );
|
||||
ent->s.angles[0] += 90;
|
||||
|
||||
// link the prox mine to the other entity
|
||||
ent->enemy = other;
|
||||
ent->die = ProximityMine_Die;
|
||||
VectorCopy(trace->plane.normal, ent->movedir);
|
||||
VectorSet(ent->r.mins, -4, -4, -4);
|
||||
VectorSet(ent->r.maxs, 4, 4, 4);
|
||||
trap_LinkEntity(ent);
|
||||
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!strcmp(ent->classname, "hook")) {
|
||||
gentity_t *nent;
|
||||
vec3_t v;
|
||||
|
@ -646,14 +418,7 @@ void G_RunMissile( gentity_t *ent ) {
|
|||
// if this missile bounced off an invulnerability sphere
|
||||
if ( ent->target_ent ) {
|
||||
passent = ent->target_ent->s.number;
|
||||
}
|
||||
#ifdef MISSIONPACK
|
||||
// prox mines that left the owner bbox will attach to anything, even the owner
|
||||
else if (ent->s.weapon == WP_PROX_LAUNCHER && ent->count) {
|
||||
passent = ENTITYNUM_NONE;
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
} else {
|
||||
// ignore interactions with the missile owner
|
||||
passent = ent->r.ownerNum;
|
||||
}
|
||||
|
@ -699,16 +464,6 @@ void G_RunMissile( gentity_t *ent ) {
|
|||
}
|
||||
*/
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
// if the prox mine wasn't yet outside the player body
|
||||
if (ent->s.weapon == WP_PROX_LAUNCHER && !ent->count) {
|
||||
// check if the prox mine is outside the owner bbox
|
||||
trap_Trace( &tr, ent->r.currentOrigin, ent->r.mins, ent->r.maxs, ent->r.currentOrigin, ENTITYNUM_NONE, ent->clipmask );
|
||||
if (!tr.startsolid || tr.entityNum != ent->r.ownerNum) {
|
||||
ent->count = 1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// check think function after bouncing
|
||||
G_RunThink( ent );
|
||||
}
|
||||
|
@ -1018,100 +773,3 @@ gentity_t *fire_grapple (gentity_t *self, vec3_t start, vec3_t dir) {
|
|||
}
|
||||
*/
|
||||
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
/*
|
||||
=================
|
||||
fire_nail
|
||||
=================
|
||||
*/
|
||||
#define NAILGUN_SPREAD 500
|
||||
|
||||
gentity_t *fire_nail( gentity_t *self, vec3_t start, vec3_t forward, vec3_t right, vec3_t up ) {
|
||||
gentity_t *bolt;
|
||||
vec3_t dir;
|
||||
vec3_t end;
|
||||
float r, u, scale;
|
||||
|
||||
bolt = G_Spawn();
|
||||
bolt->classname = "nail";
|
||||
bolt->nextthink = level.time + 10000;
|
||||
bolt->think = G_ExplodeMissile;
|
||||
bolt->s.eType = ET_MISSILE;
|
||||
bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN;
|
||||
bolt->s.weapon = WP_NAILGUN;
|
||||
bolt->r.ownerNum = self->s.number;
|
||||
bolt->parent = self;
|
||||
bolt->damage = 20;
|
||||
bolt->methodOfDeath = MOD_NAIL;
|
||||
bolt->clipmask = MASK_SHOT;
|
||||
bolt->target_ent = NULL;
|
||||
|
||||
bolt->s.pos.trType = TR_LINEAR;
|
||||
bolt->s.pos.trTime = level.time;
|
||||
VectorCopy( start, bolt->s.pos.trBase );
|
||||
|
||||
r = random() * M_PI * 2.0f;
|
||||
u = sin(r) * crandom() * NAILGUN_SPREAD * 16;
|
||||
r = cos(r) * crandom() * NAILGUN_SPREAD * 16;
|
||||
VectorMA( start, 8192 * 16, forward, end);
|
||||
VectorMA (end, r, right, end);
|
||||
VectorMA (end, u, up, end);
|
||||
VectorSubtract( end, start, dir );
|
||||
VectorNormalize( dir );
|
||||
|
||||
scale = 555 + random() * 1800;
|
||||
VectorScale( dir, scale, bolt->s.pos.trDelta );
|
||||
SnapVector( bolt->s.pos.trDelta );
|
||||
|
||||
VectorCopy( start, bolt->r.currentOrigin );
|
||||
|
||||
return bolt;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
fire_prox
|
||||
=================
|
||||
*/
|
||||
gentity_t *fire_prox( gentity_t *self, vec3_t start, vec3_t dir ) {
|
||||
gentity_t *bolt;
|
||||
|
||||
VectorNormalize (dir);
|
||||
|
||||
bolt = G_Spawn();
|
||||
bolt->classname = "prox mine";
|
||||
bolt->nextthink = level.time + 3000;
|
||||
bolt->think = G_ExplodeMissile;
|
||||
bolt->s.eType = ET_MISSILE;
|
||||
bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN;
|
||||
bolt->s.weapon = WP_PROX_LAUNCHER;
|
||||
bolt->s.eFlags = 0;
|
||||
bolt->r.ownerNum = self->s.number;
|
||||
bolt->parent = self;
|
||||
bolt->damage = 0;
|
||||
bolt->splashDamage = 100;
|
||||
bolt->splashRadius = 150;
|
||||
bolt->methodOfDeath = MOD_PROXIMITY_MINE;
|
||||
bolt->splashMethodOfDeath = MOD_PROXIMITY_MINE;
|
||||
bolt->clipmask = MASK_SHOT;
|
||||
bolt->target_ent = NULL;
|
||||
// count is used to check if the prox mine left the player bbox
|
||||
// if count == 1 then the prox mine left the player bbox and can attack to it
|
||||
bolt->count = 0;
|
||||
|
||||
//FIXME: we prolly wanna abuse another field
|
||||
bolt->s.generic1 = self->client->sess.sessionTeam;
|
||||
|
||||
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, 700, bolt->s.pos.trDelta );
|
||||
SnapVector( bolt->s.pos.trDelta ); // save net bandwidth
|
||||
|
||||
VectorCopy (start, bolt->r.currentOrigin);
|
||||
|
||||
return bolt;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.46 2002/06/16 17:38:00 jbravo
|
||||
// Removed the MISSIONPACK ifdefs and missionpack only code.
|
||||
//
|
||||
// Revision 1.45 2002/06/10 23:46:28 blaze
|
||||
// fixed the default sounds on doors
|
||||
//
|
||||
|
@ -408,43 +411,6 @@ qboolean G_MoverPush( gentity_t *pusher, vec3_t move, vec3_t amove, gentity_t **
|
|||
// see if any solid entities are inside the final position
|
||||
for ( e = 0 ; e < listedEntities ; e++ ) {
|
||||
check = &g_entities[ entityList[ e ] ];
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
if ( check->s.eType == ET_MISSILE ) {
|
||||
// if it is a prox mine
|
||||
if ( !strcmp(check->classname, "prox mine") ) {
|
||||
// if this prox mine is attached to this mover try to move it with the pusher
|
||||
if ( check->enemy == pusher ) {
|
||||
if (!G_TryPushingProxMine( check, pusher, move, amove )) {
|
||||
//explode
|
||||
check->s.loopSound = 0;
|
||||
G_AddEvent( check, EV_PROXIMITY_MINE_TRIGGER, 0 );
|
||||
G_ExplodeMissile(check);
|
||||
if (check->activator) {
|
||||
G_FreeEntity(check->activator);
|
||||
check->activator = NULL;
|
||||
}
|
||||
//G_Printf("prox mine explodes\n");
|
||||
}
|
||||
}
|
||||
else {
|
||||
//check if the prox mine is crushed by the mover
|
||||
if (!G_CheckProxMinePosition( check )) {
|
||||
//explode
|
||||
check->s.loopSound = 0;
|
||||
G_AddEvent( check, EV_PROXIMITY_MINE_TRIGGER, 0 );
|
||||
G_ExplodeMissile(check);
|
||||
if (check->activator) {
|
||||
G_FreeEntity(check->activator);
|
||||
check->activator = NULL;
|
||||
}
|
||||
//G_Printf("prox mine explodes\n");
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// only push items and players
|
||||
if ( check->s.eType != ET_ITEM && check->s.eType != ET_PLAYER && !check->physicsObject ) {
|
||||
continue;
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.6 2002/06/16 17:38:00 jbravo
|
||||
// Removed the MISSIONPACK ifdefs and missionpack only code.
|
||||
//
|
||||
// Revision 1.5 2002/04/01 02:56:50 jbravo
|
||||
// Some sourcecode reformatting
|
||||
//
|
||||
|
@ -226,45 +229,6 @@ Key digits:
|
|||
#define QGR_KEY_PICKUP_UNKNOWN 1111021109
|
||||
#define QGR_KEY_TIME_UNKNOWN 1111021110
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
// new to team arena
|
||||
#define QGR_KEY_FRAG_NAILGIN 1211021200
|
||||
#define QGR_KEY_SUICIDE_NAILGIN 1111021201
|
||||
#define QGR_KEY_SHOT_FIRED_NAILGIN 1111021202
|
||||
#define QGR_KEY_HIT_GIVEN_NAILGIN 1111021203
|
||||
#define QGR_KEY_HIT_TAKEN_NAILGIN 1111021204
|
||||
#define QGR_KEY_DAMAGE_GIVEN_NAILGIN 1111021205
|
||||
#define QGR_KEY_DAMAGE_TAKEN_NAILGIN 1111021206
|
||||
#define QGR_KEY_SPLASH_GIVEN_NAILGIN 1111021207
|
||||
#define QGR_KEY_SPLASH_TAKEN_NAILGIN 1111021208
|
||||
#define QGR_KEY_PICKUP_NAILGIN 1111021209
|
||||
#define QGR_KEY_TIME_NAILGIN 1111021210
|
||||
// new to team arena
|
||||
#define QGR_KEY_FRAG_PROX_LAUNCHER 1211021300
|
||||
#define QGR_KEY_SUICIDE_PROX_LAUNCHER 1111021301
|
||||
#define QGR_KEY_SHOT_FIRED_PROX_LAUNCHER 1111021302
|
||||
#define QGR_KEY_HIT_GIVEN_PROX_LAUNCHER 1111021303
|
||||
#define QGR_KEY_HIT_TAKEN_PROX_LAUNCHER 1111021304
|
||||
#define QGR_KEY_DAMAGE_GIVEN_PROX_LAUNCHER 1111021305
|
||||
#define QGR_KEY_DAMAGE_TAKEN_PROX_LAUNCHER 1111021306
|
||||
#define QGR_KEY_SPLASH_GIVEN_PROX_LAUNCHER 1111021307
|
||||
#define QGR_KEY_SPLASH_TAKEN_PROX_LAUNCHER 1111021308
|
||||
#define QGR_KEY_PICKUP_PROX_LAUNCHER 1111021309
|
||||
#define QGR_KEY_TIME_PROX_LAUNCHER 1111021310
|
||||
// new to team arena
|
||||
#define QGR_KEY_FRAG_CHAINGUN 1211021400
|
||||
#define QGR_KEY_SUICIDE_CHAINGUN 1111021401
|
||||
#define QGR_KEY_SHOT_FIRED_CHAINGUN 1111021402
|
||||
#define QGR_KEY_HIT_GIVEN_CHAINGUN 1111021403
|
||||
#define QGR_KEY_HIT_TAKEN_CHAINGUN 1111021404
|
||||
#define QGR_KEY_DAMAGE_GIVEN_CHAINGUN 1111021405
|
||||
#define QGR_KEY_DAMAGE_TAKEN_CHAINGUN 1111021406
|
||||
#define QGR_KEY_SPLASH_GIVEN_CHAINGUN 1111021407
|
||||
#define QGR_KEY_SPLASH_TAKEN_CHAINGUN 1111021408
|
||||
#define QGR_KEY_PICKUP_CHAINGUN 1111021409
|
||||
#define QGR_KEY_TIME_CHAINGUN 1111021410
|
||||
#endif /* MISSIONPACK */
|
||||
|
||||
// ammo keys
|
||||
#define QGR_KEY_BOXES 1111030000
|
||||
#define QGR_KEY_ROUNDS 1111030001
|
||||
|
@ -293,18 +257,6 @@ Key digits:
|
|||
#define QGR_KEY_BOXES_BFG_AMMO 1111030800
|
||||
#define QGR_KEY_ROUNDS_BFG_AMMO 1111030801
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
// new to team arena
|
||||
#define QGR_KEY_BOXES_NAILGUN_AMMO 1111030900
|
||||
#define QGR_KEY_ROUNDS_NAILGUN_AMMO 1111030901
|
||||
// new to team arena
|
||||
#define QGR_KEY_BOXES_PROX_LAUNCHER_AMMO 1111031000
|
||||
#define QGR_KEY_ROUNDS_PROX_LAUNCHER_AMMO 1111031001
|
||||
// new to team arena
|
||||
#define QGR_KEY_BOXES_CHAINGUN_AMMO 1111031100
|
||||
#define QGR_KEY_ROUNDS_CHAINGUN_AMMO 1111031101
|
||||
#endif /* MISSIONPACK */
|
||||
|
||||
// health keys
|
||||
#define QGR_KEY_HEALTH 1111040000
|
||||
#define QGR_KEY_HEALTH_TOTAL 1111040001
|
||||
|
@ -331,16 +283,6 @@ Key digits:
|
|||
#define QGR_KEY_REGEN 1111060500
|
||||
#define QGR_KEY_FLIGHT 1111060600
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
// persistant powerup keys
|
||||
// new to team arena
|
||||
#define QGR_KEY_SCOUT 1111160800
|
||||
#define QGR_KEY_GUARD 1111160801
|
||||
#define QGR_KEY_DOUBLER 1111160802
|
||||
#define QGR_KEY_AMMOREGEN 1111160803
|
||||
|
||||
#endif //MISSIONPACK
|
||||
|
||||
// holdable item keys
|
||||
#define QGR_KEY_MEDKIT 1111070000
|
||||
#define QGR_KEY_MEDKIT_USE 1111070001
|
||||
|
@ -348,18 +290,6 @@ Key digits:
|
|||
#define QGR_KEY_TELEPORTER 1111070100
|
||||
#define QGR_KEY_TELEPORTER_USE 1111070101
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
// new to team arena
|
||||
#define QGR_KEY_KAMIKAZE 1111070200
|
||||
#define QGR_KEY_KAMIKAZE_USE 1111070201
|
||||
// new to team arena
|
||||
#define QGR_KEY_PORTAL 1111070300
|
||||
#define QGR_KEY_PORTAL_USE 1111070301
|
||||
// new to team arena
|
||||
#define QGR_KEY_INVULNERABILITY 1111070400
|
||||
#define QGR_KEY_INVULNERABILITY_USE 1111070401
|
||||
#endif /* MISSIONPACK */
|
||||
|
||||
// hazard keys
|
||||
#define QGR_KEY_HAZARD_DEATH 1111080000
|
||||
#define QGR_KEY_WATER 1111080100
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.31 2002/06/16 17:38:00 jbravo
|
||||
// Removed the MISSIONPACK ifdefs and missionpack only code.
|
||||
//
|
||||
// Revision 1.30 2002/06/12 11:14:35 makro
|
||||
// Fixed knives/pistols not spawning bug
|
||||
//
|
||||
|
@ -260,11 +263,6 @@ void SP_team_CTF_redspawn( gentity_t *ent );
|
|||
void SP_team_CTF_bluespawn( gentity_t *ent );
|
||||
|
||||
void SP_func_door_rotating( gentity_t *ent ); // VALKYRIE: for rotating doors
|
||||
#ifdef MISSIONPACK
|
||||
void SP_team_blueobelisk( gentity_t *ent );
|
||||
void SP_team_redobelisk( gentity_t *ent );
|
||||
void SP_team_neutralobelisk( gentity_t *ent );
|
||||
#endif
|
||||
|
||||
// JBravo: SP_item_botroam doesnt really exsist.
|
||||
// Makro - still, bots are supposed to use these
|
||||
|
@ -344,11 +342,6 @@ spawn_t spawns[] = {
|
|||
{"team_CTF_bluespawn", SP_team_CTF_bluespawn},
|
||||
|
||||
{"func_door_rotating", SP_func_door_rotating}, // VALKYRIE: for rotating doors
|
||||
#ifdef MISSIONPACK
|
||||
{"team_redobelisk", SP_team_redobelisk},
|
||||
{"team_blueobelisk", SP_team_blueobelisk},
|
||||
{"team_neutralobelisk", SP_team_neutralobelisk},
|
||||
#endif
|
||||
|
||||
//Blaze: Merged func_explosive into func_breakable
|
||||
// {"func_explosive", SP_func_explosive}, // JBravo: for explosive.
|
||||
|
@ -632,19 +625,11 @@ void G_SpawnGEntityFromSpawnVars( void ) {
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
G_SpawnInt( "notta", "0", &i );
|
||||
if ( i ) {
|
||||
G_FreeEntity( ent );
|
||||
return;
|
||||
}
|
||||
#else
|
||||
G_SpawnInt( "notq3a", "0", &i );
|
||||
if ( i ) {
|
||||
G_FreeEntity( ent );
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if( G_SpawnString( "gametype", NULL, &value ) ) {
|
||||
if( g_gametype.integer >= GT_FFA && g_gametype.integer < GT_MAX_GAME_TYPE ) {
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.8 2002/06/16 17:38:00 jbravo
|
||||
// Removed the MISSIONPACK ifdefs and missionpack only code.
|
||||
//
|
||||
// Revision 1.7 2002/02/26 03:32:02 jbravo
|
||||
// Fixed teamsay spilling over to members of the other team
|
||||
//
|
||||
|
@ -49,12 +52,6 @@ void Team_InitGame( void ) {
|
|||
Team_SetFlagStatus( TEAM_RED, FLAG_ATBASE );
|
||||
Team_SetFlagStatus( TEAM_BLUE, FLAG_ATBASE );
|
||||
break;
|
||||
#ifdef MISSIONPACK
|
||||
case GT_1FCTF:
|
||||
teamgame.flagStatus = -1; // Invalid to force update
|
||||
Team_SetFlagStatus( TEAM_FREE, FLAG_ATBASE );
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -318,11 +315,6 @@ void Team_FragBonuses(gentity_t *targ, gentity_t *inflictor, gentity_t *attacker
|
|||
|
||||
// did the attacker frag the flag carrier?
|
||||
tokens = 0;
|
||||
#ifdef MISSIONPACK
|
||||
if( g_gametype.integer == GT_HARVESTER ) {
|
||||
tokens = targ->client->ps.generic1;
|
||||
}
|
||||
#endif
|
||||
if (targ->client->ps.powerups[enemy_flag_pw]) {
|
||||
attacker->client->pers.teamState.lastfraggedcarrier = level.time;
|
||||
AddScore(attacker, targ->r.currentOrigin, CTF_FRAG_CARRIER_BONUS);
|
||||
|
@ -399,28 +391,7 @@ void Team_FragBonuses(gentity_t *targ, gentity_t *inflictor, gentity_t *attacker
|
|||
}
|
||||
|
||||
// flag and flag carrier area defense bonuses
|
||||
|
||||
// we have to find the flag and carrier entities
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
if( g_gametype.integer == GT_OBELISK ) {
|
||||
// find the team obelisk
|
||||
switch (attacker->client->sess.sessionTeam) {
|
||||
case TEAM_RED:
|
||||
c = "team_redobelisk";
|
||||
break;
|
||||
case TEAM_BLUE:
|
||||
c = "team_blueobelisk";
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
} else if (g_gametype.integer == GT_HARVESTER ) {
|
||||
// find the center obelisk
|
||||
c = "team_neutralobelisk";
|
||||
} else {
|
||||
#endif
|
||||
// find the flag
|
||||
switch (attacker->client->sess.sessionTeam) {
|
||||
case TEAM_RED:
|
||||
|
@ -439,9 +410,6 @@ void Team_FragBonuses(gentity_t *targ, gentity_t *inflictor, gentity_t *attacker
|
|||
break;
|
||||
carrier = NULL;
|
||||
}
|
||||
#ifdef MISSIONPACK
|
||||
}
|
||||
#endif
|
||||
flag = NULL;
|
||||
while ((flag = G_Find (flag, FOFS(classname), c)) != NULL) {
|
||||
if (!(flag->flags & FL_DROPPED_ITEM))
|
||||
|
@ -568,14 +536,9 @@ gentity_t *Team_ResetFlag( int team ) {
|
|||
|
||||
void Team_ResetFlags( void ) {
|
||||
if( g_gametype.integer == GT_CTF ) {
|
||||
Team_ResetFlag(TEAM_RED);
|
||||
Team_ResetFlag(TEAM_BLUE);
|
||||
}
|
||||
#ifdef MISSIONPACK
|
||||
else if( g_gametype.integer == GT_1FCTF ) {
|
||||
Team_ResetFlag( TEAM_FREE );
|
||||
Team_ResetFlag(TEAM_RED);
|
||||
Team_ResetFlag(TEAM_BLUE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void Team_ReturnFlagSound( gentity_t *ent, int team ) {
|
||||
|
@ -712,12 +675,6 @@ int Team_TouchOurFlag( gentity_t *ent, gentity_t *other, int team ) {
|
|||
gclient_t *cl = other->client;
|
||||
int enemy_flag;
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
if( g_gametype.integer == GT_1FCTF ) {
|
||||
enemy_flag = PW_NEUTRALFLAG;
|
||||
}
|
||||
else {
|
||||
#endif
|
||||
if (cl->sess.sessionTeam == TEAM_RED) {
|
||||
enemy_flag = PW_BLUEFLAG;
|
||||
} else {
|
||||
|
@ -735,24 +692,12 @@ int Team_TouchOurFlag( gentity_t *ent, gentity_t *other, int team ) {
|
|||
Team_ReturnFlagSound(Team_ResetFlag(team), team);
|
||||
return 0;
|
||||
}
|
||||
#ifdef MISSIONPACK
|
||||
}
|
||||
#endif
|
||||
|
||||
// the flag is at home base. if the player has the enemy
|
||||
// flag, he's just won!
|
||||
if (!cl->ps.powerups[enemy_flag])
|
||||
return 0; // We don't have the flag
|
||||
#ifdef MISSIONPACK
|
||||
if( g_gametype.integer == GT_1FCTF ) {
|
||||
PrintMsg( NULL, "%s" S_COLOR_WHITE " captured the flag!\n", cl->pers.netname );
|
||||
}
|
||||
else {
|
||||
#endif
|
||||
PrintMsg( NULL, "%s" S_COLOR_WHITE " captured the %s flag!\n", cl->pers.netname, TeamName(OtherTeam(team)));
|
||||
#ifdef MISSIONPACK
|
||||
}
|
||||
#endif
|
||||
|
||||
cl->ps.powerups[enemy_flag] = 0;
|
||||
|
||||
|
@ -825,21 +770,6 @@ int Team_TouchOurFlag( gentity_t *ent, gentity_t *other, int team ) {
|
|||
int Team_TouchEnemyFlag( gentity_t *ent, gentity_t *other, int team ) {
|
||||
gclient_t *cl = other->client;
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
if( g_gametype.integer == GT_1FCTF ) {
|
||||
PrintMsg (NULL, "%s" S_COLOR_WHITE " got the flag!\n", other->client->pers.netname );
|
||||
|
||||
cl->ps.powerups[PW_NEUTRALFLAG] = INT_MAX; // flags never expire
|
||||
|
||||
if( team == TEAM_RED ) {
|
||||
Team_SetFlagStatus( TEAM_FREE, FLAG_TAKEN_RED );
|
||||
}
|
||||
else {
|
||||
Team_SetFlagStatus( TEAM_FREE, FLAG_TAKEN_BLUE );
|
||||
}
|
||||
}
|
||||
else{
|
||||
#endif
|
||||
PrintMsg (NULL, "%s" S_COLOR_WHITE " got the %s flag!\n",
|
||||
other->client->pers.netname, TeamName(team));
|
||||
|
||||
|
@ -849,9 +779,6 @@ int Team_TouchEnemyFlag( gentity_t *ent, gentity_t *other, int team ) {
|
|||
cl->ps.powerups[PW_BLUEFLAG] = INT_MAX; // flags never expire
|
||||
|
||||
Team_SetFlagStatus( team, FLAG_TAKEN );
|
||||
#ifdef MISSIONPACK
|
||||
}
|
||||
#endif
|
||||
|
||||
AddScore(other, ent->r.currentOrigin, CTF_FLAG_BONUS);
|
||||
cl->pers.teamState.flagsince = level.time;
|
||||
|
@ -864,22 +791,6 @@ int Pickup_Team( gentity_t *ent, gentity_t *other ) {
|
|||
int team;
|
||||
gclient_t *cl = other->client;
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
if( g_gametype.integer == GT_OBELISK ) {
|
||||
// there are no team items that can be picked up in obelisk
|
||||
G_FreeEntity( ent );
|
||||
return 0;
|
||||
}
|
||||
|
||||
if( g_gametype.integer == GT_HARVESTER ) {
|
||||
// the only team items that can be picked up in harvester are the cubes
|
||||
if( ent->spawnflags != cl->sess.sessionTeam ) {
|
||||
cl->ps.generic1 += 1;
|
||||
}
|
||||
G_FreeEntity( ent );
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
// figure out what team this flag is
|
||||
if( strcmp(ent->classname, "team_CTF_redflag") == 0 ) {
|
||||
team = TEAM_RED;
|
||||
|
@ -887,26 +798,10 @@ int Pickup_Team( gentity_t *ent, gentity_t *other ) {
|
|||
else if( strcmp(ent->classname, "team_CTF_blueflag") == 0 ) {
|
||||
team = TEAM_BLUE;
|
||||
}
|
||||
#ifdef MISSIONPACK
|
||||
else if( strcmp(ent->classname, "team_CTF_neutralflag") == 0 ) {
|
||||
team = TEAM_FREE;
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
PrintMsg ( other, "Don't know what team the flag is on.\n");
|
||||
return 0;
|
||||
}
|
||||
#ifdef MISSIONPACK
|
||||
if( g_gametype.integer == GT_1FCTF ) {
|
||||
if( team == TEAM_FREE ) {
|
||||
return Team_TouchEnemyFlag( ent, other, cl->sess.sessionTeam );
|
||||
}
|
||||
if( team != cl->sess.sessionTeam) {
|
||||
return Team_TouchOurFlag( ent, other, cl->sess.sessionTeam );
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
// GT_CTF
|
||||
if( team == cl->sess.sessionTeam) {
|
||||
return Team_TouchOurFlag( ent, other, team );
|
||||
|
@ -1200,296 +1095,3 @@ Targets will be fired when someone spawns in on them.
|
|||
void SP_team_CTF_bluespawn(gentity_t *ent) {
|
||||
}
|
||||
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
/*
|
||||
================
|
||||
Obelisks
|
||||
================
|
||||
*/
|
||||
|
||||
static void ObeliskRegen( gentity_t *self ) {
|
||||
self->nextthink = level.time + g_obeliskRegenPeriod.integer * 1000;
|
||||
if( self->health >= g_obeliskHealth.integer ) {
|
||||
return;
|
||||
}
|
||||
|
||||
G_AddEvent( self, EV_POWERUP_REGEN, 0 );
|
||||
self->health += g_obeliskRegenAmount.integer;
|
||||
if ( self->health > g_obeliskHealth.integer ) {
|
||||
self->health = g_obeliskHealth.integer;
|
||||
}
|
||||
|
||||
self->activator->s.modelindex2 = self->health * 0xff / g_obeliskHealth.integer;
|
||||
self->activator->s.frame = 0;
|
||||
}
|
||||
|
||||
|
||||
static void ObeliskRespawn( gentity_t *self ) {
|
||||
self->takedamage = qtrue;
|
||||
self->health = g_obeliskHealth.integer;
|
||||
|
||||
self->think = ObeliskRegen;
|
||||
self->nextthink = level.time + g_obeliskRegenPeriod.integer * 1000;
|
||||
|
||||
self->activator->s.frame = 0;
|
||||
}
|
||||
|
||||
|
||||
static void ObeliskDie( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int mod ) {
|
||||
int otherTeam;
|
||||
|
||||
otherTeam = OtherTeam( self->spawnflags );
|
||||
AddTeamScore(self->s.pos.trBase, otherTeam, 1);
|
||||
Team_ForceGesture(otherTeam);
|
||||
|
||||
CalculateRanks();
|
||||
|
||||
self->takedamage = qfalse;
|
||||
self->think = ObeliskRespawn;
|
||||
self->nextthink = level.time + g_obeliskRespawnDelay.integer * 1000;
|
||||
|
||||
self->activator->s.modelindex2 = 0xff;
|
||||
self->activator->s.frame = 2;
|
||||
|
||||
G_AddEvent( self->activator, EV_OBELISKEXPLODE, 0 );
|
||||
|
||||
AddScore(attacker, self->r.currentOrigin, CTF_CAPTURE_BONUS);
|
||||
|
||||
// add the sprite over the player's head
|
||||
attacker->client->ps.eFlags &= ~(EF_AWARD_IMPRESSIVE | EF_AWARD_EXCELLENT | EF_AWARD_GAUNTLET | EF_AWARD_ASSIST | EF_AWARD_DEFEND | EF_AWARD_CAP );
|
||||
attacker->client->ps.eFlags |= EF_AWARD_CAP;
|
||||
attacker->client->rewardTime = level.time + REWARD_SPRITE_TIME;
|
||||
attacker->client->ps.persistant[PERS_CAPTURES]++;
|
||||
|
||||
teamgame.redObeliskAttackedTime = 0;
|
||||
teamgame.blueObeliskAttackedTime = 0;
|
||||
}
|
||||
|
||||
|
||||
static void ObeliskTouch( gentity_t *self, gentity_t *other, trace_t *trace ) {
|
||||
int tokens;
|
||||
|
||||
if ( !other->client ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( OtherTeam(other->client->sess.sessionTeam) != self->spawnflags ) {
|
||||
return;
|
||||
}
|
||||
|
||||
tokens = other->client->ps.generic1;
|
||||
if( tokens <= 0 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
PrintMsg(NULL, "%s" S_COLOR_WHITE " brought in %i skull%s.\n",
|
||||
other->client->pers.netname, tokens, tokens ? "s" : "" );
|
||||
|
||||
AddTeamScore(self->s.pos.trBase, other->client->sess.sessionTeam, tokens);
|
||||
Team_ForceGesture(other->client->sess.sessionTeam);
|
||||
|
||||
AddScore(other, self->r.currentOrigin, CTF_CAPTURE_BONUS*tokens);
|
||||
|
||||
// add the sprite over the player's head
|
||||
other->client->ps.eFlags &= ~(EF_AWARD_IMPRESSIVE | EF_AWARD_EXCELLENT | EF_AWARD_GAUNTLET | EF_AWARD_ASSIST | EF_AWARD_DEFEND | EF_AWARD_CAP );
|
||||
other->client->ps.eFlags |= EF_AWARD_CAP;
|
||||
other->client->rewardTime = level.time + REWARD_SPRITE_TIME;
|
||||
other->client->ps.persistant[PERS_CAPTURES] += tokens;
|
||||
|
||||
other->client->ps.generic1 = 0;
|
||||
CalculateRanks();
|
||||
|
||||
Team_CaptureFlagSound( self, self->spawnflags );
|
||||
}
|
||||
|
||||
static void ObeliskPain( gentity_t *self, gentity_t *attacker, int damage ) {
|
||||
int actualDamage = damage / 10;
|
||||
if (actualDamage <= 0) {
|
||||
actualDamage = 1;
|
||||
}
|
||||
self->activator->s.modelindex2 = self->health * 0xff / g_obeliskHealth.integer;
|
||||
if (!self->activator->s.frame) {
|
||||
G_AddEvent(self, EV_OBELISKPAIN, 0);
|
||||
}
|
||||
self->activator->s.frame = 1;
|
||||
AddScore(attacker, self->r.currentOrigin, actualDamage);
|
||||
}
|
||||
|
||||
gentity_t *SpawnObelisk( vec3_t origin, int team, int spawnflags) {
|
||||
trace_t tr;
|
||||
vec3_t dest;
|
||||
gentity_t *ent;
|
||||
|
||||
ent = G_Spawn();
|
||||
|
||||
VectorCopy( origin, ent->s.origin );
|
||||
VectorCopy( origin, ent->s.pos.trBase );
|
||||
VectorCopy( origin, ent->r.currentOrigin );
|
||||
|
||||
VectorSet( ent->r.mins, -15, -15, 0 );
|
||||
VectorSet( ent->r.maxs, 15, 15, 87 );
|
||||
|
||||
ent->s.eType = ET_GENERAL;
|
||||
ent->flags = FL_NO_KNOCKBACK;
|
||||
|
||||
if( g_gametype.integer == GT_OBELISK ) {
|
||||
ent->r.contents = CONTENTS_SOLID;
|
||||
ent->takedamage = qtrue;
|
||||
ent->health = g_obeliskHealth.integer;
|
||||
ent->die = ObeliskDie;
|
||||
ent->pain = ObeliskPain;
|
||||
ent->think = ObeliskRegen;
|
||||
ent->nextthink = level.time + g_obeliskRegenPeriod.integer * 1000;
|
||||
}
|
||||
if( g_gametype.integer == GT_HARVESTER ) {
|
||||
ent->r.contents = CONTENTS_TRIGGER;
|
||||
ent->touch = ObeliskTouch;
|
||||
}
|
||||
|
||||
if ( spawnflags & 1 ) {
|
||||
// suspended
|
||||
G_SetOrigin( ent, ent->s.origin );
|
||||
} else {
|
||||
// mappers like to put them exactly on the floor, but being coplanar
|
||||
// will sometimes show up as starting in solid, so lif it up one pixel
|
||||
ent->s.origin[2] += 1;
|
||||
|
||||
// drop to floor
|
||||
VectorSet( dest, ent->s.origin[0], ent->s.origin[1], ent->s.origin[2] - 4096 );
|
||||
trap_Trace( &tr, ent->s.origin, ent->r.mins, ent->r.maxs, dest, ent->s.number, MASK_SOLID );
|
||||
if ( tr.startsolid ) {
|
||||
ent->s.origin[2] -= 1;
|
||||
G_Printf( "SpawnObelisk: %s startsolid at %s\n", ent->classname, vtos(ent->s.origin) );
|
||||
|
||||
ent->s.groundEntityNum = ENTITYNUM_NONE;
|
||||
G_SetOrigin( ent, ent->s.origin );
|
||||
}
|
||||
else {
|
||||
// allow to ride movers
|
||||
ent->s.groundEntityNum = tr.entityNum;
|
||||
G_SetOrigin( ent, tr.endpos );
|
||||
}
|
||||
}
|
||||
|
||||
ent->spawnflags = team;
|
||||
|
||||
trap_LinkEntity( ent );
|
||||
|
||||
return ent;
|
||||
}
|
||||
|
||||
/*QUAKED team_redobelisk (1 0 0) (-16 -16 0) (16 16 8)
|
||||
*/
|
||||
void SP_team_redobelisk( gentity_t *ent ) {
|
||||
gentity_t *obelisk;
|
||||
|
||||
if ( g_gametype.integer <= GT_TEAM ) {
|
||||
G_FreeEntity(ent);
|
||||
return;
|
||||
}
|
||||
ent->s.eType = ET_TEAM;
|
||||
if ( g_gametype.integer == GT_OBELISK ) {
|
||||
obelisk = SpawnObelisk( ent->s.origin, TEAM_RED, ent->spawnflags );
|
||||
obelisk->activator = ent;
|
||||
// initial obelisk health value
|
||||
ent->s.modelindex2 = 0xff;
|
||||
ent->s.frame = 0;
|
||||
}
|
||||
if ( g_gametype.integer == GT_HARVESTER ) {
|
||||
obelisk = SpawnObelisk( ent->s.origin, TEAM_RED, ent->spawnflags );
|
||||
obelisk->activator = ent;
|
||||
}
|
||||
ent->s.modelindex = TEAM_RED;
|
||||
trap_LinkEntity(ent);
|
||||
}
|
||||
|
||||
/*QUAKED team_blueobelisk (0 0 1) (-16 -16 0) (16 16 88)
|
||||
*/
|
||||
void SP_team_blueobelisk( gentity_t *ent ) {
|
||||
gentity_t *obelisk;
|
||||
|
||||
if ( g_gametype.integer <= GT_TEAM ) {
|
||||
G_FreeEntity(ent);
|
||||
return;
|
||||
}
|
||||
ent->s.eType = ET_TEAM;
|
||||
if ( g_gametype.integer == GT_OBELISK ) {
|
||||
obelisk = SpawnObelisk( ent->s.origin, TEAM_BLUE, ent->spawnflags );
|
||||
obelisk->activator = ent;
|
||||
// initial obelisk health value
|
||||
ent->s.modelindex2 = 0xff;
|
||||
ent->s.frame = 0;
|
||||
}
|
||||
if ( g_gametype.integer == GT_HARVESTER ) {
|
||||
obelisk = SpawnObelisk( ent->s.origin, TEAM_BLUE, ent->spawnflags );
|
||||
obelisk->activator = ent;
|
||||
}
|
||||
ent->s.modelindex = TEAM_BLUE;
|
||||
trap_LinkEntity(ent);
|
||||
}
|
||||
|
||||
/*QUAKED team_neutralobelisk (0 0 1) (-16 -16 0) (16 16 88)
|
||||
*/
|
||||
void SP_team_neutralobelisk( gentity_t *ent ) {
|
||||
if ( g_gametype.integer != GT_1FCTF && g_gametype.integer != GT_HARVESTER ) {
|
||||
G_FreeEntity(ent);
|
||||
return;
|
||||
}
|
||||
ent->s.eType = ET_TEAM;
|
||||
if ( g_gametype.integer == GT_HARVESTER) {
|
||||
neutralObelisk = SpawnObelisk( ent->s.origin, TEAM_FREE, ent->spawnflags);
|
||||
neutralObelisk->spawnflags = TEAM_FREE;
|
||||
}
|
||||
ent->s.modelindex = TEAM_FREE;
|
||||
trap_LinkEntity(ent);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
CheckObeliskAttack
|
||||
================
|
||||
*/
|
||||
qboolean CheckObeliskAttack( gentity_t *obelisk, gentity_t *attacker ) {
|
||||
gentity_t *te;
|
||||
|
||||
// if this really is an obelisk
|
||||
if( obelisk->die != ObeliskDie ) {
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
// if the attacker is a client
|
||||
if( !attacker->client ) {
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
// if the obelisk is on the same team as the attacker then don't hurt it
|
||||
if( obelisk->spawnflags == attacker->client->sess.sessionTeam ) {
|
||||
return qtrue;
|
||||
}
|
||||
|
||||
// obelisk may be hurt
|
||||
|
||||
// if not played any sounds recently
|
||||
if ((obelisk->spawnflags == TEAM_RED &&
|
||||
teamgame.redObeliskAttackedTime < level.time - OVERLOAD_ATTACK_BASE_SOUND_TIME) ||
|
||||
(obelisk->spawnflags == TEAM_BLUE &&
|
||||
teamgame.blueObeliskAttackedTime < level.time - OVERLOAD_ATTACK_BASE_SOUND_TIME) ) {
|
||||
|
||||
// tell which obelisk is under attack
|
||||
te = G_TempEntity( obelisk->s.pos.trBase, EV_GLOBAL_TEAM_SOUND );
|
||||
if( obelisk->spawnflags == TEAM_RED ) {
|
||||
te->s.eventParm = GTS_REDOBELISK_ATTACKED;
|
||||
teamgame.redObeliskAttackedTime = level.time;
|
||||
}
|
||||
else {
|
||||
te->s.eventParm = GTS_BLUEOBELISK_ATTACKED;
|
||||
teamgame.blueObeliskAttackedTime = level.time;
|
||||
}
|
||||
te->r.svFlags |= SVF_BROADCAST;
|
||||
}
|
||||
|
||||
return qfalse;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.6 2002/06/16 17:38:00 jbravo
|
||||
// Removed the MISSIONPACK ifdefs and missionpack only code.
|
||||
//
|
||||
// Revision 1.5 2002/04/01 02:56:50 jbravo
|
||||
// Some sourcecode reformatting
|
||||
//
|
||||
|
@ -19,23 +22,6 @@
|
|||
// Copyright (C) 1999-2000 Id Software, Inc.
|
||||
//
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
|
||||
#define CTF_CAPTURE_BONUS 100 // what you get for capture
|
||||
#define CTF_TEAM_BONUS 25 // what your team gets for capture
|
||||
#define CTF_RECOVERY_BONUS 10 // what you get for recovery
|
||||
#define CTF_FLAG_BONUS 10 // what you get for picking up enemy flag
|
||||
#define CTF_FRAG_CARRIER_BONUS 20 // what you get for fragging enemy flag carrier
|
||||
#define CTF_FLAG_RETURN_TIME 40000 // seconds until auto return
|
||||
|
||||
#define CTF_CARRIER_DANGER_PROTECT_BONUS 5 // bonus for fraggin someone who has recently hurt your flag carrier
|
||||
#define CTF_CARRIER_PROTECT_BONUS 2 // bonus for fraggin someone while either you or your target are near your flag carrier
|
||||
#define CTF_FLAG_DEFENSE_BONUS 10 // bonus for fraggin someone while either you or your target are near your flag
|
||||
#define CTF_RETURN_FLAG_ASSIST_BONUS 10 // awarded for returning a flag that causes a capture to happen almost immediately
|
||||
#define CTF_FRAG_CARRIER_ASSIST_BONUS 10 // award for fragging a flag carrier if a capture happens almost immediately
|
||||
|
||||
#else
|
||||
|
||||
#define CTF_CAPTURE_BONUS 5 // what you get for capture
|
||||
#define CTF_TEAM_BONUS 0 // what your team gets for capture
|
||||
#define CTF_RECOVERY_BONUS 1 // what you get for recovery
|
||||
|
@ -49,8 +35,6 @@
|
|||
#define CTF_RETURN_FLAG_ASSIST_BONUS 1 // awarded for returning a flag that causes a capture to happen almost immediately
|
||||
#define CTF_FRAG_CARRIER_ASSIST_BONUS 2 // award for fragging a flag carrier if a capture happens almost immediately
|
||||
|
||||
#endif
|
||||
|
||||
#define CTF_TARGET_PROTECT_RADIUS 1000 // the radius around an object being defended where a target will be worth extra frags
|
||||
#define CTF_ATTACKER_PROTECT_RADIUS 1000 // the radius around an object being defended where an attacker will get extra frags when making kills
|
||||
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.65 2002/06/16 17:38:00 jbravo
|
||||
// Removed the MISSIONPACK ifdefs and missionpack only code.
|
||||
//
|
||||
// Revision 1.64 2002/06/03 00:40:25 blaze
|
||||
// some more breakables fixes(ssg chips)
|
||||
//
|
||||
|
@ -385,11 +388,6 @@ qboolean CheckGauntletAttack( gentity_t *ent ) {
|
|||
} else {
|
||||
s_quadFactor = 1;
|
||||
}
|
||||
#ifdef MISSIONPACK
|
||||
if( ent->client->persistantPowerup && ent->client->persistantPowerup->item && ent->client->persistantPowerup->item->giTag == PW_DOUBLER ) {
|
||||
s_quadFactor *= 2;
|
||||
}
|
||||
#endif
|
||||
|
||||
damage = 50 * s_quadFactor;
|
||||
G_Damage( traceEnt, ent, ent, forward, tr.endpos,
|
||||
|
@ -429,9 +427,6 @@ void SnapVectorTowards( vec3_t v, vec3_t to ) {
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
#define CHAINGUN_SPREAD 600
|
||||
#endif
|
||||
#define MACHINEGUN_SPREAD 200
|
||||
#define MACHINEGUN_DAMAGE 7
|
||||
#define MACHINEGUN_TEAM_DAMAGE 5 // wimpier MG in teamplay
|
||||
|
@ -439,9 +434,6 @@ void SnapVectorTowards( vec3_t v, vec3_t to ) {
|
|||
void Bullet_Fire (gentity_t *ent, float spread, int damage, int MOD ) {
|
||||
trace_t tr;
|
||||
vec3_t end;
|
||||
#ifdef MISSIONPACK
|
||||
vec3_t impactpoint, bouncedir;
|
||||
#endif
|
||||
float r;
|
||||
float u;
|
||||
gentity_t *tent;
|
||||
|
@ -683,9 +675,6 @@ qboolean ShotgunPellet( vec3_t start, vec3_t end, gentity_t *ent ) {
|
|||
trace_t tr;
|
||||
int damage, i, passent;
|
||||
gentity_t *traceEnt;
|
||||
#ifdef MISSIONPACK
|
||||
vec3_t impactpoint, bouncedir;
|
||||
#endif
|
||||
vec3_t tr_start, tr_end;
|
||||
|
||||
passent = ent->s.number;
|
||||
|
@ -714,34 +703,11 @@ qboolean ShotgunPellet( vec3_t start, vec3_t end, gentity_t *ent ) {
|
|||
G_Damage( traceEnt, ent, ent, forward, tr.endpos, damage, 0, MOD_M3);
|
||||
}
|
||||
//damage = DEFAULT_SHOTGUN_DAMAGE; // * s_quadFactor;
|
||||
#ifdef MISSIONPACK
|
||||
if ( traceEnt->client && traceEnt->client->invulnerabilityTime > level.time ) {
|
||||
if (G_InvulnerabilityEffect( traceEnt, forward, tr.endpos, impactpoint, bouncedir )) {
|
||||
G_BounceProjectile( tr_start, impactpoint, bouncedir, tr_end );
|
||||
VectorCopy( impactpoint, tr_start );
|
||||
// the player can hit him/herself with the bounced rail
|
||||
passent = ENTITYNUM_NONE;
|
||||
}
|
||||
else {
|
||||
VectorCopy( tr.endpos, tr_start );
|
||||
passent = traceEnt->s.number;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
G_Damage( traceEnt, ent, ent, forward, tr.endpos,
|
||||
damage, 0, MOD_SHOTGUN);
|
||||
if( LogAccuracyHit( traceEnt, ent ) ) {
|
||||
return qtrue;
|
||||
}
|
||||
}
|
||||
#else
|
||||
//Elder: moved into if conditional above
|
||||
//G_Damage( traceEnt, ent, ent, forward, tr.endpos, damage, 0, MOD_SHOTGUN);
|
||||
if( LogAccuracyHit( traceEnt, ent ) ) {
|
||||
return qtrue;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return qfalse;
|
||||
}
|
||||
|
@ -930,9 +896,6 @@ weapon_railgun_fire
|
|||
#define MAX_RAIL_HITS 4
|
||||
void weapon_railgun_fire (gentity_t *ent) {
|
||||
vec3_t end;
|
||||
#ifdef MISSIONPACK
|
||||
vec3_t impactpoint, bouncedir;
|
||||
#endif
|
||||
trace_t trace;
|
||||
gentity_t *tent;
|
||||
gentity_t *traceEnt;
|
||||
|
@ -958,39 +921,10 @@ void weapon_railgun_fire (gentity_t *ent) {
|
|||
}
|
||||
traceEnt = &g_entities[ trace.entityNum ];
|
||||
if ( traceEnt->takedamage ) {
|
||||
#ifdef MISSIONPACK
|
||||
if ( traceEnt->client && traceEnt->client->invulnerabilityTime > level.time ) {
|
||||
if ( G_InvulnerabilityEffect( traceEnt, forward, trace.endpos, impactpoint, bouncedir ) ) {
|
||||
G_BounceProjectile( muzzle, impactpoint, bouncedir, end );
|
||||
// snap the endpos to integers to save net bandwidth, but nudged towards the line
|
||||
SnapVectorTowards( trace.endpos, muzzle );
|
||||
// send railgun beam effect
|
||||
tent = G_TempEntity( trace.endpos, EV_RAILTRAIL );
|
||||
// set player number for custom colors on the railtrail
|
||||
tent->s.clientNum = ent->s.clientNum;
|
||||
VectorCopy( muzzle, tent->s.origin2 );
|
||||
// move origin a bit to come closer to the drawn gun muzzle
|
||||
VectorMA( tent->s.origin2, 4, right, tent->s.origin2 );
|
||||
VectorMA( tent->s.origin2, -1, up, tent->s.origin2 );
|
||||
tent->s.eventParm = 255; // don't make the explosion at the end
|
||||
//
|
||||
VectorCopy( impactpoint, muzzle );
|
||||
// the player can hit him/herself with the bounced rail
|
||||
passent = ENTITYNUM_NONE;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if( LogAccuracyHit( traceEnt, ent ) ) {
|
||||
hits++;
|
||||
}
|
||||
G_Damage (traceEnt, ent, ent, forward, trace.endpos, damage, 0, MOD_RAILGUN);
|
||||
}
|
||||
#else
|
||||
if( LogAccuracyHit( traceEnt, ent ) ) {
|
||||
hits++;
|
||||
}
|
||||
G_Damage (traceEnt, ent, ent, forward, trace.endpos, damage, 0, MOD_RAILGUN);
|
||||
#endif
|
||||
}
|
||||
if ( trace.contents & CONTENTS_SOLID ) {
|
||||
break; // we hit something solid enough to stop the beam
|
||||
|
@ -1106,9 +1040,6 @@ LIGHTNING GUN
|
|||
void Weapon_LightningFire( gentity_t *ent ) {
|
||||
trace_t tr;
|
||||
vec3_t end;
|
||||
#ifdef MISSIONPACK
|
||||
vec3_t impactpoint, bouncedir;
|
||||
#endif
|
||||
gentity_t *traceEnt, *tent;
|
||||
int damage, i, passent;
|
||||
|
||||
|
@ -1118,20 +1049,7 @@ void Weapon_LightningFire( gentity_t *ent ) {
|
|||
for (i = 0; i < 10; i++) {
|
||||
VectorMA( muzzle, LIGHTNING_RANGE, forward, end );
|
||||
|
||||
trap_Trace( &tr, muzzle, NULL, NULL, end, passent, MASK_SHOT );
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
// if not the first trace (the lightning bounced of an invulnerability sphere)
|
||||
if (i) {
|
||||
// add bounced off lightning bolt temp entity
|
||||
// the first lightning bolt is a cgame only visual
|
||||
//
|
||||
tent = G_TempEntity( muzzle, EV_LIGHTNINGBOLT );
|
||||
VectorCopy( tr.endpos, end );
|
||||
SnapVector( end );
|
||||
VectorCopy( end, tent->s.origin2 );
|
||||
}
|
||||
#endif
|
||||
trap_Trace( &tr, muzzle, NULL, NULL, end, passent, MASK_SHOT );
|
||||
if ( tr.entityNum == ENTITYNUM_NONE ) {
|
||||
return;
|
||||
}
|
||||
|
@ -1139,30 +1057,8 @@ void Weapon_LightningFire( gentity_t *ent ) {
|
|||
traceEnt = &g_entities[ tr.entityNum ];
|
||||
|
||||
if ( traceEnt->takedamage) {
|
||||
#ifdef MISSIONPACK
|
||||
if ( traceEnt->client && traceEnt->client->invulnerabilityTime > level.time ) {
|
||||
if (G_InvulnerabilityEffect( traceEnt, forward, tr.endpos, impactpoint, bouncedir )) {
|
||||
G_BounceProjectile( muzzle, impactpoint, bouncedir, end );
|
||||
VectorCopy( impactpoint, muzzle );
|
||||
VectorSubtract( end, impactpoint, forward );
|
||||
VectorNormalize(forward);
|
||||
// the player can hit him/herself with the bounced lightning
|
||||
passent = ENTITYNUM_NONE;
|
||||
}
|
||||
else {
|
||||
VectorCopy( tr.endpos, muzzle );
|
||||
passent = traceEnt->s.number;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
G_Damage( traceEnt, ent, ent, forward, tr.endpos,
|
||||
G_Damage( traceEnt, ent, ent, forward, tr.endpos,
|
||||
damage, 0, MOD_LIGHTNING);
|
||||
}
|
||||
#else
|
||||
G_Damage( traceEnt, ent, ent, forward, tr.endpos,
|
||||
damage, 0, MOD_LIGHTNING);
|
||||
#endif
|
||||
}
|
||||
|
||||
if ( traceEnt->takedamage && traceEnt->client ) {
|
||||
|
@ -1182,53 +1078,6 @@ void Weapon_LightningFire( gentity_t *ent ) {
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
/*
|
||||
======================================================================
|
||||
|
||||
NAILGUN
|
||||
|
||||
======================================================================
|
||||
*/
|
||||
|
||||
void Weapon_Nailgun_Fire (gentity_t *ent) {
|
||||
gentity_t *m;
|
||||
int count;
|
||||
|
||||
for( count = 0; count < NUM_NAILSHOTS; count++ ) {
|
||||
m = fire_nail (ent, muzzle, forward, right, up );
|
||||
m->damage *= s_quadFactor;
|
||||
m->splashDamage *= s_quadFactor;
|
||||
}
|
||||
|
||||
// VectorAdd( m->s.pos.trDelta, ent->client->ps.velocity, m->s.pos.trDelta ); // "real" physics
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
======================================================================
|
||||
|
||||
PROXIMITY MINE LAUNCHER
|
||||
|
||||
======================================================================
|
||||
*/
|
||||
|
||||
void weapon_proxlauncher_fire (gentity_t *ent) {
|
||||
gentity_t *m;
|
||||
|
||||
// extra vertical velocity
|
||||
forward[2] += 0.2f;
|
||||
VectorNormalize( forward );
|
||||
|
||||
m = fire_prox (ent, muzzle, forward);
|
||||
m->damage *= s_quadFactor;
|
||||
m->splashDamage *= s_quadFactor;
|
||||
|
||||
// VectorAdd( m->s.pos.trDelta, ent->client->ps.velocity, m->s.pos.trDelta ); // "real" physics
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
========================================================================
|
||||
|
||||
|
@ -2198,24 +2047,11 @@ void FireWeapon( gentity_t *ent ) {
|
|||
//Elder: uncommented so it won't be zero!
|
||||
s_quadFactor = 1;
|
||||
//}
|
||||
#ifdef MISSIONPACK
|
||||
if( ent->client->persistantPowerup && ent->client->persistantPowerup->item && ent->client->persistantPowerup->item->giTag == PW_DOUBLER ) {
|
||||
s_quadFactor *= 2;
|
||||
}
|
||||
#endif
|
||||
|
||||
// track shots taken for accuracy tracking. Grapple is not a weapon and gauntet is just not tracked
|
||||
//Blaze: dont record accuracy for knife
|
||||
// if( ent->s.weapon != WP_KNIFE) {
|
||||
#ifdef MISSIONPACK
|
||||
if( ent->s.weapon == WP_NAILGUN ) {
|
||||
ent->client->accuracy_shots += NUM_NAILSHOTS;
|
||||
} else {
|
||||
ent->client->accuracy_shots++;
|
||||
}
|
||||
#else
|
||||
ent->client->accuracy_shots++;
|
||||
#endif
|
||||
ent->client->accuracy_shots++;
|
||||
// }
|
||||
|
||||
// set aiming directions
|
||||
|
@ -2263,275 +2099,12 @@ void FireWeapon( gentity_t *ent ) {
|
|||
Weapon_Akimbo_Fire ( ent );
|
||||
//ent->client->akimboShots++;
|
||||
break;
|
||||
#ifdef MISSIONPACK
|
||||
case WP_NAILGUN:
|
||||
Weapon_Nailgun_Fire( ent );
|
||||
break;
|
||||
case WP_PROX_LAUNCHER:
|
||||
weapon_proxlauncher_fire( ent );
|
||||
break;
|
||||
case WP_CHAINGUN:
|
||||
Bullet_Fire( ent, CHAINGUN_SPREAD, MACHINEGUN_DAMAGE );
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
// FIXME G_Error( "Bad ent->s.weapon" );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
|
||||
/*
|
||||
===============
|
||||
KamikazeRadiusDamage
|
||||
===============
|
||||
*/
|
||||
static void KamikazeRadiusDamage( vec3_t origin, gentity_t *attacker, float damage, float radius ) {
|
||||
float dist;
|
||||
gentity_t *ent;
|
||||
int entityList[MAX_GENTITIES];
|
||||
int numListedEntities;
|
||||
vec3_t mins, maxs;
|
||||
vec3_t v;
|
||||
vec3_t dir;
|
||||
int i, e;
|
||||
|
||||
if ( radius < 1 ) {
|
||||
radius = 1;
|
||||
}
|
||||
|
||||
for ( i = 0 ; i < 3 ; i++ ) {
|
||||
mins[i] = origin[i] - radius;
|
||||
maxs[i] = origin[i] + radius;
|
||||
}
|
||||
|
||||
numListedEntities = trap_EntitiesInBox( mins, maxs, entityList, MAX_GENTITIES );
|
||||
|
||||
for ( e = 0 ; e < numListedEntities ; e++ ) {
|
||||
ent = &g_entities[entityList[ e ]];
|
||||
|
||||
if (!ent->takedamage) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// dont hit things we have already hit
|
||||
if( ent->kamikazeTime > level.time ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// find the distance from the edge of the bounding box
|
||||
for ( i = 0 ; i < 3 ; i++ ) {
|
||||
if ( origin[i] < ent->r.absmin[i] ) {
|
||||
v[i] = ent->r.absmin[i] - origin[i];
|
||||
} else if ( origin[i] > ent->r.absmax[i] ) {
|
||||
v[i] = origin[i] - ent->r.absmax[i];
|
||||
} else {
|
||||
v[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
dist = VectorLength( v );
|
||||
if ( dist >= radius ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// if( CanDamage (ent, origin) ) {
|
||||
VectorSubtract (ent->r.currentOrigin, origin, dir);
|
||||
// push the center of mass higher than the origin so players
|
||||
// get knocked into the air more
|
||||
dir[2] += 24;
|
||||
G_Damage( ent, NULL, attacker, dir, origin, damage, DAMAGE_RADIUS|DAMAGE_NO_TEAM_PROTECTION, MOD_KAMIKAZE );
|
||||
ent->kamikazeTime = level.time + 3000;
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
KamikazeShockWave
|
||||
===============
|
||||
*/
|
||||
static void KamikazeShockWave( vec3_t origin, gentity_t *attacker, float damage, float push, float radius ) {
|
||||
float dist;
|
||||
gentity_t *ent;
|
||||
int entityList[MAX_GENTITIES];
|
||||
int numListedEntities;
|
||||
vec3_t mins, maxs;
|
||||
vec3_t v;
|
||||
vec3_t dir;
|
||||
int i, e;
|
||||
|
||||
if ( radius < 1 )
|
||||
radius = 1;
|
||||
|
||||
for ( i = 0 ; i < 3 ; i++ ) {
|
||||
mins[i] = origin[i] - radius;
|
||||
maxs[i] = origin[i] + radius;
|
||||
}
|
||||
|
||||
numListedEntities = trap_EntitiesInBox( mins, maxs, entityList, MAX_GENTITIES );
|
||||
|
||||
for ( e = 0 ; e < numListedEntities ; e++ ) {
|
||||
ent = &g_entities[entityList[ e ]];
|
||||
|
||||
// dont hit things we have already hit
|
||||
if( ent->kamikazeShockTime > level.time ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// find the distance from the edge of the bounding box
|
||||
for ( i = 0 ; i < 3 ; i++ ) {
|
||||
if ( origin[i] < ent->r.absmin[i] ) {
|
||||
v[i] = ent->r.absmin[i] - origin[i];
|
||||
} else if ( origin[i] > ent->r.absmax[i] ) {
|
||||
v[i] = origin[i] - ent->r.absmax[i];
|
||||
} else {
|
||||
v[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
dist = VectorLength( v );
|
||||
if ( dist >= radius ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// if( CanDamage (ent, origin) ) {
|
||||
VectorSubtract (ent->r.currentOrigin, origin, dir);
|
||||
dir[2] += 24;
|
||||
G_Damage( ent, NULL, attacker, dir, origin, damage, DAMAGE_RADIUS|DAMAGE_NO_TEAM_PROTECTION, MOD_KAMIKAZE );
|
||||
//
|
||||
dir[2] = 0;
|
||||
VectorNormalize(dir);
|
||||
if ( ent->client ) {
|
||||
ent->client->ps.velocity[0] = dir[0] * push;
|
||||
ent->client->ps.velocity[1] = dir[1] * push;
|
||||
ent->client->ps.velocity[2] = 100;
|
||||
}
|
||||
ent->kamikazeShockTime = level.time + 3000;
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
KamikazeDamage
|
||||
===============
|
||||
*/
|
||||
static void KamikazeDamage( gentity_t *self ) {
|
||||
int i;
|
||||
float t;
|
||||
gentity_t *ent;
|
||||
vec3_t newangles;
|
||||
|
||||
self->count += 100;
|
||||
|
||||
if (self->count >= KAMI_SHOCKWAVE_STARTTIME) {
|
||||
// shockwave push back
|
||||
t = self->count - KAMI_SHOCKWAVE_STARTTIME;
|
||||
KamikazeShockWave(self->s.pos.trBase, self->activator, 25, 400, (int) (float) t * KAMI_SHOCKWAVE_MAXRADIUS / (KAMI_SHOCKWAVE_ENDTIME - KAMI_SHOCKWAVE_STARTTIME) );
|
||||
}
|
||||
//
|
||||
if (self->count >= KAMI_EXPLODE_STARTTIME) {
|
||||
// do our damage
|
||||
t = self->count - KAMI_EXPLODE_STARTTIME;
|
||||
KamikazeRadiusDamage( self->s.pos.trBase, self->activator, 400, (int) (float) t * KAMI_BOOMSPHERE_MAXRADIUS / (KAMI_IMPLODE_STARTTIME - KAMI_EXPLODE_STARTTIME) );
|
||||
}
|
||||
|
||||
// either cycle or kill self
|
||||
if( self->count >= KAMI_SHOCKWAVE_ENDTIME ) {
|
||||
G_FreeEntity( self );
|
||||
return;
|
||||
}
|
||||
self->nextthink = level.time + 100;
|
||||
|
||||
// add earth quake effect
|
||||
newangles[0] = crandom() * 2;
|
||||
newangles[1] = crandom() * 2;
|
||||
newangles[2] = 0;
|
||||
for (i = 0; i < MAX_CLIENTS; i++)
|
||||
{
|
||||
ent = &g_entities[i];
|
||||
if (!ent->inuse)
|
||||
continue;
|
||||
if (!ent->client)
|
||||
continue;
|
||||
|
||||
if (ent->client->ps.groundEntityNum != ENTITYNUM_NONE) {
|
||||
ent->client->ps.velocity[0] += crandom() * 120;
|
||||
ent->client->ps.velocity[1] += crandom() * 120;
|
||||
ent->client->ps.velocity[2] = 30 + random() * 25;
|
||||
}
|
||||
|
||||
ent->client->ps.delta_angles[0] += ANGLE2SHORT(newangles[0] - self->movedir[0]);
|
||||
ent->client->ps.delta_angles[1] += ANGLE2SHORT(newangles[1] - self->movedir[1]);
|
||||
ent->client->ps.delta_angles[2] += ANGLE2SHORT(newangles[2] - self->movedir[2]);
|
||||
}
|
||||
VectorCopy(newangles, self->movedir);
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
G_StartKamikaze
|
||||
===============
|
||||
*/
|
||||
void G_StartKamikaze( gentity_t *ent ) {
|
||||
gentity_t *explosion;
|
||||
gentity_t *te;
|
||||
vec3_t snapped;
|
||||
|
||||
// start up the explosion logic
|
||||
explosion = G_Spawn();
|
||||
|
||||
explosion->s.eType = ET_EVENTS + EV_KAMIKAZE;
|
||||
explosion->eventTime = level.time;
|
||||
|
||||
if ( ent->client ) {
|
||||
VectorCopy( ent->s.pos.trBase, snapped );
|
||||
}
|
||||
else {
|
||||
VectorCopy( ent->activator->s.pos.trBase, snapped );
|
||||
}
|
||||
SnapVector( snapped ); // save network bandwidth
|
||||
G_SetOrigin( explosion, snapped );
|
||||
|
||||
explosion->classname = "kamikaze";
|
||||
explosion->s.pos.trType = TR_STATIONARY;
|
||||
|
||||
explosion->kamikazeTime = level.time;
|
||||
|
||||
explosion->think = KamikazeDamage;
|
||||
explosion->nextthink = level.time + 100;
|
||||
explosion->count = 0;
|
||||
VectorClear(explosion->movedir);
|
||||
|
||||
trap_LinkEntity( explosion );
|
||||
|
||||
if (ent->client) {
|
||||
//
|
||||
explosion->activator = ent;
|
||||
|
||||
// nuke the guy that used it
|
||||
G_Damage( ent, ent, ent, NULL, NULL, 100000, DAMAGE_NO_PROTECTION, MOD_KAMIKAZE );
|
||||
}
|
||||
else {
|
||||
if ( !strcmp(ent->activator->classname, "bodyque") ) {
|
||||
explosion->activator = &g_entities[ent->activator->r.ownerNum];
|
||||
}
|
||||
else {
|
||||
explosion->activator = ent->activator;
|
||||
}
|
||||
}
|
||||
|
||||
// play global sound at all clients
|
||||
te = G_TempEntity(snapped, EV_GLOBAL_TEAM_SOUND );
|
||||
te->r.svFlags |= SVF_BROADCAST;
|
||||
te->s.eventParm = GTS_KAMIKAZE;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
============
|
||||
Laser Sight Stuff
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.11 2002/06/16 17:38:00 jbravo
|
||||
// Removed the MISSIONPACK ifdefs and missionpack only code.
|
||||
//
|
||||
// Revision 1.10 2002/05/10 13:21:53 makro
|
||||
// Mainly bot stuff. Also fixed a couple of crash bugs
|
||||
//
|
||||
|
@ -118,13 +121,6 @@
|
|||
#define NUM_VISIBLE_ENEMIES 202
|
||||
#define NUM_VISIBLE_TEAMMATES 203
|
||||
|
||||
// if running the mission pack
|
||||
#ifdef MISSIONPACK
|
||||
|
||||
//#error "running mission pack"
|
||||
|
||||
#endif
|
||||
|
||||
//item numbers (make sure they are in sync with bg_itemlist in bg_misc.c)
|
||||
#define MODELINDEX_KNIFE 1
|
||||
#define MODELINDEX_PISTOL 2
|
||||
|
|
Loading…
Reference in a new issue