Compare commits
No commits in common. "ea20089d4cca0f464299e27cb8fc89d4c7e7f7b1" and "56f99fb2714a2583b0db2a45eb599e29f23c7347" have entirely different histories.
ea20089d4c
...
56f99fb271
5 changed files with 10 additions and 88 deletions
|
@ -2,8 +2,8 @@ ctf_classes.default_class = "knight"
|
||||||
|
|
||||||
ctf_classes.register("knight", {
|
ctf_classes.register("knight", {
|
||||||
description = "Knight",
|
description = "Knight",
|
||||||
pros = { "* Skilled with swords", "* +50% health points" },
|
pros = { ">Skilled with swords", "> +50% health points" },
|
||||||
cons = { "* -10% speed" },
|
cons = { "> -10% speed" },
|
||||||
color = "#ccc",
|
color = "#ccc",
|
||||||
properties = {
|
properties = {
|
||||||
max_hp = 30,
|
max_hp = 30,
|
||||||
|
@ -23,8 +23,8 @@ ctf_classes.register("knight", {
|
||||||
|
|
||||||
ctf_classes.register("shooter", {
|
ctf_classes.register("shooter", {
|
||||||
description = "Sharp Shooter",
|
description = "Sharp Shooter",
|
||||||
pros = { "* Skilled with ranged", "weapons and can", "craft/use sniper rifles"},
|
pros = { ">Skilled with ranged", "weapons and can", "craft/use sniper rifles"},
|
||||||
cons = { "* -20% health points" },
|
cons = { "> -20% health points" },
|
||||||
color = "#c60",
|
color = "#c60",
|
||||||
properties = {
|
properties = {
|
||||||
allow_grapples = true,
|
allow_grapples = true,
|
||||||
|
@ -72,7 +72,7 @@ ctf_classes.register("shooter", {
|
||||||
|
|
||||||
ctf_classes.register("medic", {
|
ctf_classes.register("medic", {
|
||||||
description = "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 = {},
|
cons = {},
|
||||||
color = "#0af",
|
color = "#0af",
|
||||||
properties = {
|
properties = {
|
||||||
|
@ -156,8 +156,8 @@ ctf_classes.register("sniper", {
|
||||||
|
|
||||||
ctf_classes.register("rocketeer", {
|
ctf_classes.register("rocketeer", {
|
||||||
description = "Rocketeer",
|
description = "Rocketeer",
|
||||||
pros = { "* Can craft/use rockets" },
|
pros = { ">Can craft/use rockets" },
|
||||||
cons = { "* Can't capture the flag", "* -25% health points" },
|
cons = { "> -25% health points" },
|
||||||
color = "#fa0",
|
color = "#fa0",
|
||||||
properties = {
|
properties = {
|
||||||
-- Disallow rocketeers from capturing flags - they're intended to be support
|
-- Disallow rocketeers from capturing flags - they're intended to be support
|
||||||
|
@ -167,16 +167,12 @@ ctf_classes.register("rocketeer", {
|
||||||
|
|
||||||
initial_stuff = {
|
initial_stuff = {
|
||||||
"shooter_rocket:rocket_gun_loaded",
|
"shooter_rocket:rocket_gun_loaded",
|
||||||
"ctf_classes:rocket",
|
"shooter_rocket:rocket 4",
|
||||||
"shooter_rocket:rocket 3",
|
|
||||||
},
|
|
||||||
|
|
||||||
item_whitelist = {
|
|
||||||
"shooter_rocket:rocket"
|
|
||||||
},
|
},
|
||||||
|
|
||||||
additional_item_blacklist = {
|
additional_item_blacklist = {
|
||||||
"shooter_rocket:rocket_gun",
|
"shooter_rocket:rocket_gun",
|
||||||
|
"shooter_rocket:rocket"
|
||||||
},
|
},
|
||||||
|
|
||||||
allowed_guns = {
|
allowed_guns = {
|
||||||
|
|
|
@ -11,7 +11,6 @@ dofile(minetest.get_modpath("ctf_classes") .. "/melee.lua")
|
||||||
dofile(minetest.get_modpath("ctf_classes") .. "/items.lua")
|
dofile(minetest.get_modpath("ctf_classes") .. "/items.lua")
|
||||||
dofile(minetest.get_modpath("ctf_classes") .. "/flags.lua")
|
dofile(minetest.get_modpath("ctf_classes") .. "/flags.lua")
|
||||||
dofile(minetest.get_modpath("ctf_classes") .. "/classes.lua")
|
dofile(minetest.get_modpath("ctf_classes") .. "/classes.lua")
|
||||||
dofile(minetest.get_modpath("ctf_classes") .. "/update_wear.lua")
|
|
||||||
|
|
||||||
|
|
||||||
minetest.register_on_joinplayer(function(player)
|
minetest.register_on_joinplayer(function(player)
|
||||||
|
|
|
@ -122,9 +122,3 @@ minetest.registered_entities["shooter_hook:hook"].on_step = function(self, dtime
|
||||||
|
|
||||||
return old_grapple_step(self, dtime, ...)
|
return old_grapple_step(self, dtime, ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_tool("ctf_classes:rocket", {
|
|
||||||
description = "Rocket",
|
|
||||||
stack_max = 1,
|
|
||||||
inventory_image = "shooter_rocket_inv.png",
|
|
||||||
})
|
|
||||||
|
|
|
@ -1,67 +0,0 @@
|
||||||
-- ported from v3
|
|
||||||
local wear_timers = {}
|
|
||||||
|
|
||||||
ctf_classes.update_wear = {}
|
|
||||||
|
|
||||||
function ctf_classes.update_wear.find_item(pinv, item)
|
|
||||||
for pos, stack in pairs(pinv:get_list("main")) do
|
|
||||||
if stack:get_name() == item then
|
|
||||||
return pos, stack
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function ctf_classes.update_wear.start_update(pname, item, step, down, finish_callback, cancel_callback)
|
|
||||||
if not wear_timers[pname] then wear_timers[pname] = {} end
|
|
||||||
if wear_timers[pname][item] then return end
|
|
||||||
|
|
||||||
wear_timers[pname][item] = {c=cancel_callback, t=minetest.after(1, function()
|
|
||||||
wear_timers[pname][item] = nil
|
|
||||||
local player = minetest.get_player_by_name(pname)
|
|
||||||
|
|
||||||
if player then
|
|
||||||
local pinv = player:get_inventory()
|
|
||||||
local pos, stack = ctf_classes.update_wear.find_item(pinv, item)
|
|
||||||
|
|
||||||
if pos then
|
|
||||||
local wear = stack:get_wear()
|
|
||||||
|
|
||||||
if down then
|
|
||||||
wear = math.max(0, wear - step)
|
|
||||||
else
|
|
||||||
wear = math.min(65534, wear + step)
|
|
||||||
end
|
|
||||||
|
|
||||||
stack:set_wear(wear)
|
|
||||||
pinv:set_stack("main", pos, stack)
|
|
||||||
|
|
||||||
if (down and wear > 0) or (not down and wear < 65534) then
|
|
||||||
ctf_classes.update_wear.start_update(pname, item, step, down, finish_callback, cancel_callback)
|
|
||||||
elseif finish_callback then
|
|
||||||
finish_callback()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end)}
|
|
||||||
end
|
|
||||||
|
|
||||||
function ctf_classes.update_wear.cancel_player_updates(pname)
|
|
||||||
if wear_timers[pname] then
|
|
||||||
for _, timer in pairs(wear_timers[pname]) do
|
|
||||||
if timer.c then
|
|
||||||
timer.c()
|
|
||||||
end
|
|
||||||
timer.t:cancel()
|
|
||||||
end
|
|
||||||
|
|
||||||
wear_timers[pname] = nil
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
minetest.register_on_dieplayer(function(player)
|
|
||||||
ctf_classes.update_wear.cancel_player_updates(player)
|
|
||||||
end)
|
|
||||||
|
|
||||||
minetest.register_on_leaveplayer(function(player)
|
|
||||||
ctf_classes.update_wear.cancel_player_updates(player)
|
|
||||||
end)
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit bb8775c3bbe48d77a7dbdbc4c08088500b6605a6
|
Subproject commit 4733f7e6c792477a702aa172bed34df68e0c8e79
|
Loading…
Reference in a new issue