Skip to content

Commit

Permalink
Give more score for items returned that are more valuable
Browse files Browse the repository at this point in the history
  • Loading branch information
LoneWolfHT committed Aug 17, 2024
1 parent 3079fd2 commit b9c7363
Showing 1 changed file with 31 additions and 51 deletions.
82 changes: 31 additions & 51 deletions mods/ctf/ctf_teams/team_chest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,58 +5,37 @@ local blacklist = {
"default:pick_stone",
}

--[[

local item_value = {
["grenades:poison"] = 5,
["grenades:frag"] = 6,
["grenades:smoke"] = 2,
["ctf_ranged:pistol_loaded"] = 2,
["ctf_ranged:pistol"] = 1,
["ctf_ranged:rifle"] = 4,
["ctf_ranged:rifle_loaded"] = 5,
["ctf_ranged:smg"] = 4,
["ctf_ranged:smg_loaded"] = 5,
["ctf_ranged:sniper_magnum"] = 8,
["default:sword_diamond" ] = 16,
["default:sword_mese" ] = 13,
["ctf_ranged:shotgun_loaded" ] = 12,
["ctf_ranged:shotgun" ] = 10,
["ctf_ranged:sniper_magnum_loaded"] = 10,
["ctf_ranged:ammo"] = 4,
["default:diamond"] = 2.5,
["default:mese_crystal"] = 2,
["default:mese"] = 18,
["default:steel_ingot"] = 1,
["default:iron_lump"] = 1,
["default:sword_diamond"] = 16,
["default:sword_steel"] = 7,
["default:sword_mese"] = 13,
["default:pick_steel"] = 3,
["default:pick_mese"] = 6,
["default:pick_diamond"] = 7,
["default:axe_steel"] = 3,
["default:axe_mese"] = 6,
["default:axe_diamond"] = 7,
["default:shovel_steel"] = 2,
["default:shovel_mese"] = 3,
["default:shovel_diamond"] = 4,
["default:stick"] = 0.5,
["default:wood"] = 1,
["default:cobble"] = 1,
["ctf_map:reinforced_cobble"] = 3,
["ctf_map:damage_cobble"] = 3,
["ctf_map:unwalkable_cobble"] = 1,
["ctf_map:unwalkable_stone"] = 1,
["ctf_map:unwalkable_dirt"] = 1,
["default:steelblock"] = 2.5,
["default:bronzeblock"] = 2.5,
["default:obsidian_block"] = 3.5,
["ctf_map:spike"] = 2.5,
["default:apple"] = 1.5,
["ctf_healing:medkit"] = 6,
["ctf_healing:bandage"] = 6,
["ctf_ranged:sniper_magnum" ] = 8,
["default:sword_steel" ] = 7,
["default:pick_diamond" ] = 7,
["default:axe_diamond" ] = 7,
["grenades:frag" ] = 6,
["default:pick_mese" ] = 6,
["ctf_healing:medkit" ] = 6,
["default:axe_mese" ] = 6,
["grenades:poison" ] = 5,
["ctf_ranged:rifle_loaded" ] = 5,
["ctf_ranged:smg_loaded" ] = 5,
["ctf_ranged:rifle" ] = 4,
["ctf_ranged:smg" ] = 4,
["ctf_healing:bandage" ] = 4,
["default:shovel_diamond" ] = 4,
["default:pick_steel" ] = 3,
["default:axe_steel" ] = 3,
["default:shovel_mese" ] = 3,
["grenades:smoke" ] = 2,
["ctf_ranged:pistol_loaded" ] = 2,
["default:mese_crystal" ] = 2,
["default:shovel_steel" ] = 2,
["ctf_ranged:pistol" ] = 1,
}
--]]





local function get_chest_access(name)
local current_mode = ctf_modebase:get_current_mode()
Expand Down Expand Up @@ -312,8 +291,9 @@ for _, team in ipairs(ctf_teams.teamlist) do
if dropped_by ~= pname and dropped_by ~= "" then
local cur_mode = ctf_modebase:get_current_mode()
if pname and cur_mode then
--local score = (item_value[stack:get_name()] or 0) * stack:get_count()
cur_mode.recent_rankings.add(pname, { score = 1 }, false)
local score = item_value[stack:get_name()] or 1

cur_mode.recent_rankings.add(pname, { score = score }, false)
end
end
meta:set_string("dropped_by", "")
Expand Down

0 comments on commit b9c7363

Please sign in to comment.