diff --git a/.github/workflows/build-winxp.yml b/.github/workflows/build-winxp.yml index 6b04992ad4..944ed4cdc6 100644 --- a/.github/workflows/build-winxp.yml +++ b/.github/workflows/build-winxp.yml @@ -1,7 +1,10 @@ name: build-winxp +# runs every 4 months on: workflow_dispatch: + schedule: + - cron: "0 0 1 */4 *" release: types: [published] diff --git a/.gitignore b/.gitignore index 98b58b5545..28632a0bbf 100644 --- a/.gitignore +++ b/.gitignore @@ -183,6 +183,7 @@ pip-log.txt ## clangd ############# .clangd +compile_commands.json ############# ## CLion @@ -193,4 +194,4 @@ pip-log.txt ## CMake Builds ############# [Bb]uild*/ -cmake-build-* \ No newline at end of file +cmake-build-* diff --git a/CMakeLists.txt b/CMakeLists.txt index 2013ff6288..1572b2ac47 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -91,6 +91,14 @@ endif() #============================================================================= list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_SOURCE_DIR}/cmake/Modules") +if(CMAKE_EXPORT_COMPILE_COMMANDS) + add_custom_target( + copy-compile-commands ALL + ${CMAKE_COMMAND} -E copy_if_different + ${CMAKE_BINARY_DIR}/compile_commands.json + ${CMAKE_CURRENT_LIST_DIR}) +endif() + #============================================================================= # # Architecture/OS defines diff --git a/README.md b/README.md index 4c2bee7583..25ed0ab54d 100644 --- a/README.md +++ b/README.md @@ -16,3 +16,66 @@ This project is maintained against the following repositories: * [jaPRO](https://github.com/videoP/jaPRO) * [EternalJK](https://github.com/eternalcodes/EternalJK) * [EternalJK-Vulkan](https://github.com/JKSunny/EternalJK) + +# OpenJK + +OpenJK is a community effort to maintain and improve the game and engine powering Jedi Academy, while maintaining _full backwards compatibility_ with the existing games and mods. +This fork focuses on the jaPRO integration and Client Engine modifications. + +Our aims are to: + +- Improve the stability of the engine by fixing bugs and improving performance. +- Support more hardware (x86_64, Arm, Apple Silicon) and software platforms (Linux, macOS) +- Provide a clean base from which new code modifications can be made. + + +## For players + +To install TaystJK, you will first need Jedi Academy installed. If you don't already own the game you can buy it from online stores such as [Steam](https://store.steampowered.com/app/6020/), [Amazon](https://www.amazon.com/Star-Wars-Jedi-Knight-Academy-Pc/dp/B0000A2MCN) or [GOG](https://www.gog.com/game/star_wars_jedi_knight_jedi_academy). + +Download the [latest build](https://github.com/JACoders/TaystJK/releases/tag/latest) for your operating system. + +Installing and running TaystJK: + +1. Extract the contents of the file into the Jedi Academy `GameData/` folder. For Steam users, this will be in `/steamapps/common/Jedi Academy/GameData/`. +2. Run `taystjk.x86.exe` (Windows), `taystjk.i386` (Linux 32-bit), `taystjk.x86_64` (Linux 64-bit) or the `TaystJK` app bundle (macOS), depending on your operating system. + +### Linux Instructions + +If you do not have an existing JKA installation and need to download the base game: + +1. Download and Install SteamCMD [SteamCMD](https://developer.valvesoftware.com/wiki/SteamCMD#Linux). +2. Set the download path using steamCMD: `force_install_dir /path/to/install/jka/` +3. Using SteamCMD Set the platform to windows to download any windows game on steam. @sSteamCmdForcePlatformType "windows" +4. Using SteamCMD download the game, `app_update 6020`. + +Extract the contents of the file into the Jedi Academy `GameData/` folder. For Steam users, this will be in `/steamapps/common/Jedi Academy/GameData/`. + +### macOS Instructions + +If you have the Mac App Store Version of Jedi Academy, follow these steps to get TaystJK runnning under macOS: + +1. Install [Homebrew](https://brew.sh/) if you don't have it. +2. Open the Terminal app, and enter the command `brew install sdl2`. +3. Extract the contents of the TaystJK DMG into the game directory `/Applications/Star Wars Jedi Knight: Jedi Academy.app/Contents/` +4. Run `TaystJK.app` +5. Savegames, Config Files and Log Files are stored in `/Users/$USER/Library/Application Support/TaystJK/` + +## For Developers + +### Building TaystJK + +- [Compilation guide](https://github.com/JACoders/OpenJK/wiki/Compilation-guide) +- [Debugging guide](https://github.com/JACoders/OpenJK/wiki/Debugging) + +### Contributing to TaystJK + +- [Fork](https://github.com/Taysta/TaystJK/fork) the project on GitHub +- Create a new branch and make your changes +- Send a [pull request](https://help.github.com/articles/creating-a-pull-request) to upstream (Taysta/TaystJK) + +### Using TaystJK as a base for a new mod + +- [Fork](https://github.com/Taysta/TaystJK/fork) the project on GitHub +- Change the `GAMEVERSION` define in [codemp/game/g_local.h](https://github.com/Taysta/TaystJK/blob/master/codemp/game/g_local.h) from "OpenJK" to your project name +- If you make a nice change, please consider back-porting to upstream via pull request as described above. This is so everyone benefits without having to reinvent the wheel for every project. diff --git a/codemp/botlib/botlib.h b/codemp/botlib/botlib.h index 0345e758b1..8f1a1c7615 100644 --- a/codemp/botlib/botlib.h +++ b/codemp/botlib/botlib.h @@ -103,6 +103,7 @@ struct weaponinfo_s; #define ACTION_WALK 0x0080000 #define ACTION_FORCEPOWER 0x0100000 #define ACTION_ALT_ATTACK 0x0200000 +#define ACTION_SKI 0x0800000 /* #define ACTION_AFFIRMATIVE 0x0100000 #define ACTION_NEGATIVE 0x0200000 diff --git a/codemp/game/ai_main.c b/codemp/game/ai_main.c index 07cbe51ca6..fe74a8bb25 100644 --- a/codemp/game/ai_main.c +++ b/codemp/game/ai_main.c @@ -576,6 +576,8 @@ void BotInputToUserCommand(bot_input_t *bi, usercmd_t *ucmd, int delta_angles[3] if (bi->actionflags & ACTION_FORCEPOWER) ucmd->buttons |= BUTTON_FORCEPOWER; + if (bi->actionflags & ACTION_SKI) ucmd->buttons |= BUTTON_DASH; + if (useTime < level.time && Q_irand(1, 10) < 5) { //for now just hit use randomly in case there's something useable around ucmd->buttons |= BUTTON_USE; @@ -6772,6 +6774,159 @@ float NewBotAI_GetSpeedTowardsEnemy(bot_state_t *bs) return 0; } + +int NewBotAI_GetTribesWeapon(bot_state_t *bs) +{ + const int /*hisHealth = bs->currentEnemy->health,*/ distance = bs->frame_Enemy_Len; + int hisWeapon = WP_SABER; + int bestWeapon = bs->cur_ps.weapon; + const int forcedFireMode = level.clients[bs->client].forcedFireMode; + + bs->doAltAttack = 0; + + if (bs->currentEnemy->client) + hisWeapon = bs->currentEnemy->client->ps.weapon; + + //Dependant on distance from enemy, enemys health, enemys weapon, and our health? + + + if (distance > 3000) { + if (BotWeaponSelectable(bs, WP_DISRUPTOR)) + bestWeapon = WP_DISRUPTOR; + else if (BotWeaponSelectable(bs, WP_BLASTER) && (bs->cur_ps.weapon != WP_BLASTER && bs->cur_ps.jetpackFuel == 100) || (bs->cur_ps.weapon == WP_BLASTER && bs->cur_ps.jetpackFuel > 10)) { + bestWeapon = WP_BLASTER; + } + else if (BotWeaponSelectableAltFire(bs, WP_BRYAR_OLD) && (bs->cur_ps.weapon == WP_BRYAR_OLD && bs->cur_ps.jetpackFuel == 100) || (bs->cur_ps.weapon == WP_BRYAR_OLD && bs->cur_ps.jetpackFuel > 10)) { //logic to let us run down to 0 but nto switch to 0 + bestWeapon = WP_BRYAR_OLD; + bs->doAltAttack = 1; + bs->altChargeTime = 800; + } + else if (BotWeaponSelectable(bs, WP_REPEATER) && forcedFireMode != 2) + bestWeapon = WP_REPEATER; + else if (BotWeaponSelectableAltFire(bs, WP_DEMP2) && forcedFireMode != 1) { + bestWeapon = WP_DEMP2; + bs->doAltAttack = 1; + bs->altChargeTime = 2100; + } + else if (BotWeaponSelectable(bs, WP_CONCUSSION) && bs->cur_ps.fd.forcePower > 90 && forcedFireMode != 1) { + bestWeapon = WP_CONCUSSION; + bs->doAltAttack = 1; + } + else if (BotWeaponSelectable(bs, WP_CONCUSSION) && forcedFireMode != 2) { + bestWeapon = WP_CONCUSSION; + } + else if (BotWeaponSelectable(bs, WP_ROCKET_LAUNCHER) && forcedFireMode != 2) { + bestWeapon = WP_ROCKET_LAUNCHER; + } + else if (BotWeaponSelectable(bs, WP_FLECHETTE)) { + bestWeapon = WP_FLECHETTE; + bs->doAltAttack = 1; + } + else if (bs->cur_ps.stats[STAT_WEAPONS] & (1 << WP_SABER)) + bestWeapon = WP_SABER; + } + else if (distance > 800 && distance < 2800) { //Have some padding between distance tiers so we dont weaponswitch spam + if (BotWeaponSelectableAltFire(bs, WP_BLASTER) && (bs->cur_ps.weapon != WP_BLASTER && bs->cur_ps.jetpackFuel == 100) || (bs->cur_ps.weapon == WP_BLASTER && bs->cur_ps.jetpackFuel > 10)) { + bestWeapon = WP_BLASTER; + } + else if (BotWeaponSelectable(bs, WP_REPEATER) && forcedFireMode != 2) + bestWeapon = WP_REPEATER; + else if (BotWeaponSelectableAltFire(bs, WP_BRYAR_OLD) && (bs->cur_ps.weapon == WP_BRYAR_OLD && bs->cur_ps.jetpackFuel == 100) || (bs->cur_ps.weapon == WP_BRYAR_OLD && bs->cur_ps.jetpackFuel > 10)) { + bestWeapon = WP_BRYAR_OLD; + bs->doAltAttack = 1; + bs->altChargeTime = 800; + } + else if (BotWeaponSelectableAltFire(bs, WP_BOWCASTER)) { + bestWeapon = WP_BOWCASTER; + bs->doAltAttack = 1; + } + else if (BotWeaponSelectable(bs, WP_CONCUSSION) && bs->cur_ps.fd.forcePower > 90 && forcedFireMode != 1) { + bestWeapon = WP_CONCUSSION; + bs->doAltAttack = 1; + } + else if (BotWeaponSelectable(bs, WP_CONCUSSION) && forcedFireMode != 2) { + bestWeapon = WP_CONCUSSION; + } + else if (BotWeaponSelectable(bs, WP_ROCKET_LAUNCHER) && forcedFireMode != 2) { + bestWeapon = WP_ROCKET_LAUNCHER; + } + else if (BotWeaponSelectable(bs, WP_DISRUPTOR)) + bestWeapon = WP_DISRUPTOR; + else if (BotWeaponSelectableAltFire(bs, WP_DEMP2) && forcedFireMode != 2) { + bestWeapon = WP_DEMP2; + } + else if (BotWeaponSelectableAltFire(bs, WP_DEMP2) && forcedFireMode != 1) { + bestWeapon = WP_DEMP2; + bs->doAltAttack = 1; + bs->altChargeTime = 2100; + } + else if (BotWeaponSelectable(bs, WP_FLECHETTE)) { + bestWeapon = WP_FLECHETTE; + bs->doAltAttack = 1; + } + else if (bs->cur_ps.stats[STAT_WEAPONS] & (1 << WP_SABER)) + bestWeapon = WP_SABER; + } + else if (distance < 600) { //Most DPS! + if (BotWeaponSelectableAltFire(bs, WP_THERMAL) && (bs->currentEnemy->client->ps.powerups[PW_REDFLAG] || bs->currentEnemy->client->ps.powerups[PW_BLUEFLAG] || bs->currentEnemy->client->ps.powerups[PW_NEUTRALFLAG])) { + bestWeapon = WP_THERMAL; + } + if (BotWeaponSelectableAltFire(bs, WP_BLASTER) && (bs->cur_ps.weapon == WP_BLASTER != bs->cur_ps.jetpackFuel == 100) || (bs->cur_ps.weapon == WP_BLASTER && bs->cur_ps.jetpackFuel > 10)) { + bestWeapon = WP_BLASTER; + bs->doAltAttack = 1; + } + else if (BotWeaponSelectable(bs, WP_FLECHETTE)) + bestWeapon = WP_FLECHETTE; + else if (BotWeaponSelectable(bs, WP_ROCKET_LAUNCHER)) + bestWeapon = WP_ROCKET_LAUNCHER; + else if (BotWeaponSelectable(bs, WP_CONCUSSION) && forcedFireMode != 2) + bestWeapon = WP_CONCUSSION; + else if (BotWeaponSelectableAltFire(bs, WP_BOWCASTER)) { + bestWeapon = WP_BOWCASTER; + bs->doAltAttack = 1; + } + else if (BotWeaponSelectableAltFire(bs, WP_DEMP2) && forcedFireMode != 2) { + bestWeapon = WP_DEMP2; + } + else if (BotWeaponSelectable(bs, WP_DISRUPTOR)) + bestWeapon = WP_DISRUPTOR; + else if (BotWeaponSelectableAltFire(bs, WP_BRYAR_OLD)) { + bestWeapon = WP_BRYAR_OLD; + bs->doAltAttack = 1; + bs->altChargeTime = 800; + } + else if (BotWeaponSelectableAltFire(bs, WP_BRYAR_PISTOL)) { + bestWeapon = WP_BRYAR_PISTOL; + bs->doAltAttack = 1; + bs->altChargeTime = 1200; + } + else if (BotWeaponSelectable(bs, WP_CONCUSSION) && bs->cur_ps.fd.forcePower > 90 && forcedFireMode != 1) { + bestWeapon = WP_CONCUSSION; + bs->doAltAttack = 1; + } + else if (BotWeaponSelectableAltFire(bs, WP_DEMP2) && forcedFireMode != 1) { + bestWeapon = WP_DEMP2; + bs->doAltAttack = 1; + bs->altChargeTime = 2100; + } + else if (bs->cur_ps.stats[STAT_WEAPONS] & (1 << WP_SABER)) + bestWeapon = WP_SABER; + } + + + if (bs->currentEnemy->client && bs->currentEnemy->client->ps.weapon == WP_DEMP2) //dont charge if they can cancel it + bs->altChargeTime = 50; + + if (forcedFireMode == 1) + bs->doAltAttack = 0; + else if (forcedFireMode == 2) + bs->doAltAttack = 1; + + //todo- weapon table. + + return bestWeapon; +} + int NewBotAI_GetWeapon(bot_state_t *bs) { const int /*hisHealth = bs->currentEnemy->health,*/ distance = bs->frame_Enemy_Len; @@ -6802,10 +6957,6 @@ int NewBotAI_GetWeapon(bot_state_t *bs) else if (BotWeaponSelectable(bs, WP_BLASTER)) { bestWeapon = WP_BLASTER; } - else if (BotWeaponSelectable(bs, WP_REPEATER) && (g_tweakWeapons.integer & WT_TRIBES) && (g_tweakWeapons.integer & WT_INFINITE_AMMO) && forcedFireMode != 1) { - bestWeapon = WP_REPEATER; - bs->doAltAttack = 1; - } else if (distance > 500 && BotWeaponSelectableAltFire(bs, WP_BRYAR_OLD)) { bestWeapon = WP_BRYAR_OLD; bs->doAltAttack = 1; @@ -6843,10 +6994,6 @@ int NewBotAI_GetWeapon(bot_state_t *bs) bestWeapon = WP_BLASTER; bs->doAltAttack = 1; } - else if (BotWeaponSelectable(bs, WP_ROCKET_LAUNCHER) && (g_tweakWeapons.integer & WT_TRIBES) && (g_tweakWeapons.integer & WT_INFINITE_AMMO)) - bestWeapon = WP_ROCKET_LAUNCHER; - else if (BotWeaponSelectable(bs, WP_CONCUSSION) && (g_tweakWeapons.integer & WT_TRIBES) && (g_tweakWeapons.integer & WT_INFINITE_AMMO)) - bestWeapon = WP_CONCUSSION; else if (BotWeaponSelectableAltFire(bs, WP_BOWCASTER)) { bestWeapon = WP_BOWCASTER; bs->doAltAttack = 1; @@ -6920,14 +7067,6 @@ int NewBotAI_GetWeapon(bot_state_t *bs) } else if (BotWeaponSelectable(bs, WP_BLASTER)) bestWeapon = WP_BLASTER; - else if (BotWeaponSelectable(bs, WP_ROCKET_LAUNCHER) && (g_tweakWeapons.integer & WT_TRIBES) && (g_tweakWeapons.integer & WT_INFINITE_AMMO)) - bestWeapon = WP_ROCKET_LAUNCHER; - else if (BotWeaponSelectable(bs, WP_CONCUSSION) && (g_tweakWeapons.integer & WT_TRIBES) && (g_tweakWeapons.integer & WT_INFINITE_AMMO)) - bestWeapon = WP_CONCUSSION; - else if (BotWeaponSelectable(bs, WP_REPEATER) && (g_tweakWeapons.integer & WT_TRIBES) && (g_tweakWeapons.integer & WT_INFINITE_AMMO) && forcedFireMode != 1) { - bestWeapon = WP_REPEATER; - bs->doAltAttack = 1; - } else if (BotWeaponSelectableAltFire(bs, WP_BRYAR_OLD)) { bestWeapon = WP_BRYAR_OLD; bs->doAltAttack = 1; @@ -6957,10 +7096,6 @@ int NewBotAI_GetWeapon(bot_state_t *bs) else if (distance < 768 && BotWeaponSelectableAltFire(bs, WP_STUN_BATON) && (g_tweakWeapons.integer & WT_STUN_LG) && !(g_tweakWeapons.integer & WT_STUN_HEAL)) { bestWeapon = WP_STUN_BATON; } - else if (BotWeaponSelectable(bs, WP_ROCKET_LAUNCHER) && (g_tweakWeapons.integer & WT_TRIBES) && (g_tweakWeapons.integer & WT_INFINITE_AMMO)) - bestWeapon = WP_ROCKET_LAUNCHER; - else if (BotWeaponSelectable(bs, WP_CONCUSSION) && (g_tweakWeapons.integer & WT_TRIBES) && (g_tweakWeapons.integer & WT_INFINITE_AMMO)) - bestWeapon = WP_CONCUSSION; else if (BotWeaponSelectableAltFire(bs, WP_BOWCASTER)) { bestWeapon = WP_BOWCASTER; bs->doAltAttack = 1; @@ -7041,14 +7176,6 @@ int NewBotAI_GetWeapon(bot_state_t *bs) bestWeapon = WP_DISRUPTOR; else if (BotWeaponSelectable(bs, WP_BLASTER)) bestWeapon = WP_BLASTER; - else if (BotWeaponSelectable(bs, WP_ROCKET_LAUNCHER) && (g_tweakWeapons.integer & WT_TRIBES) && (g_tweakWeapons.integer & WT_INFINITE_AMMO)) - bestWeapon = WP_ROCKET_LAUNCHER; - else if (BotWeaponSelectable(bs, WP_CONCUSSION) && (g_tweakWeapons.integer & WT_TRIBES) && (g_tweakWeapons.integer & WT_INFINITE_AMMO)) - bestWeapon = WP_CONCUSSION; - else if (BotWeaponSelectable(bs, WP_REPEATER) && (g_tweakWeapons.integer & WT_TRIBES) && (g_tweakWeapons.integer & WT_INFINITE_AMMO) && forcedFireMode != 1) { - bestWeapon = WP_REPEATER; - bs->doAltAttack = 1; - } else if (bs->cur_ps.stats[STAT_WEAPONS] & WP_SABER) bestWeapon = WP_SABER; else if (BotWeaponSelectableAltFire(bs, WP_BRYAR_OLD)) { @@ -7083,10 +7210,6 @@ int NewBotAI_GetWeapon(bot_state_t *bs) else if (BotWeaponSelectableAltFire(bs, WP_STUN_BATON) && (g_tweakWeapons.integer & WT_STUN_LG) && !(g_tweakWeapons.integer & WT_STUN_HEAL)) { bestWeapon = WP_STUN_BATON; } - else if (BotWeaponSelectable(bs, WP_ROCKET_LAUNCHER) && (g_tweakWeapons.integer & WT_TRIBES) && (g_tweakWeapons.integer & WT_INFINITE_AMMO)) - bestWeapon = WP_ROCKET_LAUNCHER; - else if (BotWeaponSelectable(bs, WP_CONCUSSION) && (g_tweakWeapons.integer & WT_TRIBES) && (g_tweakWeapons.integer & WT_INFINITE_AMMO)) - bestWeapon = WP_CONCUSSION; else if (bs->cur_ps.stats[STAT_WEAPONS] & WP_SABER) bestWeapon = WP_SABER; else if (BotWeaponSelectableAltFire(bs, WP_BRYAR_OLD)) { @@ -7217,7 +7340,10 @@ void NewBotAI_GetAttack(bot_state_t *bs) int weapon; // const float speed = NewBotAI_GetSpeedTowardsEnemy(bs); - weapon = NewBotAI_GetWeapon(bs); + if (g_tweakWeapons.integer & WT_TRIBES) + weapon = NewBotAI_GetTribesWeapon(bs); + else + weapon = NewBotAI_GetWeapon(bs); BotSelectWeapon(bs->client, weapon); if (bs->runningLikeASissy) //Dont attack when chasing them with strafe i guess @@ -8348,6 +8474,68 @@ void NewBotAI_NF(bot_state_t *bs) //NewBotAI_GetAttack(bs); } +void NewBotAI_Tribes(bot_state_t *bs, float thinktime) +{ + + if (bs->cur_ps.eFlags & EF_JETPACK_FLAMING || bs->cur_ps.eFlags & EF_JETPACK_ACTIVE) { + //if (!(bs->cur_ps.pm_flags & PMF_JUMP_HELD)) + //{ + //bs->jumpTime = level.time + 200; + //bs->jumpHoldTime = level.time + 200; + //} + //Com_Printf("2 Still going up\n"); + trap->EA_Jump(bs->client); + } + else if (bs->cur_ps.fd.forcePower > 98) { + //Com_Printf("1 Going up\n"); + //bs->jumpTime = level.time + 200; + //bs->jumpHoldTime = level.time + 200; + trap->EA_Jump(bs->client); + } + else { + //Com_Printf("3 Flaming? %i, Active? %i, FP: %i\n", (bs->cur_ps.eFlags & EF_JETPACK_FLAMING), bs->cur_ps.eFlags & EF_JETPACK_ACTIVE, bs->cur_ps.fd.forcePower); + } + + + /* + if (bs->jumpTime > level.time && bs->jDelay < level.time) + { + if (bs->jumpHoldTime > level.time) + { + trap->EA_Jump(bs->client); + if (bs->wpCurrent) + { + if ((bs->wpCurrent->origin[2] - bs->origin[2]) < 64) + { + trap->EA_MoveForward(bs->client); + } + } + else + { + trap->EA_MoveForward(bs->client); + } + if (g_entities[bs->client].client->ps.groundEntityNum == ENTITYNUM_NONE) + { + g_entities[bs->client].client->ps.pm_flags |= PMF_JUMP_HELD; + } + } + else if (!(bs->cur_ps.pm_flags & PMF_JUMP_HELD)) + { + trap->EA_Jump(bs->client); + } + */ + + trap->EA_Action(bs->client, ACTION_SKI); + + + StandardBotAI(bs, thinktime); + NewBotAI_GetAim(bs); + NewBotAI_GetAttack(bs); + + //NewBotAI_GetMovement(bs); + //NewBotAI_GetAttack(bs); +} + void NewBotAI_StrafeJump(bot_state_t *bs, float distance) { qboolean aimright = qfalse; @@ -8728,6 +8916,11 @@ void NewBotAI(bot_state_t *bs, float thinktime) //BOT START } */ + if (g_movementStyle.integer == MV_TRIBES && (g_startingItems.integer & (1 << HI_JETPACK))) { + NewBotAI_Tribes(bs, thinktime); + return; + } + if ((g_forcePowerDisable.integer != 163837 && g_forcePowerDisable.integer != 163839) || (g_flipKick.integer) || (bs->cur_ps.weapon != WP_SABER)) { if (bs->currentEnemy->client->ps.fd.forceSide == FORCE_LIGHTSIDE) { // They are LS. if (bs->cur_ps.fd.forceSide == FORCE_LIGHTSIDE) diff --git a/codemp/game/bg_pmove.c b/codemp/game/bg_pmove.c index ea0b76cfe0..6caed28792 100644 --- a/codemp/game/bg_pmove.c +++ b/codemp/game/bg_pmove.c @@ -6944,7 +6944,7 @@ static qboolean BG_AreRunWalkAnimsFixed(void) { #elif defined(_CGAME) const char *cs = CG_ConfigString(CS_LEGACY_FIXES); const uint32_t legacyFixes = strtoul(cs, NULL, 0); - return (legacyFixes & (1 << LEGACYFIX_RUNWALKANIMS)) != 0; + return !!(legacyFixes & (1 << LEGACYFIX_RUNWALKANIMS)); #endif } @@ -13601,6 +13601,16 @@ void PmoveSingle (pmove_t *pmove) { //Probably need to do something here to give it 2 stages. 1: Low velocity accel boost which fades away as you start getting fast. if (pm->ps->velocity[2] > 0 && pm->ps->velocity[2] < 250) { float hackscale = 250.0f / pm->ps->velocity[2]; + + if (hackscale > 1.4f) + hackscale = 1.4f; + else if (hackscale < 1) + hackscale = 1; + + pm->ps->velocity[2] += 425.0f * pml.frametime * upScale * hackscale;//was 18 with no grav + +#if 0 + float hackscale = 250.0f / pm->ps->velocity[2]; float hackscale2 = (pm->ps->velocity[0]*pm->ps->velocity[0] + pm->ps->velocity[1]*pm->ps->velocity[1]) / (700 * 700); if (hackscale2 < 1) @@ -13614,26 +13624,24 @@ void PmoveSingle (pmove_t *pmove) { hackscale = 1; pm->ps->velocity[2] += 425.0f * pml.frametime * upScale * hackscale;//was 18 with no grav +#endif } else if (pm->ps->velocity[2] < 0) { //This is fucked. Start at 1.25 and get higher based on Z speed. Don't take XY into account..? - - if (1) - { - float hackscale = pm->ps->velocity[2] / -600; + float hackscale = pm->ps->velocity[2] / -600; - if (hackscale < 1.4f) - hackscale = 1.4f; + if (hackscale < 1.4f) + hackscale = 1.4f; - if (hackscale > 4.0f) - hackscale = 4.0f; + if (hackscale > 4.0f) + hackscale = 4.0f; - //Com_Printf("Hackscale z is %.2f\n", hackscale); + //Com_Printf("Hackscale z is %.2f\n", hackscale); - pm->ps->velocity[2] += 425.0f * pml.frametime * upScale * hackscale;//was 18 with no grav - } - else { + pm->ps->velocity[2] += 425.0f * pml.frametime * upScale * hackscale;//was 18 with no grav +#if 0 + { float hackscale = 1.25f; float hackscale2 = (pm->ps->velocity[0] * pm->ps->velocity[0] + pm->ps->velocity[1] * pm->ps->velocity[1]) / (700 * 700); @@ -13650,6 +13658,7 @@ void PmoveSingle (pmove_t *pmove) { pm->ps->velocity[2] += 425.0f * pml.frametime * upScale * hackscale;//was 18 with no grav } +#endif } else if (pm->ps->velocity[2] > 800) { float hackscale = 800.0f / pm->ps->velocity[2]; diff --git a/codemp/game/bg_public.h b/codemp/game/bg_public.h index 759b5b60f6..e621b37562 100644 --- a/codemp/game/bg_public.h +++ b/codemp/game/bg_public.h @@ -111,7 +111,6 @@ along with this program; if not, see . #define CS_FLAGSTATUS 23 // string indicating flag status in CTF #define CS_SHADERSTATE 24 #define CS_BOTINFO 25 -#define CS_LEGACY_FIXES 26 #define CS_ITEMS 27 // string of 0's and 1's that tell which items are present #define CS_CLIENT_JEDIMASTER 28 // current jedi master @@ -120,6 +119,8 @@ along with this program; if not, see . #define CS_CLIENT_DUELHEALTHS 31 // nmckenzie: DUEL_HEALTH. Hopefully adding this cs is safe and good? #define CS_GLOBAL_AMBIENT_SET 32 +#define CS_LEGACY_FIXES 36 + #define CS_AMBIENT_SET 37 #define CS_SIEGE_STATE (CS_AMBIENT_SET+MAX_AMBIENT_SETS) diff --git a/codemp/game/bg_slidemove.c b/codemp/game/bg_slidemove.c index 38e75c7615..ef95c428f5 100644 --- a/codemp/game/bg_slidemove.c +++ b/codemp/game/bg_slidemove.c @@ -472,7 +472,7 @@ void PM_VehicleImpact(bgEntity_t *pEnt, trace_t *trace) impactDot = DotProduct(moveDir, trace->plane.normal); magnitude *= -impactDot * 6 * g_newVehicleDamageScale.value; } - else + else #endif { float mult = (pSelfVeh->m_vOrientation[PITCH] * 0.1f); //Ths might be the dumbest way to calculate damage multiplier ever. todo: server cvar to fix vehicles @@ -833,7 +833,7 @@ qboolean PM_SlideMove( qboolean gravity ) { #endif PM_ClipVelocity(pm->ps->velocity, planes[i], clipVelocity, offset); //Loda this is causing deadstops on vertical seams. 1.5f? } - else + else PM_ClipVelocity(pm->ps->velocity, planes[i], clipVelocity, OVERCLIP); // slide along the plane PM_ClipVelocity (endVelocity, planes[i], endClipVelocity, OVERCLIP ); @@ -1180,10 +1180,10 @@ void PM_StepSlideMove( qboolean gravity ) { PM_ClipVelocity(pm->ps->velocity, trace.plane.normal, pm->ps->velocity, OVERCLIP); //How do we do this without redoing all the slope calculation. The T3 way is to look at the magnitute of what we lost, and then just re-add it to the current vel. But that gives us too much if its a nice smooth skii... - //Question is, how can we determine if we should have been clipped here or not. + //Question is, how can we determine if we should have been clipped here or not. lost = VectorLength(pm->ps->velocity) / oldSpeed; - //400, 600 = + //400, 600 = if (lost < 0.9f) { //We lost more than 10pct of our speed. Give it all back? float regain = 1.0f - lost; @@ -1191,7 +1191,7 @@ void PM_StepSlideMove( qboolean gravity ) { VectorScale(pm->ps->velocity, 1.0f + regain, pm->ps->velocity); } - //Look at pre speed + //Look at pre speed //Do the velocity clip //Look at post speed. If we lost too much, add it back. diff --git a/codemp/game/g_account.c b/codemp/game/g_account.c index 89075da5a3..f27f7bb106 100644 --- a/codemp/game/g_account.c +++ b/codemp/game/g_account.c @@ -1530,7 +1530,7 @@ void TimeSecToString(int duration_ms, char *timeStr, size_t strSize) { } } -void TimeToString(int duration_ms, char *timeStr, size_t strSize) { +void TimeToString(int duration_ms, char *timeStr, size_t strSize) { if (duration_ms > (60*60*1000)) { //thanks, eternal int hours, minutes, seconds, milliseconds; hours = (int)((duration_ms / (1000*60*60))); //wait wut @@ -1986,7 +1986,7 @@ void G_AddRaceTime(char *username, char *message, int duration_ms, int style, in i--; } lastDuration = duration; - } + } if (duration_ms < duration) { //We are faster than this time... If we dont find anything newrank stays -1 global_newRank = i; break; @@ -6075,7 +6075,7 @@ GROUP BY coursename, style, season } else tmpMsg = va("^5%2i^3: ^3%s\n", start + row, sqlite3_column_text(stmt, 0)); //Print username, inputstyle, coursename - + if (strlen(msg) + strlen(tmpMsg) >= sizeof(msg)) { trap->SendServerCommand(ent - g_entities, va("print \"%s\"", msg)); msg[0] = '\0'; diff --git a/codemp/game/g_client.c b/codemp/game/g_client.c index e3a81a7050..624fcacd8b 100644 --- a/codemp/game/g_client.c +++ b/codemp/game/g_client.c @@ -1269,7 +1269,7 @@ void ClientRespawn(gentity_t *ent) { } trap->UnlinkEntity((sharedEntity_t *)ent); - + if (level.gametype == GT_SIEGE) { if (g_siegeRespawn.integer) diff --git a/codemp/game/g_combat.c b/codemp/game/g_combat.c index 36182138dc..10a44f2a26 100644 --- a/codemp/game/g_combat.c +++ b/codemp/game/g_combat.c @@ -4968,10 +4968,10 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, vec3_ if ((mod == MOD_DISRUPTOR || mod == MOD_DISRUPTOR_SNIPER) && targ && targ->client && !(targ->client->ps.fd.forcePowersActive & (1 << FP_PROTECT)) && !(g_tweakWeapons.integer & WT_PROJ_SNIPER) && (g_tweakWeapons.integer & WT_TRIBES)) { - float cut; + float cut; if (g_tribesMode.integer) cut = 1 - ((damage * 0.0005)); - else + else cut = 1 - ((damage * 0.0025f)); if (cut > 1) @@ -5963,7 +5963,7 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, vec3_ if (targ->client->ps.fd.forcePower < 0) { if (g_tribesMode.integer) - subamt += targ->client->ps.fd.forcePower * 5; + subamt += targ->client->ps.fd.forcePower * 5; else subamt += targ->client->ps.fd.forcePower; targ->client->ps.fd.forcePower = 0; diff --git a/codemp/game/g_items.c b/codemp/game/g_items.c index 33013780d3..724ae7b228 100644 --- a/codemp/game/g_items.c +++ b/codemp/game/g_items.c @@ -571,7 +571,7 @@ void pas_fire( gentity_t *ent ) if (g_tweakWeapons.integer & WT_TRIBES) WP_FireTurretMissile(&g_entities[ent->genericValue3], myOrg, fwd, qfalse, 10*g_weaponDamageScale.value, 5220 * g_projectileVelocityScale.value, MOD_SENTRY, ent ); - else + else WP_FireTurretMissile(&g_entities[ent->genericValue3], myOrg, fwd, qfalse, 10*g_weaponDamageScale.value, 2300 * g_projectileVelocityScale.value, MOD_SENTRY, ent); G_RunObject(ent); @@ -2401,6 +2401,10 @@ int Pickup_Health (gentity_t *ent, gentity_t *other) { } other->client->ps.stats[STAT_HEALTH] = other->health; + if (g_showHealth.integer) + G_ScaleNetHealth(other); //WT_TRIBES rework + + if ( ent->item->quantity == 100 ) { // mega health respawns slow return RESPAWN_MEGAHEALTH; } @@ -2418,6 +2422,9 @@ int Pickup_Armor( gentity_t *ent, gentity_t *other ) other->client->ps.stats[STAT_ARMOR] = other->client->ps.stats[STAT_MAX_HEALTH] * ent->item->giTag; } + if (g_showHealth.integer) + G_ScaleNetHealth(other); //WT_TRIBES rework + return adjustRespawnTime(RESPAWN_ARMOR, ent->item->giType, ent->item->giTag); } diff --git a/codemp/game/g_svcmds.c b/codemp/game/g_svcmds.c index a555934560..5db252aea8 100644 --- a/codemp/game/g_svcmds.c +++ b/codemp/game/g_svcmds.c @@ -630,7 +630,7 @@ static void RemoveCTFFlags(void) { void SetGametypeFuncSolids( void ); void G_CacheGametype( void ); qboolean G_CallSpawn( gentity_t *ent ); -void Svcmd_ChangeGametype_f (void) { //because of "variable change -- restarting.\n" in the server code this will always trigger a full map reload.. when map restarts +void Svcmd_ChangeGametype_f (void) { //because of "variable change -- restarting.\n" in the server code this will always trigger a full map reload.. when map restarts char input[16]; int gametype, i, red = 0; gentity_t* ent; diff --git a/codemp/game/g_team.c b/codemp/game/g_team.c index a8ff73b400..90d068fd88 100644 --- a/codemp/game/g_team.c +++ b/codemp/game/g_team.c @@ -390,7 +390,10 @@ void Team_FragBonuses(gentity_t *targ, gentity_t *inflictor, gentity_t *attacker // did the attacker frag the flag carrier? if (targ->client->ps.powerups[enemy_flag_pw]) { attacker->client->pers.teamState.lastfraggedcarrier = level.time; - AddScore(attacker, targ->r.currentOrigin, CTF_FRAG_CARRIER_BONUS); + if (g_fixCTFScores.integer) + AddScore(attacker, targ->r.currentOrigin, 4); + else + AddScore(attacker, targ->r.currentOrigin, CTF_FRAG_CARRIER_BONUS); attacker->client->pers.teamState.fragcarrier++; if (g_fixCTFScores.integer) attacker->client->ps.persistant[PERS_DEFEND_COUNT]++; @@ -413,7 +416,10 @@ void Team_FragBonuses(gentity_t *targ, gentity_t *inflictor, gentity_t *attacker !attacker->client->ps.powerups[flag_pw]) { // attacker is on the same team as the flag carrier and // fragged a guy who hurt our flag carrier - AddScore(attacker, targ->r.currentOrigin, CTF_CARRIER_DANGER_PROTECT_BONUS); + if (g_fixCTFScores.integer) + AddScore(attacker, targ->r.currentOrigin, 1); + else + AddScore(attacker, targ->r.currentOrigin, CTF_CARRIER_DANGER_PROTECT_BONUS); attacker->client->pers.teamState.carrierdefense++; targ->client->pers.teamState.lasthurtcarrier = 0; @@ -428,7 +434,10 @@ void Team_FragBonuses(gentity_t *targ, gentity_t *inflictor, gentity_t *attacker if (targ->client->pers.teamState.lasthurtcarrier && level.time - targ->client->pers.teamState.lasthurtcarrier < CTF_CARRIER_DANGER_PROTECT_TIMEOUT) { // attacker is on the same team as the skull carrier and - AddScore(attacker, targ->r.currentOrigin, CTF_CARRIER_DANGER_PROTECT_BONUS); + if (g_fixCTFScores.integer) + AddScore(attacker, targ->r.currentOrigin, 1); + else + AddScore(attacker, targ->r.currentOrigin, CTF_CARRIER_DANGER_PROTECT_BONUS); attacker->client->pers.teamState.carrierdefense++; targ->client->pers.teamState.lasthurtcarrier = 0; @@ -484,7 +493,10 @@ void Team_FragBonuses(gentity_t *targ, gentity_t *inflictor, gentity_t *attacker attacker->client->sess.sessionTeam != targ->client->sess.sessionTeam) { // we defended the base flag - AddScore(attacker, targ->r.currentOrigin, CTF_FLAG_DEFENSE_BONUS); + if (g_fixCTFScores.integer) + AddScore(attacker, targ->r.currentOrigin, 1); + else + AddScore(attacker, targ->r.currentOrigin, CTF_FLAG_DEFENSE_BONUS); attacker->client->pers.teamState.basedefense++; attacker->client->ps.persistant[PERS_DEFEND_COUNT]++; @@ -502,7 +514,10 @@ void Team_FragBonuses(gentity_t *targ, gentity_t *inflictor, gentity_t *attacker ( VectorLength(v2) < CTF_ATTACKER_PROTECT_RADIUS && trap->InPVS(carrier->r.currentOrigin, attacker->r.currentOrigin ) ) ) && attacker->client->sess.sessionTeam != targ->client->sess.sessionTeam) { - AddScore(attacker, targ->r.currentOrigin, CTF_CARRIER_PROTECT_BONUS); + if (g_fixCTFScores.integer) + AddScore(attacker, targ->r.currentOrigin, 1); + else + AddScore(attacker, targ->r.currentOrigin, CTF_CARRIER_PROTECT_BONUS); attacker->client->pers.teamState.carrierdefense++; attacker->client->ps.persistant[PERS_DEFEND_COUNT]++; @@ -732,6 +747,7 @@ void G_AddSimpleStat(char *username, int type); int Team_TouchOneFlagBase (gentity_t *ent, gentity_t *other, int team) { // the flag is at home base. if the player has the enemy // flag, he's just won! + int points = CTF_CAPTURE_BONUS; //We need to respawn the flag that we have on our back to midfield @@ -759,9 +775,9 @@ int Team_TouchOneFlagBase (gentity_t *ent, gentity_t *other, int team) { // other gets another 10 frag bonus if (g_fixCTFScores.integer) - AddScore(other, ent->r.currentOrigin, 60); - else - AddScore(other, ent->r.currentOrigin, CTF_CAPTURE_BONUS); + points = 15; + + AddScore(other, ent->r.currentOrigin, points); if (cl->pers.stats.startTimeFlag) {//JAPRO SHITTY FLAG TIMER const float time = (level.time - cl->pers.stats.startTimeFlag) / 1000.0f; @@ -772,14 +788,14 @@ int Team_TouchOneFlagBase (gentity_t *ent, gentity_t *other, int team) { else average = cl->pers.stats.topSpeedFlag; - trap->SendServerCommand(-1, va("print \"%s^5 has captured the %s^5 flag in ^3%.2f^5 seconds with max of ^3%i^5 ups and average ^3%i^5 ups\n\"", cl->pers.netname, team == 2 ? "^1red" : "^4blue", time, (int)floorf(cl->pers.stats.topSpeedFlag + 0.5f), average)); + trap->SendServerCommand(-1, va("print \"%s^5 has captured the %s^5 flag in ^3%.2f^5 seconds with max of ^3%i^5 ups and average ^3%i^5 ups for ^3%i^5 points\n\"", cl->pers.netname, team == 2 ? "^1red" : "^4blue", time, (int)floorf(cl->pers.stats.topSpeedFlag + 0.5f), average, points)); cl->pers.stats.startTimeFlag = 0; cl->pers.stats.topSpeedFlag = 0; cl->pers.stats.displacementFlag = 0; cl->pers.stats.displacementFlagSamples = 0; } else - PrintCTFMessage(other->s.number, team, CTFMESSAGE_PLAYER_CAPTURED_FLAG); + PrintCTFMessage(other->s.number, team, CTFMESSAGE_PLAYER_CAPTURED_FLAG); #if _DEBUGCTFCRASH G_SecurityLogPrintf("Team_TouchOurFlag function reached point z, Enemy Flag is %i\n", enemy_flag); @@ -833,10 +849,51 @@ int Team_TouchOurFlag( gentity_t *ent, gentity_t *other, int team ) { // hey, its not home. return it by teleporting it back //PrintMsg( NULL, "%s" S_COLOR_WHITE " returned the %s flag!\n", // cl->pers.netname, TeamName(team)); - PrintCTFMessage(other->s.number, team, CTFMESSAGE_PLAYER_RETURNED_FLAG); + if (other->client && g_fixCTFScores.integer) { + float enemyDist, myDist, percent; + int points; + gentity_t *flag = NULL; + char *enemyflag, *myflag; + if (team == TEAM_RED) { + enemyflag = "team_CTF_blueflag"; + myflag = "team_CTF_redflag"; + } + else if (team == TEAM_BLUE) { + enemyflag = "team_CTF_redflag"; + myflag = "team_CTF_blueflag"; + } + while ((flag = G_Find(flag, FOFS(classname), enemyflag)) != NULL) { + if (flag->s.origin[0] || flag->s.origin[1] || flag->s.origin[2]) { //How better to tell if this flag is at home? + enemyDist = Distance(flag->s.origin, ent->s.pos.trBase); + } + //Com_Printf("Found flag %s %.2f %.2f\n", classname, flag->s.origin[0], flag->s.origin[1]); + } + while ((flag = G_Find(flag, FOFS(classname), myflag)) != NULL) { + if (flag->s.origin[0] || flag->s.origin[1] || flag->s.origin[2]) { //How better to tell if this flag is at home? + myDist = Distance(flag->s.origin, ent->s.pos.trBase); + } + //Com_Printf("Found flag %s %.2f %.2f\n", classname, flag->s.origin[0], flag->s.origin[1]); + } + //Com_Printf("Touching enemy flag, it was %.0f away from our flag base.\n", points); + //Com_Printf("Enemy dist %.2f, My dist %.2f\n", enemyDist, myDist); + + percent = (enemyDist + myDist) ? (myDist / ((enemyDist + myDist)) * 100) : 1; + if (percent < 10) { + trap->SendServerCommand(-1, va("print \"%s^5 has returned the %s^5 flag ^3<10^5 percent of the way to enemy base for ^30^5 points\n\"", cl->pers.netname, team == 1 ? "^1red" : "^4blue")); + } + else { + points = (int)(CTF_RECOVERY_BONUS * percent*0.01f); + trap->SendServerCommand(-1, va("print \"%s^5 has returned the %s^5 flag ^3%.0f^5 percent of the way to enemy base for ^3%i^5 points\n\"", cl->pers.netname, team == 1 ? "^1red" : "^4blue", percent, points)); + } + + AddScore(other, ent->r.currentOrigin, CTF_RECOVERY_BONUS); + } + else { + PrintCTFMessage(other->s.number, team, CTFMESSAGE_PLAYER_RETURNED_FLAG); + AddScore(other, ent->r.currentOrigin, CTF_RECOVERY_BONUS); + } - AddScore(other, ent->r.currentOrigin, CTF_RECOVERY_BONUS); other->client->pers.teamState.flagrecovery++; if (other->client->pers.userName[0]) G_AddSimpleStat(other->client->pers.userName, 5); @@ -982,7 +1039,10 @@ int Team_TouchOurFlag( gentity_t *ent, gentity_t *other, int team ) { // award extra points for capture assists if (player->client->pers.teamState.lastreturnedflag + CTF_RETURN_FLAG_ASSIST_TIMEOUT > level.time) { - AddScore (player, ent->r.currentOrigin, CTF_RETURN_FLAG_ASSIST_BONUS); + if (g_fixCTFScores.integer) + AddScore(player, ent->r.currentOrigin, 3); + else + AddScore (player, ent->r.currentOrigin, CTF_RETURN_FLAG_ASSIST_BONUS); other->client->pers.teamState.assists++; player->client->ps.persistant[PERS_ASSIST_COUNT]++; @@ -991,7 +1051,10 @@ int Team_TouchOurFlag( gentity_t *ent, gentity_t *other, int team ) { } if (player->client->pers.teamState.lastfraggedcarrier + CTF_FRAG_CARRIER_ASSIST_TIMEOUT > level.time) { - AddScore(player, ent->r.currentOrigin, CTF_FRAG_CARRIER_ASSIST_BONUS); + if (g_fixCTFScores.integer) + AddScore(player, ent->r.currentOrigin, 3); + else + AddScore(player, ent->r.currentOrigin, CTF_FRAG_CARRIER_ASSIST_BONUS); other->client->pers.teamState.assists++; player->client->ps.persistant[PERS_ASSIST_COUNT]++; player->client->rewardTime = level.time + REWARD_SPRITE_TIME; @@ -1021,6 +1084,7 @@ int Team_TouchEnemyFlag( gentity_t *ent, gentity_t *other, int team ) { int touch[MAX_GENTITIES]; gentity_t* enemy; float enemyDist, dist; + int points = 0; #if _DEBUGCTFCRASH G_SecurityLogPrintf("Team_TouchEnemyFlag called \n"); @@ -1085,6 +1149,18 @@ int Team_TouchEnemyFlag( gentity_t *ent, gentity_t *other, int team ) { } } else { + if (g_fixCTFScores.integer) { + float speed = VectorLength(other->client->ps.velocity); + int points = 0; + if (speed > 1000) + points = 1; + if (speed > 2000) + points = 2; + if (points == 1) + trap->SendServerCommand(other->s.number, va("print \"You grabbed the %s^5 flag at ^3%.0f^5 ups for ^31^5 point\n\"", team == 2 ? "^1red" : "^4blue", speed)); + else + trap->SendServerCommand(other->s.number, va("print \"You grabbed the %s^5 flag at ^3%.0f^5 ups for ^3%i^5 points\n\"", team == 2 ? "^1red" : "^4blue", speed, points)); + } PrintCTFMessage(other->s.number, team, CTFMESSAGE_PLAYER_GOT_FLAG); } if (team == TEAM_RED) @@ -1111,13 +1187,16 @@ int Team_TouchEnemyFlag( gentity_t *ent, gentity_t *other, int team ) { if (g_fixCTFScores.integer) { if ((team == TEAM_RED && teamgame.redStatus == FLAG_ATBASE && teamgame.blueStatus != FLAG_ATBASE) || (team == TEAM_BLUE && teamgame.blueStatus == FLAG_ATBASE && teamgame.redStatus != FLAG_ATBASE)) { //Flag was "egrabbed". - AddScore(other, ent->r.currentOrigin, 5); + AddScore(other, ent->r.currentOrigin, points); } } else if (!g_allowFlagThrow.integer && (g_neutralFlag.integer != 2)) { AddScore(other, ent->r.currentOrigin, CTF_FLAG_BONUS); } + // Increase the team's score + //AddTeamScore(ent->s.pos.trBase, other->client->sess.sessionTeam, 1, qtrue); //wtf why? + Team_SetFlagStatus( team, FLAG_TAKEN ); cl->pers.teamState.flagsince = level.time; diff --git a/codemp/game/g_trigger.c b/codemp/game/g_trigger.c index 6a90ea0dcb..a89ba1791f 100644 --- a/codemp/game/g_trigger.c +++ b/codemp/game/g_trigger.c @@ -1674,7 +1674,7 @@ void TimerStop(gentity_t *trigger, gentity_t *player, trace_t *trace) {//JAPRO T //Com_Printf("Flag: %i, Objective %i, player objectives %i\n", restrictions, trigger->objective, player->client->pers.stats.checkpoints); //If player has MORe checkpoints than the end trigger requires, that also fails. Fix this? - if (trigger->spawnflags & (1 << 7) && (trigger->objective & player->client->pers.stats.checkpoints) != trigger->objective) {//spawnflags 128 is required checkpoints. + if (trigger->spawnflags & (1 << 7) && (trigger->objective & player->client->pers.stats.checkpoints) != trigger->objective) {//spawnflags 128 is required checkpoints. if (time > 2000 && (player->client->lastKickTime < level.time)) {//sad hack to avoid spamming people who just start run(trigger on opposite side of start) trap->SendServerCommand(player - g_entities, "cp \"^3Warning: you are missing some required checkpoints!\n\n\n\n\n\n\n\n\n\n\""); //Print the checkpoint(s) its missing? player->client->lastKickTime = level.time + 1000; diff --git a/codemp/game/g_weapon.c b/codemp/game/g_weapon.c index 658cdb9db7..7c93312f94 100644 --- a/codemp/game/g_weapon.c +++ b/codemp/game/g_weapon.c @@ -271,7 +271,7 @@ static void WP_FireBryarPistol( gentity_t *ent, qboolean altFire, int seed ) charge = 400; vel = 10440 * g_projectileVelocityScale.value; if (ent->client->ps.jetpackFuel > 0) - ent->client->ps.jetpackFuel -= 9; + ent->client->ps.jetpackFuel -= 7; if (ent->client->ps.jetpackFuel < 0) ent->client->ps.jetpackFuel = 0; } @@ -306,7 +306,7 @@ static void WP_FireBryarPistol( gentity_t *ent, qboolean altFire, int seed ) AngleVectors(angs, dir, NULL, NULL); } - + missile = CreateMissileNew(muzzle, dir, vel, 10000, ent, altFire, qtrue, qtrue); missile->classname = "bryar_proj"; missile->s.weapon = WP_BRYAR_PISTOL; @@ -2569,7 +2569,7 @@ static void WP_CreateFlechetteBouncyThing( vec3_t start, vec3_t fwd, gentity_t * //[JAPRO - Serverside - Weapons - Tweak weapons Nerf Alt Flechette Dmg - End] missile->dflags = 0; - + missile->r.svFlags = SVF_USE_CURRENT_ORIGIN; missile->methodOfDeath = MOD_FLECHETTE_ALT_SPLASH; @@ -2897,7 +2897,7 @@ void rocketThink( gentity_t *ent ) //If its close blow it up. //ent->think = G_ExplodeMissile; //} - /*else*/ + /*else*/ dist = VectorLengthSquared(dir); if (g_tweakWeapons.integer & WT_TRIBES)