From 7c0c0d4d0c17c7b4d57e1fef32f907c2a97a41f0 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 19 Aug 2020 17:37:41 +0200 Subject: [PATCH] Change particle for instant effects --- .../textures/mcl_particles_crit.png | Bin 128 -> 127 bytes .../textures/mcl_particles_droplet_bottle.png | Bin 164 -> 91 bytes .../textures/mcl_particles_instant_effect.png | Bin 0 -> 125 bytes mods/ITEMS/mcl_potions/lingering.lua | 10 ++++++++-- mods/ITEMS/mcl_potions/potions.lua | 14 ++++++++++++++ mods/ITEMS/mcl_potions/splash.lua | 6 +++++- 6 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 mods/CORE/mcl_particles/textures/mcl_particles_instant_effect.png diff --git a/mods/CORE/mcl_particles/textures/mcl_particles_crit.png b/mods/CORE/mcl_particles/textures/mcl_particles_crit.png index 5b7fd3f6ef29a02c38e25dfd323c8a905b59abd2..25d5615b292b0a929c40869a6222b01ca2aeb8ce 100644 GIT binary patch delta 79 zcmZo*te;@!Y2xYP7*fHQe1JXe{Jhw>IKJmhHys2uUf=4$rBm(iTt4jB!Tc_Oa>tEboFyt=akR{0JFVdQ&MBb@09Jz&O8@`> delta 135 zcma!E!Z<;to-N7S-GxD&A&{YgE2aMo0|NtRfk$L90|U1(2s1Lwnj--eWH0gbb!C6T zA~*2NZap+L;;}&g7k( kyy(cQkQFDJSs56trwj17|LAf9YG&|s^>bP0l)%^o01q}Py#N3J diff --git a/mods/CORE/mcl_particles/textures/mcl_particles_instant_effect.png b/mods/CORE/mcl_particles/textures/mcl_particles_instant_effect.png new file mode 100644 index 0000000000000000000000000000000000000000..bae450282c44fee7f70ac6b96b2937bc645c280b GIT binary patch literal 125 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1SGw4HSYi^wvr&fU?2?ydCS-*0x2U;7srqa z#^eL+Y3Jwl20yv6G5P7!rw(irST-$ORA3jN=)$_|+xqzZPCSZBm@o6ytYc!hCakYe S{@<<}WQwP&pUXO@geCw;wInwH literal 0 HcmV?d00001 diff --git a/mods/ITEMS/mcl_potions/lingering.lua b/mods/ITEMS/mcl_potions/lingering.lua index cb327accc4..bfeff88f60 100644 --- a/mods/ITEMS/mcl_potions/lingering.lua +++ b/mods/ITEMS/mcl_potions/lingering.lua @@ -10,7 +10,7 @@ end local lingering_effect_at = {} -local function add_lingering_effect(pos, color, def, is_water) +local function add_lingering_effect(pos, color, def, is_water, instant) lingering_effect_at[pos] = {color = color, timer = 30, def = def, is_water = is_water} @@ -30,6 +30,8 @@ minetest.register_globalstep(function(dtime) local texture if vals.is_water then texture = "mcl_particles_droplet_bottle.png" + elseif vals.def.instant then + texture = "mcl_particles_instant_effect.png" else texture = "mcl_particles_effect.png" end @@ -145,7 +147,11 @@ minetest.register_entity(id.."_flying",{ minacc = {x=-0.2, y=-0.05, z=-0.2} maxacc = {x=0.2, y=0.05, z=0.2} else - texture = "mcl_particles_effect.png" + if def.instant then + texture = "mcl_particles_instant_effect.png" + else + texture = "mcl_particles_effect.png" + end minacc = {x=-0.2, y=0, z=-0.2} maxacc = {x=0.2, y=.05, z=0.2} end diff --git a/mods/ITEMS/mcl_potions/potions.lua b/mods/ITEMS/mcl_potions/potions.lua index 8b73803021..9202196a8a 100644 --- a/mods/ITEMS/mcl_potions/potions.lua +++ b/mods/ITEMS/mcl_potions/potions.lua @@ -177,6 +177,7 @@ local function register_potion(def) longdesc = def._longdesc, potion_fun = get_splash_fun(def.effect, splash_dur), no_effect = def.no_effect, + instant = def.instant, } local ling_def @@ -186,6 +187,7 @@ local function register_potion(def) longdesc = def._longdesc, potion_fun = get_lingering_fun(def.effect*mcl_potions.LINGERING_FACTOR, ling_dur), no_effect = def.no_effect, + instant = def.instant, } else ling_def = { @@ -193,6 +195,7 @@ local function register_potion(def) longdesc = def._longdesc, potion_fun = get_lingering_fun(def.effect, ling_dur), no_effect = def.no_effect, + instant = def.instant, } end @@ -201,6 +204,7 @@ local function register_potion(def) longdesc = def._longdesc, potion_fun = get_arrow_fun(def.effect, dur/8.), no_effect = def.no_effect, + instant = def.instant, } if def.color and not def.no_throwable then @@ -270,6 +274,7 @@ local function register_potion(def) longdesc = def._longdesc, potion_fun = get_splash_fun(7, splash_dur_2), no_effect = def.no_effect, + instant = def.instant, } else splash_def_2 = { @@ -277,6 +282,7 @@ local function register_potion(def) longdesc = def._longdesc, potion_fun = get_splash_fun(effect_II, splash_dur_2), no_effect = def.no_effect, + instant = def.instant, } end @@ -288,6 +294,7 @@ local function register_potion(def) longdesc = def._longdesc, potion_fun = get_lingering_fun(effect_II*mcl_potions.LINGERING_FACTOR, ling_dur_2), no_effect = def.no_effect, + instant = def.instant, } else ling_def_2 = { @@ -295,6 +302,7 @@ local function register_potion(def) longdesc = def._longdesc, potion_fun = get_lingering_fun(effect_II, ling_dur_2), no_effect = def.no_effect, + instant = def.instant, } end @@ -303,6 +311,7 @@ local function register_potion(def) longdesc = def._longdesc, potion_fun = get_arrow_fun(effect_II, dur_2/8.), no_effect = def.no_effect, + instant = def.instant, } if def.color and not def.no_throwable then @@ -346,18 +355,21 @@ local function register_potion(def) longdesc = def._longdesc, potion_fun = get_splash_fun(def.effect, splash_dur_pl), no_effect = def.no_effect, + instant = def.instant, } local ling_def_pl = { tt = get_tt(def._tt_plus, def.effect, ling_dur_pl), longdesc = def._longdesc, potion_fun = get_lingering_fun(def.effect, ling_dur_pl), no_effect = def.no_effect, + instant = def.instant, } local arrow_def_pl = { tt = get_tt(def._tt_pl, def.effect, dur_pl/8.), longdesc = def._longdesc, potion_fun = get_arrow_fun(def.effect, dur_pl/8.), no_effect = def.no_effect, + instant = def.instant, } if def.color and not def.no_throwable then mcl_potions.register_splash(def.name.."_plus", S("Splash @1 + Potion", def.description), def.color, splash_def_pl) @@ -449,6 +461,7 @@ local healing_def = { _longdesc = S("Instantly heals."), color = "#CC0000", effect = 4, + instant = true, on_use = mcl_potions.healing_func, is_II = true, } @@ -462,6 +475,7 @@ local harming_def = { _longdesc = S("Instantly deals damage."), color = "#660099", effect = -6, + instant = true, on_use = mcl_potions.healing_func, is_II = true, is_inv = true, diff --git a/mods/ITEMS/mcl_potions/splash.lua b/mods/ITEMS/mcl_potions/splash.lua index fb47ebd8a0..14c7f455e4 100644 --- a/mods/ITEMS/mcl_potions/splash.lua +++ b/mods/ITEMS/mcl_potions/splash.lua @@ -71,7 +71,11 @@ function mcl_potions.register_splash(name, descr, color, def) texture = "mcl_particles_droplet_bottle.png" acc = {x=0, y=-GRAVITY, z=0} else - texture = "mcl_particles_effect.png" + if def.instant then + texture = "mcl_particles_instant_effect.png" + else + texture = "mcl_particles_effect.png" + end acc = {x=0, y=0, z=0} end minetest.add_particlespawner({