From 26a1dc5ebdb014877d88b01b863cf300748f1c06 Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Fri, 16 Mar 2012 01:52:05 +0200 Subject: [PATCH] Damage offset for bots depending on skill. Needs to be balanced better --- data/botsVT.cfg | 2 ++ data/qcsrc/server/g_damage.qc | 12 ++++++++++++ docs/Release notes.txt | 2 ++ docs/TODO.txt | 4 +++- 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/data/botsVT.cfg b/data/botsVT.cfg index cf3757b0..74349ebf 100644 --- a/data/botsVT.cfg +++ b/data/botsVT.cfg @@ -7,6 +7,8 @@ set bot_god 0 "When set, all bots are god mode (take no damage)" seta bot_prefix ^8[BOT]^7 "Prefix in front of the bot names" seta bot_suffix "" "Suffix behind the bot names" seta skill_auto 0 "when 1, \"skill\" gets adjusted to match the best player on the map" +seta skill_damage 1.1 "the greater or lower the skill, the more / less damage bots will do or take" +seta skill_damage_center 5 "center skill around which to apply the damage offset" set bot_navigation_ignoreplayers 0 // FIXME remove this once the issue is solved set bot_sound_monopoly 0 "when enabled, only bots can make any noise" diff --git a/data/qcsrc/server/g_damage.qc b/data/qcsrc/server/g_damage.qc index 4b304b89..f28095d0 100644 --- a/data/qcsrc/server/g_damage.qc +++ b/data/qcsrc/server/g_damage.qc @@ -798,6 +798,18 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float force = force * cvar("g_ctf_flagcarrier_selfforce"); } + // skill-based damage offset for bots + if(skill && cvar("skill_damage")) + { + float ofs; + ofs = pow(skill / cvar("skill_damage_center"), cvar("skill_damage")); + if(clienttype(attacker) == CLIENTTYPE_BOT) + damage *= ofs; + if(clienttype(targ) == CLIENTTYPE_BOT) + damage /= ofs; +dprint(strcat(ftos(ofs), " --------\n")); + } + // count the damage if(attacker) if(!targ.deadflag) diff --git a/docs/Release notes.txt b/docs/Release notes.txt index 8af4e482..0229f8c5 100644 --- a/docs/Release notes.txt +++ b/docs/Release notes.txt @@ -300,6 +300,8 @@ Features: - Bootable subsystems. The crosshair, HUD, and helper voice will take 2 seconds to startup when the player spawns. Also, if armor (now considered charge) is below 5, you will not have enough energy to run your subsystems, and must wait for your armor to recharge. +- Skill based damage for bots. The higher the skill, the more damage bots do and the less they take. At the highest skill, bots are extremely difficult to defeat. Does not apply to campaign. + - The Grabber now has a screen which displays ammo count as well as weapon load. - Improvements to the vixen mesh. Models have been switched from zym to iqm (better and newer format), polygon count has been doubled, stomach bulges are more detailed, and the vixens are a bit more chubby and fluffy. diff --git a/docs/TODO.txt b/docs/TODO.txt index aa2f09d0..5799fc54 100644 --- a/docs/TODO.txt +++ b/docs/TODO.txt @@ -144,4 +144,6 @@ - 0.8: Scoreboard doesn't show when HUD is disabled (sbar_hudselector is 0) -- 0.8: Weapons menu: Center setting for the gun? \ No newline at end of file +- 0.8: Weapons menu: Center setting for the gun? + +- 0.7: Why does bot_number still get stuck at 7? \ No newline at end of file -- 2.39.2