From 87454dd0e3c939899f1fd6ca8504f94c0c5903b0 Mon Sep 17 00:00:00 2001 From: Anand S <36130650+ClobberXD@users.noreply.github.com> Date: Thu, 15 Feb 2018 13:34:34 +0530 Subject: [PATCH] Improve ctf_stats * Modified ctf_stats/init.lua * Modified ctf_stats/init.lua - Max. points for a kill has been increased from 150 to 200 - good_weapons list has been modified to include *all* mese and diamond implements - Minor corrections in comments * Delete init.lua Was created by accident in the root directory of repo --- mods/ctf_stats/init.lua | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/mods/ctf_stats/init.lua b/mods/ctf_stats/init.lua index 6a4aaf0..c98c5cc 100644 --- a/mods/ctf_stats/init.lua +++ b/mods/ctf_stats/init.lua @@ -189,16 +189,24 @@ ctf_flag.register_on_precapture(function(name, flag) return true end) +-- good_weapons now includes all mese and diamond implements, and swords of steel and better local good_weapons = { "default:sword_steel", "default:sword_bronze", "default:sword_mese", "default:sword_diamond", + "default:pick_mese" + "default:pick_diamond" + "default:axe_mese" + "default:axe_diamond" + "default:shovel_mese" + "default:shovel_diamond" "shooter:grenade", "shooter:shotgun", "shooter:rifle", "shooter:machine_gun", } + local function invHasGoodWeapons(inv) for _, weapon in pairs(good_weapons) do if inv:contains_item("main", weapon) then @@ -216,7 +224,7 @@ local function calculateKillReward(victim, killer) ctf.log("ctf_stats", "Player " .. victim .. " has made " .. reward .. " score worth of kills since last death") - -- 15 * kd ration, with variable based on player's score + -- 30 * K/D ratio, with variable based on player's score local kdreward = 30 * vmain.kills / (vmain.deaths + 1) local max = vmain.score / 6 if kdreward > max then @@ -227,9 +235,9 @@ local function calculateKillReward(victim, killer) end reward = reward + kdreward - -- Limited to 0 <= X <= 100 - if reward > 150 then - reward = 150 + -- Limited to 0 <= X <= 200 + if reward > 200 then + reward = 200 elseif reward < 14 then reward = 14 end