text:
#> lib:integer_to_bit_array/core/recursive
#
# 再帰的にbinary配列を生成するよ
#
# @within function lib:integer_to_bit_array/core/*

execute if score $Argument.Number Temporary matches 00.. run data modify storage lib: Return.Array append value 0
execute if score $Argument.Number Temporary matches ..-1 run data modify storage lib: Return.Array append value 1
scoreboard players operation $Argument.Number Temporary += $Argument.Number Temporary
scoreboard players add $i Temporary 1
execute if score $i Temporary < $32 Const run function lib:integer_to_bit_array/core/recursive


text:
#> lib:score_to_move/_index.d
# @private

#> temp
# @within lib:score_to_move/**
    #declare score_holder $Move

repo_name: ProjectTSB/TheSkyBlessing

repo_language: mcfunction

mime_type: text/plain


text:
#> lib:score_to_move/core/27
#
# 二分探索的にスコアを座標に変換します
#
# @within lib:score_to_move/core/28

scoreboard players operation $Move Lib += $Move Lib
execute if score $Move Lib matches 0.. run function lib:score_to_move/core/26
execute if score $Move Lib matches ..-1 positioned ^ ^ ^13421.7728 run function lib:score_to_move/core/26


text:
#> lib:score_to_move/core/1
#
# 二分探索的にスコアを座標に変換します
#
# @within lib:score_to_move/core/2

scoreboard players operation $Move Lib += $Move Lib
execute if score $Move Lib matches 0.. run function lib:score_to_move/core/0
execute if score $Move Lib matches ..-1 positioned ^ ^ ^0.0002 run function lib:score_to_move/core/0


text:
#> lib:score_to_move/core/5
#
# 二分探索的にスコアを座標に変換します
#
# @within lib:score_to_move/core/6

scoreboard players operation $Move Lib += $Move Lib
execute if score $Move Lib matches 0.. run function lib:score_to_move/core/4
execute if score $Move Lib matches ..-1 positioned ^ ^ ^0.0032 run function lib:score_to_move/core/4


text:
#> lib:score_to_move/core/13
#
# 二分探索的にスコアを座標に変換します
#
# @within lib:score_to_move/core/14

scoreboard players operation $Move Lib += $Move Lib
execute if score $Move Lib matches 0.. run function lib:score_to_move/core/12
execute if score $Move Lib matches ..-1 positioned ^ ^ ^0.8192 run function lib:score_to_move/core/12


text:
#> lib:score_to_move/core/21
#
# 二分探索的にスコアを座標に変換します
#
# @within lib:score_to_move/core/22

scoreboard players operation $Move Lib += $Move Lib
execute if score $Move Lib matches 0.. run function lib:score_to_move/core/20
execute if score $Move Lib matches ..-1 positioned ^ ^ ^209.7152 run function lib:score_to_move/core/20


text:
#> lib:score_to_move/core/25
#
# 二分探索的にスコアを座標に変換します
#
# @within lib:score_to_move/core/26

scoreboard players operation $Move Lib += $Move Lib
execute if score $Move Lib matches 0.. run function lib:score_to_move/core/24
execute if score $Move Lib matches ..-1 positioned ^ ^ ^3355.4432 run function lib:score_to_move/core/24


text:
#> lib:score_to_move/core/7
#
# 二分探索的にスコアを座標に変換します
#
# @within lib:score_to_move/core/8

scoreboard players operation $Move Lib += $Move Lib
execute if score $Move Lib matches 0.. run function lib:score_to_move/core/6
execute if score $Move Lib matches ..-1 positioned ^ ^ ^0.0128 run function lib:score_to_move/core/6


text:
#> lib:score_to_move/core/2
#
# 二分探索的にスコアを座標に変換します
#
# @within lib:score_to_move/core/3

scoreboard players operation $Move Lib += $Move Lib
execute if score $Move Lib matches 0.. run function lib:score_to_move/core/1
execute if score $Move Lib matches ..-1 positioned ^ ^ ^0.0004 run function lib:score_to_move/core/1


text:
#> lib:score_to_move/core/23
#
# 二分探索的にスコアを座標に変換します
#
# @within lib:score_to_move/core/24

scoreboard players operation $Move Lib += $Move Lib
execute if score $Move Lib matches 0.. run function lib:score_to_move/core/22
execute if score $Move Lib matches ..-1 positioned ^ ^ ^838.8608 run function lib:score_to_move/core/22


text:
#> lib:score_to_move/core/26
#
# 二分探索的にスコアを座標に変換します
#
# @within lib:score_to_move/core/27

scoreboard players operation $Move Lib += $Move Lib
execute if score $Move Lib matches 0.. run function lib:score_to_move/core/25
execute if score $Move Lib matches ..-1 positioned ^ ^ ^6710.8864 run function lib:score_to_move/core/25


text:
#> lib:score_to_move/core/30
#
# 二分探索的にスコアを座標に変換します
#
# @within lib:score_to_move/

scoreboard players operation $Move Lib += $Move Lib
execute if score $Move Lib matches 0.. run function lib:score_to_move/core/29
execute if score $Move Lib matches ..-1 positioned ^ ^ ^107374.1824 run function lib:score_to_move/core/29


text:
#> lib:score_to_move/core/6
#
# 二分探索的にスコアを座標に変換します
#
# @within lib:score_to_move/core/7

scoreboard players operation $Move Lib += $Move Lib
execute if score $Move Lib matches 0.. run function lib:score_to_move/core/5
execute if score $Move Lib matches ..-1 positioned ^ ^ ^0.0064 run function lib:score_to_move/core/5


text:
#> lib:score_to_move/core/8
#
# 二分探索的にスコアを座標に変換します
#
# @within lib:score_to_move/core/9

scoreboard players operation $Move Lib += $Move Lib
execute if score $Move Lib matches 0.. run function lib:score_to_move/core/7
execute if score $Move Lib matches ..-1 positioned ^ ^ ^0.0256 run function lib:score_to_move/core/7


text:
#> lib:score_to_move/core/18
#
# 二分探索的にスコアを座標に変換します
#
# @within lib:score_to_move/core/19

scoreboard players operation $Move Lib += $Move Lib
execute if score $Move Lib matches 0.. run function lib:score_to_move/core/17
execute if score $Move Lib matches ..-1 positioned ^ ^ ^26.2144 run function lib:score_to_move/core/17


text:
#> lib:score_to_move/core/20
#
# 二分探索的にスコアを座標に変換します
#
# @within lib:score_to_move/core/21

scoreboard players operation $Move Lib += $Move Lib
execute if score $Move Lib matches 0.. run function lib:score_to_move/core/19
execute if score $Move Lib matches ..-1 positioned ^ ^ ^104.8576 run function lib:score_to_move/core/19


text:
#> lib:score_to_move/core/22
#
# 二分探索的にスコアを座標に変換します
#
# @within lib:score_to_move/core/23

scoreboard players operation $Move Lib += $Move Lib
execute if score $Move Lib matches 0.. run function lib:score_to_move/core/21
execute if score $Move Lib matches ..-1 positioned ^ ^ ^419.4304 run function lib:score_to_move/core/21


text:
#> lib:score_to_move/core/11
#
# 二分探索的にスコアを座標に変換します
#
# @within lib:score_to_move/core/12

scoreboard players operation $Move Lib += $Move Lib
execute if score $Move Lib matches 0.. run function lib:score_to_move/core/10
execute if score $Move Lib matches ..-1 positioned ^ ^ ^0.2048 run function lib:score_to_move/core/10


text:
#> lib:score_to_move/core/28
#
# 二分探索的にスコアを座標に変換します
#
# @within lib:score_to_move/core/29

scoreboard players operation $Move Lib += $Move Lib
execute if score $Move Lib matches 0.. run function lib:score_to_move/core/27
execute if score $Move Lib matches ..-1 positioned ^ ^ ^26843.5456 run function lib:score_to_move/core/27


text:
#> lib:score_to_move/core/10
#
# 二分探索的にスコアを座標に変換します
#
# @within lib:score_to_move/core/11

scoreboard players operation $Move Lib += $Move Lib
execute if score $Move Lib matches 0.. run function lib:score_to_move/core/9
execute if score $Move Lib matches ..-1 positioned ^ ^ ^0.2048 run function lib:score_to_move/core/9


text:
#> lib:score_to_move/core/15
#
# 二分探索的にスコアを座標に変換します
#
# @within lib:score_to_move/core/16

scoreboard players operation $Move Lib += $Move Lib
execute if score $Move Lib matches 0.. run function lib:score_to_move/core/14
execute if score $Move Lib matches ..-1 positioned ^ ^ ^3.2768 run function lib:score_to_move/core/14


text:
#> lib:score_to_move/core/3
#
# 二分探索的にスコアを座標に変換します
#
# @within lib:score_to_move/core/4

scoreboard players operation $Move Lib += $Move Lib
execute if score $Move Lib matches 0.. run function lib:score_to_move/core/2
execute if score $Move Lib matches ..-1 positioned ^ ^ ^0.0008 run function lib:score_to_move/core/2


text:
#> lib:score_to_move/core/12
#
# 二分探索的にスコアを座標に変換します
#
# @within lib:score_to_move/core/13

scoreboard players operation $Move Lib += $Move Lib
execute if score $Move Lib matches 0.. run function lib:score_to_move/core/11
execute if score $Move Lib matches ..-1 positioned ^ ^ ^0.4096 run function lib:score_to_move/core/11


text:
#> lib:score_to_move/core/19
#
# 二分探索的にスコアを座標に変換します
#
# @within lib:score_to_move/core/20

scoreboard players operation $Move Lib += $Move Lib
execute if score $Move Lib matches 0.. run function lib:score_to_move/core/18
execute if score $Move Lib matches ..-1 positioned ^ ^ ^52.4288 run function lib:score_to_move/core/18


text:
#> lib:score_to_move/core/4
#
# 二分探索的にスコアを座標に変換します
#
# @within lib:score_to_move/core/5

scoreboard players operation $Move Lib += $Move Lib
execute if score $Move Lib matches 0.. run function lib:score_to_move/core/3
execute if score $Move Lib matches ..-1 positioned ^ ^ ^0.0016 run function lib:score_to_move/core/3


text:
#> lib:score_to_move/core/29
#
# 二分探索的にスコアを座標に変換します
#
# @within lib:score_to_move/core/30

scoreboard players operation $Move Lib += $Move Lib
execute if score $Move Lib matches 0.. run function lib:score_to_move/core/28
execute if score $Move Lib matches ..-1 positioned ^ ^ ^53687.0912 run function lib:score_to_move/core/28


text:
#> lib:score_to_move/core/9
#
# 二分探索的にスコアを座標に変換します
#
# @within lib:score_to_move/core/10

scoreboard players operation $Move Lib += $Move Lib
execute if score $Move Lib matches 0.. run function lib:score_to_move/core/8
execute if score $Move Lib matches ..-1 positioned ^ ^ ^0.0512 run function lib:score_to_move/core/8


text:
#> lib:score_to_move/core/24
#
# 二分探索的にスコアを座標に変換します
#
# @within lib:score_to_move/core/25

scoreboard players operation $Move Lib += $Move Lib
execute if score $Move Lib matches 0.. run function lib:score_to_move/core/23
execute if score $Move Lib matches ..-1 positioned ^ ^ ^1677.7216 run function lib:score_to_move/core/23


text:
#> lib:score_to_move/core/16
#
# 二分探索的にスコアを座標に変換します
#
# @within lib:score_to_move/core/17

scoreboard players operation $Move Lib += $Move Lib
execute if score $Move Lib matches 0.. run function lib:score_to_move/core/15
execute if score $Move Lib matches ..-1 positioned ^ ^ ^6.5536 run function lib:score_to_move/core/15


text:
#> lib:score_to_move/core/17
#
# 二分探索的にスコアを座標に変換します
#
# @within lib:score_to_move/core/18

scoreboard players operation $Move Lib += $Move Lib
execute if score $Move Lib matches 0.. run function lib:score_to_move/core/16
execute if score $Move Lib matches ..-1 positioned ^ ^ ^13.1072 run function lib:score_to_move/core/16


text:
#> lib:score_to_move/core/0
#
# 二分探索的にスコアを座標に変換します
#
# @within lib:score_to_move/core/1

scoreboard players operation $Move Lib += $Move Lib
execute if score $Move Lib matches 0.. run tp @s ~ ~ ~
execute if score $Move Lib matches ..-1 positioned ^ ^ ^0.0001 run tp @s ~ ~ ~


text:
#> lib:score_to_move/core/14
#
# 二分探索的にスコアを座標に変換します
#
# @within lib:score_to_move/core/15

scoreboard players operation $Move Lib += $Move Lib
execute if score $Move Lib matches 0.. run function lib:score_to_move/core/13
execute if score $Move Lib matches ..-1 positioned ^ ^ ^1.6384 run function lib:score_to_move/core/13


text:
#> lib:forward_spreader/square
#
# 実行entityを前方の四角状範囲内のランダムな座標に移動させます
#
# @input
#   as entity
#   position
#   rotation
#   storage lib:
#       Argument.Distance : float
#       Argument.Spread : float
# @public

function lib:forward_spreader/core/


text:
#> lib:forward_spreader/_index.d
# @private

#> Temp
# @within lib:forward_spreader/**
    #declare score_holder $CircleRandomizerMode
    #declare score_holder $Distance
    #declare score_holder $Diameter
    #declare score_holder $YawSin
    #declare score_holder $YawCos
    #declare score_holder $PitchSin
    #declare score_holder $PitchCos
    #declare score_holder $Radius
    #declare score_holder $Radius^2
    #declare score_holder $VecX
    #declare score_holder $VecY
    #declare score_holder $VecZ
    #declare score_holder $X
    #declare score_holder $Y
    #declare score_holder $Z


text:
#> lib:forward_spreader/circle
#
# 実行entityを前方の円状範囲内のランダムな座標に移動させます
#
# @input
#   as entity
#   position
#   rotation
#   storage lib:
#       Argument.Distance : float
#       Argument.Spread : float
# @public

scoreboard players set $CircleRandomizerMode Temporary 1
function lib:forward_spreader/core/
scoreboard players reset $CircleRandomizerMode Temporary


text:
#> lib:forward_spreader/core/check_distance
#
# 点が中心から半径以内に存在するまで繰り返します
#
# @within function lib:forward_spreader/core/randomizer

#> Temporary
# @private
    #declare score_holder $Temp
    #declare score_holder $Temp2

# while ((x^2+y^2) > r^2) randomizer
    scoreboard players operation $Temp Temporary = $VecX Temporary
    scoreboard players operation $Temp Temporary *= $VecX Temporary

    scoreboard players operation $Temp2 Temporary = $VecY Temporary
    scoreboard players operation $Temp2 Temporary *= $VecY Temporary

    scoreboard players operation $Temp Temporary += $Temp2 Temporary

    execute if score $Temp Temporary > $Radius^2 Temporary run function lib:forward_spreader/core/randomizer
# リセット
    scoreboard players reset $Temp Temporary
    scoreboard players reset $Temp2 Temporary


text:
#> lib:forward_spreader/core/fetch
#
# 汎用entityのPosに計算済みの拡散座標を代入します
#
# @within function lib:forward_spreader/core/

#> Temporary
# @private
    #declare score_holder $PosX
    #declare score_holder $PosY
    #declare score_holder $PosZ

# 汎用EntityのPosを取得
    data modify storage lib: Pos set from entity @s Pos
    execute store result score $PosX Temporary run data get storage lib: Pos[0] 10000
    execute store result score $PosY Temporary run data get storage lib: Pos[1] 10000
    execute store result score $PosZ Temporary run data get storage lib: Pos[2] 10000
# ベクトルを加算
    scoreboard players operation $PosX Temporary += $X Temporary
    scoreboard players operation $PosY Temporary += $Y Temporary
    scoreboard players operation $PosZ Temporary += $Z Temporary
# 戻す
    execute store result storage lib: Pos[0] double 0.0001 run scoreboard players get $PosX Temporary
    execute store result storage lib: Pos[1] double 0.0001 run scoreboard players get $PosY Temporary
    execute store result storage lib: Pos[2] double 0.0001 run scoreboard players get $PosZ Temporary
    data modify entity @s Pos set from storage lib: Pos
# リセット
    scoreboard players reset $PosX Temporary
    scoreboard players reset $PosY Temporary
    scoreboard players reset $PosZ Temporary
    data remove storage lib: Pos


text:
#> lib:forward_spreader/core/randomizer
#
# ランダム座標生成処理
#
# @within function
#   lib:forward_spreader/core/
#   lib:forward_spreader/core/check_distance

execute store result score $VecX Temporary run function lib:random/
scoreboard players operation $VecX Temporary %= $Diameter Temporary
scoreboard players operation $VecX Temporary -= $Radius Temporary

execute store result score $VecY Temporary run function lib:random/
scoreboard players operation $VecY Temporary %= $Diameter Temporary
scoreboard players operation $VecY Temporary -= $Radius Temporary

execute if score $CircleRandomizerMode Temporary matches 1 run function lib:forward_spreader/core/check_distance


text:
#> lib:forward_spreader/core/calc
#
# 回転行列で実行方向へ座標を補正します
#
# @within function lib:forward_spreader/core/

#> Temporary
# @private
    #declare score_holder $Temp

# Y` = Y * cos(pitch) - Z * sin(pitch)
    scoreboard players operation $Y Temporary = $VecY Temporary
    scoreboard players operation $Y Temporary *= $PitchCos Temporary
    scoreboard players operation $Temp Temporary = $VecZ Temporary
    scoreboard players operation $Temp Temporary *= $PitchSin Temporary
    scoreboard players operation $Y Temporary -= $Temp Temporary
# Z` = Y * sin(pitch) + Z * cos(pitch)
    scoreboard players operation $Z Temporary = $VecY Temporary
    scoreboard players operation $Z Temporary *= $PitchSin Temporary
    scoreboard players operation $Temp Temporary = $VecZ Temporary
    scoreboard players operation $Temp Temporary *= $PitchCos Temporary
    scoreboard players operation $Z Temporary += $Temp Temporary
    scoreboard players operation $Z Temporary /= $10000 Const
# X` = X * cos(yaw) + Z` * sin(yaw)
    scoreboard players operation $X Temporary = $VecX Temporary
    scoreboard players operation $X Temporary *= $YawCos Temporary
    scoreboard players operation $Temp Temporary = $Z Temporary
    scoreboard players operation $Temp Temporary *= $YawSin Temporary
    scoreboard players operation $X Temporary += $Temp Temporary
# Z` = Z` * cos(yaw) - X * sin(yaw)
    scoreboard players operation $Z Temporary *= $YawCos Temporary
    scoreboard players operation $Temp Temporary = $VecX Temporary
    scoreboard players operation $Temp Temporary *= $YawSin Temporary
    scoreboard players operation $Z Temporary -= $Temp Temporary
# 係数が乗算で膨れ上がってるので除算
    scoreboard players operation $X Temporary /= $10000 Const
    scoreboard players operation $Y Temporary /= $10000 Const
    scoreboard players operation $Z Temporary /= $10000 Const
# リセット
    scoreboard players reset $Temp Temporary
    scoreboard players reset $CircleRandomizerMode Temporary
    scoreboard players reset $Distance Temporary
    scoreboard players reset $Diameter Temporary
    scoreboard players reset $YawSin Temporary
    scoreboard players reset $YawCos Temporary
    scoreboard players reset $PitchSin Temporary
    scoreboard players reset $PitchCos Temporary
    scoreboard players reset $Radius Temporary
    scoreboard players reset $Radius^2 Temporary
    scoreboard players reset $VecX Temporary
    scoreboard players reset $VecY Temporary
    scoreboard players reset $VecZ Temporary


text:
#> lib:forward_spreader/core/pitch
#
# 実行方向のpitchからsin/cosを取得します
#
# @within function lib:forward_spreader/core/

# 汎用Entityを原点にTP
    execute in overworld run tp 0-0-0-0-0 0.0 0.0 0.0 0.0 0.0
# pitchを代入しベクトルをnormalize
    execute store result entity 0-0-0-0-0 Rotation[0] float 1 run data get storage lib: Rotation[1]
    execute as 0-0-0-0-0 at @s run tp @s ^ ^ ^1
# pitchのsin/cosを取得
    data modify storage lib: Pos set from entity 0-0-0-0-0 Pos
    execute store result score $PitchSin Temporary run data get storage lib: Pos[0] -10000
    execute store result score $PitchCos Temporary run data get storage lib: Pos[2] 10000
# リセット
    data remove storage lib: Pos


text:
#> lib:forward_spreader/core/pre_randomizer
#
# ランダム座標生成前に半径等のデータを求めます
#
# @within function lib:forward_spreader/core/

# 半径を求める
    scoreboard players operation $Radius Temporary = $Diameter Temporary
    scoreboard players operation $Radius Temporary /= $2 Const
# 半径の二乗を求める
    scoreboard players operation $Radius^2 Temporary = $Radius Temporary
    scoreboard players operation $Radius^2 Temporary *= $Radius Temporary


text:
#> lib:forward_spreader/core/yaw
#
# 実行方向のyawからsin/cosを取得します
#
# @within function lib:forward_spreader/core/

# 汎用Entityを原点にTP
    execute in overworld run tp 0-0-0-0-0 0.0 0.0 0.0 0.0 0.0
# yawを代入しベクトルをnormalize
    execute store result entity 0-0-0-0-0 Rotation[0] float 1 run data get storage lib: Rotation[0]
    execute as 0-0-0-0-0 at @s run tp @s ^ ^ ^1
# yawのsin/cosを取得
    data modify storage lib: Pos set from entity 0-0-0-0-0 Pos
    execute store result score $YawSin Temporary run data get storage lib: Pos[0] 10000
    execute store result score $YawCos Temporary run data get storage lib: Pos[2] 10000
# リセット
    data remove storage lib: Pos


text:
#> lib:dimension/get
#
# 実行座標のディメンションを取得します
#
# @output storage lib: Return.Dimension : id(minecraft:dimension)
# @api

execute if predicate lib:dimension/is_overworld run data modify storage lib: Return.Dimension set value "minecraft:overworld"
execute if predicate lib:dimension/is_nether run data modify storage lib: Return.Dimension set value "minecraft:the_nether"
execute if predicate lib:dimension/is_end run data modify storage lib: Return.Dimension set value "minecraft:the_end"


text:
#> lib:score_to_health_wrapper/proc
#
# そのtick内のHP処理をまとめて処理します。
#
# @within function core:tick/player/post

# 値がなければ現在値を入れる
    execute unless score @s ScoreToHealth matches -2147483648..2147483647 run function api:data_get/health
    execute unless score @s ScoreToHealth matches -2147483648..2147483647 store result score @s ScoreToHealth run data get storage api: Health 100
# 回復/ダメージを適用
    scoreboard players operation @s ScoreToHealth += @s ScoreToHPFluc
# 1<=体力: ダメージ演出
    execute if score @s ScoreToHPFluc matches ..-1 if score @s ScoreToHealth matches 1.. run summon area_effect_cloud ~ ~ ~ {Duration:6,Age:4,Effects:[{Id:11,Amplifier:127b,Duration:1,ShowParticles:0b},{Id:7,Amplifier:0b,Duration:1,ShowParticles:0b}]}
# 0>=体力: kill処理
    execute if score @s ScoreToHealth matches ..0 run function lib:score_to_health_wrapper/core/die
# リセット
    scoreboard players reset @s ScoreToHPFluc


text:
#> lib:score_to_health_wrapper/set
#
# プレイヤーのHPをその値に設定します。
#
# 値は100倍で入れる必要があります。
#
# @input
#   as player
#   score $Set Argument
#   storage lib: Argument.DeathMessage? : TextComponent || TextComponent[]
# @api

#> temp
# @private
    #declare score_holder $Set

# セット
    scoreboard players operation @s ScoreToHealth = $Set Lib
    function oh_my_dat:please
    data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LatestAttackInfo.Type set value 0
    data remove storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LatestAttackInfo.DeathMessage
    data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LatestAttackInfo.DeathMessage set from storage lib: Argument.DeathMessage
# リセット
    scoreboard players reset $Set Lib
    # data remove storage lib: Argument.DeathMessage


text:
#> lib:score_to_health_wrapper/fluctuation
#
# プレイヤーのHealthを増減します。
#
# @input
#   as player
#   storage api: Argument.Fluctuation: double
#   storage api: Argument.Attacker?: int(MobUUID)
#   storage api: Argument.AttackType?: Enum(AttackType)
#   storage api: Argument.ElementType?: Enum(ElementType)
# @within function
#   lib:**
#   api:**

#> temp
# @private
    #declare score_holder $Fluctuation

# 取得
    execute store result score $Fluctuation Lib run data get storage api: Argument.Fluctuation 100
# 増減
    scoreboard players operation @s ScoreToHPFluc += $Fluctuation Lib
# 攻撃情報を記録する
    execute if score $Fluctuation Lib matches ..-1 run function lib:score_to_health_wrapper/core/store_attack_info
# ログ表示
    execute at @s run function lib:status_log/show_health
# リセット
    scoreboard players reset $Fluctuation Lib


text:
#> lib:score_to_health_wrapper/core/show_custom_death_message
#
# カスタム死亡メッセージを配列内から1つ選んで表示
#
# @within function lib:score_to_health_wrapper/core/die

#> ListLength
# @private
    #declare score_holder $Length
    #declare score_holder $Argument.Index

# 乱数取得&範囲設定
    execute store result score $Argument.Index Lib run function lib:random/
    execute store result score $Length Temporary if data storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LatestAttackInfo.DeathMessage[]
    scoreboard players operation $Argument.Index Lib %= $Length Temporary
# 配列操作
    function lib:array/session/open
    data modify storage lib: Array set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LatestAttackInfo.DeathMessage
    function lib:array/move
# メッセージ
    tellraw @a {"storage":"lib:","nbt":"Array[-1]","interpret": true}
# リセット
    function lib:array/session/close
    scoreboard players reset $Length Temporary


text:
#> lib:score_to_health_wrapper/core/show_common_death_message
#
#
#
# @within function lib:score_to_health_wrapper/core/die

# Enumをもとにメッセージを表示
    execute if data storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LatestAttackInfo{Type:0} run function lib:message/common/die/unknown
    execute if data storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LatestAttackInfo{Type:1} run function lib:message/common/die/fire
    execute if data storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LatestAttackInfo{Type:2} run function lib:message/common/die/water
    execute if data storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LatestAttackInfo{Type:3} run function lib:message/common/die/thunder
    execute if data storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LatestAttackInfo{Type:4} run function lib:message/common/die/physical
    execute if data storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LatestAttackInfo{Type:5} run function lib:message/common/die/magic


text:
#> lib:score_to_health_wrapper/core/store_attack_info
#
#
#
# @within function lib:score_to_health_wrapper/fluctuation

#> ThisTag
# @private
    #declare score_holder $LatestAttacker

# 攻撃者名を記録する
    function oh_my_dat:please
    execute store result score $LatestAttacker Temporary run data get storage api: Argument.Attacker
    execute at @s as @e[type=!player,distance=..150] if score @s MobUUID = $LatestAttacker Temporary run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LatestAttackInfo.Name set from entity @s CustomName
# 攻撃属性をEnumとして保存する
    data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LatestAttackInfo.Type set value 0
    execute if data storage api: Argument{ElementType:"Fire"} run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LatestAttackInfo.Type set value 1
    execute if data storage api: Argument{ElementType:"Water"} run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LatestAttackInfo.Type set value 2
    execute if data storage api: Argument{ElementType:"Thunder"} run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LatestAttackInfo.Type set value 3
    execute if data storage api: Argument{ElementType:"None"} if data storage api: Argument{AttackType:"Physical"} run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LatestAttackInfo.Type set value 4
    execute if data storage api: Argument{ElementType:"None"} if data storage api: Argument{AttackType:"Magic"} run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LatestAttackInfo.Type set value 5
# 死亡メッセージが設定されていたら保存する
    data remove storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LatestAttackInfo.DeathMessage
    data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LatestAttackInfo.DeathMessage set from storage api: Argument.DeathMessage
# リセット
    scoreboard players reset $LatestAttacker Temporary


text:
#> lib:score_to_health_wrapper/core/die
#
#
#
# @within function lib:score_to_health_wrapper/proc

# 独自の死亡メッセージを出すためにバニラのを無効化する
    gamerule showDeathMessages false
# ばいばい。
    kill @s
# 死亡メッセージ読み込み用準備
    function oh_my_dat:please
    data modify storage lib: Return.AttackerName set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LatestAttackInfo.Name
# 死亡メッセージ
    execute if data storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LatestAttackInfo.DeathMessage unless data storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LatestAttackInfo.DeathMessage[-1] run tellraw @a {"storage":"oh_my_dat:","nbt":"_[-4][-4][-4][-4][-4][-4][-4][-4].LatestAttackInfo.DeathMessage","interpret": true}
    execute if data storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LatestAttackInfo.DeathMessage[-1] run function lib:score_to_health_wrapper/core/show_custom_death_message
    execute unless data storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LatestAttackInfo.DeathMessage run function lib:score_to_health_wrapper/core/show_common_death_message
# リセット
    data remove storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LatestAttackInfo
    data remove storage lib: Return.AttackerName
    gamerule showDeathMessages true
    scoreboard players reset @s ScoreToHealth


text:
#> lib:mp/get_max
#
# プレイヤーのMPの最大値を取得します。
#
# @deprecated change to `api:mp/get_max`
# @input as player
# @output result score MPMax
# @api

# 取得
    function api:mp/get_max
    data get storage api: Return.MaxMP


text:
#> lib:mp/get
#
# プレイヤーのMPの現在値を取得します。
#
# @deprecated change to `api:mp/get_current`
# @input as player
# @output result score MP
# @api

# 取得
    function api:mp/get_current
    data get storage api: Return.CurrentMP


text:
#> lib:mp/set
#
# プレイヤーのMPをその値に設定します。
#
# @deprecated change to `api:mp/set`
# @input
#   as player
#   score $Set Argument
# @api

#> temp
# @private
    #declare score_holder $Set

execute store result storage api: Argument.MP int 1 run scoreboard players get $Set Lib
function api:mp/set
scoreboard players reset $Set Lib


text:
#> lib:mp/fluctuation
#
# プレイヤーのMPを増減します。
#
# @deprecated change to `api:mp/fluctuation`
# @input
#   as player
#   score $Fluctuation Argument
#   storage lib: Argument.DisableLog?: boolean
# @api

#> temp
# @private
    #declare score_holder $Fluctuation

execute store result storage api: Argument.Fluctuation int 1 run scoreboard players get $Fluctuation Lib
data modify storage api: Argument.DisableLog set from storage lib: Argument.DisableLog
function api:mp/fluctuation
data remove storage lib: Argument.DisableLog
scoreboard players reset $Fluctuation Lib


text:
#> lib:message/invalid_operation
#
# 「その操作は無効です。」
#
# @api

tellraw @a [{"text":"その操作は無効です。","color":"red"}]


text:
#> lib:message/tutorial/lost_items
#
# 「◆ 失ったアイテムについて
#   あなた[たち]の死亡時、所持していたアイテムはドロップする代わりに信仰する神によって全て保管されます。
#   保管されたアイテムは島を浄化することで全て神殿に返還されます。
#   島の浄化に苦戦する場合は信仰する神に対して慈悲を乞うのもありでしょう。」
#
# @within function world_manager:area/01-06.tutorial-lost_items

execute if score $PlayerCount Global matches ..1 run tellraw @s [{"text":"◆ 失ったアイテムについて\n","color":"light_purple"},{"text":"あなたの死亡時、所持していたアイテムはドロップする代わりに信仰する神によって全て保管されます。\n保管されたアイテムは島を浄化することで全て神殿に返還されます。\n島の浄化に苦戦する場合は信仰する神に対して慈悲を乞うのもありでしょう。","color":"white"}]
execute if score $PlayerCount Global matches 2.. run tellraw @s [{"text":"◆ 失ったアイテムについて\n","color":"light_purple"},{"text":"あなたたちの死亡時、所持していたアイテムはドロップする代わりに信仰する神によって全て保管されます。\n保管されたアイテムは島を浄化することで全て神殿に返還されます。\n島の浄化に苦戦する場合は信仰する神に対して慈悲を乞うのもありでしょう。","color":"white"}]


text:
#> lib:message/tutorial/artifact
#
# 「◆ 神器について
#   この世界には、**神器**と呼ばれる特別なアイテムが存在します。
#   しかしながら、使用するには神器の力を受け入れる神を信仰している必要があります。」
#
# @within function world_manager:area/01-03.tutorial-artifact

tellraw @s [{"text":"◆ 神器について\n","color":"light_purple"},{"text":"この世界には、","color":"white"},{"text":"神器","bold":true,"color":"light_purple"},{"text":"と呼ばれる特別なアイテムが存在します。\nしかしながら、使用するには神器の力を受け入れる神を信仰している必要があります。","color":"white"}]


text:
#> lib:message/tutorial/goal
#
# 「◆ 目標について
#   あなた[たち]の目標はただ一つ。この世界の**全てを浄化**することです。」
#
# @within function world_manager:area/01-01.tutorial-goal

execute if score $PlayerCount Global matches ..1 run tellraw @s [{"text":"◆ 目標について\n","color":"light_purple"},{"text":"あなたの目標はただ一つ。この世界の","color":"white"},{"text":"全てを浄化","bold":true,"color":"light_purple"},{"text":"することです。","color":"white"}]
execute if score $PlayerCount Global matches 2.. run tellraw @s [{"text":"◆ 目標について\n","color":"light_purple"},{"text":"あなたたちの目標はただ一つ。この世界の","color":"white"},{"text":"全てを浄化","bold":true,"color":"light_purple"},{"text":"することです。","color":"white"}]


text:
#> lib:message/tutorial/spawner
#
# 「◆ スポナーについて
#   この世界に置かれたスポナーはどんなツールや神器を使っても壊すことは出来ません。
#   しかし絶対に壊せないわけでもなく、そのスポナーより出現したモブを一定数倒すことで破壊が可能です。」
#
# @within function world_manager:area/01-05.tutorial-spawner

tellraw @s [{"text":"◆ スポナーについて\n","color":"light_purple"},{"text":"この世界に置かれたスポナーはどんなツールや神器を使っても壊すことは出来ません。\nしかし絶対に壊せないわけでもなく、そのスポナーより出現したモブを一定数倒すことで破壊が可能です。","color":"white"}]


text:
#> lib:message/tutorial/recommend
#
# 「◆ 推奨事項
#   目の前が開けた後、正面に見えるであろう島のポータルへ入り、神を信仰することを強く推奨します。」
#
# @within function world_manager:area/01-07.tutorial-recommend

tellraw @s [{"text":"◆ 推奨事項\n","color":"light_purple"},{"text":"目の前が開けた後、正面に見えるであろう島のポータルへ入り、神を信仰することを強く推奨します。","color":"white"}]


text:
#> lib:message/tutorial/island
#
# 「◆ 島について
#   この世界に存在する多くの島には呪われた神器が置かれており、島全体が呪われています。
#   その呪われた島々を浄化することがあなた[たち]の目標です。
#   浄化には、呪われた神器の周囲で__動かずに__スニークをし続ける必要があります。」
#
# @within function world_manager:area/01-02.tutorial-island

execute if score $PlayerCount Global matches ..1 run tellraw @s [{"text":"◆ 島について\n","color":"light_purple"},{"text":"この世界に存在する多くの島には呪われた神器が置かれており、島全体が呪われています。\nその呪われた島々を浄化することがあなたの目標です。\n浄化には、呪われた神器の周囲で","color":"white"},{"text":"動かずに","underlined": true,"color":"white"},{"text":"スニークをし続ける必要があります。","color":"white"}]
execute if score $PlayerCount Global matches 2.. run tellraw @s [{"text":"◆ 島について\n","color":"light_purple"},{"text":"この世界に存在する多くの島には呪われた神器が置かれており、島全体が呪われています。\nその呪われた島々を浄化することがあなたたちの目標です。\n浄化には、呪われた神器の周囲で","color":"white"},{"text":"動かずに","underlined": true,"color":"white"},{"text":"スニークをし続ける必要があります。","color":"white"}]


text:
#> lib:message/tutorial/religion
#
# 「◆ 信仰について
#   あなた[たち]は信仰する神を5柱の中から自由に選ぶことができ、様々な恩恵を受けることが出来ます。
#   もちろん改宗することも可能ですが、非常に冒涜的な行為であることに注意してください。」
#
# @within function world_manager:area/01-04.tutorial-religion

execute if score $PlayerCount Global matches ..1 run tellraw @s [{"text":"◆ 信仰について\n","color":"light_purple"},{"text":"あなたは信仰する神を5柱の中から自由に選ぶことができ、様々な恩恵を受けることが出来ます。\nもちろん改宗することも可能ですが、非常に冒涜的な行為であることに注意してください。","color":"white"}]
execute if score $PlayerCount Global matches 2.. run tellraw @s [{"text":"◆ 信仰について\n","color":"light_purple"},{"text":"あなたたちは信仰する神を5柱の中から自由に選ぶことができ、様々な恩恵を受けることが出来ます。\nもちろん改宗することも可能ですが、非常に冒涜的な行為であることに注意してください。","color":"white"}]


text:
#> lib:message/artifact/dont_have_require_items
#
# 「発動に必要なアイテムを所持していません。」
#
# @api

tellraw @s [{"text":"発動に必要なアイテムを所持していません。","color":"red"}]


text:
#> lib:message/artifact/can_not_use_here
#
# 「ここでは使用できません。」
#
# @api

tellraw @s [{"text":"ここでは使用できません。","color":"red"}]


text:
#> lib:message/god/urban/mercy
#
# 「ウルバン「汝にささやかながらの救済を！」」
#
# @within function player_manager:god/mercy/mercy

tellraw @s {"text":"ウルバン「汝にささやかながらの救済を！」"}


text:
#> lib:message/god/urban/unbelieve1
#
# 「ウルバン「貴様！よくもやってくれたな！」」
#
# @within function player_manager:god/change_believe/unbelieve1

tellraw @s {"text":"ウルバン「貴様！よくもやってくれたな！」"}


text:
#> lib:message/god/urban/believe2
#
# 「ウルバン「いつでも力を貸そう。吾は汝と共にあるぞ！」」
#
# @within function player_manager:god/change_believe/believe2

tellraw @s {"text":"ウルバン「いつでも力を貸そう。吾は汝と共にあるぞ！」"}


text:
#> lib:message/god/urban/unbelieve2
#
# 「ウルバン「吾は貴様を信じていた。しかし貴様は裏切った！」」
#
# @within function player_manager:god/change_believe/unbelieve2

tellraw @s {"text":"ウルバン「吾は貴様を信じていた。しかし貴様は裏切った！」"}


text:
#> lib:message/god/urban/blessing
#
#
#
# @within function player_manager:god/change_believe/on_check_blessing

tellraw @s [{"text":"","interpret":false},{"storage":"global","nbt":"GodIcon.Urban","interpret":true},{"text":" ウルバン"},{"text":"\n"},{"text":"常時恩恵:","color":"white"},{"text":"\n"},{"text":"  物理攻撃 +25%","color":"green"},{"text":"\n"},{"text":"  火攻撃 +10%","color":"green"},{"text":"\n"},{"text":"  魔法攻撃 -20%","color":"red"},{"text":"\n"},{"text":"  ノックバック軽減 +30%","color":"green"}]


text:
#> lib:message/god/urban/believe1
#
# 「ウルバン「吾を選ぶか！よかろう、汝の活躍に期待しているぞ！」」
#
# @within function player_manager:god/change_believe/believe1

tellraw @s {"text":"ウルバン「吾を選ぶか！よかろう、汝の活躍に期待しているぞ！」"}


text:
#> lib:message/god/flora/mercy
#
# 「フローラ「...うん。わかった」」
#
# @within function player_manager:god/mercy/mercy

tellraw @s {"text":"フローラ「...うん。わかった」"}


text:
#> lib:message/god/flora/unbelieve1
#
# 「フローラ「...裏切り者」」
#
# @within function player_manager:god/change_believe/unbelieve1

tellraw @s {"text":"フローラ「...裏切り者」"}


text:
#> lib:message/god/flora/believe2
#
# 「フローラ「花の祝福があらんことを...」」
#
# @within function player_manager:god/change_believe/believe2

tellraw @s {"text":"フローラ「花の祝福があらんことを...」"}


text:
#> lib:message/god/flora/unbelieve2
#
# 「フローラ「こんな事すると思ってなかった...」」
#
# @within function player_manager:god/change_believe/unbelieve2

tellraw @s {"text":"フローラ「こんな事すると思ってなかった...」"}


text:
#> lib:message/god/flora/blessing
#
#
#
# @within function player_manager:god/change_believe/on_check_blessing

tellraw @s [{"text":"","interpret":false},{"storage":"global","nbt":"GodIcon.Flora","interpret":true},{"text":" フローラ"},{"text":"\n"},{"text":"常時恩恵:","color":"white"},{"text":"\n"},{"text":"  水攻撃 +20%","color":"green"},{"text":"\n"},{"text":"  水耐性 +20%","color":"green"},{"text":"\n"},{"text":"  火耐性 -20%","color":"red"},{"text":"\n"},{"text":"雨が降っている場合:","color":"white"},{"text":"\n"},{"text":"  再生II","color":"green"}]


text:
#> lib:message/god/flora/believe1
#
# 「フローラ「よくきたね。君を歓迎するよ...」」
#
# @within function player_manager:god/change_believe/believe1

tellraw @s {"text":"フローラ「よくきたね。君を歓迎するよ...」"}


text:
#> lib:message/god/nyaptov/mercy
#
# 「ニャプトフ「ﾆｬｰ (求めよ、さらば与えられん...だっけ？)」」
#
# @within function player_manager:god/mercy/mercy

tellraw @s {"text":"ニャプトフ「ﾆｬｰ (求めよ、さらば与えられん...だっけ？)」"}


text:
#> lib:message/god/nyaptov/unbelieve1
#
# 「ニャプトフ「ﾆｬｰ (まあ...そんなもんだろうとは思っていたよ)」」
#
# @within function player_manager:god/change_believe/unbelieve1

tellraw @s {"text":"ニャプトフ「ﾆｬｰ (まあ...そんなもんだろうとは思っていたよ)」"}


text:
#> lib:message/god/nyaptov/believe2
#
# 「ニャプトフ「ﾆｬｰ (気が向いたら魚でも持ってきてくれないかい？)」」
#
# @within function player_manager:god/change_believe/believe2

tellraw @s {"text":"ニャプトフ「ﾆｬｰ (気が向いたら魚でも持ってきてくれないかい？)」"}


text:
#> lib:message/god/nyaptov/unbelieve2
#
# 「ニャプトフ「ﾆｬｰ...」」
#
# @within function player_manager:god/change_believe/unbelieve2

tellraw @s {"text":"ニャプトフ「ﾆｬｰ...」"}


text:
#> lib:message/god/nyaptov/blessing
#
#
#
# @within function player_manager:god/change_believe/on_check_blessing

tellraw @s [{"text":"","interpret":false},{"storage":"global","nbt":"GodIcon.Nyaptov","interpret":true},{"text":" ニャプトフ"},{"text":"\n"},{"text":"常時恩恵:","color":"white"},{"text":"\n"},{"text":"  回復 +30%","color":"green"},{"text":"\n"},{"text":"  攻撃 -20%","color":"red"},{"text":"\n"},{"text":"  水耐性 -20%","color":"red"},{"text":"\n"},{"text":"25m落下している場合:","color":"white"},{"text":"\n"},{"text":"  低速落下","color":"green"}]


text:
#> lib:message/god/nyaptov/believe1
#
# 「ニャプトフ「ﾆｬｰ (そうかい、せいぜい頑張ってくれ給えよ)」」
#
# @within function player_manager:god/change_believe/believe1

tellraw @s {"text":"ニャプトフ「ﾆｬｰ (そうかい、せいぜい頑張ってくれ給えよ)」"}


text:
#> lib:message/god/rumor/mercy
#
# 「ルーモア「これくらいしかしてあげれないけど...」」
#
# @within function player_manager:god/mercy/mercy

tellraw @s {"text":"ルーモア「これくらいしかしてあげれないけど...」"}


text:
#> lib:message/god/rumor/unbelieve1
#
# 「ルーモア「信じらんない！何を考えてるの！！」」
#
# @within function player_manager:god/change_believe/unbelieve1

tellraw @s {"text":"ルーモア「信じらんない！何を考えてるの！！」"}


text:
#> lib:message/god/rumor/believe2
#
# 「ルーモア「これで友達だからね！！」」
#
# @within function player_manager:god/change_believe/believe2

tellraw @s {"text":"ルーモア「これで友達だからね！！」"}


text:
#> lib:message/god/rumor/unbelieve2
#
# 「ルーモア「もういい！どっかに行ってればいいよ！」」
#
# @within function player_manager:god/change_believe/unbelieve2

tellraw @s {"text":"ルーモア「もういい！どっかに行ってればいいよ！」"}


text:
#> lib:message/god/rumor/blessing
#
#
#
# @within function player_manager:god/change_believe/on_check_blessing

tellraw @s [{"text":"","interpret":false},{"storage":"global","nbt":"GodIcon.Rumor","interpret":true},{"text":" ルーモア"},{"text":"\n"},{"text":"常時恩恵:","color":"white"},{"text":"\n"},{"text":"  攻撃 -10%","color":"red"},{"text":"\n"},{"text":"  耐性 -10%","color":"red"},{"text":"\n"},{"text":"  雷攻撃 +15%","color":"green"},{"text":"\n"},{"text":"  雷耐性 -15%","color":"red"},{"text":"\n"},{"text":"友好モブが近くにいる場合:","color":"white"},{"text":"\n"},{"text":"  攻撃 +30%","color":"green"},{"text":"\n"},{"text":"  耐性 +30%","color":"green"},{"text":"\n"},{"text":"  MP回復量 +0.5%","color":"green"}]


text:
#> lib:message/god/rumor/believe1
#
# 「ルーモア「私を信仰してくれるの？大歓迎だからね！」」
#
# @within function player_manager:god/change_believe/believe1

tellraw @s {"text":"ルーモア「私を信仰してくれるの？大歓迎だからね！」"}


text:
#> lib:message/god/wi-ki/mercy
#
# 「ウィ＝キ「さあ、受け取ってくれ」」
#
# @within function player_manager:god/mercy/mercy

tellraw @s {"text":"ウィ＝キ「さあ、受け取ってくれ」"}


text:
#> lib:message/god/wi-ki/unbelieve1
#
# 「ウィ＝キ「結局君もその程度だったのか」」
#
# @within function player_manager:god/change_believe/unbelieve1

tellraw @s {"text":"ウィ＝キ「結局君もその程度だったのか」"}


text:
#> lib:message/god/wi-ki/believe2
#
# 「ウィ＝キ「さあ、マナ本来の力を引き出してみせよう」」
#
# @within function player_manager:god/change_believe/believe2

tellraw @s {"text":"ウィ＝キ「さあ、マナ本来の力を引き出してみせよう」"}


text:
#> lib:message/god/wi-ki/unbelieve2
#
# 「ウィ＝キ「信仰は脆く、そして弱いものだよ」」
#
# @within function player_manager:god/change_believe/unbelieve2

tellraw @s {"text":"ウィ＝キ「信仰は脆く、そして弱いものだよ」"}


text:
#> lib:message/god/wi-ki/blessing
#
#
#
# @within function player_manager:god/change_believe/on_check_blessing

tellraw @s [{"text":"","interpret":false},{"storage":"global","nbt":"GodIcon.Wi-ki","interpret":true},{"text":" ウィ＝キ"},{"text":"\n"},{"text":"常時恩恵:","color":"white"},{"text":"\n"},{"text":"  魔法攻撃 +15%","color":"green"},{"text":"\n"},{"text":"  魔法耐性 +20%","color":"green"},{"text":"\n"},{"text":"  火耐性 -30%","color":"red"},{"text":"\n"},{"text":"炎上している場合:","color":"white"},{"text":"\n"},{"text":"  耐性 -50%","color":"red"}]


text:
#> lib:message/god/wi-ki/believe1
#
# 「ウィ＝キ「僕を選ぶのか、まあ...期待しておくことにするよ」」
#
# @within function player_manager:god/change_believe/believe1

tellraw @s {"text":"ウィ＝キ「僕を選ぶのか、まあ...期待しておくことにするよ」"}


text:
#> lib:message/common/dispel_island
#
# 「島を浄化した！」
#
# @within function asset_manager:island/dispel/successful

title @a times 10 60 30
title @a title [{"text":"ISLAND PURIFIED","bold":true,"color":"light_purple"}]

tellraw @a [{"text":"[!] すべてのアイテムが神殿に返還された。","color":"yellow"}]


text:
#> lib:message/common/die/fire
#
#
#
# @within function lib:score_to_health_wrapper/core/show_common_death_message

#> Random
# @private
#declare score_holder $Random

execute store result score $Random Temporary run function lib:random/
scoreboard players operation $Random Temporary %= $3 Const

execute if score $Random Temporary matches 0 run tellraw @a [{"translate": "%2$sによって%1$sは燃え尽き真っ白になった。","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]
execute if score $Random Temporary matches 1 run tellraw @a [{"translate": "%2$sは%1$sを消し炭にした。","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]
execute if score $Random Temporary matches 2 run tellraw @a [{"translate": "%1$sは%2$sによってロウソクとしてその生涯を終えた。","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]


text:
#> lib:message/common/die/water
#
#
#
# @within function lib:score_to_health_wrapper/core/show_common_death_message

#> Random
# @private
#declare score_holder $Random

execute store result score $Random Temporary run function lib:random/
scoreboard players operation $Random Temporary %= $3 Const

execute if score $Random Temporary matches 0 run tellraw @a [{"translate": "%1$sは%2$sによって真っ青になった。","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]
execute if score $Random Temporary matches 1 run tellraw @a [{"translate": "%1$sは%2$sによって冷たくなった。","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]
execute if score $Random Temporary matches 2 run tellraw @a [{"translate": "%2$sによって%1$sはふやけてしまった。","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]


text:
#> lib:message/common/die/physical
#
#
#
# @within function lib:score_to_health_wrapper/core/show_common_death_message

#> Random
# @private
#declare score_holder $Random

execute store result score $Random Temporary run function lib:random/
scoreboard players operation $Random Temporary %= $100 Const

execute if score $Random Temporary matches 00 run tellraw @a [{"translate": "%2$sの物理的要因によって、%1$sは生命活動の停止を確認... 死んだのだ","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]
execute if score $Random Temporary matches 01..33 run tellraw @a [{"translate": "%1$sは%2$sによって身体を見るも無残な姿と化した。","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]
execute if score $Random Temporary matches 34..66 run tellraw @a [{"translate": "%1$sは%2$sに切り裂かれた。","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]
execute if score $Random Temporary matches 67..99 run tellraw @a [{"translate": "%1$sは%2$sによって床のシミとなった。","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]


text:
#> lib:message/common/die/unknown
#
#
#
# @within function lib:score_to_health_wrapper/core/show_common_death_message

tellraw @a [{"translate": "%1$sは未知の力によってその命を終えた","with":[{"selector":"@s"}]}]


text:
#> lib:message/common/die/thunder
#
#
#
# @within function lib:score_to_health_wrapper/core/show_common_death_message

#> Random
# @private
#declare score_holder $Random

execute store result score $Random Temporary run function lib:random/
scoreboard players operation $Random Temporary %= $3 Const

execute if score $Random Temporary matches 0 run tellraw @a [{"translate": "%1$sは%2$sによって電撃に撃たれ目の前が真っ暗になった。","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]
execute if score $Random Temporary matches 1 run tellraw @a [{"translate": "%2$sによって%1$sの身体はシビレ、心停止した。","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]
execute if score $Random Temporary matches 2 run tellraw @a [{"translate": "%2$sによってその時%1$sに電流が走る。・・・ひらめきはなかった。","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]


text:
#> lib:message/common/die/magic
#
#
#
# @within function lib:score_to_health_wrapper/core/show_common_death_message

#> Random
# @private
#declare score_holder $Random

execute store result score $Random Temporary run function lib:random/
scoreboard players operation $Random Temporary %= $3 Const

execute if score $Random Temporary matches 0 run tellraw @a [{"translate": "%1$sは%2$sによって跡形もなく消し飛ばされた。","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]
execute if score $Random Temporary matches 1 run tellraw @a [{"translate": "%1$sは%2$sの魔力に飲まれ死んだ。","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]
execute if score $Random Temporary matches 2 run tellraw @a [{"translate": "%1$sは%2$sの魔力衝撃によって幽体離脱を経験した。","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]


text:
#> mob_manager:_index.d
# @private

#> General purpose Tag
# @public
    #declare tag Friend
    #declare tag Enemy
    #declare tag Enemy.Boss
    #declare tag Projectile
    #declare tag Npc
    #declare tag Object
    #declare tag Uninterferable

#> InitTag
# @within function
#   core:tick/
#   mob_manager:init/
    #declare tag AlreadyInitMob

#> FlagIndex
# @within function
#   mob_manager:init/
#   asset_manager:island/dispel/boss/summon
    #declare score_holder $FlagIndex

#> FindFlag
# @within *
#   mob_manager:init/add_flag
#   mob_manager:entity_finder/**
#   api:damage/core/trigger_on_**
#   asset:mob/death/abstract_detect_item
    #declare tag FindFlag0.0
    #declare tag FindFlag0.1
    #declare tag FindFlag1.0
    #declare tag FindFlag1.1
    #declare tag FindFlag2.0
    #declare tag FindFlag2.1
    #declare tag FindFlag3.0
    #declare tag FindFlag3.1
    #declare tag FindFlag4.0
    #declare tag FindFlag4.1
    #declare tag FindFlag5.0
    #declare tag FindFlag5.1
    #declare tag FindFlag6.0
    #declare tag FindFlag6.1
    #declare tag FindFlag7.0
    #declare tag FindFlag7.1
    #declare tag FindFlag8.0
    #declare tag FindFlag8.1
    #declare tag FindFlag9.0
    #declare tag FindFlag9.1
    #declare tag FindFlag10.0
    #declare tag FindFlag10.1
    #declare tag FindFlag11.0
    #declare tag FindFlag11.1
    #declare tag FindFlag12.0
    #declare tag FindFlag12.1
    #declare tag FindFlag13.0
    #declare tag FindFlag13.1
    #declare tag FindFlag14.0
    #declare tag FindFlag14.1
    #declare tag FindFlag15.0
    #declare tag FindFlag15.1
    #declare tag TargetEntity


text:
#> mob_manager:init/set_tag_and_team
#
#
#
# @within function mob_manager:init/

execute unless entity @s[type=!#lib:passive,type=!#lib:neutral_friend] run tag @s add Friend
execute unless entity @s[type=!#lib:hostile,type=!#lib:neutral_enemy] run tag @s add Enemy
execute unless entity @s[type=!#lib:hostile,type=!#lib:neutral_enemy] run team join Enemy


text:
#> mob_manager:init/add_flag
#
# Mobにフラグをセットします
#
# @within function mob_manager:init/

#> Private
# @private
    #declare score_holder $CloneFlagIndex

# グローバルインデックス増加
    scoreboard players add $FlagIndex Global 1
    scoreboard players operation $FlagIndex Global %= $2^15 Const
    execute if score $FlagIndex Global matches 0 run scoreboard players add $FlagIndex Global 1
# 直接UUIDとして突っ込む
    scoreboard players operation @s MobUUID = $FlagIndex Global
# Clone
    scoreboard players operation $CloneFlagIndex Temporary = $FlagIndex Global
# FlagIndex << 16
    scoreboard players operation $CloneFlagIndex Temporary *= $2^16 Const
# オーバーフローしてたらtag追加
    execute if score $CloneFlagIndex Temporary matches 00.. run tag @s add FindFlag0.0
    execute if score $CloneFlagIndex Temporary matches ..-1 run tag @s add FindFlag0.1
# 0になるまでやる
    scoreboard players operation $CloneFlagIndex Temporary *= $2 Const
    execute if score $CloneFlagIndex Temporary matches 00.. run tag @s add FindFlag1.0
    execute if score $CloneFlagIndex Temporary matches ..-1 run tag @s add FindFlag1.1
    scoreboard players operation $CloneFlagIndex Temporary *= $2 Const
    execute if score $CloneFlagIndex Temporary matches 00.. run tag @s add FindFlag2.0
    execute if score $CloneFlagIndex Temporary matches ..-1 run tag @s add FindFlag2.1
    scoreboard players operation $CloneFlagIndex Temporary *= $2 Const
    execute if score $CloneFlagIndex Temporary matches 00.. run tag @s add FindFlag3.0
    execute if score $CloneFlagIndex Temporary matches ..-1 run tag @s add FindFlag3.1
    scoreboard players operation $CloneFlagIndex Temporary *= $2 Const
    execute if score $CloneFlagIndex Temporary matches 00.. run tag @s add FindFlag4.0
    execute if score $CloneFlagIndex Temporary matches ..-1 run tag @s add FindFlag4.1
    scoreboard players operation $CloneFlagIndex Temporary *= $2 Const
    execute if score $CloneFlagIndex Temporary matches 00.. run tag @s add FindFlag5.0
    execute if score $CloneFlagIndex Temporary matches ..-1 run tag @s add FindFlag5.1
    scoreboard players operation $CloneFlagIndex Temporary *= $2 Const
    execute if score $CloneFlagIndex Temporary matches 00.. run tag @s add FindFlag6.0
    execute if score $CloneFlagIndex Temporary matches ..-1 run tag @s add FindFlag6.1
    scoreboard players operation $CloneFlagIndex Temporary *= $2 Const
    execute if score $CloneFlagIndex Temporary matches 00.. run tag @s add FindFlag7.0
    execute if score $CloneFlagIndex Temporary matches ..-1 run tag @s add FindFlag7.1
    scoreboard players operation $CloneFlagIndex Temporary *= $2 Const
    execute if score $CloneFlagIndex Temporary matches 00.. run tag @s add FindFlag8.0
    execute if score $CloneFlagIndex Temporary matches ..-1 run tag @s add FindFlag8.1
    scoreboard players operation $CloneFlagIndex Temporary *= $2 Const
    execute if score $CloneFlagIndex Temporary matches 00.. run tag @s add FindFlag9.0
    execute if score $CloneFlagIndex Temporary matches ..-1 run tag @s add FindFlag9.1
    scoreboard players operation $CloneFlagIndex Temporary *= $2 Const
    execute if score $CloneFlagIndex Temporary matches 00.. run tag @s add FindFlag10.0
    execute if score $CloneFlagIndex Temporary matches ..-1 run tag @s add FindFlag10.1
    scoreboard players operation $CloneFlagIndex Temporary *= $2 Const
    execute if score $CloneFlagIndex Temporary matches 00.. run tag @s add FindFlag11.0
    execute if score $CloneFlagIndex Temporary matches ..-1 run tag @s add FindFlag11.1
    scoreboard players operation $CloneFlagIndex Temporary *= $2 Const
    execute if score $CloneFlagIndex Temporary matches 00.. run tag @s add FindFlag12.0
    execute if score $CloneFlagIndex Temporary matches ..-1 run tag @s add FindFlag12.1
    scoreboard players operation $CloneFlagIndex Temporary *= $2 Const
    execute if score $CloneFlagIndex Temporary matches 00.. run tag @s add FindFlag13.0
    execute if score $CloneFlagIndex Temporary matches ..-1 run tag @s add FindFlag13.1
    scoreboard players operation $CloneFlagIndex Temporary *= $2 Const
    execute if score $CloneFlagIndex Temporary matches 00.. run tag @s add FindFlag14.0
    execute if score $CloneFlagIndex Temporary matches ..-1 run tag @s add FindFlag14.1
    scoreboard players operation $CloneFlagIndex Temporary *= $2 Const
    execute if score $CloneFlagIndex Temporary matches 00.. run tag @s add FindFlag15.0
    execute if score $CloneFlagIndex Temporary matches ..-1 run tag @s add FindFlag15.1
# リセット
    scoreboard players reset $CloneFlagIndex Temporary


text:
#> mob_manager:init/modify_health
#
#
#
# @within function mob_manager:init/

# 最大値を記録する
    execute store result score @s MobHealthMax run attribute @s generic.max_health get 1
# 付近雑魚のHPマルチ補正をかける
    execute if entity @s[tag=Enemy] run function mob_manager:init/multiplay_multiplier/normal
# 体力を緩衝体力に移す
    execute store result entity @s AbsorptionAmount float 1 run scoreboard players get @s MobHealthMax
    attribute @s generic.max_health base set 0.01
    data modify entity @s Health set value 0.01f


text:
#> mob_manager:init/multiplay_multiplier/normal
#
#
#
# @input score MobHealthMax
# @output score MobHealthMax
# @within function
#   mob_manager:init/modify_health
#   asset_manager:mob/summon/set_data

#> Val
# @private
    #declare score_holder $NearbyPlayerCount
    #declare score_holder $MultiplayMultiplierBase
    #declare score_holder $MultiplayMultiplier

# 周囲のプレイヤー数を取得する (e0)
    execute at @s store result score $NearbyPlayerCount Temporary if entity @a[distance=..75]
# ベース倍率 0.7(e1)
    scoreboard players set $MultiplayMultiplierBase Temporary 7
# マルチ補正倍率 0.3(e1)
    scoreboard players set $MultiplayMultiplier Temporary 3
# マルチ補正倍率の計算 0.3(e1) * N(e0) + 0.7(e1)
    scoreboard players operation $MultiplayMultiplier Temporary *= $NearbyPlayerCount Temporary
    scoreboard players operation $MultiplayMultiplier Temporary += $MultiplayMultiplierBase Temporary
# マルチ補正倍率の保存
    scoreboard players operation @s MobMaxHealthMultiplier = $MultiplayMultiplier Temporary
# マルチ補正の適用 (e1 -> e0)
    scoreboard players operation @s MobHealthMax *= $MultiplayMultiplier Temporary
    scoreboard players operation @s MobHealthMax /= $10 Const
# リセット
    scoreboard players reset $NearbyPlayerCount Temporary
    scoreboard players reset $MultiplayMultiplier Temporary
    scoreboard players reset $MultiplayMultiplierBase Temporary


text:
#> mob_manager:init/multiplay_multiplier/angel
#
#
#
# @input score MobHealthMax
# @output score MobHealthMax
# @within function asset_manager:mob/summon/set_data

#> Val
# @private
    #declare score_holder $NearbyPlayerCount
    #declare score_holder $MultiplayMultiplierBase
    #declare score_holder $MultiplayMultiplier

# ベース倍率 0.4(e1)
    scoreboard players set $MultiplayMultiplierBase Temporary 4
# マルチ補正倍率 0.6(e1)
    scoreboard players set $MultiplayMultiplier Temporary 6
# マルチ補正倍率の計算 0.6(e1) * N(e0) + 0.4(e1)
    scoreboard players operation $MultiplayMultiplier Temporary *= $PlayerCount Global
    scoreboard players operation $MultiplayMultiplier Temporary += $MultiplayMultiplierBase Temporary
# マルチ補正倍率の保存
    scoreboard players operation @s MobMaxHealthMultiplier = $MultiplayMultiplier Temporary
# マルチ補正の適用 (e1 -> e0)
    scoreboard players operation @s MobHealthMax *= $MultiplayMultiplier Temporary
    scoreboard players operation @s MobHealthMax /= $10 Const
# リセット
    scoreboard players reset $NearbyPlayerCount Temporary
    scoreboard players reset $MultiplayMultiplier Temporary
    scoreboard players reset $MultiplayMultiplierBase Temporary


text:
#> mob_manager:entity_finder/attacked_entity/fetch_attacked_entity
#
# 多分このfunctionの実行者は攻撃したEntityであるはず
#
# @within function mob_manager:entity_finder/attacked_entity/filters/0

# 軽量にセレクターを利用する用のtag
    tag @s add AttackedEntity
# 紐づけ用スコア
    scoreboard players operation @s AttackedEntity = @p[tag=TargetEntity] UserID
    scoreboard players operation @p[tag=TargetEntity] AttackedEntity = @p[tag=TargetEntity] UserID


text:
#> mob_manager:entity_finder/attacked_entity/on_attack
#
# 攻撃対象を特定します
#
# @within advancement mob_manager:entity_finder/check_attacked_entity

# tag付け
    tag @s add TargetEntity
# フィルタ
    execute unless entity @e[type=#lib:living,type=!player,tag=VictimFromLibrary,distance=..150,limit=1] as @e[type=#lib:living,type=!player,nbt=!{HurtTime:0s},distance=..150] run function mob_manager:entity_finder/attacked_entity/filters/15
    execute as @e[type=#lib:living,type=!player,tag=VictimFromLibrary,distance=..150] run function mob_manager:entity_finder/attacked_entity/filters/15
# リセット
    tag @s remove TargetEntity
    advancement revoke @s only mob_manager:entity_finder/check_attacked_entity


text:
#> mob_manager:entity_finder/attacked_entity/_index.d
# @private

#> 攻撃したEntity
# `@e[type=#lib:living,type=!player,tag=AttackedEntity,distance=..150]`
# @public function
#   mob_manager:entity_finder/attacked_entity/**
#   asset_manager:artifact/triggers/
#   asset_manager:mob/triggers/tick_check
    #declare tag AttackedEntity

#> フラグ
# @within function mob_manager:entity_finder/attacked_entity/**
    #declare storage mob_manager:attacked_entity
    #declare score_holder $AttackedEntityIndex

#> lib:damage/からの攻撃検出用
# @within function
#   mob_manager:entity_finder/attacked_entity/on_attack
#   api:damage/core/trigger_on_attack
    #declare tag VictimFromLibrary


text:
#> mob_manager:entity_finder/attacked_entity/reset
#
# スコア等のリセット
#
# @within function core:tick/

scoreboard players reset @a[scores={AttackedEntity=-2147483648..}] AttackedEntity
scoreboard players reset @e[type=#lib:living,type=!player,tag=AttackedEntity] AttackedEntity
tag @e[type=#lib:living,type=!player,tag=AttackedEntity] remove AttackedEntity


text:
#> mob_manager:entity_finder/attacked_entity/filters/1
#
# 攻撃先のエンティティ候補を絞っていく
#
# @within function mob_manager:entity_finder/attacked_entity/filters/2

execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacked_entity={1-0=true}}] if entity @s[tag=FindFlag1.0] run function mob_manager:entity_finder/attacked_entity/filters/0
execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacked_entity={1-1=true}}] if entity @s[tag=FindFlag1.1] run function mob_manager:entity_finder/attacked_entity/filters/0


text:
#> mob_manager:entity_finder/attacked_entity/filters/5
#
# 攻撃先のエンティティ候補を絞っていく
#
# @within function mob_manager:entity_finder/attacked_entity/filters/6

execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacked_entity={5-0=true}}] if entity @s[tag=FindFlag5.0] run function mob_manager:entity_finder/attacked_entity/filters/4
execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacked_entity={5-1=true}}] if entity @s[tag=FindFlag5.1] run function mob_manager:entity_finder/attacked_entity/filters/4


text:
#> mob_manager:entity_finder/attacked_entity/filters/13
#
# 攻撃先のエンティティ候補を絞っていく
#
# @within function mob_manager:entity_finder/attacked_entity/filters/14

execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacked_entity={13-0=true}}] if entity @s[tag=FindFlag13.0] run function mob_manager:entity_finder/attacked_entity/filters/12
execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacked_entity={13-1=true}}] if entity @s[tag=FindFlag13.1] run function mob_manager:entity_finder/attacked_entity/filters/12


text:
#> mob_manager:entity_finder/attacked_entity/filters/7
#
# 攻撃先のエンティティ候補を絞っていく
#
# @within function mob_manager:entity_finder/attacked_entity/filters/8

execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacked_entity={7-0=true}}] if entity @s[tag=FindFlag7.0] run function mob_manager:entity_finder/attacked_entity/filters/6
execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacked_entity={7-1=true}}] if entity @s[tag=FindFlag7.1] run function mob_manager:entity_finder/attacked_entity/filters/6


text:
#> mob_manager:entity_finder/attacked_entity/filters/2
#
# 攻撃先のエンティティ候補を絞っていく
#
# @within function mob_manager:entity_finder/attacked_entity/filters/3

execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacked_entity={2-0=true}}] if entity @s[tag=FindFlag2.0] run function mob_manager:entity_finder/attacked_entity/filters/1
execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacked_entity={2-1=true}}] if entity @s[tag=FindFlag2.1] run function mob_manager:entity_finder/attacked_entity/filters/1


text:
#> mob_manager:entity_finder/attacked_entity/filters/6
#
# 攻撃先のエンティティ候補を絞っていく
#
# @within function mob_manager:entity_finder/attacked_entity/filters/7

execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacked_entity={6-0=true}}] if entity @s[tag=FindFlag6.0] run function mob_manager:entity_finder/attacked_entity/filters/5
execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacked_entity={6-1=true}}] if entity @s[tag=FindFlag6.1] run function mob_manager:entity_finder/attacked_entity/filters/5


text:
#> mob_manager:entity_finder/attacked_entity/filters/8
#
# 攻撃先のエンティティ候補を絞っていく
#
# @within function mob_manager:entity_finder/attacked_entity/filters/9

execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacked_entity={8-0=true}}] if entity @s[tag=FindFlag8.0] run function mob_manager:entity_finder/attacked_entity/filters/7
execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacked_entity={8-1=true}}] if entity @s[tag=FindFlag8.1] run function mob_manager:entity_finder/attacked_entity/filters/7


text:
#> mob_manager:entity_finder/attacked_entity/filters/11
#
# 攻撃先のエンティティ候補を絞っていく
#
# @within function mob_manager:entity_finder/attacked_entity/filters/12

execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacked_entity={11-0=true}}] if entity @s[tag=FindFlag11.0] run function mob_manager:entity_finder/attacked_entity/filters/10
execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacked_entity={11-1=true}}] if entity @s[tag=FindFlag11.1] run function mob_manager:entity_finder/attacked_entity/filters/10


text:
#> mob_manager:entity_finder/attacked_entity/filters/10
#
# 攻撃先のエンティティ候補を絞っていく
#
# @within function mob_manager:entity_finder/attacked_entity/filters/11

execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacked_entity={10-0=true}}] if entity @s[tag=FindFlag10.0] run function mob_manager:entity_finder/attacked_entity/filters/9
execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacked_entity={10-1=true}}] if entity @s[tag=FindFlag10.1] run function mob_manager:entity_finder/attacked_entity/filters/9


text:
#> mob_manager:entity_finder/attacked_entity/filters/15
#
# 攻撃先のエンティティ候補を絞っていく
#
# @within function mob_manager:entity_finder/attacked_entity/on_attack

execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacked_entity={15-0=true}}] if entity @s[tag=FindFlag15.0] run function mob_manager:entity_finder/attacked_entity/filters/14
execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacked_entity={15-1=true}}] if entity @s[tag=FindFlag15.1] run function mob_manager:entity_finder/attacked_entity/filters/14


text:
#> mob_manager:entity_finder/attacked_entity/filters/3
#
# 攻撃先のエンティティ候補を絞っていく
#
# @within function mob_manager:entity_finder/attacked_entity/filters/4

execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacked_entity={3-0=true}}] if entity @s[tag=FindFlag3.0] run function mob_manager:entity_finder/attacked_entity/filters/2
execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacked_entity={3-1=true}}] if entity @s[tag=FindFlag3.1] run function mob_manager:entity_finder/attacked_entity/filters/2


text:
#> mob_manager:entity_finder/attacked_entity/filters/12
#
# 攻撃先のエンティティ候補を絞っていく
#
# @within function mob_manager:entity_finder/attacked_entity/filters/13

execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacked_entity={12-0=true}}] if entity @s[tag=FindFlag12.0] run function mob_manager:entity_finder/attacked_entity/filters/11
execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacked_entity={12-1=true}}] if entity @s[tag=FindFlag12.1] run function mob_manager:entity_finder/attacked_entity/filters/11


text:
#> mob_manager:entity_finder/attacked_entity/filters/4
#
# 攻撃先のエンティティ候補を絞っていく
#
# @within function mob_manager:entity_finder/attacked_entity/filters/5

execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacked_entity={4-0=true}}] if entity @s[tag=FindFlag4.0] run function mob_manager:entity_finder/attacked_entity/filters/3
execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacked_entity={4-1=true}}] if entity @s[tag=FindFlag4.1] run function mob_manager:entity_finder/attacked_entity/filters/3


text:
#> mob_manager:entity_finder/attacked_entity/filters/9
#
# 攻撃先のエンティティ候補を絞っていく
#
# @within function mob_manager:entity_finder/attacked_entity/filters/10

execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacked_entity={9-0=true}}] if entity @s[tag=FindFlag9.0] run function mob_manager:entity_finder/attacked_entity/filters/8
execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacked_entity={9-1=true}}] if entity @s[tag=FindFlag9.1] run function mob_manager:entity_finder/attacked_entity/filters/8


text:
#> mob_manager:entity_finder/attacked_entity/filters/0
#
# 攻撃先のエンティティ候補を絞っていく
#
# @within function mob_manager:entity_finder/attacked_entity/filters/1

execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacked_entity={0-0=true}}] if entity @s[tag=FindFlag0.0] run function mob_manager:entity_finder/attacked_entity/fetch_attacked_entity
execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacked_entity={0-1=true}}] if entity @s[tag=FindFlag0.1] run function mob_manager:entity_finder/attacked_entity/fetch_attacked_entity


text:
#> mob_manager:entity_finder/attacked_entity/filters/14
#
# 攻撃先のエンティティ候補を絞っていく
#
# @within function mob_manager:entity_finder/attacked_entity/filters/15

execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacked_entity={14-0=true}}] if entity @s[tag=FindFlag14.0] run function mob_manager:entity_finder/attacked_entity/filters/13
execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacked_entity={14-1=true}}] if entity @s[tag=FindFlag14.1] run function mob_manager:entity_finder/attacked_entity/filters/13


text:
#> mob_manager:entity_finder/attacking_entity/fetch_attacking_entity
#
# 多分このfunctionの実行者は攻撃してきたEntityであるはず
#
# @within function mob_manager:entity_finder/attacking_entity/filters/0

# 軽量にセレクターを利用する用のtag
    tag @s add AttackingEntity
# 紐づけ用スコア
    scoreboard players operation @s AttackingEntity = @p[tag=TargetEntity] UserID
    scoreboard players operation @p[tag=TargetEntity] AttackingEntity = @p[tag=TargetEntity] UserID


text:
#> mob_manager:entity_finder/attacking_entity/on_hurt
#
# 被攻撃対象を特定します
#
# @within advancement mob_manager:entity_finder/check_attacking_entity

# tag付け
    tag @s add TargetEntity
# フィルタ
    execute unless entity @e[type=#lib:living,type=!player,tag=AttackerFromLibrary,distance=..150,limit=1] as @e[type=#lib:living,type=!player,distance=..150] run function mob_manager:entity_finder/attacking_entity/filters/15
    execute as @e[type=#lib:living,type=!player,tag=AttackerFromLibrary,distance=..150] run function mob_manager:entity_finder/attacking_entity/filters/15
# リセット
    tag @s remove TargetEntity
    advancement revoke @s only mob_manager:entity_finder/check_attacking_entity


text:
#> mob_manager:entity_finder/attacking_entity/_index.d
# @private

#> 攻撃してきたEntity
# `@e[type=#lib:living,type=!player,tag=AttackingEntity,distance=..150]`
# @public function
#   mob_manager:entity_finder/attacking_entity/**
#   asset_manager:artifact/triggers/
#   asset_manager:mob/triggers/tick_check
    #declare tag AttackingEntity

#> フラグ
# @within function mob_manager:entity_finder/attacking_entity/**
    #declare storage mob_manager:attacking_entity
    #declare score_holder $AttackingEntityIndex

#> lib:damage/からの攻撃検出用
# @within function
#   mob_manager:entity_finder/attacking_entity/on_hurt
#   api:damage/core/trigger_on_damage/as_attacker
    #declare tag AttackerFromLibrary


text:
#> mob_manager:entity_finder/attacking_entity/reset
#
# スコア等のリセット
#
# @within function core:tick/

scoreboard players reset @a[scores={AttackingEntity=-2147483648..}] AttackingEntity
scoreboard players reset @e[type=#lib:living,type=!player,tag=AttackingEntity] AttackingEntity
tag @e[type=#lib:living,type=!player,tag=AttackingEntity] remove AttackingEntity


text:
#> mob_manager:entity_finder/attacking_entity/filters/1
#
# 攻撃元のエンティティ候補を絞っていく
#
# @within function mob_manager:entity_finder/attacking_entity/filters/2

execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacking_entity={1-0=true}}] if entity @s[tag=FindFlag1.0] run function mob_manager:entity_finder/attacking_entity/filters/0
execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacking_entity={1-1=true}}] if entity @s[tag=FindFlag1.1] run function mob_manager:entity_finder/attacking_entity/filters/0


text:
#> mob_manager:entity_finder/attacking_entity/filters/5
#
# 攻撃元のエンティティ候補を絞っていく
#
# @within function mob_manager:entity_finder/attacking_entity/filters/6

execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacking_entity={5-0=true}}] if entity @s[tag=FindFlag5.0] run function mob_manager:entity_finder/attacking_entity/filters/4
execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacking_entity={5-1=true}}] if entity @s[tag=FindFlag5.1] run function mob_manager:entity_finder/attacking_entity/filters/4


text:
#> mob_manager:entity_finder/attacking_entity/filters/13
#
# 攻撃元のエンティティ候補を絞っていく
#
# @within function mob_manager:entity_finder/attacking_entity/filters/14

execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacking_entity={13-0=true}}] if entity @s[tag=FindFlag13.0] run function mob_manager:entity_finder/attacking_entity/filters/12
execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacking_entity={13-1=true}}] if entity @s[tag=FindFlag13.1] run function mob_manager:entity_finder/attacking_entity/filters/12


text:
#> mob_manager:entity_finder/attacking_entity/filters/7
#
# 攻撃元のエンティティ候補を絞っていく
#
# @within function mob_manager:entity_finder/attacking_entity/filters/8

execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacking_entity={7-0=true}}] if entity @s[tag=FindFlag7.0] run function mob_manager:entity_finder/attacking_entity/filters/6
execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacking_entity={7-1=true}}] if entity @s[tag=FindFlag7.1] run function mob_manager:entity_finder/attacking_entity/filters/6


text:
#> mob_manager:entity_finder/attacking_entity/filters/2
#
# 攻撃元のエンティティ候補を絞っていく
#
# @within function mob_manager:entity_finder/attacking_entity/filters/3

execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacking_entity={2-0=true}}] if entity @s[tag=FindFlag2.0] run function mob_manager:entity_finder/attacking_entity/filters/1
execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacking_entity={2-1=true}}] if entity @s[tag=FindFlag2.1] run function mob_manager:entity_finder/attacking_entity/filters/1


text:
#> mob_manager:entity_finder/attacking_entity/filters/6
#
# 攻撃元のエンティティ候補を絞っていく
#
# @within function mob_manager:entity_finder/attacking_entity/filters/7

execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacking_entity={6-0=true}}] if entity @s[tag=FindFlag6.0] run function mob_manager:entity_finder/attacking_entity/filters/5
execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacking_entity={6-1=true}}] if entity @s[tag=FindFlag6.1] run function mob_manager:entity_finder/attacking_entity/filters/5


text:
#> mob_manager:entity_finder/attacking_entity/filters/8
#
# 攻撃元のエンティティ候補を絞っていく
#
# @within function mob_manager:entity_finder/attacking_entity/filters/9

execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacking_entity={8-0=true}}] if entity @s[tag=FindFlag8.0] run function mob_manager:entity_finder/attacking_entity/filters/7
execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacking_entity={8-1=true}}] if entity @s[tag=FindFlag8.1] run function mob_manager:entity_finder/attacking_entity/filters/7


text:
#> mob_manager:entity_finder/attacking_entity/filters/11
#
# 攻撃元のエンティティ候補を絞っていく
#
# @within function mob_manager:entity_finder/attacking_entity/filters/12

execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacking_entity={11-0=true}}] if entity @s[tag=FindFlag11.0] run function mob_manager:entity_finder/attacking_entity/filters/10
execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacking_entity={11-1=true}}] if entity @s[tag=FindFlag11.1] run function mob_manager:entity_finder/attacking_entity/filters/10


text:
#> mob_manager:entity_finder/attacking_entity/filters/10
#
# 攻撃元のエンティティ候補を絞っていく
#
# @within function mob_manager:entity_finder/attacking_entity/filters/11

execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacking_entity={10-0=true}}] if entity @s[tag=FindFlag10.0] run function mob_manager:entity_finder/attacking_entity/filters/9
execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacking_entity={10-1=true}}] if entity @s[tag=FindFlag10.1] run function mob_manager:entity_finder/attacking_entity/filters/9


text:
#> mob_manager:entity_finder/attacking_entity/filters/15
#
# 攻撃元のエンティティ候補を絞っていく
#
# @within function mob_manager:entity_finder/attacking_entity/on_hurt

execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacking_entity={15-0=true}}] if entity @s[tag=FindFlag15.0] run function mob_manager:entity_finder/attacking_entity/filters/14
execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacking_entity={15-1=true}}] if entity @s[tag=FindFlag15.1] run function mob_manager:entity_finder/attacking_entity/filters/14


text:
#> mob_manager:entity_finder/attacking_entity/filters/3
#
# 攻撃元のエンティティ候補を絞っていく
#
# @within function mob_manager:entity_finder/attacking_entity/filters/4

execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacking_entity={3-0=true}}] if entity @s[tag=FindFlag3.0] run function mob_manager:entity_finder/attacking_entity/filters/2
execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacking_entity={3-1=true}}] if entity @s[tag=FindFlag3.1] run function mob_manager:entity_finder/attacking_entity/filters/2


text:
#> mob_manager:entity_finder/attacking_entity/filters/12
#
# 攻撃元のエンティティ候補を絞っていく
#
# @within function mob_manager:entity_finder/attacking_entity/filters/13

execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacking_entity={12-0=true}}] if entity @s[tag=FindFlag12.0] run function mob_manager:entity_finder/attacking_entity/filters/11
execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacking_entity={12-1=true}}] if entity @s[tag=FindFlag12.1] run function mob_manager:entity_finder/attacking_entity/filters/11


text:
#> mob_manager:entity_finder/attacking_entity/filters/4
#
# 攻撃元のエンティティ候補を絞っていく
#
# @within function mob_manager:entity_finder/attacking_entity/filters/5

execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacking_entity={4-0=true}}] if entity @s[tag=FindFlag4.0] run function mob_manager:entity_finder/attacking_entity/filters/3
execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacking_entity={4-1=true}}] if entity @s[tag=FindFlag4.1] run function mob_manager:entity_finder/attacking_entity/filters/3


text:
#> mob_manager:entity_finder/attacking_entity/filters/9
#
# 攻撃元のエンティティ候補を絞っていく
#
# @within function mob_manager:entity_finder/attacking_entity/filters/10

execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacking_entity={9-0=true}}] if entity @s[tag=FindFlag9.0] run function mob_manager:entity_finder/attacking_entity/filters/8
execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacking_entity={9-1=true}}] if entity @s[tag=FindFlag9.1] run function mob_manager:entity_finder/attacking_entity/filters/8


text:
#> mob_manager:entity_finder/attacking_entity/filters/0
#
# 攻撃元のエンティティ候補を絞っていく
#
# @within function mob_manager:entity_finder/attacking_entity/filters/1

execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacking_entity={0-0=true}}] if entity @s[tag=FindFlag0.0] run function mob_manager:entity_finder/attacking_entity/fetch_attacking_entity
execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacking_entity={0-1=true}}] if entity @s[tag=FindFlag0.1] run function mob_manager:entity_finder/attacking_entity/fetch_attacking_entity


text:
#> mob_manager:entity_finder/attacking_entity/filters/14
#
# 攻撃元のエンティティ候補を絞っていく
#
# @within function mob_manager:entity_finder/attacking_entity/filters/15

execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacking_entity={14-0=true}}] if entity @s[tag=FindFlag14.0] run function mob_manager:entity_finder/attacking_entity/filters/13
execute if entity @p[tag=TargetEntity,advancements={mob_manager:entity_finder/check_attacking_entity={14-1=true}}] if entity @s[tag=FindFlag14.1] run function mob_manager:entity_finder/attacking_entity/filters/13


text:
data modify storage api: Argument.ID set value 65532
data modify storage api: Argument.FieldOverride set value {myValue:"override field"}
function api:mob/summon


type: empty


source: Lock

op: replace

source: LootTable

source: LootTableSeed


text:
#> player_manager:pos_fix_and_calc_diff
#
#
#
# @within function core:tick/player/pre

#> Val
# @private
    #declare score_holder $Prv.SquaredMagnitude
    #declare score_holder $Cur.SquaredMagnitude
    #declare score_holder $Temp
    #declare storage player_manager:pos_fix

# 現tickの座標を取得する (PlayerStorage呼び出しも含む)
    function api:data_get/pos
    # function oh_my_dat:please
# 1tick前のベクトルの大きさの二乗を取得する
    execute store result score $Prv.SquaredMagnitude Temporary run data get storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].PlayerPosDiffSquaredMagnitude

# セッションを開く
    function lib:array/session/open
# 現tickの差分を計算する
    data modify storage lib: ArrayA set from storage api: Pos
    data modify storage lib: ArrayB set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].PlayerPos
    function lib:array/math/sub

    data modify storage player_manager:pos_fix PosDiff set from storage lib: SubResult
# 現tickのベクトルの大きさの二乗を計算する
    data modify storage lib: Array set from storage lib: SubResult
    function lib:array/math/sqr

    data modify storage lib: Array set from storage lib: SqrResult
    function lib:array/math/sum

    execute store result score $Cur.SquaredMagnitude Temporary run data get storage lib: SumResult 100
# スコア推移
    scoreboard players reset @s[scores={PosPacketLossDetectAfterTick=2}] PosPacketLossDetectAfterTick
    scoreboard players add @s[scores={PosPacketLossDetectAfterTick=0..}] PosPacketLossDetectAfterTick 1

# 前tickの差分が十分な状態(0.05m/tick,1m/sec)でDiffが急に0になったらおそらくPosのパケロスが発生してるので、Posを前tickのPosとDiffから予測する
    execute if score $Prv.SquaredMagnitude Temporary matches 50.. if score $Cur.SquaredMagnitude Temporary matches ..15 unless score @s PosPacketLossDetectAfterTick matches 2 run scoreboard players set @s PosPacketLossDetectAfterTick 0
    execute if score $Prv.SquaredMagnitude Temporary matches 50.. if score $Cur.SquaredMagnitude Temporary matches ..15 unless score @s PosPacketLossDetectAfterTick matches 2 run data modify storage lib: ArrayA set from storage api: Pos
    execute if score $Prv.SquaredMagnitude Temporary matches 50.. if score $Cur.SquaredMagnitude Temporary matches ..15 unless score @s PosPacketLossDetectAfterTick matches 2 run data modify storage lib: ArrayB set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].PlayerPosDiff
    execute if score $Prv.SquaredMagnitude Temporary matches 50.. if score $Cur.SquaredMagnitude Temporary matches ..15 unless score @s PosPacketLossDetectAfterTick matches 2 run function lib:array/math/add
    execute if score $Prv.SquaredMagnitude Temporary matches 50.. if score $Cur.SquaredMagnitude Temporary matches ..15 unless score @s PosPacketLossDetectAfterTick matches 2 run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].DataCache.Pos.Data set from storage lib: AddResult
    execute if score $Prv.SquaredMagnitude Temporary matches 50.. if score $Cur.SquaredMagnitude Temporary matches ..15 unless score @s PosPacketLossDetectAfterTick matches 2 run data modify storage api: Pos set from storage lib: AddResult
# パケロスが検出されていたらDiffとCurSquaredMagnitudeを古いもので上書きする(即ち、更新が発生しなくなる)
    execute if score $Prv.SquaredMagnitude Temporary matches 50.. if score $Cur.SquaredMagnitude Temporary matches ..15 unless score @s PosPacketLossDetectAfterTick matches 2 run data modify storage player_manager:pos_fix PosDiff set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].PlayerPosDiff
    execute if score $Prv.SquaredMagnitude Temporary matches 50.. if score $Cur.SquaredMagnitude Temporary matches ..15 unless score @s PosPacketLossDetectAfterTick matches 2 run scoreboard players operation $Cur.SquaredMagnitude Temporary = $Prv.SquaredMagnitude Temporary

# 止まってから20tick目に座標の補正がかかるのでそのtickに限っては無視する
    execute if score @s PlayerStopTime matches 19 run data modify storage player_manager:pos_fix PosDiff set value [0d,0d,0d]

# 止まってからの時間の管理
    scoreboard players add @s PlayerStopTime 1

    data modify storage lib: Array set from storage player_manager:pos_fix PosDiff
    data modify storage lib: CompareTarget set value 0d
    function lib:array/compare_single
    execute if data storage lib: CompareResult[{_:{_:false}}] run scoreboard players set @s PlayerStopTime 0

# 次tickにデータ渡す
    data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].PlayerPos set from storage api: Pos
    data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].PlayerPosDiff set from storage player_manager:pos_fix PosDiff
    execute store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].PlayerPosDiffSquaredMagnitude int 1 run scoreboard players get $Cur.SquaredMagnitude Temporary
# リセット
    function lib:array/session/close
    data remove storage player_manager:pos_fix PosDiff
    scoreboard players reset $Prv.SquaredMagnitude Temporary
    scoreboard players reset $Cur.SquaredMagnitude Temporary
    scoreboard players reset $Temp Temporary


text:
#> player_manager:set_team_and_per_health
#
#
#
# @within function core:tick/player/

#> Temp
# @private
    #declare score_holder $Health
    #declare score_holder $MaxHealth

# 体力コピー
    scoreboard players operation $Health Temporary = @s Health
    scoreboard players operation $Health Temporary *= $1000 Const
# 最大体力取得
    execute store result score $MaxHealth Temporary run attribute @s generic.max_health get 10
# 割合を計算する
    scoreboard players operation $Health Temporary /= $MaxHealth Temporary
# 割合をもとにチーム振り分け
    execute if score $Health Temporary matches 00..34 if entity @s[tag=Believe.None] run team join None.LowHP
    execute if score $Health Temporary matches 35..79 if entity @s[tag=Believe.None] run team join None.MedHP
    execute if score $Health Temporary matches 80.. if entity @s[tag=Believe.None] run team join None.HighHP
    execute if score $Health Temporary matches 00..34 if entity @s[tag=Believe.Flora] run team join Flora.LowHP
    execute if score $Health Temporary matches 35..79 if entity @s[tag=Believe.Flora] run team join Flora.MedHP
    execute if score $Health Temporary matches 80.. if entity @s[tag=Believe.Flora] run team join Flora.HighHP
    execute if score $Health Temporary matches 00..34 if entity @s[tag=Believe.Urban] run team join Urban.LowHP
    execute if score $Health Temporary matches 35..79 if entity @s[tag=Believe.Urban] run team join Urban.MedHP
    execute if score $Health Temporary matches 80.. if entity @s[tag=Believe.Urban] run team join Urban.HighHP
    execute if score $Health Temporary matches 00..34 if entity @s[tag=Believe.Nyaptov] run team join Nyaptov.LowHP
    execute if score $Health Temporary matches 35..79 if entity @s[tag=Believe.Nyaptov] run team join Nyaptov.MedHP
    execute if score $Health Temporary matches 80.. if entity @s[tag=Believe.Nyaptov] run team join Nyaptov.HighHP
    execute if score $Health Temporary matches 00..34 if entity @s[tag=Believe.Wi-ki] run team join Wi-ki.LowHP
    execute if score $Health Temporary matches 35..79 if entity @s[tag=Believe.Wi-ki] run team join Wi-ki.MedHP
    execute if score $Health Temporary matches 80.. if entity @s[tag=Believe.Wi-ki] run team join Wi-ki.HighHP
    execute if score $Health Temporary matches 00..34 if entity @s[tag=Believe.Rumor] run team join Rumor.LowHP
    execute if score $Health Temporary matches 35..79 if entity @s[tag=Believe.Rumor] run team join Rumor.MedHP
    execute if score $Health Temporary matches 80.. if entity @s[tag=Believe.Rumor] run team join Rumor.HighHP

# 割合を100分率から20分率にする
    scoreboard players operation $Health Temporary /= $5 Const
# 割合を割合体力表示用スコアに代入
    scoreboard players operation @s PerHealth = $Health Temporary

# リセット
    scoreboard players reset $Health Temporary
    scoreboard players reset $MaxHealth Temporary


text:
#> player_manager:version_check
#
#
#
# @within function core:handler/join

# versionのチェック
    function api:data_get/data_version
    execute unless data storage api: {DataVersion:3465} run tellraw @a [{"text":"[warning] ","color":"yellow"},{"text":"動作バージョン(","color":"white"},{"text":"1.20.1","color":"green"},{"text":")と異なるバージョンでのjoinを検出しました。\n重大な問題が発生する可能性があります。","color":"white"}]


text:
#> player_manager:vanilla_attack/show_log
#
#
#
# @within function core:handler/attack

# ダメージを表示形式に変換する
    scoreboard players operation $Fluctuation Lib = @s AttackEvent
    scoreboard players operation $Fluctuation Lib *= $-10 Const
# 攻撃した敵の座標で表示する
    execute as @e[tag=AttackedEntity] if score @s AttackedEntity = @p[tag=this] UserID at @s run function lib:status_log/show_health


text:
#> player_manager:god/tick
#
#
#
# @within function core:tick/player/

# execute if entity @s[tag=Believe.None]
execute if entity @s[tag=Believe.Flora] run function player_manager:god/flora/passive
execute if entity @s[tag=Believe.Nyaptov] run function player_manager:god/nyaptov/passive
execute if entity @s[tag=Believe.Rumor] run function player_manager:god/rumor/passive/
# execute if entity @s[tag=Believe.Urban] run function player_manager:god/urban/passive
execute if entity @s[tag=Believe.Wi-ki] run function player_manager:god/wi-ki/passive/


text:
#> player_manager:god/_index.d
# @private

#> Tags
# @within
#   function player_manager:god/**
#   function player_manager:set_team_and_per_health
#   function debug:change_believe/*
#   predicate player_manager:is_believe/*
    #declare tag Believe.None
    #declare tag Believe.Flora
    #declare tag Believe.Urban
    #declare tag Believe.Nyaptov
    #declare tag Believe.Wi-ki
    #declare tag Believe.Rumor

#> storage for process
# @within function player_manager:god/mercy/**
    #declare storage player_manager:god

#> Tag for Nyaptov Passive
# @within
#   function core:handler/flying_elytra
#   function player_manager:god/nyaptov/passive
    #declare tag Nyaptov.FlyingElytra


text:
#> player_manager:god/urban/in_temple
#
#
#
# @within function world_manager:area/01-13.urban_temple

# 教徒
    execute if entity @s[tag=Believe.Urban] run function player_manager:god/mercy/
# 異教徒
    execute if entity @s[tag=!Believe.Urban] run function player_manager:god/change_believe/


text:
#> player_manager:god/urban/unbelieve
#
#
#
# @within
#   function player_manager:god/change_believe/unbelieve2
#   function debug:change_believe/none

# 信仰タグ削除
    tag @s remove Believe.Urban
# 物理攻撃+25%
    data modify storage api: Argument.UUID set value [2, 1, 1, 13]
    function api:modifier/attack/physical/remove
# 火攻撃+10%
    data modify storage api: Argument.UUID set value [2, 1, 1, 13]
    function api:modifier/attack/fire/remove
# 魔法攻撃-20%
    data modify storage api: Argument.UUID set value [2, 1, 1, 13]
    function api:modifier/attack/magic/remove
# ノックバック軽減+30%
    attribute @s generic.knockback_resistance modifier remove 1-0-2-0-d


text:
#> player_manager:god/urban/believe
#
#
#
# @within
#   function player_manager:god/change_believe/believe2
#   function debug:change_believe/urban

# 信仰タグ付与
    tag @s add Believe.Urban
# 物理攻撃+25%
    data modify storage api: Argument.UUID set value [2, 1, 1, 13]
    data modify storage api: Argument.Amount set value 0.25
    data modify storage api: Argument.Operation set value "multiply_base"
    function api:modifier/attack/physical/add
# 火攻撃+10%
    data modify storage api: Argument.UUID set value [2, 1, 1, 13]
    data modify storage api: Argument.Amount set value 0.1
    data modify storage api: Argument.Operation set value "multiply_base"
    function api:modifier/attack/fire/add
# 魔法攻撃-20%
    data modify storage api: Argument.UUID set value [2, 1, 1, 13]
    data modify storage api: Argument.Amount set value -0.2
    data modify storage api: Argument.Operation set value "multiply_base"
    function api:modifier/attack/magic/add
# ノックバック軽減+30%
    attribute @s generic.knockback_resistance modifier add 1-0-2-0-d "Urban believe bonus" 0.3 multiply_base


text:
#> player_manager:god/flora/passive
#
#
#
# @within function player_manager:god/tick

execute if predicate lib:weather/is_raining unless predicate player_manager:god/flora/has_high_lvl_regeneration run effect give @s regeneration 5 1 true


text:
#> player_manager:god/flora/in_temple
#
#
#
# @within function world_manager:area/01-10.flora_temple

# 教徒
    execute if entity @s[tag=Believe.Flora] run function player_manager:god/mercy/
# 異教徒
    execute if entity @s[tag=!Believe.Flora] run function player_manager:god/change_believe/


text:
#> player_manager:god/flora/unbelieve
#
#
#
# @within
#   function player_manager:god/change_believe/unbelieve2
#   function debug:change_believe/none

# 信仰タグ削除
    tag @s remove Believe.Flora
# 水攻撃+20%
    data modify storage api: Argument.UUID set value [2, 1, 1, 10]
    function api:modifier/attack/water/remove
# 水耐性+20%
    data modify storage api: Argument.UUID set value [2, 1, 1, 10]
    function api:modifier/defense/water/remove
# 火耐性-20%
    data modify storage api: Argument.UUID set value [2, 1, 1, 10]
    function api:modifier/defense/fire/remove


text:
#> player_manager:god/flora/believe
#
#
#
# @within
#   function player_manager:god/change_believe/believe2
#   function debug:change_believe/flora

# 信仰タグ付与
    tag @s add Believe.Flora
# 水攻撃+20%
    data modify storage api: Argument.UUID set value [2, 1, 1, 10]
    data modify storage api: Argument.Amount set value 0.2
    data modify storage api: Argument.Operation set value "multiply_base"
    function api:modifier/attack/water/add
# 水耐性+20%
    data modify storage api: Argument.UUID set value [2, 1, 1, 10]
    data modify storage api: Argument.Amount set value 0.2
    data modify storage api: Argument.Operation set value "multiply_base"
    function api:modifier/defense/water/add
# 火耐性-20%
    data modify storage api: Argument.UUID set value [2, 1, 1, 10]
    data modify storage api: Argument.Amount set value -0.2
    data modify storage api: Argument.Operation set value "multiply_base"
    function api:modifier/defense/fire/add


text:
#> player_manager:god/change_believe/on_check_blessing
#
#
#
# @within function player_manager:god/change_believe/check-1/on_click

execute if score @s InSubArea matches 10 run function lib:message/god/flora/blessing
execute if score @s InSubArea matches 11 run function lib:message/god/nyaptov/blessing
execute if score @s InSubArea matches 12 run function lib:message/god/rumor/blessing
execute if score @s InSubArea matches 13 run function lib:message/god/urban/blessing
execute if score @s InSubArea matches 14 run function lib:message/god/wi-ki/blessing

function player_manager:god/change_believe/check-1/


text:
#> player_manager:god/change_believe/unbelieve1
#
#
#
# @within function player_manager:god/change_believe/change_task

# 共通処理
    effect give @s blindness 11 0 true
    effect give @s slowness 11 5 true
# 各神固有処理
    execute if entity @s[tag=Believe.Flora] run function lib:message/god/flora/unbelieve1
    execute if entity @s[tag=Believe.Nyaptov] run function lib:message/god/nyaptov/unbelieve1
    execute if entity @s[tag=Believe.Rumor] run function lib:message/god/rumor/unbelieve1
    execute if entity @s[tag=Believe.Urban] run function lib:message/god/urban/unbelieve1
    execute if entity @s[tag=Believe.Wi-ki] run function lib:message/god/wi-ki/unbelieve1


text:
#> player_manager:god/change_believe/believe2
#
#
#
# @within function player_manager:god/change_believe/change_task

# 共通処理
    tag @s remove Believe.None
# 共通演出
    execute at @s run particle enchant ~ ~2 ~ 0.1 0.1 0.1 1 100
# 各神固有処理
    execute if score @s InSubArea matches 10 run function lib:message/god/flora/believe2
    execute if score @s InSubArea matches 10 run function player_manager:god/flora/believe
    execute if score @s InSubArea matches 11 run function lib:message/god/nyaptov/believe2
    execute if score @s InSubArea matches 11 run function player_manager:god/nyaptov/believe
    execute if score @s InSubArea matches 12 run function lib:message/god/rumor/believe2
    execute if score @s InSubArea matches 12 run function player_manager:god/rumor/believe
    execute if score @s InSubArea matches 13 run function lib:message/god/urban/believe2
    execute if score @s InSubArea matches 13 run function player_manager:god/urban/believe
    execute if score @s InSubArea matches 14 run function lib:message/god/wi-ki/believe2
    execute if score @s InSubArea matches 14 run function player_manager:god/wi-ki/believe


text:
#> player_manager:god/change_believe/unbelieve2
#
#
#
# @within function player_manager:god/change_believe/change_task

# 共通処理
    tag @s add Believe.None
    function oh_my_dat:please
    data remove storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LostItems
# 各神固有処理
    execute if entity @s[tag=Believe.Flora] run function lib:message/god/flora/unbelieve2
    execute if entity @s[tag=Believe.Flora] run function player_manager:god/flora/unbelieve
    execute if entity @s[tag=Believe.Nyaptov] run function lib:message/god/nyaptov/unbelieve2
    execute if entity @s[tag=Believe.Nyaptov] run function player_manager:god/nyaptov/unbelieve
    execute if entity @s[tag=Believe.Rumor] run function lib:message/god/rumor/unbelieve2
    execute if entity @s[tag=Believe.Rumor] run function player_manager:god/rumor/unbelieve
    execute if entity @s[tag=Believe.Urban] run function lib:message/god/urban/unbelieve2
    execute if entity @s[tag=Believe.Urban] run function player_manager:god/urban/unbelieve
    execute if entity @s[tag=Believe.Wi-ki] run function lib:message/god/wi-ki/unbelieve2
    execute if entity @s[tag=Believe.Wi-ki] run function player_manager:god/wi-ki/unbelieve


text:
#> player_manager:god/change_believe/change_task
#
#
#
# @within function
#   player_manager:god/change_believe/on_change
#   player_manager:god/change_believe/change_task

# 該当ユーザーのスコア加算
    scoreboard players add @a[scores={GodMessagePhase=0..}] GodMessagePhase 1
# 処理
    execute as @a[scores={GodMessagePhase=40}] run function player_manager:god/change_believe/unbelieve1
    execute as @a[scores={GodMessagePhase=120}] run function player_manager:god/change_believe/unbelieve2
    execute as @a[scores={GodMessagePhase=280}] run function player_manager:god/change_believe/believe1
    execute as @a[scores={GodMessagePhase=380}] run function player_manager:god/change_believe/believe2
    scoreboard players reset @a[scores={GodMessagePhase=400}] GodMessagePhase
# 途中退出時
    execute as @a[scores={GodMessagePhase=0..}] unless score @s InSubArea matches 10..14 run scoreboard players reset @s GodMessagePhase
    execute as @a[scores={GodMessagePhase=0..}] unless score @s InArea matches 1 run scoreboard players reset @s GodMessagePhase

# ループ
    execute if entity @a[scores={GodMessagePhase=0..},limit=1] run schedule function player_manager:god/change_believe/change_task 1t


text:
#> player_manager:god/change_believe/on_change
#
#
#
# @within function player_manager:god/change_believe/check-?/on_click

scoreboard players set @s GodMessagePhase 0
execute if entity @s[tag=!Believe.Flora,tag=!Believe.Nyaptov,tag=!Believe.Rumor,tag=!Believe.Urban,tag=!Believe.Wi-ki] run scoreboard players set @s GodMessagePhase 240
function player_manager:god/change_believe/change_task


text:
#> player_manager:god/change_believe/believe1
#
#
#
# @within function player_manager:god/change_believe/change_task

execute if score @s InSubArea matches 10 run function lib:message/god/flora/believe1
execute if score @s InSubArea matches 11 run function lib:message/god/nyaptov/believe1
execute if score @s InSubArea matches 12 run function lib:message/god/rumor/believe1
execute if score @s InSubArea matches 13 run function lib:message/god/urban/believe1
execute if score @s InSubArea matches 14 run function lib:message/god/wi-ki/believe1


text:
#> player_manager:god/change_believe/check-2/on_click
#
#
#
# @within function player_manager:god/change_believe/check-2/listener

# エラー値
    execute unless score @s Believe2 matches 2 run function lib:message/invalid_operation
# 正常値
    execute if score @s Believe2 matches 2 run function player_manager:god/change_believe/on_change
# リセット
    scoreboard players reset @s Believe2


text:
#> player_manager:god/change_believe/check-2/listener
#
#
#
# @within function
#   player_manager:god/change_believe/check-2/
#   player_manager:god/change_believe/check-2/listener

# チェック
    execute as @a[scores={Believe2=1..}] run function player_manager:god/change_believe/check-2/on_click
    execute as @a[scores={Believe2=0}] unless score @s InArea matches 1 run scoreboard players reset @s Believe2
    execute as @a[scores={Believe2=0}] unless score @s InSubArea matches 10..14 run scoreboard players reset @s Believe2
# ループ
    execute if entity @a[scores={Believe2=0},limit=1] run schedule function player_manager:god/change_believe/check-2/listener 1t