Re-add rocketeer class

This commit is contained in:
philipmi 2021-02-07 21:53:20 +01:00
parent 81bd8ca9b2
commit 04c75c989d
6 changed files with 33 additions and 20 deletions

View file

@ -2,8 +2,8 @@ ctf_classes.default_class = "knight"
ctf_classes.register("knight", {
description = "Knight",
pros = { "Skilled with swords", "+50% health points" },
cons = { "-10% speed" },
pros = { ">Skilled with swords", "> +50% health points" },
cons = { "> -10% speed" },
color = "#ccc",
properties = {
max_hp = 30,
@ -23,8 +23,8 @@ ctf_classes.register("knight", {
ctf_classes.register("shooter", {
description = "Sharp Shooter",
pros = { "Skilled with ranged weapons", "Can craft/use sniper rifles"},
cons = {"-25% health points"},
pros = { ">Skilled with ranged", "weapons and can", "craft/use sniper rifles"},
cons = { "> -20% health points" },
color = "#c60",
properties = {
allow_grapples = true,
@ -72,7 +72,7 @@ ctf_classes.register("shooter", {
ctf_classes.register("medic", {
description = "Medic",
pros = { "x2 regen for nearby friendlies", "Building supplies + Paxel", "+10% speed" },
pros = { ">x2 regen for nearby", "friendlies", ">Building supplies +", "Paxel", "> +10% speed" },
cons = {},
color = "#0af",
properties = {
@ -154,12 +154,16 @@ ctf_classes.register("sniper", {
})
]]--
--[[ctf_classes.register("rocketeer", {
ctf_classes.register("rocketeer", {
description = "Rocketeer",
pros = { "Can craft rockets" },
cons = {},
pros = { ">Can craft/use rockets" },
cons = { "> -50% health points" },
color = "#fa0",
properties = {
-- Disallow rocketeers from capturing flags - they're intended to be support
can_capture = false,
max_hp = 10,
initial_stuff = {
"shooter_rocket:rocket_gun_loaded",
"shooter_rocket:rocket 4",
@ -171,12 +175,10 @@ ctf_classes.register("sniper", {
allowed_guns = {
"shooter_guns:pistol",
"shooter_guns:machine_gun",
"shooter_guns:shotgun",
},
crafting = {
"shooter_rocket:rocket"
},
},
})]]
})

View file

@ -24,7 +24,7 @@ function ctf_classes.show_gui(name, player)
fs[#fs + 1] = "]"
fs[#fs + 1] = "tableoptions[background=#00000000;highlight=#00000000;border=false]"
fs[#fs + 1] = "tablecolumns[color;text]"
fs[#fs + 1] = "table[0,0.9;2.8,2.2;;"
fs[#fs + 1] = "table[0,0.9;3.0,2.25;;"
fs[#fs + 1] = class.color
fs[#fs + 1] = ","
fs[#fs + 1] = minetest.formspec_escape(class.description)

View file

@ -8,24 +8,24 @@ local full_ores = {
local sword_materials = {
steel = "default:steel_ingot",
mese = "default:mese_crystal",
diamond = "default:diamond",
mese = "default:mese_crystal",
}
-- Rocket <== Gold ingot x16 + Coal lump x5
-- Rocket <== Gold ingot x5 + Coal lump x4
crafting.register_recipe({
type = "inv",
output = "shooter_rocket:rocket",
items = { "default:gold_ingot 16", "default:coal_lump 5" },
items = { "default:gold_ingot 5", "default:coal_lump 4" },
always_known = false,
level = 1,
})
-- Rocket <== Mese x5 + Coal lump x5
-- Rocket <== Mese x1 + Coal lump x4
crafting.register_recipe({
type = "inv",
output = "shooter_rocket:rocket",
items = { "default:mese 5", "default:coal_lump 5" },
items = { "default:mese 1", "default:coal_lump 4" },
always_known = false,
level = 1,
})
@ -52,11 +52,20 @@ for ore, ore_item in pairs(full_ores) do
})
end
--Mese block <== Mese crystal x9
crafting.register_recipe({
type = "inv",
output = "default:mese",
items = { "default:mese_crystal 9" },
always_known = true,
level = 1,
})
-- Mese crystal x9 <== Mese block
crafting.register_recipe({
type = "inv",
output = "default:mese_crystal 9",
items = { "default:mese"},
items = { "default:mese" },
always_known = true,
level = 1,
})

@ -1 +1 @@
Subproject commit 08f571991b30fa7d9eae0e836e3047f5049d7963
Subproject commit e8dffc7b1bdf445b87c4ae1cf3eeeb3da2b1a801

View file

@ -24,6 +24,8 @@ function ctf_treasure.get_default_treasures()
{ "shooter:ammo", 0.3, 2, { 1, 10 } },
-- { "shooter:arrow_white", 0.5, 2, { 2, 18 } },
{ "shooter_rocket:rocket", 0.3, 2, 1 },
{ "sniper_rifles:rifle_762_loaded", 0.1, 2, 1 },
{ "sniper_rifles:rifle_magnum_loaded", 0.01, 2, 1 },

View file

@ -22,7 +22,7 @@ function give_initial_stuff.give_item(inv, item)
end
-- Don't duplicate stacks
if inv:contains_item("main", item:get_name()) then
if inv:contains_item("main", item:get_name()) and not inv:contains_item("main", "shooter_rocket:rocket") then
local safeguard = 0
local itemcount = item:get_count()-5
if itemcount < 0 then itemcount = 0 end