jump fix, added check for rocket teleportation if mod is not installed.

This commit is contained in:
Vitaliy Olkhin 2024-09-24 15:44:11 +05:00
parent d71e318230
commit 46061ed9a2
3 changed files with 221 additions and 158 deletions

View File

@ -493,84 +493,85 @@ minetest.register_craft({
}) })
--Space Drive recipes --Space Drive recipes
if minetest.get_modpath("rocket") then
minetest.register_craft({
output = 'space_travel:space_drive_engine',
recipe = {
{'default:mese_crystal', 'default:steel_ingot', 'default:mese_crystal'},
{'default:steel_ingot', 'default:mese', 'default:steel_ingot'},
{'default:mese_crystal', 'rocket:rocket_thruster', 'default:mese_crystal'},
}
})
minetest.register_craft({ minetest.register_craft({
output = 'space_travel:space_drive_engine', output = 'space_travel:warp_drive_engine',
recipe = { recipe = {
{'default:mese_crystal', 'default:steel_ingot', 'default:mese_crystal'}, {'space_travel:dark_matter_crystal', 'default:gold_ingot', 'space_travel:dark_matter_crystal'},
{'default:steel_ingot', 'default:mese', 'default:steel_ingot'}, {'default:gold_ingot', 'space_travel:dark_matter_crystal_block', 'default:gold_ingot'},
{'default:mese_crystal', 'rocket:rocket_thruster', 'default:mese_crystal'}, {'space_travel:dark_matter_crystal', 'rocket:rocket_thruster', 'space_travel:dark_matter_crystal'},
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = 'space_travel:warp_drive_engine', output = 'space_travel:space_drive_1',
recipe = { recipe = {
{'space_travel:dark_matter_crystal', 'default:gold_ingot', 'space_travel:dark_matter_crystal'}, {'default:mese_crystal', 'default:steel_ingot', 'default:mese_crystal'},
{'default:gold_ingot', 'space_travel:dark_matter_crystal_block', 'default:gold_ingot'}, {'default:steel_ingot', 'space_travel:space_drive_engine', 'default:steel_ingot'},
{'space_travel:dark_matter_crystal', 'rocket:rocket_thruster', 'space_travel:dark_matter_crystal'}, {'default:mese_crystal', 'default:steel_ingot', 'default:mese_crystal'},
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = 'space_travel:space_drive_1', output = 'space_travel:space_drive_2',
recipe = { recipe = {
{'default:mese_crystal', 'default:steel_ingot', 'default:mese_crystal'}, {'space_travel:lunar_spinel_gem', 'space_travel:titanium_ingot', 'space_travel:lunar_spinel_gem'},
{'default:steel_ingot', 'space_travel:space_drive_engine', 'default:steel_ingot'}, {'space_travel:titanium_ingot', 'space_travel:space_drive_engine', 'space_travel:titanium_ingot'},
{'default:mese_crystal', 'default:steel_ingot', 'default:mese_crystal'}, {'space_travel:lunar_spinel_gem', 'space_travel:titanium_ingot', 'space_travel:lunar_spinel_gem'},
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = 'space_travel:space_drive_2', output = 'space_travel:space_drive_3',
recipe = { recipe = {
{'space_travel:lunar_spinel_gem', 'space_travel:titanium_ingot', 'space_travel:lunar_spinel_gem'}, {'space_travel:martian_ice_crystal', 'space_travel:titanium_ingot', 'space_travel:martian_ice_crystal'},
{'space_travel:titanium_ingot', 'space_travel:space_drive_engine', 'space_travel:titanium_ingot'}, {'space_travel:titanium_ingot', 'space_travel:space_drive_engine', 'space_travel:titanium_ingot'},
{'space_travel:lunar_spinel_gem', 'space_travel:titanium_ingot', 'space_travel:lunar_spinel_gem'}, {'space_travel:martian_ice_crystal', 'space_travel:titanium_ingot', 'space_travel:martian_ice_crystal'},
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = 'space_travel:space_drive_3', output = 'space_travel:space_drive_4',
recipe = { recipe = {
{'space_travel:martian_ice_crystal', 'space_travel:titanium_ingot', 'space_travel:martian_ice_crystal'}, {'space_travel:solar_mese_crystal', 'space_travel:lead_ingot', 'space_travel:solar_mese_crystal'},
{'space_travel:titanium_ingot', 'space_travel:space_drive_engine', 'space_travel:titanium_ingot'}, {'space_travel:lead_ingot', 'space_travel:space_drive_engine', 'space_travel:lead_ingot'},
{'space_travel:martian_ice_crystal', 'space_travel:titanium_ingot', 'space_travel:martian_ice_crystal'}, {'space_travel:solar_mese_crystal', 'space_travel:lead_ingot', 'space_travel:solar_mese_crystal'},
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = 'space_travel:space_drive_4', output = 'space_travel:space_drive_5',
recipe = { recipe = {
{'space_travel:solar_mese_crystal', 'space_travel:lead_ingot', 'space_travel:solar_mese_crystal'}, {'space_travel:lava_crystal', 'space_travel:lead_ingot', 'space_travel:lava_crystal'},
{'space_travel:lead_ingot', 'space_travel:space_drive_engine', 'space_travel:lead_ingot'}, {'space_travel:lead_ingot', 'space_travel:space_drive_engine', 'space_travel:lead_ingot'},
{'space_travel:solar_mese_crystal', 'space_travel:lead_ingot', 'space_travel:solar_mese_crystal'}, {'space_travel:lava_crystal', 'space_travel:lead_ingot', 'space_travel:lava_crystal'},
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = 'space_travel:space_drive_5', output = 'space_travel:space_drive_6',
recipe = { recipe = {
{'space_travel:lava_crystal', 'space_travel:lead_ingot', 'space_travel:lava_crystal'}, {'space_travel:titan_alien_crystal', 'space_travel:titanium_ingot', 'space_travel:titan_alien_crystal'},
{'space_travel:lead_ingot', 'space_travel:space_drive_engine', 'space_travel:lead_ingot'}, {'space_travel:titanium_ingot', 'space_travel:space_drive_engine', 'space_travel:titanium_ingot'},
{'space_travel:lava_crystal', 'space_travel:lead_ingot', 'space_travel:lava_crystal'}, {'space_travel:titan_alien_crystal', 'space_travel:titanium_ingot', 'space_travel:titan_alien_crystal'},
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = 'space_travel:space_drive_6', output = 'space_travel:space_drive_7',
recipe = { recipe = {
{'space_travel:titan_alien_crystal', 'space_travel:titanium_ingot', 'space_travel:titan_alien_crystal'}, {'space_travel:dark_matter_crystal', 'default:gold_ingot', 'space_travel:dark_matter_crystal'},
{'space_travel:titanium_ingot', 'space_travel:space_drive_engine', 'space_travel:titanium_ingot'}, {'default:gold_ingot', 'space_travel:warp_drive_engine', 'default:gold_ingot'},
{'space_travel:titan_alien_crystal', 'space_travel:titanium_ingot', 'space_travel:titan_alien_crystal'}, {'space_travel:dark_matter_crystal', 'default:gold_ingot', 'space_travel:dark_matter_crystal'},
} }
}) })
end
minetest.register_craft({
output = 'space_travel:space_drive_7',
recipe = {
{'space_travel:dark_matter_crystal', 'default:gold_ingot', 'space_travel:dark_matter_crystal'},
{'default:gold_ingot', 'space_travel:warp_drive_engine', 'default:gold_ingot'},
{'space_travel:dark_matter_crystal', 'default:gold_ingot', 'space_travel:dark_matter_crystal'},
}
})

62
sky.lua
View File

@ -316,6 +316,18 @@ minetest.register_on_joinplayer(function(player)
sky_defaults.col, sky_defaults.tp, sky_defaults.tex, sky_defaults.cl = player:get_sky() sky_defaults.col, sky_defaults.tp, sky_defaults.tex, sky_defaults.cl = player:get_sky()
end) end)
local player_weightlessness = {}
local function set_weightlessness(name, par)
player_weightlessness[name] = par
end
local function get_weightlessness(name)
if type(player_weightlessness[name]) ~= 'nil' then
return player_weightlessness[name]
end
return false
end
minetest.register_globalstep(function(dtime) minetest.register_globalstep(function(dtime)
time = time + dtime time = time + dtime
if time > 1 then if time > 1 then
@ -347,39 +359,51 @@ minetest.register_globalstep(function(dtime)
thickness = 16, thickness = 16,
speed ={x=0, z=-2}, speed ={x=0, z=-2},
}) })
player:set_physics_override(1, 1, 1) -- speed, jump, gravity if get_weightlessness(name) == true then
player:set_physics_override(1, 1, 1) -- speed, jump, gravity
set_weightlessness(name, false)
end
return
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.yarth and pos.y < space_travel.yarth_orbit then --Earth orbit elseif minetest.get_player_by_name(name) and pos.y >= space_travel.yarth and pos.y < space_travel.yarth_orbit then --Earth orbit
player:set_sky({r = 0, g = 0, b = 0}, "skybox", earth_space) player:set_sky({r = 0, g = 0, b = 0}, "skybox", earth_space)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.yarth_orbit and pos.y < space_travel.luna then --Moon sky elseif minetest.get_player_by_name(name) and pos.y >= space_travel.yarth_orbit and pos.y < space_travel.luna then --Moon sky
player:set_sky({r = 0, g = 0, b = 0}, "skybox", moon_sky) player:set_sky({r = 0, g = 0, b = 0}, "skybox", moon_sky)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.luna and pos.y < space_travel.luna_orbit then --Moon orbit elseif minetest.get_player_by_name(name) and pos.y >= space_travel.luna and pos.y < space_travel.luna_orbit then --Moon orbit
player:set_sky({r = 0, g = 0, b = 0}, "skybox", moon_sky) player:set_sky({r = 0, g = 0, b = 0}, "skybox", moon_sky)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.luna_orbit and pos.y < space_travel.mars and day_time then --Mars sky at day elseif minetest.get_player_by_name(name) and pos.y >= space_travel.luna_orbit and pos.y < space_travel.mars and day_time then --Mars sky at day
player:set_sky({r=219, g=168, b=117}, "plain", {}) player:set_sky({r=219, g=168, b=117}, "plain", {})
player:set_clouds({density = 0}) player:set_clouds({density = 0})
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.luna_orbit and pos.y < space_travel.mars and (not day_time) then --Mars sky at night elseif minetest.get_player_by_name(name) and pos.y >= space_travel.luna_orbit and pos.y < space_travel.mars and (not day_time) then --Mars sky at night
player:set_sky({r = 0, g = 0, b = 0}, "skybox", mars_night) player:set_sky({r = 0, g = 0, b = 0}, "skybox", mars_night)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.mars and pos.y < space_travel.mars_orbit then --Mars orbit elseif minetest.get_player_by_name(name) and pos.y >= space_travel.mars and pos.y < space_travel.mars_orbit then --Mars orbit
player:set_sky({r = 0, g = 0, b = 0}, "skybox", mars_space) player:set_sky({r = 0, g = 0, b = 0}, "skybox", mars_space)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.mars_orbit and pos.y < space_travel.mercury then --Mercury sky elseif minetest.get_player_by_name(name) and pos.y >= space_travel.mars_orbit and pos.y < space_travel.mercury then --Mercury sky
player:set_sky({r = 0, g = 0, b = 0}, "skybox", mercury_sky) player:set_sky({r = 0, g = 0, b = 0}, "skybox", mercury_sky)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.mercury and pos.y < space_travel.mercury_orbit then --Mercury orbit elseif minetest.get_player_by_name(name) and pos.y >= space_travel.mercury and pos.y < space_travel.mercury_orbit then --Mercury orbit
player:set_sky({r = 0, g = 0, b = 0}, "skybox", mercury_space) player:set_sky({r = 0, g = 0, b = 0}, "skybox", mercury_space)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.mercury and pos.y < space_travel.venus and day_time then --Venus sky at day elseif minetest.get_player_by_name(name) and pos.y >= space_travel.mercury and pos.y < space_travel.venus and day_time then --Venus sky at day
player:set_sky({r=208, g=177, b=11}, "plain", {}) player:set_sky({r=208, g=177, b=11}, "plain", {})
player:set_clouds({ player:set_clouds({
@ -391,6 +415,7 @@ minetest.register_globalstep(function(dtime)
speed ={x=0, z=10}, speed ={x=0, z=10},
}) })
player:set_physics_override(1, 1, 1) -- speed, jump, gravity player:set_physics_override(1, 1, 1) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.mercury and pos.y < space_travel.venus and (not day_time) then --Venus sky at night elseif minetest.get_player_by_name(name) and pos.y >= space_travel.mercury and pos.y < space_travel.venus and (not day_time) then --Venus sky at night
player:set_sky({r=102, g=87, b=5}, "plain", {}) player:set_sky({r=102, g=87, b=5}, "plain", {})
player:set_clouds({ player:set_clouds({
@ -402,6 +427,7 @@ minetest.register_globalstep(function(dtime)
speed ={x=0, z=10}, speed ={x=0, z=10},
}) })
player:set_physics_override(1, 1, 1) -- speed, jump, gravity player:set_physics_override(1, 1, 1) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.venus and pos.y < space_travel.venus_orbit then --Venus orbit elseif minetest.get_player_by_name(name) and pos.y >= space_travel.venus and pos.y < space_travel.venus_orbit then --Venus orbit
player:set_sky({r = 0, g = 0, b = 0}, "skybox", venus_space) player:set_sky({r = 0, g = 0, b = 0}, "skybox", venus_space)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
@ -410,34 +436,42 @@ minetest.register_globalstep(function(dtime)
player:set_sky({r = 0, g = 0, b = 0}, "skybox", jupiter_space) player:set_sky({r = 0, g = 0, b = 0}, "skybox", jupiter_space)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.ganymede and pos.y < space_travel.ganymede_orbit then --Ganymede orbit elseif minetest.get_player_by_name(name) and pos.y >= space_travel.ganymede and pos.y < space_travel.ganymede_orbit then --Ganymede orbit
player:set_sky({r = 0, g = 0, b = 0}, "skybox", ganymede_space) player:set_sky({r = 0, g = 0, b = 0}, "skybox", ganymede_space)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.ganymede_orbit and pos.y < space_travel.callisto then --Callisto sky elseif minetest.get_player_by_name(name) and pos.y >= space_travel.ganymede_orbit and pos.y < space_travel.callisto then --Callisto sky
player:set_sky({r = 0, g = 0, b = 0}, "skybox", jupiter_space) player:set_sky({r = 0, g = 0, b = 0}, "skybox", jupiter_space)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.callisto and pos.y < space_travel.callisto_orbit then --Callisto orbit elseif minetest.get_player_by_name(name) and pos.y >= space_travel.callisto and pos.y < space_travel.callisto_orbit then --Callisto orbit
player:set_sky({r = 0, g = 0, b = 0}, "skybox", callisto_space) player:set_sky({r = 0, g = 0, b = 0}, "skybox", callisto_space)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.callisto_orbit and pos.y < space_travel.io then --Io sky elseif minetest.get_player_by_name(name) and pos.y >= space_travel.callisto_orbit and pos.y < space_travel.io then --Io sky
player:set_sky({r = 0, g = 0, b = 0}, "skybox", jupiter_space) player:set_sky({r = 0, g = 0, b = 0}, "skybox", jupiter_space)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.io and pos.y < space_travel.io_orbit then --Io orbit elseif minetest.get_player_by_name(name) and pos.y >= space_travel.io and pos.y < space_travel.io_orbit then --Io orbit
player:set_sky({r = 0, g = 0, b = 0}, "skybox", io_space) player:set_sky({r = 0, g = 0, b = 0}, "skybox", io_space)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.io_orbit and pos.y < space_travel.europa then --Europa sky elseif minetest.get_player_by_name(name) and pos.y >= space_travel.io_orbit and pos.y < space_travel.europa then --Europa sky
player:set_sky({r = 0, g = 0, b = 0}, "skybox", jupiter_space) player:set_sky({r = 0, g = 0, b = 0}, "skybox", jupiter_space)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.europa and pos.y < space_travel.europa_orbit then --Europa orbit elseif minetest.get_player_by_name(name) and pos.y >= space_travel.europa and pos.y < space_travel.europa_orbit then --Europa orbit
player:set_sky({r = 0, g = 0, b = 0}, "skybox", europa_space) player:set_sky({r = 0, g = 0, b = 0}, "skybox", europa_space)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.europa_orbit and pos.y < space_travel.titan and day_time then --Titan sky at day elseif minetest.get_player_by_name(name) and pos.y >= space_travel.europa_orbit and pos.y < space_travel.titan and day_time then --Titan sky at day
player:set_sky({r = 239, g = 194, b = 109}, "skybox", titan_sky) player:set_sky({r = 239, g = 194, b = 109}, "skybox", titan_sky)
player:set_clouds({ player:set_clouds({
@ -449,6 +483,7 @@ minetest.register_globalstep(function(dtime)
speed ={x=0, z=-6}, speed ={x=0, z=-6},
}) })
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.europa_orbit and pos.y < space_travel.titan and (not day_time) then --Titan sky at night elseif minetest.get_player_by_name(name) and pos.y >= space_travel.europa_orbit and pos.y < space_travel.titan and (not day_time) then --Titan sky at night
player:set_sky({r = 128, g = 103, b = 58}, "plain", {}) player:set_sky({r = 128, g = 103, b = 58}, "plain", {})
player:set_clouds({ player:set_clouds({
@ -460,54 +495,67 @@ minetest.register_globalstep(function(dtime)
speed ={x=0, z=-6}, speed ={x=0, z=-6},
}) })
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.titan and pos.y < space_travel.titan_orbit then --Titan orbit elseif minetest.get_player_by_name(name) and pos.y >= space_travel.titan and pos.y < space_travel.titan_orbit then --Titan orbit
player:set_sky({r = 0, g = 0, b = 0}, "skybox", saturn_space) player:set_sky({r = 0, g = 0, b = 0}, "skybox", saturn_space)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.titan_orbit and pos.y < space_travel.oberon then --Oberon sky elseif minetest.get_player_by_name(name) and pos.y >= space_travel.titan_orbit and pos.y < space_travel.oberon then --Oberon sky
player:set_sky({r = 0, g = 0, b = 0}, "skybox", uranus_space) player:set_sky({r = 0, g = 0, b = 0}, "skybox", uranus_space)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.oberon and pos.y < space_travel.oberon_orbit then --Oberon orbit elseif minetest.get_player_by_name(name) and pos.y >= space_travel.oberon and pos.y < space_travel.oberon_orbit then --Oberon orbit
player:set_sky({r = 0, g = 0, b = 0}, "skybox", uranus_space) player:set_sky({r = 0, g = 0, b = 0}, "skybox", uranus_space)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.oberon_orbit and pos.y < space_travel.triton then --Triton sky elseif minetest.get_player_by_name(name) and pos.y >= space_travel.oberon_orbit and pos.y < space_travel.triton then --Triton sky
player:set_sky({r = 0, g = 0, b = 0}, "skybox", neptune_space) player:set_sky({r = 0, g = 0, b = 0}, "skybox", neptune_space)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.triton and pos.y < space_travel.triton_orbit then --Triton orbit elseif minetest.get_player_by_name(name) and pos.y >= space_travel.triton and pos.y < space_travel.triton_orbit then --Triton orbit
player:set_sky({r = 0, g = 0, b = 0}, "skybox", neptune_space) player:set_sky({r = 0, g = 0, b = 0}, "skybox", neptune_space)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.triton_orbit and pos.y < space_travel.pluto then --Pluto sky elseif minetest.get_player_by_name(name) and pos.y >= space_travel.triton_orbit and pos.y < space_travel.pluto then --Pluto sky
player:set_sky({r = 0, g = 0, b = 0}, "skybox", pluto_sky) player:set_sky({r = 0, g = 0, b = 0}, "skybox", pluto_sky)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.pluto and pos.y < space_travel.pluto_orbit then --Pluto orbit elseif minetest.get_player_by_name(name) and pos.y >= space_travel.pluto and pos.y < space_travel.pluto_orbit then --Pluto orbit
player:set_sky({r = 0, g = 0, b = 0}, "skybox", pluto_space) player:set_sky({r = 0, g = 0, b = 0}, "skybox", pluto_space)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.pluto_orbit and pos.y < space_travel.charon then --Charon sky elseif minetest.get_player_by_name(name) and pos.y >= space_travel.pluto_orbit and pos.y < space_travel.charon then --Charon sky
player:set_sky({r = 0, g = 0, b = 0}, "skybox", charon_sky) player:set_sky({r = 0, g = 0, b = 0}, "skybox", charon_sky)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.charon and pos.y < space_travel.charon_orbit then --Charon orbit elseif minetest.get_player_by_name(name) and pos.y >= space_travel.charon and pos.y < space_travel.charon_orbit then --Charon orbit
player:set_sky({r = 0, g = 0, b = 0}, "skybox", charon_space) player:set_sky({r = 0, g = 0, b = 0}, "skybox", charon_space)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.charon_orbit and pos.y < space_travel.sedna then --Sedna sky elseif minetest.get_player_by_name(name) and pos.y >= space_travel.charon_orbit and pos.y < space_travel.sedna then --Sedna sky
player:set_sky({r = 118, g = 84, b = 84}, "skybox", sedna_sky) player:set_sky({r = 118, g = 84, b = 84}, "skybox", sedna_sky)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.sedna and pos.y < space_travel.sedna_orbit then --Sedna orbit elseif minetest.get_player_by_name(name) and pos.y >= space_travel.sedna and pos.y < space_travel.sedna_orbit then --Sedna orbit
player:set_sky({r = 118, g = 84, b = 84}, "skybox", sedna_sky) player:set_sky({r = 118, g = 84, b = 84}, "skybox", sedna_sky)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.sedna_orbit and pos.y < space_travel.asteriod_belt then --Asteriod belt sky elseif minetest.get_player_by_name(name) and pos.y >= space_travel.sedna_orbit and pos.y < space_travel.asteriod_belt then --Asteriod belt sky
player:set_sky({r = 0, g = 0, b = 0}, "skybox", cosmos_sky) player:set_sky({r = 0, g = 0, b = 0}, "skybox", cosmos_sky)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.asteriod_belt and pos.y < space_travel.asteriod_belt_orbit and day_time then --Minerva sky at day elseif minetest.get_player_by_name(name) and pos.y >= space_travel.asteriod_belt and pos.y < space_travel.asteriod_belt_orbit and day_time then --Minerva sky at day
player:set_sky({r=249, g=139, b=139}, "plain", {}) player:set_sky({r=249, g=139, b=139}, "plain", {})
player:set_clouds({ player:set_clouds({
@ -519,6 +567,7 @@ minetest.register_globalstep(function(dtime)
speed ={x=0, z=-2}, speed ={x=0, z=-2},
}) })
player:set_physics_override(1, 1, 1) -- speed, jump, gravity player:set_physics_override(1, 1, 1) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.asteriod_belt and pos.y < space_travel.asteriod_belt_orbit and (not day_time) then --Minerva sky at night elseif minetest.get_player_by_name(name) and pos.y >= space_travel.asteriod_belt and pos.y < space_travel.asteriod_belt_orbit and (not day_time) then --Minerva sky at night
player:set_sky({r = 0, g = 0, b = 0}, "skybox", minerva_night) player:set_sky({r = 0, g = 0, b = 0}, "skybox", minerva_night)
player:set_clouds({ player:set_clouds({
@ -530,6 +579,7 @@ minetest.register_globalstep(function(dtime)
speed ={x=0, z=-2}, speed ={x=0, z=-2},
}) })
player:set_physics_override(1, 1, 1) -- speed, jump, gravity player:set_physics_override(1, 1, 1) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.minerva and pos.y < space_travel.minerva_orbit then --Minerva orbit elseif minetest.get_player_by_name(name) and pos.y >= space_travel.minerva and pos.y < space_travel.minerva_orbit then --Minerva orbit
player:set_sky({r = 0, g = 0, b = 0}, "skybox", minerva_space) player:set_sky({r = 0, g = 0, b = 0}, "skybox", minerva_space)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
@ -545,6 +595,7 @@ minetest.register_globalstep(function(dtime)
speed ={x=0, z=-2}, speed ={x=0, z=-2},
}) })
player:set_physics_override(1, 1, 1) -- speed, jump, gravity player:set_physics_override(1, 1, 1) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.minerva_orbit and pos.y < space_travel.bacchus and (not day_time) then --Bacchus sky at night elseif minetest.get_player_by_name(name) and pos.y >= space_travel.minerva_orbit and pos.y < space_travel.bacchus and (not day_time) then --Bacchus sky at night
player:set_sky({r = 0, g = 0, b = 0}, "skybox", minerva_night) player:set_sky({r = 0, g = 0, b = 0}, "skybox", minerva_night)
player:set_clouds({ player:set_clouds({
@ -556,22 +607,27 @@ minetest.register_globalstep(function(dtime)
speed ={x=0, z=-2}, speed ={x=0, z=-2},
}) })
player:set_physics_override(1, 1, 1) -- speed, jump, gravity player:set_physics_override(1, 1, 1) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.bacchus and pos.y < space_travel.bacchus_orbit then --Bacchus orbit elseif minetest.get_player_by_name(name) and pos.y >= space_travel.bacchus and pos.y < space_travel.bacchus_orbit then --Bacchus orbit
player:set_sky({r = 0, g = 0, b = 0}, "skybox", bacchus_space) player:set_sky({r = 0, g = 0, b = 0}, "skybox", bacchus_space)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.bacchus_orbit and pos.y < space_travel.ourea and day_time then --Ourea sky at day elseif minetest.get_player_by_name(name) and pos.y >= space_travel.bacchus_orbit and pos.y < space_travel.ourea and day_time then --Ourea sky at day
player:set_sky({r = 0, g = 0, b = 0}, "skybox", ourea_sky) player:set_sky({r = 0, g = 0, b = 0}, "skybox", ourea_sky)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.bacchus_orbit and pos.y < space_travel.ourea and (not day_time) then --Ourea night at day elseif minetest.get_player_by_name(name) and pos.y >= space_travel.bacchus_orbit and pos.y < space_travel.ourea and (not day_time) then --Ourea night at day
player:set_sky({r = 0, g = 0, b = 0}, "skybox", caelus_space) player:set_sky({r = 0, g = 0, b = 0}, "skybox", caelus_space)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.ourea and pos.y < space_travel.ourea_orbit then --Ourea orbit elseif minetest.get_player_by_name(name) and pos.y >= space_travel.ourea and pos.y < space_travel.ourea_orbit then --Ourea orbit
player:set_sky({r = 0, g = 0, b = 0}, "skybox", caelus_space) player:set_sky({r = 0, g = 0, b = 0}, "skybox", caelus_space)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.ourea_orbit and pos.y < space_travel.osiris and day_time then --Osiris sky at day elseif minetest.get_player_by_name(name) and pos.y >= space_travel.ourea_orbit and pos.y < space_travel.osiris and day_time then --Osiris sky at day
player:set_sky({r=247, g=180, b=138}, "plain", {}) player:set_sky({r=247, g=180, b=138}, "plain", {})
player:set_clouds({ player:set_clouds({
@ -583,6 +639,7 @@ minetest.register_globalstep(function(dtime)
speed ={x=0, z=-2}, speed ={x=0, z=-2},
}) })
player:set_physics_override(1, 1, 1) -- speed, jump, gravity player:set_physics_override(1, 1, 1) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.ourea_orbit and pos.y < space_travel.osiris and (not day_time) then --Osiris sky at night elseif minetest.get_player_by_name(name) and pos.y >= space_travel.ourea_orbit and pos.y < space_travel.osiris and (not day_time) then --Osiris sky at night
player:set_sky({r = 0, g = 0, b = 0}, "skybox", osiris_night) player:set_sky({r = 0, g = 0, b = 0}, "skybox", osiris_night)
player:set_clouds({ player:set_clouds({
@ -594,6 +651,7 @@ minetest.register_globalstep(function(dtime)
speed ={x=0, z=-2}, speed ={x=0, z=-2},
}) })
player:set_physics_override(1, 1, 1) -- speed, jump, gravity player:set_physics_override(1, 1, 1) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.osiris and pos.y < space_travel.osiris_orbit then --Osiris orbit elseif minetest.get_player_by_name(name) and pos.y >= space_travel.osiris and pos.y < space_travel.osiris_orbit then --Osiris orbit
player:set_sky({r = 0, g = 0, b = 0}, "skybox", osiris_space) player:set_sky({r = 0, g = 0, b = 0}, "skybox", osiris_space)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
@ -602,6 +660,7 @@ minetest.register_globalstep(function(dtime)
player:set_sky({r=117, g=219, b=170}, "plain", {}) player:set_sky({r=117, g=219, b=170}, "plain", {})
player:set_clouds({density = 0}) player:set_clouds({density = 0})
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
elseif minetest.get_player_by_name(name) and pos.y >= space_travel.osiris_orbit and pos.y < space_travel.minthe and (not day_time) then --Minthe sky at night elseif minetest.get_player_by_name(name) and pos.y >= space_travel.osiris_orbit and pos.y < space_travel.minthe and (not day_time) then --Minthe sky at night
player:set_sky({r = 0, g = 0, b = 0}, "skybox", minthe_night) player:set_sky({r = 0, g = 0, b = 0}, "skybox", minthe_night)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
@ -610,6 +669,7 @@ minetest.register_globalstep(function(dtime)
player:set_sky({r = 0, g = 0, b = 0}, "skybox", minthe_space) player:set_sky({r = 0, g = 0, b = 0}, "skybox", minthe_space)
player:set_clouds({density = 0}) player:set_clouds({density = 0})
player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity player:set_physics_override(1, 0.6, 0.2) -- speed, jump, gravity
set_weightlessness(name, true)
end end
--End of important code --End of important code
end end

View File

@ -632,100 +632,102 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
end end
end) end)
minetest.register_tool("space_travel:space_drive_1", { if minetest.get_modpath("rocket") then
description = "Tier I Basic Space Drive\n\nCan fly to the Moon.", minetest.register_tool("space_travel:space_drive_1", {
inventory_image = "space_travel_space_drive_1.png", description = "Tier I Basic Space Drive\n\nCan fly to the Moon.",
on_use = function(itemstack, user, pointed_thing) inventory_image = "space_travel_space_drive_1.png",
local name = user:get_player_name() on_use = function(itemstack, user, pointed_thing)
local attach = user:get_attach() local name = user:get_player_name()
if attach and attach:get_luaentity() then local attach = user:get_attach()
space_travel.space_drive_1_show(name) if attach and attach:get_luaentity() then
else space_travel.space_drive_1_show(name)
minetest.chat_send_player(name, "You are not in a space shuttle.") else
minetest.chat_send_player(name, "You are not in a space shuttle.")
end
end end
end })
})
minetest.register_tool("space_travel:space_drive_2", { minetest.register_tool("space_travel:space_drive_2", {
description = "Tier II Lunar Drive\n\nGo to Mars on your first interplanetary voyage.\nYou can also go to the asteriod belt.", description = "Tier II Lunar Drive\n\nGo to Mars on your first interplanetary voyage.\nYou can also go to the asteriod belt.",
inventory_image = "space_travel_space_drive_2.png", inventory_image = "space_travel_space_drive_2.png",
on_use = function(itemstack, user, pointed_thing) on_use = function(itemstack, user, pointed_thing)
local name = user:get_player_name() local name = user:get_player_name()
local attach = user:get_attach() local attach = user:get_attach()
if attach and attach:get_luaentity() then if attach and attach:get_luaentity() then
space_travel.space_drive_2_show(name) space_travel.space_drive_2_show(name)
else else
minetest.chat_send_player(name, "You are not in a space shuttle.") minetest.chat_send_player(name, "You are not in a space shuttle.")
end
end end
end })
})
minetest.register_tool("space_travel:space_drive_3", { minetest.register_tool("space_travel:space_drive_3", {
description = "Tier III Martian Drive\n\nYou can now visit the inner solar system.", description = "Tier III Martian Drive\n\nYou can now visit the inner solar system.",
inventory_image = "space_travel_space_drive_3.png^[colorize:#cf411b66", inventory_image = "space_travel_space_drive_3.png^[colorize:#cf411b66",
on_use = function(itemstack, user, pointed_thing) on_use = function(itemstack, user, pointed_thing)
local name = user:get_player_name() local name = user:get_player_name()
local attach = user:get_attach() local attach = user:get_attach()
if attach and attach:get_luaentity() then if attach and attach:get_luaentity() then
space_travel.space_drive_3_show(name) space_travel.space_drive_3_show(name)
else else
minetest.chat_send_player(name, "You are not in a space shuttle.") minetest.chat_send_player(name, "You are not in a space shuttle.")
end
end end
end })
})
minetest.register_tool("space_travel:space_drive_4", { minetest.register_tool("space_travel:space_drive_4", {
description = "Tier IV Solar Drive\n\nGo to the Jupiter system on your first trip\ninto the outer solar system.", description = "Tier IV Solar Drive\n\nGo to the Jupiter system on your first trip\ninto the outer solar system.",
inventory_image = "space_travel_space_drive_4.png", inventory_image = "space_travel_space_drive_4.png",
on_use = function(itemstack, user, pointed_thing) on_use = function(itemstack, user, pointed_thing)
local name = user:get_player_name() local name = user:get_player_name()
local attach = user:get_attach() local attach = user:get_attach()
if attach and attach:get_luaentity() then if attach and attach:get_luaentity() then
space_travel.space_drive_4_show(name) space_travel.space_drive_4_show(name)
else else
minetest.chat_send_player(name, "You are not in a space shuttle.") minetest.chat_send_player(name, "You are not in a space shuttle.")
end
end end
end })
})
minetest.register_tool("space_travel:space_drive_5", { minetest.register_tool("space_travel:space_drive_5", {
description = "Tier V Lava Drive\n\nYou can now visit the rest of the gas giant systems.\nThe most notable location is Titan.", description = "Tier V Lava Drive\n\nYou can now visit the rest of the gas giant systems.\nThe most notable location is Titan.",
inventory_image = "space_travel_space_drive_5.png", inventory_image = "space_travel_space_drive_5.png",
on_use = function(itemstack, user, pointed_thing) on_use = function(itemstack, user, pointed_thing)
local name = user:get_player_name() local name = user:get_player_name()
local attach = user:get_attach() local attach = user:get_attach()
if attach and attach:get_luaentity() then if attach and attach:get_luaentity() then
space_travel.space_drive_5_show(name) space_travel.space_drive_5_show(name)
else else
minetest.chat_send_player(name, "You are not in a space shuttle.") minetest.chat_send_player(name, "You are not in a space shuttle.")
end
end end
end })
})
minetest.register_tool("space_travel:space_drive_6", { minetest.register_tool("space_travel:space_drive_6", {
description = "Tier VI Titan Drive\n\nYou can now explore the edge of the solar system\nand visit trans-neptunian objects.", description = "Tier VI Titan Drive\n\nYou can now explore the edge of the solar system\nand visit trans-neptunian objects.",
inventory_image = "space_travel_space_drive_6.png^[colorize:#ebb34766", inventory_image = "space_travel_space_drive_6.png^[colorize:#ebb34766",
on_use = function(itemstack, user, pointed_thing) on_use = function(itemstack, user, pointed_thing)
local name = user:get_player_name() local name = user:get_player_name()
local attach = user:get_attach() local attach = user:get_attach()
if attach and attach:get_luaentity() then if attach and attach:get_luaentity() then
space_travel.space_drive_6_show(name) space_travel.space_drive_6_show(name)
else else
minetest.chat_send_player(name, "You are not in a space shuttle.") minetest.chat_send_player(name, "You are not in a space shuttle.")
end
end end
end })
})
minetest.register_tool("space_travel:space_drive_7", { minetest.register_tool("space_travel:space_drive_7", {
description = "Tier VII Warp Drive\n\nYou can now travel interstellar.\nSeek out strange new worlds and life forms.", description = "Tier VII Warp Drive\n\nYou can now travel interstellar.\nSeek out strange new worlds and life forms.",
inventory_image = "space_travel_space_drive_7.png", inventory_image = "space_travel_space_drive_7.png",
on_use = function(itemstack, user, pointed_thing) on_use = function(itemstack, user, pointed_thing)
local name = user:get_player_name() local name = user:get_player_name()
local attach = user:get_attach() local attach = user:get_attach()
if attach and attach:get_luaentity() then if attach and attach:get_luaentity() then
space_travel.space_drive_7_show(name) space_travel.space_drive_7_show(name)
else else
minetest.chat_send_player(name, "You are not in a space shuttle.") minetest.chat_send_player(name, "You are not in a space shuttle.")
end
end end
end })
}) end