Compare commits
22 commits
b0b4052408
...
28ce8e6c63
Author | SHA1 | Date | |
---|---|---|---|
|
28ce8e6c63 | ||
|
3279f45c6c | ||
|
d778b3a622 | ||
|
b2ea5c6c8a | ||
|
bdfc9d5ecd | ||
|
9c1339f6d7 | ||
|
a9806b593e | ||
|
1225504258 | ||
|
741e7d2bdc | ||
|
d591aff727 | ||
|
0f41ee3fa2 | ||
|
9c8de618a2 | ||
|
5d82a2d813 | ||
|
c076f5fb4c | ||
|
7b4a9ee146 | ||
|
03d05ea77f | ||
|
932b471f36 | ||
|
8a65f94b81 | ||
|
c35bd98e34 | ||
|
5abb26cb28 | ||
|
9bc4491f2c | ||
|
e91b7c0521 |
2 changed files with 22 additions and 0 deletions
|
@ -163,6 +163,7 @@ ctf_classes.register("rocketeer", {
|
||||||
-- Disallow rocketeers from capturing flags - they're intended to be support
|
-- Disallow rocketeers from capturing flags - they're intended to be support
|
||||||
can_capture = false,
|
can_capture = false,
|
||||||
max_hp = 15,
|
max_hp = 15,
|
||||||
|
allow_rockets = true,
|
||||||
|
|
||||||
initial_stuff = {
|
initial_stuff = {
|
||||||
"shooter_rocket:rocket_gun_loaded",
|
"shooter_rocket:rocket_gun_loaded",
|
||||||
|
@ -171,6 +172,7 @@ ctf_classes.register("rocketeer", {
|
||||||
|
|
||||||
additional_item_blacklist = {
|
additional_item_blacklist = {
|
||||||
"shooter_rocket:rocket_gun",
|
"shooter_rocket:rocket_gun",
|
||||||
|
"shooter_rocket:rocket"
|
||||||
},
|
},
|
||||||
|
|
||||||
allowed_guns = {
|
allowed_guns = {
|
||||||
|
|
|
@ -66,10 +66,30 @@ local function check_grapple(itemname)
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function check_rocket(itemname)
|
||||||
|
local def = minetest.registered_items[itemname]
|
||||||
|
local old_func = def.on_use
|
||||||
|
minetest.override_item(itemname, {
|
||||||
|
on_use = function(itemstack, user, ...)
|
||||||
|
if not ctf_classes.get(user).properties.allow_rockets then
|
||||||
|
minetest.chat_send_player(user:get_player_name(),
|
||||||
|
"You can't use that weapon! Change your class at base.")
|
||||||
|
return itemstack
|
||||||
|
end
|
||||||
|
|
||||||
|
return old_func(itemstack, user, ...)
|
||||||
|
end,
|
||||||
|
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
check_grapple("shooter_hook:grapple_gun_loaded")
|
check_grapple("shooter_hook:grapple_gun_loaded")
|
||||||
check_grapple("shooter_hook:grapple_gun")
|
check_grapple("shooter_hook:grapple_gun")
|
||||||
check_grapple("shooter_hook:grapple_hook")
|
check_grapple("shooter_hook:grapple_hook")
|
||||||
|
|
||||||
|
check_rocket("shooter_rocket:rocket_gun_loaded")
|
||||||
|
check_rocket("shooter_rocket:rocket_gun")
|
||||||
|
|
||||||
-- Override grappling hook entity to check if player has flag before teleporting
|
-- Override grappling hook entity to check if player has flag before teleporting
|
||||||
local old_grapple_step = minetest.registered_entities["shooter_hook:hook"].on_step
|
local old_grapple_step = minetest.registered_entities["shooter_hook:hook"].on_step
|
||||||
minetest.registered_entities["shooter_hook:hook"].on_step = function(self, dtime, ...)
|
minetest.registered_entities["shooter_hook:hook"].on_step = function(self, dtime, ...)
|
||||||
|
|
Loading…
Reference in a new issue