Skip to content

Commit

Permalink
パーティクルの互換性チェック
Browse files Browse the repository at this point in the history
  • Loading branch information
Gakuto1112 committed Oct 11, 2024
1 parent 92daf92 commit ca8a6cf
Show file tree
Hide file tree
Showing 15 changed files with 30 additions and 30 deletions.
4 changes: 2 additions & 2 deletions scripts/actions/broom_cleaning.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ BroomCleaning = General.instance({
models.models.broom_cleaning.Dust:setOpacity(models.models.broom_cleaning.Dust:getOpacity() - 0.14)
local dustParticlePivot = models.models.broom_cleaning.Dust.DustParticlePivot:partToWorldMatrix()
for _ = 1, 5 do
particles:newParticle("block gravel", dustParticlePivot[4][1], dustParticlePivot[4][2], dustParticlePivot[4][3])
particles:newParticle(CompatibilityUtils.getBlockParticleId(CompatibilityUtils:checkBlock("minecraft:gravel")), dustParticlePivot[4][1], dustParticlePivot[4][2], dustParticlePivot[4][3])
end
elseif self.AnimationCount == 41 then
FaceParts.setEmotion("CLOSED", "CLOSED", "OPENED", 40, true)
local playerPos = player:getPos()
sounds:playSound("entity.player.levelup", playerPos, 1, 1.5)
for _ = 1, 30 do
particles:newParticle("happy_villager", playerPos:copy():add((math.random() - 0.5) * 4, (math.random() - 0.5) * 4 + 1, (math.random() - 0.5) * 4))
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:happy_villager"), playerPos:copy():add((math.random() - 0.5) * 4, (math.random() - 0.5) * 4 + 1, (math.random() - 0.5) * 4))
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion scripts/actions/cloth_cleaning.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ClothCleaning = General.instance({
local playerPos = player:getPos()
sounds:playSound("entity.player.levelup", playerPos, 1, 1.5)
for _ = 1, 30 do
particles:newParticle("happy_villager", playerPos:copy():add((math.random() - 0.5) * 4, (math.random() - 0.5) * 4 + 1, (math.random() - 0.5) * 4))
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:happy_villager"), playerPos:copy():add((math.random() - 0.5) * 4, (math.random() - 0.5) * 4 + 1, (math.random() - 0.5) * 4))
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions scripts/actions/ear_cuddling.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ EarCuddling = General.instance({
end
local playerPos = player:getPos()
for _ = 1, 5 do
particles:newParticle("minecraft:end_rod", playerPos:copy():add((math.random() - 0.5) * 10, (math.random() - 0.5) * 10, (math.random() - 0.5) * 10))
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:end_rod"), playerPos:copy():add((math.random() - 0.5) * 10, (math.random() - 0.5) * 10, (math.random() - 0.5) * 10))
end
elseif self.AnimationCount == 132 then
FaceParts.setEmotion("SURPLISED", "SURPLISED", "OPENED", 30, true)
Expand All @@ -49,7 +49,7 @@ EarCuddling = General.instance({
FaceParts.setEmotion("TEAR", "TEAR", "NONE", 60, true)
local playerPos = player:getPos()
for _ = 1, 30 do
particles:newParticle("angry_villager", playerPos:copy():add((math.random() - 0.5) * 4, (math.random() - 0.5) * 4 + 1, (math.random() - 0.5) * 4))
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:angry_villager"), playerPos:copy():add((math.random() - 0.5) * 4, (math.random() - 0.5) * 4 + 1, (math.random() - 0.5) * 4))
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions scripts/actions/earpick.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ Earpick = General.instance({
AnimationAction.onAnimationTick(self)
local playerPos = player:getPos()
for _ = 1, 5 do
particles:newParticle("end_rod", playerPos:copy():add((math.random() - 0.5) * 10, (math.random() - 0.5) * 10, (math.random() - 0.5) * 10))
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:end_rod"), playerPos:copy():add((math.random() - 0.5) * 10, (math.random() - 0.5) * 10, (math.random() - 0.5) * 10))
end
if self.AnimationCount == 184 then
FaceParts.setEmotion("CLOSED", "CLOSED", "CLOSED", 40, true)
elseif self.AnimationCount == 41 then
FaceParts.setEmotion("CLOSED", "CLOSED", "OPENED", 40, true)
sounds:playSound("entity.player.levelup", playerPos, 1, 1.5)
for _ = 1, 30 do
particles:newParticle("happy_villager", playerPos:copy():add((math.random() - 0.5) * 4, (math.random() - 0.5) * 4 + 1, (math.random() - 0.5) * 4))
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:happy_villager"), playerPos:copy():add((math.random() - 0.5) * 4, (math.random() - 0.5) * 4 + 1, (math.random() - 0.5) * 4))
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion scripts/actions/fox_jump.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ FoxJump = General.instance({
elseif self.AnimationCount == 87 or (self.AnimationCount <= 83 and self.AnimationCount >= 32 and (self.AnimationCount - 83) % 3 == 0) or self.AnimationCount == 18 then
sounds:playSound("block.snow.break", player:getPos(), 1, 1)
for _ = 1, 5 do
particles:newParticle("block minecraft:snow_block", FoxJump.TargetPos)
particles:newParticle(CompatibilityUtils.getBlockParticleId(CompatibilityUtils:checkBlock("minecraft:snow")), FoxJump.TargetPos)
end
if self.AnimationCount == 87 then
FaceParts.setEmotion("UNEQUAL", "UNEQUAL", "CLOSED", 69, true)
Expand Down
8 changes: 4 additions & 4 deletions scripts/actions/hair_cut.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ HairCut = General.instance({
if self.AnimationCount > 296 or self.AnimationCount <= 206 then
local playerPos = player:getPos()
for _ = 1, 5 do
particles:newParticle("end_rod", playerPos:copy():add((math.random() - 0.5) * 10, (math.random() - 0.5) * 10, (math.random() - 0.5) * 10))
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:end_rod"), playerPos:copy():add((math.random() - 0.5) * 10, (math.random() - 0.5) * 10, (math.random() - 0.5) * 10))
end
end
if self.AnimationCount <= 468 and self.AnimationCount >= 398 and (self.AnimationCount - 468) % 15 == 0 then
sounds:playSound("entity.cat.hiss", player:getPos(), 0.25, 2)
local splashPos = vectors.rotateAroundAxis(-(player:getBodyYaw() % 360), 0, 0, 0.3, 0, 1):add(player:getPos():add(0, 1))
for _ = 1, 5 do
particles:newParticle("splash", splashPos)
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:splash"), splashPos)
end
elseif self.AnimationCount == 383 then
for _, modelPart in ipairs({models.models.main.Avatar.UpperBody.Arms.RightArm.RightArmBottom.HairCutRAB.Spray, models.models.main.Avatar.UpperBody.Arms.LeftArm.LeftArmBottom.HairCutLAB.Comb}) do
Expand All @@ -48,7 +48,7 @@ HairCut = General.instance({
elseif self.AnimationCount == 296 then
local playerPos = player:getPos()
for _ = 1, 30 do
particles:newParticle("smoke", playerPos:copy():add((math.random() - 0.5) * 2, (math.random() - 0.5) * 2 + 1, (math.random() - 0.5) * 2))
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:smoke"), playerPos:copy():add((math.random() - 0.5) * 2, (math.random() - 0.5) * 2 + 1, (math.random() - 0.5) * 2))
end
sounds:playSound("entity.sheep.shear", player:getPos(), 1, 1)
FaceParts.setEmotion("SURPLISED", "SURPLISED", "CLOSED", 60, false)
Expand All @@ -69,7 +69,7 @@ HairCut = General.instance({
local playerPos = player:getPos()
sounds:playSound("entity.player.levelup", playerPos, 1, 1.5)
for _ = 1, 30 do
particles:newParticle("happy_villager", playerPos:copy():add((math.random() - 0.5) * 4, (math.random() - 0.5) * 4 + 1, (math.random() - 0.5) * 4))
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:happy_villager"), playerPos:copy():add((math.random() - 0.5) * 4, (math.random() - 0.5) * 4 + 1, (math.random() - 0.5) * 4))
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions scripts/actions/massage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ Massage = General.instance({
AnimationAction.onAnimationTick(self)
local playerPos = player:getPos()
for _ = 1, 5 do
particles:newParticle("end_rod", playerPos:copy():add((math.random() - 0.5) * 10, (math.random() - 0.5) * 10, (math.random() - 0.5) * 10))
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:end_rod"), playerPos:copy():add((math.random() - 0.5) * 10, (math.random() - 0.5) * 10, (math.random() - 0.5) * 10))
end
if (self.AnimationCount <= 403 and self.AnimationCount >= 373 and (self.AnimationCount - 403) % 15 == 0) or (self.AnimationCount <= 341 and self.AnimationCount >= 311 and (self.AnimationCount - 341) % 15 == 0) or (self.AnimationCount <= 279 and self.AnimationCount >= 249 and (self.AnimationCount - 279) % 15 == 0) or (self.AnimationCount <= 151 and self.AnimationCount >= 59 and (self.AnimationCount - 151) % 8 == 0) then
sounds:playSound("block.wool.step", player:getPos(), 0.5, 1)
if self.AnimationCount == 95 then
FaceParts.setEmotion("CLOSED", "CLOSED", "OPENED", 40, true)
sounds:playSound("entity.player.levelup", playerPos, 1, 1.5)
for _ = 1, 30 do
particles:newParticle("happy_villager", playerPos:copy():add((math.random() - 0.5) * 4, (math.random() - 0.5) * 4 + 1, (math.random() - 0.5) * 4))
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:happy_villager"), playerPos:copy():add((math.random() - 0.5) * 4, (math.random() - 0.5) * 4 + 1, (math.random() - 0.5) * 4))
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion scripts/actions/refuse_emote.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ RefuseEmote = General.instance({
AnimationAction.onAnimationTick(self)
if self.AnimationCount % 5 == 0 then
for _ = 1, 4 do
particles:newParticle("splash", player:getPos():add(0, 2))
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:splash"), player:getPos():add(0, 2))
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions scripts/actions/shake_body.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ ShakeBody = General.instance({
if self.AnimationCount % 5 == 0 then
if ShakeBody.SnowParticle then
for _ = 1, 6 do
particles:newParticle("block snow_block", player:getPos():add(math.random() - 0.5, math.random() + 0.5, math.random() - 0.5))
particles:newParticle(CompatibilityUtils.getBlockParticleId(CompatibilityUtils:checkBlock("minecraft:snow_block")), player:getPos():add(math.random() - 0.5, math.random() + 0.5, math.random() - 0.5))
end
elseif not Wet.IsWet and Wet.WetCount > 0 then
for _ = 1, 4 do
particles:newParticle("splash", player:getPos():add(math.random() - 0.5, math.random() + 0.5, math.random() - 0.5))
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:splash"), player:getPos():add(math.random() - 0.5, math.random() + 0.5, math.random() - 0.5))
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion scripts/actions/smile.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Smile = General.instance({
local playerPos = player:getPos()
sounds:playSound("entity.player.levelup", playerPos, 1, 1.5)
for _ = 1, 30 do
particles:newParticle("happy_villager", playerPos:copy():add((math.random() - 0.5) * 4, (math.random() - 0.5) * 4 + 1, (math.random() - 0.5) * 4))
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:happy_villager"), playerPos:copy():add((math.random() - 0.5) * 4, (math.random() - 0.5) * 4 + 1, (math.random() - 0.5) * 4))
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions scripts/actions/tail_cuddling.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ TailCuddling = General.instance({
if self.AnimationCount <= 270 and self.AnimationCount >= 20 then
local playerPos = player:getPos()
for _ = 1, 5 do
particles:newParticle("minecraft:end_rod", playerPos:copy():add((math.random() - 0.5) * 10, (math.random() - 0.5) * 10, (math.random() - 0.5) * 10))
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:end_rod"), playerPos:copy():add((math.random() - 0.5) * 10, (math.random() - 0.5) * 10, (math.random() - 0.5) * 10))
end
end
if self.AnimationCount == 370 then
Expand Down Expand Up @@ -54,7 +54,7 @@ TailCuddling = General.instance({
local playerPos = player:getPos()
sounds:playSound("minecraft:entity.player.levelup", playerPos, 1, 1.5)
for _ = 1, 30 do
particles:newParticle("minecraft:happy_villager", playerPos:copy():add((math.random() - 0.5) * 4, (math.random() - 0.5) * 4 + 1, (math.random() - 0.5) * 4))
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:happy_villager"), playerPos:copy():add((math.random() - 0.5) * 4, (math.random() - 0.5) * 4 + 1, (math.random() - 0.5) * 4))
end
elseif self.AnimationCount == 20 then
models.models.dummy_player:setVisible(false)
Expand Down
6 changes: 3 additions & 3 deletions scripts/actions/tea_time.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ TeaTime = General.instance({
onAnimationTick = function (self)
AnimationAction.onAnimationTick(self)
local yunomi2ParticlePivot = models.models.tea.Table.TableItems.Yunomi2.Yunomi2ParticlePivot:partToWorldMatrix()
particles:newParticle("poof", yunomi2ParticlePivot[4][1], yunomi2ParticlePivot[4][2], yunomi2ParticlePivot[4][3]):scale(0.2):velocity(0, 0, 0):lifetime(15)
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:poof"), yunomi2ParticlePivot[4][1], yunomi2ParticlePivot[4][2], yunomi2ParticlePivot[4][3]):scale(0.2):velocity(0, 0, 0):lifetime(15)
if self.AnimationCount > 50 then
local yunomi1ParticlePivot = models.models.main.Avatar.UpperBody.Body.Yunomi1.Yunomi1ParticlePivot:partToWorldMatrix()
particles:newParticle("poof", yunomi1ParticlePivot[4][1], yunomi1ParticlePivot[4][2], yunomi1ParticlePivot[4][3]):scale(0.2):velocity(0, 0, 0):lifetime(15)
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:poof"), yunomi1ParticlePivot[4][1], yunomi1ParticlePivot[4][2], yunomi1ParticlePivot[4][3]):scale(0.2):velocity(0, 0, 0):lifetime(15)
end
if self.AnimationCount <= 210 and self.AnimationCount > 50 and (self.AnimationCount - 210) % 20 == 0 then
if self.AnimationCount == 210 then
Expand All @@ -36,7 +36,7 @@ TeaTime = General.instance({
sounds:playSound("entity.player.levelup", playerPos, 1, 1.5)
sounds:playSound("block.stone.break", player:getPos(), 0.5, 1)
for _ = 1, 30 do
particles:newParticle("happy_villager", playerPos:copy():add((math.random() - 0.5) * 4, (math.random() - 0.5) * 4 + 1, (math.random() - 0.5) * 4))
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:happy_villager"), playerPos:copy():add((math.random() - 0.5) * 4, (math.random() - 0.5) * 4 + 1, (math.random() - 0.5) * 4))
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion scripts/actions/vacuum_cleaning.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ VacuumCleaning = General.instance({
end
sounds:playSound("entity.minecart.riding", player:getPos(), 0.25, 2)
local exhaustParticlePivot = models.models.vacuum_cleaning.VeccumCleaner.ExhaustParticlePivot:partToWorldMatrix()
particles:newParticle("poof", exhaustParticlePivot[4][1], exhaustParticlePivot[4][2], exhaustParticlePivot[4][3]):scale(0.3)
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:poof"), exhaustParticlePivot[4][1], exhaustParticlePivot[4][2], exhaustParticlePivot[4][3]):scale(0.3)
elseif self.AnimationCount == 148 then
models.models.vacuum_cleaning:setVisible(false)
sounds:playSound("entity.item.pickup", player:getPos(), 1, 0.5)
Expand Down
10 changes: 5 additions & 5 deletions scripts/fox_fire/fox_fire.lua
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ FoxFire = {
table.remove(self.IsLit, 1)
end
if self.IsLit[2] ~= self.IsLit[1] and self.Phase == "NORMAL" then
sounds:playSound(self.IsLit[2] and "minecraft:item.firecharge.use" or "minecraft:block.fire.extinguish", self.FoxFireModel:getPos():scale(0.0625), 0.25, 2)
sounds:playSound(CompatibilityUtils:checkParticle(self.IsLit[2] and "minecraft:item.firecharge.use" or "minecraft:block.fire.extinguish"), self.FoxFireModel:getPos():scale(0.0625), 0.25, 2)
end
if self.ModelScale > 0 then
self.IsAboveSoudBlock = false
Expand All @@ -129,17 +129,17 @@ FoxFire = {
if self.IsAboveSoudBlock then
for _ = 1, 5 do
local offsetPos = vectors.vec3(math.random() * 0.375 - 0.1875, math.random() * 0.375 - 0.0625, math.random() * 0.375 - 0.1875)
particles:newParticle("minecraft:soul_fire_flame", particlePos:copy():add(offsetPos)):setVelocity(offsetPos:copy():scale(0.05))
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:soul_fire_flame"), particlePos:copy():add(offsetPos)):setVelocity(offsetPos:copy():scale(0.05))
end
else
particles:newParticle("minecraft:soul_fire_flame", particlePos:copy():add(math.random() * 0.375 - 0.1875, math.random() * 0.375 - 0.0625, math.random() * 0.375 - 0.1875))
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:soul_fire_flame"), particlePos:copy():add(math.random() * 0.375 - 0.1875, math.random() * 0.375 - 0.0625, math.random() * 0.375 - 0.1875))
end
self.FrameParticleCount = math.random(4, 8)
end
if world.getRainGradient() > 0 and world.isOpenSky(particlePos) then
self.SmokeParticleCount = self.SmokeParticleCount - 1
if self.SmokeParticleCount == 0 then
particles:newParticle("minecraft:smoke", particlePos:copy():add(math.random() * 0.25 - 0.125, math.random() * 0.25 + 0.125, math.random() * 0.375 - 0.1875))
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:smoke"), particlePos:copy():add(math.random() * 0.25 - 0.125, math.random() * 0.25 + 0.125, math.random() * 0.375 - 0.1875))
self.SmokeParticleCount = 2
end
end
Expand Down Expand Up @@ -177,7 +177,7 @@ FoxFire = {
if self.ModelScale == 0 and ModelScalePrev > 0 then
local particlePos = self.FoxFireModel:getPos():scale(0.0625)
for _ = 1, 3 do
particles:newParticle("minecraft:smoke", particlePos:copy():add(math.random() * 0.25 - 0.125, math.random() * 0.25 + 0.125, math.random() * 0.375 - 0.1875))
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:smoke"), particlePos:copy():add(math.random() * 0.25 - 0.125, math.random() * 0.25 + 0.125, math.random() * 0.375 - 0.1875))
end
end
if self.FlickerCount >= 0 then
Expand Down
2 changes: 1 addition & 1 deletion scripts/wet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ events.TICK:register(function()
elseif Wet.WetCount > 0 then
if Wet.WetCount % 5 == 0 then
for _ = 1, math.min(avatar:getMaxParticles() / 4 , 4) * math.ceil(Wet.WetCount / 300) / 4 do
particles:newParticle("minecraft:falling_water", playerPos.x + math.random() - 0.5, playerPos.y + math.random() + 0.5, playerPos.z + math.random() - 0.5)
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:falling_water"), playerPos.x + math.random() - 0.5, playerPos.y + math.random() + 0.5, playerPos.z + math.random() - 0.5)
end
end
Ears.setEarsRot("DROOPING", 1, true)
Expand Down

0 comments on commit ca8a6cf

Please sign in to comment.