Compare commits

...

10 Commits

Author SHA1 Message Date
Wuzzy
00deac97db Version 1.1.0 2023-12-27 18:46:01 +01:00
Wuzzy
3ddf9152f5 Add license link for MIT License 2023-12-27 18:45:48 +01:00
Wuzzy
4fa1b4635d Add setting to enable legacy selectionbox 2023-12-27 18:41:42 +01:00
Wuzzy
2d13976dd7 Fix initial_properties warning 2023-12-27 18:29:17 +01:00
Wuzzy
ce32169b93 Remove interlacing from PNG file 2023-12-27 18:29:02 +01:00
Wuzzy
bf902ec843 Add mod title to mod.conf 2023-04-24 16:11:09 +02:00
Wuzzy
f9911958f5 Fix wrong file name in README 2023-04-24 16:10:59 +02:00
Wuzzy
af04b98ade Version 1.0.1 2023-02-25 00:04:08 +01:00
Wuzzy
c3556cb526 Add .mailmap for Wuzzy's e-mail 2023-02-24 23:57:41 +01:00
Wuzzy
2b3b92f086 Use TRUE ephemeral sounds 2020-04-06 00:46:21 +02:00
6 changed files with 37 additions and 14 deletions

2
.mailmap Normal file
View File

@ -0,0 +1,2 @@
Wuzzy <Wuzzy@disroot.org> <Wuzzy2@mail.ru>
Wuzzy <Wuzzy@disroot.org> <almikes@aol.com>

View File

@ -1,7 +1,7 @@
# Minetest mod: Flying Carpet
by Wuzzy
Version: 1.0.0
Version: 1.1.0
## Introduction
Quickly explore the vast terrain with the magical flying carpet. But only the skilled users can master its speed, the fools will crash and hurt themselves.
@ -116,7 +116,7 @@ MIT License
- `flying_carpet_inventory.png`: Roman Zacharij and Wuzzy, MIT License
- `flying_carpet_slide.ogg`: crcavol, MIT License
- `flying_carpet_magic_smoke.png`: Wuzzy, MIT License
- `flying_carpet_smoke.png.png`: Wuzzy. MIT License
- `flying_carpet_smoke.png`: Wuzzy. MIT License
- `flying_carpet_star.png`: Wuzzy, MIT License
- `flying_carpet_star_warning.png`: Wuzzy, MIT License
- `flying_carpet_star_death_warning.png`: Wuzzy, MIT License
@ -124,3 +124,4 @@ MIT License
### License references
* [CC BY-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0/)
* [MIT License](https://mit-license.org/)

View File

@ -1,5 +1,7 @@
local S = minetest.get_translator("flying_carpet")
local legacy_selectionbox = minetest.settings:get_bool("flying_carpet_legacy_selectionbox", false)
--
-- Helper functions
--
@ -95,13 +97,22 @@ local update_velocities = function(velocities, new_value)
return velocities
end
local collisionbox = {-1,-0.02,-1, 1,0.02,1}
if legacy_selectionbox then
selectionbox = collisionbox
else
selectionbox = {-1,-0.03,-0.69, 1,0.03,0.69,rotate=true}
end
local carpet = {
physical = true,
collide_with_objects = false,
collisionbox = {-1,-0.02,-1, 1,0.02,1},
visual = "mesh",
mesh = "flying_carpet_model.obj",
textures = {"flying_carpet_surface.png"},
initial_properties = {
physical = true,
collide_with_objects = false,
collisionbox = collisionbox,
selectionbox = selectionbox,
visual = "mesh",
mesh = "flying_carpet_model.obj",
textures = {"flying_carpet_surface.png"},
},
driver = nil, -- Attached player object
v = 0, -- Velocity on the horizontal plane
@ -219,7 +230,7 @@ function carpet:on_punch(puncher, time_from_last_punch, tool_capabilities, direc
-- Owner of flying carpet punches
if (self.driver == puncher and self.flying) then
-- Go into falling mode immediately
minetest.sound_play("flying_carpet_out_of_energy", {pos = self.object:get_pos(), gain=0.7}, false)
minetest.sound_play("flying_carpet_out_of_energy", {pos = self.object:get_pos(), gain=0.7}, true)
magic_particle(self.object)
if mod_mana then
mana.setregen(puncher:get_player_name(), mana.getregen(puncher:get_player_name())+mana_regen_cost)
@ -248,7 +259,7 @@ function carpet:on_punch(puncher, time_from_last_punch, tool_capabilities, direc
minetest.add_item(self.object:get_pos(), leftover)
end
end
minetest.sound_play("flying_carpet_take", {pos=self.object:get_pos(), gain=0.3}, false)
minetest.sound_play("flying_carpet_take", {pos=self.object:get_pos(), gain=0.3}, true)
puncher:set_detach()
if mod_model then
player_api.player_attached[puncher:get_player_name()] = false
@ -366,7 +377,7 @@ function carpet:on_step(dtime)
if mod_mana then
if mana.getregen(self.driver:get_player_name()) < 0 and mana.get(self.driver:get_player_name()) == 0 then
minetest.sound_play("flying_carpet_out_of_energy", {pos = self.object:get_pos(), gain=0.7}, false)
minetest.sound_play("flying_carpet_out_of_energy", {pos = self.object:get_pos(), gain=0.7}, true)
magic_particle(self.object)
self.falling = true
self.flying = false
@ -545,7 +556,7 @@ function carpet:on_step(dtime)
if (self.v < 6 and self.starttimer >= 5) or (self.v < 0.5 and self.starttimer >= 0.5) then
if self.falling == false then
minetest.sound_play("flying_carpet_out_of_energy", {pos = self.object:get_pos(), gain=0.7}, false)
minetest.sound_play("flying_carpet_out_of_energy", {pos = self.object:get_pos(), gain=0.7}, true)
self.falling = true
self.flying = false
if mod_mana and self.driver ~= nil then
@ -640,7 +651,7 @@ function carpet:on_step(dtime)
self.driver:get_meta():set_int("flying_carpet:mana_cost", 0)
end
end
minetest.sound_play("flying_carpet_out_of_energy", {pos = self.object:get_pos(), gain=0.7}, false)
minetest.sound_play("flying_carpet_out_of_energy", {pos = self.object:get_pos(), gain=0.7}, true)
self.object:remove()
return
end
@ -729,7 +740,7 @@ minetest.register_tool("flying_carpet:carpet", {
if not minetest.settings:get_bool("creative_mode") then
itemstack:take_item()
end
minetest.sound_play("flying_carpet_place", {pos = place_pos, gain = 1}, false)
minetest.sound_play("flying_carpet_place", {pos = place_pos, gain = 1}, true)
return itemstack
end,
})

View File

@ -1,3 +1,4 @@
name = flying_carpet
title = Flying Carpet
optional_depends = player_api, wool, mana, doc_items, doc_identifier
description = Quickly explore the vast terrain with the magical flying carpet. But only the skilled users can master its speed, the fools will crash and hurt themselves.

8
settingtypes.txt Normal file
View File

@ -0,0 +1,8 @@
# If enabled, the flying carpet uses an outdated non-rotated
# square-shaped selection box.
# If disabled, the flying carpet has a selection box that matches
# its shape and rotation perfectly.
# Rotating selection boxes are supported since Minetest 5.7.0.
# If your Minetest version is older, enable this setting.
# If not, disable this setting.
flying_carpet_legacy_selectionbox (Use legacy selection box) bool false

Binary file not shown.

Before

Width:  |  Height:  |  Size: 360 B

After

Width:  |  Height:  |  Size: 301 B