fixed bug with players being given a pushstick when they die

Also fixed version cmd
master
MisterE123 2021-02-16 16:19:56 -05:00
parent 6deffbd655
commit f55b3fe935
3 changed files with 23 additions and 44 deletions

View File

@ -38,8 +38,8 @@ ChatCmdBuilder.new("sumo", function(cmd)
arena_lib.disable_arena(name, "sumo", arena)
end)
cmd:sub("version", function()
return "the current version of sumo is "..sumo.version
cmd:sub("version", function(name)
minetest.chat_send_player(name,"The version of sumo is "..sumo.version)
end)
end, {

View File

@ -1,23 +1,4 @@
local movement_timeout = sumo.movement_timeout --for how long players may run (and jump a little extra too)
local cage_positions = {
{x = 0, y = -1, z = 0}, --bottom
{x = 0, y = 3, z = 0}, --top
{x = 1, y = 0, z = 0},-- +X
{x = 1, y = 1, z = 0},
{x = 1, y = 2, z = 0},
{x = -1, y = 0, z = 0},-- -x
{x = -1, y = 1, z = 0},
{x = -1, y = 2, z = 0},
{x = 0, y = 0, z = 1},-- +Z
{x = 0, y = 1, z = 1},
{x = 0, y = 2, z = 1},
{x = 0, y = 0, z = -1},-- -Z
{x = 0, y = 1, z = -1},
{x = 0, y = 2, z = -1},} -- cage postions are relative vectors to spawn fulclips at
@ -196,27 +177,6 @@ minetest.register_on_player_hpchange(function(player, hp_change,reason)
local inv = player:get_inventory()
local taken = inv:remove_item("main", ItemStack("sumo:pushstick"))
minetest.after(2,function(pl_name)
--sumo.invincible[pl_name] = false
if arena_lib.is_player_in_arena(pl_name, 'sumo') then
local arena = arena_lib.get_arena_by_player(pl_name)
if arena.in_game == true then
arena_lib.HUD_send_msg("title", pl_name,'Fight!', 2,nil,0x00FF00)
local player = minetest.get_player_by_name(pl_name)
local sp_pos = arena_lib.get_random_spawner(arena)
if player then
player:move_to(sp_pos, false)
player:get_inventory():set_stack("main", 1, ItemStack("sumo:pushstick"))
minetest.after(3,function(pl_name)
sumo.invincible[pl_name] = false
end,pl_name)
end
end
end
end,pl_name)
arena.players[pl_name].lives = arena.players[pl_name].lives - 1
if arena.players[pl_name].lives == 0 then
local player = minetest.get_player_by_name(pl_name)
@ -228,7 +188,26 @@ minetest.register_on_player_hpchange(function(player, hp_change,reason)
else
arena_lib.HUD_send_msg("title", pl_name,'You Died! Lives: '.. arena.players[pl_name].lives , 2,nil,0xFF1100)
minetest.after(2,function(pl_name)
--sumo.invincible[pl_name] = false
if arena_lib.is_player_in_arena(pl_name, 'sumo') then
local arena = arena_lib.get_arena_by_player(pl_name)
if arena.in_game == true then
arena_lib.HUD_send_msg("title", pl_name,'Fight!', 2,nil,0x00FF00)
local player = minetest.get_player_by_name(pl_name)
local sp_pos = arena_lib.get_random_spawner(arena)
if player then
player:move_to(sp_pos, false)
player:get_inventory():set_stack("main", 1, ItemStack("sumo:pushstick"))
minetest.after(3,function(pl_name)
sumo.invincible[pl_name] = false
end,pl_name)
end
end
end
end,pl_name)
minetest.sound_play('sumo_elim', {
to_player = pl_name,

View File

@ -1,6 +1,6 @@
--version control (do not change unless you are a developer!)
--------------------------------------
sumo.version = "02.16.2021.1" --read: last changed: mo.day.yr.daily_version
sumo.version = "02.16.2021.2" --read: last changed: mo.day.yr.daily_version
-- speed when in the minigame (players will be a little faster when running)
sumo.player_speed = 2