diff --git a/mods/ctf/ctf_classes/gui.lua b/mods/ctf/ctf_classes/gui.lua index 9d2aef2..e87e449 100644 --- a/mods/ctf/ctf_classes/gui.lua +++ b/mods/ctf/ctf_classes/gui.lua @@ -2,12 +2,12 @@ function ctf_classes.show_gui(name, player) player = player or minetest.get_player_by_name(name) assert(player.get_player_name) if not ctf_classes.can_change(player) then - minetest.chat_send_player(name, "Move closer to the flag to change classes!") + minetest.chat_send_player(name, "Move closer to your flag to change classes!") return end local fs = { - "size[9,3.4]" + "size[", #ctf_classes.__classes_ordered * 3 , ",3.4]" } diff --git a/mods/ctf/ctf_classes/init.lua b/mods/ctf/ctf_classes/init.lua index e6d2734..8eb17c1 100644 --- a/mods/ctf/ctf_classes/init.lua +++ b/mods/ctf/ctf_classes/init.lua @@ -76,6 +76,26 @@ ctf_classes.register("medic", { }, }) +ctf_classes.register("rocketeer", { + description = "Rocketeer", + pros = { "Can craft rockets" }, + cons = {}, + color = "#fa0", + properties = { + items = { + "shooter:rocket_gun_loaded", + "shooter:rocket 4", + }, + + allowed_guns = { + "shooter:pistol", + "shooter:smg", + "shooter:shotgun", + }, + }, +}) + + minetest.register_on_joinplayer(function(player) ctf_classes.update(player) diff --git a/mods/ctf/ctf_classes/ranged.lua b/mods/ctf/ctf_classes/ranged.lua index 4d8702f..8f4dd9a 100644 --- a/mods/ctf/ctf_classes/ranged.lua +++ b/mods/ctf/ctf_classes/ranged.lua @@ -17,8 +17,10 @@ local function get_shooter_specs(weapon_name, multiplier) spec = table.copy(spec) specs_cache[idx] = spec - spec.range = spec.range * 1.5 - spec.tool_caps.full_punch_interval = spec.tool_caps.full_punch_interval * 0.8 + for key, value in pairs(multiplier) do + spec[key] = spec[key] * value + end + return spec end diff --git a/mods/ctf/ctf_classes/textures/ctf_classes_rocketeer.png b/mods/ctf/ctf_classes/textures/ctf_classes_rocketeer.png new file mode 100644 index 0000000..3b2dc4d Binary files /dev/null and b/mods/ctf/ctf_classes/textures/ctf_classes_rocketeer.png differ diff --git a/mods/other/give_initial_stuff/init.lua b/mods/other/give_initial_stuff/init.lua index 6ba9cd5..bd1936c 100644 --- a/mods/other/give_initial_stuff/init.lua +++ b/mods/other/give_initial_stuff/init.lua @@ -28,13 +28,19 @@ function give_initial_stuff.register_stuff_provider(func, priority) end function give_initial_stuff.get_stuff(player) + local seen_stuff = {} + local stuff = {} for i=1, #registered_stuff_providers do local new_stuff = registered_stuff_providers[i](player) assert(new_stuff) for j=1, #new_stuff do - stuff[#stuff + 1] = new_stuff[j] + local name = ItemStack(new_stuff[j]):get_name() + if not seen_stuff[name] then + seen_stuff[name] = true + stuff[#stuff + 1] = new_stuff[j] + end end end return stuff