Compare commits

...

77 Commits

Author SHA1 Message Date
a3846876ec changed shit to poop 2023-05-03 12:11:11 +02:00
1705722908 Craftings added 2023-05-02 20:54:31 +02:00
b62ffd6996 Shitting fixed 2023-05-02 20:34:00 +02:00
0397a7a911 Shitting added 2023-05-02 20:30:12 +02:00
31df071956 new biome 2023-05-02 20:12:09 +02:00
8a28cbfddb new player model 2023-05-02 18:44:15 +02:00
ce0ca11f31 less unnecesary crap code 2023-05-02 17:12:25 +02:00
edcfc93db3 removed bags from i3 2023-04-28 08:01:36 +02:00
88b8e857cb big changes 2023-04-26 21:27:40 +02:00
dcaa8e5d63 changed item pickup radius to 2 2023-04-26 20:09:07 +02:00
ba91a3df1b sus 2023-04-25 00:57:34 +02:00
57d740cf4f restored main menu music 2023-04-17 22:31:39 +02:00
343911c1c9 Update 'README.md' 2023-03-19 12:44:01 +00:00
d0fc5ca2e5 Update 'README.md' 2023-03-19 12:39:23 +00:00
a892365de4 sus 2023-03-02 17:12:48 +01:00
8a08384a6c small sussy changes 2023-02-28 18:51:57 +01:00
8f0806b0a4 modified sussy imposter spawning parameters, removed foggy piano music for now 2023-02-23 20:57:08 +01:00
5f60a72df9 nice 2023-02-23 20:37:11 +01:00
6d67496bd6 fixed sodas 2023-02-23 19:03:31 +00:00
02a7044e19 added new amogus spawning system, tweaked sussy imposter spawning system 2023-02-23 19:03:25 +01:00
adefaaf592 removed old amogus sound file and added music to main menu 2023-02-23 15:24:47 +01:00
0a0ecf49b4 updated license 2023-02-23 15:16:50 +01:00
b4b589f864 Zaktualizuj 'LICENSE.txt' 2023-02-23 14:12:14 +00:00
0a15121fbf trying to add item_drop again 2023-02-18 19:03:00 +01:00
e41623d029 temporarly removed item_drop 2023-02-18 19:01:39 +01:00
89c8b55d8d AAAAAAAA NOT WORKING 2023-02-18 18:57:05 +01:00
6036182625 part 3/3 added item_drop NOT as submodule 2023-02-18 18:54:50 +01:00
09f544e34c last commit not working so theres 2/3 part 2023-02-18 18:53:44 +01:00
f385686b3d mod item_drop is no loner a submodule 2023-02-18 18:51:36 +01:00
1622e5cd6d I suspiciously f****d up last commit so theres second part of the previous one 2023-02-18 17:15:39 +01:00
cbeab46431 restored item_drop submodule, added new sussy imposter spawning system, added mod.conf with name to every mod, fixed 3 water errors on chat 2023-02-18 17:07:35 +01:00
73e63d452f obsusian sword damage fixed 2023-02-18 12:53:23 +01:00
7eae59a8ca fix 2023-02-18 12:09:31 +01:00
0a7f3829f3 added item drop pickup mod as submodule, fixed "Deprecated call to "get_entity_name" error spam, increased sussy imposter spawning rate but decreased chance of spawn on each iteration 2023-02-16 00:49:24 +01:00
Kacper Kostka
a17a49bbfd cool 2023-02-12 17:34:01 +01:00
Kacper Kostka
275ef8f3a1 Purple Bricks fixed 2023-02-12 16:13:22 +01:00
Kacper Kostka
a9a5a9bcb5 fix 2023-02-12 16:09:51 +01:00
Kacper Kostka
60fec2cb4f nice 2023-02-12 16:07:35 +01:00
49cf5f16f9 sussy imposters no longer spawn underwater 2023-02-11 19:28:03 +01:00
Kacper Kostka
5233a3aa6f . 2023-02-06 05:22:35 +01:00
f62082d9c6 Added Sussy Imposter (he's very sussy and he wants to kill you) and improved jumping of every entity 2023-02-05 23:47:35 +01:00
Kacper Kostka
27d36b0e8b craftings fixed 2023-02-05 21:35:34 +01:00
Kacper Kostka
e281b06031 n 2023-02-05 16:37:48 +01:00
Kacper Kostka
f739bcab43 n 2023-02-05 16:16:25 +01:00
Kacper Kostka
e32fed7ebc Merge branch 'master' of http://git.cubesoftware.xyz:20524/kacperks/SussyCraft 2023-02-05 12:19:14 +01:00
Kacper Kostka
d97c031888 nice 2023-02-05 12:19:02 +01:00
4ff9fe733b added sussy imposter shaped water bucket and empty bucket with sussy random names 2023-02-05 02:17:27 +01:00
a601906435 removed water source from player creative inventory 2023-02-04 21:23:55 +01:00
5df7c4dc59 I spent over an hour moving player hotbar in i3 inventory to the bottom. 2023-02-04 17:52:56 +01:00
Kacper Kostka
0b4456cf7e cool craftings 2023-02-04 16:17:05 +01:00
Kacper Kostka
4c21c72aba dynamite added: 2023-02-03 18:13:48 +01:00
98a97f4aee added transparency to the water 2023-02-03 08:04:38 +01:00
d16714b3ae Merge branch 'master' of http://git.cubesoftware.xyz:20524/kacperks/SussyCraft 2023-02-03 07:49:16 +01:00
2e67b44f7a fixed massive amount of water errors (only 3 sussy error messages left) and now water can flow 2023-02-03 07:49:06 +01:00
Kacper Kostka
4a5de5757c carts 2023-02-03 07:26:53 +01:00
Kacper Kostka
7f9fe5adff new reciepes 2023-02-03 07:03:12 +01:00
d18d3d3794 added sussy music 2023-02-01 19:28:51 +01:00
feee9cba44 shortended water block texture code 2023-02-01 15:32:49 +01:00
71cf78c304 added random mini crewmate colors 2023-01-31 22:31:00 +01:00
bc21a51a77 added random sounds and some little changes (little as you, little sussy baka) 2023-01-31 22:14:39 +01:00
97601cfe24 Merge branch 'master' of http://git.cubesoftware.xyz:20524/kacperks/SussyCraft 2023-01-31 20:24:36 +01:00
673e7083a7 fixed sussy bug i totaly true 100% confirmed didnt know about that caused mini crewmates to crash on multplayer when spawned 2023-01-31 20:24:22 +01:00
Kacper Kostka
688f73e4a3 Yas 2023-01-31 05:45:15 +01:00
8df420796a now sussy mini crewmates can be hit and they run away. 2023-01-30 16:53:03 +01:00
Kacper Kostka
20c937f1e4 yas Sus 2023-01-30 07:24:03 +01:00
Kacper Kostka
0be3171577 player collisions fixed. 2023-01-29 11:28:07 +01:00
Kacper Kostka
15888ac85e amogus spawner fixed 2023-01-29 09:27:09 +01:00
Kacper Kostka
3dad29ca0a Sussy Character 2023-01-29 08:55:54 +01:00
Kacper Kostka
8ecc69cea0 random color of amoguses 2023-01-29 08:25:10 +01:00
2b97c8ba4a sussy baka modified ur code 2023-01-29 00:09:39 +01:00
24ed7606ba Merge branch 'master' of http://git.cubesoftware.xyz:20524/kacperks/SussyCraft 2023-01-28 23:59:01 +01:00
4e7a041d58 added (unfinished) mini crewmates, fixed bug causing amoguses couldnt jump underwater and some other sussy changes 2023-01-28 23:58:43 +01:00
Kacper Kostka
ed95983450 . 2023-01-28 19:12:16 +01:00
Kacper Kostka
8b7a428b88 wowowo looking gooooood 2023-01-28 11:04:13 +01:00
Kacper Kostka
046d6fb7a1 cool 2023-01-27 13:07:56 +01:00
Kacper Kostka
9a9b150cd1 sand biome added 2023-01-26 13:52:37 +01:00
Kacper Kostka
8a064ab0ac new tools and world generator updated 2023-01-26 13:42:13 +01:00
183 changed files with 5463 additions and 2216 deletions

View File

@@ -0,0 +1,8 @@
The MIT License (MIT)
Copyright © 2023 Kacper Kostka & Looki2000 (Łukasz Brzostowski)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

2
README.md Normal file
View File

@@ -0,0 +1,2 @@
added readme because yes
sus

BIN
menu/theme.ogg Normal file

Binary file not shown.

View File

@@ -1,4 +1,3 @@
minetest.register_node("amogus_blocks:ladder_steel", {
description = "Ladder",
drawtype = "signlike",
@@ -26,20 +25,58 @@ minetest.register_node("amogus_blocks:tv", {
"crt.png"
},
paramtype2 = "facedir",
drop = 'amogus_blocks:amogus_blocks', groups = {cracky=3, stone=1},
drop = { -- amogus_items:capacitor amogus_items:pcb
-- drop two items
max_items = 2,
items = {
{items = {'amogus_items:capacitor'}, rarity = 1},
{items = {'amogus_items:pcb'}, rarity = 1},
},
}, groups = {crumbly = 3},
})
minetest.register_node("amogus_blocks:bricks", {
description = "Bricks",
description = "Red Bricks",
tiles = {"Bricks.png"},
drop = 'amogus_blocks:grey_bricks', groups = {cracky=3, stone=1},
drop = 'amogus_blocks:bricks', groups = {stone=3},
})
minetest.register_node("amogus_blocks:grey_bricks", {
description = "Bricks 2",
tiles = {"Bricks2.png"}, groups = {cracky=3, stone=1},
description = "Bricks",
tiles = {"Bricks2.png"}, groups = {stone=3},
drop = 'amogus_blocks:grey_bricks', groups = {cracky=3, stone=1},
drop = 'amogus_blocks:grey_bricks',
})
minetest.register_node("amogus_blocks:blue_bricks", {
description = "blue Bricks",
tiles = {"Bricks_blue.png"}, groups = {stone=3},
drop = 'amogus_blocks:blue_bricks',
})
minetest.register_node("amogus_blocks:yellow_bricks", {
description = "yellow Bricks",
tiles = {"Bricks_yellow.png"}, groups = {stone=3},
drop = 'amogus_blocks:yellow_bricks',
})
minetest.register_node("amogus_blocks:green_bricks", {
description = "green Bricks",
tiles = {"Bricks_green.png"}, groups = {stone=3},
drop = 'amogus_blocks:green_bricks',
})
minetest.register_node("amogus_blocks:black_bricks", {
description = "black Bricks",
tiles = {"Bricks_black.png"}, groups = {stone=3},
drop = 'amogus_blocks:black_bricks',
})
minetest.register_node("amogus_blocks:purple_bricks", {
description = "purple Bricks",
tiles = {"Bricks_purple.png"}, groups = {stone=3},
drop = 'amogus_blocks:purple_bricks',
})
minetest.register_node("amogus_blocks:planks", {
description = "Planks",
@@ -97,7 +134,7 @@ minetest.register_node("amogus_blocks:glowing_block", {
})
minetest.register_node("amogus_blocks:transparent", {
description = "Transparent",
description = "Glass",
drawtype = "glasslike",
tiles = {"glass.png"},
paramtype = "light",
@@ -106,6 +143,29 @@ minetest.register_node("amogus_blocks:transparent", {
groups = {cracky=3,oddly_breakable_by_hand=3},
})
---- grasses and dirts (blocks) ----
minetest.register_node("amogus_blocks:dirt", {
description = "Dirt",
tiles = {"d.png"},
groups = {crumbly = 3},
drop = {
max_items = 2,
items = {
{
items = {"amogus_blocks:dirt"}, -- always drop one dirt
rarity = 1,
},
{
items = {"amogus_items:rock"},
rarity = 3,
},
},
},
})
minetest.register_node("amogus_blocks:grass", {
description = "Grass",
tiles = {
@@ -122,14 +182,15 @@ minetest.register_node("amogus_blocks:grass", {
items = {
{
items = {'amogus_blocks:dirt'},
rarity = 3,
rarity = 1,
},
{
items = {'amogus_items:rock'},
rarity = 2,
rarity = 3,
},
},
}, groups = {crumbly=3},
},
groups = {crumbly=3},
})
minetest.register_node("amogus_blocks:grass_green", {
@@ -148,124 +209,108 @@ minetest.register_node("amogus_blocks:grass_green", {
items = {
{
items = {'amogus_blocks:dirt'},
rarity = 3,
rarity = 1,
},
{
items = {'amogus_items:rock'},
rarity = 2,
rarity = 3,
},
},
}, groups = {crumbly=3},
})
---------------------------------
minetest.register_node("amogus_blocks:wood", {
description = "Wood",
tiles = {"wood.png"},
drop = 'amogus_items:wooden_plank',
drop = 'amogus_blocks:wood',
groups = {choppy = 3, flammable = 3, wood = 1},
})
minetest.register_node("amogus_blocks:water", {
description = "Water",
minetest.register_node("amogus_blocks:water_source", {
description = "Water Source",
drawtype = "liquid",
waving = 3,
tiles = {
{
name = "water.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 2.0,
},
},
{
name = "water.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 2.0,
},
},
},
special_tiles = {
-- New-style water source material (mostly unused)
{
name = "water.png",
name = "water.png^[opacity:127]",
backface_culling = false,
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 2.0,
},
},
-- New-style flowing water material (mostly unused)
{
name = "water.png",
name = "water.png^[opacity:127]",
backface_culling = true,
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 0.8,
},
},
},
alpha = 160,
use_texture_alpha = "blend",
paramtype = "light",
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
is_ground_content = false,
drop = "",
drowning = 1,
liquidtype = "source",
--liquid_alternative_flowing = "amogus_blocks:water_flowing",
--liquid_alternative_source = "amogus_blocks:water_source",
liquid_alternative_flowing = "amogus_blocks:water_flowing",
liquid_alternative_source = "amogus_blocks:water_source",
liquid_viscosity = 1,
post_effect_color = {a = 103, r = 30, g = 60, b = 90},
groups = {water = 3, liquid = 3, puts_out_fire = 1},
groups = {water = 3, liquid = 3, cools_lava = 1, not_in_creative_inventory = 1},
})
minetest.register_node("amogus_blocks:dirt", {
description = "Dirt",
tiles = {"d.png"},
groups = {crumbly = 3},
minetest.register_node("amogus_blocks:water_flowing", {
description = "Flowing Water",
drawtype = "flowingliquid",
waving = 3,
drop = {
max_items = 2,
items = {
{
items = {'amogus_blocks:dirt'},
rarity = 3,
},
{
items = {'amogus_items:rock'},
rarity = 2,
},
tiles = {"water.png^[opacity:127]"},
special_tiles = {
{
name = "water.png^[opacity:127]",
backface_culling = false,
},
{
name = "water.png^[opacity:127]",
backface_culling = true,
},
},
use_texture_alpha = "blend",
paramtype = "light",
paramtype2 = "flowingliquid",
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
is_ground_content = false,
drop = "",
drowning = 1,
liquidtype = "flowing",
liquid_alternative_flowing = "amogus_blocks:water_flowing",
liquid_alternative_source = "amogus_blocks:water_source",
liquid_viscosity = 1,
post_effect_color = {a = 103, r = 30, g = 60, b = 90},
groups = {water = 3, liquid = 3, not_in_creative_inventory = 1, cools_lava = 1}
})
minetest.register_node("amogus_blocks:sand", {
description = "Sand",
tiles = {"sand.png"},
groups = {crumbly = 3, falling_node = 1},
})
minetest.register_node("amogus_blocks:stone", {
description = "Stone",
tiles = {"stone.png"},
-- drop 10 times amogus_items:rock
drop = {
max_items = 10,
items = {
{
items = {'amogus_items:rock'},
rarity = 1,
},
},
},
drop = 'amogus_items:rock 9',
--sounds = default.node_sound_stone_defaults(),
groups = {cracky = 3, stone = 1},
groups = {stone = 3},
})
--add gold ore and sussium ore
@@ -273,7 +318,7 @@ minetest.register_node("amogus_blocks:stone", {
minetest.register_node("amogus_blocks:gold_ore", {
description = "Gold Ore",
tiles = {"gold.png"},
groups = {cracky = 3, stone = 1},
groups = {stone = 2},
drop = 'amogus_items:gold_ingot',
--sounds = default.node_sound_stone_defaults(),
})
@@ -281,29 +326,69 @@ minetest.register_node("amogus_blocks:gold_ore", {
minetest.register_node("amogus_blocks:sussium_ore", {
description = "Sussium Ore",
tiles = {"sussium.png"},
groups = {cracky = 3, stone = 1},
groups = {stone = 1},
drop = 'amogus_items:sussium_ingot',
--sounds = default.node_sound_stone_defaults(),
})
local loot = {
"amogus_items:amogus",
"amogus_items:sprite",
"amogus_items:coke",
"amogus_items:fanta",
"amogus_items:tomato",
"amogus_items:lightsaber_blue",
"amogus_items:lightsaber_red",
"amogus_items:lightsaber_green",
minetest.register_node("amogus_blocks:iron_ore", {
description = "Iron Ore",
tiles = {"iron_ore.png"},
groups = {stone = 3},
drop = 'amogus_items:iron_ingot',
--sounds = default.node_sound_stone_defaults(),
})
-- item name, probability (larger number = larger probability relative to numbers of other items)
local lucky_loot = {
{"amogus_items:dynamite" , 3.0},
{"amogus_items:amogus" , 4.0},
{"amogus_items:coke" , 2.0},
{"amogus_items:fanta" , 2.0},
{"amogus_items:tomato" , 2.0},
{"amogus_items:sugar" , 4.0},
{"amogus_items:water" , 4.0},
{"amogus_items:sprite" , 2.0},
{"amogus_items:lightsaber_blue" , 1.0},
{"amogus_items:lightsaber_red" , 1.0},
{"amogus_items:lightsaber_green" , 1.0},
}
-- sum of all numbers in second column
local lucky_loot_propability_sum = 0
local last_lucky_loot_propability_sum = 0
for _, item in ipairs(lucky_loot) do
last_lucky_loot_propability_sum = lucky_loot_propability_sum
lucky_loot_propability_sum = lucky_loot_propability_sum + item[2]
item[2] = last_lucky_loot_propability_sum
-- create new column element
item[3] = lucky_loot_propability_sum
end
minetest.register_node("amogus_blocks:lucky_block", {
description = "Lucky Block",
tiles = {"luckyblock.png"},
groups = {cracky = 3},
on_punch = function(pos, node, puncher, pointed_thing)
local item = loot[math.random(#loot)]
minetest.add_item(pos, item)
local random_number = math.random() * lucky_loot_propability_sum
for _, item in ipairs(lucky_loot) do
-- if random_number is in range of current item (inclusive start, exclusive end)
if random_number >= item[2] and random_number < item[3] then
minetest.add_item(pos, item[1])
break
end
end
--local item = lucky_loot[math.random(#lucky_loot)]
--minetest.add_item(pos, item)
minetest.add_particlespawner({
amount = 100,
time = 0.1,
@@ -328,7 +413,12 @@ minetest.register_node("amogus_blocks:lucky_block", {
minetest.register_node("amogus_blocks:amogus_spawner", {
description = "Amogus Spawner",
tiles = {"amogus_spawner.png"},
tiles = {"spawner.png"},
drawtype = "glasslike",
paramtype = "light",
is_ground_content = false,
sunlight_propagates = true,
-- after place event
--on_ = function(pos)
@@ -343,6 +433,23 @@ minetest.register_node("amogus_blocks:amogus_spawner", {
local spawned = meta:get_int("spawned")
if spawned < 30 then
minetest.add_entity({x = pos.x, y = pos.y + 1, z = pos.z}, "amogus_entities:amogus")
minetest.add_particlespawner({
amount = 1000,
time = 0.3,
minpos = pos,
maxpos = pos,
minvel = {x = -1, y = 5, z = -1},
maxvel = {x = 1, y = 5, z = 1},
minacc = {x = 0, y = -10, z = 0},
maxacc = {x = 0, y = -10, z = 0},
minexptime = 0.1,
maxexptime = 0.5,
minsize = 1,
maxsize = 2,
collisiondetection = true,
vertical = false,
texture = "amog_flower.png",
})
spawned = spawned + 1
meta:set_int("spawned", spawned)
minetest.get_node_timer(pos):start(meta:get_int("interval"))
@@ -351,3 +458,134 @@ minetest.register_node("amogus_blocks:amogus_spawner", {
end
end
})
minetest.register_node("amogus_blocks:green_leaves", {
description = "Green Leaves",
drawtype = "glasslike",
tiles = {"leaves.png"},
paramtype = "light",
is_ground_content = false,
sunlight_propagates = true,
groups = {cracky=3,oddly_breakable_by_hand=3},
})
minetest.register_node("amogus_blocks:grass_tall", {
description = "Grass plant",
drawtype = "plantlike",
tiles = {"grass_tall.png"},
inventory_image = "grass_tall.png",
wield_image = "grass_tall.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
groups = {snappy=3,flammable=2,flower=1},
--sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
},
})
minetest.register_node("amogus_blocks:purple_grass_tall", {
description = "Grass plant",
drawtype = "plantlike",
tiles = {"purple_grass_tall.png"},
inventory_image = "purple_grass_tall.png",
wield_image = "purple_grass_tall.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
groups = {snappy=3,flammable=2,flower=1},
--sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
},
})
minetest.register_node("amogus_blocks:amogflower", {
description = "amogus flower",
drawtype = "plantlike",
tiles = {"amog_flower.png"},
inventory_image = "amog_flower.png",
wield_image = "amog_flower.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
light_source = 14,
groups = {snappy=3,flammable=2,flower=1},
--sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
},
})
minetest.register_node("amogus_blocks:redflower", {
description = "red flower",
drawtype = "plantlike",
tiles = {"flower.png"},
inventory_image = "flower.png",
wield_image = "flower.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
groups = {snappy=3,flammable=2,flower=1},
--sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
},
})
minetest.register_node("amogus_blocks:yellowflower", {
description = "yellow flower",
drawtype = "plantlike",
tiles = {"flower_2.png"},
inventory_image = "flower_2.png",
wield_image = "flower_2.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
groups = {snappy=3,flammable=2,flower=1},
--sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
},
})
minetest.register_node("amogus_blocks:obsusian", {
description = "obSUSian",
tiles = {"obsusian.png"},
groups = {stone=0.5},
})
-- create golden, sussium block
minetest.register_node("amogus_blocks:sussium_block", {
description = "SUSsium block",
tiles = {"sussium_block.png"},
groups = {stone=1},
})
minetest.register_node("amogus_blocks:golden_block", {
description = "golden block",
tiles = {"golden_block.png"},
groups = {stone=2},
})
minetest.register_node("amogus_blocks:grass_yellow", {
description = "Yellow Grass",
tiles = {
"grass_yellow_top.png",
"d.png",
"grass_yellow_side.png",
"grass_yellow_side.png",
"grass_yellow_side.png",
"grass_yellow_side.png"
},
groups = {crumbly=3,soil=1},
drop = 'amogus_blocks:dirt',
})

View File

@@ -0,0 +1 @@
name = amogus_blocks

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1015 B

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 187 B

After

Width:  |  Height:  |  Size: 232 B

View File

@@ -1,33 +1,18 @@
minetest.register_craft({
output = "amogus_items:goldenaxe",
recipe = {
{"amogus_items:gold_ingot", "amogus_items:gold_ingot", ""},
{"amogus_items:gold_ingot", "amogus_items:wooden_plank", ""},
{"", "amogus_items:wooden_plank", ""},
}
})
minetest.register_craft({
output = "amogus_items:stonepickaxe",
recipe = {
{"amogus_items:rock", "amogus_items:rock", "amogus_items:rock"},
{"", "amogus_items:wooden_plank", ""},
{"", "amogus_items:wooden_plank", ""},
}
})
minetest.register_craft({
output = "amogus_items:goldenplumba",
recipe = {
{"amogus_items:gold_ingot", "amogus_items:gold_ingot", "amogus_items:gold_ingot"},
{"amogus_items:gold_ingot", "amogus_items:wooden_plank", "amogus_items:gold_ingot"},
{"amogus_items:gold_ingot", "amogus_items:wooden_plank", "amogus_items:gold_ingot"},
{"amogus_items:gold_ingot", "amogus_blocks:planks", "amogus_items:gold_ingot"},
{"amogus_items:gold_ingot", "amogus_blocks:planks", "amogus_items:gold_ingot"},
}
})
minetest.register_craft({
output = "amogus_items:susplumba",
recipe = {
{"amogus_items:sussium_ingot", "amogus_items:sussium_ingot", "amogus_items:sussium_ingot"},
{"amogus_items:sussium_ingot", "amogus_items:wooden_plank", "amogus_items:sussium_ingot"},
{"amogus_items:sussium_ingot", "amogus_items:wooden_plank", "amogus_items:sussium_ingot"},
{"amogus_items:sussium_ingot", "amogus_blocks:planks", "amogus_items:sussium_ingot"},
{"amogus_items:sussium_ingot", "amogus_blocks:planks", "amogus_items:sussium_ingot"},
}
})
@@ -48,11 +33,303 @@ minetest.register_craft({
}
})
minetest.register_craft({
output = "amogus_blocks:planks",
output = "amogus_blocks:planks 4",
recipe = {
{"amogus_items:wooden_plank", "amogus_items:wooden_plank", "amogus_items:wooden_plank"},
{"amogus_items:wooden_plank", "amogus_items:wooden_plank", "amogus_items:wooden_plank"},
{"amogus_items:wooden_plank", "amogus_items:wooden_plank", "amogus_items:wooden_plank"},
{"", "", ""},
{"", "amogus_blocks:wood", ""},
{"", "", ""},
}
})
minetest.register_craft({
output = "amogus_items:sussiumshovel",
recipe = {
{"", "amogus_blocks:sussium_block", ""},
{"", "amogus_blocks:planks", ""},
{"", "amogus_blocks:planks", ""},
}
})
minetest.register_craft({
output = "amogus_items:goldenshovel",
recipe = {
{"", "amogus_items:gold_ingot", ""},
{"", "amogus_blocks:planks", ""},
{"", "amogus_blocks:planks", ""},
}
})
minetest.register_craft({
output = "amogus_items:stoneshovel",
recipe = {
{"", "amogus_items:rock", ""},
{"", "amogus_blocks:planks", ""},
{"", "amogus_blocks:planks", ""},
}
})
minetest.register_craft({
output = "amogus_items:stoneaxe",
recipe = {
{"", "amogus_items:rock", "amogus_items:rock"},
{"", "amogus_blocks:planks", "amogus_items:rock"},
{"", "amogus_blocks:planks", ""},
}
})
minetest.register_craft({
output = "amogus_items:stoneaxe",
recipe = {
{"amogus_items:rock", "amogus_items:rock", ""},
{"amogus_items:rock", "amogus_blocks:planks", ""},
{"", "amogus_blocks:planks", ""},
}
})
minetest.register_craft({
output = "amogus_items:goldenaxe",
recipe = {
{"amogus_items:gold_ingot", "amogus_items:gold_ingot", ""},
{"amogus_items:gold_ingot", "amogus_blocks:planks", ""},
{"", "amogus_blocks:planks", ""},
}
})
minetest.register_craft({
output = "amogus_items:goldenaxe",
recipe = {
{"", "amogus_items:gold_ingot", "amogus_items:gold_ingot"},
{"", "amogus_blocks:planks", "amogus_items:gold_ingot"},
{"", "amogus_blocks:planks", ""},
}
})
minetest.register_craft({
output = "amogus_items:sussiumaxe",
recipe = {
{"", "amogus_blocks:sussium_block", "amogus_blocks:sussium_block"},
{"", "amogus_blocks:planks", "amogus_blocks:sussium_block"},
{"", "amogus_blocks:planks", ""},
}
})
minetest.register_craft({
output = "amogus_items:sussiumaxe",
recipe = {
{"amogus_blocks:sussium_block", "amogus_blocks:sussium_block", ""},
{"amogus_blocks:sussium_block", "amogus_blocks:planks", ""},
{"", "amogus_blocks:planks", ""},
}
})
minetest.register_craft({
output = "amogus_blocks:sussium_block",
recipe = {
{"amogus_items:sussium_ingot", "amogus_items:sussium_ingot", "amogus_items:sussium_ingot"},
{"amogus_items:sussium_ingot", "amogus_items:sussium_ingot", "amogus_items:sussium_ingot"},
{"amogus_items:sussium_ingot", "amogus_items:sussium_ingot", "amogus_items:sussium_ingot"},
}
})
minetest.register_craft({
output = "amogus_items:sussium_ingot 9",
recipe = {
{"amogus_blocks:sussium_block"},
}
})
minetest.register_craft({
output = "amogus_blocks:golden_block",
recipe = {
{"amogus_items:gold_ingot", "amogus_items:gold_ingot", "amogus_items:gold_ingot"},
{"amogus_items:gold_ingot", "amogus_items:gold_ingot", "amogus_items:gold_ingot"},
{"amogus_items:gold_ingot", "amogus_items:gold_ingot", "amogus_items:gold_ingot"},
}
})
minetest.register_craft({
output = "amogus_items:gold_ingot 9",
recipe = {
{"amogus_blocks:golden_block"},
}
})
minetest.register_craft({
output = "amogus_items:stonepickaxe",
recipe = {
{"amogus_items:rock", "amogus_items:rock", "amogus_items:rock"},
{"", "amogus_blocks:planks", ""},
{"", "amogus_blocks:planks", ""},
}
})
minetest.register_craft({
output = "amogus_items:goldenpickaxe",
recipe = {
{"amogus_items:gold_ingot", "amogus_items:gold_ingot", "amogus_items:gold_ingot"},
{"", "amogus_blocks:planks", ""},
{"", "amogus_blocks:planks", ""},
}
})
minetest.register_craft({
output = "amogus_items:sussiumpickaxe",
recipe = {
{"amogus_blocks:sussium_block", "amogus_blocks:sussium_block", "amogus_blocks:sussium_block"},
{"", "amogus_blocks:planks", ""},
{"", "amogus_blocks:planks", ""},
}
})
-- obsusian hammer crafting
minetest.register_craft({
output = "amogus_items:obsussian_hammer",
recipe = {
{"amogus_blocks:obsusian", "amogus_blocks:obsusian", "amogus_blocks:obsusian"},
{"amogus_blocks:obsusian", "amogus_blocks:obsusian", "amogus_blocks:obsusian"},
{"amogus_blocks:obsusian", "amogus_blocks:planks", "amogus_blocks:obsusian"},
}
})
minetest.register_craft({
output = "amogus_blocks:blue_bricks",
recipe = {
{"", "amogus_blocks:blueblock", ""},
{"", "amogus_blocks:grey_bricks", ""},
{"", "", ""},
}
})
minetest.register_craft({
output = "amogus_blocks:black_bricks",
recipe = {
{"", "amogus_blocks:blackblock", ""},
{"", "amogus_blocks:grey_bricks", ""},
{"", "", ""},
}
})
minetest.register_craft({
output = "amogus_blocks:yellow_bricks",
recipe = {
{"", "amogus_blocks:yellowblock", ""},
{"", "amogus_blocks:grey_bricks", ""},
{"", "", ""},
}
})
minetest.register_craft({
output = "amogus_blocks:green_bricks",
recipe = {
{"", "amogus_blocks:greenblock", ""},
{"", "amogus_blocks:grey_bricks", ""},
{"", "", ""},
}
})
minetest.register_craft({
output = "amogus_blocks:transparent",
recipe = {
{"", "amogus_items:lightsaber_blue", ""},
{"", "amogus_blocks:sand", ""},
{"", "", ""},
}
})
minetest.register_craft({
output = "amogus_blocks:transparent",
recipe = {
{"", "amogus_items:lightsaber_green", ""},
{"", "amogus_blocks:sand", ""},
{"", "", ""},
}
})
minetest.register_craft({
output = "amogus_blocks:transparent",
recipe = {
{"", "amogus_items:lightsaber_red", ""},
{"", "amogus_blocks:sand", ""},
{"", "", ""},
}
})
minetest.register_craft({
output = "amogus_items:dynamite",
recipe = {
{"amogus_items:capacitor", "amogus_items:capacitor", "amogus_items:capacitor"},
{"amogus_items:capacitor", "amogus_items:pcb", "amogus_items:capacitor"},
{"amogus_blocks:obsusian", "amogus_items:iron_ingot", "amogus_blocks:obsusian"},
}
})
minetest.register_craft({
output = "carts:cart",
recipe = {
{"amogus_items:iron_ingot", "", "amogus_items:iron_ingot"},
{"amogus_items:iron_ingot", "amogus_items:iron_ingot", "amogus_items:iron_ingot"},
{"", "amogus_items:iron_ingot", ""},
}
})
minetest.register_craft({
output = "carts:powerrail 16",
recipe = {
{"amogus_items:iron_ingot", "amogus_items:pcb", "amogus_items:iron_ingot"},
{"amogus_items:iron_ingot", "amogus_blocks:planks", "amogus_items:iron_ingot"},
{"amogus_items:iron_ingot", "amogus_blocks:planks", "amogus_items:iron_ingot"},
}
})
minetest.register_craft({
output = "carts:rail 16",
recipe = {
{"amogus_items:iron_ingot", "amogus_blocks:planks", "amogus_items:iron_ingot"},
{"amogus_items:iron_ingot", "amogus_blocks:planks", "amogus_items:iron_ingot"},
{"amogus_items:iron_ingot", "amogus_blocks:planks", "amogus_items:iron_ingot"},
}
})
minetest.register_craft({
output = "amogus_items:empty_bucket",
recipe = {
{"amogus_items:iron_ingot", "", "amogus_items:iron_ingot"},
{"", "amogus_items:iron_ingot", ""},
{"", "", ""},
}
})
minetest.register_craft({
output = "amogus_blocks:purple_bricks",
recipe = {
{"", "amogus_blocks:purpleblock", ""},
{"", "amogus_blocks:grey_bricks", ""},
{"", "", ""},
}
})
minetest.register_craft({
output = "amogus_items:obsusian_sword",
recipe = {
{"amogus_blocks:obsusian"},
{"amogus_blocks:obsusian"},
{"amogus_blocks:planks"},
}
})
minetest.register_craft({
output = "amogus_items:obsusian_shovel",
recipe = {
{"amogus_blocks:obsusian"},
{"amogus_blocks:planks"},
{"amogus_blocks:planks"},
}
})
-- create recipe for pooper out of PCB and mogus and dirt
minetest.register_craft({
output = "amogus_items:pooper",
recipe = {
{"amogus_items:pcb", "amogus_items:mogus", "amogus_items:pcb"},
{"amogus_items:pcb", "amogus_blocks:dirt", "amogus_items:pcb"},
{"amogus_items:pcb", "amogus_items:pcb", "amogus_items:pcb"},
}
})

View File

@@ -0,0 +1 @@
name = amogus_craftings

View File

@@ -1,5 +1,9 @@
-- create a random number from 0 to 3
local textures_b = {
"amogus_entity.png",
"amogus_entity_b.png",
"amogus_entity_g.png",
"amogus_entity_br.png"
}
local entity = {
physical = true,
@@ -9,17 +13,21 @@ local entity = {
visual_size = {x=10, y=10, z=10},
mesh = "amogus_entity.obj",
textures = {"amogus_entity.png",},
on_rightclick = function(self, clicker)
minetest.chat_send_player(clicker:get_player_name(), "WHY ARE YOU SUCH SUSSY BAKA?")
-- give player mogus item
local inv = clicker:get_inventory()
inv:add_item("main", "amogus_items:mogus")
-- remove entity
self.object:remove()
end,
-- physics config -- <--- HERE IS PART FOR YOU "USER" (NERD)
gravity = 9.81, -- m/s^2
walk_acceletation_speed = 0.2, -- self explainatory
rotation_acceletation_speed = 3, -- self explainatory
walk_acceleration_speed = 0.2, -- self explainatory
rotation_acceleration_speed = 3, -- self explainatory
min_jump_force = 15, -- self explainatory
max_jump_force = 25, -- self explainatory
@@ -35,30 +43,36 @@ local entity = {
rotation_direction = nil,
last_y_velocity = 0,
on_activate = function(self, staticdata)
local texture = textures_b[math.random(#textures_b)]
self.object:set_properties({textures = {texture}})
self.object:set_yaw(math.random() * 2 * math.pi)
self.rotation_direction = math.random(-1, 1)
self.min_max_jump_force_diff = self.max_jump_force - self.min_jump_force
-- kill itself (debugging)
--self.object:remove()
end,
on_step = function(self, dtime)
-- play amogus sound randomly
if math.random(300) == 1 then
minetest.sound_play("amogus_sound", {
pos = self.object:get_pos(),
gain = 1.0,
max_hear_distance = 5
})
if math.random(400) == 1 then
--minetest.sound_play("amogus_sound", {
-- pos = self.object:get_pos(),
-- gain = 1.0,
-- max_hear_distance = 50
--})
amogus_general.play_random_sound(
"amogus_sound",
self.object:get_pos(),
1.0, -- gain
40, -- max_hear_distance
1.0 -- pitch
)
end
-- random changing between walking and standing still
if math.random(200) == 1 then
self.is_going_forward = not self.is_going_forward
@@ -73,8 +87,8 @@ local entity = {
if self.is_going_forward then
--local pos = self.object:get_pos()
local vel = self.object:get_velocity()
vel.x = vel.x + dir_cos * self.walk_acceletation_speed
vel.z = vel.z + dir_sin * self.walk_acceletation_speed
vel.x = vel.x + dir_cos * self.walk_acceleration_speed
vel.z = vel.z + dir_sin * self.walk_acceleration_speed
self.object:set_velocity(vel)
end
@@ -91,11 +105,10 @@ local entity = {
else
self.rotation_direction = 0
end
end
-- update rotation_velocity
self.rotation_velocity = self.rotation_velocity + self.rotation_direction * self.rotation_acceletation_speed * dtime
self.rotation_velocity = self.rotation_velocity + self.rotation_direction * self.rotation_acceleration_speed * dtime
-- update rotation
self.object:set_yaw(self.object:get_yaw() + self.rotation_velocity * dtime)
@@ -111,15 +124,21 @@ local entity = {
pos.z = pos.z + dir_sin
local bnode = minetest.get_node(pos)
if bnode.name ~= "air" then
--if bnode.name == "air" or bnode.name == "amogus_blocks:water_source" or bnode.name == "amogus_blocks:water_flowing" then
-- if node is not solid OR is a liquid
if minetest.registered_nodes[bnode.name].walkable == false or minetest.registered_nodes[bnode.name].liquidtype ~= "none" then
self.block_lastly_in_front = false
-- if node next to the entity is a solid block
else
if self.block_lastly_in_front == false then
self.block_lastly_in_front = true
local vel = self.object:get_velocity()
vel.y = vel.y + (math.random() * self.min_max_jump_force_diff + self.min_jump_force)
self.object:set_velocity(vel)
-- randomly jump in the next iteration even if theres still a block in front
elseif math.random(10) == 1 then
self.block_lastly_in_front = false
end
else
self.block_lastly_in_front = false
end
@@ -143,4 +162,5 @@ local entity = {
self.last_y_velocity = vel.y
end
}
minetest.register_entity("amogus_entities:amogus", entity)

View File

@@ -0,0 +1,316 @@
local textures_b = {
"amogus_entity.png",
"amogus_entity_b.png",
"amogus_entity_g.png",
"amogus_entity_br.png"
}
local entity = {
physical = true,
collisionbox = {-0.25, 0, -0.25, 0.25, 0.5, 0.25},
visual = "mesh",
visual_size = {x=5, y=5, z=5},
mesh = "amogus_entity.obj",
on_rightclick = function(self, clicker)
minetest.chat_send_player(clicker:get_player_name(), "SO SUSSY!")
--minetest.sound_play("amogus_sound", {
-- pos = self.object:get_pos(),
-- gain = 1.0,
-- max_hear_distance = 5,
-- pitch = 2
--})
amogus_general.play_random_sound(
"amogus_sound",
self.object:get_pos(),
1.0, -- gain
40, -- max_hear_distance
2 -- pitch
)
end,
-- mini crewmate config --
walk_acceleration_speed = 0.05, -- acceleration speed when no panic, no stress
run_acceleration_speed = 0.2, -- acceleration speed when chasing player
run_away_acceleration_speed = 0.4, -- acceleration speed when running away from player
rotation_acceleration_speed = 0.5, -- self explainatory
gravity = 9.81, -- m/s^2
jump_force = 10, -- self explainatory
friction = 0.8, -- friction (0.0 - no friction like perfectly smooth ice | 1.0 - full friction and can't even move)
rotation_friction = 0.9, -- the same but for rotation
largest_distance_to_find_player = 8, -- largest distance to find player
smallest_distance_to_lost_player = 12, -- smallest distance to lost player
largest_distance_to_stand_still = 3, -- largest distance to stand still next to the player
smallest_distance_to_stop_run_away = 30, -- smallest distance to stop run away from player
--------------------------
block_lastly_in_front = false,
rotation_velocity = 0,
rotation_direction = nil,
sound_pitch = nil,
sound_propability = nil,
-- player detection variables
player = nil,
player_pos = nil,
entity_pos = nil,
entity_player_vector = nil,
distance = nil,
current_distance = nil,
current_entity_player_vector = nil,
mode = 0, -- | 0 - stand still | 1 - walk | 2 - chase | 3 - run away | 4 - rest mode |
on_activate = function(self, staticdata)
local texture = textures_b[math.random(#textures_b)]
self.object:set_properties({textures = {texture}})
self.object:set_yaw(math.random() * 2 * math.pi)
self.rotation_direction = math.random(-1, 1)
end,
on_punch = function(self, puncher, time_from_last_punch, tool_capabilities, dir)
self.mode = 3
end,
on_step = function(self, dtime)
-- play amogus sound randomly with different pitch depending on situation
if self.mode == 0 or self.mode == 1 then -- stand still or walk
sound_pitch = 1.8
sound_propability = 100
elseif self.mode == 2 then -- chase
sound_pitch = 2.5
sound_propability = 50
elseif self.mode == 3 then -- run away
sound_pitch = 3
sound_propability = 10
else -- rest mode (4)
sound_pitch = 2
sound_propability = 300
end
if math.random(sound_propability) == 1 then
--minetest.sound_play("amogus_sound", {
-- pos = self.object:get_pos(),
-- gain = 1.0,
-- max_hear_distance = 50,
-- pitch = sound_pitch
--})
amogus_general.play_random_sound(
"amogus_sound",
self.object:get_pos(),
1.0, -- gain
40, -- max_hear_distance
sound_pitch -- pitch
)
end
-- if on singpleplayer mode or only one player is connected, calculate distance between player and mini crewmate
if minetest.is_singleplayer() or #minetest.get_connected_players() == 1 then
-- get first player
self.player = minetest.get_connected_players()[1]
self.player_pos = self.player:get_pos()
self.entity_pos = self.object:get_pos()
self.entity_player_vector = vector.subtract(self.player_pos, self.entity_pos)
self.distance = vector.length(self.entity_player_vector)
-- if on multiplayer mode, calculate distance between nearest player and mini crewmate
else
self.player = minetest.get_connected_players()
self.distance = nil
self.entity_player_vector = nil
self.entity_pos = self.object:get_pos()
-- iterate over all players
for i = 1, #self.player do
self.player_pos = self.player[i]:get_pos()
--self.entity_player_vector = vector.subtract(self.player_pos, self.entity_pos)
self.current_entity_player_vector = vector.subtract(self.player_pos, self.entity_pos)
self.current_distance = vector.length(self.current_entity_player_vector)
-- if distance is nil or current_distance is smaller than distance, set distance to current_distance
if self.distance == nil or self.current_distance < self.distance then
self.distance = self.current_distance
self.entity_player_vector = self.current_entity_player_vector
end
end
end
-- if mode is 0 or 1 (stand still or walk) and distance is smaller or equal to largest_distance_to_find_player, set mode to 2 (chase)
if (self.mode == 0 or self.mode == 1) and self.distance <= self.largest_distance_to_find_player then
self.mode = 2
-- elseif mode is 2 (chase)
elseif self.mode == 2 then
-- if distance is greater or equal to smallest_distance_to_lost_player, set mode to 0 (stand still)
if self.distance >= self.smallest_distance_to_lost_player then
self.mode = 0
-- elif distance is smaller or equal to largest_distance_to_stand_still, set mode to 4 (rest mode)
elseif self.distance <= self.largest_distance_to_stand_still then
self.mode = 4
end
-- if mode is 4 (rest mode) and distance is greater than largest_distance_to_stand_still, set mode to 2 (chase)
elseif self.mode == 4 and self.distance > self.largest_distance_to_stand_still then
self.mode = 2
-- running away mode
elseif self.mode == 3 then
-- if distance is greater than smallest_distance_to_lost_player, set mode to 0 (stand still)
if self.distance > self.smallest_distance_to_stop_run_away then
self.mode = 1
else
-- jump if on ground
local pos = self.object:get_pos()
pos.y = pos.y - 0.2
local bnode = minetest.get_node(pos)
if bnode.name ~= "air" then
local vel = self.object:get_velocity()
vel.y = vel.y + self.jump_force
self.object:set_velocity(vel)
end
end
end
-- if if not performing an action related to the player
if (self.mode == 0 or self.mode == 1) then
-- make mini crewmate sometimes stand still and sometimes walk
if math.random(100) == 1 then
if self.mode == 0 then
self.mode = 1
else
self.mode = 0
end
end
-- some chance of chaning rotation_direction to random value
if math.random(10) == 1 then
--self.rotation_direction = math.random(-1, 1)
local rand = math.random()
if rand < 0.2 then
self.rotation_direction = 1
elseif rand < 0.4 then
self.rotation_direction = -1
else
self.rotation_direction = 0
end
end
-- update rotation_velocity
self.rotation_velocity = self.rotation_velocity + self.rotation_direction * self.rotation_acceleration_speed * dtime
-- update rotation
self.object:set_yaw(self.object:get_yaw() + self.rotation_velocity * dtime)
-- apply rotation_friction
self.rotation_velocity = self.rotation_velocity * (1 - self.rotation_friction * dtime)
else -- else performing an action related to the player
self.rotation_velocity = 0;
-- if mode is 3 (run away) set rotation so mini crewmate is facing either at the player or away from the player depending on situation
if self.mode == 3 then
-- look away from the player
self.object:set_yaw(math.atan2(-self.entity_player_vector.z, -self.entity_player_vector.x))
else
-- look at the player
self.object:set_yaw(math.atan2(self.entity_player_vector.z, self.entity_player_vector.x))
end
end
-- perform calculations on direction
local dir = self.object:get_yaw()
local dir_cos = math.cos(dir)
local dir_sin = math.sin(dir)
-- if not standing still and not in rest mode
if self.mode ~= 0 and self.mode ~= 4 then
-- make mini crewmate walk or run
local vel = self.object:get_velocity()
-- if walking
if self.mode == 1 then
vel.x = vel.x + dir_cos * self.walk_acceleration_speed
vel.z = vel.z + dir_sin * self.walk_acceleration_speed
-- elif chasing
elseif self.mode == 2 then
vel.x = vel.x + dir_cos * self.run_acceleration_speed
vel.z = vel.z + dir_sin * self.run_acceleration_speed
else -- else running away (3)
vel.x = vel.x + dir_cos * self.run_away_acceleration_speed
vel.z = vel.z + dir_sin * self.run_away_acceleration_speed
end
self.object:set_velocity(vel)
end
-- Make it also jump when some block is in front of it
local pos = self.object:get_pos()
pos.x = pos.x + dir_cos
pos.z = pos.z + dir_sin
local bnode = minetest.get_node(pos)
--if bnode.name == "air" or bnode.name == "amogus_blocks:water_source" or bnode.name == "amogus_blocks:water_flowing" then
-- if node is not solid OR is a liquid
if minetest.registered_nodes[bnode.name].walkable == false or minetest.registered_nodes[bnode.name].liquidtype ~= "none" then
self.block_lastly_in_front = false
-- if node next to the entity is a solid block
else
if self.block_lastly_in_front == false then
self.block_lastly_in_front = true
local vel = self.object:get_velocity()
vel.y = vel.y + self.jump_force
self.object:set_velocity(vel)
-- randomly jump in the next iteration even if theres still a block in front
elseif math.random(10) == 1 then
self.block_lastly_in_front = false
end
end
local vel = self.object:get_velocity()
-- change velocity by gravity
vel.y = vel.y - self.gravity * dtime * 2
-- change velocity by friction
vel.x = vel.x * (1 - self.friction * dtime)
vel.z = vel.z * (1 - self.friction * dtime)
self.object:set_velocity(vel)
end
}
minetest.register_entity("amogus_entities:mini_crewmate", entity)

View File

@@ -0,0 +1,303 @@
--local textures_b = {
-- "amogus_entity.png",
-- "amogus_entity_b.png",
-- "amogus_entity_g.png",
-- "amogus_entity_br.png"
--}
local entity = {
physical = true,
collisionbox = {-0.75, 0, -0.75, 0.75, 1.5, 0.75},
visual = "mesh",
visual_size = {x=15, y=15, z=15},
mesh = "sussy_imposter_entity.obj",
textures = {"sussy_imposter_entity.png"},
on_rightclick = function(self, clicker)
minetest.chat_send_player(clicker:get_player_name(), "YOU MET THE MOST SUS THING IN THE WORLD!")
amogus_general.play_random_sound(
"sus_sound",
self.object:get_pos(),
1.0, -- gain
40, -- max_hear_distance
1.0 -- pitch
)
end,
-- impostor config --
walk_acceleration_speed = 0.08, -- acceleration speed when no panic, no stress
run_acceleration_speed = 0.15, -- acceleration speed when chasing player
rotation_acceleration_speed = 0.5, -- self explainatory
gravity = 9.81, -- m/s^2
jump_force = 8, -- self explainatory
friction = 0.6, -- friction (0.0 - no friction like perfectly smooth ice | 1.0 - full friction and can't even move)
rotation_friction = 0.8, -- the same but for rotation
largest_distance_to_find_player = 12, -- largest distance to find player
smallest_distance_to_lost_player = 16, -- smallest distance to lost player
largest_distance_to_hurt_player = 1.5, -- largest distance to hurt player
--------------------------
block_lastly_in_front = false,
rotation_velocity = 0,
rotation_direction = nil,
sound_pitch = nil,
sound_propability = nil,
-- player detection variables
player = nil,
player_pos = nil,
entity_pos = nil,
entity_player_vector = nil,
distance = nil,
current_distance = nil,
current_entity_player_vector = nil,
nearest_player_index = nil,
mode = 0, -- | 0 - stand still | 1 - walk | 2 - chase
on_activate = function(self, staticdata)
self.object:set_yaw(math.random() * 2 * math.pi)
self.rotation_direction = math.random(-1, 1)
end,
on_punch = function(self, puncher, time_from_last_punch, tool_capabilities, dir)
amogus_general.play_random_sound(
"sus_sound",
self.object:get_pos(),
1.0, -- gain
40, -- max_hear_distance
1.5 -- pitch
)
end,
on_step = function(self, dtime)
-- play sus sound randomly with different pitch depending on situation
if self.mode == 0 or self.mode == 1 then -- stand still or walk
self.sound_pitch = 0.8
self.sound_propability = 100
else -- chase (2)
self.sound_pitch = 1.2
self.sound_propability = 50
end
if math.random(self.sound_propability) == 1 then
amogus_general.play_random_sound(
"sus_sound",
self.object:get_pos(),
1.0, -- gain
40, -- max_hear_distance
self.sound_pitch -- pitch
)
end
-- if on singpleplayer mode or only one player is connected, calculate distance between player and mini crewmate
if minetest.is_singleplayer() or #minetest.get_connected_players() == 1 then
-- get first player
self.player = minetest.get_connected_players()[1]
self.player_pos = self.player:get_pos()
self.entity_pos = self.object:get_pos()
self.entity_player_vector = vector.subtract(self.player_pos, self.entity_pos)
self.distance = vector.length(self.entity_player_vector)
-- if on multiplayer mode, calculate distance between nearest player and mini crewmate
else
self.player = minetest.get_connected_players()
self.distance = nil
self.entity_player_vector = nil
self.nearest_player_index = nil
self.entity_pos = self.object:get_pos()
-- iterate over all players
for i = 1, #self.player do
self.player_pos = self.player[i]:get_pos()
--self.entity_player_vector = vector.subtract(self.player_pos, self.entity_pos)
self.current_entity_player_vector = vector.subtract(self.player_pos, self.entity_pos)
self.current_distance = vector.length(self.current_entity_player_vector)
-- if distance is nil or current_distance is smaller than distance, set distance to current_distance
if self.distance == nil or self.current_distance < self.distance then
self.distance = self.current_distance
self.entity_player_vector = self.current_entity_player_vector
self.nearest_player_index = i
end
end
-- get nearest player
self.player = self.player[self.nearest_player_index]
end
-- if mode is 0 or 1 (stand still or walk) and distance is smaller or equal to largest_distance_to_find_player, set mode to 2 (chase)
if (self.mode == 0 or self.mode == 1) and self.distance <= self.largest_distance_to_find_player then
self.mode = 2
-- elseif mode is 2 (chase)
elseif self.mode == 2 then
-- if distance is greater or equal to smallest_distance_to_lost_player, set mode to 0 (stand still)
if self.distance >= self.smallest_distance_to_lost_player then
self.mode = 0
-- else if distance is smaller or equal to largest_distance_to_hurt_player, hurt player
elseif self.distance <= self.largest_distance_to_hurt_player then
if math.random(10) == 1 then
self.player:punch(self.object, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 5},
}, nil)
end
end
end
-- if if not performing an action related to the player
if self.mode ~= 2 then
-- make mini crewmate sometimes stand still and sometimes walk
if math.random(100) == 1 then
if self.mode == 0 then
self.mode = 1
else
self.mode = 0
end
end
-- some chance of chaning rotation_direction to random value
if math.random(10) == 1 then
--self.rotation_direction = math.random(-1, 1)
local rand = math.random()
if rand < 0.2 then
self.rotation_direction = 1
elseif rand < 0.4 then
self.rotation_direction = -1
else
self.rotation_direction = 0
end
end
-- update rotation_velocity
self.rotation_velocity = self.rotation_velocity + self.rotation_direction * self.rotation_acceleration_speed * dtime
-- update rotation
self.object:set_yaw(self.object:get_yaw() + self.rotation_velocity * dtime)
-- apply rotation_friction
self.rotation_velocity = self.rotation_velocity * (1 - self.rotation_friction * dtime)
else -- else performing an action related to the player
self.rotation_velocity = 0;
-- set rotation so entity is facing at the player
self.object:set_yaw(math.atan2(self.entity_player_vector.z, self.entity_player_vector.x))
end
-- perform calculations on direction
local dir = self.object:get_yaw()
local dir_cos = math.cos(dir)
local dir_sin = math.sin(dir)
-- if not standing still
if self.mode ~= 0 then
-- make mini crewmate walk or run
local vel = self.object:get_velocity()
-- if walking
if self.mode == 1 then
vel.x = vel.x + dir_cos * self.walk_acceleration_speed
vel.z = vel.z + dir_sin * self.walk_acceleration_speed
else -- chasing (2)
vel.x = vel.x + dir_cos * self.run_acceleration_speed
vel.z = vel.z + dir_sin * self.run_acceleration_speed
end
self.object:set_velocity(vel)
end
-- Make it also jump when some block is in front of it
local pos = self.object:get_pos()
pos.x = pos.x + dir_cos
pos.z = pos.z + dir_sin
local bnode = minetest.get_node(pos)
--if bnode.name == "air" or bnode.name == "amogus_blocks:water_source" or bnode.name == "amogus_blocks:water_flowing" then
-- if node is not solid OR is a liquid
if minetest.registered_nodes[bnode.name].walkable == false or minetest.registered_nodes[bnode.name].liquidtype ~= "none" then
self.block_lastly_in_front = false
-- if node next to the entity is a solid block
else
if self.block_lastly_in_front == false then
self.block_lastly_in_front = true
local vel = self.object:get_velocity()
vel.y = vel.y + self.jump_force
self.object:set_velocity(vel)
-- randomly jump in the next iteration even if theres still a block in front
elseif math.random(10) == 1 then
self.block_lastly_in_front = false
end
end
local vel = self.object:get_velocity()
-- change velocity by gravity
vel.y = vel.y - self.gravity * dtime * 2
-- change velocity by friction
vel.x = vel.x * (1 - self.friction * dtime)
vel.z = vel.z * (1 - self.friction * dtime)
self.object:set_velocity(vel)
end
}
minetest.register_entity("amogus_entities:sussy_imposter", entity)
-- register spawn egg
minetest.register_craftitem("amogus_entities:sussy_imposter_spawn_egg", {
description = "Sussy Imposter Spawn Egg",
inventory_image = "imposta_egg.png",
on_place = function(itemstack, placer, pointed_thing)
if pointed_thing.type ~= "node" then
return
end
local pos = pointed_thing.above
local node = minetest.get_node(pos)
local def = minetest.registered_nodes[node.name]
if not def or not def.buildable_to then
return
end
minetest.add_entity(pos, "amogus_entities:sussy_imposter")
itemstack:take_item()
return itemstack
end,
})

View File

@@ -1,2 +1,4 @@
-- Load the entity's lua file
dofile(minetest.get_modpath("amogus_entities") .. "/entities/amogus_entity.lua")
dofile(minetest.get_modpath("amogus_entities") .. "/entities/mini_crewmate_entity.lua")
dofile(minetest.get_modpath("amogus_entities") .. "/entities/sussy_imposter_entity.lua")

View File

@@ -0,0 +1 @@
name = amogus_entities

View File

@@ -0,0 +1,288 @@
# Blender 3.4.0
# www.blender.org
o body
v -0.250000 1.312500 -0.250000
v -0.375000 1.312500 -0.250000
v -0.250000 1.000000 -0.250000
v -0.375000 1.000000 -0.250000
v -0.375000 1.312500 0.250000
v -0.250000 1.312500 0.250000
v -0.375000 1.000000 0.250000
v -0.250000 1.000000 0.250000
v 0.437500 1.125000 -0.312500
v 0.250000 1.125000 -0.312500
v 0.437500 0.375000 -0.312500
v 0.250000 0.375000 -0.312500
v 0.250000 1.125000 0.312500
v 0.437500 1.125000 0.312500
v 0.250000 0.375000 0.312500
v 0.437500 0.375000 0.312500
v 0.250000 1.437500 -0.375000
v -0.250000 1.437500 -0.375000
v 0.250000 0.312500 -0.375000
v -0.250000 0.312500 -0.375000
v -0.250000 1.437500 0.375000
v 0.250000 1.437500 0.375000
v -0.250000 0.312500 0.375000
v 0.250000 0.312500 0.375000
vn -1.0000 -0.0000 -0.0000
vn -0.0000 -0.0000 -1.0000
vn 1.0000 -0.0000 -0.0000
vn -0.0000 -0.0000 1.0000
vn -0.0000 1.0000 -0.0000
vn -0.0000 -1.0000 -0.0000
vt 0.000000 1.000000
vt 0.968971 0.969702
vt 0.000000 1.000000
vt 0.125000 1.000000
vt 0.000000 0.875000
vt 0.000000 0.687500
vt 0.500000 1.000000
vt 0.968971 0.969702
vt 0.000000 0.687500
vt 0.125000 0.687500
vt 0.500000 0.875000
vt 0.500000 1.000000
vt 0.125000 0.687500
vt 0.500000 0.875000
vt -0.000000 0.687500
vt 0.500000 1.000000
vt 0.968971 0.969702
vt 0.500000 0.687500
vt 0.125000 1.000000
vt 0.000000 0.875000
vt 0.000000 1.000000
vt 0.968971 0.969702
vt 0.968971 0.969702
vt 0.968971 0.969702
vt 0.968971 0.969702
vt 0.968971 0.969702
vt 0.968971 0.969702
vt 0.968971 0.969702
vt 0.968971 0.969702
vt 0.968971 0.969702
vt 0.968971 0.969702
vt 0.968971 0.969702
vt 0.968971 0.969702
vt 0.968971 0.969702
vt 0.968971 0.969702
vt 0.968971 0.969702
vt 0.968971 0.969702
vt 0.968971 0.969702
s 0
f 4/9/1 7/18/1 5/12/1 2/3/1
f 3/6/2 4/10/2 2/4/2 1/1/2
f 12/26/3 19/33/3 17/31/3 10/24/3
f 7/19/4 8/21/4 6/15/4 5/13/4
f 6/16/5 1/1/5 2/5/5 5/14/5
f 7/20/6 4/11/6 3/7/6 8/21/6
f 13/27/3 10/24/3 17/31/3 22/36/3
f 11/25/2 12/26/2 10/24/2 9/23/2
f 16/30/3 11/25/3 9/23/3 14/28/3
f 15/29/4 16/30/4 14/28/4 13/27/4
f 14/28/5 9/23/5 10/24/5 13/27/5
f 15/29/6 12/26/6 11/25/6 16/30/6
f 15/29/3 13/27/3 22/36/3 24/38/3
f 19/33/2 20/34/2 18/32/2 17/31/2
f 23/37/4 24/38/4 22/36/4 21/35/4
f 22/36/5 17/31/5 18/32/5 21/35/5
f 23/37/6 20/34/6 19/33/6 24/38/6
f 15/29/3 24/38/3 19/33/3 12/26/3
f 6/17/1 21/35/1 18/32/1 1/2/1
f 8/22/1 23/37/1 21/35/1 6/17/1
f 3/8/1 1/2/1 18/32/1 20/34/1
f 8/22/1 3/8/1 20/34/1 23/37/1
o left_leg
v 0.187500 0.437500 0.062500
v -0.187500 0.437500 0.062500
v 0.187500 -0.000000 0.062500
v -0.187500 -0.000000 0.062500
v -0.187500 0.437500 0.312500
v 0.187500 0.437500 0.312500
v -0.187500 -0.000000 0.312500
v 0.187500 -0.000000 0.312500
vn -1.0000 -0.0000 -0.0000
vn -0.0000 -0.0000 -1.0000
vn 1.0000 -0.0000 -0.0000
vn -0.0000 -0.0000 1.0000
vn -0.0000 1.0000 -0.0000
vn -0.0000 -1.0000 -0.0000
vt 0.968971 0.969702
vt 0.968971 0.969702
vt 0.968971 0.969702
vt 0.968971 0.969702
vt 0.968971 0.969702
vt 0.968971 0.969702
vt 0.968971 0.969702
vt 0.968971 0.969702
s 0
f 28/42/7 31/45/7 29/43/7 26/40/7
f 27/41/8 28/42/8 26/40/8 25/39/8
f 32/46/9 27/41/9 25/39/9 30/44/9
f 31/45/10 32/46/10 30/44/10 29/43/10
f 30/44/11 25/39/11 26/40/11 29/43/11
f 31/45/12 28/42/12 27/41/12 32/46/12
o right_leg
v 0.187500 0.437500 -0.312500
v -0.187500 0.437500 -0.312500
v 0.187500 0.000000 -0.312500
v -0.187500 0.000000 -0.312500
v -0.187500 0.437500 -0.062500
v 0.187500 0.437500 -0.062500
v -0.187500 0.000000 -0.062500
v 0.187500 0.000000 -0.062500
vn -1.0000 -0.0000 -0.0000
vn -0.0000 -0.0000 -1.0000
vn 1.0000 -0.0000 -0.0000
vn -0.0000 -0.0000 1.0000
vn -0.0000 1.0000 -0.0000
vn -0.0000 -1.0000 -0.0000
vt 0.968971 0.969702
vt 0.968971 0.969702
vt 0.968971 0.969702
vt 0.968971 0.969702
vt 0.968971 0.969702
vt 0.968971 0.969702
vt 0.968971 0.969702
vt 0.968971 0.969702
s 0
f 36/50/13 39/53/13 37/51/13 34/48/13
f 35/49/14 36/50/14 34/48/14 33/47/14
f 40/54/15 35/49/15 33/47/15 38/52/15
f 39/53/16 40/54/16 38/52/16 37/51/16
f 38/52/17 33/47/17 34/48/17 37/51/17
f 39/53/18 36/50/18 35/49/18 40/54/18
o knife
v -0.187500 0.750000 -0.531250
v -0.562500 0.750000 -0.531250
v -0.187500 0.625000 -0.531250
v -0.437500 0.625000 -0.531250
v -0.562500 0.750000 -0.468750
v -0.187500 0.750000 -0.468750
v -0.437500 0.625000 -0.468750
v -0.187500 0.625000 -0.468750
v 0.062500 0.734375 -0.531250
v -0.125000 0.734375 -0.531250
v 0.062500 0.640625 -0.531250
v -0.125000 0.640625 -0.531250
v -0.125000 0.734375 -0.468750
v 0.062500 0.734375 -0.468750
v -0.125000 0.640625 -0.468750
v 0.062500 0.640625 -0.468750
v -0.125000 0.812500 -0.562500
v -0.187500 0.812500 -0.562500
v -0.125000 0.562500 -0.562500
v -0.187500 0.562500 -0.562500
v -0.187500 0.812500 -0.437500
v -0.125000 0.812500 -0.437500
v -0.187500 0.562500 -0.437500
v -0.125000 0.562500 -0.437500
v -0.237500 0.625000 -0.531250
v -0.287500 0.640625 -0.531250
v -0.337500 0.625000 -0.531250
v -0.387500 0.640625 -0.531250
v -0.237500 0.750000 -0.531250
v -0.287500 0.750000 -0.531250
v -0.337500 0.750000 -0.531250
v -0.387500 0.750000 -0.531250
v -0.387500 0.750000 -0.468750
v -0.337500 0.750000 -0.468750
v -0.287500 0.750000 -0.468750
v -0.237500 0.750000 -0.468750
v -0.387500 0.640625 -0.468750
v -0.337500 0.625000 -0.468750
v -0.287500 0.640625 -0.468750
v -0.237500 0.625000 -0.468750
vn -0.7071 -0.7071 -0.0000
vn -0.0000 -0.0000 -1.0000
vn 1.0000 -0.0000 -0.0000
vn -0.0000 -0.0000 1.0000
vn -0.0000 1.0000 -0.0000
vn -0.0000 -1.0000 -0.0000
vn -1.0000 -0.0000 -0.0000
vn 0.2983 -0.9545 -0.0000
vn -0.2983 -0.9545 -0.0000
vt 0.593750 0.968750
vt 0.656250 0.968750
vt 0.656250 0.968750
vt 0.593750 0.968750
vt 0.656250 0.968750
vt 0.656250 0.968750
vt 0.656250 0.968750
vt 0.593750 0.968750
vt 0.656250 0.968750
vt 0.656250 0.968750
vt 0.656250 0.968750
vt 0.593750 0.968750
vt 0.593750 0.968750
vt 0.593750 0.968750
vt 0.593750 0.968750
vt 0.593750 0.968750
vt 0.593750 0.968750
vt 0.593750 0.968750
vt 0.593750 0.968750
vt 0.593750 0.968750
vt 0.593750 0.968750
vt 0.593750 0.968750
vt 0.593750 0.968750
vt 0.593750 0.968750
vt 0.593750 0.968750
vt 0.593750 0.968750
vt 0.593750 0.968750
vt 0.593750 0.968750
vt 0.656250 0.968750
vt 0.656250 0.968750
vt 0.656250 0.968750
vt 0.656250 0.968750
vt 0.656250 0.968750
vt 0.656250 0.968750
vt 0.656250 0.968750
vt 0.656250 0.968750
vt 0.656250 0.968750
vt 0.656250 0.968750
vt 0.656250 0.968750
vt 0.656250 0.968750
vt 0.656250 0.968750
vt 0.656250 0.968750
vt 0.656250 0.968750
vt 0.656250 0.968750
s 0
usemtl none
f 44/60/19 47/64/19 45/61/19 42/57/19
f 68/86/20 44/60/20 42/57/20 72/90/20
f 52/70/21 59/77/21 57/75/21 50/68/21
f 80/98/22 48/65/22 46/63/22 76/94/22
f 73/91/23 72/90/23 42/57/23 45/61/23
f 80/98/24 65/83/24 43/59/24 48/65/24
f 53/71/21 50/68/21 57/75/21 62/80/21
f 51/69/20 52/70/20 50/68/20 49/67/20
f 56/74/21 51/69/21 49/67/21 54/72/21
f 55/73/22 56/74/22 54/72/22 53/71/22
f 54/72/23 49/67/23 50/68/23 53/71/23
f 55/73/24 52/70/24 51/69/24 56/74/24
f 55/73/21 64/82/21 59/77/21 52/70/21
f 59/77/20 60/78/20 58/76/20 57/75/20
f 55/73/21 53/71/21 62/80/21 64/82/21
f 63/81/22 64/82/22 62/80/22 61/79/22
f 62/80/23 57/75/23 58/76/23 61/79/23
f 63/81/24 60/78/24 59/77/24 64/82/24
f 48/66/25 43/58/25 60/78/25 63/81/25
f 43/58/25 41/55/25 58/76/25 60/78/25
f 46/62/25 61/79/25 58/76/25 41/55/25
f 48/66/25 63/81/25 61/79/25 46/62/25
f 47/64/26 44/60/26 68/86/26 77/95/26
f 77/95/27 68/86/27 67/85/27 78/96/27
f 78/96/26 67/85/26 66/84/26 79/97/26
f 79/97/27 66/84/27 65/83/27 80/98/27
f 46/63/23 41/56/23 69/87/23 76/94/23
f 76/94/23 69/87/23 70/88/23 75/93/23
f 75/93/23 70/88/23 71/89/23 74/92/23
f 74/92/23 71/89/23 72/90/23 73/91/23
f 47/64/22 77/95/22 73/91/22 45/61/22
f 77/95/22 78/96/22 74/92/22 73/91/22
f 78/96/22 79/97/22 75/93/22 74/92/22
f 79/97/22 80/98/22 76/94/22 75/93/22
f 43/59/20 65/83/20 69/87/20 41/56/20
f 65/83/20 66/84/20 70/88/20 69/87/20
f 66/84/20 67/85/20 71/89/20 70/88/20
f 67/85/20 68/86/20 72/90/20 71/89/20

View File

Before

Width:  |  Height:  |  Size: 614 B

After

Width:  |  Height:  |  Size: 614 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@@ -1,4 +1,58 @@
minetest.register_on_joinplayer(function(player)
player:set_physics_override({speed = 2})
player:set_sky({r=0, g=0, b=0}, "plain", {})
player:set_physics_override({speed = 2})
--player:set_sky({r=0, g=0, b=0}, "plain", {})
-- set time to midday
minetest.set_timeofday(0.5)
-- play music in loop without position
if true then
minetest.sound_play("amogus_incomming", {
to_player = player:get_player_name(),
loop = true,
gain = 1
})
end
end)
-- idk what is this crap. it's doing nothing
--minetest.register_on_joinplayer(function(player)
--
--
-- player:set_lighting({
-- shadows = {intensity = 0.5}
-- })
--
--end)
amogus_general = { }
---- SOUNDS CONFIGURATION ----
sounds_config = {
-- format: {sound name, number of sounds to ramdomly choose from}
-- so for example if sound name is "test" and the number of sounds is 3, file names that will be randomly chosen are: "test1", "test2", "test3"
{"amogus_sound", 3},
{"sus_sound", 3}
}
-- randomized amogus sounds
function amogus_general.play_random_sound(sound_name, pos, gain, max_hear_distance, pitch)
-- get number of sounds from config
local number_of_sounds = nil
for i = 1, #sounds_config do
if sounds_config[i][1] == sound_name then
number_of_sounds = sounds_config[i][2]
break
end
end
assert(number_of_sounds ~= nil, "amogus_general.play_random_sound: sound with name '"..sound_name.."' is not found in sounds_config in mod amogus_general in init.lua")
minetest.sound_play(sound_name..math.random(number_of_sounds), {
pos = pos,
gain = gain,
max_hear_distance = max_hear_distance,
pitch = pitch
})
end

View File

@@ -0,0 +1 @@
name = amogus_general

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,42 +1,99 @@
minetest.register_alias("mapgen_stone", "amogus_blocks:stone")
minetest.register_alias("mapgen_dirt", "amogus_blocks:dirt")
minetest.register_alias("mapgen_dirt_with_grass", "amogus_blocks:grass")
minetest.register_alias("mapgen_water_source", "amogus_blocks:water")
minetest.register_alias("mapgen_water_source", "amogus_blocks:water_source")
minetest.register_alias("mapgen_river_water_source", "amogus_blocks:water_source")
-- I need to register alias of amogus_blocks:water that doesn't even exist in any of the mods to air because Minetest is f****d up and tries to use "water" by default
minetest.register_alias("amogus_blocks:water", "air")
minetest.register_biome({
name = "amogus_biome",
--node_dust = "amogus_blocks:stone",
node_top = "amogus_blocks:grass",
name = "amogus_beach",
node_top = "amogus_blocks:sand",
depth_top = 1,
node_filler = "amogus_blocks:dirt",
depth_filler = 1,
node_filler = "amogus_blocks:sand",
depth_filler = 3,
node_stone = "amogus_blocks:stone",
node_water_top = "amogus_blocks:water",
depth_water_top = 1,
node_water = "amogus_blocks:water",
node_river_water = "amogus_blocks:water",
y_max = 31000,
y_min = 1,
node_water = "amogus_blocks:water_source",
y_max = 6,
y_min = -5,
heat_point = 50,
humidity_point = 50,
})
minetest.register_biome({
name = "amogus_green_biome",
--node_dust = "amogus_blocks:stone",
node_top = "amogus_blocks:grass_green",
depth_top = 1,
node_filler = "amogus_blocks:dirt",
depth_filler = 1,
node_stone = "amogus_blocks:stone",
node_water_top = "amogus_blocks:water",
depth_water_top = 1,
node_water = "amogus_blocks:water",
node_river_water = "amogus_blocks:water",
node_water = "amogus_blocks:water_source",
y_max = 31000,
y_min = 1,
heat_point = 100,
humidity_point = 100,
})
minetest.register_biome({
name = "amogus_biome",
node_top = "amogus_blocks:grass",
depth_top = 1,
node_filler = "amogus_blocks:dirt",
depth_filler = 1,
node_stone = "amogus_blocks:stone",
node_water = "amogus_blocks:water_source",
y_max = 31000,
y_min = 1,
heat_point = 50,
humidity_point = 50,
})
minetest.register_biome({
name = "yellow_biome",
node_top = "amogus_blocks:grass_yellow",
depth_top = 1,
node_filler = "amogus_blocks:dirt",
depth_filler = 1,
node_stone = "amogus_blocks:stone",
node_water_top = "amogus_blocks:water_source",
node_water = "amogus_blocks:water_source",
node_river_water = "amogus_blocks:water_source",
y_max = 31000,
y_min = 1,
heat_point = 50,
humidity_point = 50,
})
minetest.register_decoration({
deco_type = "schematic",
place_on = {"amogus_blocks:grass_yellow"},
sidelen = 16,
fill_ratio = 0.01,
biomes = {"yellow_biome"},
y_max = 31000,
y_min = 1,
schematic = minetest.get_modpath("amogus_generator") .. "/schematics/lucky_tree_1.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
})
minetest.register_decoration({
deco_type = "schematic",
place_on = {"amogus_blocks:grass_yellow"},
sidelen = 16,
fill_ratio = 0.01,
biomes = {"yellow_biome"},
y_max = 31000,
y_min = 1,
schematic = minetest.get_modpath("amogus_generator") .. "/schematics/lucky_tree_2.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
})
minetest.register_ore({
ore_type = "scatter",
ore = "amogus_blocks:sussium_ore",
@@ -46,7 +103,9 @@ minetest.register_ore({
clust_size = 1,
y_max = 31000,
y_min = -31000,
})minetest.register_ore({
})
minetest.register_ore({
ore_type = "scatter",
ore = "amogus_blocks:gold_ore",
wherein = "amogus_blocks:stone",
@@ -57,6 +116,29 @@ minetest.register_ore({
y_min = -31000,
})
minetest.register_ore({
ore_type = "scatter",
ore = "amogus_blocks:obsusian",
wherein = "amogus_blocks:stone",
clust_scarcity = 8 * 8 * 8,
clust_num_ores = 1,
clust_size = 1,
y_max = 31000,
y_min = -31000,
})
minetest.register_ore({
ore_type = "scatter",
ore = "amogus_blocks:iron_ore",
wherein = "amogus_blocks:stone",
clust_scarcity = 8 * 8 * 8,
clust_num_ores = 1,
clust_size = 1,
y_max = 31000,
y_min = -31000,
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"amogus_blocks:grass"},
@@ -73,7 +155,85 @@ minetest.register_decoration({
y_max = 31000,
y_min = 1,
decoration = "amogus_blocks:lucky_block",
})minetest.register_decoration({
deco_type = "simple",
place_on = {"amogus_blocks:grass_green"},
sidelen = 16,
noise_params = {
offset = 0,
scale = 0.0001,
spread = {x = 100, y = 100, z = 100},
seed = 1234,
octaves = 3,
persist = 0.6
},
biomes = {"green_biome"},
y_max = 31000,
y_min = 1,
decoration = "amogus_blocks:lucky_block",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"amogus_blocks:grass_green"},
sidelen = 16,
fill_ratio = 0.01,
biomes = {"green_biome"},
y_max = 31000,
y_min = 1,
decoration = "amogus_blocks:amogflower",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"amogus_blocks:grass_green"},
sidelen = 16,
fill_ratio = 0.10,
biomes = {"green_biome"},
y_max = 31000,
y_min = 1,
decoration = "amogus_blocks:grass_tall",
})minetest.register_decoration({
deco_type = "simple",
place_on = {"amogus_blocks:grass"},
sidelen = 16,
fill_ratio = 0.10,
biomes = {"amogus_biome"},
y_max = 31000,
y_min = 1,
decoration = "amogus_blocks:purple_grass_tall",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"amogus_blocks:grass"},
sidelen = 16,
fill_ratio = 0.01,
biomes = {"amogus_biome"},
y_max = 31000,
y_min = 1,
decoration = "amogus_blocks:amogflower",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"amogus_blocks:grass_green"},
sidelen = 16,
fill_ratio = 0.01,
biomes = {"green_biome"},
y_max = 31000,
y_min = 1,
decoration = "amogus_blocks:redflower",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"amogus_blocks:grass_green"},
sidelen = 16,
fill_ratio = 0.01,
biomes = {"green_biome"},
y_max = 31000,
y_min = 1,
decoration = "amogus_blocks:yellowflower",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"amogus_blocks:grass"},
@@ -92,9 +252,6 @@ minetest.register_decoration({
decoration = "amogus_blocks:tv",
})
--- generate trees
minetest.register_decoration({
deco_type = "schematic",
place_on = {"amogus_blocks:grass"},
@@ -103,7 +260,43 @@ minetest.register_decoration({
biomes = {"amogus_biome"},
y_max = 31000,
y_min = 1,
schematic = "/schematics/tree.mts",
schematic = minetest.get_modpath("amogus_generator") .. "/schematics/tree.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
})
minetest.register_decoration({
deco_type = "schematic",
place_on = {"amogus_blocks:grass_green"},
sidelen = 16,
fill_ratio = 0.01,
biomes = {"green__biome"},
y_max = 31000,
y_min = 1,
schematic = minetest.get_modpath("amogus_generator") .. "/schematics/green_tree.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
})
minetest.register_decoration({
deco_type = "schematic",
place_on = {"amogus_blocks:grass_green"},
sidelen = 16,
fill_ratio = 0.01,
biomes = {"green__biome"},
y_max = 31000,
y_min = 1,
schematic = minetest.get_modpath("amogus_generator") .. "/schematics/green_tree_tall.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
})
minetest.register_decoration({
deco_type = "schematic",
place_on = {"amogus_blocks:grass","amogus_blocks:grass_green"},
sidelen = 16,
fill_ratio = 0.01,
biomes = {"amogus_biome","green_biome"},
y_max = 31000,
y_min = 1,
schematic = minetest.get_modpath("amogus_generator") .. "/schematics/fallen.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
})
@@ -115,19 +308,7 @@ minetest.register_decoration({
biomes = {"amogus_biome"},
y_max = 31000,
y_min = 1,
schematic = "/schematics/fallen.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
})
minetest.register_decoration({
deco_type = "schematic",
place_on = {"amogus_blocks:grass"},
sidelen = 16,
fill_ratio = 0.01,
biomes = {"amogus_biome"},
y_max = 31000,
y_min = 1,
schematic = "/schematics/treer.mts",
schematic = minetest.get_modpath("amogus_generator") .. "/schematics/treer.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
})minetest.register_decoration({
@@ -145,42 +326,277 @@ minetest.register_decoration({
biomes = {"amogus_biome"},
y_max = 31000,
y_min = 1,
schematic = "/schematics/minihouse.mts",
schematic = minetest.get_modpath("amogus_generator") .. "/schematics/minihouse.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
})
--minetest.register_abm({
-- label = "Spawn random entities",
-- nodenames = {"group:soil", "group:crumbly", "group:choppy", "group:snappy", "group:cracky"},
-- interval = 15,
-- chance = 50,
-- action = function(pos)
-- local r = math.random(1, 500)
-- if r <= 50 then
-- minetest.add_entity({x = pos.x + math.random(-10, 10),
-- y = pos.y + 1,
-- z = pos.z + math.random(-10, 10)}, "amogus_entities:amogus")
-- minetest.sound_play("amogus_sound", {
-- pos = pos,
-- gain = 1.0,
-- max_hear_distance = 5
-- })
-- end
-- end
--})
minetest.register_decoration({
deco_type = "schematic",
place_on = {"amogus_blocks:grass"},
sidelen = 16,
noise_params = {
offset = 0,
scale = 0.0001,
spread = {x = 100, y = 100, z = 100},
seed = 4321,
octaves = 3,
persist = 0.6
},
biomes = {"amogus_biome"},
y_max = 31000,
y_min = 1,
schematic = minetest.get_modpath("amogus_generator") .. "/schematics/amogus_statue.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
})
minetest.register_decoration({
deco_type = "schematic",
place_on = {"amogus_blocks:grass"},
sidelen = 16,
noise_params = {
offset = 0,
scale = 0.0001,
spread = {x = 100, y = 100, z = 100},
seed = 1234,
octaves = 3,
persist = 0.6
},
biomes = {"amogus_biome"},
y_max = 31000,
y_min = 1,
schematic = minetest.get_modpath("amogus_generator") .. "/schematics/lucky_tree_2.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
})
minetest.register_decoration({
deco_type = "schematic",
place_on = {"amogus_blocks:grass"},
sidelen = 16,
noise_params = {
offset = 0,
scale = 0.0001,
spread = {x = 100, y = 100, z = 100},
seed = 1234,
octaves = 3,
persist = 0.6
},
biomes = {"amogus_biome"},
y_max = 31000,
y_min = 1,
schematic = minetest.get_modpath("amogus_generator") .. "/schematics/lucky_tree_1.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
})
minetest.register_decoration({
deco_type = "schematic",
place_on = {"amogus_blocks:grass_green"},
sidelen = 16,
noise_params = {
offset = 0,
scale = 0.0001,
spread = {x = 100, y = 100, z = 100},
seed = 1234,
octaves = 3,
persist = 0.6
},
biomes = {"green_biome"},
y_max = 31000,
y_min = 1,
schematic = minetest.get_modpath("amogus_generator") .. "/schematics/lucky_tree_2.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
})
minetest.register_decoration({
deco_type = "schematic",
place_on = {"amogus_blocks:grass_green"},
sidelen = 16,
noise_params = {
offset = 0,
scale = 0.0001,
spread = {x = 100, y = 100, z = 100},
seed = 1234,
octaves = 3,
persist = 0.6
},
biomes = {"green_biome"},
y_max = 31000,
y_min = 1,
schematic = minetest.get_modpath("amogus_generator") .. "/schematics/lucky_tree_1.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
})
minetest.register_decoration({
deco_type = "schematic",
place_on = {"amogus_blocks:grass_green"},
sidelen = 16,
noise_params = {
offset = 0,
scale = 0.0001,
spread = {x = 100, y = 100, z = 100},
seed = 1234,
octaves = 3,
persist = 0.6
},
biomes = {"green_biome"},
y_max = 31000,
y_min = 1,
schematic = minetest.get_modpath("amogus_generator") .. "/schematics/STONE1.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
})
minetest.register_decoration({
deco_type = "schematic",
place_on = {"amogus_blocks:grass_green"},
sidelen = 16,
noise_params = {
offset = 0,
scale = 0.0001,
spread = {x = 100, y = 100, z = 100},
seed = 1234,
octaves = 3,
persist = 0.6
},
biomes = {"green_biome"},
y_max = 31000,
y_min = 1,
schematic = minetest.get_modpath("amogus_generator") .. "/schematics/STONE2.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
})
minetest.register_decoration({
deco_type = "schematic",
place_on = {"amogus_blocks:grass_green"},
sidelen = 16,
noise_params = {
offset = 0,
scale = 0.0001,
spread = {x = 100, y = 100, z = 100},
seed = 1234,
octaves = 3,
persist = 0.6
},
biomes = {"green_biome"},
y_max = 31000,
y_min = 1,
schematic = minetest.get_modpath("amogus_generator") .. "/schematics/STONE3.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
})
amogus_spawn_random_spread = 2
minetest.register_on_generated(function(minp, maxp, seed)
--local is_newchunk = true
--for , pos in ipairs(minetest.find_nodes_in_area(minp, maxp, "mymod:amogus_spawner")) do
--is_new_chunk = false
-- break
--end
--if is_new_chunk then
for i = 1, math.random(10, 15) do
minetest.add_entity({x = minp.x + math.random(16), y = minp.y + 1, z = minp.z + math.random(16)}, "amogus_entities:amogus")
--minetest.sound_play("amogus_sound", { pos = pos,gain = 1.0,max_hear_distance = 5})
if math.random(0, 100) < 75 then -- percentage chance of spawning group of amoguses in a chunk
-- spawn random amount of amoguses around random point in chunk
local spawn_position = {x = minp.x + math.random(0, 79), y = minp.y + math.random(0, 10), z = minp.z + math.random(0, 79)}
for i = 1, math.random(5, 15) do
math.randomseed(seed + i)
minetest.add_entity({
x = spawn_position.x + math.random(-amogus_spawn_random_spread, amogus_spawn_random_spread),
y = spawn_position.y + math.random(-amogus_spawn_random_spread, amogus_spawn_random_spread),
z = spawn_position.z + math.random(-amogus_spawn_random_spread, amogus_spawn_random_spread)
}, "amogus_entities:amogus")
end
--end
end
end)
minetest.register_decoration({
deco_type = "schematic",
place_on = {"amogus_blocks:sand"},
sidelen = 16,
fill_ratio = 0.0001,
y_max = 31000,
y_min = 1,
biomes = {"amogus_beach"},
schematic = minetest.get_modpath("amogus_generator") .. "/schematics/sand_house_1.mts",
})
minetest.register_decoration({
deco_type = "schematic",
place_on = {"amogus_blocks:sand"},
sidelen = 16,
fill_ratio = 0.0001,
y_max = 31000,
y_min = 1,
biomes = {"amogus_beach"},
schematic = minetest.get_modpath("amogus_generator") .. "/schematics/sand_house_2.mts",
})
minetest.register_decoration({
deco_type = "schematic",
place_on = {"amogus_blocks:sand"},
sidelen = 16,
fill_ratio = 0.0001,
y_max = 31000,
y_min = 1,
biomes = {"amogus_beach"},
schematic = minetest.get_modpath("amogus_generator") .. "/schematics/sand_house_3.mts",
})
minetest.register_decoration({
deco_type = "schematic",
place_on = {"amogus_blocks:grass_green"},
sidelen = 16,
fill_ratio = 0.0001,
y_max = 31000,
y_min = 1,
biomes = {"green_biome"},
schematic = minetest.get_modpath("amogus_generator") .. "/schematics/STATUE_GIANT.mts",
})
-- DEBUG
--imposters_spawned = 0
minetest.register_abm({
label = "Spawn Imposter",
nodenames = {"air"},
neighbors = {"group:stone"},
interval = 10,
-- IMPORTANT !! spawning chance is actualy interpreted as 1 / chance so the bigger the number the lower the actual chance of imposter being spawned
chance = 200,
action = function(pos)
-- DEBUG
--imposters_spawned = imposters_spawned + 1
--minetest.chat_send_all("Imposters spawned: " .. imposters_spawned)
-- only spawn on solid blocks AND in the dark
if minetest.registered_nodes[minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z}).name].walkable and minetest.get_node_light(pos) < 10 then
-- do not spawn if there is already an sussy imposter nearby
local nearby_entities = minetest.get_objects_inside_radius(pos, 30)
local imposter_nearby = false
for _, entity in pairs(nearby_entities) do
if (entity:get_luaentity() and entity:get_luaentity().name or "") == "amogus_entities:sussy_imposter" then
imposter_nearby = true
break
end
end
if not imposter_nearby then
minetest.add_entity(pos, "amogus_entities:sussy_imposter")
end
end
end
})

View File

@@ -0,0 +1 @@
name = amogus_generator

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,20 +1,48 @@
minetest.register_item(":", { -- Hand
type = "none",
wield_image = "coke.png",
wield_image = "CRT.png",
wield_scale = {x=.3,y=2,z=2.5},
range = 5,
tool_capabilities = {
max_drop_level = 0,
full_punch_interval = 0.4,
groupcaps = {
choppy = {times = {[1] = 2, [2] = 1.5, [3] = 1.0}, uses = 20, maxlevel = 1},
crumbly = {times = {[1] = 0.5, [2] = 0.3, [3] = 0.2}, uses = 20, maxlevel = 1},
choppy = {times = {[1] = 2, [2] = 1.5, [3] = 1.3}, uses = 20, maxlevel = 1},
crumbly = {times = {[1] = 1.0, [2] = 0.9, [3] = 0.8}, uses = 20, maxlevel = 1},
cracky = {times = {[1] = 1.0, [2] = 0.7, [3] = 0.5}, uses = 20, maxlevel = 1},
flower = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3},
},
damage_groups = {fleshy = 1, snappy = 1, cracky=1},
damage_groups = {fleshy = 0.5, snappy = 1, cracky=1},
}
})
local function explode(pos, radius)
local objects = minetest.get_objects_inside_radius(pos, radius)
for _, obj in pairs(objects) do
local obj_pos = obj:get_pos()
local dir = vector.normalize(vector.subtract(obj_pos, pos))
obj:set_velocity(vector.multiply(dir, 10))
obj:punch(obj, 1.0, {
full_punch_interval = 1.0,
damage_groups = {fleshy = 4},
})
end
for x = -radius, radius do
for y = -radius, radius do
for z = -radius, radius do
local p = {x = pos.x + x, y = pos.y + y, z = pos.z + z}
local d = vector.distance(pos, p)
if d <= radius then
minetest.remove_node(p)
end
end
end
end
end
minetest.register_craftitem("amogus_items:amogus", {
description = "Amogus",
description = "Mini Amogus friend",
inventory_image = "amogus_item.png",
--on_use = function(itemstack, user)
@@ -38,40 +66,51 @@ minetest.register_craftitem("amogus_items:amogus", {
on_place = function(itemstack, placer, pointed_thing)
if pointed_thing.type == "node" then
local pos = pointed_thing.above
minetest.add_entity(pos, "amogus_entities:amogus")
minetest.sound_play("amogus_sound", {
pos = pos,
gain = 1.0,
max_hear_distance = 5
})
minetest.add_entity(pos, "amogus_entities:mini_crewmate")
--minetest.sound_play("amogus_sound", {
-- pos = pos,
-- gain = 1.0,
-- max_hear_distance = 5
--})
amogus_general.play_random_sound(
"amogus_sound",
pos,
1.0, -- gain
5, -- max_hear_distance
2.0 -- pitch
)
itemstack:take_item()
end
return itemstack
end
})
minetest.register_craftitem("amogus_items:sprite", {
description = "Sprite",
description = "Zprite - Soda",
inventory_image = "sprite.png",
on_use = minetest.item_eat(10),
})
minetest.register_craftitem("amogus_items:coke", {
description = "Coke",
description = "koka Cola - Soda",
inventory_image = "coke.png",
on_use = minetest.item_eat(10),
on_use = minetest.item_eat(2),
})
minetest.register_craftitem("amogus_items:fanta", {
description = "Fanta",
description = "Funta - Soda",
inventory_image = "fanta.png",
on_use = minetest.item_eat(10),
on_use = minetest.item_eat(2),
})
minetest.register_craftitem("amogus_items:tomato", {
description = "Tomato",
inventory_image = "tomato.png",
on_use = minetest.item_eat(10),
on_use = minetest.item_eat(2),
})
minetest.register_craftitem("amogus_items:water", {
inventory_image = "water.png",
on_use = minetest.item_eat(10),
description = "Water",
inventory_image = "water_bottle.png",
on_use = minetest.item_eat(8),
})
minetest.register_tool("amogus_items:lightsaber_blue", {
@@ -83,9 +122,9 @@ minetest.register_tool("amogus_items:lightsaber_blue", {
groupcaps={
snappy={times={[1]=0.1, [2]=0.1, [3]=0.1}, uses=0, maxlevel=3},
},
damage_groups = {fleshy=10},
damage_groups = {fleshy=1.01},
},
sound = {breaks = "amogus_sound"},
--sound = {breaks = "amogus_sound"},
})
minetest.register_tool("amogus_items:lightsaber_red", {
@@ -97,9 +136,10 @@ minetest.register_tool("amogus_items:lightsaber_red", {
groupcaps={
snappy={times={[1]=0.1, [2]=0.1, [3]=0.1}, uses=0, maxlevel=3},
},
damage_groups = {fleshy=10},
damage_groups = {fleshy=1.01},
},
sound = {breaks = "amogus_sound"},
--sound = {breaks = "amogus_sound"},
})
minetest.register_tool("amogus_items:lightsaber_green", {
@@ -111,27 +151,38 @@ minetest.register_tool("amogus_items:lightsaber_green", {
groupcaps={
snappy={times={[1]=0.1, [2]=0.1, [3]=0.1}, uses=0, maxlevel=3},
},
damage_groups = {fleshy=10},
damage_groups = {fleshy=1.01},
},
sound = {breaks = "amogus_sound"},
--sound = {breaks = "amogus_sound"},
})
-- add theese items : goldenpickaxe, wooden plank, gold_ingot, sussium_ingot
minetest.register_craftitem("amogus_items:wooden_plank", {
description = "Wooden Plank",
inventory_image = "wood.png",
})
minetest.register_craftitem("amogus_items:gold_ingot", {
description = "Gold Ingot",
inventory_image = "gold_ingot.png",
})minetest.register_craftitem("amogus_items:rock", {
tool_capabilities = {
damage_groups = {fleshy = 1.0},
full_punch_interval = 1.5,
},
})
minetest.register_craftitem("amogus_items:rock", {
description = "Rock",
inventory_image = "rocks.png",
tool_capabilities = {
damage_groups = {fleshy = 1.0},
full_punch_interval = 1.5,
},
})
minetest.register_craftitem("amogus_items:sussium_ingot", {
description = "Sussium Ingot",
inventory_image = "sussium_ingot.png",
tool_capabilities = {
damage_groups = {fleshy = 1.0},
full_punch_interval = 1.5,
},
})
--add theese items goldenpickaxe, stonepickaxe and allow them slowly break nodes and destroy it after 30 uses
minetest.register_tool("amogus_items:goldenplumba", {
description = "Golden Plumba",
@@ -148,7 +199,7 @@ minetest.register_tool("amogus_items:goldenplumba", {
crumbly = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3},
cracky = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3},
},
damage_groups = {fleshy = 10},
damage_groups = {fleshy = 2},
},
on_use = function(itemstack, user, pointed_thing)
if pointed_thing.type == "node" then
@@ -175,7 +226,7 @@ minetest.register_tool("amogus_items:susplumba", {
crumbly = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3},
cracky = {times={[1] = 0, [2] = 0, [3] = 0}, uses = 10, maxlevel=3},
},
damage_groups = {fleshy = 10},
damage_groups = {fleshy = 2},
},
on_use = function(itemstack, user, pointed_thing)
if pointed_thing.type == "node" then
@@ -194,13 +245,38 @@ minetest.register_tool("amogus_items:stonepickaxe", {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
cracky={times={[1]=2.0, [2]=1.0, [3]=0.50}, uses=30, maxlevel=1},
stone={times={[1]=2.5, [2]=1.0, [3]=0.50}, uses=30, maxlevel=1},
},
damage_groups = {fleshy=2},
damage_groups = {fleshy=1.0},
},
sound = {breaks = "default_tool_breaks"},
})
minetest.register_tool("amogus_items:goldenpickaxe", {
description = "Golden Pickaxe",
inventory_image = "golden_pick.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
stone={times={[1]=1.3, [2]=0.60, [3]=0.40}, uses=30, maxlevel=1},
},
damage_groups = {fleshy=1.0},
},
sound = {breaks = "default_tool_breaks"},
})
minetest.register_tool("amogus_items:sussiumpickaxe", {
description = "Sussium Pickaxe",
inventory_image = "sussium_pickaxe.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
stone={times={[0.5]=2.0,[1]=0.85, [2]=0.40, [3]=0.20}, uses=30, maxlevel=1},
},
damage_groups = {fleshy=1.0},
},
sound = {breaks = "default_tool_breaks"},
})
minetest.register_tool("amogus_items:goldenaxe", {
description = "Golden Axe",
inventory_image = "goldenaxe.png",
@@ -208,22 +284,526 @@ minetest.register_tool("amogus_items:goldenaxe", {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
choppy={times={[1]=2.50, [2]=1.40, [3]=0.40}, uses=30, maxlevel=2},
choppy={times={[1]=2.50, [2]=1.40, [3]=0.45}, uses=30, maxlevel=2},
},
damage_groups = {fleshy=4},
damage_groups = {fleshy=1.0},
},
groups = {flammable = 2}
})
minetest.register_tool("amogus_items:stoneaxe", {
description = "Stone Axe",
inventory_image = "goldenaxe.png",
inventory_image = "stone_axe.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
choppy={times={[1]=2.50, [2]=1.40, [3]=0.40}, uses=30, maxlevel=2},
choppy={times={[1]=2.50, [2]=1.40, [3]=0.80}, uses=30, maxlevel=2},
},
damage_groups = {fleshy=4},
damage_groups = {fleshy=1.0},
},
groups = {flammable = 2}
})
minetest.register_tool("amogus_items:sussiumaxe", {
description = "Sussium Axe",
inventory_image = "sussium_axe.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
choppy={times={[1]=0.90, [2]=0.80, [3]=0.35}, uses=30, maxlevel=2},
},
damage_groups = {fleshy=1.0},
},
groups = {flammable = 2}
})
minetest.register_tool("amogus_items:stoneshovel", {
description = "stone shovel",
inventory_image = "stone_shovel.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
crumbly={times={[1]=1.5, [2]=1.0, [3]=0.9}, uses=30, maxlevel=2},
},
damage_groups = {fleshy=1.0},
},
groups = {flammable = 2}
})
minetest.register_tool("amogus_items:goldenshovel", {
description = "golden shovel",
inventory_image = "golden_shovel.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
crumbly={times={[1]=1.0, [2]=0.8, [3]=0.6}, uses=30, maxlevel=2},
},
damage_groups = {fleshy=1.0},
},
groups = {flammable = 2}
})
minetest.register_tool("amogus_items:sussiumshovel", {
description = "sussium shovel",
inventory_image = "sussium_shovel.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
crumbly={times={[1]=0.8, [2]=0.6, [3]=0.35}, uses=30, maxlevel=2},
},
damage_groups = {fleshy=1.0},
},
groups = {flammable = 2}
})
minetest.register_tool("amogus_items:obsussian_hammer", {
description = "obsussian hammer",
inventory_image = "obsusian_hammer.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
choppy={times={[1]=0.90, [2]=0.40, [3]=0.06}, uses=30, maxlevel=2},
crumbly={times={[1]=0.90, [2]=0.40, [3]=0.06}, uses=30, maxlevel=2},
stone={times={[0.5]=1.4,[1]=0.90, [2]=0.40, [3]=0.06}, uses=30, maxlevel=1},
crumbly={times={[1]=0.90, [2]=0.40, [3]=0.06}, uses=30, maxlevel=2},
},
damage_groups = {fleshy=1.0},
},
groups = {flammable = 2}
})
minetest.register_craftitem("amogus_items:pcb", {
description = "PCB",
inventory_image = "PCB.png",
tool_capabilities = {
damage_groups = {fleshy = 1.0},
full_punch_interval = 2.0,
},
})
minetest.register_craftitem("amogus_items:capacitor", {
description = "Capacitor",
inventory_image = "capacitor.png",
tool_capabilities = {
damage_groups = {fleshy = 1.0},
full_punch_interval = 2.0,
},
})
minetest.register_craftitem("amogus_items:sugar", {
description = "Sugar",
inventory_image = "sugar.png",
on_use = minetest.item_eat(20),
tool_capabilities = {
damage_groups = {fleshy = 1.0},
full_punch_interval = 2.0,
},
})
minetest.register_craftitem("amogus_items:iron_ingot", {
description = "Iron Ingot",
inventory_image = "iron_ingot.png",
tool_capabilities = {
damage_groups = {fleshy = 1.0},
full_punch_interval = 1.5,
},
})
minetest.register_tool("amogus_items:dynamite", {
description = "dynamite",
inventory_image = "dynamite.png",
tool_capabilities = {
damage_groups = {fleshy = 1.0},
full_punch_interval = 1.5,
},
on_place = function(itemstack, placer, pointed_thing)
if pointed_thing.type == "node" then
local pos = pointed_thing.above
minetest.add_entity(pos, "amogus_items:dynamite_entity")
-- remove one item from the itemstack
itemstack:take_item()
end
return itemstack
end
})
minetest.register_entity("amogus_items:dynamite_entity", {
physical = true,
collisionbox = {-0.5,-0.5,-0.5, 0.5,0.5,0.5},
visual = "sprite",
textures = {"dynamite.png"},
on_step = function(self, dtime)
local pos = self.object:get_pos()
explode(pos,5)
minetest.add_particlespawner({
amount = 2900,
time = 0.5,
-- create 15 block radius of particles
minpos = {x=pos.x-5, y=pos.y-5, z=pos.z-5},
maxpos = {x=pos.x+5, y=pos.y+5, z=pos.z+5},
minvel = {x=-2, y=-2, z=-2},
maxvel = {x=2, y=2, z=2},
minacc = {x=0, y=-10, z=0},
maxacc = {x=0, y=-10, z=0},
minexptime = 1,
maxexptime = 3,
minsize = 1,
maxsize = 2,
texture = "capacitor.png",
})
self.object:remove()
end
})
-- below is modified code from bucket mod from minetest_game. (Minetest 0.4 mod: bucket)
-- original is licensed under:
-- GNU Lesser General Public License, version 2.1
-- Copyright (C) 2011-2016 Kahrl <kahrl@gmx.net>
-- Copyright (C) 2011-2016 celeron55, Perttu Ahola <celeron55@gmail.com>
-- Copyright (C) 2011-2016 Various Minetest developers and contributors
minetest.register_alias("empty_bucket", "amogus_items:empty_bucket")
minetest.register_alias("water_bucket", "amogus_items:water_bucket")
minetest.register_craft({
output = "bucket:empty_bucket 1",
recipe = {
{"amogus_items:iron_ingot", "", "amogus_items:iron_ingot"},
{"", "amogus_items:iron_ingot", ""},
}
})
bucket = {}
bucket.liquids = {}
local function check_protection(pos, name, text)
if minetest.is_protected(pos, name) then
minetest.log("action", (name ~= "" and name or "A mod")
.. " tried to " .. text
.. " at protected position "
.. minetest.pos_to_string(pos)
.. " with a bucket")
minetest.record_protection_violation(pos, name)
return true
end
return false
end
-- Register a new liquid
-- source = name of the source node
-- flowing = name of the flowing node
-- itemname = name of the new bucket item (or nil if liquid is not takeable)
-- inventory_image = texture of the new bucket item (ignored if itemname == nil)
-- name = text description of the bucket item
-- groups = (optional) groups of the bucket item, for example {water_bucket = 1}
-- force_renew = (optional) bool. Force the liquid source to renew if it has a
-- source neighbour, even if defined as 'liquid_renewable = false'.
-- Needed to avoid creating holes in sloping rivers.
-- This function can be called from any mod (that depends on bucket).
function bucket.register_liquid(source, flowing, itemname, inventory_image, name,
groups, force_renew)
bucket.liquids[source] = {
source = source,
flowing = flowing,
itemname = itemname,
force_renew = force_renew,
}
bucket.liquids[flowing] = bucket.liquids[source]
if itemname ~= nil then
minetest.register_craftitem(itemname, {
description = name,
inventory_image = inventory_image,
stack_max = 1,
liquids_pointable = true,
groups = groups,
on_place = function(itemstack, user, pointed_thing)
-- Must be pointing to node
if pointed_thing.type ~= "node" then
return
end
local node = minetest.get_node_or_nil(pointed_thing.under)
local ndef = node and minetest.registered_nodes[node.name]
-- Call on_rightclick if the pointed node defines it
if ndef and ndef.on_rightclick and
not (user and user:is_player() and
user:get_player_control().sneak) then
return ndef.on_rightclick(
pointed_thing.under,
node, user,
itemstack)
end
local lpos
-- Check if pointing to a buildable node
if ndef and ndef.buildable_to then
-- buildable; replace the node
lpos = pointed_thing.under
else
-- not buildable to; place the liquid above
-- check if the node above can be replaced
lpos = pointed_thing.above
node = minetest.get_node_or_nil(lpos)
local above_ndef = node and minetest.registered_nodes[node.name]
if not above_ndef or not above_ndef.buildable_to then
-- do not remove the bucket with the liquid
return itemstack
end
end
if check_protection(lpos, user
and user:get_player_name()
or "", "place "..source) then
return
end
minetest.set_node(lpos, {name = source})
return ItemStack("amogus_items:empty_bucket")
end
})
end
end
-- random prefixes for names
local bucket_names_prefixes = {
"Sussy",
"Sussy wussy",
"Sus",
"Imposterous",
"This is",
"I wonder what is the",
"You probably need",
"Big",
"Cursed",
"I want that",
"Very funny",
"Suspicious",
"SuspicioususUSSuS",
"SuspiciousususSuSuSsSSuS",
"AAAAA!! IT'S AGAIN THAT",
"Fantastick",
"I don't know what is that",
"This is propably the longest item name you will ever see and btw this item is called",
"I like",
"Whatever that is, I've got my own",
"A",
"Wonderful",
"Respectful",
"Amogus shaped",
"Impostor shaped",
"Imposter shaped",
"Sussy shaped"
}
-- random name
local empty_bucket_names = {
"Bmpty Eucket",
"Bupty Emcket",
"Emptt Buckey",
"Emckty Bupet"
}
minetest.register_craftitem("amogus_items:empty_bucket", {
-- random name
--description = (empty_bucket_names[math.random(1, #empty_bucket_names)]),
description = (bucket_names_prefixes[math.random(1, #bucket_names_prefixes)] .. " " .. empty_bucket_names[math.random(1, #empty_bucket_names)]),
inventory_image = "empty_bucket.png",
groups = {tool = 1},
tool_capabilities = {
damage_groups = {fleshy = 1.0},
full_punch_interval = 1.0,
},
liquids_pointable = true,
on_use = function(itemstack, user, pointed_thing)
if pointed_thing.type == "object" then
pointed_thing.ref:punch(user, 1.0, { full_punch_interval=1.0 }, nil)
return user:get_wielded_item()
elseif pointed_thing.type ~= "node" then
-- do nothing if it's neither object nor node
return
end
-- Check if pointing to a liquid source
local node = minetest.get_node(pointed_thing.under)
local liquiddef = bucket.liquids[node.name]
local item_count = user:get_wielded_item():get_count()
if liquiddef ~= nil
and liquiddef.itemname ~= nil
and node.name == liquiddef.source then
if check_protection(pointed_thing.under,
user:get_player_name(),
"take ".. node.name) then
return
end
-- default set to return filled bucket
local giving_back = liquiddef.itemname
-- check if holding more than 1 empty bucket
if item_count > 1 then
-- if space in inventory add filled bucked, otherwise drop as item
local inv = user:get_inventory()
if inv:room_for_item("main", {name=liquiddef.itemname}) then
inv:add_item("main", liquiddef.itemname)
else
local pos = user:get_pos()
pos.y = math.floor(pos.y + 0.5)
minetest.add_item(pos, liquiddef.itemname)
end
-- set to return empty buckets minus 1
giving_back = "amogus_items:empty_bucket "..tostring(item_count-1)
end
-- force_renew requires a source neighbour
local source_neighbor = false
if liquiddef.force_renew then
source_neighbor =
minetest.find_node_near(pointed_thing.under, 1, liquiddef.source)
end
if not (source_neighbor and liquiddef.force_renew) then
minetest.add_node(pointed_thing.under, {name = "air"})
end
return ItemStack(giving_back)
else
-- non-liquid nodes will have their on_punch triggered
local node_def = minetest.registered_nodes[node.name]
if node_def then
node_def.on_punch(pointed_thing.under, node, user, pointed_thing)
end
return user:get_wielded_item()
end
end,
})
-- random name
local water_bucket_names = {
"Bater Wucket",
"Buter Wacket",
"Watet Bucker",
"Wacker Butet"
}
bucket.register_liquid(
"amogus_blocks:water_source",
"amogus_blocks:water_flowing",
"amogus_items:water_bucket",
"water_bucket.png",
-- random name
(bucket_names_prefixes[math.random(1, #bucket_names_prefixes)] .. " " .. water_bucket_names[math.random(1, #water_bucket_names)]),
{tool = 1, water_bucket = 1}
)
minetest.register_tool("amogus_items:obsusian_shovel", {
description = "Obsidian Shovel",
inventory_image = "obsusian_shovel.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level = 1,
groupcaps = {
crumbly = {times = {[1] = 0.80, [2] = 0.40, [3] = 0.20}, uses = 30, maxlevel = 3},
},
damage_groups = {fleshy = 1.6},
},
sound = {breaks = "default_tool_breaks"},
})
minetest.register_tool("amogus_items:obsusian_sword", {
description = "Obsidian Sword",
inventory_image = "obsusian_sword.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level = 1,
groupcaps = {
snappy = {times = {[2] = 0.70, [3] = 0.30}, uses = 30, maxlevel = 3},
},
damage_groups = {fleshy = 16},
},
sound = {breaks = "default_tool_breaks"},
})
-- create mogus item that can be eaten
minetest.register_craftitem("amogus_items:mogus", {
description = "Mogus",
inventory_image = "mogus.png",
on_use = minetest.item_eat(1),
})
function sraj_dzwiek()
--make random sound
local sounds = {
"shitting1",
"shitting2",
"shitting3"}
local sound = sounds[math.random(1, #sounds)]
minetest.sound_play(sound, {pos = pos, gain = 2.0, max_hear_distance = 10})
end
minetest.register_node("amogus_items:Poop", {
description = "Just Poop",
tiles = {"Poop.png"},
drop = 'amogus_items:Poop', groups = {falling_node = 1, cracky=3, stone=1},
})
minetest.register_node("amogus_items:Poop2", {
description = "Just Poop",
tiles = {"Poop2.png"},
drop = 'amogus_items:Poop', groups = {falling_node = 1, cracky=3, stone=1},
})
minetest.register_craftitem("amogus_items:pooper", {
description = "Pooper",
inventory_image = "SHITitem.png",
on_use = function(itemstack, user, pointed_thing)
-- check if pointing at a node
if pointed_thing.type ~= "node" then
return
end
-- make a random number between 1 and 10
local random_number = math.random(1, 10)
if random_number < 5 then
local node = minetest.get_node(pointed_thing.above)
if node.name == "air" then
minetest.add_node(pointed_thing.above, {name="amogus_items:Poop"})
minetest.check_for_falling(pointed_thing.above)
else
minetest.add_node(pointed_thing.under, {name="amogus_items:Poop"})
minetest.check_for_falling(pointed_thing.under)
end
else
local node = minetest.get_node(pointed_thing.above)
if node.name == "air" then
minetest.add_node(pointed_thing.above, {name="amogus_items:Poop2"})
minetest.check_for_falling(pointed_thing.above)
else
minetest.add_node(pointed_thing.under, {name="amogus_items:Poop2"})
minetest.check_for_falling(pointed_thing.under)
end
end
sraj_dzwiek()
return itemstack
end,
})

View File

@@ -0,0 +1 @@
name = amogus_items

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,2 @@
shit_packing=3
shitting=3

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 516 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 754 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 231 B

After

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 B

After

Width:  |  Height:  |  Size: 210 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 188 B

After

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 157 B

After

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 B

View File

Before

Width:  |  Height:  |  Size: 284 B

After

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 777 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

23
mods/carts/README.txt Normal file
View File

@@ -0,0 +1,23 @@
Carts (formerly boost_cart)
==========================
Carts, based almost entirely on the mod boost_cart [1], which
itself is based on (and fully compatible with) the carts mod [2].
The model was originally designed by stujones11 [3] (CC-0).
Cart textures are based on original work from PixelBOX by Gambit (permissive
license).
[1] https://github.com/SmallJoker/boost_cart/
[2] https://github.com/PilzAdam/carts/
[3] https://github.com/stujones11/railcart/
Features
----------
- A fast cart for your railway or roller coaster (up to 7 m/s!)
- Boost and brake rails
- Rail junction switching with the 'right-left' walking keys
- Handbrake with the 'back' key

421
mods/carts/cart_entity.lua Normal file
View File

@@ -0,0 +1,421 @@
-- carts/cart_entity.lua
-- support for MT game translation.
local S = carts.get_translator
local cart_entity = {
initial_properties = {
physical = false, -- otherwise going uphill breaks
collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
visual = "mesh",
mesh = "carts_cart.b3d",
visual_size = {x=1, y=1},
textures = {"carts_cart.png"},
},
driver = nil,
punched = false, -- used to re-send velocity and position
velocity = {x=0, y=0, z=0}, -- only used on punch
old_dir = {x=1, y=0, z=0}, -- random value to start the cart on punch
old_pos = nil,
old_switch = 0,
railtype = nil,
attached_items = {}
}
function cart_entity:on_rightclick(clicker)
if not clicker or not clicker:is_player() then
return
end
local player_name = clicker:get_player_name()
if self.driver and player_name == self.driver then
carts:manage_attachment(clicker, nil)
elseif not self.driver then
carts:manage_attachment(clicker, self.object)
self.driver = player_name
end
end
function cart_entity:on_activate(staticdata, dtime_s)
self.object:set_armor_groups({immortal=1})
if string.sub(staticdata, 1, string.len("return")) ~= "return" then
return
end
local data = minetest.deserialize(staticdata)
if type(data) ~= "table" then
return
end
self.railtype = data.railtype
self.old_dir = data.old_dir or self.old_dir
end
function cart_entity:get_staticdata()
return minetest.serialize({
railtype = self.railtype,
old_dir = self.old_dir
})
end
-- 0.5.x and later: When the driver leaves
function cart_entity:on_detach_child(child)
if child and child:get_player_name() == self.driver then
-- Clean up eye height
carts:manage_attachment(child, nil)
self.driver = nil
end
end
function cart_entity:on_punch(puncher, time_from_last_punch, tool_capabilities, direction)
local pos = self.object:get_pos()
local vel = self.object:get_velocity()
if not self.railtype or vector.equals(vel, {x=0, y=0, z=0}) then
local node = minetest.get_node(pos).name
self.railtype = minetest.get_item_group(node, "connect_to_raillike")
end
-- Punched by non-player
if not puncher or not puncher:is_player() then
local cart_dir = carts:get_rail_direction(pos, self.old_dir, nil, nil, self.railtype)
if vector.equals(cart_dir, {x=0, y=0, z=0}) then
return
end
self.velocity = vector.multiply(cart_dir, 2)
self.punched = true
return
end
-- Player digs cart by sneak-punch
if puncher:get_player_control().sneak then
if self.sound_handle then
minetest.sound_stop(self.sound_handle)
end
-- Detach driver and items
if self.driver then
if self.old_pos then
self.object:set_pos(self.old_pos)
end
local player = minetest.get_player_by_name(self.driver)
carts:manage_attachment(player, nil)
end
for _, obj_ in ipairs(self.attached_items) do
if obj_ then
obj_:set_detach()
end
end
-- Pick up cart
local inv = puncher:get_inventory()
if not minetest.is_creative_enabled(puncher:get_player_name())
or not inv:contains_item("main", "carts:cart") then
local leftover = inv:add_item("main", "carts:cart")
-- If no room in inventory add a replacement cart to the world
if not leftover:is_empty() then
minetest.add_item(self.object:get_pos(), leftover)
end
end
self.object:remove()
return
end
-- Player punches cart to alter velocity
if puncher:get_player_name() == self.driver then
if math.abs(vel.x + vel.z) > carts.punch_speed_max then
return
end
end
local punch_dir = carts:velocity_to_dir(puncher:get_look_dir())
punch_dir.y = 0
local cart_dir = carts:get_rail_direction(pos, punch_dir, nil, nil, self.railtype)
if vector.equals(cart_dir, {x=0, y=0, z=0}) then
return
end
local punch_interval = 1
-- Faulty tool registrations may cause the interval to be set to 0 !
if tool_capabilities and (tool_capabilities.full_punch_interval or 0) > 0 then
punch_interval = tool_capabilities.full_punch_interval
end
time_from_last_punch = math.min(time_from_last_punch or punch_interval, punch_interval)
local f = 2 * (time_from_last_punch / punch_interval)
self.velocity = vector.multiply(cart_dir, f)
self.old_dir = cart_dir
self.punched = true
end
local function rail_on_step_event(handler, obj, dtime)
if handler then
handler(obj, dtime)
end
end
-- sound refresh interval = 1.0sec
local function rail_sound(self, dtime)
if not self.sound_ttl then
self.sound_ttl = 1.0
return
elseif self.sound_ttl > 0 then
self.sound_ttl = self.sound_ttl - dtime
return
end
self.sound_ttl = 1.0
if self.sound_handle then
local handle = self.sound_handle
self.sound_handle = nil
minetest.after(0.2, minetest.sound_stop, handle)
end
local vel = self.object:get_velocity()
local speed = vector.length(vel)
if speed > 0 then
self.sound_handle = minetest.sound_play(
"carts_cart_moving", {
object = self.object,
gain = (speed / carts.speed_max) / 2,
loop = true,
})
end
end
local function get_railparams(pos)
local node = minetest.get_node(pos)
return carts.railparams[node.name] or {}
end
local v3_len = vector.length
local function rail_on_step(self, dtime)
local vel = self.object:get_velocity()
if self.punched then
vel = vector.add(vel, self.velocity)
self.object:set_velocity(vel)
self.old_dir.y = 0
elseif vector.equals(vel, {x=0, y=0, z=0}) then
return
end
local pos = self.object:get_pos()
local dir = carts:velocity_to_dir(vel)
local dir_changed = not vector.equals(dir, self.old_dir)
local update = {}
if self.old_pos and not self.punched and not dir_changed then
local flo_pos = vector.round(pos)
local flo_old = vector.round(self.old_pos)
if vector.equals(flo_pos, flo_old) then
-- Do not check one node multiple times
return
end
end
local ctrl, player
-- Get player controls
if self.driver then
player = minetest.get_player_by_name(self.driver)
if player then
ctrl = player:get_player_control()
end
end
local stop_wiggle = false
if self.old_pos and not dir_changed then
-- Detection for "skipping" nodes (perhaps use average dtime?)
-- It's sophisticated enough to take the acceleration in account
local acc = self.object:get_acceleration()
local distance = dtime * (v3_len(vel) + 0.5 * dtime * v3_len(acc))
local new_pos, new_dir = carts:pathfinder(
pos, self.old_pos, self.old_dir, distance, ctrl,
self.old_switch, self.railtype
)
if new_pos then
-- No rail found: set to the expected position
pos = new_pos
update.pos = true
dir = new_dir
end
elseif self.old_pos and self.old_dir.y ~= 1 and not self.punched then
-- Stop wiggle
stop_wiggle = true
end
local railparams
-- dir: New moving direction of the cart
-- switch_keys: Currently pressed L(1) or R(2) key,
-- used to ignore the key on the next rail node
local switch_keys
dir, switch_keys = carts:get_rail_direction(
pos, dir, ctrl, self.old_switch, self.railtype
)
dir_changed = not vector.equals(dir, self.old_dir)
local acc = 0
if stop_wiggle or vector.equals(dir, {x=0, y=0, z=0}) then
dir = vector.new(self.old_dir)
vel = {x = 0, y = 0, z = 0}
local pos_r = vector.round(pos)
if not carts:is_rail(pos_r, self.railtype)
and self.old_pos then
pos = self.old_pos
elseif not stop_wiggle then
-- End of rail: Smooth out.
pos = pos_r
dir_changed = false
dir.y = 0
else
pos.y = math.floor(pos.y + 0.5)
end
update.pos = true
update.vel = true
else
-- Direction change detected
if dir_changed then
vel = vector.multiply(dir, math.abs(vel.x + vel.z))
update.vel = true
if dir.y ~= self.old_dir.y then
pos = vector.round(pos)
update.pos = true
end
end
-- Center on the rail
if dir.z ~= 0 and math.floor(pos.x + 0.5) ~= pos.x then
pos.x = math.floor(pos.x + 0.5)
update.pos = true
end
if dir.x ~= 0 and math.floor(pos.z + 0.5) ~= pos.z then
pos.z = math.floor(pos.z + 0.5)
update.pos = true
end
-- Slow down or speed up..
acc = dir.y * -4.0
-- Get rail for corrected position
railparams = get_railparams(pos)
-- no need to check for railparams == nil since we always make it exist.
local speed_mod = railparams.acceleration
if speed_mod and speed_mod ~= 0 then
-- Try to make it similar to the original carts mod
acc = acc + speed_mod
else
-- Handbrake or coast
if ctrl and ctrl.down then
acc = acc - 3
else
acc = acc - 0.4
end
end
end
-- Limit cart speed
local vel_len = vector.length(vel)
if vel_len > carts.speed_max then
vel = vector.multiply(vel, carts.speed_max / vel_len)
update.vel = true
end
if vel_len >= carts.speed_max and acc > 0 then
acc = 0
end
self.object:set_acceleration(vector.multiply(dir, acc))
self.old_pos = vector.round(pos)
self.old_dir = vector.new(dir)
self.old_switch = switch_keys
if self.punched then
-- Collect dropped items
for _, obj_ in pairs(minetest.get_objects_inside_radius(pos, 1)) do
local ent = obj_:get_luaentity()
-- Careful here: physical_state and disable_physics are item-internal APIs
if ent and ent.name == "__builtin:item" and ent.physical_state then
ent:disable_physics()
obj_:set_attach(self.object, "", {x=0, y=0, z=0}, {x=0, y=0, z=0})
self.attached_items[#self.attached_items + 1] = obj_
end
end
self.punched = false
update.vel = true
end
railparams = railparams or get_railparams(pos)
if not (update.vel or update.pos) then
rail_on_step_event(railparams.on_step, self, dtime)
return
end
local yaw = 0
if dir.x < 0 then
yaw = 0.5
elseif dir.x > 0 then
yaw = 1.5
elseif dir.z < 0 then
yaw = 1
end
self.object:set_yaw(yaw * math.pi)
local anim = {x=0, y=0}
if dir.y == -1 then
anim = {x=1, y=1}
elseif dir.y == 1 then
anim = {x=2, y=2}
end
self.object:set_animation(anim, 1, 0)
if update.vel then
self.object:set_velocity(vel)
end
if update.pos then
if dir_changed then
self.object:set_pos(pos)
else
self.object:move_to(pos)
end
end
-- call event handler
rail_on_step_event(railparams.on_step, self, dtime)
end
function cart_entity:on_step(dtime)
rail_on_step(self, dtime)
rail_sound(self, dtime)
end
minetest.register_entity("carts:cart", cart_entity)
minetest.register_craftitem("carts:cart", {
description = S("Cart") .. "\n" .. S("(Sneak+Click to pick up)"),
inventory_image = minetest.inventorycube("carts_cart_top.png", "carts_cart_front.png", "carts_cart_side.png"),
wield_image = "carts_cart_front.png",
on_place = function(itemstack, placer, pointed_thing)
local under = pointed_thing.under
local node = minetest.get_node(under)
local udef = minetest.registered_nodes[node.name]
if udef and udef.on_rightclick and
not (placer and placer:is_player() and
placer:get_player_control().sneak) then
return udef.on_rightclick(under, node, placer, itemstack,
pointed_thing) or itemstack
end
if pointed_thing.type ~= "node" then
return
end
if carts:is_rail(pointed_thing.under) then
minetest.add_entity(pointed_thing.under, "carts:cart")
elseif carts:is_rail(pointed_thing.above) then
minetest.add_entity(pointed_thing.above, "carts:cart")
else
return
end
minetest.sound_play({name = "default_place_node_metal", gain = 0.5},
{pos = pointed_thing.above}, true)
if not minetest.is_creative_enabled(placer:get_player_name()) then
itemstack:take_item()
end
return itemstack
end,
})

Some files were not shown because too many files have changed in this diff Show More