From 4704f88ad62ce9668f1c6df421369c39dd61629d Mon Sep 17 00:00:00 2001 From: driAn Date: Fri, 17 Nov 2006 23:25:22 +0000 Subject: [PATCH] no message git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@708 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/bot/ac_bot.cpp | 55 ++------------------------------- source/src/bot/bot_waypoint.cpp | 3 +- source/src/bot/botmanager.cpp | 1 + source/src/clientgame.cpp | 8 +++-- source/src/cube.h | 3 ++ source/src/physics.cpp | 2 +- source/src/weapon.cpp | 2 -- 7 files changed, 15 insertions(+), 59 deletions(-) diff --git a/source/src/bot/ac_bot.cpp b/source/src/bot/ac_bot.cpp index fb5bbf58..f16f4f93 100644 --- a/source/src/bot/ac_bot.cpp +++ b/source/src/bot/ac_bot.cpp @@ -23,65 +23,14 @@ extern void spawnstate(playerent *d); void CACBot::Spawn() { - // Init all bot variabeles - m_pMyEnt->primary = m_pMyEnt->nextprimary = 2 + rnd(4); - + // Init all bot variabeles spawnplayer(m_pMyEnt); m_pMyEnt->primary = m_pMyEnt->nextprimary = 2 + rnd(4); m_pMyEnt->targetyaw = m_pMyEnt->targetpitch = 0.0f; equip(this->m_pMyEnt); - m_pMyEnt->armour = 50; + m_pMyEnt->armour = 0; m_pMyEnt->pBot = this; - - /* UNDONE - m_pMyEnt->ammo[GUN_FIST] = 1; - if(m_noitems) - { - m_pMyEnt->gunselect = GUN_RIFLE; - m_pMyEnt->armour = 0; - if(m_noitemsrail) - { - m_pMyEnt->health = 1; - m_pMyEnt->ammo[GUN_RIFLE] = 100; - } - else - { - if(gamemode==12) // eihrul's secret "instafist" mode - { - m_pMyEnt->gunselect = GUN_FIST; - } - else - { - m_pMyEnt->health = 256; - if(m_tarena) - { - int gun1 = rnd(4)+1; - baseammo(m_pMyEnt->gunselect = gun1, m_pMyEnt); - for(;;) - { - int gun2 = rnd(4)+1; - if(gun1!=gun2) { baseammo(gun2, m_pMyEnt); break; }; - } - } - else if(m_arena) // insta arena - { - m_pMyEnt->ammo[GUN_RIFLE] = 100; - } - else // efficiency - { - loopi(4) baseammo(i+1, m_pMyEnt); - m_pMyEnt->gunselect = GUN_CG; - } - m_pMyEnt->ammo[GUN_CG] /= 2; - } - } - } - else - { - m_pMyEnt->ammo[GUN_SEMIPISTOL] = 5; - SelectGun(GUN_SG); - }*/ SelectGun(m_pMyEnt->primary); diff --git a/source/src/bot/bot_waypoint.cpp b/source/src/bot/bot_waypoint.cpp index ff0251f6..9e93fd4a 100644 --- a/source/src/bot/bot_waypoint.cpp +++ b/source/src/bot/bot_waypoint.cpp @@ -17,8 +17,9 @@ CACWaypointClass WaypointClass; CCubeWaypointClass WaypointClass; #endif +VAR(xhairwpsel, 0, 1, 1); extern block sel; -#define curselection vec(sel.x, sel.y, S(sel.x, sel.y)->floor+2.0f) +#define curselection (xhairwpsel ? vec(sel.x, sel.y, S(sel.x, sel.y)->floor+2.0f) : vec(player1->o.x, player1->o.y, player1->o.z)) // Waypoint class begin diff --git a/source/src/bot/botmanager.cpp b/source/src/bot/botmanager.cpp index 8d66ad25..6c3dc9cf 100644 --- a/source/src/bot/botmanager.cpp +++ b/source/src/bot/botmanager.cpp @@ -902,6 +902,7 @@ botent *CBotManager::CreateBot(const char *team, const char *skill, const char * botent *m = newbotent(); if (!m) return NULL; loopi(NUMGUNS) m->ammo[i] = m->mag[i] = 0; + m->skin = rnd(10); //fixme // Create new bot class, dependand on the current mod #if defined VANILLA_CUBE m->pBot = new CCubeBot; diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index a601a237..4f7a79a5 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -421,7 +421,8 @@ void mousemove(int dx, int dy) void selfdamage(int damage, int actor, playerent *act, bool gib, playerent *pl) { - if(!act) return; + + if(!act) return; if(pl->state!=CS_ALIVE || editmode || intermission) return; if(pl==player1) { @@ -429,7 +430,7 @@ void selfdamage(int damage, int actor, playerent *act, bool gib, playerent *pl) demoblend(damage); }; int ad = damage*30/100; // let armour absorb when possible - if(ad>pl->armour) ad = player1->armour; + if(ad>pl->armour) ad = pl->armour; pl->armour -= ad; damage -= ad; float droll = damage/0.5f; @@ -498,6 +499,9 @@ void selfdamage(int damage, int actor, playerent *act, bool gib, playerent *pl) { playsound(S_PAIN6, pl!=player1 ? &pl->o : NULL); }; + //fixme + conoutf("dmg %i / hp %i / kv %i", damage, pl->health, pl->armour); + }; void timeupdate(int timeremain) diff --git a/source/src/cube.h b/source/src/cube.h index 1c5bcdb8..c99fd83d 100644 --- a/source/src/cube.h +++ b/source/src/cube.h @@ -14,6 +14,9 @@ #endif #include +#ifdef WIN32 + #define strcasecmp(a,b) _stricmp(a,b) +#endif #include #include #include diff --git a/source/src/physics.cpp b/source/src/physics.cpp index dd909499..4ca79647 100644 --- a/source/src/physics.cpp +++ b/source/src/physics.cpp @@ -192,7 +192,7 @@ void moveplayer(physent *pl, int moveres, bool local, int curtime) const float speed = curtime/(water ? 2000.0f : 1000.0f)*pl->maxspeed; const float friction = water ? 20.0f : (pl->onfloor || floating ? 6.0f : (pl->onladder ? 1.5f : 30.0f)); - const float fpsfric = friction/curtime*20.0f; + const float fpsfric = friction/curtime*20.0f; pl->vel.mul(fpsfric-1); // slowly apply friction and direction to velocity, gives a smooth movement pl->vel.add(d); diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index 3fe7e901..d6b68f1f 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -444,8 +444,6 @@ void shootv(int gun, vec &from, vec &to, playerent *d, bool local, int nademilli { if(d!=player1) { - /*int nademillis = nadetimer/100*nadepercent; - if(nademillis<0 || nademillis>100) nademillis = 100;*/ bounceent *p = new_nade(d, nademillis); throw_nade(d, to, p); }