merge server with github
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 197 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 252 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 257 B |
Before Width: | Height: | Size: 264 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 243 B |
Before Width: | Height: | Size: 291 B After Width: | Height: | Size: 175 B |
Before Width: | Height: | Size: 508 B After Width: | Height: | Size: 190 B |
Before Width: | Height: | Size: 508 B After Width: | Height: | Size: 219 B |
Before Width: | Height: | Size: 341 B After Width: | Height: | Size: 166 B |
Before Width: | Height: | Size: 341 B After Width: | Height: | Size: 283 B |
Before Width: | Height: | Size: 741 B After Width: | Height: | Size: 180 B |
Before Width: | Height: | Size: 425 B |
Before Width: | Height: | Size: 425 B After Width: | Height: | Size: 245 B |
@ -1,95 +0,0 @@
|
|||||||
local is_healthpack = function(node)
|
|
||||||
if node.name == 'bobblocks:health_off' or node.name == 'health_on' then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
local update_healthpack = function (pos, node)
|
|
||||||
local nodename=""
|
|
||||||
local param2=""
|
|
||||||
--Switch HealthPack State
|
|
||||||
if node.name == 'bobblocks:health_off' then
|
|
||||||
nodename = 'bobblocks:health_on'
|
|
||||||
elseif node.name == 'bobblocks:health_on' then
|
|
||||||
nodename = 'bobblocks:health_off'
|
|
||||||
end
|
|
||||||
minetest.env:add_node(pos, {name = nodename})
|
|
||||||
end
|
|
||||||
|
|
||||||
local toggle_healthpack = function (pos, node)
|
|
||||||
if not is_healthgate(node) then return end
|
|
||||||
update_healthpack (pos, node, state)
|
|
||||||
end
|
|
||||||
|
|
||||||
local on_healthpack_punched = function (pos, node, puncher)
|
|
||||||
if node.name == 'bobblocks:health_off' or node.name == 'bobblocks:health_on' then
|
|
||||||
update_healthpack(pos, node)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Healing Node
|
|
||||||
|
|
||||||
minetest.register_node("bobblocks:health_off", {
|
|
||||||
description = "Health Pack 1 Off",
|
|
||||||
tile_images = {"bobblocks_health_off.png"},
|
|
||||||
inventory_image = "bobblocks_health_off.png",
|
|
||||||
paramtype2 = "facedir",
|
|
||||||
legacy_facedir_simple = true,
|
|
||||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
|
||||||
is_ground_content = true,
|
|
||||||
walkable = false,
|
|
||||||
climbable = false,
|
|
||||||
mesecons = {conductor={
|
|
||||||
state = mesecon.state.off,
|
|
||||||
onstate = "bobblocks:health_on"
|
|
||||||
}}
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_node("bobblocks:health_on", {
|
|
||||||
description = "Health Pack 1 On",
|
|
||||||
tile_images = {"bobblocks_health_on.png"},
|
|
||||||
paramtype2 = "facedir",
|
|
||||||
legacy_facedir_simple = true,
|
|
||||||
light_source = LIGHT_MAX-0,
|
|
||||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
|
||||||
is_ground_content = true,
|
|
||||||
walkable = false,
|
|
||||||
climbable = false,
|
|
||||||
drop = "bobblocks:health_off",
|
|
||||||
mesecons = {conductor={
|
|
||||||
state = mesecon.state.on,
|
|
||||||
offstate = "bobblocks:health_off"
|
|
||||||
}}
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
minetest.register_abm(
|
|
||||||
{nodenames = {"bobblocks:health_on"},
|
|
||||||
interval = 1.0,
|
|
||||||
chance = 1,
|
|
||||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
|
||||||
local objs = minetest.env:get_objects_inside_radius(pos, 1)
|
|
||||||
for k, obj in pairs(objs) do
|
|
||||||
minetest.sound_play("bobblocks_health",
|
|
||||||
{pos = pos, gain = 1.0, max_hear_distance = 32,})
|
|
||||||
obj:set_hp(obj:get_hp()+3) -- give 3HP
|
|
||||||
minetest.env:remove_node(pos) -- remove the node after use
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
--- Health
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
output = 'NodeItem "bobblocks:health_off" 1',
|
|
||||||
recipe = {
|
|
||||||
{'node "default:dirt" 1', 'node "default:paper" 1', 'node "default:apple" 2'},
|
|
||||||
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
minetest.register_on_punchnode(on_healthpack_punched)
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
|||||||
print("[BobBlocks By minetest@rabbibob.com] Version 0.0.8 loading....")
|
|
||||||
print("[BobBlocks] loading Blocks")
|
|
||||||
dofile(minetest.get_modpath("bobblocks") .. "/blocks.lua")
|
|
||||||
print("[BobBlocks] loaded Blocks")
|
|
||||||
print("[BobBlocks] loading Health")
|
|
||||||
dofile(minetest.get_modpath("bobblocks") .. "/health.lua")
|
|
||||||
print("[BobBlocks] loaded Health")
|
|
||||||
print("[BobBlocks] loading Traps")
|
|
||||||
dofile(minetest.get_modpath("bobblocks") .. "/trap.lua")
|
|
||||||
print("[BobBlocks] loaded Traps")
|
|
||||||
print("[BobBlocks By minetest@rabbibob.com] Version 0.0.8 loaded!")
|
|
@ -70,7 +70,7 @@ minetest.register_craft( {
|
|||||||
minetest.register_craftitem("farming:chocolate_dark", {
|
minetest.register_craftitem("farming:chocolate_dark", {
|
||||||
description = "Bar of Dark Chocolate",
|
description = "Bar of Dark Chocolate",
|
||||||
inventory_image = "farming_chocolate_dark.png",
|
inventory_image = "farming_chocolate_dark.png",
|
||||||
on_use = minetest.item_eat(3),
|
on_use = minetest.item_eat(2),
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft( {
|
minetest.register_craft( {
|
||||||
@ -92,7 +92,7 @@ minetest.register_node("farming:cocoa_1", {
|
|||||||
{items = {'farming:cocoa_beans 1'},rarity=2},
|
{items = {'farming:cocoa_beans 1'},rarity=2},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
selection_box = {type = "fixed",fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3},},
|
selection_box = {type = "fixed",fixed = {-0.27, -0.45, -0.27, 0.27, 0.45, 0.27},},
|
||||||
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,growing=1},
|
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,growing=1},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
})
|
})
|
||||||
@ -107,7 +107,7 @@ minetest.register_node("farming:cocoa_2", {
|
|||||||
{items = {'farming:cocoa_beans 1'},rarity=1},
|
{items = {'farming:cocoa_beans 1'},rarity=1},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
selection_box = {type = "fixed",fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3},},
|
selection_box = {type = "fixed",fixed = {-0.27, -0.45, -0.27, 0.27, 0.45, 0.27},},
|
||||||
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,growing=1},
|
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,growing=1},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
})
|
})
|
||||||
@ -125,7 +125,7 @@ minetest.register_node("farming:cocoa_3", {
|
|||||||
{items = {'farming:cocoa_beans 1'},rarity=2},
|
{items = {'farming:cocoa_beans 1'},rarity=2},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
selection_box = {type = "fixed",fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3},},
|
selection_box = {type = "fixed",fixed = {-0.27, -0.45, -0.27, 0.27, 0.45, 0.27},},
|
||||||
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1},
|
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
})
|
})
|
||||||
|
Before Width: | Height: | Size: 548 B After Width: | Height: | Size: 552 B |
Before Width: | Height: | Size: 166 B After Width: | Height: | Size: 341 B |
Before Width: | Height: | Size: 95 B After Width: | Height: | Size: 136 B |
Before Width: | Height: | Size: 119 B After Width: | Height: | Size: 161 B |
Before Width: | Height: | Size: 148 B |
Before Width: | Height: | Size: 179 B After Width: | Height: | Size: 220 B |
Before Width: | Height: | Size: 221 B After Width: | Height: | Size: 263 B |
Before Width: | Height: | Size: 290 B After Width: | Height: | Size: 342 B |
Before Width: | Height: | Size: 317 B After Width: | Height: | Size: 359 B |
Before Width: | Height: | Size: 289 B After Width: | Height: | Size: 339 B |
Before Width: | Height: | Size: 271 B After Width: | Height: | Size: 348 B |
Before Width: | Height: | Size: 335 B After Width: | Height: | Size: 378 B |
Before Width: | Height: | Size: 547 B After Width: | Height: | Size: 566 B |
Before Width: | Height: | Size: 105 B After Width: | Height: | Size: 146 B |
Before Width: | Height: | Size: 143 B |
Before Width: | Height: | Size: 187 B After Width: | Height: | Size: 228 B |
Before Width: | Height: | Size: 227 B After Width: | Height: | Size: 270 B |
Before Width: | Height: | Size: 298 B After Width: | Height: | Size: 354 B |
Before Width: | Height: | Size: 396 B After Width: | Height: | Size: 456 B |
Before Width: | Height: | Size: 479 B After Width: | Height: | Size: 523 B |
Before Width: | Height: | Size: 582 B After Width: | Height: | Size: 635 B |
Before Width: | Height: | Size: 325 B After Width: | Height: | Size: 372 B |
@ -265,25 +265,25 @@ end
|
|||||||
--- mes modifs /début ---
|
--- mes modifs /début ---
|
||||||
|
|
||||||
if minetest.get_modpath("farming") and farming.mod == "redo" then
|
if minetest.get_modpath("farming") and farming.mod == "redo" then
|
||||||
overwrite("farming:bread", 6)
|
overwrite("farming:bread", 5)
|
||||||
overwrite("farming:potato", 1)
|
overwrite("farming:potato", 1)
|
||||||
overwrite("farming:baked_potato", 6)
|
overwrite("farming:baked_potato", 5)
|
||||||
overwrite("farming:cucumber", 4)
|
overwrite("farming:cucumber", 3)
|
||||||
overwrite("farming:tomato", 4)
|
overwrite("farming:tomato", 3)
|
||||||
overwrite("farming:carrot", 3)
|
overwrite("farming:carrot", 3)
|
||||||
overwrite("farming:carrot_gold", 6, "", nil, 10)
|
overwrite("farming:carrot_gold", 6, "", nil, 10)
|
||||||
overwrite("farming:corn", 3)
|
overwrite("farming:corn", 3)
|
||||||
overwrite("farming:corn_cob", 5)
|
overwrite("farming:corn_cob", 5)
|
||||||
overwrite("farming:melon_slice", 2)
|
overwrite("farming:melon_slice", 2)
|
||||||
overwrite("farming:pumpkin_slice", 1)
|
overwrite("farming:pumpkin_slice", 1)
|
||||||
overwrite("farming:pumpkin_bread", 9)
|
overwrite("farming:pumpkin_bread", 7)
|
||||||
overwrite("farming:coffee_cup", 2, "farming:drinking_cup")
|
overwrite("farming:coffee_cup", 2, "farming:drinking_cup")
|
||||||
overwrite("farming:coffee_cup_hot", 3, "farming:drinking_cup", nil, 2)
|
overwrite("farming:coffee_cup_hot", 3, "farming:drinking_cup", nil, 2)
|
||||||
overwrite("farming:cookie", 2)
|
overwrite("farming:cookie", 2)
|
||||||
overwrite("farming:chocolate_dark", 3)
|
overwrite("farming:chocolate_dark", 3)
|
||||||
overwrite("farming:donut", 4)
|
overwrite("farming:donut", 4)
|
||||||
overwrite("farming:donut_chocolate", 6)
|
overwrite("farming:donut_chocolate", 5)
|
||||||
overwrite("farming:donut_apple", 6)
|
overwrite("farming:donut_apple", 5)
|
||||||
overwrite("farming:raspberries", 1)
|
overwrite("farming:raspberries", 1)
|
||||||
overwrite("farming:blueberries", 1)
|
overwrite("farming:blueberries", 1)
|
||||||
overwrite("farming:muffin_blueberry", 4)
|
overwrite("farming:muffin_blueberry", 4)
|
||||||
@ -291,7 +291,7 @@ if minetest.get_modpath("farming") and farming.mod == "redo" then
|
|||||||
overwrite("farming:smoothie_raspberry", 2, "vessels:drinking_glass")
|
overwrite("farming:smoothie_raspberry", 2, "vessels:drinking_glass")
|
||||||
end
|
end
|
||||||
overwrite("farming:rhubarb", 1)
|
overwrite("farming:rhubarb", 1)
|
||||||
overwrite("farming:rhubarb_pie", 6)
|
overwrite("farming:rhubarb_pie", 5)
|
||||||
end
|
end
|
||||||
|
|
||||||
if minetest.get_modpath("maptools") then
|
if minetest.get_modpath("maptools") then
|
||||||
@ -302,6 +302,7 @@ if minetest.get_modpath("mobs") ~= nil then
|
|||||||
overwrite("mobs:cheese", 4)
|
overwrite("mobs:cheese", 4)
|
||||||
overwrite("mobs:meat", 6)
|
overwrite("mobs:meat", 6)
|
||||||
overwrite("mobs:meat_raw", 3)
|
overwrite("mobs:meat_raw", 3)
|
||||||
|
overwrite("mobs:meat", 5)
|
||||||
overwrite("mobs:rat_cooked", 5)
|
overwrite("mobs:rat_cooked", 5)
|
||||||
overwrite("mobs:honey", 2)
|
overwrite("mobs:honey", 2)
|
||||||
overwrite("mobs:pork_raw", 4)
|
overwrite("mobs:pork_raw", 4)
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
rcvboxes = {
|
rcvboxes = {
|
||||||
{ -3/16, -3/16 , -8/16 , 3/16, 3/16, -13/32 }, -- the smaller bump
|
{ -3/16, -3/16, -8/16 , 3/16, 3/16 , -13/32 }, -- the smaller bump
|
||||||
{ -1/32, -1/32 , -3/2 , 1/32, 1/32, -1/2 }, -- the wire through the block
|
{ -1/32, -1/32, -3/2 , 1/32, 1/32 , -1/2 }, -- the wire through the block
|
||||||
{ -2/32, -.5-1/32, -.5 , 2/32, 0 , -.5002+3/32 }, -- the vertical wire bit
|
{ -2/32, -1/2 , -.5 , 2/32, 0 , -.5002+3/32 }, -- the vertical wire bit
|
||||||
{ -2/32, -17/32 , -7/16+0.002 , 2/32, -14/32, 16/32+0.001 } -- the horizontal wire
|
{ -2/32, -1/2 , -7/16+0.002 , 2/32, -14/32, 16/32+0.001 } -- the horizontal wire
|
||||||
}
|
}
|
||||||
|
|
||||||
local receiver_get_rules = function (node)
|
local receiver_get_rules = function (node)
|
||||||
|
@ -37,6 +37,21 @@ mobs:register_mob("mobs:chicken", {
|
|||||||
clicker:get_inventory():add_item("main", "mobs:chicken")
|
clicker:get_inventory():add_item("main", "mobs:chicken")
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
end
|
end
|
||||||
|
-- A VOIR POUR RENDRE TAMED/APPRIVOISABLE
|
||||||
|
-- if item:get_name() == "farming:wheat" then
|
||||||
|
-- if not minetest.setting_getbool("creative_mode") then
|
||||||
|
-- item:take_item()
|
||||||
|
-- clicker:set_wielded_item(item)
|
||||||
|
-- end
|
||||||
|
-- self.food = (self.food or 0) + 1
|
||||||
|
-- if self.food >= 4 then
|
||||||
|
-- self.food = 0
|
||||||
|
-- self.tamed = true
|
||||||
|
-- end
|
||||||
|
-- end
|
||||||
|
-- return
|
||||||
|
-- end
|
||||||
|
|
||||||
end,
|
end,
|
||||||
jump = true,
|
jump = true,
|
||||||
step = 1,
|
step = 1,
|
||||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.9 KiB |
BIN
mods/mobs/models/oerkki.png
Normal file
After Width: | Height: | Size: 4.6 KiB |
@ -1,18 +1,18 @@
|
|||||||
# Whether you are running a legacy minetest version (auto-detected).
|
|
||||||
legacy = false
|
|
||||||
# Enables falling snow.
|
|
||||||
enable_snowfall = true
|
|
||||||
# Disable this to stop snow from being smoothed.
|
|
||||||
smooth_snow = true
|
|
||||||
# Disable this to remove christmas saplings from being found.
|
|
||||||
christmas_content = true
|
|
||||||
# The minumum height a snow biome will generate.
|
|
||||||
min_height = 3
|
|
||||||
# Disable this to prevent sleds from being riden.
|
|
||||||
sleds = true
|
|
||||||
# Enables debug output.
|
|
||||||
debug = false
|
|
||||||
# Reduces the amount of resources and fps used by snowfall.
|
# Reduces the amount of resources and fps used by snowfall.
|
||||||
lighter_snowfall = false
|
lighter_snowfall = false
|
||||||
# Enables smooth transition of biomes
|
# Enables smooth transition of biomes
|
||||||
smooth_biomes = true
|
smooth_biomes = true
|
||||||
|
# The minumum height a snow biome will generate.
|
||||||
|
min_height = 3
|
||||||
|
# Disable this to prevent sleds from being riden.
|
||||||
|
sleds = true
|
||||||
|
# Disable this to stop snow from being smoothed.
|
||||||
|
smooth_snow = true
|
||||||
|
# Disable this to remove christmas saplings from being found.
|
||||||
|
christmas_content = true
|
||||||
|
# Whether you are running a legacy minetest version (auto-detected).
|
||||||
|
legacy = false
|
||||||
|
# Enables debug output.
|
||||||
|
debug = false
|
||||||
|
# Enables falling snow.
|
||||||
|
enable_snowfall = true
|
||||||
|
123
mods/sprint/esprint.lua~
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
--[[
|
||||||
|
Sprint mod for Minetest by GunshipPenguin
|
||||||
|
|
||||||
|
To the extent possible under law, the author(s)
|
||||||
|
have dedicated all copyright and related and neighboring rights
|
||||||
|
to this software to the public domain worldwide. This software is
|
||||||
|
distributed without any warranty.
|
||||||
|
]]
|
||||||
|
|
||||||
|
local players = {}
|
||||||
|
local staminaHud = {}
|
||||||
|
|
||||||
|
minetest.register_on_joinplayer(function(player)
|
||||||
|
playerName = player:get_player_name()
|
||||||
|
players[playerName] = {
|
||||||
|
sprinting = false,
|
||||||
|
timeOut = 0,
|
||||||
|
stamina = SPRINT_STAMINA,
|
||||||
|
epressed = false,
|
||||||
|
hud = player:hud_add({
|
||||||
|
hud_elem_type = "statbar",
|
||||||
|
position = {x=0.5,y=1},
|
||||||
|
size = {x=24, y=24},
|
||||||
|
text = "stamina.png",
|
||||||
|
number = 20,
|
||||||
|
alignment = {x=0,y=1},
|
||||||
|
offset = {x=-320, y=-186},
|
||||||
|
}
|
||||||
|
),
|
||||||
|
}
|
||||||
|
end)
|
||||||
|
minetest.register_on_leaveplayer(function(player)
|
||||||
|
playerName = player:get_player_name()
|
||||||
|
players[playerName] = nil
|
||||||
|
end)
|
||||||
|
minetest.register_globalstep(function(dtime)
|
||||||
|
--Get the gametime
|
||||||
|
local gameTime = minetest.get_gametime()
|
||||||
|
|
||||||
|
--Loop through all connected players
|
||||||
|
for playerName,playerInfo in pairs(players) do
|
||||||
|
local player = minetest.get_player_by_name(playerName)
|
||||||
|
if player ~= nil then
|
||||||
|
--Check if they are pressing the e key
|
||||||
|
players[playerName]["epressed"] = player:get_player_control()["aux1"]
|
||||||
|
|
||||||
|
--Stop sprinting if the player is pressing the LMB or RMB
|
||||||
|
if player:get_player_control()["LMB"] or player:get_player_control()["RMB"] then
|
||||||
|
setSprinting(playerName, false)
|
||||||
|
playerInfo["timeOut"] = 3
|
||||||
|
end
|
||||||
|
|
||||||
|
--If the player is sprinting, create particles behind him/her
|
||||||
|
if playerInfo["sprinting"] == true and gameTime % 0.1 == 0 then
|
||||||
|
local numParticles = math.random(1, 2)
|
||||||
|
local playerPos = player:getpos()
|
||||||
|
local playerNode = minetest.get_node({x=playerPos["x"], y=playerPos["y"]-1, z=playerPos["z"]})
|
||||||
|
if playerNode["name"] ~= "air" then
|
||||||
|
for i=1, numParticles, 1 do
|
||||||
|
minetest.add_particle({
|
||||||
|
pos = {x=playerPos["x"]+math.random(-1,1)*math.random()/2,y=playerPos["y"]+0.1,z=playerPos["z"]+math.random(-1,1)*math.random()/2},
|
||||||
|
vel = {x=0, y=5, z=0},
|
||||||
|
acc = {x=0, y=-13, z=0},
|
||||||
|
expirationtime = math.random(),
|
||||||
|
size = math.random()+0.5,
|
||||||
|
collisiondetection = true,
|
||||||
|
vertical = false,
|
||||||
|
texture = "default_dirt.png",
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
--Adjust player states
|
||||||
|
if players[playerName]["epressed"] == true and playerInfo["timeOut"] == 0 then --Stopped
|
||||||
|
setSprinting(playerName, true)
|
||||||
|
elseif players[playerName]["epressed"] == false then
|
||||||
|
setSprinting(playerName, false)
|
||||||
|
end
|
||||||
|
|
||||||
|
if playerInfo["timeOut"] > 0 then
|
||||||
|
playerInfo["timeOut"] = playerInfo["timeOut"] - dtime
|
||||||
|
if playerInfo["timeOut"] < 0 then
|
||||||
|
playerInfo["timeOut"] = 0
|
||||||
|
end
|
||||||
|
else
|
||||||
|
--Lower the player's stamina by dtime if he/she is sprinting and set his/her state to 0 if stamina is zero
|
||||||
|
if playerInfo["sprinting"] == true then
|
||||||
|
playerInfo["stamina"] = playerInfo["stamina"] - dtime
|
||||||
|
if playerInfo["stamina"] <= 0 then
|
||||||
|
playerInfo["stamina"] = 0
|
||||||
|
setSprinting(playerName, false)
|
||||||
|
minetest.chat_send_player(playerName, "Your sprint stamina has run out")
|
||||||
|
playerInfo["timeOut"] = 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
--Increase player's stamina if he/she is not sprinting and his/her stamina is less than SPRINT_STAMINA
|
||||||
|
if playerInfo["sprinting"] == false and playerInfo["stamina"] < SPRINT_STAMINA then
|
||||||
|
playerInfo["stamina"] = playerInfo["stamina"] + dtime
|
||||||
|
end
|
||||||
|
|
||||||
|
--Update the players's hud sprint stamina bar
|
||||||
|
local numBars = (playerInfo["stamina"]/SPRINT_STAMINA)*20
|
||||||
|
player:hud_change(playerInfo["hud"], "number", numBars)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
function setSprinting(playerName, sprinting) --Sets the state of a player (0=stopped/moving, 1=sprinting)
|
||||||
|
local player = minetest.get_player_by_name(playerName)
|
||||||
|
if players[playerName] then
|
||||||
|
players[playerName]["sprinting"] = sprinting
|
||||||
|
if sprinting == true then
|
||||||
|
player:set_physics_override({speed=SPRINT_SPEED,jump=SPRINT_JUMP})
|
||||||
|
elseif sprinting == false then
|
||||||
|
player:set_physics_override({speed=1.0,jump=1.0})
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
Before Width: | Height: | Size: 1.5 KiB |
@ -1,3 +0,0 @@
|
|||||||
Jovens
|
|
||||||
Ailton Junior
|
|
||||||
CC BY-SA 3.0
|
|
Before Width: | Height: | Size: 207 B |
Before Width: | Height: | Size: 523 B |
@ -1,3 +0,0 @@
|
|||||||
old skin in 3D
|
|
||||||
DS
|
|
||||||
CC BY-SA 3.0
|
|
Before Width: | Height: | Size: 143 B |
Before Width: | Height: | Size: 347 B |
@ -1,3 +0,0 @@
|
|||||||
Kirby
|
|
||||||
Rhys
|
|
||||||
CC BY-SA 3.0
|
|
Before Width: | Height: | Size: 224 B |
Before Width: | Height: | Size: 919 B |
@ -1,3 +0,0 @@
|
|||||||
Cool Bacon
|
|
||||||
Ghanastripes1
|
|
||||||
CC BY-SA 3.0
|
|
Before Width: | Height: | Size: 434 B |
Before Width: | Height: | Size: 258 B |
@ -1,3 +0,0 @@
|
|||||||
Invisibility Ninja
|
|
||||||
Minetestian
|
|
||||||
CC 0 (1.0)
|
|
Before Width: | Height: | Size: 116 B |
Before Width: | Height: | Size: 393 B |
@ -1,3 +0,0 @@
|
|||||||
Lil Ghast
|
|
||||||
Blitzfan
|
|
||||||
CC 0 (1.0)
|
|
Before Width: | Height: | Size: 125 B |
Before Width: | Height: | Size: 1.9 KiB |
@ -1,3 +0,0 @@
|
|||||||
Mummy
|
|
||||||
TandT
|
|
||||||
CC BY-SA 3.0
|
|
Before Width: | Height: | Size: 844 B |
Before Width: | Height: | Size: 5.5 KiB |
@ -1,3 +0,0 @@
|
|||||||
Diamond Armor Sam
|
|
||||||
Block_Guy
|
|
||||||
CC BY-SA 3.0
|
|
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 6.4 KiB |
@ -1,3 +0,0 @@
|
|||||||
Diamond Armor Sam
|
|
||||||
Block_Guy
|
|
||||||
CC BY-SA 3.0
|
|
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 280 B |
@ -1,3 +0,0 @@
|
|||||||
HurtedOerkki
|
|
||||||
AMMOnym
|
|
||||||
CC BY-SA 3.0
|
|
Before Width: | Height: | Size: 198 B |
Before Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 162 B |
@ -1,3 +0,0 @@
|
|||||||
Black
|
|
||||||
Calinou
|
|
||||||
CC BY 4.0
|
|
Before Width: | Height: | Size: 121 B |
Before Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 245 B |
@ -1,3 +0,0 @@
|
|||||||
ShadowNinja
|
|
||||||
ShadowNinja
|
|
||||||
CC BY-SA 4.0
|
|
Before Width: | Height: | Size: 130 B |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 207 B After Width: | Height: | Size: 783 B |
Before Width: | Height: | Size: 523 B After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 143 B After Width: | Height: | Size: 783 B |
Before Width: | Height: | Size: 347 B After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 224 B After Width: | Height: | Size: 783 B |
Before Width: | Height: | Size: 919 B After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 434 B After Width: | Height: | Size: 783 B |
Before Width: | Height: | Size: 258 B After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 116 B After Width: | Height: | Size: 783 B |