text:
#> api:modifier/attack/water/add
#
#
#
# @api

# データ検証
    function api:modifier/core/common/validate
# データが正しいなら入れる
    execute if data storage api: Argument.UUID if data storage api: Argument.Amount if data storage api: Argument.Operation run function api:modifier/core/attack/water/add
# リセット
    data remove storage api: Argument.UUID
    data remove storage api: Argument.Amount
    data remove storage api: Argument.Operation


text:
#> api:modifier/attack/water/remove
#
#
#
# @api

# データ検証
    execute unless data storage api: Argument.UUID run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません","color":"white"},{"text":" UUID","color":"red"}]
# データが正しいなら消す
    execute if data storage api: Argument.UUID run function api:modifier/core/attack/water/remove
# リセット
    data remove storage api: Argument.UUID

repo_name: ProjectTSB/TheSkyBlessing

repo_language: mcfunction

mime_type: text/plain


text:
#> api:modifier/attack/water/get
#
#
#
# @api

function oh_my_dat:please
data remove storage api: Return.Attack.Water
data modify storage api: Return.Attack.Water set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].Modifiers.Attack.Water


text:
#> api:modifier/mp_regen/add
#
#
#
# @api

# データ検証
    function api:modifier/core/common/validate
# データが正しいなら入れる
    execute if data storage api: Argument.UUID if data storage api: Argument.Amount if data storage api: Argument.Operation run function api:modifier/core/mp_regen/add
# リセット
    data remove storage api: Argument.UUID
    data remove storage api: Argument.Amount
    data remove storage api: Argument.Operation


text:
#> api:modifier/mp_regen/remove
#
#
#
# @api

# データ検証
    execute unless data storage api: Argument.UUID run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません","color":"white"},{"text":" UUID","color":"red"}]
# データが正しいなら消す
    execute if data storage api: Argument.UUID run function api:modifier/core/mp_regen/remove
# リセット
    data remove storage api: Argument.UUID


text:
#> api:modifier/mp_regen/get
#
#
#
# @api

function oh_my_dat:please
data remove storage api: Return.MPRegen
data modify storage api: Return.MPRegen set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].Modifiers.MPRegen


text:
#> api:mp/get_max
#
# プレイヤーのMPの最大値を取得します。
#
# @input as player
# @output storage api: Return.MaxMP : int @ 0..
# @api

# 取得
    execute store result storage api: Return.MaxMP int 1 run scoreboard players get @s MPMax


text:
#> api:mp/check
#
# プレイヤーのMPが一定以上かチェックします。
#
# また、この関数は開発特権がついている際に常時`true`を返します。
#
# @input
#   as player
#   storage api: Argument.Threshold : int
# @output storage api: Return.IsThresholdOrMore: boolean
# @api

#> temp
# @private
    #declare score_holder $CheckMP

# 閾値を取得
    execute store result score $CheckMP Temporary run data get storage api: Argument.Threshold
# Bypass
    execute if entity @s[tag=DevPrivilege] run scoreboard players set $CheckMP Temporary 0
# チェック
    execute store success storage api: Return.IsThresholdOrMore byte 1 if score $CheckMP Temporary <= @s MP
# リセット
    scoreboard players reset $CheckMP Temporary


text:
#> api:mp/get_current
#
# プレイヤーのMPの現在値を取得します。
#
# @input as player
# @output storage api: Return.CurrentMP : int @ 0..
# @api

# 取得
    execute store result storage api: Return.CurrentMP int 1 run scoreboard players get @s MP


text:
#> api:mp/set
#
# プレイヤーのMPをその値に設定します。
#
# @input
#   as player
#   storage api: Argument.MP
# @api

#> temp
# @private
    #declare score_holder $MP

# 取得
    execute store result score $MP Temporary run data get storage api: Argument.MP
# セット
    scoreboard players operation @s MP = $MP Temporary
# リセット
    scoreboard players reset $MP Temporary
    data remove storage api: Argument.MP


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

#> temp
# @private
    #declare score_holder $Fluctuation

# 増減量取得
    execute store result score $Fluctuation Temporary run data get storage api: Argument.Fluctuation
# 増減
    scoreboard players operation @s MP += $Fluctuation Temporary
    scoreboard players operation @s MP > $0 Const
    scoreboard players operation @s MP < @s MPMax
# 表示
    execute unless data storage api: Argument{DisableLog:1b} at @s run function lib:status_log/show_mp
# リセット
    scoreboard players reset $Fluctuation Temporary
    data remove storage api: Argument.Fluctuation
    data remove storage api: Argument.DisableLog


text:
#> api:player_vector/get
#
#
#
# @output storage api: Return.Vector : [double] @ 3
# @api

# EntityStorage呼び出し
    function oh_my_dat:please
# コピー
    data modify storage api: Return.Vector set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].PlayerPosDiff


text:
#> api:common/arguments/stash
#
#
#
# @api

# スタックに新しい空間を追加する
    data modify storage api: ArgumentStash append value {}
# Argumentを退避
    data modify storage api: ArgumentStash[-1].Api set from storage api: Argument
    data modify storage api: ArgumentStash[-1].Lib set from storage lib: Argument
# Argumentを掃除
    data remove storage api: Argument


text:
#> api:common/arguments/pop
#
#
#
# @api

# idを掃除
    data remove storage api: Argument
# idを戻す
    data modify storage api: Argument set from storage api: ArgumentStash[-1].Api
    data modify storage lib: Argument set from storage api: ArgumentStash[-1].Lib
# スタックの要素を消す
    data remove storage api: ArgumentStash[-1]


text:
#> rom:provide
#
#
#
# @license Copyright © 2020 赤石愛, This software is released under the MIT License, see OhMyDat/LICENSE.
# @within function api:rom/please

#> Val
# @private
#declare score_holder $Address

# IDを取得する
    execute store result score $Address Temporary run data get storage api: Argument.Address

# リセット
    data remove storage rom: _[-4][-4][-4][-4][-4][-4][-4][6]
    data remove storage rom: _[-4][-4][-4][-4][-4][-4][-4][5]
    data remove storage rom: _[-4][-4][-4][-4][-4][-4][-4][4]
    data remove storage rom: _[-4][-4][-4][-4][-4][-4][6]
    data remove storage rom: _[-4][-4][-4][-4][-4][-4][5]
    data remove storage rom: _[-4][-4][-4][-4][-4][-4][4]
    data remove storage rom: _[-4][-4][-4][-4][-4][6]
    data remove storage rom: _[-4][-4][-4][-4][-4][5]
    data remove storage rom: _[-4][-4][-4][-4][-4][4]
    data remove storage rom: _[-4][-4][-4][-4][6]
    data remove storage rom: _[-4][-4][-4][-4][5]
    data remove storage rom: _[-4][-4][-4][-4][4]
    data remove storage rom: _[-4][-4][-4][6]
    data remove storage rom: _[-4][-4][-4][5]
    data remove storage rom: _[-4][-4][-4][4]
    data remove storage rom: _[-4][-4][6]
    data remove storage rom: _[-4][-4][5]
    data remove storage rom: _[-4][-4][4]
    data remove storage rom: _[-4][6]
    data remove storage rom: _[-4][5]
    data remove storage rom: _[-4][4]
    data remove storage rom: _[6]
    data remove storage rom: _[5]
    data remove storage rom: _[4]

# 上位2bit =
#   00?? ???? ???? ???? ???? ???? ???? ???? ->                  0 <= n < 2^30
#   01?? ???? ???? ???? ???? ???? ???? ???? ->                           2^30 <= n
#   10?? ???? ???? ???? ???? ???? ???? ???? -> n < -2^30
#   11?? ???? ???? ???? ???? ???? ???? ???? ->     -2^30 <= n < 0
# 2^30 = 1,073,741,824

# シフト1
    scoreboard players operation $Address Temporary *= $65536 Const
# 上位2bitを元にオフセット要素を末尾追加する
    execute if score $Address Temporary matches 1073741824.. run data modify storage rom: _ append from storage rom: OneEmptyLists[]
    execute if score $Address Temporary matches ..-1073741825 run data modify storage rom: _ append from storage rom: TwoEmptyLists[]
    execute if score $Address Temporary matches -1073741824..-1 run data modify storage rom: _ append from storage rom: ThreeEmptyLists[]

# チェック2
    execute unless data storage rom: _[-4][0] run data modify storage rom: _[-4] set from storage rom: Initial[0]
# シフト2
    scoreboard players operation $Address Temporary *= $4 Const
# 上位2bitを元にオフセット要素を末尾追加する
    execute if score $Address Temporary matches 1073741824.. run data modify storage rom: _[-4] append from storage rom: OneEmptyLists[]
    execute if score $Address Temporary matches ..-1073741825 run data modify storage rom: _[-4] append from storage rom: TwoEmptyLists[]
    execute if score $Address Temporary matches -1073741824..-1 run data modify storage rom: _[-4] append from storage rom: ThreeEmptyLists[]

# チェック3
    execute unless data storage rom: _[-4][-4][0] run data modify storage rom: _[-4][-4] set from storage rom: Initial[0][0]
# シフト3
    scoreboard players operation $Address Temporary *= $4 Const
# 上位2bitを元にオフセット要素を末尾追加する
    execute if score $Address Temporary matches 1073741824.. run data modify storage rom: _[-4][-4] append from storage rom: OneEmptyLists[]
    execute if score $Address Temporary matches ..-1073741825 run data modify storage rom: _[-4][-4] append from storage rom: TwoEmptyLists[]
    execute if score $Address Temporary matches -1073741824..-1 run data modify storage rom: _[-4][-4] append from storage rom: ThreeEmptyLists[]

# チェック4
    execute unless data storage rom: _[-4][-4][-4][0] run data modify storage rom: _[-4][-4][-4] set from storage rom: Initial[0][0][0]
# シフト4
    scoreboard players operation $Address Temporary *= $4 Const
# 上位2bitを元にオフセット要素を末尾追加する
    execute if score $Address Temporary matches 1073741824.. run data modify storage rom: _[-4][-4][-4] append from storage rom: OneEmptyLists[]
    execute if score $Address Temporary matches ..-1073741825 run data modify storage rom: _[-4][-4][-4] append from storage rom: TwoEmptyLists[]
    execute if score $Address Temporary matches -1073741824..-1 run data modify storage rom: _[-4][-4][-4] append from storage rom: ThreeEmptyLists[]

# チェック5
    execute unless data storage rom: _[-4][-4][-4][-4][0] run data modify storage rom: _[-4][-4][-4][-4] set from storage rom: Initial[0][0][0][0]
# シフト5
    scoreboard players operation $Address Temporary *= $4 Const
# 上位2bitを元にオフセット要素を末尾追加する
    execute if score $Address Temporary matches 1073741824.. run data modify storage rom: _[-4][-4][-4][-4] append from storage rom: OneEmptyLists[]
    execute if score $Address Temporary matches ..-1073741825 run data modify storage rom: _[-4][-4][-4][-4] append from storage rom: TwoEmptyLists[]
    execute if score $Address Temporary matches -1073741824..-1 run data modify storage rom: _[-4][-4][-4][-4] append from storage rom: ThreeEmptyLists[]

# チェック6
    execute unless data storage rom: _[-4][-4][-4][-4][-4][0] run data modify storage rom: _[-4][-4][-4][-4][-4] set from storage rom: Initial[0][0][0][0][0]
# シフト6
    scoreboard players operation $Address Temporary *= $4 Const
# 上位2bitを元にオフセット要素を末尾追加する
    execute if score $Address Temporary matches 1073741824.. run data modify storage rom: _[-4][-4][-4][-4][-4] append from storage rom: OneEmptyLists[]
    execute if score $Address Temporary matches ..-1073741825 run data modify storage rom: _[-4][-4][-4][-4][-4] append from storage rom: TwoEmptyLists[]
    execute if score $Address Temporary matches -1073741824..-1 run data modify storage rom: _[-4][-4][-4][-4][-4] append from storage rom: ThreeEmptyLists[]

# チェック7
    execute unless data storage rom: _[-4][-4][-4][-4][-4][-4][0] run data modify storage rom: _[-4][-4][-4][-4][-4][-4] set from storage rom: Initial[0][0][0][0][0][0]
# シフト7
    scoreboard players operation $Address Temporary *= $4 Const
# 上位2bitを元にオフセット要素を末尾追加する
    execute if score $Address Temporary matches 1073741824.. run data modify storage rom: _[-4][-4][-4][-4][-4][-4] append from storage rom: OneEmptyLists[]
    execute if score $Address Temporary matches ..-1073741825 run data modify storage rom: _[-4][-4][-4][-4][-4][-4] append from storage rom: TwoEmptyLists[]
    execute if score $Address Temporary matches -1073741824..-1 run data modify storage rom: _[-4][-4][-4][-4][-4][-4] append from storage rom: ThreeEmptyLists[]

# チェック8
    execute unless data storage rom: _[-4][-4][-4][-4][-4][-4][-4][0] run data modify storage rom: _[-4][-4][-4][-4][-4][-4][-4] set from storage rom: Initial[0][0][0][0][0][0][0]
# シフト8
    scoreboard players operation $Address Temporary *= $4 Const
# 上位2bitを元にオフセット要素を末尾追加する
    execute if score $Address Temporary matches 1073741824.. run data modify storage rom: _[-4][-4][-4][-4][-4][-4][-4] append from storage rom: OneEmptyMaps[]
    execute if score $Address Temporary matches ..-1073741825 run data modify storage rom: _[-4][-4][-4][-4][-4][-4][-4] append from storage rom: TwoEmptyMaps[]
    execute if score $Address Temporary matches -1073741824..-1 run data modify storage rom: _[-4][-4][-4][-4][-4][-4][-4] append from storage rom: ThreeEmptyMaps[]

# リセット
    scoreboard players reset $Address Temporary


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

#> Storage
# @within function
#   api:**
#   asset:*/super.*
#   asset_manager:**
#   mob_manager:**
#   rom:**
#declare storage rom:

#> Val
# @within function
#   api:rom/please
#   rom:**
    #declare score_holder $LatestProvidedAddress
    #declare score_holder $Address


text:
#> rom:init
#
# このデータパックに必要なものを初期化する
#
#
# @license Copyright © 2020 赤石愛, This software is released under the MIT License, see OhMyDat/LICENSE.
# @within function core:load_once

# ストレージシフトに使うデータ
    data modify storage rom: OneEmptyLists set value [[]]
    data modify storage rom: TwoEmptyLists set value [[],[]]
    data modify storage rom: ThreeEmptyLists set value [[],[],[]]
    data modify storage rom: OneEmptyMaps set value [{}]
    data modify storage rom: TwoEmptyMaps set value [{},{}]
    data modify storage rom: ThreeEmptyMaps set value [{},{},{}]
    data modify storage rom: Initial set value [[[[[[[[{},{},{},{}],[],[],[]],[],[],[]],[],[],[]],[],[],[]],[],[],[]],[],[],[]],[],[],[]]
# メインになるストレージ
    data modify storage rom: _ set from storage rom: Initial


text:
#> core:define_const
#
# 定数を定義します
#
# @within function core:load_once

scoreboard players set $-100 Const -100
scoreboard players set $-99 Const -99
scoreboard players set $-98 Const -98
scoreboard players set $-97 Const -97
scoreboard players set $-96 Const -96
scoreboard players set $-95 Const -95
scoreboard players set $-94 Const -94
scoreboard players set $-93 Const -93
scoreboard players set $-92 Const -92
scoreboard players set $-91 Const -91
scoreboard players set $-90 Const -90
scoreboard players set $-89 Const -89
scoreboard players set $-88 Const -88
scoreboard players set $-87 Const -87
scoreboard players set $-86 Const -86
scoreboard players set $-85 Const -85
scoreboard players set $-84 Const -84
scoreboard players set $-83 Const -83
scoreboard players set $-82 Const -82
scoreboard players set $-81 Const -81
scoreboard players set $-80 Const -80
scoreboard players set $-79 Const -79
scoreboard players set $-78 Const -78
scoreboard players set $-77 Const -77
scoreboard players set $-76 Const -76
scoreboard players set $-75 Const -75
scoreboard players set $-74 Const -74
scoreboard players set $-73 Const -73
scoreboard players set $-72 Const -72
scoreboard players set $-71 Const -71
scoreboard players set $-70 Const -70
scoreboard players set $-69 Const -69
scoreboard players set $-68 Const -68
scoreboard players set $-67 Const -67
scoreboard players set $-66 Const -66
scoreboard players set $-65 Const -65
scoreboard players set $-64 Const -64
scoreboard players set $-63 Const -63
scoreboard players set $-62 Const -62
scoreboard players set $-61 Const -61
scoreboard players set $-60 Const -60
scoreboard players set $-59 Const -59
scoreboard players set $-58 Const -58
scoreboard players set $-57 Const -57
scoreboard players set $-56 Const -56
scoreboard players set $-55 Const -55
scoreboard players set $-54 Const -54
scoreboard players set $-53 Const -53
scoreboard players set $-52 Const -52
scoreboard players set $-51 Const -51
scoreboard players set $-50 Const -50
scoreboard players set $-49 Const -49
scoreboard players set $-48 Const -48
scoreboard players set $-47 Const -47
scoreboard players set $-46 Const -46
scoreboard players set $-45 Const -45
scoreboard players set $-44 Const -44
scoreboard players set $-43 Const -43
scoreboard players set $-42 Const -42
scoreboard players set $-41 Const -41
scoreboard players set $-40 Const -40
scoreboard players set $-39 Const -39
scoreboard players set $-38 Const -38
scoreboard players set $-37 Const -37
scoreboard players set $-36 Const -36
scoreboard players set $-35 Const -35
scoreboard players set $-34 Const -34
scoreboard players set $-33 Const -33
scoreboard players set $-32 Const -32
scoreboard players set $-31 Const -31
scoreboard players set $-30 Const -30
scoreboard players set $-29 Const -29
scoreboard players set $-28 Const -28
scoreboard players set $-27 Const -27
scoreboard players set $-26 Const -26
scoreboard players set $-25 Const -25
scoreboard players set $-24 Const -24
scoreboard players set $-23 Const -23
scoreboard players set $-22 Const -22
scoreboard players set $-21 Const -21
scoreboard players set $-20 Const -20
scoreboard players set $-19 Const -19
scoreboard players set $-18 Const -18
scoreboard players set $-17 Const -17
scoreboard players set $-16 Const -16
scoreboard players set $-15 Const -15
scoreboard players set $-14 Const -14
scoreboard players set $-13 Const -13
scoreboard players set $-12 Const -12
scoreboard players set $-11 Const -11
scoreboard players set $-10 Const -10
scoreboard players set $-9 Const -9
scoreboard players set $-8 Const -8
scoreboard players set $-7 Const -7
scoreboard players set $-6 Const -6
scoreboard players set $-5 Const -5
scoreboard players set $-4 Const -4
scoreboard players set $-3 Const -3
scoreboard players set $-2 Const -2
scoreboard players set $-1 Const -1
scoreboard players set $0 Const 0
scoreboard players set $1 Const 1
scoreboard players set $2 Const 2
scoreboard players set $3 Const 3
scoreboard players set $4 Const 4
scoreboard players set $5 Const 5
scoreboard players set $6 Const 6
scoreboard players set $7 Const 7
scoreboard players set $8 Const 8
scoreboard players set $9 Const 9
scoreboard players set $10 Const 10
scoreboard players set $11 Const 11
scoreboard players set $12 Const 12
scoreboard players set $13 Const 13
scoreboard players set $14 Const 14
scoreboard players set $15 Const 15
scoreboard players set $16 Const 16
scoreboard players set $17 Const 17
scoreboard players set $18 Const 18
scoreboard players set $19 Const 19
scoreboard players set $20 Const 20
scoreboard players set $21 Const 21
scoreboard players set $22 Const 22
scoreboard players set $23 Const 23
scoreboard players set $24 Const 24
scoreboard players set $25 Const 25
scoreboard players set $26 Const 26
scoreboard players set $27 Const 27
scoreboard players set $28 Const 28
scoreboard players set $29 Const 29
scoreboard players set $30 Const 30
scoreboard players set $31 Const 31
scoreboard players set $32 Const 32
scoreboard players set $33 Const 33
scoreboard players set $34 Const 34
scoreboard players set $35 Const 35
scoreboard players set $36 Const 36
scoreboard players set $37 Const 37
scoreboard players set $38 Const 38
scoreboard players set $39 Const 39
scoreboard players set $40 Const 40
scoreboard players set $41 Const 41
scoreboard players set $42 Const 42
scoreboard players set $43 Const 43
scoreboard players set $44 Const 44
scoreboard players set $45 Const 45
scoreboard players set $46 Const 46
scoreboard players set $47 Const 47
scoreboard players set $48 Const 48
scoreboard players set $49 Const 49
scoreboard players set $50 Const 50
scoreboard players set $51 Const 51
scoreboard players set $52 Const 52
scoreboard players set $53 Const 53
scoreboard players set $54 Const 54
scoreboard players set $55 Const 55
scoreboard players set $56 Const 56
scoreboard players set $57 Const 57
scoreboard players set $58 Const 58
scoreboard players set $59 Const 59
scoreboard players set $60 Const 60
scoreboard players set $61 Const 61
scoreboard players set $62 Const 62
scoreboard players set $63 Const 63
scoreboard players set $64 Const 64
scoreboard players set $65 Const 65
scoreboard players set $66 Const 66
scoreboard players set $67 Const 67
scoreboard players set $68 Const 68
scoreboard players set $69 Const 69
scoreboard players set $70 Const 70
scoreboard players set $71 Const 71
scoreboard players set $72 Const 72
scoreboard players set $73 Const 73
scoreboard players set $74 Const 74
scoreboard players set $75 Const 75
scoreboard players set $76 Const 76
scoreboard players set $77 Const 77
scoreboard players set $78 Const 78
scoreboard players set $79 Const 79
scoreboard players set $80 Const 80
scoreboard players set $81 Const 81
scoreboard players set $82 Const 82
scoreboard players set $83 Const 83
scoreboard players set $84 Const 84
scoreboard players set $85 Const 85
scoreboard players set $86 Const 86
scoreboard players set $87 Const 87
scoreboard players set $88 Const 88
scoreboard players set $89 Const 89
scoreboard players set $90 Const 90
scoreboard players set $91 Const 91
scoreboard players set $92 Const 92
scoreboard players set $93 Const 93
scoreboard players set $94 Const 94
scoreboard players set $95 Const 95
scoreboard players set $96 Const 96
scoreboard players set $97 Const 97
scoreboard players set $98 Const 98
scoreboard players set $99 Const 99
scoreboard players set $100 Const 100
scoreboard players set $150 Const 150
scoreboard players set $183 Const 183
scoreboard players set $200 Const 200
scoreboard players set $250 Const 250
scoreboard players set $300 Const 300
scoreboard players set $350 Const 350
scoreboard players set $400 Const 400
scoreboard players set $450 Const 450
scoreboard players set $500 Const 500
scoreboard players set $550 Const 550
scoreboard players set $600 Const 600
scoreboard players set $650 Const 650
scoreboard players set $700 Const 700
scoreboard players set $750 Const 750
scoreboard players set $800 Const 800
scoreboard players set $850 Const 850
scoreboard players set $900 Const 900
scoreboard players set $950 Const 950
scoreboard players set $1000 Const 1000
scoreboard players set $1500 Const 1500
scoreboard players set $2000 Const 2000
scoreboard players set $2500 Const 2500
scoreboard players set $3000 Const 3000
scoreboard players set $3500 Const 3500
scoreboard players set $4000 Const 4000
scoreboard players set $4500 Const 4500
scoreboard players set $5000 Const 5000
scoreboard players set $5500 Const 5500
scoreboard players set $6000 Const 6000
scoreboard players set $6500 Const 6500
scoreboard players set $7000 Const 7000
scoreboard players set $7500 Const 7500
scoreboard players set $8000 Const 8000
scoreboard players set $8500 Const 8500
scoreboard players set $9000 Const 9000
scoreboard players set $9500 Const 9500
scoreboard players set $10000 Const 10000
scoreboard players set $15000 Const 15000
scoreboard players set $20000 Const 20000
scoreboard players set $25000 Const 25000
scoreboard players set $30000 Const 30000
scoreboard players set $35000 Const 35000
scoreboard players set $40000 Const 40000
scoreboard players set $45000 Const 45000
scoreboard players set $50000 Const 50000
scoreboard players set $55000 Const 55000
scoreboard players set $60000 Const 60000
scoreboard players set $65000 Const 65000
scoreboard players set $70000 Const 70000
scoreboard players set $75000 Const 75000
scoreboard players set $80000 Const 80000
scoreboard players set $85000 Const 85000
scoreboard players set $90000 Const 90000
scoreboard players set $95000 Const 95000
scoreboard players set $100000 Const 100000
scoreboard players set $150000 Const 150000
scoreboard players set $200000 Const 200000
scoreboard players set $250000 Const 250000
scoreboard players set $300000 Const 300000
scoreboard players set $350000 Const 350000
scoreboard players set $400000 Const 400000
scoreboard players set $450000 Const 450000
scoreboard players set $500000 Const 500000
scoreboard players set $550000 Const 550000
scoreboard players set $600000 Const 600000
scoreboard players set $650000 Const 650000
scoreboard players set $700000 Const 700000
scoreboard players set $750000 Const 750000
scoreboard players set $800000 Const 800000
scoreboard players set $850000 Const 850000
scoreboard players set $900000 Const 900000
scoreboard players set $950000 Const 950000
scoreboard players set $1000000 Const 1000000
scoreboard players set $1500000 Const 1500000
scoreboard players set $2000000 Const 2000000
scoreboard players set $2500000 Const 2500000
scoreboard players set $3000000 Const 3000000
scoreboard players set $3500000 Const 3500000
scoreboard players set $4000000 Const 4000000
scoreboard players set $4500000 Const 4500000
scoreboard players set $5000000 Const 5000000
scoreboard players set $5500000 Const 5500000
scoreboard players set $6000000 Const 6000000
scoreboard players set $6500000 Const 6500000
scoreboard players set $7000000 Const 7000000
scoreboard players set $7500000 Const 7500000
scoreboard players set $8000000 Const 8000000
scoreboard players set $8500000 Const 8500000
scoreboard players set $9000000 Const 9000000
scoreboard players set $9500000 Const 9500000
scoreboard players set $10000000 Const 10000000
scoreboard players set $15000000 Const 15000000
scoreboard players set $20000000 Const 20000000
scoreboard players set $25000000 Const 25000000
scoreboard players set $30000000 Const 30000000
scoreboard players set $35000000 Const 35000000
scoreboard players set $40000000 Const 40000000
scoreboard players set $45000000 Const 45000000
scoreboard players set $50000000 Const 50000000
scoreboard players set $55000000 Const 55000000
scoreboard players set $60000000 Const 60000000
scoreboard players set $65000000 Const 65000000
scoreboard players set $70000000 Const 70000000
scoreboard players set $75000000 Const 75000000
scoreboard players set $80000000 Const 80000000
scoreboard players set $85000000 Const 85000000
scoreboard players set $90000000 Const 90000000
scoreboard players set $95000000 Const 95000000
scoreboard players set $100000000 Const 100000000
scoreboard players set $150000000 Const 150000000
scoreboard players set $200000000 Const 200000000
scoreboard players set $250000000 Const 250000000
scoreboard players set $300000000 Const 300000000
scoreboard players set $350000000 Const 350000000
scoreboard players set $400000000 Const 400000000
scoreboard players set $450000000 Const 450000000
scoreboard players set $500000000 Const 500000000
scoreboard players set $550000000 Const 550000000
scoreboard players set $600000000 Const 600000000
scoreboard players set $650000000 Const 650000000
scoreboard players set $700000000 Const 700000000
scoreboard players set $750000000 Const 750000000
scoreboard players set $800000000 Const 800000000
scoreboard players set $850000000 Const 850000000
scoreboard players set $900000000 Const 900000000
scoreboard players set $950000000 Const 950000000
scoreboard players set $1000000000 Const 1000000000
scoreboard players set $1500000000 Const 1500000000
scoreboard players set $2000000000 Const 2000000000

#回転周り
scoreboard players set $90 Const 90
scoreboard players set $180 Const 180
scoreboard players set $270 Const 270
scoreboard players set $360 Const 360
scoreboard players set $90*1 Const 90
scoreboard players set $180*1 Const 180
scoreboard players set $270*1 Const 270
scoreboard players set $360*1 Const 360
scoreboard players set $90*10 Const 900
scoreboard players set $180*10 Const 1800
scoreboard players set $270*10 Const 2700
scoreboard players set $360*10 Const 3600
scoreboard players set $90*100 Const 9000
scoreboard players set $180*100 Const 18000
scoreboard players set $270*100 Const 27000
scoreboard players set $360*100 Const 36000
scoreboard players set $90*1000 Const 90000
scoreboard players set $180*1000 Const 180000
scoreboard players set $270*1000 Const 270000
scoreboard players set $360*1000 Const 360000
scoreboard players set $90*10000 Const 900000
scoreboard players set $180*10000 Const 1800000
scoreboard players set $270*10000 Const 2700000
scoreboard players set $360*10000 Const 3600000
scoreboard players set $90*100000 Const 9000000
scoreboard players set $180*100000 Const 18000000
scoreboard players set $270*100000 Const 27000000
scoreboard players set $360*100000 Const 36000000
scoreboard players set $90*1000000 Const 90000000
scoreboard players set $180*1000000 Const 180000000
scoreboard players set $270*1000000 Const 270000000
scoreboard players set $360*1000000 Const 360000000

#bit周り
scoreboard players set $2^1 Const 2
scoreboard players set $2^2 Const 4
scoreboard players set $2^3 Const 8
scoreboard players set $2^4 Const 16
scoreboard players set $2^5 Const 32
scoreboard players set $2^6 Const 64
scoreboard players set $2^7 Const 128
scoreboard players set $2^8 Const 256
scoreboard players set $2^9 Const 512
scoreboard players set $2^10 Const 1024
scoreboard players set $2^11 Const 2048
scoreboard players set $2^12 Const 4096
scoreboard players set $2^13 Const 8192
scoreboard players set $2^14 Const 16384
scoreboard players set $2^15 Const 32768
scoreboard players set $2^16 Const 65536
scoreboard players set $2^17 Const 131072
scoreboard players set $2^18 Const 262144
scoreboard players set $2^19 Const 524288
scoreboard players set $2^20 Const 1048576
scoreboard players set $2^21 Const 2097152
scoreboard players set $2^22 Const 4194304
scoreboard players set $2^23 Const 8388608
scoreboard players set $2^24 Const 16777216
scoreboard players set $2^25 Const 33554432
scoreboard players set $2^26 Const 67108864
scoreboard players set $2^27 Const 134217728
scoreboard players set $2^28 Const 268435456
scoreboard players set $2^29 Const 536870912
scoreboard players set $2^30 Const 1073741824

scoreboard players set $1 Const 1
scoreboard players set $3 Const 3
scoreboard players set $7 Const 7
scoreboard players set $15 Const 15
scoreboard players set $31 Const 31
scoreboard players set $63 Const 63
scoreboard players set $127 Const 127
scoreboard players set $255 Const 255
scoreboard players set $511 Const 511
scoreboard players set $1023 Const 1023
scoreboard players set $2047 Const 2047
scoreboard players set $4095 Const 4095
scoreboard players set $8191 Const 8191
scoreboard players set $16383 Const 16383
scoreboard players set $32767 Const 32767
scoreboard players set $65535 Const 65535
scoreboard players set $131071 Const 131071
scoreboard players set $262143 Const 262143
scoreboard players set $524287 Const 524287
scoreboard players set $1048575 Const 1048575
scoreboard players set $2097151 Const 2097151
scoreboard players set $4194303 Const 4194303
scoreboard players set $8388607 Const 8388607
scoreboard players set $16777215 Const 16777215
scoreboard players set $33554431 Const 33554431
scoreboard players set $67108863 Const 67108863
scoreboard players set $134217727 Const 134217727
scoreboard players set $268435455 Const 268435455
scoreboard players set $536870911 Const 536870911
scoreboard players set $1073741823 Const 1073741823

scoreboard players set $2 Const 2
scoreboard players set $4 Const 4
scoreboard players set $8 Const 8
scoreboard players set $16 Const 16
scoreboard players set $32 Const 32
scoreboard players set $64 Const 64
scoreboard players set $128 Const 128
scoreboard players set $256 Const 256
scoreboard players set $512 Const 512
scoreboard players set $1024 Const 1024
scoreboard players set $2048 Const 2048
scoreboard players set $4096 Const 4096
scoreboard players set $8192 Const 8192
scoreboard players set $16384 Const 16384
scoreboard players set $32768 Const 32768
scoreboard players set $65536 Const 65536
scoreboard players set $131072 Const 131072
scoreboard players set $262144 Const 262144
scoreboard players set $524288 Const 524288
scoreboard players set $1048576 Const 1048576
scoreboard players set $2097152 Const 2097152
scoreboard players set $4194304 Const 4194304
scoreboard players set $8388608 Const 8388608
scoreboard players set $16777216 Const 16777216
scoreboard players set $33554432 Const 33554432
scoreboard players set $67108864 Const 67108864
scoreboard players set $134217728 Const 134217728
scoreboard players set $268435456 Const 268435456
scoreboard players set $536870912 Const 536870912
scoreboard players set $1073741824 Const 1073741824

#その他定数
scoreboard players set $31743 Const 31743

scoreboard players set $byte.min Const -256
scoreboard players set $byte.max Const 255
scoreboard players set $short.min Const -32768
scoreboard players set $short.max Const 32767
scoreboard players set $int.min Const -2147483648
scoreboard players set $int.max Const 2147483647
scoreboard players set $min Const -2147483648
scoreboard players set $max Const 2147483647

scoreboard players set $-256 Const -256
scoreboard players set $255 Const 255
scoreboard players set $-32768 Const -32768
scoreboard players set $32767 Const 32767
scoreboard players set $-2147483648 Const -2147483648
scoreboard players set $2147483647 Const 2147483647
scoreboard players set $-2147483648 Const -2147483648
scoreboard players set $2147483647 Const 2147483647


text:
#> core:load
#
# #load時に毎回実行される処理群
#
# @within tag/function minecraft:load

# ⚠ リリース時のみtrueにすること。 これをtrueにした場合、ワールドに不可逆的な登録処理が発生します。 ⚠
    data modify storage global IsProduction set value false

# 初回限定ロード
    execute if data storage global {IsProduction:1b} unless data storage global GameVersion run function core:load_once
    execute if data storage global {IsProduction:0b} run function core:load_once

# マイグレーション
    function core:migration/

# 神器のレジストリ読み込み
    function asset_manager:artifact/load

# 初期化処理
    execute if data storage global {IsProduction:0b} run function #asset:mob/load
    execute if data storage global {IsProduction:0b} run function #asset:artifact/load


text:
#> core:load_once
#
# #load時に一回のみ実行される処理群
#
# @within function core:load

#> バージョン情報の設定
data modify storage global GameVersion set value "v0.1.6"

#> forceload chunksの設定
# Origin
    execute in overworld run forceload add -1 -1 0 0
    execute in the_nether run forceload add -1 -1 0 0
    execute in the_end run forceload add -1 -1 0 0
# ShulkerBox
    execute in overworld run forceload add 10000 10000
    execute in the_nether run forceload add 10000 10000
    execute in the_end run forceload add 10000 10000
# Item Return Point
    execute in overworld run forceload add 2927 -1273
# テレポート先
    # 神殿出口
        execute in overworld run forceload add 62 -12
    # 神殿入り口
        execute in overworld run forceload add 3040 -544 3103 -481
    # Item Return Point
        execute in overworld run forceload add 2922 -1333 2934 -1313
    # 神殿
        execute in overworld run forceload add 2976 -144 3007 -129
        execute in overworld run forceload add 3448 -472
        execute in overworld run forceload add 2915 -862
        execute in overworld run forceload add 3056 -896 3087 -881
        execute in overworld run forceload add 3411 -630

#> gameruleの設定
function core:define_gamerule

#> エイリアスの登録とシャルカーボックスのsetblock
# @public
    #alias vector shulkerA 10000 0 10000
    #alias vector shulkerB 10000 1 10000
    #alias vector worldSpawn 23 3 24
execute in overworld run setblock 10000 0 10000 lime_shulker_box{Lock:"lock"}
execute in overworld run setblock 10000 1 10000 lime_shulker_box{Lock:"lock"}
execute in the_nether run setblock 10000 0 10000 lime_shulker_box{Lock:"lock"}
execute in the_nether run setblock 10000 1 10000 lime_shulker_box{Lock:"lock"}
execute in the_end run setblock 10000 0 10000 lime_shulker_box{Lock:"lock"}
execute in the_end run setblock 10000 1 10000 lime_shulker_box{Lock:"lock"}

#> デバッグ用storageの設定
#
# Prefix.<DEBUG,SUCCESS,FAILED,ERROR,CRIT>
#
# @public
    #declare tag DevPrivilege
    #declare storage global
data modify storage global Prefix.DEBUG set value "§3DEBUG >> §r"
data modify storage global Prefix.SUCCESS set value "§aSUCCESS >> §r"
data modify storage global Prefix.FAILED set value "§cFAILED >> §r"
data modify storage global Prefix.ERROR set value "§cERROR >> §r"
data modify storage global Prefix.CRIT set value "§4CRITICAL >> §r"

data modify storage global GodIcon.Flora set value '{"text":"\\uE010","color":"white","font":"tsb"}'
data modify storage global GodIcon.Urban set value '{"text":"\\uE011","color":"white","font":"tsb"}'
data modify storage global GodIcon.Nyaptov set value '{"text":"\\uE012","color":"white","font":"tsb"}'
data modify storage global GodIcon.Wi-ki set value '{"text":"\\uE013","color":"white","font":"tsb"}'
data modify storage global GodIcon.Rumor set value '{"text":"\\uE014","color":"white","font":"tsb"}'

#> リセット必須オブジェクト等の削除
scoreboard objectives remove Debug
scoreboard objectives remove FirstJoinEvent
kill 0-0-0-0-0

#> ベクトル用等のシステム内汎用Entityのエイリアスの登録とsummon
# @within *
#   api:**
#   asset_manager:**
#   core:**
#   lib:**
#   mob_manager:**
#   player_manager:**
    #alias entity commonMarker 0-0-0-0-0
    #alias entity commonArmorStand 0-0-0-0-1
summon marker 0.0 0.0 0.0 {UUID:[I;0,0,0,0]}
summon armor_stand 0.0 0.0 0.0 {UUID:[I;0,0,0,1],Marker:1b,Invisible:1b}

#> 当たり判定を消す汎用Teamの作成
# @public
    team add NoCollision
team modify NoCollision collisionRule never

#> スコアボード類
    #> 1tickで消す一時変数の保存用スコアボード
    # @public
        scoreboard objectives add Temporary dummy

    #> 常に値が設定される変数用スコアボード
    # @public
        scoreboard objectives add Global dummy
    # 乱数値の設定
        #> Private
        # @private
            #declare tag Random
        summon minecraft:area_effect_cloud ~ ~ ~ {Age:-2147483648,Duration:-1,WaitTime:-2147483648,Tags:["Random"]}
        execute store result score $Random.Base Global run data get entity @e[tag=Random,limit=1] UUID[1]
        execute store result score $Random.Carry Global run data get entity @e[tag=Random,limit=1] UUID[3]
        kill @e[tag=Random,limit=1]
    scoreboard players set $Difficulty Global 2

    #> 定数類用スコアボード **変更厳禁**
    # @public
        scoreboard objectives add Const dummy
    function core:define_const

    #> UserID
    # @public
        scoreboard objectives add UserID dummy {"text":"汎用固有ユーザーID"}
        scoreboard objectives add MobUUID dummy {"text":"汎用固有MobID"}

    #> DEBUG用スコアボード
    # @within function core:load_once
        scoreboard objectives add Debug dummy {"text":"デバッグ"}

    #> AssetManager: 神器
    # @within function
    #   core:load_once
    #   asset_manager:artifact/**
        bossbar add asset:special_cooldown {"text":"特殊クールダウン"}
        scoreboard objectives add Sneak.Mainhand custom:sneak_time {"text":"スニークタイム: メインハンド"}
        scoreboard objectives add Sneak.Offhand custom:sneak_time {"text":"スニークタイム: オフハンド"}
        scoreboard objectives add Sneak.Head custom:sneak_time {"text":"スニークタイム: 頭"}
        scoreboard objectives add Sneak.Chest custom:sneak_time {"text":"スニークタイム: 胸"}
        scoreboard objectives add Sneak.Legs custom:sneak_time {"text":"スニークタイム: 脚"}
        scoreboard objectives add Sneak.Feet custom:sneak_time {"text":"スニークタイム: 足"}
        scoreboard objectives add Sneak.Hotbar0 custom:sneak_time {"text":"スニークタイム: ホットバー0"}
        scoreboard objectives add Sneak.Hotbar1 custom:sneak_time {"text":"スニークタイム: ホットバー1"}
        scoreboard objectives add Sneak.Hotbar2 custom:sneak_time {"text":"スニークタイム: ホットバー2"}
        scoreboard objectives add Sneak.Hotbar3 custom:sneak_time {"text":"スニークタイム: ホットバー3"}
        scoreboard objectives add Sneak.Hotbar4 custom:sneak_time {"text":"スニークタイム: ホットバー4"}
        scoreboard objectives add Sneak.Hotbar5 custom:sneak_time {"text":"スニークタイム: ホットバー5"}
        scoreboard objectives add Sneak.Hotbar6 custom:sneak_time {"text":"スニークタイム: ホットバー6"}
        scoreboard objectives add Sneak.Hotbar7 custom:sneak_time {"text":"スニークタイム: ホットバー7"}
        scoreboard objectives add Sneak.Hotbar8 custom:sneak_time {"text":"スニークタイム: ホットバー8"}
        scoreboard objectives add MPLogCD dummy {"text":"神器をMP枯渇で失敗した際のログのクールダウン"}
        scoreboard objectives add BelieveLogCD dummy {"text":"神器を信仰で失敗した際のログのクールダウン"}
        scoreboard objectives add LocalCDLogCD dummy {"text":"神器をローカルクールダウンで失敗した際のログのクールダウン"}
        scoreboard objectives add SpecialCDLogCD dummy {"text":"神器を特殊クールダウンで失敗した際のログのクールダウン"}
    bossbar set asset:special_cooldown color green
    bossbar set asset:special_cooldown style notched_10

    #> AssetManager: Mob -Public
    # @public
        scoreboard objectives add MobID dummy {"text":"MobAssetのID"}

    #> AssetManager: Mob -Private
    # @within function
    #   core:load_once
    #   asset_manager:mob/**
        bossbar add asset:bossbar {"text":""}
        scoreboard objectives add VoidActionTime dummy {"text":"汎用奈落耐性アクションの状態"}
        scoreboard objectives add VoidMobID dummy {"text":"耐性MobとAECの紐付け用"}
    bossbar set asset:bossbar color pink
    bossbar set asset:bossbar style notched_10

    #> AssetManager: Spawner
    # @within function
    #   asset_manager:spawner/**
        scoreboard objectives add SpawnerHP dummy {"text":"スポナーの残体力"}
        scoreboard objectives add SpawnerCooldown dummy {"text":"スポナーの召喚クールダウン"}

    #> AssetManager: Island
    # @within function
    #   asset_manager:island/**
        scoreboard objectives add DispelTime dummy {"text":"解呪の時間"}
        scoreboard objectives add TargetBossID dummy {"text":"召喚するボスのID"}

    #> イベントハンドラ用スコアボード
    # @within function
    #   asset_manager:artifact/triggers/**
    #   player_manager:vanilla_attack/show_log
    #   core:load_once
    #   core:handler/*
    #   core:tick/**
        scoreboard objectives add FirstJoinEvent custom:play_time {"text":"イベント: 初回Join"}
        scoreboard objectives add RejoinEvent custom:leave_game {"text":"イベント: 再Join"}
        scoreboard objectives add AttackEvent custom:damage_dealt_absorbed {"text":"イベント: 攻撃"}
        scoreboard objectives add DeathEvent deathCount {"text":"イベント: 死亡"}
        scoreboard objectives add RespawnEvent custom:time_since_death {"text":"イベント: リスポーン"}
        scoreboard objectives add ClickCarrotEvent used:carrot_on_a_stick {"text":"イベント: クリック 人参棒"}
        scoreboard objectives add Sneak custom:sneak_time {"text":"イベント: スニーク"}
        scoreboard objectives add Elytra custom:aviate_one_cm {"text":"イベント: エリトラ"}
        scoreboard objectives add DropEvent custom:drop {"text":"イベント: アイテムドロップ"}

    #> Library用スコアボード
    # @public
        scoreboard objectives add Lib dummy {"text":"ライブラリの引数/返り値用"}

    #> Library用スコアボード - PrivateUse
    # @within * lib:**
        scoreboard objectives add LogRemoveTime dummy
        scoreboard objectives add ScoreToHPFluc dummy

    #> PlayerManager - Motionチェック用スコアボード
    # @within
    #   function
    #       player_manager:pos_fix_and_calc_diff
    #       api:player_vector/get
    #   predicate lib:is_player_moving
        scoreboard objectives add PlayerStopTime dummy
        scoreboard objectives add PosPacketLossDetectAfterTick dummy

    #> PlayerManager - AdjustHunger用スコアボード
    # @within function player_manager:adjust_hunger/**
        scoreboard objectives add HungerTarget dummy {"text":"目標の満腹度"}
        scoreboard objectives add Hunger food {"text":"現在の満腹度"}

    #> PlayerManager - 信仰
    # @within function player_manager:god/**
        scoreboard objectives add Believe trigger {"text":"信仰のユーザー入力"}
        scoreboard objectives add Believe2 trigger {"text":"信仰のユーザー入力"}
        scoreboard objectives add Believe3 trigger {"text":"信仰のユーザー入力"}
        scoreboard objectives add GodMessagePhase dummy {"text":"信仰変更のチャット遅延用"}

    #> PlayerManager - Teams
    # @within function
    #   core:load_once
    #   player_manager:set_team_and_per_health
        team add None.LowHP
        team add None.MedHP
        team add None.HighHP
        team add Flora.LowHP
        team add Flora.MedHP
        team add Flora.HighHP
        team add Urban.LowHP
        team add Urban.MedHP
        team add Urban.HighHP
        team add Nyaptov.LowHP
        team add Nyaptov.MedHP
        team add Nyaptov.HighHP
        team add Wi-ki.LowHP
        team add Wi-ki.MedHP
        team add Wi-ki.HighHP
        team add Rumor.LowHP
        team add Rumor.MedHP
        team add Rumor.HighHP
    team modify None.LowHP color red
    team modify None.MedHP color yellow
    team modify None.HighHP color green
    team modify Flora.LowHP color red
    team modify Flora.MedHP color yellow
    team modify Flora.HighHP color green
    team modify Urban.LowHP color red
    team modify Urban.MedHP color yellow
    team modify Urban.HighHP color green
    team modify Nyaptov.LowHP color red
    team modify Nyaptov.MedHP color yellow
    team modify Nyaptov.HighHP color green
    team modify Wi-ki.LowHP color red
    team modify Wi-ki.MedHP color yellow
    team modify Wi-ki.HighHP color green
    team modify Rumor.LowHP color red
    team modify Rumor.MedHP color yellow
    team modify Rumor.HighHP color green
    team modify None.LowHP prefix {"text":"  ","color":"white"}
    team modify None.MedHP prefix {"text":"  ","color":"white"}
    team modify None.HighHP prefix {"text":"  ","color":"white"}
    team modify Flora.LowHP prefix [{"text":"\uE010","color":"white","font":"tsb"},{"text":" ","font":"default"}]
    team modify Flora.MedHP prefix [{"text":"\uE010","color":"white","font":"tsb"},{"text":" ","font":"default"}]
    team modify Flora.HighHP prefix [{"text":"\uE010","color":"white","font":"tsb"},{"text":" ","font":"default"}]
    team modify Urban.LowHP prefix [{"text":"\uE011","color":"white","font":"tsb"},{"text":" ","font":"default"}]
    team modify Urban.MedHP prefix [{"text":"\uE011","color":"white","font":"tsb"},{"text":" ","font":"default"}]
    team modify Urban.HighHP prefix [{"text":"\uE011","color":"white","font":"tsb"},{"text":" ","font":"default"}]
    team modify Nyaptov.LowHP prefix [{"text":"\uE012","color":"white","font":"tsb"},{"text":" ","font":"default"}]
    team modify Nyaptov.MedHP prefix [{"text":"\uE012","color":"white","font":"tsb"},{"text":" ","font":"default"}]
    team modify Nyaptov.HighHP prefix [{"text":"\uE012","color":"white","font":"tsb"},{"text":" ","font":"default"}]
    team modify Wi-ki.LowHP prefix [{"text":"\uE013","color":"white","font":"tsb"},{"text":" ","font":"default"}]
    team modify Wi-ki.MedHP prefix [{"text":"\uE013","color":"white","font":"tsb"},{"text":" ","font":"default"}]
    team modify Wi-ki.HighHP prefix [{"text":"\uE013","color":"white","font":"tsb"},{"text":" ","font":"default"}]
    team modify Rumor.LowHP prefix [{"text":"\uE014","color":"white","font":"tsb"},{"text":" ","font":"default"}]
    team modify Rumor.MedHP prefix [{"text":"\uE014","color":"white","font":"tsb"},{"text":" ","font":"default"}]
    team modify Rumor.HighHP prefix [{"text":"\uE014","color":"white","font":"tsb"},{"text":" ","font":"default"}]

    #> PlayerManager用スコアボード
    # @within
    #   function core:handler/first_join
    #   function core:load_once
    #   * api:**
    #   * player_manager:**
        scoreboard objectives add Health health {"text":"♥","color":"#FF4c99"}
        scoreboard objectives add PerHealth dummy {"text":"♥","color":"#FF4c99"}
        scoreboard objectives add MP dummy {"text":"MP"}
        scoreboard objectives add MPFloat dummy {"text":"MP - 小数部"}
        scoreboard objectives add MPMax dummy {"text":"MP上限値"}
        scoreboard objectives add MPRegenCooldown dummy {"text":"MP再生のクールダウン"}
    scoreboard objectives setdisplay belowName Health
    scoreboard objectives modify PerHealth rendertype hearts
    scoreboard objectives setdisplay list PerHealth

    #> 最大値用スコアホルダー
    # @within function
    #   core:load_once
    #   core:handler/first_join
    #   player_manager:bonus/**
    #   asset:artifact/0002.blessing/trigger/**
        #declare score_holder $MaxHealth
        #declare score_holder $MaxMP
        #declare score_holder $AttackBonus
        #declare score_holder $DefenseBonus
    scoreboard players set $MaxHealth Global 200000
    scoreboard players set $MaxMP Global 100
    scoreboard players set $AttackBonus Global 0
    scoreboard players set $DefenseBonus Global 0

    #> WorldManager用スコアボード - ChunkLoadProtect
    # @within
    #   function
    #       core:tick/player/pre
    #       world_manager:chunk_io_protect/*
    #   predicate api:is_completed_player_chunk_load_waiting_time
        scoreboard objectives add ChunkLoadWaitingTime dummy {"text":"プレイヤーの周囲のチャンクロードが終了するまでの待ち時間"}

    #> WorldManager用スコアボード - Area
    # @within function
    #   world_manager:area/**
    #   world_manager:** @readonly
    #   player_manager:** @readonly
        scoreboard objectives add InArea dummy {"text":"プレイヤーが居るエリア"}
        scoreboard objectives add InSubArea dummy {"text":"どのサブエリアに居るか"}

    #> WorldManager用スコアボード - テレポーター
    # @within function
    #   asset_manager:teleporter/tick/**
        scoreboard objectives add TPStarFromUserID dummy {"text":"テレポーターの星のユーザーID"}

    #> MobManager用スコアボード - 最大体力
    # @within function
    #   api:mob/get_max_health*
    #   asset_manager:mob/summon/set_data
    #   mob_manager:init/modify_health
    #   mob_manager:init/multiplay_multiplier/*
        scoreboard objectives add MobHealthMax dummy
        scoreboard objectives add MobMaxHealthMultiplier dummy {"text":"MOBの体力のマルチプレイ補正倍率 (e1)"}

    #> MobManager用スコアボード - 攻撃元
    # @within function
    #   core:tick/
    #   asset_manager:*/triggers/
    #   asset_manager:artifact/triggers/damage
    #   mob_manager:entity_finder/attacking_entity/*
        scoreboard objectives add AttackingEntity dummy

    #> MobManager用スコアボード - 攻撃先
    # @within function
    #   core:tick/
    #   asset_manager:*/triggers/
    #   asset_manager:artifact/triggers/attack
    #   player_manager:vanilla_attack/show_log
    #   mob_manager:entity_finder/attacked_entity/*
        scoreboard objectives add AttackedEntity dummy

    #> MobManager - Teams
    # @within function
    #   mob_manager:init/set_tag_and_team
    #   asset_manager:mob/summon/set_data
        team add Enemy

#> 各Asset側のロード処理
    function #asset:artifact/load
    function #asset:mob/load

#> 神の慈悲アイテムを定義する
    function player_manager:god/mercy/offering/init

#> ROMを初期化する
    function rom:init


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

#> Global Vars
# @public
    #declare score_holder $PlayerCount
    #declare score_holder $LoadTime

# TODO 上記のGlobal VarsをPrivateにしてAPIに移行する
#> Global Vars - Private
# @within *
#   core:load_once
#   api:global_vars/difficulty/**
    #declare score_holder $Difficulty

#> DeathTag
# @public
    #declare tag Death

#> DistributedIntervalGroup
# @within function **6_distributed_interval
#declare score_holder $DistributeGroup


text:
#> core:define_gamerule
#
# gameruleを定義します
#
# @within function core:load_once

gamerule announceAdvancements true
gamerule commandBlockOutput false
gamerule disableElytraMovementCheck false
gamerule disableRaids true
execute if data storage global {IsProduction:1b} run gamerule doDaylightCycle true
execute if data storage global {IsProduction:0b} run gamerule doDaylightCycle false
gamerule doEntityDrops true
execute if data storage global {IsProduction:1b} run gamerule doFireTick true
execute if data storage global {IsProduction:0b} run gamerule doFireTick false
gamerule doImmediateRespawn false
execute if data storage global {IsProduction:1b} run gamerule doInsomnia true
execute if data storage global {IsProduction:0b} run gamerule doInsomnia false
gamerule doLimitedCrafting false
gamerule doMobLoot true
execute if data storage global {IsProduction:1b} run gamerule doMobSpawning true
execute if data storage global {IsProduction:0b} run gamerule doMobSpawning false
gamerule doPatrolSpawning false
gamerule doTileDrops true
gamerule doTraderSpawning false
execute if data storage global {IsProduction:1b} run gamerule doWeatherCycle true
execute if data storage global {IsProduction:0b} run gamerule doWeatherCycle false
gamerule drowningDamage true
gamerule fallDamage true
gamerule fireDamage true
gamerule forgiveDeadPlayers false
gamerule keepInventory true
execute if data storage global {IsProduction:1b} run gamerule logAdminCommands false
execute if data storage global {IsProduction:0b} run gamerule logAdminCommands true
gamerule maxCommandChainLength 2147483647
gamerule maxEntityCramming 24
execute if data storage global {IsProduction:1b} run gamerule mobGriefing true
execute if data storage global {IsProduction:0b} run gamerule mobGriefing false
gamerule naturalRegeneration true
gamerule randomTickSpeed 3
execute if data storage global {IsProduction:1b} run gamerule reducedDebugInfo true
execute if data storage global {IsProduction:0b} run gamerule reducedDebugInfo false
execute if data storage global {IsProduction:1b} run gamerule sendCommandFeedback false
execute if data storage global {IsProduction:0b} run gamerule sendCommandFeedback true
gamerule showDeathMessages true
gamerule spawnRadius 0
gamerule spectatorsGenerateChunks true
gamerule universalAnger false


text:
#> core:handler/attack
#
# entityを殴った際に実行される
#
# @within function core:tick/player/

# ダメージ表示
    function player_manager:vanilla_attack/show_log
# asset_managerへの引継ぎ
    tag @s add TriggerFlag.Attack
# Reset
    scoreboard players reset @s AttackEvent


text:
#> core:handler/damage
#
# ダメージを受けた際に実行される
#
# @within function core:tick/player/

# asset_managerへの引継ぎ
    tag @s add TriggerFlag.Damage
# Reset
    advancement revoke @s only core:handler/damage


text:
#> core:handler/consume_item
#
# アイテムの使用時に実行
#
# @within function core:tick/player/

# asset_managerへの引継ぎ
    tag @s add TriggerFlag.UseItem
# Reset
    advancement revoke @s only core:handler/consume_item


text:
#> core:handler/using_item
#
# アイテムを使用している最中に実行される
#
# @within function core:tick/player/

# asset_managerへの引継ぎ
    tag @s add TriggerFlag.UsingItem

# reset
    advancement revoke @s only core:handler/using_item


text:
#> core:handler/sneak
#
# スニーク中に実行される
#
# @within function core:tick/player/

# asset_managerへの引継ぎ
    tag @s add TriggerFlag.Sneak


text:
#> core:handler/inventory_change
#
# インベントリに変更があったときにトリガーされる
#
# @within function core:tick/player/

# Reset
    advancement revoke @s only core:handler/inventory_change


text:
#> core:handler/respawn.delay
#
# リスポーン後80tick経過時に実行される
#
# @within function core:tick/player/

# リスポーン時の満腹度調整
    function player_manager:adjust_hunger/respawn.delay


text:
#> core:handler/killed
#
# entityをkillした際に実行
#
# @within function core:tick/player/

# asset_managerへの引継ぎ
    tag @s add TriggerFlag.Killed
# Reset
    advancement revoke @s only core:handler/killed


text:
#> core:handler/rejoin
#
# 二度目以降のJoin時に実行される
#
# @within function core:tick/player/

# 共通Join処理
    function core:handler/join
# asset_managerへの引継ぎ
    tag @s add TriggerFlag.Rejoin
# Reset
    scoreboard players reset @s RejoinEvent


text:
#> core:handler/click.carrot
#
# 人参棒をクリックした際に実行される
#
# @within function core:tick/player/

# asset_managerへの引継ぎ
    tag @s add TriggerFlag.ClickCarrot
# Reset
    scoreboard players reset @s ClickCarrotEvent


text:
#> core:handler/death
#
# 死亡時に実行される
#
# @within function core:tick/player/post

# 満腹度を保存
    function player_manager:adjust_hunger/death
# 死亡時のアイテム没収処理
    function api:data_get/inventory
    execute if data storage api: Inventory[0] unless predicate player_manager:is_believe/null run function player_manager:lost_item/take
    execute if data storage api: Inventory[0] if predicate player_manager:is_believe/null run function player_manager:lost_item/drop/
# Reset
    scoreboard players reset @s DeathEvent


text:
#> core:handler/flying_elytra
#
# エリトラ飛行中に実行
#
# @within function core:tick/player/

# Nyaptov恩恵で使用
    tag @s add Nyaptov.FlyingElytra

# リセット
    scoreboard players reset @s Elytra


text:
#> core:handler/join
#
#
#
# @within function
#   core:handler/first_join
#   core:handler/rejoin

# バージョンチェック
    function player_manager:version_check
# ボーナスの更新
    function player_manager:bonus/update_health_bonus
    function player_manager:bonus/update_mp_bonus
    function player_manager:bonus/update_attack_bonus
    function player_manager:bonus/update_defense_bonus
# ロード待ち時間を更新する
    function world_manager:chunk_io_protect/update_load_waiting_time


text:
#> core:handler/first_join
#
# 初回Join時に実行される
#
# @within function core:tick/player/

#> UserIDのIndex
# @private
    #declare score_holder $UserIDIndex

# 固有ユーザーID
    scoreboard players add $UserIDIndex Global 1
    scoreboard players operation @s UserID = $UserIDIndex Global
# お友達(概念)
    tag @s add Friend
# 無信仰にする
    function player_manager:god/none/set_tag
# ステータス初期化
    function oh_my_dat:please
    data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].Modifiers set value {Heal:1d,ReceiveHeal:1d,Attack:{Base:1d,Physical:1d,Magic:1d,None:1d,Fire:1d,Water:1d,Thunder:1d},Defense:{Base:1d,Physical:1d,Magic:1d,None:1d,Fire:1d,Water:1d,Thunder:1d},MPRegen:1d}
# 神器クールダウンの初期化
    data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCoolDown set value [{Value:-15,Max:0},{Value:-15,Max:0},{Value:-15,Max:0},{Value:-15,Max:0},{Value:-15,Max:0},{Value:-15,Max:0},{Value:-15,Max:0},{Value:-15,Max:0},{Value:-15,Max:0},{Value:-15,Max:0},{Value:-15,Max:0},{Value:-15,Max:0},{Value:-15,Max:0},{Value:-15,Max:0}]

# 共通Join処理
    function core:handler/join

# リスポーンイベントが初回に発火しないように
    scoreboard players set @s RespawnEvent 81


text:
#> core:handler/drop
#
# アイテムを投げた時に実行される
#
# @within function core:tick/player/

# 神器Asset用の誤検知対策タグ
    tag @s add StrictCheckMainhand
# Reset
    scoreboard players reset @s DropEvent


text:
#> core:handler/respawn
#
# リスポーン時に実行される
#
# @within function core:tick/player/

# 死亡時タグを削除
    tag @s remove Death
# 体力を戻すためにSTMHBackUpを戻す
    scoreboard players set @s STMHBackup 200000
# リスポーン時の満腹度調整
    function player_manager:adjust_hunger/respawn


text:
#> core:early_handler/damage
#
# ダメージを受けた際に実行される
#
# @within advancement core:handler/damage


text:
#> core:early_handler/consume_item
#
# アイテムの使用時に実行
#
# @within advancement core:handler/consume_item


text:
#> core:early_handler/using_item
#
#
#
# @within advancement core:handler/using_item


text:
#> core:early_handler/inventory_change
#
# インベントリに変更があったときにトリガーされる
#
# @within advancement core:handler/inventory_change


text:
#> core:early_handler/killed
#
#
#
# @within advancement core:handler/killed


text:
#> core:tick/4_interval
#
# 4tick毎にschedule実行されます
#
# @within function core:tick/

# スポナー
    function asset_manager:spawner/tick/4_interval
# 島
    function asset_manager:island/tick/4_interval
# 交易
    function asset_manager:trader/tick/4_interval
# テレポーター
    function asset_manager:teleporter/tick/4_interval


text:
#> core:tick/6_distributed_interval
#
#
#
# @within function core:tick/

# スポナー
    function asset_manager:spawner/tick/6_distributed_interval

# 次のtickのグループを決める
    scoreboard players add $DistributeGroup Global 1
    scoreboard players operation $DistributeGroup Global %= $6 Const


text:
#> core:tick/check_item_meta/inventory
#
# インベントリ内のアイテムのItemMetaDataをチェックします
#
# @within function core:tick/player/post

#> Temp
# @private
    #declare storage core:temp

# 負荷軽減のためstorageに代入する
    function api:data_get/inventory
    data modify storage core:temp MetaData set from storage api: Inventory[].tag.TSB.ItemMetaData
# 各MetaData処理
    execute if data storage core:temp {MetaData:["BanPossession"]} run clear @a #lib:all{TSB:{ItemMetaData:["BanPossession"]}}
# リセット
    data remove storage core:temp MetaData


text:
#> core:tick/check_item_meta/_index
# @private

#> Val
# @within function
#   core:tick/
#   core:tick/check_item_meta/entity
#declare tag ItemMetaChecked


text:
#> core:tick/check_item_meta/entity
#
# ItemEntityのItemMetaDataをチェックします
#
# @within function core:tick/

#> Temp
# @private
    #declare storage core:temp

# 負荷軽減のためstorageに代入する
    data modify storage core:temp MetaData set from entity @s Item.tag.TSB.ItemMetaData
# 各MetaData処理
    execute if data storage core:temp {MetaData:["MobDeathTrigger"]} at @s run function asset_manager:mob/triggers/death/
    execute if data storage core:temp {MetaData:["BanEntityConditionItem"]} run kill @s
# 二度と処理しないように
    tag @s add ItemMetaChecked
# リセット
    data remove storage core:temp MetaData


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

function player_manager:manage_tag/

function player_manager:pos_fix_and_calc_diff

function world_manager:chunk_io_protect/


text:
#> core:tick/player/post
#
# tickの基本的な処理を終えた後に実行されるプレイヤーのtick処理
#
# @within function core:tick/

# 死亡処理チェック
    execute if entity @s[scores={DeathEvent=1..}] run function core:handler/death

# プレイヤーの所持するアイテムのMetaチェック
    function core:tick/check_item_meta/inventory

# プレイヤーの体力の変更Queueの消化
    execute if entity @s[predicate=lib:has_health_modify_score] run function lib:score_to_health_wrapper/proc
# MPを経験値バーに同期
    function player_manager:mp/viewer/check_xpbar

# リセット
    execute if entity @s[scores={Sneak=1..},predicate=!lib:is_sneaking] run function asset_manager:artifact/triggers/sneak/reset
    scoreboard players reset @s[scores={Sneak=1..},predicate=!lib:is_sneaking] Sneak


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

#> Asset環境
# @within function
#   asset_manager:**
#   asset:*/*/**
#   asset:*/extends
#   asset:*/super.*
#   api:**
    #declare storage asset:context


text:
#> asset_manager:island/_index.d
# @private

#> storage
# @within *
#   asset:island/*/register/*
#   asset:island/common/register
#   asset_manager:island/**
#declare storage asset:island

#> Tag
# @within *
#   asset:island/*/register/
#   asset_manager:island/**
#   core:tick/
#declare tag CursedArtifact

#> Tag
# @within *
#   asset_manager:island/**
#   core:tick/
#declare tag DispelledCursedArtifact

#> Tag
# @within function
#   asset_manager:island/register/*
#declare tag CursedArtifactInit

#> Tag
# @within function
#   asset_manager:island/dispel/boss/*
#   asset_manager:island/tick/
    #declare tag CantDispel
    #declare tag BossSummonMarker

# MEMO
# DispelPhase:
#   0b: unknown(first boss waited/dispellable)
#   1b: boss waited
#   2b: dispellable
#   3b: dispelled


text:
#> asset_manager:island/dispel/cancelled
#
#
#
# @within function
#   asset_manager:island/tick/
#   asset_manager:island/dispel/
#   asset_manager:island/dispel/boss/

execute if score @s DispelTime matches 20.. as @p[predicate=lib:is_sneaking,distance=..2] at @s run playsound block.glass.break block @s ~ ~ ~ 1 2.0
scoreboard players reset @s DispelTime


text:
#> asset_manager:island/dispel/successful
#
#
#
# @within function asset_manager:island/dispel/

# 邪魔なスコアをリセットする
    scoreboard players reset @s DispelTime
# VFX
    function asset_manager:island/dispel/vfx/dispel
# メッセージ
    function lib:message/common/dispel_island
# 祝福を与える
    data modify storage api: Argument.ID set value 2
    execute as @p[predicate=lib:is_sneaking,distance=..2] at @s run function api:artifact/give/from_id
# アイテム返す
    function player_manager:lost_item/give_all/
# データ取得
    function oh_my_dat:please
# 二度と祈れないようにする
    tag @s add DispelledCursedArtifact
# テレポーターを起動する
    data modify storage api: Argument.ID set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].IslandData.ID
    data modify storage api: Argument.ActivationState set value "Activate"
    function api:teleporter/set_activation_state/from_id
# DispelPhaseを進める
    function oh_my_dat:please
    data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].IslandData.DispelPhase set value 3b
# Dispelledトリガーを発火する
    data modify storage asset:context id set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].IslandData.ID
    function #asset:island/dispelled


text:
#> asset_manager:island/dispel/vfx/dispelling
#
#
#
# @within function asset_manager:island/dispel/

execute if score @s DispelTime matches 000.. run particle enchant ^-0.06371 ^0.05 ^0.64687 0 0 0 0 1
execute if score @s DispelTime matches 005.. run particle enchant ^-0.18869 ^0.05 ^0.62201 0 0 0 0 1
execute if score @s DispelTime matches 010.. run particle enchant ^-0.30641 ^0.05 ^0.57325 0 0 0 0 1
execute if score @s DispelTime matches 015.. run particle enchant ^-0.41236 ^0.05 ^0.50246 0 0 0 0 1
execute if score @s DispelTime matches 020.. run particle enchant ^-0.50246 ^0.05 ^0.41236 0 0 0 0 1
execute if score @s DispelTime matches 025.. run particle enchant ^-0.57325 ^0.05 ^0.30641 0 0 0 0 1
execute if score @s DispelTime matches 030.. run particle enchant ^-0.62201 ^0.05 ^0.18869 0 0 0 0 1
execute if score @s DispelTime matches 035.. run particle enchant ^-0.64687 ^0.05 ^0.06371 0 0 0 0 1
execute if score @s DispelTime matches 040.. run particle enchant ^-0.64687 ^0.05 ^-0.06371 0 0 0 0 1
execute if score @s DispelTime matches 045.. run particle enchant ^-0.62201 ^0.05 ^-0.18869 0 0 0 0 1
execute if score @s DispelTime matches 050.. run particle enchant ^-0.57325 ^0.05 ^-0.30641 0 0 0 0 1
execute if score @s DispelTime matches 055.. run particle enchant ^-0.50246 ^0.05 ^-0.41236 0 0 0 0 1
execute if score @s DispelTime matches 060.. run particle enchant ^-0.41236 ^0.05 ^-0.50246 0 0 0 0 1
execute if score @s DispelTime matches 065.. run particle enchant ^-0.30641 ^0.05 ^-0.57325 0 0 0 0 1
execute if score @s DispelTime matches 070.. run particle enchant ^-0.18869 ^0.05 ^-0.62201 0 0 0 0 1
execute if score @s DispelTime matches 075.. run particle enchant ^-0.06371 ^0.05 ^-0.64687 0 0 0 0 1
execute if score @s DispelTime matches 080.. run particle enchant ^0.06371 ^0.05 ^-0.64687 0 0 0 0 1
execute if score @s DispelTime matches 085.. run particle enchant ^0.18869 ^0.05 ^-0.62201 0 0 0 0 1
execute if score @s DispelTime matches 090.. run particle enchant ^0.30641 ^0.05 ^-0.57325 0 0 0 0 1
execute if score @s DispelTime matches 095.. run particle enchant ^0.41236 ^0.05 ^-0.50246 0 0 0 0 1
execute if score @s DispelTime matches 100.. run particle enchant ^0.50246 ^0.05 ^-0.41236 0 0 0 0 1
execute if score @s DispelTime matches 105.. run particle enchant ^0.57325 ^0.05 ^-0.30641 0 0 0 0 1
execute if score @s DispelTime matches 110.. run particle enchant ^0.62201 ^0.05 ^-0.18869 0 0 0 0 1
execute if score @s DispelTime matches 115.. run particle enchant ^0.64687 ^0.05 ^-0.06371 0 0 0 0 1
execute if score @s DispelTime matches 120.. run particle enchant ^0.64687 ^0.05 ^0.06371 0 0 0 0 1
execute if score @s DispelTime matches 125.. run particle enchant ^0.62201 ^0.05 ^0.18869 0 0 0 0 1
execute if score @s DispelTime matches 130.. run particle enchant ^0.57325 ^0.05 ^0.30641 0 0 0 0 1
execute if score @s DispelTime matches 135.. run particle enchant ^0.50246 ^0.05 ^0.41236 0 0 0 0 1
execute if score @s DispelTime matches 140.. run particle enchant ^0.41236 ^0.05 ^0.50246 0 0 0 0 1
execute if score @s DispelTime matches 145.. run particle enchant ^0.30641 ^0.05 ^0.57325 0 0 0 0 1
execute if score @s DispelTime matches 150.. run particle enchant ^0.18869 ^0.05 ^0.62201 0 0 0 0 1
execute if score @s DispelTime matches 155.. run particle enchant ^0.06371 ^0.05 ^0.64687 0 0 0 0 1


text:
#> asset_manager:island/dispel/vfx/dispel
#
#
#
# @within function asset_manager:island/dispel/successful

# Particle
    particle end_rod ~ ~1.1 ~ 0.15 0.15 0.15 2 150 force @a
# SE
    playsound ogg:random.levelup player @a ~ ~ ~ 1 0.8 1


text:
#> asset_manager:island/dispel/boss/summon
#
#
#
# @within function asset_manager:island/dispel/boss/summoning_task

# ボスを召喚する
    execute store result storage api: Argument.ID int 1 run scoreboard players get @s TargetBossID
    function api:mob/summon
# UUID保存
    scoreboard players operation @e[type=armor_stand,tag=CursedArtifact,distance=..2.5,limit=1] TargetBossID = $FlagIndex Global


text:
#> asset_manager:island/dispel/boss/remove
#
#
#
# @within function asset_manager:island/dispel/boss/watcher

# タグ外す
    tag @e[type=armor_stand,tag=this,distance=..100,limit=1] remove CantDispel
    scoreboard players reset @e[type=armor_stand,tag=this,distance=..100,limit=1] TargetBossID
# context作成
    execute store result storage asset:context id int 1 run scoreboard players get @s MobID
# 削除処理
    function #asset:mob/remove
# Deathトリガー防止
    data modify entity @s DeathLootTable set value "empty"
# さよなら～
    tp @s ~ -300 ~
    kill @s


text:
#> asset_manager:island/dispel/boss/watcher
#
#
#
# @within function asset_manager:island/tick/

#>
# @private
    #declare tag Target

# 判別用タグ
    tag @s add this
    execute as @e[tag=Enemy.Boss] if score @s MobUUID = @e[type=armor_stand,tag=this,distance=..0.01,limit=1] TargetBossID run tag @s add Target
# 殺されてるなら解呪可能にする
    execute unless entity @e[tag=Target,limit=1] as @e[type=armor_stand,tag=this,distance=..0.01,limit=1] run function asset_manager:island/dispel/boss/killed
# BOSSが100m以上離れた場合は戻る
    execute unless entity @e[tag=Target,distance=..100,limit=1] as @e[tag=Target,distance=100..,limit=1] run tp @s ~ ~ ~
# BOSSの60m以内にプレイヤーが存在しなければさよならする
    execute as @e[tag=Target,distance=..100,limit=1] at @s unless entity @p[tag=!Death,distance=..60] run function asset_manager:island/dispel/boss/remove
# リセット
    tag @s remove this
    tag @e[tag=Target] remove Target


text:
#> asset_manager:island/dispel/boss/killed
#
#
#
# @within function asset_manager:island/dispel/boss/watcher

# タグ外す
    tag @s remove CantDispel
    scoreboard players reset @s TargetBossID
# DispelPhaseを進める
    function oh_my_dat:please
    data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].IslandData.DispelPhase set value 2b


text:
#> asset_manager:island/dispel/boss/_index.d
# @private

#>
# @within function asset_manager:island/dispel/boss/*
    #declare tag this


text:
#> asset_manager:island/dispel/boss/summoning_task
#
#
#
# @within function asset_manager:island/tick/

# スコア加算
    scoreboard players add @s DispelTime 1
# VFX
    execute if score @s DispelTime matches 1..95 run tp @s ~ ~ ~ ~1.5 ~
    execute if score @s DispelTime matches 1..95 run function asset_manager:island/dispel/boss/vfx/circle
    execute if score @s DispelTime matches 96..100 run function asset_manager:island/dispel/boss/vfx/summon_line
    execute if score @s DispelTime matches 100 run function asset_manager:island/dispel/boss/vfx/summon
# 召喚
    execute if score @s DispelTime matches 100 run function asset_manager:island/dispel/boss/summon
# 削除
    execute if score @s DispelTime matches 100 run kill @s


text:
#> asset_manager:island/dispel/boss/vfx/summon
#
#
#
# @within function asset_manager:island/dispel/boss/summoning_task

playsound entity.wither.spawn hostile @a ~ ~ ~ 0.5 0.8

# TODO よしななパーティクル
# [ImportKey]: NobwRALgngDgpmAXGGB7ANlA5qgdmAGjAFdiBLAEyTADMB2AFgEMBmAYwE4BWAWiYEZuPBhyYMeADgoMATDwBsdAAxN5DLhTZx5-QmFxMAtgmSAsTUBLkYCN9AAS6iMJgCcjAZyTg2qYrghJ+RLR84R3cwADcmdGITcAAPJCUiKASAXxSiZwoyYjdEJQA6OiIXCCdfPKI4dHQyGBcTfiVEsEdUUogTZs9HXGC-GSIAK2JDGCQWIgAjOAAvMj6KsDIXAFFq2vqVgEdiSMwAZQctKkQaSPqiZYAhWfnHbd3qqEOmY6Qz9Hq0gF0gA_3
# 多角形 1
particle end_rod ~0 ~ ~-0.7 ~ ~ ~ 0 1
particle end_rod ~0.35 ~ ~-0.60622 ~ ~ ~ 0 1
particle end_rod ~0.60622 ~ ~-0.35 ~ ~ ~ 0 1
particle end_rod ~0.7 ~ ~0 ~ ~ ~ 0 1
particle end_rod ~0.60622 ~ ~0.35 ~ ~ ~ 0 1
particle end_rod ~0.35 ~ ~0.60622 ~ ~ ~ 0 1
particle end_rod ~0 ~ ~0.7 ~ ~ ~ 0 1
particle end_rod ~-0.35 ~ ~0.60622 ~ ~ ~ 0 1
particle end_rod ~-0.60622 ~ ~0.35 ~ ~ ~ 0 1
particle end_rod ~-0.7 ~ ~0 ~ ~ ~ 0 1
particle end_rod ~-0.60622 ~ ~-0.35 ~ ~ ~ 0 1
particle end_rod ~-0.35 ~ ~-0.60622 ~ ~ ~ 0 1
# 多角形 1
particle end_rod ~0 ~0000000.25 ~-0.7 ~ ~ ~ 0 1
particle end_rod ~0.35 ~0000000.25 ~-0.60622 ~ ~ ~ 0 1
particle end_rod ~0.60622 ~0000000.25 ~-0.35 ~ ~ ~ 0 1
particle end_rod ~0.7 ~0000000.25 ~0 ~ ~ ~ 0 1
particle end_rod ~0.60622 ~ ~0.35 ~ ~ ~ 0 1
particle end_rod ~0.35 ~0000000.25 ~0.60622 ~ ~ ~ 0 1
particle end_rod ~0 ~0000000.25 ~0.7 ~ ~ ~ 0 1
particle end_rod ~-0.35 ~0000000.25 ~0.60622 ~ ~ ~ 0 1
particle end_rod ~-0.60622 ~0000000.25 ~0.35 ~ ~ ~ 0 1
particle end_rod ~-0.7 ~0000000.25 ~0 ~ ~ ~ 0 1
particle end_rod ~-0.60622 ~0000000.25 ~-0.35 ~ ~ ~ 0 1
particle end_rod ~-0.35 ~0000000.25 ~-0.60622 ~ ~ ~ 0 1
# 多角形 1
particle end_rod ~0 ~0000000.50 ~-0.7 ~ ~ ~ 0 1
particle end_rod ~0.35 ~0000000.50 ~-0.60622 ~ ~ ~ 0 1
particle end_rod ~0.60622 ~0000000.50 ~-0.35 ~ ~ ~ 0 1
particle end_rod ~0.7 ~0000000.50 ~0 ~ ~ ~ 0 1
particle end_rod ~0.60622 ~0000000.50 ~0.35 ~ ~ ~ 0 1
particle end_rod ~0.35 ~0000000.50 ~0.60622 ~ ~ ~ 0 1
particle end_rod ~0 ~0000000.50 ~0.7 ~ ~ ~ 0 1
particle end_rod ~-0.35 ~0000000.50 ~0.60622 ~ ~ ~ 0 1
particle end_rod ~-0.60622 ~0000000.50 ~0.35 ~ ~ ~ 0 1
particle end_rod ~-0.7 ~0000000.50 ~0 ~ ~ ~ 0 1
particle end_rod ~-0.60622 ~0000000.50 ~-0.35 ~ ~ ~ 0 1
particle end_rod ~-0.35 ~0000000.50 ~-0.60622 ~ ~ ~ 0 1
# 多角形 1
particle end_rod ~0 ~0000000.75 ~-0.7 ~ ~ ~ 0 1
particle end_rod ~0.35 ~0000000.75 ~-0.60622 ~ ~ ~ 0 1
particle end_rod ~0.60622 ~0000000.75 ~-0.35 ~ ~ ~ 0 1
particle end_rod ~0.7 ~0000000.75 ~0 ~ ~ ~ 0 1
particle end_rod ~0.60622 ~ ~0.35 ~ ~ ~ 0 1
particle end_rod ~0.35 ~0000000.75 ~0.60622 ~ ~ ~ 0 1
particle end_rod ~0 ~0000000.75 ~0.7 ~ ~ ~ 0 1
particle end_rod ~-0.35 ~0000000.75 ~0.60622 ~ ~ ~ 0 1
particle end_rod ~-0.60622 ~0000000.75 ~0.35 ~ ~ ~ 0 1
particle end_rod ~-0.7 ~0000000.75 ~0 ~ ~ ~ 0 1
particle end_rod ~-0.60622 ~0000000.75 ~-0.35 ~ ~ ~ 0 1
particle end_rod ~-0.35 ~0000000.75 ~-0.60622 ~ ~ ~ 0 1
# 多角形 1
particle end_rod ~0 ~0000001.00 ~-0.7 ~ ~ ~ 0 1
particle end_rod ~0.35 ~0000001.00 ~-0.60622 ~ ~ ~ 0 1
particle end_rod ~0.60622 ~0000001.00 ~-0.35 ~ ~ ~ 0 1
particle end_rod ~0.7 ~0000001.00 ~0 ~ ~ ~ 0 1
particle end_rod ~0.60622 ~0000001.00 ~0.35 ~ ~ ~ 0 1
particle end_rod ~0.35 ~0000001.00 ~0.60622 ~ ~ ~ 0 1
particle end_rod ~0 ~0000001.00 ~0.7 ~ ~ ~ 0 1
particle end_rod ~-0.35 ~0000001.00 ~0.60622 ~ ~ ~ 0 1
particle end_rod ~-0.60622 ~0000001.00 ~0.35 ~ ~ ~ 0 1
particle end_rod ~-0.7 ~0000001.00 ~0 ~ ~ ~ 0 1
particle end_rod ~-0.60622 ~0000001.00 ~-0.35 ~ ~ ~ 0 1
particle end_rod ~-0.35 ~0000001.00 ~-0.60622 ~ ~ ~ 0 1
# 多角形 1
particle end_rod ~0 ~0000001.25 ~-0.7 ~ ~ ~ 0 1
particle end_rod ~0.35 ~0000001.25 ~-0.60622 ~ ~ ~ 0 1
particle end_rod ~0.60622 ~0000001.25 ~-0.35 ~ ~ ~ 0 1
particle end_rod ~0.7 ~0000001.25 ~0 ~ ~ ~ 0 1
particle end_rod ~0.60622 ~ ~0.35 ~ ~ ~ 0 1
particle end_rod ~0.35 ~0000001.25 ~0.60622 ~ ~ ~ 0 1
particle end_rod ~0 ~0000001.25 ~0.7 ~ ~ ~ 0 1
particle end_rod ~-0.35 ~0000001.25 ~0.60622 ~ ~ ~ 0 1
particle end_rod ~-0.60622 ~0000001.25 ~0.35 ~ ~ ~ 0 1
particle end_rod ~-0.7 ~0000001.25 ~0 ~ ~ ~ 0 1
particle end_rod ~-0.60622 ~0000001.25 ~-0.35 ~ ~ ~ 0 1
particle end_rod ~-0.35 ~0000001.25 ~-0.60622 ~ ~ ~ 0 1
# 多角形 1
particle end_rod ~0 ~0000001.50 ~-0.7 ~ ~ ~ 0 1
particle end_rod ~0.35 ~0000001.50 ~-0.60622 ~ ~ ~ 0 1
particle end_rod ~0.60622 ~0000001.50 ~-0.35 ~ ~ ~ 0 1
particle end_rod ~0.7 ~0000001.50 ~0 ~ ~ ~ 0 1
particle end_rod ~0.60622 ~0000001.50 ~0.35 ~ ~ ~ 0 1
particle end_rod ~0.35 ~0000001.50 ~0.60622 ~ ~ ~ 0 1
particle end_rod ~0 ~0000001.50 ~0.7 ~ ~ ~ 0 1
particle end_rod ~-0.35 ~0000001.50 ~0.60622 ~ ~ ~ 0 1
particle end_rod ~-0.60622 ~0000001.50 ~0.35 ~ ~ ~ 0 1
particle end_rod ~-0.7 ~0000001.50 ~0 ~ ~ ~ 0 1
particle end_rod ~-0.60622 ~0000001.50 ~-0.35 ~ ~ ~ 0 1
particle end_rod ~-0.35 ~0000001.50 ~-0.60622 ~ ~ ~ 0 1
# 多角形 1
particle end_rod ~0 ~0000001.75 ~-0.7 ~ ~ ~ 0 1
particle end_rod ~0.35 ~0000001.75 ~-0.60622 ~ ~ ~ 0 1
particle end_rod ~0.60622 ~0000001.75 ~-0.35 ~ ~ ~ 0 1
particle end_rod ~0.7 ~0000001.75 ~0 ~ ~ ~ 0 1
particle end_rod ~0.60622 ~ ~0.35 ~ ~ ~ 0 1
particle end_rod ~0.35 ~0000001.75 ~0.60622 ~ ~ ~ 0 1
particle end_rod ~0 ~0000001.75 ~0.7 ~ ~ ~ 0 1
particle end_rod ~-0.35 ~0000001.75 ~0.60622 ~ ~ ~ 0 1
particle end_rod ~-0.60622 ~0000001.75 ~0.35 ~ ~ ~ 0 1
particle end_rod ~-0.7 ~0000001.75 ~0 ~ ~ ~ 0 1
particle end_rod ~-0.60622 ~0000001.75 ~-0.35 ~ ~ ~ 0 1
particle end_rod ~-0.35 ~0000001.75 ~-0.60622 ~ ~ ~ 0 1
# 多角形 1
particle end_rod ~0 ~0000002.00 ~-0.7 ~ ~ ~ 0 1
particle end_rod ~0.35 ~0000002.00 ~-0.60622 ~ ~ ~ 0 1
particle end_rod ~0.60622 ~0000002.00 ~-0.35 ~ ~ ~ 0 1
particle end_rod ~0.7 ~0000002.00 ~0 ~ ~ ~ 0 1
particle end_rod ~0.60622 ~0000002.00 ~0.35 ~ ~ ~ 0 1
particle end_rod ~0.35 ~0000002.00 ~0.60622 ~ ~ ~ 0 1
particle end_rod ~0 ~0000002.00 ~0.7 ~ ~ ~ 0 1
particle end_rod ~-0.35 ~0000002.00 ~0.60622 ~ ~ ~ 0 1
particle end_rod ~-0.60622 ~0000002.00 ~0.35 ~ ~ ~ 0 1
particle end_rod ~-0.7 ~0000002.00 ~0 ~ ~ ~ 0 1
particle end_rod ~-0.60622 ~0000002.00 ~-0.35 ~ ~ ~ 0 1
particle end_rod ~-0.35 ~0000002.00 ~-0.60622 ~ ~ ~ 0 1


text:
#> asset_manager:island/dispel/boss/vfx/summon_line
#
#
#
# @within function asset_manager:island/dispel/boss/summoning_task

execute if score @s DispelTime matches 96 run particle electric_spark ~ ~3.8 ~ 0 0 0 0 1 force @a
execute if score @s DispelTime matches 96 run particle electric_spark ~ ~3.6 ~ 0 0 0 0 1 force @a
execute if score @s DispelTime matches 96 run particle electric_spark ~ ~3.4 ~ 0 0 0 0 1 force @a
execute if score @s DispelTime matches 96 run particle electric_spark ~ ~3.2 ~ 0 0 0 0 1 force @a
execute if score @s DispelTime matches 97 run particle electric_spark ~ ~3.0 ~ 0 0 0 0 1 force @a
execute if score @s DispelTime matches 97 run particle electric_spark ~ ~2.8 ~ 0 0 0 0 1 force @a
execute if score @s DispelTime matches 97 run particle electric_spark ~ ~2.6 ~ 0 0 0 0 1 force @a
execute if score @s DispelTime matches 97 run particle electric_spark ~ ~2.4 ~ 0 0 0 0 1 force @a
execute if score @s DispelTime matches 98 run particle electric_spark ~ ~2.2 ~ 0 0 0 0 1 force @a
execute if score @s DispelTime matches 98 run particle electric_spark ~ ~2.0 ~ 0 0 0 0 1 force @a
execute if score @s DispelTime matches 98 run particle electric_spark ~ ~1.8 ~ 0 0 0 0 1 force @a
execute if score @s DispelTime matches 98 run particle electric_spark ~ ~1.6 ~ 0 0 0 0 1 force @a
execute if score @s DispelTime matches 99 run particle electric_spark ~ ~1.4 ~ 0 0 0 0 1 force @a
execute if score @s DispelTime matches 99 run particle electric_spark ~ ~1.2 ~ 0 0 0 0 1 force @a
execute if score @s DispelTime matches 99 run particle electric_spark ~ ~1.0 ~ 0 0 0 0 1 force @a
execute if score @s DispelTime matches 99 run particle electric_spark ~ ~0.8 ~ 0 0 0 0 1 force @a
execute if score @s DispelTime matches 100 run particle electric_spark ~ ~0.6 ~ 0 0 0 0 1 force @a
execute if score @s DispelTime matches 100 run particle electric_spark ~ ~0.4 ~ 0 0 0 0 1 force @a
execute if score @s DispelTime matches 100 run particle electric_spark ~ ~0.2 ~ 0 0 0 0 1 force @a
execute if score @s DispelTime matches 100 run particle electric_spark ~ ~0.0 ~ 0 0 0 0 1 force @a


text:
#> asset_manager:island/dispel/boss/vfx/circle
#
#
#
# @within function asset_manager:island/dispel/boss/summoning_task

# [ImportKey]: NobwRALgngDgpmAXGGB7ANlA5qgdmAGjAFdiBLAEyTAFYAmOAYwEYAORugWgHYA2bgAycALDRq9OAQzoAjSZwDMFVq0mTu42a0JhckgLYJkgLE1AS5GAjfQAEzHTEkAnAwGck4RqmK4ISZryKM4Lzh7VzAAN0l0YiNwAA8kASIoBIBfFKJHCjJiF0QBADpWIicIB288ojh0dDIYJyNmAUSwe1RSiCNm93tcYKQ-MAArYn0YJDoiGTgALzI+xE4CibAyJwBRatr6tYBHYkjMAGU7AKpEADNI+qJVgCEZuftd-eqoY8lTpEv0erSCcGg8GojDI9kY6AQRFIlGozAUcjgzHOEjovBYImYkmEnBUrBoUjE3BUfFYzFEOj0hmogDDFay2BzOULuTzlBTLAJBEKIcARKIxMDxCpgZJ5P4tSRZHIJQrFUr2crNKo1OoNJoZNqSDoJG7rTYq54HN4nOBnb6-FIAXSAA_3
# 円 1
particle dust 0.7 0 0.7 0.4 ^0 ^ ^-0.8 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.15607 ^ ^-0.78463 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.30615 ^ ^-0.7391 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.44446 ^ ^-0.66518 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.56569 ^ ^-0.56569 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.66518 ^ ^-0.44446 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.7391 ^ ^-0.30615 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.78463 ^ ^-0.15607 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.8 ^ ^0 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.78463 ^ ^0.15607 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.7391 ^ ^0.30615 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.66518 ^ ^0.44446 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.56569 ^ ^0.56569 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.44446 ^ ^0.66518 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.30615 ^ ^0.7391 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.15607 ^ ^0.78463 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0 ^ ^0.8 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.15607 ^ ^0.78463 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.30615 ^ ^0.7391 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.44446 ^ ^0.66518 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.56569 ^ ^0.56569 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.66518 ^ ^0.44446 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.7391 ^ ^0.30615 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.78463 ^ ^0.15607 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.8 ^ ^0 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.78463 ^ ^-0.15607 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.7391 ^ ^-0.30615 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.66518 ^ ^-0.44446 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.56569 ^ ^-0.56569 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.44446 ^ ^-0.66518 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.30615 ^ ^-0.7391 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.15607 ^ ^-0.78463 0 0 0 0 1
# 多角形 1
particle dust 0.7 0 0.7 0.4 ^0.023 ^ ^-0.71328 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.04871 ^ ^-0.62812 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.07713 ^ ^-0.54453 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.10825 ^ ^-0.4625 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.14208 ^ ^-0.38203 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.17862 ^ ^-0.30313 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.21786 ^ ^-0.22578 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.25981 ^ ^-0.15 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.30446 ^ ^-0.07578 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.35182 ^ ^-0.00313 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.40189 ^ ^0.06797 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.45466 ^ ^0.1375 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.51014 ^ ^0.20547 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.56833 ^ ^0.27187 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.62922 ^ ^0.33672 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.69282 ^ ^-0.4 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.62922 ^ ^-0.33672 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.56833 ^ ^-0.27188 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.51014 ^ ^-0.20547 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.45466 ^ ^-0.1375 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.40189 ^ ^-0.06797 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.30446 ^ ^0.07578 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.25981 ^ ^0.15 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.21786 ^ ^0.22578 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.17862 ^ ^0.30312 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.14208 ^ ^0.38203 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.10825 ^ ^0.4625 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.07713 ^ ^0.54453 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.04871 ^ ^0.62812 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.023 ^ ^0.71328 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.69282 ^ ^0.4 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.51962 ^ ^0.35625 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.43301 ^ ^0.33906 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.34641 ^ ^0.325 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.25981 ^ ^0.31406 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.0866 ^ ^0.30156 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0 ^ ^0.3 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.0866 ^ ^0.30156 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.17321 ^ ^0.30625 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.25981 ^ ^0.31406 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.34641 ^ ^0.325 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.43301 ^ ^0.33906 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.51962 ^ ^0.35625 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.60622 ^ ^0.37656 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.04871 ^ ^0.62812 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.07713 ^ ^0.54453 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.10825 ^ ^0.4625 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.14208 ^ ^0.38203 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.21786 ^ ^0.22578 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.25981 ^ ^0.15 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.30446 ^ ^0.07578 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.35182 ^ ^0.00312 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.40189 ^ ^-0.06797 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.45466 ^ ^-0.1375 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.51014 ^ ^-0.20547 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.56833 ^ ^-0.27188 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.62922 ^ ^-0.33672 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.69282 ^ ^0.4 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.56833 ^ ^0.27188 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.51014 ^ ^0.20547 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.45466 ^ ^0.1375 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.40189 ^ ^0.06797 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.30446 ^ ^-0.07578 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.25981 ^ ^-0.15 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.21786 ^ ^-0.22578 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.17862 ^ ^-0.30312 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.14208 ^ ^-0.38203 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.10825 ^ ^-0.4625 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.07713 ^ ^-0.54453 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.04871 ^ ^-0.62812 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.69282 ^ ^-0.4 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.51962 ^ ^-0.35625 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.43301 ^ ^-0.33906 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.34641 ^ ^-0.325 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.25981 ^ ^-0.31406 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^-0.0866 ^ ^-0.30156 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0 ^ ^-0.3 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.0866 ^ ^-0.30156 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.25981 ^ ^-0.31406 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.34641 ^ ^-0.325 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.43301 ^ ^-0.33906 0 0 0 0 1
particle dust 0.7 0 0.7 0.4 ^0.51962 ^ ^-0.35625 0 0 0 0 1


text:
#> asset_manager:island/register/set_data
#
#
#
# @within function asset_manager:island/register/

# EntityStorage呼び出し
    function oh_my_dat:please
# Entityの方向
    data modify entity @s Pose.Head set value [0f,0.001f,0f]
    data modify entity @s Pose.Head[1] set from storage asset:island Rotation
    data modify entity @s Rotation[0] set from storage asset:island Rotation
# EntityStorageに保存するもの
    data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].IslandData.ID set from storage asset:island ID
    data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].IslandData.BossID set from storage asset:island BossID
    execute if data storage asset:island BossID run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].IslandData.HasBoss set value true
    data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].IslandData.DispelPhase set value 0b
# リセット
    tag @s remove CursedArtifactInit


text:
#> asset_manager:island/tick/4_interval
#
#
#
# @within function core:tick/4_interval

# 登録処理
    execute if data storage global {IsProduction:1b} run function #asset:island/register
# パーティクル
    execute as @e[type=armor_stand,tag=CursedArtifact] at @s run function asset_manager:island/tick/vfx


text:
#> asset_manager:island/tick/vfx
#
#
#
# @within function asset_manager:island/tick/4_interval

function oh_my_dat:please

execute if data storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].IslandData{DispelPhase:1b} run particle dust 0.5 0 0.5 0.5 ~ ~1.0 ~ 0.2 0.3 0.2 0 1 normal
execute if data storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].IslandData{DispelPhase:2b} run particle dust 0.9 0.7 0.9 0.5 ~ ~1.0 ~ 0.2 0.3 0.2 0 1 normal
execute if data storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].IslandData{DispelPhase:3b} run particle end_rod ~ ~1.0 ~ 4 5 4 0.03 2 normal


text:
compound AssetTeleporter {
   /// テレポーターの定義データ
   Teleporters: [GroupData]
   /// テレポーターのIDとOyMyDatIDのMap
   TeleporeterOMDMap: [IDPair]
}

compound GroupData {
   /// 識別ID
   ID: int,
   /// 所属グループID
   GroupID: string,
   /// 座標
   Pos: [double] @ 3,
   /// メタデータ
   Data: TeleporterMetaData
}

compound TeleporterMetaData {
   /// そのテレポーターが起動しているか
   ActivationState: ActivationState,
   /// テレポーターを星として見た時の色 default: White
   Color?: StarColor
}

enum(string) ActivationState {
   InvisibleDeactivate = "InvisibleDeactivate",
   VisibleDeactivate = "VisibleDeactivate",
   Activate = "Activate"
}

enum(string) StarColor {
   White = "white",
   Yellow = "yellow"
}

compound IDPair {
    TeleporterID: int
    OyMyDatID: int
}

AssetTeleporter describes minecraft:storage[asset:teleporter]


text:
#> asset_manager:teleporter/_index.d
# @private

#> storage
# @within *
#   asset:teleporter/*/*
#   asset:teleporter/common/register
#   asset_manager:teleporter/**
    #declare storage asset:teleporter

#> Teleporter
# @within
#   asset_manager:teleporter/**
#   api:teleporter/set_activation_state/from_nearest
    #declare tag Teleporter

#> TeleportPoint
# @within asset_manager:teleporter/tick/**
    #declare tag FromTeleporter
    #declare tag TeleporterInitialized
    #declare tag TeleporterInitializing
    #declare tag TPStar
    #declare tag TPStar.White
    #declare tag TPStar.Aqua
    #declare tag SuppressTeleport
    #declare tag TPCancel

#> for Init
# @within asset_manager:teleporter/tick/star_init/*
    #declare tag TPStarInit

#> OpenDeclares
# @within asset_manager:island/dispel/register_tp
    #declare tag Teleporter

#> TeleporterExists
# @within asset_manager:teleporter/update_activation_state/*
    #declare score_holder $TeleporterExists


text:
#> asset_manager:teleporter/update_activation_state/try_get_storage_id_from_teleporter
#
# IDの一致するテレポーターのOhMyDatIDを検索し、存在するかと、存在する場合はそのIDを返す
#
# @input storage api: Argument.ID : int
# @output score
#   $ OhMyDatID
#   $TeleporterExists Temporary : int @ 0..1
# @within function asset_manager:teleporter/update_activation_state/

# セッション開く
    function lib:array/session/open
# CompareResult = TeleporterOMDMap.map(v => v.TeleporterID == Argument.ID)
    data modify storage lib: Array append from storage asset:teleporter TeleporterOMDMap[].TeleporterID
    data modify storage lib: CompareTarget set from storage api: Argument.ID
    function lib:array/compare_single
# CompareResultを元に同一のIDの要素を取り出す
# OyMyDatID = TeleporterOMDMap.map(v => v.OyMyDatID).filter((v, i) => CompareResult[i]).head
    data modify storage lib: Array append from storage asset:teleporter TeleporterOMDMap[].OhMyDatID
    data modify storage lib: Masks set from storage lib: CompareResult
    function lib:array/mask_inverted
    execute store result score $ OhMyDatID run data get storage lib: Array[0]
# EntityStorage取得
    execute store success score $TeleporterExists Temporary if data storage lib: Array[0]
# リセット
    function lib:array/session/close


text:
#> asset_manager:teleporter/update_activation_state/pop_master_data_from_teleporter_id
#
# IDの一致するテレポーターのデータをマスタより取り出す
#
# @input storage api: Argument.ID : int
# @output storage asset:teleporter
#   TargetTeleporterData : compound GroupData
#   Teleporters : Teleporters - Teleporters[id=Argument.ID]
# @within function asset_manager:teleporter/update_activation_state/

# セッション開く
    function lib:array/session/open
# 対象テレポーターのGroupIDと、同一のIDを持つ配列の要素のIndex のみがtrueになる配列(CompareResult)を作る
# CompareResult = Teleporters.map(v => v.ID ==Argument.ID)
    data modify storage lib: Array append from storage asset:teleporter Teleporters[].ID
    data modify storage lib: CompareTarget set from storage api: Argument.ID
    function lib:array/compare_single
# CompareResultを元に同一のIDの要素を取り出す
# TargetTeleporterData = Teleporters.filter((v, i) => CompareResult[i]).head
    data modify storage lib: Array set from storage asset:teleporter Teleporters
    data modify storage lib: Masks set from storage lib: CompareResult
    function lib:array/mask_inverted
    data modify storage asset:teleporter TargetTeleporterData set from storage lib: Array[0]
# TeleportersからTargetデータを消した状態にする
# Teleporters = Teleporters.filter((v, i) => !CompareResult[i])
    data modify storage lib: Array set from storage asset:teleporter Teleporters
    data modify storage lib: Masks set from storage lib: CompareResult
    function lib:array/mask
    data modify storage asset:teleporter Teleporters set from storage lib: Array
# セッション閉じる
    function lib:array/session/close


text:
#> asset_manager:teleporter/tick/4_interval
#
#
#
# @within function core:tick/4_interval

# 登録処理
    execute if data storage global {IsProduction:1b} run function #asset:teleporter/register


text:
#> asset_manager:teleporter/tick/player
#
#
#
# @within function core:tick/player/

# 対象テレポーターの特定及びタグ付与
    tag @e[type=marker,tag=Teleporter,distance=..1,limit=1] add FromTeleporter

# EntityStorageを取得する
    execute as @e[type=marker,tag=FromTeleporter,distance=..1,limit=1] run function oh_my_dat:please

# テレポートのメイン処理
    execute if entity @s[tag=!SuppressTeleport,predicate=lib:is_sneaking] if entity @e[type=marker,tag=FromTeleporter,distance=..1,limit=1] if data storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].TeleporterData{ActivationState:"Activate"} run function asset_manager:teleporter/tick/active
# テレポート後のタグ解除処理
    execute if entity @s[tag=SuppressTeleport,predicate=!lib:is_sneaking] run tag @s remove SuppressTeleport
# キャンセル処理
    execute unless entity @s[tag=!TeleporterInitializing,tag=!TeleporterInitialized] run function asset_manager:teleporter/tick/cancel/check
    execute if entity @s[tag=TPCancel] run function asset_manager:teleporter/tick/cancel/

# リセット
    tag @e[type=marker,tag=FromTeleporter,distance=..1,limit=1] remove FromTeleporter


text:
#> asset_manager:teleporter/tick/active
#
#
#
# @within function asset_manager:teleporter/tick/player

# 接地しているかの取得
    function api:data_get/on_ground
# 初期化
    execute if data storage api: {OnGround:true} if entity @s[tag=!TeleporterInitializing,tag=!TeleporterInitialized] run function asset_manager:teleporter/tick/star_init/
# 初期化中
    execute if data storage api: {OnGround:true} if entity @s[tag=TeleporterInitializing] run function asset_manager:teleporter/tick/star_init/summon_once
# ジャンプ検知
    execute if data storage api: {OnGround:false} unless entity @s[tag=!TeleporterInitializing,tag=!TeleporterInitialized] run function asset_manager:teleporter/tick/tp/
# VFX
    summon area_effect_cloud ~ ~ ~ {Duration:6,Age:4,Effects:[{Id:15,Amplifier:0b,Duration:25,ShowParticles:0b}]}
    execute anchored eyes positioned ^ ^ ^ as @e[type=marker,tag=TPStar,distance=..1.8] if score @s TPStarFromUserID = @p[tag=this] UserID facing entity @s feet positioned as @s run function asset_manager:teleporter/tick/vfx/star/


text:
#> asset_manager:teleporter/tick/global
#
#
#
# @within function core:tick/

execute as @e[type=marker,tag=Teleporter] at @s if entity @p[distance=..50] run function asset_manager:teleporter/tick/vfx/teleporter/


text:
#> asset_manager:teleporter/tick/cancel/check
#
#
#
# @within function asset_manager:teleporter/tick/player

# スニークを解除したら
    execute unless predicate lib:is_sneaking run tag @s add TPCancel
# 地面がなくなったら
    function api:data_get/on_ground
    execute if data storage api: {OnGround:false} run tag @s add TPCancel
# 動いたら
    execute if predicate lib:is_player_moving run tag @s add TPCancel


text:
#> asset_manager:teleporter/tick/star_init/summon
#
#
#
# @within function asset_manager:teleporter/tick/star_init/summon_once

# 対象のテレポーターを移す
    data modify storage asset:teleporter TargetTeleporter set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].Temp.Teleporters[-1]
# 汎用entityを現地へ
    data modify entity @s Pos set from storage asset:teleporter TargetTeleporter.Pos
# プレイヤーからその方向の1ブロック先に星を召喚する
    execute unless entity @s[distance=..15] facing entity @s feet run summon marker ^ ^ ^1.5 {Tags:["TPStar","TPStarInit"]}
    execute unless entity @s[distance=..15] facing entity @s feet positioned ^ ^ ^1.5 as @e[type=marker,tag=TPStarInit,distance=..0.01,limit=1] run function asset_manager:teleporter/tick/star_init/set_data
# 原点へお帰り
    execute in overworld run tp @s 0.0 0.0 0.0
# リセット
    data remove storage asset:teleporter TargetTeleporter


text:
#> asset_manager:teleporter/tick/star_init/get_teleporters_from_group_id
#
#
#
# @input storage asset:teleporter TargetGroupID
# @output storage asset:teleporter FilteredTeleporters
#
# @within function asset_manager:teleporter/tick/star_init/

# セッション開く
    function lib:array/session/open
# 対象テレポーターのGrpupIDと、同一のIDを持つ配列の要素のIndex のみがtrueになる配列(CompareResult)を作る
# CompareResult = Teleporters.map(v => v.GroupID == GroupID)
    data modify storage lib: Array append from storage asset:teleporter Teleporters[].GroupID
    data modify storage lib: CompareTarget set from storage asset:teleporter TargetGroupID
    function lib:array/compare_single
# CompareResultを元に同一のIDの要素を取り出す
# FilteredTeleporters = Teleporters.filiter((v, i) => CompareResult[i])
    data modify storage lib: Array set from storage asset:teleporter Teleporters
    data modify storage lib: Masks set from storage lib: CompareResult
    function lib:array/mask_inverted
    data modify storage asset:teleporter FilteredTeleporters set from storage lib: Array
# セッション閉じる
    function lib:array/session/close
# リセット
    data remove storage asset:teleporter TargetGroupID


text:
#> asset_manager:teleporter/tick/star_init/set_data
#
#
#
# @within function asset_manager:teleporter/tick/star_init/summon

# ユーザーIDをコピー
    scoreboard players operation @s TPStarFromUserID = @p[tag=this] UserID
# ユーザーデータ取得
    function oh_my_dat:please
# 座標データ
    data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].TPStarData.TargetPos set from storage asset:teleporter TargetTeleporter.Pos
# 色データ
    execute if data storage asset:teleporter TargetTeleporter.Data{Color:"white"} run tag @s add TPStar.White
    execute if data storage asset:teleporter TargetTeleporter.Data{Color:"aqua"} run tag @s add TPStar.Aqua
# 初期化タグ削除
    tag @s remove TPStarInit


text:
#> asset_manager:teleporter/tick/star_init/summon_once
#
#
#
# @input storage asset:teleporter FilteredTeleporters
# @within function
#   asset_manager:teleporter/tick/active
#   asset_manager:teleporter/tick/star_init/summon_once

# storage呼び出し
    function oh_my_dat:please
# 召喚可能か確認
    execute store success storage asset:teleporter TPStarSummonable byte 1 if data storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].Temp.Teleporters[-1].Data{ActivationState:"Activate"}
# 召喚可能なら召喚する
    execute if data storage asset:teleporter {TPStarSummonable: true} anchored eyes positioned ^ ^ ^ as 0-0-0-0-0 run function asset_manager:teleporter/tick/star_init/summon
# 召喚したならstorage呼び出し
    execute if data storage asset:teleporter {TPStarSummonable: true} run function oh_my_dat:please
# 否が応でも末尾削除
    data remove storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].Temp.Teleporters[-1]
# 全てのテレポーターを見きったら初期化済タグに切り替える
    execute unless data storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].Temp.Teleporters[0] run tag @s remove TeleporterInitializing
    execute unless data storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].Temp.Teleporters[0] run tag @s add TeleporterInitialized
# 召喚したならリセット
    execute if data storage asset:teleporter {TPStarSummonable: true} run data remove storage asset:teleporter TPStarSummonable
# 召喚できてなかったら再帰
    execute if data storage asset:teleporter {TPStarSummonable:false} if data storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].Temp.Teleporters[0] run function asset_manager:teleporter/tick/star_init/summon_once


text:
#> asset_manager:teleporter/tick/tp/move
#
#
#
# @within function asset_manager:teleporter/tick/tp/

# TP先へ移動
    data modify entity @s Pos set from storage asset:teleporter TargetPos
# プレイヤーを飛ばす
    execute positioned as @s run tp @p[tag=this] ~ ~ ~
    tp @p[tag=this] @p[tag=this]
# VFX
    function asset_manager:teleporter/tick/vfx/teleport/from
    execute positioned as @s run function asset_manager:teleporter/tick/vfx/teleport/to
# 盲目を消す
    effect clear @p[tag=this] blindness
# TP後タグ付与
    tag @p[tag=this] add SuppressTeleport
# 汎用entityを戻す
    execute in overworld run tp @s 0.0 0.0 0.0