Skip to content

Commit

Permalink
day_one
Browse files Browse the repository at this point in the history
  • Loading branch information
Python-Sargent committed Nov 2, 2024
1 parent aa189f6 commit 05a76aa
Show file tree
Hide file tree
Showing 88 changed files with 1,431 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Reentry


Reentry is a Space Survival game built for the Luanti 2024 Game Jam

## Installation

Expand All @@ -14,7 +14,9 @@ In the Luanti Engine:

### Manually

- Unzip the archive, rename the folder to `Luanti Game Jam` and
- Go to [Reentry Github](https://github.com/Python-Sargent/Reentry) and download the release.

- Unzip the archive, rename the folder to `Reentry` and
place it in `.../minetest/games/`

- GNU/Linux: If you use a system-wide installation place it in `~/.minetest/games/`.
Expand Down
2 changes: 2 additions & 0 deletions game.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
title = Reentry
description = Submission for the LGJ2024. A space survival game.
allowed_mapgens = singlenode
disabled_settings = !enable_damage
Binary file added menu/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions mods/reentry_creative/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Reentry mod (copied from MTG): creative
===========================
See license.txt for license information.

Authors of source code
----------------------
Originally by Perttu Ahola (celeron55) <[email protected]> (MIT)
Jean-Patrick G. (kilbith) <[email protected]> (MIT)

Modified by Altius Games (SuperStarSonic) - Samuel Sargent <[email protected]> (MIT)

Author of media (textures)
--------------------------
paramat (CC BY-SA 3.0):
* creative_prev_icon.png
* creative_next_icon.png
* creative_search_icon.png
* creative_clear_icon.png
* creative_trash_icon.png derived from a texture by kilbith (CC BY-SA 3.0)
96 changes: 96 additions & 0 deletions mods/reentry_creative/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
-- creative/init.lua

-- Load support for MT game translation.
local S = minetest.get_translator("creative")

creative = {}
creative.get_translator = S

local function update_sfinv(name)
minetest.after(0, function()
local player = minetest.get_player_by_name(name)
if player then
if sfinv.get_page(player):sub(1, 9) == "creative:" then
sfinv.set_page(player, sfinv.get_homepage_name(player))
else
sfinv.set_player_inventory_formspec(player)
end
end
end)
end

minetest.register_privilege("creative", {
description = S("Allow player to use creative inventory"),
give_to_singleplayer = false,
give_to_admin = false,
on_grant = update_sfinv,
on_revoke = update_sfinv,
})

-- Override the engine's creative mode function
local old_is_creative_enabled = minetest.is_creative_enabled

function minetest.is_creative_enabled(name)
if name == "" then
return old_is_creative_enabled(name)
end
return minetest.check_player_privs(name, {creative = true}) or
old_is_creative_enabled(name)
end

-- For backwards compatibility:
function creative.is_enabled_for(name)
return minetest.is_creative_enabled(name)
end

dofile(minetest.get_modpath("creative") .. "/inventory.lua")

if minetest.is_creative_enabled("") then
minetest.register_on_mods_loaded(function()
-- Dig time is modified according to difference (leveldiff) between tool
-- 'maxlevel' and node 'level'. Digtime is divided by the larger of
-- leveldiff and 1.
-- To speed up digging in creative, hand 'maxlevel' and 'digtime' have been
-- increased such that nodes of differing levels have an insignificant
-- effect on digtime.
local digtime = 42
local caps = {times = {digtime, digtime, digtime}, uses = 0, maxlevel = 256}

-- Override the hand tool
minetest.override_item("", {
wield_scale = {x=1,y=1,z=2.5},
tool_capabilities = {
full_punch_interval = 0.9,
groupcaps = {
diggable = {times={[1]=4.00, [2]=1.80, [3]=0.60}, uses=0, maxlevel=1},
mapnode = {times={[1]=0}, uses=0, maxlevel=1},
},
damage_groups = {damageable=1,removeable=10},
}
})
end)
end

-- Unlimited node placement
minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack)
if placer and placer:is_player() then
return minetest.is_creative_enabled(placer:get_player_name())
end
end)

-- Don't pick up if the item is already in the inventory
local old_handle_node_drops = minetest.handle_node_drops
function minetest.handle_node_drops(pos, drops, digger)
if not digger or not digger:is_player() or
not minetest.is_creative_enabled(digger:get_player_name()) then
return old_handle_node_drops(pos, drops, digger)
end
local inv = digger:get_inventory()
if inv then
for _, item in ipairs(drops) do
if not inv:contains_item("main", item, true) then
inv:add_item("main", item)
end
end
end
end
Loading

0 comments on commit 05a76aa

Please sign in to comment.