Compare commits

...

5 Commits

Author SHA1 Message Date
MisterE123 a8366a47b8 prevent players from being left in arena because of detachment by delaying elimination 2021-02-03 15:39:50 -05:00
MisterE123 7f12f9f6b1 add version info 2021-02-03 15:10:50 -05:00
MisterE123 4042180743 Update globalstep.lua 2021-02-03 14:30:09 -05:00
MisterE123 8b81961a39 remove undeclared globals 2021-02-03 13:49:08 -05:00
MisterE123 f4b43e7b21 change in-game physics 2021-02-03 00:47:08 -05:00
5 changed files with 29 additions and 7 deletions

View File

@ -1,3 +1,17 @@
--thx AliasAlreadyTaken for this version cmd
minetest.register_chatcommand("wormball_version", {
description = "Shows wormball version",
privs = {
interact = true,
},
func = function(name, param)
return true, "Wormball Version: "..wormball.version
end
})
ChatCmdBuilder.new("wormball", function(cmd)
-- create arena

View File

@ -1,3 +1,5 @@
wormball.version = "02.03.2021.3"
wormball.player_texture_save = {}

View File

@ -13,8 +13,8 @@ dofile(minetest.get_modpath("wormball") .. "/globals.lua")
join_while_in_progress = false,
keep_inventory = false,
in_game_physics = {
speed = 0,
jump = 0,
speed = 1,
jump = 1,
sneak = false,
gravity = 1,
},

View File

@ -66,6 +66,8 @@ minetest.register_globalstep(function(dtime)
local remove_tail = true
local died --used to determine whether to elim player
-- if players are alive, move the worms (add to the length, subtract from the tail)
@ -81,7 +83,7 @@ minetest.register_globalstep(function(dtime)
local look_dir = wormball.get_look_dir(arena,player) --in globals file; returns a string, one of: px, nx, pz, nz for the approximation of player look direction
local died = false --used to determine whether to elim player
died = false --used to determine whether to elim player
--get player direction from current input, first check up or down, then look direction
@ -290,7 +292,7 @@ minetest.register_globalstep(function(dtime)
-- if the player is dead, then we will slowly convert them into food (of their color)
-- if they are still alive, then we will place air there to delete the tail
if arena.players[pl_name].alive == false then
item = "wormball:power_"..color
local item = "wormball:power_"..color
minetest.set_node(tail_pos, {name=item})
else
minetest.set_node(tail_pos, {name="air"})
@ -316,8 +318,12 @@ minetest.register_globalstep(function(dtime)
minetest.sound_play('sumo_lose', {
to_player = pl_name,
gain = 2.0,
})
arena_lib.remove_player_from_arena(pl_name, 1)
})
minetest.after(.3,function(pl_name)
arena_lib.remove_player_from_arena(pl_name, 1)
end,pl_name)
end
end
end

View File

@ -95,7 +95,7 @@ arena_lib.on_time_tick('wormball', function(arena)
if remove then
--if there are enough powerups to remove some, have a 0.5 chance of removing them
if math.random(1,2) == 1 then
rem_pos = table.remove(arena.dots,math.random(4,#arena.dots)) --forget the pos of removed powerup
local rem_pos = table.remove(arena.dots,math.random(4,#arena.dots)) --forget the pos of removed powerup
if not(string.find(minetest.get_node(rem_pos).name,"wormball:straight_"))
and not(string.find(minetest.get_node(rem_pos).name,"wormball:corner_"))
and not(string.find(minetest.get_node(rem_pos).name,"wormball:head_")) then