From b17f526929190929225abad95ab867dfeadbda13 Mon Sep 17 00:00:00 2001 From: reidlab Date: Sun, 2 Mar 2025 01:16:33 -0800 Subject: [PATCH 1/3] update version --- README.md | 4 +++- avatar.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 18b8b2c..78b4466 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,11 @@ # figura-skin -my figura avatar!! this currently targets version **0.14** +my figura avatar!! this currently targets version **0.15** `textures/vanilla.png` contains the skins base, which can be used as your default minecraft skin if you so choose ## development to get proper typings, find the correct branch for your figura version [on this repository](github.com/GrandpaScout/FiguraRewriteVSDocs/). then, copy everything from the `src/` folder into your current working folder here + +unfortunately, 0.15 typings aren't done yet, so just make sure it works :) diff --git a/avatar.json b/avatar.json index 119b9ca..09b5a3c 100644 --- a/avatar.json +++ b/avatar.json @@ -7,6 +7,6 @@ "purpledeni + Manuel_: Gradient Scroll Nickname" ], "color": "#d87b5a", - "version": "0.1.4", + "version": "0.1.5", "autoScripts": [ "scripts/main.lua" ] } From fc31f49d3f75bff94ece2b1d6c108e770a0782e8 Mon Sep 17 00:00:00 2001 From: reidlab Date: Sun, 2 Mar 2025 01:23:56 -0800 Subject: [PATCH 2/3] oops. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 78b4466..a957cc6 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ my figura avatar!! this currently targets version **0.15** -`textures/vanilla.png` contains the skins base, which can be used as your default minecraft skin if you so choose +`textures/main.png` contains the skins base, which can be used as your default minecraft skin if you so choose ## development From 220e7a04b7730b830439ab65b75cff6210257ece Mon Sep 17 00:00:00 2001 From: reidlab Date: Sun, 2 Mar 2025 01:51:50 -0800 Subject: [PATCH 3/3] i feel so soggy! --- avatar.json | 3 ++- scripts/libs/utils.lua | 17 +++++++++++++++++ scripts/main.lua | 1 + scripts/soggy.lua | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 scripts/libs/utils.lua create mode 100644 scripts/soggy.lua diff --git a/avatar.json b/avatar.json index 09b5a3c..4802630 100644 --- a/avatar.json +++ b/avatar.json @@ -4,7 +4,8 @@ "authors": [ "reidlab", "mrsirsquishy: Squishy's API", - "purpledeni + Manuel_: Gradient Scroll Nickname" + "purpledeni + Manuel_: Gradient Scroll Nickname", + "adristel: Wet Clothes/Fur Script" ], "color": "#d87b5a", "version": "0.1.5", diff --git a/scripts/libs/utils.lua b/scripts/libs/utils.lua new file mode 100644 index 0000000..5bd6bd7 --- /dev/null +++ b/scripts/libs/utils.lua @@ -0,0 +1,17 @@ +local module = {} + +--- @param model ModelPart +--- @param func fun(model: ModelPart) +function module.forEachNonGroup(model, func) + if model:getType() == "GROUP" then + for _, child in pairs(model:getChildren()) do + module.forEachNonGroup(child, func) + end + end + + if model:getType() == "CUBE" or model:getType() == "MESH" then + func(model) + end +end + +return module diff --git a/scripts/main.lua b/scripts/main.lua index 8d64bcc..6cf20ea 100644 --- a/scripts/main.lua +++ b/scripts/main.lua @@ -3,4 +3,5 @@ events.ENTITY_INIT:register(function () require("scripts.tail_physics") require("scripts.ear_physics") require("scripts.nameplate") + require("scripts.soggy") end) diff --git a/scripts/soggy.lua b/scripts/soggy.lua new file mode 100644 index 0000000..3367573 --- /dev/null +++ b/scripts/soggy.lua @@ -0,0 +1,35 @@ +local utils = require("scripts.libs.utils") + +local tw = 1 --top wetness --wet effect +local bw = 1 --bottom wetness +local driptime = 4 --recommended to change based on how low you have TW/BW + +local offset = vec(0,0,0) +local offset2 = vec(0,0,0) +events.TICK:register(function () + if player:isInRain() then --makes clothes wet if in rain + tw = tw - 0.005 + bw = bw - 0.005 + if tw <= 0.6 then tw = 0.6 end + if bw <= 0.6 then bw = 0.6 end + end + offset = vec((math.random()-0.5), math.random(), (math.random()-0.5)) --random offset of particles + offset2 = vec(math.random(-1,1),math.random(-1,1),math.random(-1,1)) -- velocity + if player:isInWater() then bw = 0.6 end --if player is standing in water, make bottom clothes wet + if player:isUnderwater() then tw = 0.6 end --if player is submerged in water, make top clothes wet + if not player:isUnderwater() and tw ~= 1 and not player:isInRain() then tw = tw + 0.005 end --if not submerged in water, dry top clothes + if not player:isInWater() and bw ~= 1 and not player:isInRain() then bw = bw + 0.005 end --if not standing in water, dry bottom clothes + if bw >= 1 then bw = 1 end + if tw >= 1 then tw = 1 end + if world.getTime() % driptime == 0 and tw ~= 1 and not (player:isUnderwater()) then for _ = 0, driptime*0.5 do particles:newParticle("falling_dripstone_water",player:getPos():add(offset+vec(0,0.7,0)),offset2) end end + if world.getTime() % driptime == 0 and bw ~= 1 and not (player:isInWater()) then for _ = 0, driptime*0.5 do particles:newParticle("falling_dripstone_water",player:getPos():add(offset),offset2:mul(0.5)) end end + + + utils.forEachNonGroup(models.models.main.LeftArm, function (part) part:setColor(tw,tw,tw) end) + utils.forEachNonGroup(models.models.main.RightArm, function (part) part:setColor(tw,tw,tw) end) + utils.forEachNonGroup(models.models.main.Head, function (part) part:setColor(tw,tw,tw) end) + utils.forEachNonGroup(models.models.main.Body, function (part) part:setColor(tw,tw,tw) end) + + utils.forEachNonGroup(models.models.main.LeftLeg, function (part) part:setColor(bw,bw,bw) end) + utils.forEachNonGroup(models.models.main.RightLeg, function (part) part:setColor(bw,bw,bw) end) +end)