*** empty log message ***

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@699 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lee Salzman
2006-11-17 18:35:20 +00:00
parent 4b8d32b733
commit 5ec9426088
15 changed files with 66 additions and 110 deletions
+1 -1
View File
@@ -10,7 +10,7 @@
//
//
#include "../cube.h"
#include "bot.h"
#ifdef AC_CUBE
+1 -1
View File
@@ -9,7 +9,7 @@
#include "../cube.h"
#include "bot.h"
#ifdef AC_CUBE
+1 -1
View File
@@ -10,7 +10,7 @@
//
//
#include "../cube.h"
#include "bot.h"
vector<botent *> bots;
+1
View File
@@ -42,6 +42,7 @@
#ifndef BOT_H
#define BOT_H
#include "../cube.h"
//#define RELEASE_BUILD // Set when you want to make a release build
+1 -1
View File
@@ -10,7 +10,7 @@
// Code of CBot - Start
#include "../cube.h"
#include "bot.h"
extern vector<server_entity> sents;
extern vector<dynent*> monsters;
+1 -1
View File
@@ -10,7 +10,7 @@
//
//
#include "../cube.h"
#include "bot.h"
// Function code by PMB - Begin
+1 -2
View File
@@ -7,7 +7,7 @@
// Author: Rick <[email protected]>
//
#include "../cube.h"
#include "bot.h"
vec v_debuggoal = g_vecZero;
@@ -758,7 +758,6 @@ void CWaypointClass::DrawNearWaypoints()
}
}
extern bool intermission;
if (intermission) return;
/*for(int i=0;i<MAX_STORED_LOCATIONS;i++)
+42 -77
View File
@@ -10,7 +10,7 @@
//
//
#include "../cube.h"
#include "bot.h"
#ifndef VANILLA_CUBE // UNDONE
bool dedserv = false;
@@ -37,9 +37,6 @@ void CBotManager::Init()
{
m_pBotToView = NULL;
if (!ishost())
return;
m_bBotsShoot = true;
m_bIdleBots = false;
m_iFrameTime = 0;
@@ -64,9 +61,6 @@ void CBotManager::Think()
if (m_pBotToView)
ViewBot();
if (!ishost())
return;
AddDebugText("m_sMaxAStarBots: %d", m_sMaxAStarBots);
AddDebugText("m_sCurrentTriggerNr: %d", m_sCurrentTriggerNr);
short x, y;
@@ -117,9 +111,6 @@ void CBotManager::Think()
void CBotManager::LoadBotNamesFile()
{
if (!ishost())
return;
// Init bot names array first
for (int i=0;i<100;i++)
strcpy(m_szBotNames[i], "Bot");
@@ -223,9 +214,6 @@ char *CBotManager::GetBotName()
void CBotManager::LoadBotTeamsFile()
{
if (!ishost())
return;
// Init bot teams array first
for (int i=0;i<20;i++)
strcpy(m_szBotTeams[i], "b0ts");
@@ -340,20 +328,18 @@ void CBotManager::EndMap()
if (!bots[i])
continue;
if (ishost()) // Store bots so they can be re-added after map change
// Store bots so they can be re-added after map change
if (bots[i]->pBot && bots[i]->name[0] && bots[i]->team[0])
{
if (bots[i]->pBot && bots[i]->name[0] && bots[i]->team[0])
{
CStoredBot *pStoredBot = new CStoredBot(bots[i]->name, bots[i]->team,
bots[i]->pBot->m_sSkillNr);
m_StoredBots.AddNode(pStoredBot);
}
delete bots[i]->pBot;
}
CStoredBot *pStoredBot = new CStoredBot(bots[i]->name, bots[i]->team,
bots[i]->pBot->m_sSkillNr);
m_StoredBots.AddNode(pStoredBot);
};
delete bots[i]->pBot;
bots[i]->pBot = NULL;
freebotent(bots[i]);
}
};
bots.setsize(0);
condebug("Cleared all bots");
m_fReAddBotDelay = lastmillis + 7500;
@@ -364,8 +350,6 @@ void CBotManager::BeginMap(char *szMapName)
{
EndMap(); // End previous map
if (!ishost()) return;
WaypointClass.Init();
WaypointClass.SetMapName(szMapName);
if (!WaypointClass.LoadWaypoints())
@@ -863,8 +847,6 @@ void CBotManager::CalculateMaxAStarCount()
void CBotManager::PickNextTrigger()
{
if (!ishost()) return;
short lowest = -1;
bool found0 = false; // True if found a trigger with nr 0
@@ -990,18 +972,15 @@ bool botmode()
void addbot(char *arg1, char *arg2, char *arg3)
{
if(!botmode()) return;
if (ishost())
{
conoutf("Creating bot...\n");
botent *b = BotManager.CreateBot(arg1, arg2, arg3);
if (b)
conoutf("connected: %s", b->name);
else
{
conoutf("Error: Couldn't create bot!");
return;
}
}
conoutf("Creating bot...\n");
botent *b = BotManager.CreateBot(arg1, arg2, arg3);
if (b)
conoutf("connected: %s", b->name);
else
{
conoutf("Error: Couldn't create bot!");
return;
}
}
COMMAND(addbot, ARG_3STR);
@@ -1013,13 +992,10 @@ void addnbot(char *arg1, char *arg2, char *arg3)
int i = atoi(arg1);
if (ishost())
while(i > 0)
{
while(i > 0)
{
addbot(arg2, arg3, NULL);
i--;
}
addbot(arg2, arg3, NULL);
i--;
}
}
@@ -1027,7 +1003,6 @@ COMMAND(addnbot, ARG_3STR);
void botsshoot(int Shoot)
{
if (!ishost()) return;
if (Shoot)
{
BotManager.SetBotsShoot(true);
@@ -1044,7 +1019,6 @@ COMMAND(botsshoot, ARG_1INT);
void idlebots(int Idle)
{
if (!ishost()) return;
if (Idle)
{
BotManager.SetIdleBots(true);
@@ -1091,14 +1065,11 @@ void kickbot(const char *szName)
if (iBotInd != -1)
{
if (ishost())
{
botent *d = bots[iBotInd];
if(d->name[0]) conoutf("bot %s disconnected", d->name);
delete d->pBot;
bots.remove(iBotInd);
freebotent(d);
}
botent *d = bots[iBotInd];
if(d->name[0]) conoutf("bot %s disconnected", d->name);
delete d->pBot;
bots.remove(iBotInd);
freebotent(d);
}
}
@@ -1110,12 +1081,9 @@ void kickallbots(void)
{
if (bots[i])
{
if (ishost())
{
if(bots[i]->name[0]) conoutf("bot %s disconnected", bots[i]->name);
delete bots[i]->pBot;
freebotent(bots[i]);
}
if(bots[i]->name[0]) conoutf("bot %s disconnected", bots[i]->name);
delete bots[i]->pBot;
freebotent(bots[i]);
}
}
@@ -1180,22 +1148,19 @@ void botskill(char *bot, char *skill)
return;
}
if (ishost())
{
if (bot)
{
loopv(bots)
{
if (bots[i] && !strcmp(bots[i]->name, bot))
{
BotManager.ChangeBotSkill(SkillNr, bots[i]);
break;
}
}
}
else
BotManager.ChangeBotSkill(SkillNr);
}
if (bot)
{
loopv(bots)
{
if (bots[i] && !strcmp(bots[i]->name, bot))
{
BotManager.ChangeBotSkill(SkillNr, bots[i]);
break;
}
}
}
else
BotManager.ChangeBotSkill(SkillNr);
}
COMMAND(botskill, ARG_2STR);
+5 -4
View File
@@ -1,6 +1,8 @@
// clientgame.cpp: core game related stuff
#include "cube.h"
#include "bot/bot.h"
int nextmode = 0; // nextmode becomes gamemode after next map load
VAR(gamemode, 1, 0, 0);
@@ -8,8 +10,7 @@ flaginfo flaginfos[2];
void mode(int n)
{
if((n>=7 && n<=8) && clienthost) conoutf("this mode is for singleplayer only");
else addmsg(SV_GAMEMODE, "ri", nextmode = n);
if(!m_botmode || !multiplayer()) addmsg(SV_GAMEMODE, "ri", nextmode = n);
};
COMMAND(mode, ARG_1INT);
@@ -145,7 +146,7 @@ void arenarespawn()
conoutf("new round starting... fight!");
respawnself();
// Added by Rick: Let all bots respawn if were the host
if (ishost()) BotManager.RespawnBots();
if (m_botmode) BotManager.RespawnBots();
//End add by Rick
clearbounceents();
};
@@ -255,7 +256,7 @@ void updateworld(int curtime, int lastmillis) // main game update loop
//monsterthink();
// Added by Rick: let bots think
BotManager.Think();
if(m_botmode) BotManager.Think();
//put game mode extra call here
if(player1->state==CS_DEAD)
-5
View File
@@ -167,11 +167,6 @@ void parsemessages(int cn, playerent *d, ucharbuf &p)
c2sinit = false; // send new players my info again
conoutf("connected: %s", &text);
gun_changed = true;
// Added by Rick: If we are the host("the bot owner"), tell the bots
// to update their stats
if (ishost())
BotManager.LetBotsUpdateStats();
// End add by Rick
};
s_strncpy(d->name, text, MAXNAMELEN+1);
getstring(text, p);
+6 -14
View File
@@ -1,3 +1,6 @@
#ifndef __CUBE_H__
#define __CUBE_H__
/// one big bad include file for the whole engine... nasty!
#ifdef __GNUC__
@@ -109,25 +112,14 @@ extern int curtime; // current frame time
extern int gamemode, nextmode;
extern int xtraverts;
extern bool demoplayback;
extern bool intermission;
#define VIRTW 2400 // virtual screen size for text & HUD
#define VIRTH 1800
#define FONTH 64
#define PIXELTAB (VIRTW/12)
// Added by Rick
extern ENetHost *clienthost;
inline bool ishost(void) { return !clienthost; };
void splaysound(int n, vec *loc=0);
void addteamscore(playerent *d);
void renderscore(playerent *d);
extern void conoutf(const char *s, ...); // Moved from protos.h
extern void particle_trail(int type, int fade, vec &from, vec &to); // Moved from protos.h
extern bool listenserv;
extern bool intermission;
#include "bot/bot.h"
// End add by Rick
#include "protos.h" // external function decls
#endif
+2 -2
View File
@@ -23,6 +23,7 @@ extern void renderconsole();
extern char *getcurcommand();
extern char *addreleaseaction(char *s);
extern void writebinds(FILE *f);
extern void conoutf(const char *s, ...);
// menus
extern bool rendermenu();
@@ -194,8 +195,7 @@ extern void loadingscreen();
// renderparticles
extern void particle_splash(int type, int num, int fade, vec &p);
//extern void particle_splash(int num, int fade, vec &p);
// extern void particle_trail(int type, int fade, vec &from, vec &to); Moved to cube.h by Rick
extern void particle_trail(int type, int fade, vec &from, vec &to);
extern void render_particles(int time);
// worldio
+1
View File
@@ -1,6 +1,7 @@
// rendergl.cpp: core opengl rendering stuff
#include "cube.h"
#include "bot/bot.h"
#ifdef __APPLE__
#define GL_COMBINE_EXT GL_COMBINE_ARB
+1
View File
@@ -1,6 +1,7 @@
// weapon.cpp: all shooting and effects code
#include "cube.h"
#include "bot/bot.h"
struct guninfo { short sound, reload, reloadtime, attackdelay, damage, projspeed, part, spread, recoil, magsize, mdl_kick_rot, mdl_kick_back; bool isauto; char *name; };
+2 -1
View File
@@ -1,6 +1,7 @@
// world.cpp: core map management stuff
#include "cube.h"
#include "bot/bot.h"
extern char *entnames[]; // lookup from map entities above to strings
@@ -44,7 +45,7 @@ void settagareas() // set for playing
{
settag(0, 1);
loopv(ents) if(ents[i].type==CARROT) setspawn(i, true);
if(ishost()) BotManager.PickNextTrigger();
if(m_botmode) BotManager.PickNextTrigger();
};
// End mod