Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General overhaul #11

Open
wants to merge 86 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
7eda102
add luacheck.yml github workflow
SwissalpS Apr 10, 2024
14b3dbe
add luacheck badge to Readme.md
SwissalpS Apr 10, 2024
cb250c2
luacheck silencing
SwissalpS Apr 10, 2024
e1dd174
whitespace cleanup
SwissalpS Apr 10, 2024
7ab4060
add CDB badge to Readme.md
SwissalpS Apr 10, 2024
3dbd982
Create crafts.lua
SwissalpS Apr 10, 2024
3dc52e5
move crafting to crafts.lua
SwissalpS Apr 10, 2024
fd63ec1
add unifieddyes to .luacheckrc
SwissalpS Apr 10, 2024
e8403b8
enable coloured gliders
SwissalpS Apr 10, 2024
3d387cb
.luacheckrc cleanup
SwissalpS Apr 10, 2024
4207813
rename to Delta Glider
SwissalpS Apr 10, 2024
1b5367f
move rocket to separate file
SwissalpS Apr 10, 2024
7520629
whitespace changes
SwissalpS Apr 10, 2024
0bcedb6
only use rockets if server settings allow them
SwissalpS Apr 10, 2024
aac1c5f
use vector.zero()
SwissalpS Apr 10, 2024
8d52c8d
change setting name for mouse controls
SwissalpS Apr 10, 2024
ffd68d0
slightly different control structure
SwissalpS Apr 10, 2024
03d821d
make sure fakeplayers don't crash the server
SwissalpS Apr 10, 2024
739c55f
rename tool too, to "Delta Glider"
SwissalpS Apr 10, 2024
7895224
don't crash server when player logs off while gliding
SwissalpS Apr 10, 2024
6751b33
wear out glider
SwissalpS Apr 10, 2024
ee978f2
comment and whitespace
SwissalpS Apr 10, 2024
243c0f9
avoid crashing server when fails to creat entity
SwissalpS Apr 10, 2024
401856e
avoid depricated functions
SwissalpS Apr 10, 2024
cb796f2
[player_monoids] support
SwissalpS Apr 10, 2024
f3a0daf
cleanup and load message
SwissalpS Apr 10, 2024
56c7a46
scope optimization
SwissalpS Apr 10, 2024
1c16b07
new glider_glider textures
SwissalpS Apr 10, 2024
bf3f929
more precise crash speed calculation
SwissalpS Apr 11, 2024
52b8692
also damage glider on crash
SwissalpS Apr 11, 2024
cec11e1
only allow rockets if [tnt] is available
SwissalpS Apr 11, 2024
c071344
undo damage glider on crash
SwissalpS Apr 11, 2024
fcdd3c4
remove objects without drivers
SwissalpS Apr 11, 2024
431604c
support flak and sounds
SwissalpS Apr 11, 2024
dacbd42
cleanup use same variable name for player
SwissalpS Apr 11, 2024
85640e3
preserve colour in repair recipes
SwissalpS Apr 11, 2024
f14ce2a
rename can_fly() to friendly_airspace()
SwissalpS Apr 11, 2024
739d459
fix spelling: dammage -> damage
SwissalpS Apr 11, 2024
35b834c
damage glider on crashes
SwissalpS Apr 11, 2024
842d69d
cleanup
SwissalpS Apr 11, 2024
d138d0d
support mcl for rockets
SwissalpS Apr 11, 2024
1968c5f
use rocket_delay
SwissalpS Apr 11, 2024
06b66a6
cleanup
SwissalpS Apr 11, 2024
a553df9
ouch, missing bracket
SwissalpS Apr 11, 2024
ea2cd4d
crafting update
SwissalpS Apr 11, 2024
f8c4e7a
mod.conf updated
SwissalpS Apr 11, 2024
e248fcd
version bump 20240411.182102
SwissalpS Apr 11, 2024
862e2f6
allow players to toggle control methods
SwissalpS Apr 11, 2024
16d9ca9
add crash_damage_wear_factor setting
SwissalpS Apr 12, 2024
e75962b
rename rocket_delay -> rocket_cooldown
SwissalpS Apr 13, 2024
a54d41c
add damage_driver()
SwissalpS Apr 13, 2024
d5a4671
rework custom flight checks
SwissalpS Apr 13, 2024
91db154
destroy glider on flak using damage_glider()
SwissalpS Apr 13, 2024
de1046d
add max_speed setting
SwissalpS Apr 13, 2024
d4172c6
add hud
SwissalpS Apr 13, 2024
cce9881
variable rename: control -> keys
SwissalpS Apr 13, 2024
8cec2af
move functions without changes
SwissalpS Apr 13, 2024
05cad63
fix bug when player dies while gliding
SwissalpS Apr 13, 2024
6078e51
some settings respecting [hangglider]
SwissalpS Apr 13, 2024
e7581da
version bump 20240413.22340
SwissalpS Apr 13, 2024
19e2d54
commit missing section
SwissalpS Apr 13, 2024
99775dc
revert to inverted controls by default
SwissalpS Apr 14, 2024
02fc61b
rename files for consistancy
SwissalpS Apr 16, 2024
062f035
refactor HUD to show glider values
SwissalpS Apr 16, 2024
d5e24d6
set default to novice controls
SwissalpS Apr 16, 2024
39ef71c
more sensitive keyboard control
SwissalpS Apr 16, 2024
c330f2b
cleanup and use same terminology for player
SwissalpS Apr 16, 2024
589cfda
version bump 20240416.172015
SwissalpS Apr 16, 2024
1ee0658
extend area FLAK with area priv and XP protections
SwissalpS Apr 16, 2024
6dff3e1
fix xp-limit detection for FLAK
SwissalpS Apr 18, 2024
b0e37de
make sure glider is destroyed completely by FLAK
SwissalpS Apr 18, 2024
9b9c1ef
add optional depends priv_protector and xp_redo
SwissalpS Apr 18, 2024
1ef2d61
avoid using core.get_player_by_name on every step
SwissalpS Apr 18, 2024
ab4e5c3
update readme.md
SwissalpS Apr 18, 2024
67ce14a
version bump 20240418.142741
SwissalpS Apr 18, 2024
3e7e9fa
Merge branch 'master' into upstream2
SwissalpS Apr 18, 2024
54f6464
adjust rocket particles
SwissalpS Apr 18, 2024
97271ee
HUD pitch fixup
SwissalpS Apr 19, 2024
df8ffb8
HUD fix heading
SwissalpS Apr 19, 2024
6c7babd
HUD add label to cooldown indicator
SwissalpS Apr 19, 2024
e4125b5
HUD fixed width vV indicator
SwissalpS Apr 19, 2024
4d48bf0
add chatcommand gliderToggleHUD
SwissalpS Apr 19, 2024
176547d
verbose HUD
SwissalpS Apr 19, 2024
ee11adb
Merge branch 'master' into upstream2
SwissalpS Apr 19, 2024
dbf9759
version bump 20240419.13372
SwissalpS Apr 19, 2024
845bbe4
version bump 202420240419.133727
SwissalpS Apr 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/luacheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: luacheck
on: [push, pull_request]
jobs:
luacheck:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Luacheck
uses: lunarmodules/luacheck@master
45 changes: 25 additions & 20 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -1,32 +1,37 @@
globals = {
"areas",
"glider",
}

read_globals = {
"DIR_DELIM",
"minetest", "core",
"dump", "dump2",
"vector",
"VoxelManip", "VoxelArea",
"PseudoRandom", "PcgRandom",
"ItemStack",
"Settings",
"unpack",
table = {
math = {
fields = {
"copy",
"indexof",
"insert_all",
"key_value_swap",
"abs",
"cos",
"floor",
"max",
"min",
"pi",
"sin",
"sqrt",
}
},
string = {
"minetest", "core",
"player_monoids",
"priv_protector",
unifieddyes = {
fields = {
"split",
"trim",
"get_color_from_dye_name",
}
},
math = {
vector = {
fields = {
"hypot",
"sign",
"factorial"
"multiply",
"new",
"zero",
}
},
}
"xp_redo",
}
11 changes: 0 additions & 11 deletions Readme.md

This file was deleted.

154 changes: 154 additions & 0 deletions crafts.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@

local has_basic_materials = minetest.get_modpath("basic_materials")
local has_farming = minetest.get_modpath("farming")
local has_pipeworks = minetest.get_modpath("pipeworks")
local has_ropes = minetest.get_modpath("ropes")
local has_unifieddyes = minetest.get_modpath("unifieddyes")
local has_wool = minetest.get_modpath("wool")

local dye_colors = {
white = "ffffff",
grey = "888888",
dark_grey = "444444",
black = "111111",
violet = "8000ff",
blue = "0000ff",
cyan = "00ffff",
dark_green = "005900",
green = "00ff00",
yellow = "ffff00",
brown = "592c00",
orange = "ff7f00",
red = "ff0000",
magenta = "ff00ff",
pink = "ff7f9f",
}

local function get_dye_color(name)
local color
if has_unifieddyes then
color = unifieddyes.get_color_from_dye_name(name)
end
if not color then
color = string.match(name, "^dye:(.+)$")
if color then
color = dye_colors[color]
end
end
return color
end

local function get_color_name(name)
name = string.gsub(name, "^dye:", "")
name = string.gsub(name, "_", " ")
name = string.gsub(name, "(%l)(%w*)", function(a, b) return string.upper(a) .. b end)
return name
end

local function get_color_name_from_color(color)
for name, color_hex in pairs(dye_colors) do
if color == color_hex then
return name
end
end

return nil
end

-- This recipe is just a placeholder
do
local item = ItemStack("glider:glider")
item:get_meta():set_string("description", "Colored Delta Glider")
minetest.register_craft({
output = item:to_string(),
recipe = { "glider:glider", "group:dye" },
type = "shapeless",
})
end

-- This is what actually creates the colored hangglider
minetest.register_on_craft(function(crafted_item, _, old_craft_grid)
if crafted_item:get_name() ~= "glider:glider" then
return
end
local wear, color, color_name
for _ ,stack in ipairs(old_craft_grid) do
local name = stack:get_name()
if name == "glider:glider" then
wear = stack:get_wear()
color = stack:get_meta():get("hangglider_color")
color_name = get_color_name_from_color(color)
elseif minetest.get_item_group(name, "dye") ~= 0 then
color = get_dye_color(name)
color_name = get_color_name(name)
elseif "wool:white" == stack:get_name()
or "default:paper" == stack:get_name()
then
wear = 0
end
end
if wear and color and color_name then
if color == "ffffff" then
return ItemStack({ name = "glider:glider", wear = wear })
end

local meta = crafted_item:get_meta()
meta:set_string("description", color_name .. " Delta Glider")
meta:set_string("inventory_image",
"glider_glider.png^(glider_glider_color.png^[multiply:#"
.. color .. ")")
meta:set_string("hangglider_color", color)
crafted_item:set_wear(wear)
return crafted_item
end
end)

-- Repairing
minetest.register_craft({
output = "glider:glider",
recipe = {
{ "default:paper", "default:paper", "default:paper" },
{ "default:paper", "glider:glider", "default:paper" },
{ "default:paper", "default:paper", "default:paper" },
},
})
if has_wool then
minetest.register_craft({
output = "glider:glider",
recipe = {
{ "glider:glider", "wool:white" },
},
})
end

-- Main craft
local fabric = "default:paper"
local stick = "group:stick"
local string = ""
if has_wool then
fabric = "wool:white"
end
if has_farming then
string = "farming:string"
end
if has_ropes then
string = "ropes:ropesegment"
end
if has_basic_materials then
fabric = "basic_materials:plastic_sheet"
string = "basic_materials:steel_wire"
stick = "basic_materials:steel_strip"
end
if has_pipeworks then
stick = "pipeworks:tube_1"
end

minetest.register_craft({
output = "glider:glider",
recipe = {
{ string, fabric, string },
{ fabric, fabric, fabric },
{ stick, stick, stick },
}
})