Damage offset for bots depending on skill. Needs to be balanced better
[voretournament/voretournament.git] / data / qcsrc / server / g_damage.qc
index 4b304b8..f28095d 100644 (file)
@@ -798,6 +798,18 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                        force = force * cvar("g_ctf_flagcarrier_selfforce");\r
                }\r
 \r
+               // skill-based damage offset for bots\r
+               if(skill && cvar("skill_damage"))\r
+               {\r
+                       float ofs;\r
+                       ofs = pow(skill / cvar("skill_damage_center"), cvar("skill_damage"));\r
+                       if(clienttype(attacker) == CLIENTTYPE_BOT)\r
+                               damage *= ofs;\r
+                       if(clienttype(targ) == CLIENTTYPE_BOT)\r
+                               damage /= ofs;\r
+dprint(strcat(ftos(ofs), " --------\n"));\r
+               }\r
+\r
                // count the damage\r
                if(attacker)\r
                if(!targ.deadflag)\r