Compare commits

..

14 Commits

Author SHA1 Message Date
Wbjitscool db1d089e5b Upload files to "textures" 2024-05-08 03:36:47 +00:00
Wbjitscool 1c5fb5439c Upload files to "textures" 2024-05-08 03:36:24 +00:00
Wbjitscool a9224cdc77 Upload files to "textures" 2024-05-08 03:36:19 +00:00
Wbjitscool 1e93d084f7 updated the frames to 8 instead of 4 for the cherry blossom particles
updated the frames to 8 instead of 4 for the cherry blossom particles
to smooth out the animation a bit better
2024-05-08 03:35:48 +00:00
Wbjitscool 626fea69d9 updated the frames to 8 instead of 4 for the cherry blossom particles
updated the frames to 8 instead of 4 for the cherry blossom particles
to smooth out the animation a bit better
2024-05-08 03:35:43 +00:00
Wbjitscool 68e75c4968 Upload files to "textures" 2024-05-05 22:49:03 +00:00
Wbjitscool 313ba68ecd Upload files to "textures" 2024-05-05 22:48:33 +00:00
Wbjitscool 6a6e6fdad0 Upload files to "textures" 2024-05-05 22:47:57 +00:00
the-real-herowl 75a078f4f9 Added wind and animation support 2024-05-06 00:39:12 +02:00
Wbjitscool 5829abbe07 Update mods/ITEMS/mcl_cherry_blossom/growth.lua 2024-05-05 21:59:52 +00:00
Wbjitscool cdc4ff56bd Upload files to "textures" 2024-05-05 21:59:52 +00:00
Wbjitscool 0b1eff1af4 Delete textures/mcl_cherry_blossom_particle.png 2024-05-05 21:59:52 +00:00
Wbjitscool 530da1ef69 Upload files to "textures" 2024-05-05 21:59:52 +00:00
Wbjitscool 0548773875 adding the remaining particles 2024-05-05 21:59:52 +00:00
15 changed files with 34 additions and 20 deletions

View File

@ -31,11 +31,25 @@ local cherry_particle = {
velocity = vector.zero(),
acceleration = vector.new(0,-1,0),
size = math.random(1.3,2.5),
texture = "mcl_cherry_blossom_particle.png",
texture = "mcl_cherry_blossom_particle_" .. math.random(1, 12) .. ".png",
animation = {
type = "vertical_frames",
aspect_w = 3,
aspect_h = 3,
length = 0.8,
},
collision_removal = false,
collisiondetection = false,
}
local wind_direction -- vector
local time_changed -- 0 - afternoon; 1 - evening; 2 - morning
local function change_wind_direction()
local east_west = math.random(-0.5,0.5)
local north_south = math.random(-0.5,0.5)
wind_direction = vector.new(east_west, 0, north_south)
end
change_wind_direction()
minetest.register_abm({
label = "Cherry Blossom Particles",
@ -47,6 +61,20 @@ minetest.register_abm({
local pt = table.copy(cherry_particle)
pt.pos = vector.offset(pos,math.random(-0.5,0.5),-0.51,math.random(-0.5,0.5))
pt.expirationtime = math.random(1.2,4.5)
pt.texture = "mcl_cherry_blossom_particle_" .. math.random(1, 12) .. ".png"
local time = minetest.get_timeofday()
if time_changed ~= 0 and time > 0.6 and time < 0.605 then
time_changed = 0
change_wind_direction()
elseif (time_changed ~= 1 and time > 0.8 and time < 0.805) then
time_changed = 1
change_wind_direction()
elseif (time_changed ~= 2 and time > 0.3 and time < 0.305) then
time_changed = 2
change_wind_direction()
end
pt.acceleration = pt.acceleration + wind_direction
minetest.add_particle(pt)
end)
end

View File

@ -251,15 +251,6 @@ local function remove_shield_entity(player, i)
end
end
local function is_node_stack(itemstack)
return itemstack:get_definition().drawtype -- only node's definition table contains element "drawtype"
end
local function is_rmb_conflicting_node(nodename)
local nodedef = minetest.registered_nodes[nodename]
return nodedef.on_rightclick
end
local function handle_blocking(player)
local player_shield = mcl_shields.players[player]
local rmb = player:get_player_control().RMB
@ -275,7 +266,7 @@ local function handle_blocking(player)
local pos = player:get_pos()
if shield_in_hand then
if not_blocking then
minetest.after(0.05, function()
minetest.after(0.25, function()
if (not_blocking or not shield_in_offhand) and shield_in_hand and rmb then
player_shield.blocking = 2
set_shield(player, true, 2)
@ -286,16 +277,11 @@ local function handle_blocking(player)
end
elseif shield_in_offhand then
local pointed_thing = mcl_util.get_pointed_thing(player, true)
local wielded_stack = player:get_wielded_item()
local offhand_can_block = (minetest.get_item_group(wielded_item(player), "bow") ~= 1
and minetest.get_item_group(wielded_item(player), "crossbow") ~= 1)
local offhand_can_block = (wielded_item(player) == "" or not pointed_thing)
and (minetest.get_item_group(wielded_item(player), "bow") ~= 1 and minetest.get_item_group(wielded_item(player), "crossbow") ~= 1)
if pointed_thing and pointed_thing.type == "node" then
local pointed_node = minetest.get_node(pointed_thing.under)
if minetest.get_item_group(pointed_node.name, "container") > 1
or is_rmb_conflicting_node(pointed_node.name)
or is_node_stack(wielded_stack)
then
if minetest.get_item_group(minetest.get_node(pointed_thing.under).name, "container") > 1 then
return
end
end
@ -304,7 +290,7 @@ local function handle_blocking(player)
return
end
if not_blocking then
minetest.after(0.05, function()
minetest.after(0.25, function()
if (not_blocking or not shield_in_hand) and shield_in_offhand and rmb and offhand_can_block then
player_shield.blocking = 1
set_shield(player, true, 1)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B