Skip to content

Commit

Permalink
クラス名を変更
Browse files Browse the repository at this point in the history
  • Loading branch information
Gakuto1112 committed Aug 4, 2024
1 parent 2cca2c4 commit a77927b
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 46 deletions.
6 changes: 3 additions & 3 deletions scripts/action_wheel/action_wheel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,19 @@ if host:isHost() then
pings.action_wheel_main_action2_changeName(selectingNameState, selectingShowClubName)
Config.saveConfig("name", selectingNameState)
Config.saveConfig("showClubName", selectingShowClubName)
sounds:playSound(NameUtils:checkSound("minecraft:ui.cartography_table.take_result"), player:getPos())
sounds:playSound(CompatibilityUtils:checkSound("minecraft:ui.cartography_table.take_result"), player:getPos())
print(Language:getTranslate("action_wheel__main__action_2__done_first")..Nameplate:getName(selectingNameState)..Language:getTranslate("action_wheel__main__action_2__done_last"))
end
if selectingCostume ~= Costume.CurrentCostume then
pings.action_wheel_main_action1_changeCostume(selectingCostume)
Config.saveConfig("costume", selectingCostume)
sounds:playSound(NameUtils:checkSound("minecraft:item.armor.equip_leather"), player:getPos())
sounds:playSound(CompatibilityUtils:checkSound("minecraft:item.armor.equip_leather"), player:getPos())
print(Language:getTranslate("action_wheel__main__action_1__done_first")..Costume.getCostumeLocalName(selectingCostume)..Language:getTranslate("action_wheel__main__action_1__done_last"))
end
if selectingExSkillFrameParticleAmount ~= ExSkill.FrameParticleAmount then
ExSkill.FrameParticleAmount = selectingExSkillFrameParticleAmount
Config.saveConfig("ex_skill_frame_particle_amount", selectingExSkillFrameParticleAmount)
sounds:playSound(NameUtils:checkSound("minecraft:entity.item.pickup"), player:getPos(), 1, 0.5)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.item.pickup"), player:getPos(), 1, 0.5)
print(Language:getTranslate("action_wheel__main__action_5__done_first")..Language:getTranslate("action_wheel__main__action_5__option_"..selectingExSkillFrameParticleAmount)..Language:getTranslate("action_wheel__main__action_5__done_last"))
end
end
Expand Down
4 changes: 2 additions & 2 deletions scripts/armor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Armor = {

---前ティックの防具スロットのアイテム
---@type ItemStack[]
ArmorSlotItemsPrev = {world.newItem(NameUtils:checkItem("minecraft:air")), world.newItem(NameUtils:checkItem("minecraft:air")), world.newItem(NameUtils:checkItem("minecraft:air")), world.newItem(NameUtils:checkItem("minecraft:air"))},
ArmorSlotItemsPrev = {world.newItem(CompatibilityUtils:checkItem("minecraft:air")), world.newItem(CompatibilityUtils:checkItem("minecraft:air")), world.newItem(CompatibilityUtils:checkItem("minecraft:air")), world.newItem(CompatibilityUtils:checkItem("minecraft:air"))},

---各防具の部位(ヘルメット、チェストプイート、レギンス、ブーツ)が可視状態かどうか。
---@type boolean[]
Expand Down Expand Up @@ -198,7 +198,7 @@ Armor = {
---@param self Armor
init = function (self)
events.TICK:register(function ()
local armorSlotItems = self.ShowArmor and {player:getItem(6), player:getItem(5), player:getItem(4), player:getItem(3)} or {world.newItem(NameUtils:checkItem("minecraft:air")), world.newItem(NameUtils:checkItem("minecraft:air")), world.newItem(NameUtils:checkItem("minecraft:air")), world.newItem(NameUtils:checkItem("minecraft:air"))}
local armorSlotItems = self.ShowArmor and {player:getItem(6), player:getItem(5), player:getItem(4), player:getItem(3)} or {world.newItem(CompatibilityUtils:checkItem("minecraft:air")), world.newItem(CompatibilityUtils:checkItem("minecraft:air")), world.newItem(CompatibilityUtils:checkItem("minecraft:air")), world.newItem(CompatibilityUtils:checkItem("minecraft:air"))}
if armorSlotItems[1].id ~= self.ArmorSlotItemsPrev[1].id then
self:setHelmet(armorSlotItems[1])
end
Expand Down
2 changes: 1 addition & 1 deletion scripts/bubble.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Bubble = {
models.models.bubble.Camera.AvatarBubble.Dots:setVisible(self.Emoji == "DOTS")
if self.ShowInGui then
models.models.bubble.Gui.FirstPersonBubble.Emoji:setPrimaryTexture("CUSTOM", emojiTexture)
sounds:playSound(NameUtils:checkSound("minecraft:entity.item.pickup"), player:getPos())
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.item.pickup"), player:getPos())
end
if events.TICK:getRegisteredCount("bubble_tick") == 0 then
events.TICK:register(function ()
Expand Down
20 changes: 10 additions & 10 deletions scripts/death_animation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ DeathAnimation = {
spawnHelicopterParticles = function (self)
local helicopterPos = ModelUtils.getModelWorldPos(models.models.death_animation.Helicopter)
for _ = 1, 100 do
particles:newParticle(NameUtils:checkParticle("minecraft:poof"), helicopterPos:copy():add(vectors.rotateAroundAxis(self.AnimationRot, math.random() * 9.375 - 4.6875, math.random() * 11.125 - 5.5625, math.random() * 23.875 - 11.9375, 0, math.abs(helicopterPos.y), 0)))
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:poof"), helicopterPos:copy():add(vectors.rotateAroundAxis(self.AnimationRot, math.random() * 9.375 - 4.6875, math.random() * 11.125 - 5.5625, math.random() * 23.875 - 11.9375, 0, math.abs(helicopterPos.y), 0)))
end
end,

Expand All @@ -54,16 +54,16 @@ DeathAnimation = {
armorVisible[index] = visible
end
if armorVisible[1] then
Armor:setHelmet(world.newItem(NameUtils:checkItem("minecraft:air")))
Armor:setHelmet(world.newItem(CompatibilityUtils:checkItem("minecraft:air")))
end
if armorVisible[2] then
Armor:setChestPlate(world.newItem(NameUtils:checkItem("minecraft:air")))
Armor:setChestPlate(world.newItem(CompatibilityUtils:checkItem("minecraft:air")))
end
if armorVisible[3] then
Armor:setLeggings(world.newItem(NameUtils:checkItem("minecraft:air")))
Armor:setLeggings(world.newItem(CompatibilityUtils:checkItem("minecraft:air")))
end
if armorVisible[4] then
Armor:setBoots(world.newItem(NameUtils:checkItem("minecraft:air")))
Armor:setBoots(world.newItem(CompatibilityUtils:checkItem("minecraft:air")))
end
local excludeModelsVisibleList = {}
for index, modelPart in ipairs(BlueArchiveCharacter.DEATH_ANIMATION.excludeModels) do
Expand Down Expand Up @@ -185,21 +185,21 @@ DeathAnimation = {
for _ = 1, 3 do
local particleRot = math.random() * math.pi * 2
local particleOffset = math.random() * 3
particles:newParticle(NameUtils:checkParticle("minecraft:poof"), particleAnchorPos:copy():add(math.cos(particleRot) * particleOffset, 0, math.sin(particleRot) * particleOffset)):setVelocity(math.cos(particleRot), 0, math.sin(particleRot))
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:poof"), particleAnchorPos:copy():add(math.cos(particleRot) * particleOffset, 0, math.sin(particleRot) * particleOffset)):setVelocity(math.cos(particleRot), 0, math.sin(particleRot))

end
if self.AnimationCount % 2 == 1 then
sounds:playSound(NameUtils:checkSound("minecraft:block.bamboo_wood_door.close"), ModelUtils.getModelWorldPos(models.models.death_animation.Helicopter.DeathAnimationSoundAnchor1), 1, 0.5):setAttenuation(2)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:block.bamboo_wood_door.close"), ModelUtils.getModelWorldPos(models.models.death_animation.Helicopter.DeathAnimationSoundAnchor1), 1, 0.5):setAttenuation(2)
end
if self.AnimationCount < 120 then
models.models.death_animation.Avatar:setLight(world.getLightLevel(self.AnimationPos))
end
if self.AnimationCount == 1 then
self:spawnHelicopterParticles()
elseif self.AnimationCount == 10 then
sounds:playSound(NameUtils:checkSound("minecraft:block.iron_door.open"), ModelUtils.getModelWorldPos(models.models.death_animation.Helicopter.DeathAnimationSoundAnchor1), 1, 0.5)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:block.iron_door.open"), ModelUtils.getModelWorldPos(models.models.death_animation.Helicopter.DeathAnimationSoundAnchor1), 1, 0.5)
elseif self.AnimationCount >= 57 and self.AnimationCount < 76 then
sounds:playSound(NameUtils:checkSound("minecraft:entity.player.attack.sweep"), ModelUtils.getModelWorldPos(models.models.death_animation.Helicopter.RopeLadder.RopeLadder2.RopeLadder3.RopeLadder4.RopeLadder5.RopeLadder6.RopeLadder7.RopeLadder8.RopeLadder9.RopeLadder10.RopeLadder11.RopeLadder12.RopeLadder13.RopeLadder14), 0.25, -0.056 * (self.AnimationCount - 57) + 2)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.player.attack.sweep"), ModelUtils.getModelWorldPos(models.models.death_animation.Helicopter.RopeLadder.RopeLadder2.RopeLadder3.RopeLadder4.RopeLadder5.RopeLadder6.RopeLadder7.RopeLadder8.RopeLadder9.RopeLadder10.RopeLadder11.RopeLadder12.RopeLadder13.RopeLadder14), 0.25, -0.056 * (self.AnimationCount - 57) + 2)
elseif self.AnimationCount == 120 then
self.DummyAvatarRoot = models.models.death_animation.Avatar:moveTo(models.models.death_animation.Helicopter.RopeLadder.RopeLadder2.RopeLadder3.RopeLadder4.RopeLadder5.RopeLadder6.RopeLadder7.RopeLadder8.RopeLadder9.RopeLadder10.RopeLadder11.RopeLadder12.RopeLadder13.RopeLadder14)
self.setPhase2Pose(models.models.death_animation.Helicopter.RopeLadder.RopeLadder2.RopeLadder3.RopeLadder4.RopeLadder5.RopeLadder6.RopeLadder7.RopeLadder8.RopeLadder9.RopeLadder10.RopeLadder11.RopeLadder12.RopeLadder13.RopeLadder14.Avatar)
Expand All @@ -209,7 +209,7 @@ DeathAnimation = {
elseif self.AnimationCount == 180 then
models.models.death_animation.Helicopter.RopeLadder.RopeLadder2.RopeLadder3.RopeLadder4.RopeLadder5.RopeLadder6.RopeLadder7.RopeLadder8.RopeLadder9.RopeLadder10.RopeLadder11.RopeLadder12.RopeLadder13.RopeLadder14.Avatar:setVisible(false)
elseif self.AnimationCount == 230 then
sounds:playSound(NameUtils:checkSound("minecraft:block.iron_door.close"), ModelUtils.getModelWorldPos(models.models.death_animation.Helicopter.DeathAnimationSoundAnchor1), 1, 0.5)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:block.iron_door.close"), ModelUtils.getModelWorldPos(models.models.death_animation.Helicopter.DeathAnimationSoundAnchor1), 1, 0.5)
elseif self.AnimationCount == 255 then
self:spawnHelicopterParticles()
self:stop()
Expand Down
8 changes: 4 additions & 4 deletions scripts/ex_skill/ex_skill.lua
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ ExSkill = {
renderer:setRenderHUD(false)
CameraManager:setCameraCollisionDenial(true)
models.models.ex_skill_frame.Gui:setColor(BlueArchiveCharacter.COSTUME.costumes[Costume.CurrentCostume].formationType == "STRIKER" and vectors.vec3(1, 0.75, 0.75) or vectors.vec3(0.75, 1, 1))
sounds:playSound(NameUtils:checkSound("minecraft:entity.player.levelup"), player:getPos(), 5, 2)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.player.levelup"), player:getPos(), 5, 2)
if BlueArchiveCharacter.EX_SKILL[BlueArchiveCharacter.COSTUME.costumes[Costume.CurrentCostume].exSkill].callbacks.preTransition ~= nil then
BlueArchiveCharacter.EX_SKILL[BlueArchiveCharacter.COSTUME.costumes[Costume.CurrentCostume].exSkill].callbacks.preTransition()
end
Expand Down Expand Up @@ -244,7 +244,7 @@ ExSkill = {
---アニメーションを停止する。
stop = function (self)
if host:isHost() then
sounds:playSound(NameUtils:checkSound("minecraft:entity.player.levelup"), player:getPos(), 5, 2):setAttenuation(100)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.player.levelup"), player:getPos(), 5, 2):setAttenuation(100)
end
for _, itemModel in ipairs({vanilla_model.RIGHT_ITEM, vanilla_model.LEFT_ITEM}) do
itemModel:setVisible(true)
Expand Down Expand Up @@ -338,7 +338,7 @@ ExSkill = {
if self.KeyPressCount == 30 then
events.TICK:remove("ex_skill_keypress_tick")
pings.ex_skill_removeAll()
sounds:playSound(NameUtils:checkSound("minecraft:entity.zombie.break_wooden_door"), player:getPos(), 0.25, 2)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.zombie.break_wooden_door"), player:getPos(), 0.25, 2)
self.KeyPressCount = 0
return
end
Expand All @@ -352,7 +352,7 @@ ExSkill = {
pings.ex_skill()
else
print(Language:getTranslate("key_bind__ex_skill__unavailable"..(renderer:isFirstPerson() and "_firstperson" or "")))
sounds:playSound(NameUtils:checkSound("minecraft:block.note_block.bass"), player:getPos(), 1, 0.5)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:block.note_block.bass"), player:getPos(), 1, 0.5)
end
self.KeyPressCount = 0
end
Expand Down
18 changes: 9 additions & 9 deletions scripts/gun.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Gun = {

---前ティックに手に持っていたアイテム: 1. メインハンド, 2. オフハンド
---@type ItemStack[]
HeldItemsPrev = {world.newItem(NameUtils:checkItem("minecraft:air")), world.newItem(NameUtils:checkItem("minecraft:air"))},
HeldItemsPrev = {world.newItem(CompatibilityUtils:checkItem("minecraft:air")), world.newItem(CompatibilityUtils:checkItem("minecraft:air"))},

---銃の位置を変更する。
---@param GunPosition Gun.GunPosition 変更先の構え位置
Expand Down Expand Up @@ -80,7 +80,7 @@ Gun = {
models.models.main.Avatar.UpperBody.Body.Gun:setVisible(true)
models.models.main.Avatar.UpperBody.Body.Gun:setParentType("Item")
if not client:isPaused() then
sounds:playSound(NameUtils:checkSound("minecraft:item.flintandsteel.use"), player:getPos(), 1, 2)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:item.flintandsteel.use"), player:getPos(), 1, 2)
end
self.CurrentGunPosition = "RIGHT"
else
Expand Down Expand Up @@ -110,7 +110,7 @@ Gun = {
models.models.main.Avatar.UpperBody.Body.Gun:setVisible(true)
models.models.main.Avatar.UpperBody.Body.Gun:setParentType("Item")
if not client:isPaused() then
sounds:playSound(NameUtils:checkSound("minecraft:item.flintandsteel.use"), player:getPos(), 1, 2)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:item.flintandsteel.use"), player:getPos(), 1, 2)
end
self.CurrentGunPosition = "LEFT"
end
Expand Down Expand Up @@ -143,7 +143,7 @@ Gun = {
---@param self Gun
init = function (self)
events.TICK:register(function()
local heldItems = (player:getPose() ~= "SLEEPING" and ExSkill.AnimationCount == -1) and {player:getHeldItem(false), player:getHeldItem(true)} or {world.newItem(NameUtils:checkItem("minecraft:air")), world.newItem(NameUtils:checkItem("minecraft:air"))}
local heldItems = (player:getPose() ~= "SLEEPING" and ExSkill.AnimationCount == -1) and {player:getHeldItem(false), player:getHeldItem(true)} or {world.newItem(CompatibilityUtils:checkItem("minecraft:air")), world.newItem(CompatibilityUtils:checkItem("minecraft:air"))}
local targetItemFound = false
local isLeftHanded = player:isLeftHanded()
if heldItems[1].id ~= self.HeldItemsPrev[1].id or heldItems[2].id ~= self.HeldItemsPrev[2].id then
Expand Down Expand Up @@ -206,15 +206,15 @@ Gun = {
local distanceFromSound = math.abs(pos:copy():sub(player:getPos()):length() - velocityDistance)
if (id == "minecraft:entity.arrow.shoot" or id == "minecraft:item.crossbow.loading_end" or id == "minecraft:item.crossbow.shoot") and math.abs(velocityDistance - distanceFromSound) < 1 then
if id == "minecraft:item.crossbow.loading_end" then
sounds:playSound(NameUtils:checkSound("minecraft:block.dispenser.fail"), pos, 1, 2)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:block.dispenser.fail"), pos, 1, 2)
elseif player:isUnderwater() then
sounds:playSound(NameUtils:checkSound("minecraft:entity.generic.extinguish_fire"), pos, 0.5, 1.5)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:entity.generic.extinguish_fire"), pos, 0.5, 1.5)
else
local particleAnchor = ModelUtils.getModelWorldPos(renderer:isFirstPerson() and (Gun.CurrentGunPosition == "RIGHT" and models.models.main.Avatar.UpperBody.Arms.RightArm.RightArmBottom.RightItemPivot or models.models.main.Avatar.UpperBody.Arms.LeftArm.LeftArmBottom.LeftItemPivot) or models.models.main.Avatar.UpperBody.Body.Gun.MuzzleAnchor)
for _ = 1, 5 do
particles:newParticle(NameUtils:checkParticle("minecraft:smoke"), particleAnchor)
particles:newParticle(CompatibilityUtils:checkParticle("minecraft:smoke"), particleAnchor)
end
sounds:playSound(NameUtils:checkSound(BlueArchiveCharacter.GUN.sound.name), pos, 1, BlueArchiveCharacter.GUN.sound.pitch)
sounds:playSound(CompatibilityUtils:checkSound(BlueArchiveCharacter.GUN.sound.name), pos, 1, BlueArchiveCharacter.GUN.sound.pitch)
end
return true
elseif (id == "minecraft:item.crossbow.loading_start" or id == "minecraft:item.crossbow.loading_middle" or id:match("^minecraft:item%.crossbow%.quick_charge_[1-3]$") ~= nil) and distanceFromSound < 1 and player:getActiveItem().id == "minecraft:crossbow" then
Expand All @@ -230,7 +230,7 @@ Gun = {
end
end
if (quickChageLevel <= 4 and activeItemTime + quickChageLevel >= 4 and activeItemTime + quickChageLevel <= 6) or (quickChageLevel == 5 and activeItemTime <= 2) then
sounds:playSound(NameUtils:checkSound("minecraft:item.flintandsteel.use"), pos, 1, 2)
sounds:playSound(CompatibilityUtils:checkSound("minecraft:item.flintandsteel.use"), pos, 1, 2)
return true
elseif id == "minecraft:item.crossbow.loading_middle" then
return true
Expand Down
2 changes: 1 addition & 1 deletion scripts/head_block.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ HeadBlock = {
--ヘルメットを着けている場合は外しておく。
local isHelmetVisible = Armor ~= nil and Armor.ArmorVisible[1] or false
if isHelmetVisible then
Armor:setHelmet(world.newItem(NameUtils:checkItem("minecraft:air")))
Armor:setHelmet(world.newItem(CompatibilityUtils:checkItem("minecraft:air")))
end

--頭ブロックから除外するモデルパーツを予め非表示にする。
Expand Down
2 changes: 1 addition & 1 deletion scripts/index.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ events.ENTITY_INIT:register(function ()
Config = require("scripts.config")
KeyManager = require("scripts.key_manager")
PlayerUtils = require("scripts.utils.player_utils")
NameUtils = require("scripts.utils.name_utils")
CompatibilityUtils = require("scripts.utils.compatibility_utils")

--パーツ別クラス
require("scripts.vanilla_model")
Expand Down
Loading

0 comments on commit a77927b

Please sign in to comment.