diff --git a/actioncube.bat b/actioncube.bat index 43f89f23..2456cb63 100755 --- a/actioncube.bat +++ b/actioncube.bat @@ -1,2 +1,2 @@ -bin_win32\ac_client.exe -w1280 -h1024 %1 %2 %3 %4 %5 +bin_win32\ac_client.exe -w1280 -h1024 &* pause \ No newline at end of file diff --git a/config/menus.cfg b/config/menus.cfg index f0678fc0..e616844b 100755 --- a/config/menus.cfg +++ b/config/menus.cfg @@ -5,7 +5,7 @@ bind ESCAPE "showmenu main" // it all starts here newmenu main menuitem "Multiplayer" "showmenu multiplayer" -menuitem "Bots" "showmenu bots" +menuitem "Singleplayer" "showmenu singleplayer" menuitem "Team/Player Setup" "showmenu setup" menuitem "Load Map" "showmenu maps" menuitem "Options" "showmenu options" @@ -13,6 +13,7 @@ menuitem "Editing" "showmenu editing" menuitem "About/Credits/Help" "showmenu about" menuitem "Quit" "quit" + // menumdl path frame range rotation-speed{0..100} scale{0..100} // chmenumdl menuname newpath @@ -43,7 +44,7 @@ genmapitems "ac_mines ac_depot" newmenu setup menuitem "Select Team" "showmenu team" -menuitem "Select Skins" "showmenu skins" +menuitem "Select Skins" "showmenu skins" menuitem "Select Weapon" "showmenu weapons" menuitem "Set Name" "saycommand /name" @@ -100,33 +101,36 @@ menuitem "Deathmatch Arena (LMS)" "mode 3; showmenu maps" alias tmp_botskill good alias tmp_numbots 1 +alias tmp_mode alias tmp_botmap alias startbotmatch [ kickallbots - addnbot $tmp_numbots RVSF $tmp_botskill + addnbot (div $tmp_numbots 2) RVSF $tmp_botskill + addnbot (div $tmp_numbots 2) CLA $tmp_botskill ] alias startbotmap [ disconnect - mode 7 echo starting botmatch.. sleep 5000 startbotmatch + mode $tmp_mode map $tmp_botmap ] -newmenu bots - -menuitem "Start Botmatch" "showmenu botskill" +newmenu singleplayer +menuitem "Bot Team Deathmatch" "alias tmp_mode 7; showmenu botskill" +menuitem "Bot Deathmatch" "alias tmp_mode 8; showmenu botskill" newmenu botskill -menuitem "best" "alias tmp_botskill best; showmenu enemies" -menuitem "good (default)" "alias tmp_botskill good; showmenu enemies" -menuitem "medium" "alias tmp_botskill medium; showmenu enemies" -menuitem "worse" "alias tmp_botskill worse; showmenu enemies" -menuitem "bad" "alias tmp_botskill bad; showmenu enemies" +alias showmenu_enemies [ if (= $tmp_mode 8) [ showmenu enemies ] [ showmenu "team enemies" ] ] +menuitem "best" "alias tmp_botskill best; showmenu_enemies" +menuitem "good (default)" "alias tmp_botskill good; showmenu_enemies" +menuitem "medium" "alias tmp_botskill medium; showmenu_enemies" +menuitem "worse" "alias tmp_botskill worse; showmenu_enemies" +menuitem "bad" "alias tmp_botskill bad; showmenu_enemies" newmenu enemies @@ -135,19 +139,30 @@ alias genenemyitems [ alias n (listlen $arg1) loop $n [ at $arg1 $i - alias numenemies $s - if (= $numenemies 1) [ - concat $numenemies enemy + alias numplayers $s + if (= $arg2 0) [ + alias $numenemies (- $numplayers 1) // don't count yourself as enemy + if (= $numenemies 1) [ + concat $numenemies enemy + ] [ + concat $numenemies enemies + ] ] [ - concat $numenemies enemies + alias teamsize (div $numplayers 2) + concatword $teamsize on $teamsize ] alias menutext $s - concat "alias tmp_numbots" $numenemies "; showmenu botmaps" + concat "alias tmp_numbots" $numplayers "; showmenu botmaps" menuitem $menutext $s ] ] -genenemyitems "1 2 4 8 16 32" +genenemyitems "2 3 5 9 17 33" 0 + + +newmenu "team enemies" + +genenemyitems "2 4 6 8 16 32" 1 newmenu botmaps diff --git a/docs/readme.txt b/docs/readme.txt index 9283f2d7..a98d957d 100644 --- a/docs/readme.txt +++ b/docs/readme.txt @@ -1,15 +1,15 @@ --Actioncube Beta 1.0.- -By Rabid Viper Developement +-Actioncube Beta 0.9 +By Rabid Viper Studio -Actioncube is a team oriented total conversion of the cubeengine by Wouter van Oortmersson. (www.cubeengine.com) +ActionCube is a team oriented total conversion of Wouter van Oortmerssen's cubeengine. (www.cubeengine.com) Set in a realistic-looking environment (as far as thatīs possible with cube of course), while gameplay stays fast and arcade. Keep in mind that this beta release aims at presenting and providing a the basic gameplay elements of Actioncube. We hope to expand it in the future by adding more original, unusual and fun weapons in the spirit of the "Action-" fashion of mods. -We also consider a port to Sauerbraten (most likely to be called "Actionbraten") in wich we plan to further refine gameplay and visuals, and possibly adding a unique self made texture set. +We also consider a port to Sauerbraten (most likely to be called "ActionBraten") in wich we plan to further refine gameplay and visuals, and possibly adding a unique self made texture set. See /docs/package_copyrights.txt - /source/src/LICENSE + /docs/credits.txt /source/src/AUTHORS /source/src/README diff --git a/packages/maps/test.cgz b/packages/maps/test.cgz index 6fceb887..f2160b61 100644 Binary files a/packages/maps/test.cgz and b/packages/maps/test.cgz differ diff --git a/source/src/bot/ac_bot.cpp b/source/src/bot/ac_bot.cpp index faa54a83..31db5d8a 100644 --- a/source/src/bot/ac_bot.cpp +++ b/source/src/bot/ac_bot.cpp @@ -27,12 +27,11 @@ void CACBot::Spawn() m_pMyEnt->eyeheight = 4.25f; m_pMyEnt->aboveeye = 0.7f; m_pMyEnt->radius = 1.1f; - m_pMyEnt->primary = m_pMyEnt->nextprimary = rnd(3)+GUN_PISTOL; + m_pMyEnt->primary = m_pMyEnt->nextprimary = 2 + rnd(4); spawnplayer(m_pMyEnt); m_pMyEnt->targetyaw = m_pMyEnt->yaw = m_pMyEnt->targetpitch = m_pMyEnt->pitch = 0.0f; - m_pMyEnt->primary = m_pMyEnt->nextprimary = GUN_ASSAULT; radd(this->m_pMyEnt); m_pMyEnt->move = 0; m_pMyEnt->enemy = NULL; @@ -96,9 +95,6 @@ void CACBot::Spawn() SelectGun(GUN_SG); }*/ - m_pMyEnt->ammo[GUN_KNIFE] = 1; - m_pMyEnt->ammo[GUN_PISTOL] = 5; - m_pMyEnt->mag[GUN_PISTOL] = 5; SelectGun(m_pMyEnt->primary); m_eCurrentBotState = STATE_NORMAL; @@ -250,9 +246,11 @@ void CACBot::PickUp(int n) int ammo = np*2; switch(ents[n].type) { - case I_CLIPS: AddItem(n, m_pMyEnt->ammo[GUN_PISTOL], ammo); break; - case I_AMMO: AddItem(n, m_pMyEnt->ammo[m_pMyEnt->primary], ammo); break; - case I_GRENADE: AddItem(n, m_pMyEnt->ammo[GUN_GRENADE], ammo); break; + case I_AMMO: AddItem(n, m_pMyEnt->ammo[m_pMyEnt->primary], ammo, m_pMyEnt->primary); break; + case I_CLIPS: AddItem(n, m_pMyEnt->ammo[GUN_PISTOL], ammo, GUN_PISTOL); break; + case I_GRENADE: AddItem(n, m_pMyEnt->ammo[GUN_GRENADE], ammo, 6); break; + case I_HEALTH: AddItem(n, m_pMyEnt->health, ammo, 7); break; + case I_ARMOUR: AddItem(n, m_pMyEnt->armour, ammo, 8); break; /* case I_HELMET: // (100h/100g only absorbs 166 damage) @@ -287,16 +285,16 @@ void CACBot::PickUp(int n) }; }; -void CACBot::AddItem(int i, int &v, int spawnsec) +void CACBot::AddItem(int i, int &v, int spawnsec, int t) { if((i>=sents.length()) || (!sents[i].spawned)) return; //fixmebot - if(v>=itemstats[ents[i].type].max) // don't pick up if not needed + if(v>=itemstats[t].max) // don't pick up if not needed return; - itemstat &is = itemstats[ents[i].type]; + itemstat &is = itemstats[t]; ents[i].spawned = false; v += is.add; if(v>is.max) v = is.max; diff --git a/source/src/bot/ac_bot.h b/source/src/bot/ac_bot.h index 502d5627..033f491a 100644 --- a/source/src/bot/ac_bot.h +++ b/source/src/bot/ac_bot.h @@ -25,7 +25,7 @@ public: virtual void CheckItemPickup(void); virtual void PickUp(int n); - virtual void AddItem(int i, int &v, int spawnsec); + virtual void AddItem(int i, int &v, int spawnsec, int t); // AI Functions virtual bool ChoosePreferredWeapon(void); diff --git a/source/src/bot/ac_bot_ai.cpp b/source/src/bot/ac_bot_ai.cpp index db67c1b9..749ecda9 100644 --- a/source/src/bot/ac_bot_ai.cpp +++ b/source/src/bot/ac_bot_ai.cpp @@ -20,17 +20,17 @@ extern vector monsters; weaponinfo_s WeaponInfoTable[MAX_WEAPONS] = { // KNIFE - { TYPE_MELEE, 0.0f, 3.5f, 0.0f, 5.0f, 1 }, + { TYPE_MELEE, 0.0f, 2.0f, 0.0f, 3.5f, 1 }, // PISTOL - { TYPE_NORMAL, 0.0f, 12.0f, 0.0f, 50.0f, 6 }, + { TYPE_NORMAL, 0.0f, 20.0f, 0.0f, 50.0f, 6 }, // SHOTGUN - { TYPE_SHOTGUN, 0.0f, 20.0f, 0.0f, 70.0f, 4 }, + { TYPE_SHOTGUN, 0.0f, 15.0f, 0.0f, 40.0f, 3 }, // SUBGUN - { TYPE_AUTO, 0.0f, 25.0f, 0.0f, 100.0f, 15 }, + { TYPE_AUTO, 0.0f, 25.0f, 0.0f, 60.0f, 10 }, // SNIPER - { TYPE_SNIPER, 15.0f, 25.0f, 0.0f, 100.0f, 3 }, + { TYPE_SNIPER, 30.0f, 50.0f, 20.0f, 200.0f, 3 }, // ASSAULT - { TYPE_AUTO, 0.0f, 25.0f, 0.0f, 100.0f, 10 }, + { TYPE_AUTO, 40.0f, 80.0f, 0.0f, 150.0f, 6 }, // GRENADE { TYPE_GRENADE, 30.0f, 25.0f, 0.0f, 50.0f, 1 } }; @@ -39,76 +39,58 @@ weaponinfo_s WeaponInfoTable[MAX_WEAPONS] = bool CACBot::ChoosePreferredWeapon() { - printf("chose weapon\n"); - TMultiChoice WeaponChoices; + short bestWeapon = m_pMyEnt->gunselect; + short bestWeaponScore = 0; + short sWeaponScore; float flDist = GetDistance(m_pMyEnt->enemy->o); - - if ((m_iChangeWeaponDelay > lastmillis) && (m_pMyEnt->ammo[m_pMyEnt->gunselect])) + + if (m_iChangeWeaponDelay < lastmillis && m_pMyEnt->mag[m_pMyEnt->gunselect]) { - if ((WeaponInfoTable[m_pMyEnt->gunselect].eWeaponType != TYPE_MELEE) || (flDist <= 3.5f)) + if ((WeaponInfoTable[m_pMyEnt->gunselect].eWeaponType != TYPE_MELEE) || (flDist <= WeaponInfoTable[GUN_KNIFE].flMaxFireDistance)) return true; - } + }; // Choose a weapon for(int i=0;iammo[i] == 0) continue; + if (!m_pMyEnt->mag[i] && !m_pMyEnt->ammo[i]) continue; sWeaponScore = 5; // Minimal score for a weapon - - if ((flDist >= WeaponInfoTable[i].flMinDesiredDistance) && + + // use the advantage of the melee weapon + if((flDist >= WeaponInfoTable[i].flMinDesiredDistance) && (flDist <= WeaponInfoTable[i].flMaxDesiredDistance)) - { - // In desired range for this weapon - sWeaponScore += 5; // Increase score much - } - else if ((flDist < WeaponInfoTable[i].flMinFireDistance) || - (flDist > WeaponInfoTable[i].flMaxFireDistance)) - continue; // Wrong distance for this weapon - - // The ideal distance would be between the Min and Max desired distance. - // Score on the difference of the avarage of the Min and Max desired distance. - float flAvarage = (WeaponInfoTable[i].flMinDesiredDistance + - WeaponInfoTable[i].flMaxDesiredDistance) / 2.0f; - float flIdealDiff = fabs(flDist - flAvarage); - - if (flIdealDiff < 0.5f) // Close to ideal distance - sWeaponScore += 4; - else if (flIdealDiff <= 1.0f) - sWeaponScore += 2; - - // Now rate the weapon on available ammo... - if (WeaponInfoTable[i].sMinDesiredAmmo > 0) - { - // Calculate how much percent of the min desired ammo the bot has - float flDesiredPercent = (float(m_pMyEnt->mag[i]) / - float(WeaponInfoTable[i].sMinDesiredAmmo)) * - 100.0f; - - if(flDesiredPercent >= 175.0f) - sWeaponScore += 4; - else if(flDesiredPercent >= 100.0f) - sWeaponScore += 3; - } - - WeaponChoices.Insert(i, sWeaponScore); - } + { + if(WeaponInfoTable[i].eWeaponType == TYPE_MELEE) sWeaponScore += 5; + } + + if ((flDist > WeaponInfoTable[i].flMinFireDistance) && // inside the range, continue to evaluate + (flDist < WeaponInfoTable[i].flMaxFireDistance)) + { + if(m_pMyEnt->mag[i]) sWeaponScore += 5; + if(i > 1) sWeaponScore += 4; // prefer primary guns + } + + if(sWeaponScore > bestWeaponScore) + { + bestWeaponScore = sWeaponScore; + bestWeapon = i; + } + } - int WeaponSelect; - if (WeaponChoices.GetSelection(WeaponSelect)) { - m_iChangeWeaponDelay = lastmillis + RandomLong(2000, 8000); - if(SelectGun(WeaponSelect)) - { - if(m_pMyEnt->mag[WeaponSelect]==0) reload(m_pMyEnt); // fixme, more intelligent reload - printf("gun selected %i\n", WeaponSelect); - return true; - } + m_iChangeWeaponDelay = lastmillis + 8000; //RandomLong(2000, 8000); + m_bShootAtFeet = false; + SelectGun(bestWeapon); + if(!m_pMyEnt->mag[bestWeapon]) + { + reload(m_pMyEnt); + m_iShootDelay = lastmillis + reloadtime(bestWeapon) + 10; + } + return true; } - - return false; }; void CACBot::Reload(int Gun) @@ -166,8 +148,18 @@ entity *CACBot::SearchForEnts(bool bUseWPs, float flRange, float flMaxHeight) bInteresting = (m_pMyEnt->ammo[GUN_GRENADE]ammo[GUN_GRENADE]; break; + case I_HEALTH: + sMaxAmmo = itemstats[7].max; //FIXME + bInteresting = (m_pMyEnt->health < sMaxAmmo); + sAmmo = m_pMyEnt->health; + break; + case I_ARMOUR: + sMaxAmmo = itemstats[8].max; // FIXME + bInteresting = (m_pMyEnt->armour < sMaxAmmo); + sAmmo = m_pMyEnt->armour; + break; }; - + if (!bInteresting) continue; // Not an interesting item, skip diff --git a/source/src/bot/bot.cpp b/source/src/bot/bot.cpp index ed5e1436..7b17ad06 100644 --- a/source/src/bot/bot.cpp +++ b/source/src/bot/bot.cpp @@ -113,7 +113,7 @@ void CBot::Think() m_pMyEnt->move = 0; moveplayer(m_pMyEnt, 1, false); } - else if (!m_arena) + else if (!m_arena && lastmillis-m_pMyEnt->lastaction>5000) Spawn(); SendBotInfo(); @@ -373,14 +373,10 @@ float CBot::GetDistance(entity *e) bool CBot::SelectGun(int Gun) { - if (m_pMyEnt->ammo[Gun]) - { - //temporary doc out argh -/* if (m_pMyEnt->gunselect != Gun) botplaysound(S_WEAPLOAD, m_pMyEnt); */ - m_pMyEnt->gunselect = Gun; - return true; - } - return false; + if(m_pMyEnt->reloading) return false; + if (m_pMyEnt->gunselect != Gun) botplaysound(S_GUNCHANGE, m_pMyEnt); + m_pMyEnt->gunselect = Gun; + return true; } bool CBot::IsVisible(entity *e, bool CheckPlayers) diff --git a/source/src/bot/bot.h b/source/src/bot/bot.h index db4a3c16..ab69db0b 100644 --- a/source/src/bot/bot.h +++ b/source/src/bot/bot.h @@ -239,7 +239,7 @@ public: bool SelectGun(int Gun); virtual void CheckItemPickup(void) = 0; virtual void PickUp(int n) = 0; - virtual void AddItem(int i, int &v, int spawnsec) = 0; + virtual void AddItem(int i, int &v, int spawnsec, int t) = 0; virtual void BotPain(int damage, dynent *d) = 0; void SendBotInfo(void); float GetDistance(const vec &o); @@ -254,6 +254,7 @@ public: // AI Functions bool FindEnemy(void); + void CheckReload(void); void ShootEnemy(void); bool CheckHunt(void); bool HuntEnemy(void); diff --git a/source/src/bot/bot_ai.cpp b/source/src/bot/bot_ai.cpp index c3fadb31..44afd59e 100644 --- a/source/src/bot/bot_ai.cpp +++ b/source/src/bot/bot_ai.cpp @@ -865,8 +865,7 @@ bool CBot::HuntEnemy(void) void CBot::ShootEnemy() { - if (!m_pMyEnt->enemy) - return; + if(!m_pMyEnt->enemy) return; m_iSawEnemyTime = lastmillis; @@ -878,7 +877,7 @@ void CBot::ShootEnemy() if (m_iShootDelay < lastmillis) //if ((lastmillis-m_pMyEnt->lastaction) >= m_pMyEnt->gunwait) { - if (m_pMyEnt->ammo[m_pMyEnt->gunselect]) + if (m_pMyEnt->mag[m_pMyEnt->gunselect]) { // If the bot is using a sniper only shoot if crosshair is near the enemy if (WeaponInfoTable[m_pMyEnt->gunselect].eWeaponType == TYPE_SNIPER) @@ -1016,6 +1015,14 @@ int CBot::GetShootDelay() return max(m_pMyEnt->gunwait, int(RandomFloat(flMinShootDelay, flMaxShootDelay) * 1000.0f)); } +void CBot::CheckReload() // reload gun if no enemies are around +{ + if(m_pMyEnt->enemy) return; + SelectGun(m_pMyEnt->primary); + reload(m_pMyEnt); + return; +} + void CBot::MainAI() { // Default bots will run forward @@ -1056,22 +1063,26 @@ void CBot::MainAI() } else if (CheckHunt() && HuntEnemy()) { + CheckReload(); AddDebugText("Hunting to %s", m_pHuntTarget->name); m_eCurrentBotState = STATE_HUNT; } // Heading to an interesting entity(ammo, armour etc) else if (CheckItems()) { + CheckReload(); AddDebugText("has ent"); m_eCurrentBotState = STATE_ENT; } else if (m_classicsp && DoSPStuff()) // Home to goal, find/follow friends etc. { + AddDebugText("SP stuff"); m_eCurrentBotState = STATE_SP; } else // Normal navigation { + CheckReload(); if (m_eCurrentBotState != STATE_NORMAL) { m_vGoal = g_vecZero; diff --git a/source/src/bot/bot_waypoint.cpp b/source/src/bot/bot_waypoint.cpp index 80b4b221..d46ddf09 100644 --- a/source/src/bot/bot_waypoint.cpp +++ b/source/src/bot/bot_waypoint.cpp @@ -1082,12 +1082,6 @@ node_s *CWaypointClass::GetNearestWaypoint(vec v_src, float flRange) while(pNode) { - if (pNode->Entry->iFlags & W_FL_FLOOD) - { - pNode = pNode->next; - continue; - } - flDist = GetDistance(v_src, pNode->Entry->v_origin); if ((flDist < flNearestDist) && (flDist <= flRange)) { @@ -1921,6 +1915,13 @@ void wpload(void) COMMAND(wpload, ARG_NONE); +void wpclear(void) +{ + WaypointClass.Clear(); +} + +COMMAND(wpclear, ARG_NONE); + void autowp(int on) { WaypointClass.SetWaypointsVisible(true); @@ -2046,12 +2047,12 @@ void setwpyaw(void) COMMAND(setwpyaw, ARG_NONE); #ifdef WP_FLOOD -void startflood(void) +void wpflood(void) { WaypointClass.StartFlood(); } -COMMAND(startflood, ARG_NONE); +COMMAND(wpflood, ARG_NONE); #endif #ifdef VANILLA_CUBE diff --git a/source/src/bot/botmanager.cpp b/source/src/bot/botmanager.cpp index 368ea5b6..f2a9af39 100644 --- a/source/src/bot/botmanager.cpp +++ b/source/src/bot/botmanager.cpp @@ -315,6 +315,8 @@ char *CBotManager::GetBotTeam() return szOutput; } +extern void renderplayer(dynent *d); + void CBotManager::RenderBots() { static bool drawblue; @@ -323,8 +325,9 @@ void CBotManager::RenderBots() { if (bots[i] && (bots[i] != m_pBotToView)) { - drawblue = (m_sp || isteam(player1->team, bots[i]->team)); - renderclient(bots[i], drawblue, "playermodels/counterterrorist", 1.6f); + /*drawblue = (m_sp || isteam(player1->team, bots[i]->team)); + renderclient(bots[i], drawblue, "playermodels/counterterrorist", 1.6f);*/ + renderplayer(bots[i]); } } } @@ -916,7 +919,7 @@ dynent *CBotManager::CreateBot(const char *team, const char *skill, const char * { dynent *m = newdynent(); if (!m) return NULL; - + loopi(NUMGUNS) m->ammo[i] = m->mag[i] = 0; // Create new bot class, dependand on the current mod #if defined VANILLA_CUBE m->pBot = new CCubeBot; diff --git a/source/src/clientextras.cpp b/source/src/clientextras.cpp index a9a9ce1e..6026d93c 100644 --- a/source/src/clientextras.cpp +++ b/source/src/clientextras.cpp @@ -143,7 +143,8 @@ void addteamscore(dynent *d) if(teamsused==maxteams) return; teamname[teamsused] = d->team; teamscore[teamsused] = d->frags; - if(m_ctf) teamflagscore[teamsused++] = d->flagscore; + if(m_ctf) teamflagscore[teamsused] = d->flagscore; + teamsused++; }; void renderscores() @@ -162,6 +163,8 @@ void renderscores() { teamsused = 0; loopv(players) addteamscore(players[i]); + // Added by Rick: Add team scores for bots + BotManager.AddBotTeamScore(); if(!demoplayback) addteamscore(player1); teamscores[0] = 0; loopj(teamsused) diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index a6625e59..08c190b9 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -44,6 +44,7 @@ void resetmovement(dynent *d) }; extern bool c2sinit; +extern int dblend; void spawnstate(dynent *d) // reset player state not persistent accross spawns { @@ -73,6 +74,7 @@ void spawnstate(dynent *d) // reset player state not persistent acc scoped = false; }; radd(d); + dblend = 0; d->akimbo = false; }; @@ -115,6 +117,8 @@ dynent *newdynent() // create a new blank player or monster d->pBot = NULL; d->weaponchanging = false; d->lastanimswitchtime = -1; + loopi(NUMGUNS) d->ammo[i] = d->mag[i] = 0; + d->skin = rnd(1 + rb_team_int(d->team) == TEAM_CLA ? 3 : 5); spawnstate(d); return d; }; @@ -139,7 +143,7 @@ void respawnself() void respawn() { - if(player1->state==CS_DEAD && lastmillis>player1->lastaction+3000) + if(player1->state==CS_DEAD && lastmillis>player1->lastaction+5000) { player1->attacking = false; if(m_arena) { conoutf("waiting for new round to start..."); return; }; @@ -474,7 +478,7 @@ void selfdamage(int damage, int actor, dynent *act, bool gib) if(m_ctf) ctf_death(); showscores(true); if(scoped) togglescope(); - if(act->bIsBot) addmsg(1, 2, SV_DIEDBYBOT, actor); + if(act->bIsBot) addmsg(1, 2, SV_DIEDBYBOT, actor); else addmsg(1, 2, gib ? SV_GIBDIED : SV_DIED, actor); player1->lifesequence++; player1->attacking = false; @@ -487,6 +491,7 @@ void selfdamage(int damage, int actor, dynent *act, bool gib) spawnstate(player1); //player1->lastaction = lastmillis; //fixme + if (act->bIsBot) addmsg(1, 3, SV_BOTFRAGS, BotManager.GetBotIndex(act), ++act->frags); } else { @@ -583,7 +588,7 @@ void startmap(char *name) // called just after a map load netmapstart(); //should work //monsterclear(); // Added by Rick - if(gamemode==7) BotManager.BeginMap(name); + if(m_botmode) BotManager.BeginMap(name); else sleepwait = 0; // End add by Rick projreset(); @@ -604,7 +609,7 @@ void startmap(char *name) // called just after a map load intermission = false; framesinmap = 0; conoutf("game mode is %s", (int)modestr(gamemode)); -}; +}; COMMANDN(map, changemap, ARG_1STR); diff --git a/source/src/clients2c.cpp b/source/src/clients2c.cpp index f50ba38b..a7bce534 100644 --- a/source/src/clients2c.cpp +++ b/source/src/clients2c.cpp @@ -260,7 +260,7 @@ void localservertoclient(uchar *buf, int len) // processes any updates from th case SV_DIEDBYBOT: killedbybot = true; case SV_GIBDIED: - gib = true; // fixme + if(type!=SV_DIEDBYBOT) gib = true; // fixme case SV_DIED: { int actor = getint(p); diff --git a/source/src/cube.h b/source/src/cube.h index e6f975a6..7b7f5438 100644 --- a/source/src/cube.h +++ b/source/src/cube.h @@ -1,6 +1,6 @@ /// one big bad include file for the whole engine... nasty! -#include "tools.h" +#include "tools.h" enum // block types, order matters! { @@ -411,7 +411,8 @@ extern bool demoplayback; #define m_noitemsrail (false) #define m_arena (gamemode==3 || gamemode==4) #define m_tarena (gamemode==4) -#define m_teammode (gamemode==0 || gamemode==4 || gamemode==5) +#define m_teammode (gamemode==0 || gamemode==4 || gamemode==5 || gamemode==7) +#define m_botmode (gamemode==7 || gamemode == 8) #define m_ctf (gamemode==5) #define m_pistol (gamemode==6) //#define m_sp (gamemode<0) diff --git a/source/src/entities.cpp b/source/src/entities.cpp index 02f006cc..47d8ba01 100644 --- a/source/src/entities.cpp +++ b/source/src/entities.cpp @@ -258,7 +258,7 @@ void radd(dynent *d) { loopi(NUMGUNS) if(d->nextprimary!=i) d->ammo[i] = 0; - d->mag[GUN_KNIFE] = 1; + d->mag[GUN_KNIFE] = d->ammo[GUN_KNIFE] = 1; d->mag[GUN_GRENADE] = d->ammo[GUN_GRENADE] = 0; if (m_pistol || d->primary==GUN_PISTOL) // pistol only mode diff --git a/source/src/main.cpp b/source/src/main.cpp index 5c6ca8a6..af90fef1 100644 --- a/source/src/main.cpp +++ b/source/src/main.cpp @@ -250,6 +250,7 @@ int main(int argc, char **argv) }; quit(); return 1; + }; diff --git a/source/src/menus.cpp b/source/src/menus.cpp index 60c712e2..9219f9fd 100644 --- a/source/src/menus.cpp +++ b/source/src/menus.cpp @@ -100,9 +100,20 @@ void rendermenumdl() glPushMatrix (); - glTranslatef(player1->o.x, player1->o.z, player1->o.y); + float t = (lastmillis-player1->lastaction)/1000.0f; + if(t >= 1.6f) t = 1.6f; + + if(player1->state==CS_DEAD) + { + player1->pitch = (float) sin(t)*(-70.0f-player1->oldpitch)+player1->oldpitch; + glTranslatef(player1->o.x, -(player1->eyeheight-sin(t)*7.0f-player1->o.z), player1->o.y); + } + else + { + glTranslatef(player1->o.x, player1->o.z, player1->o.y); + } glRotatef(player1->yaw+90+180, 0, -1, 0); - glRotatef(player1->pitch, 0, 0, 1); + glRotatef(player1->pitch, 0, 0, 1); vec pos = { 0.0f, 0.0f, 0.0f }; bool isplayermodel = !strncmp(m.mdl, "playermodels", strlen("playermodels")); @@ -114,8 +125,6 @@ void rendermenumdl() } else { - //glTranslatef(1.0f, 0.32f, 0); - //pos.y = 0.1f; glTranslatef(2.0f, 1.7f, 0); }; diff --git a/source/src/physics.cpp b/source/src/physics.cpp index 220acfc8..e215c351 100644 --- a/source/src/physics.cpp +++ b/source/src/physics.cpp @@ -287,11 +287,10 @@ void moveplayer(dynent *pl, int moveres, bool local, int curtime) { if(pl->onfloor || water) { - if(pl->jumpnext) { pl->jumpnext = false; - pl->vel.z = 1.7f; // physics impulse upwards + pl->vel.z = 2.0f; //1.7f; // physics impulse upwards if(water) { pl->vel.x /= 8; pl->vel.y /= 8; }; // dampen velocity change even harder, gives correct water feel if(local) playsoundc(S_JUMP); else if(pl->monsterstate) playsound(S_JUMP, &pl->o); diff --git a/source/src/renderextras.cpp b/source/src/renderextras.cpp index c9cb241d..9ddfb4fb 100644 --- a/source/src/renderextras.cpp +++ b/source/src/renderextras.cpp @@ -390,7 +390,7 @@ void gl_drawhud(int w, int h, int curfps, int nquads, int curvert, bool underwat glEnd(); glDisable(GL_ALPHA_TEST); } - else if (player1->gunselect != GUN_SNIPER) + else if (player1->gunselect != GUN_SNIPER && !player1->reloading && !player1->state==CS_DEAD) { glBlendFunc(GL_SRC_ALPHA, GL_SRC_ALPHA); glBindTexture(GL_TEXTURE_2D, 1); @@ -608,7 +608,7 @@ void renderphysents() break; case GIB: default: - sprintf_s(model)("misc/gib0%i", (((4*(int)p))%3)+1); + sprintf_s(model)("misc/gib0%i", (((4*(int)p)+p->timetolife)%3)+1); int t = lastmillis-p->millis; if(t>p->timetolife-2000) { diff --git a/source/src/rendergl.cpp b/source/src/rendergl.cpp index b136ac4a..7475698f 100644 --- a/source/src/rendergl.cpp +++ b/source/src/rendergl.cpp @@ -243,6 +243,9 @@ VARF(gamma, 30, 100, 300, }; }); +void trypitch(int i) { player1->pitch=i; } +COMMAND(trypitch, ARG_1INT); + void transplayer() { glLoadIdentity(); @@ -257,6 +260,7 @@ void transplayer() glRotated(player1->yaw,0.0,1.0,0.0); glTranslated(-player1->o.x, player1->eyeheight-sin(t)*7.0f-player1->o.z, -player1->o.y); + //glTranslated(-player1->o.x, -player1->o.z, -player1->o.y); } else { @@ -264,7 +268,7 @@ void transplayer() glRotated(player1->pitch,-1.0,0.0,0.0); glRotated(player1->yaw,0.0,1.0,0.0); - glTranslated(-player1->o.x, (player1->state==CS_DEAD ? player1->eyeheight-0.2f : 0)-player1->o.z, -player1->o.y); + glTranslated(-player1->o.x, -player1->o.z, -player1->o.y); }; }; @@ -288,7 +292,7 @@ void drawhudmodel(int start, int end, float speed, int base) void drawhudgun(int w, int h, float aspect, int farplane) { - if(!hudgun || (scoped && player1->gunselect==GUN_SNIPER) || player1->state==CS_DEAD) return; + if(scoped && player1->gunselect==GUN_SNIPER) return; glEnable(GL_CULL_FACE); @@ -297,7 +301,7 @@ void drawhudgun(int w, int h, float aspect, int farplane) gluPerspective((float)100.0f*h/w, aspect, 0.3f, farplane); // fov fixed at 100° glMatrixMode(GL_MODELVIEW); - rendermd3gun(); + if(hudgun && player1->state!=CS_DEAD)rendermd3gun(); rendermenumdl(); glMatrixMode(GL_PROJECTION); diff --git a/source/src/rendermd2.cpp b/source/src/rendermd2.cpp index a7f23941..47b230c7 100644 --- a/source/src/rendermd2.cpp +++ b/source/src/rendermd2.cpp @@ -159,7 +159,7 @@ void md2::render(vec &light, int frame, int range, float x, float y, float z, fl { if(range==0 || frame+range-1>numFrames) { - conoutf("invalid md2 frame or range!"); + printf("warning: model %s, invalid frame (%i) or range (%i)", loadname, frame, range); return; } diff --git a/source/src/serverms.cpp b/source/src/serverms.cpp index 58d75e33..9978e6f8 100644 --- a/source/src/serverms.cpp +++ b/source/src/serverms.cpp @@ -62,7 +62,7 @@ void updatemasterserver(int seconds) if(seconds>updmaster) // send alive signal to masterserver every hour of uptime { sprintf_sd(path)("%sregister.do?action=add", masterpath); - httpgetsend(masterserver, masterbase, path, "cubeserver", "Cube Server"); + httpgetsend(masterserver, masterbase, path, "actioncubeserver", "ActionCube Server"); masterrep[0] = 0; masterb.data = masterrep; masterb.dataLength = MAXTRANS-1; @@ -80,7 +80,7 @@ void checkmasterreply() uchar *retrieveservers(uchar *buf, int buflen) { sprintf_sd(path)("%sretrieve.do?item=list", masterpath); - httpgetsend(masterserver, masterbase, path, "cubeserver", "Cube Server"); + httpgetsend(masterserver, masterbase, path, "actioncubeserver", "ActionCube Server"); ENetBuffer eb; buf[0] = 0; eb.data = buf; diff --git a/source/src/serverutil.cpp b/source/src/serverutil.cpp index 89aec460..a4a90298 100644 --- a/source/src/serverutil.cpp +++ b/source/src/serverutil.cpp @@ -29,11 +29,11 @@ void sendstring(char *t, uchar *&p) const char *modenames[] = { "team deathmatch", "coopedit", "deathmatch", "survior", - "team survior", "ctf", "pistols only!", "botmatch", + "team survior", "ctf", "pistols only!", "bot team deathmatch", "bot deathmatch" }; //const char *modestr(int n) { return (n>=-2 && n<12) ? modenames[n+2] : "unknown"; }; -const char *modestr(int n) { return (n>=0 && n<=7) ? modenames[n] : "unknown"; }; +const char *modestr(int n) { return (n>=0 && n<=8) ? modenames[n] : "unknown"; }; /* Modified by Rick: New messages and different sizes for existing ones char msgsizesl[] = // size inclusive message token, 0 for variable or not-checked sizes diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index 725b6758..fba65699 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -49,7 +49,7 @@ void weaponswitch(int gun) void weapon(int gun) { if(scoped) togglescope(); - if(NADE_IN_HAND) return; + if(NADE_IN_HAND || player1->reloading) return; gun %= G_NUM; if(gun<0) gun = G_NUM+gun; diff --git a/source/src/world.cpp b/source/src/world.cpp index 7a7fdd7b..376320ff 100644 --- a/source/src/world.cpp +++ b/source/src/world.cpp @@ -377,7 +377,7 @@ void empty_world(int factor, bool force) // main empty world creation routine }; calclight(); - startmap("base/unnamed"); + startmap("maps/unnamed"); if(oldworld) { free(oldworld);