From cd66dc28a4cd9836fe0d41ac8e9cb2aac0c312b0 Mon Sep 17 00:00:00 2001 From: Wbjitscool Date: Wed, 22 May 2024 05:18:27 +0000 Subject: [PATCH] Cherry blossom particles improvement (#4258) Co-authored-by: the-real-herowl Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4258 Reviewed-by: the-real-herowl Co-authored-by: Wbjitscool Co-committed-by: Wbjitscool --- mods/ITEMS/mcl_cherry_blossom/growth.lua | 30 +++++++++++++++++++- textures/mcl_cherry_blossom_particle.png | Bin 75 -> 0 bytes textures/mcl_cherry_blossom_particle_1.png | Bin 0 -> 140 bytes textures/mcl_cherry_blossom_particle_10.png | Bin 0 -> 140 bytes textures/mcl_cherry_blossom_particle_11.png | Bin 0 -> 140 bytes textures/mcl_cherry_blossom_particle_12.png | Bin 0 -> 132 bytes textures/mcl_cherry_blossom_particle_2.png | Bin 0 -> 140 bytes textures/mcl_cherry_blossom_particle_3.png | Bin 0 -> 140 bytes textures/mcl_cherry_blossom_particle_4.png | Bin 0 -> 140 bytes textures/mcl_cherry_blossom_particle_5.png | Bin 0 -> 140 bytes textures/mcl_cherry_blossom_particle_6.png | Bin 0 -> 140 bytes textures/mcl_cherry_blossom_particle_7.png | Bin 0 -> 140 bytes textures/mcl_cherry_blossom_particle_8.png | Bin 0 -> 140 bytes textures/mcl_cherry_blossom_particle_9.png | Bin 0 -> 140 bytes 14 files changed, 29 insertions(+), 1 deletion(-) delete mode 100644 textures/mcl_cherry_blossom_particle.png create mode 100644 textures/mcl_cherry_blossom_particle_1.png create mode 100644 textures/mcl_cherry_blossom_particle_10.png create mode 100644 textures/mcl_cherry_blossom_particle_11.png create mode 100644 textures/mcl_cherry_blossom_particle_12.png create mode 100644 textures/mcl_cherry_blossom_particle_2.png create mode 100644 textures/mcl_cherry_blossom_particle_3.png create mode 100644 textures/mcl_cherry_blossom_particle_4.png create mode 100644 textures/mcl_cherry_blossom_particle_5.png create mode 100644 textures/mcl_cherry_blossom_particle_6.png create mode 100644 textures/mcl_cherry_blossom_particle_7.png create mode 100644 textures/mcl_cherry_blossom_particle_8.png create mode 100644 textures/mcl_cherry_blossom_particle_9.png diff --git a/mods/ITEMS/mcl_cherry_blossom/growth.lua b/mods/ITEMS/mcl_cherry_blossom/growth.lua index 28cedea28..bca926539 100644 --- a/mods/ITEMS/mcl_cherry_blossom/growth.lua +++ b/mods/ITEMS/mcl_cherry_blossom/growth.lua @@ -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 diff --git a/textures/mcl_cherry_blossom_particle.png b/textures/mcl_cherry_blossom_particle.png deleted file mode 100644 index eabdb097c9bb031b7c38accb7f28e2c79141f1d1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 75 zcmeAS@N?(olHy`uVBq!ia0vp^%s|Y@!3HFyABb!LQbL|Cjv*Yf$v*a Y2D6(SHS(()tbno%p00i_>zopr07&c;5dZ)H diff --git a/textures/mcl_cherry_blossom_particle_1.png b/textures/mcl_cherry_blossom_particle_1.png new file mode 100644 index 0000000000000000000000000000000000000000..0b789e0714d9b5a5f65486235536dcef03f913f4 GIT binary patch literal 140 zcmeAS@N?(olHy`uVBq!ia0vp^%s?!`!3HGlE#033sbEhR#}J9j$q5cjJ^IeS{}~$? z7!>@Ol;FT>AbE#L{_pg^?h_N8rllUr(zzpG!JNlsmGI}q{x|>mw~0qAG5GSJOvgu4 mm>CGpn5eB0OZvfnG=kw|v2l2k(}5VE@eH1>elF{r5}E+a+$_rg literal 0 HcmV?d00001 diff --git a/textures/mcl_cherry_blossom_particle_10.png b/textures/mcl_cherry_blossom_particle_10.png new file mode 100644 index 0000000000000000000000000000000000000000..a040a3922e58626ba09ed9669975123d7f84a63e GIT binary patch literal 140 zcmeAS@N?(olHy`uVBq!ia0vp^%s?!`!3HGlE#033sbEhR#}J9j$q5cjJ?28w|D`7+ zBm{(qr8=-0NZw)kAMN+oePW{1wA4dcI(GytnDe--68_vTdiDS8?(G{r5?>sA8!;nD mjSUE9Wcozt9{IrEwUJ?2msx30TjOh>@eH1>elF{r5}E+}9WO%w literal 0 HcmV?d00001 diff --git a/textures/mcl_cherry_blossom_particle_11.png b/textures/mcl_cherry_blossom_particle_11.png new file mode 100644 index 0000000000000000000000000000000000000000..a86531ff6bb5c69b0286e764d2bc6f0b9324ef79 GIT binary patch literal 140 zcmeAS@N?(olHy`uVBq!ia0vp^%s?!`!3HGlE#033sbEhR#}J9j$q5cjJ^$B+{ZCIw zNcgc->rew%g3%7vx?}JE_bVN4(K+36HDZTi0oxssk^?`C>;BhoyPdzmBk{$-w-Gaf n)YyPvMy5}M?vW4tT^kwrLrrrbP0l+XkKB+@Zd literal 0 HcmV?d00001 diff --git a/textures/mcl_cherry_blossom_particle_12.png b/textures/mcl_cherry_blossom_particle_12.png new file mode 100644 index 0000000000000000000000000000000000000000..462798e6d3507de1d18ba3629ce532bff82a95c4 GIT binary patch literal 132 zcmeAS@N?(olHy`uVBq!ia0vp^%s?!`!3HGlE#033DQ`~~#}J9j$q5cjJ^yE_{ZCIw zNca($cBp|X!Dt8TzHpiU{Yr;hbWXQijo6`Bz;;KZFVdQ&MBb@0AKem>;M1& literal 0 HcmV?d00001 diff --git a/textures/mcl_cherry_blossom_particle_2.png b/textures/mcl_cherry_blossom_particle_2.png new file mode 100644 index 0000000000000000000000000000000000000000..e646513e02c165a3b58dfa9c8ced62c720a2c06f GIT binary patch literal 140 zcmeAS@N?(olHy`uVBq!ia0vp^%s?!`!3HGlE#033sbEhR#}J9j$q5cjJ@P!y|D`7+ zB>Xt@X*Q$ifs_Jn8?(6|Bk{$-w-Gaf n)YyPvMy5}M?vW4tT^kur+&64Lxbs>O(0B$e$1{uvt> z7<~Br$#4PF44%Bk4%tbv``+>iesKlhJVV({fbnU0U9 nFf$OGF;QD1mh^-DXaqxqhkiK!qc{73#xr=j`njxgN@xNA-DNE3 literal 0 HcmV?d00001 diff --git a/textures/mcl_cherry_blossom_particle_4.png b/textures/mcl_cherry_blossom_particle_4.png new file mode 100644 index 0000000000000000000000000000000000000000..f0440ff1c47bd70983c142ea57f7e5ca0baa9630 GIT binary patch literal 140 zcmeAS@N?(olHy`uVBq!ia0vp^%s?!`!3HGlE#033sbEhR#}J9j$q5cjJ;#4)|1&l) zF!0Bf{>X}H^4RW>@bnXaPFz0buCG2@&^K}1}o%17>7<_q9rsJb2 m%nSr)Ow`thCH-JO8o`hks_$yM;GHPYcm_{bKbLh*2~7Y$kt*f@ literal 0 HcmV?d00001 diff --git a/textures/mcl_cherry_blossom_particle_6.png b/textures/mcl_cherry_blossom_particle_6.png new file mode 100644 index 0000000000000000000000000000000000000000..9f7def63b22b2694013a1fef6112f962f7b560ac GIT binary patch literal 140 zcmeAS@N?(olHy`uVBq!ia0vp^%s?!`!3HGlE#033sbEhR#}J9j$q5cjJ?bV=|BMX` z3^G2RHeA3ogD0=i|5^9H#U~6DPa7qgisf<4VKirzHK;R+|MLIVarcNN245bO>G)_0 mGXudH6SXyBNk7<+MlfXg>ASvI;GzdKp25@A&t;ucLK6ULYAX8x literal 0 HcmV?d00001 diff --git a/textures/mcl_cherry_blossom_particle_7.png b/textures/mcl_cherry_blossom_particle_7.png new file mode 100644 index 0000000000000000000000000000000000000000..bce32f7962bbfeb71ecd5737a7d557520aab2234 GIT binary patch literal 140 zcmeAS@N?(olHy`uVBq!ia0vp^%s?!`!3HGlE#033sbEhR#}J9j$q5cjJ>N~#{-q}* zBnTJ>Bsj1dNZw(JS2FwOJ~7d0TI!)JojU>+%z0c^34eq(e*C|hn}35x;){cCBW47t mu>rx1OrHqdBOmy?HZr{ZYg$}{WCT& zFyNS}ZM1-C22Wn&^OdjvFFs+Qc-kn@R4k8U4x>4%tbv_>?En9FPyUWrV({fbnU0U9 mFf$OGF;QD1mh^-DXavJCMZelF{r5}E+g5G&>Y literal 0 HcmV?d00001