Compare commits
5 Commits
10a5625502
...
a8366a47b8
Author | SHA1 | Date |
---|---|---|
MisterE123 | a8366a47b8 | |
MisterE123 | 7f12f9f6b1 | |
MisterE123 | 4042180743 | |
MisterE123 | 8b81961a39 | |
MisterE123 | f4b43e7b21 |
14
commands.lua
14
commands.lua
|
@ -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
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
wormball.version = "02.03.2021.3"
|
||||
|
||||
|
||||
wormball.player_texture_save = {}
|
||||
|
||||
|
|
4
init.lua
4
init.lua
|
@ -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,
|
||||
},
|
||||
|
|
|
@ -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"})
|
||||
|
@ -317,7 +319,11 @@ minetest.register_globalstep(function(dtime)
|
|||
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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue