From 93693a8dfdccf2b2cee41774fdc5325070fc98c8 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sat, 14 Mar 2020 17:22:55 +0000 Subject: [PATCH] Add rocketeer class --- mods/ctf/ctf_classes/gui.lua | 4 ++-- mods/ctf/ctf_classes/init.lua | 20 ++++++++++++++++++ mods/ctf/ctf_classes/ranged.lua | 6 ++++-- .../textures/ctf_classes_rocketeer.png | Bin 0 -> 679 bytes mods/other/give_initial_stuff/init.lua | 8 ++++++- 5 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 mods/ctf/ctf_classes/textures/ctf_classes_rocketeer.png 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 0000000000000000000000000000000000000000..3b2dc4d1cc0e433a2c15bc2a09ea3b165f257324 GIT binary patch literal 679 zcmV;Y0$BZtP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2i^x1 z4jMIOyV%tL00JjTL_t(I%bk-yXcJ)=#(!U^shASb1KUeW@gJ5$keXD`f>4UYC|nu{ z3PC7zIXYx)JQ|6Lj!TBgd@WV%{9DlAHVj51Uj2q zt%jy)7>*-yxg4fxQYw{XC!{C9Fbq7;L(?=`qK>7i(zb1UNNues-E5YP(GU-k@sm05 z>-%<<^)KI~ZQJO&&K<`QFP}e^Q{xJ?wW7S6oIA|OQf~{FMy~>(>pC+xPYHnQ+bywN zahbYtj@nvLw%ctonGC9`9tWw@hN36{ykC6H?U^{A-!3sesZ&|C<=p)dUMw~ND3wYg zolYMEIw1f%Etdf$z{ZD90E|!StgNiag@py`^*WYiowQ(C7CSAMoz_8UeDTCsm~c1@ zKr|X