-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into dev/lapis_737
- Loading branch information
Showing
80 changed files
with
1,228 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"values": [ | ||
|
||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"values": [ | ||
|
||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"values": [ | ||
|
||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"values": [ | ||
|
||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"values": [ | ||
|
||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"values": [ | ||
|
||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"values": [ | ||
|
||
] | ||
} |
9 changes: 9 additions & 0 deletions
9
TheSkyBlessing/data/api/functions/entity/mob/effect/core/get/from_id.m.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#> api:entity/mob/effect/core/get/from_id.m | ||
# @input args | ||
# ID : int | ||
# 欲しいエフェクトのID | ||
# @within function api:entity/mob/effect/get/from_id | ||
|
||
data remove storage api: Return.Effect | ||
function oh_my_dat:please | ||
$data modify storage api: Return.Effect set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].Effects[{ID:$(ID)}] |
55 changes: 55 additions & 0 deletions
55
TheSkyBlessing/data/api/functions/entity/mob/effect/core/give.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#> api:entity/mob/effect/core/give | ||
# | ||
# | ||
# | ||
# @within function api:entity/mob/effect/give | ||
|
||
# 既存にasset:context idが存在する場合に備えて退避させる | ||
function asset_manager:common/context_id/stash | ||
|
||
# ID | ||
data modify storage asset:context id set from storage api: Argument.ID | ||
# prefill | ||
data modify storage asset:effect Duration set from storage api: Argument.Duration | ||
data modify storage asset:effect Stack set from storage api: Argument.Stack | ||
data modify storage asset:effect DurationOperation set from storage api: Argument.DurationOperation | ||
data modify storage asset:effect StackOperation set from storage api: Argument.StackOperation | ||
# API側Opt値のprefill | ||
execute unless data storage asset:effect Stack run data modify storage asset:effect Stack set value 1 | ||
execute unless data storage asset:effect DurationOperation run data modify storage asset:effect DurationOperation set value "replace" | ||
execute unless data storage asset:effect StackOperation run data modify storage asset:effect StackOperation set value "replace" | ||
# register側Opt値のprefill | ||
data modify storage asset:effect MaxDuration set value 2147483647 | ||
data modify storage asset:effect MaxStack set value 2147483647 | ||
data modify storage asset:effect ProcessOnDied set value "remove" | ||
data modify storage asset:effect RequireClearLv set value 1 | ||
|
||
# データを取得 | ||
function #asset:effect/register | ||
# データチェック | ||
execute unless data storage asset:effect ID run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"次のIDのエフェクトは存在しません: "},{"storage":"api:","nbt":"Argument.ID"}] | ||
# 継承が行われている場合そのデータを追加する | ||
execute if data storage asset:effect ID if data storage asset:effect Extends[0] run function api:entity/mob/effect/core/put_id_to_map | ||
# データが正しくあれば呼び出す | ||
execute if data storage asset:effect ID run function asset_manager:effect/give/ | ||
|
||
# リセット | ||
data remove storage asset:effect ID | ||
data remove storage asset:effect Extends | ||
data remove storage asset:effect Name | ||
data remove storage asset:effect Description | ||
data remove storage asset:effect Duration | ||
data remove storage asset:effect Stack | ||
data remove storage asset:effect DurationOperation | ||
data remove storage asset:effect StackOperation | ||
data remove storage asset:effect MaxDuration | ||
data remove storage asset:effect MaxStack | ||
data remove storage asset:effect IsBadEffect | ||
data remove storage asset:effect ProcessOnDied | ||
data remove storage asset:effect RequireClearLv | ||
data remove storage asset:effect Field | ||
|
||
data remove storage asset:effect NonExistsInRom | ||
|
||
# 退避させたasset:context idを戻す | ||
function asset_manager:common/context_id/pop |
24 changes: 24 additions & 0 deletions
24
TheSkyBlessing/data/api/functions/entity/mob/effect/core/put_id_to_map.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#> api:entity/mob/effect/core/put_id_to_map | ||
# | ||
# | ||
# | ||
# @within function api:entity/mob/effect/core/* | ||
|
||
# ID:1, Extends: [2, 3, 4] => 1 -> 2, 2 -> 3, 3 -> 4 | ||
|
||
# Extends に1要素しかなければ ID をキーにする | ||
execute unless data storage asset:effect Extends[1] run data modify storage api: Argument.Address set from storage asset:effect ID | ||
# Extends に2要素あれば Extends の最後から2番目の要素をキーにする | ||
execute if data storage asset:effect Extends[1] run data modify storage api: Argument.Address set from storage asset:effect Extends[-2] | ||
|
||
# キーからROMを呼び出す | ||
function api:rom/please | ||
|
||
# データを保存しつつ、すでにデータが入っているかを確認する | ||
execute store result storage asset:effect NonExistsInRom byte 1 run data modify storage rom: _[-4][-4][-4][-4][-4][-4][-4][-4].Effect.Extends set from storage asset:effect Extends[-1] | ||
|
||
# リセット | ||
data remove storage asset:effect Extends[-1] | ||
|
||
# まだExtendsが残っていて、かつROMに保存されていなければれば再帰する | ||
execute if data storage asset:effect Extends[0] if data storage asset:effect {NonExistsInRom:true} run function api:entity/mob/effect/core/put_id_to_map |
12 changes: 12 additions & 0 deletions
12
TheSkyBlessing/data/api/functions/entity/mob/effect/core/remove/from_id.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#> api:entity/mob/effect/core/remove/from_id | ||
# | ||
# | ||
# | ||
# @within function api:entity/mob/effect/remove/from_id | ||
|
||
# 該当IDのデータを引っこ抜く | ||
data modify storage asset:effect ID set from storage api: Argument.ID | ||
function asset_manager:effect/common/try_pop_effect_data | ||
# 存在する場合は残り時間を-1に設定して元に戻す | ||
execute if data storage asset:effect TargetEffectData run data modify storage asset:effect TargetEffectData.Duration set value -1 | ||
execute if data storage asset:effect TargetEffectData run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].Effects append from storage asset:effect TargetEffectData |
20 changes: 20 additions & 0 deletions
20
TheSkyBlessing/data/api/functions/entity/mob/effect/core/remove/from_level/.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#> api:entity/mob/effect/core/remove/from_level/ | ||
# | ||
# | ||
# | ||
# @within function api:entity/mob/effect/remove/from_level | ||
|
||
# storage呼び出し | ||
function oh_my_dat:please | ||
# effect id抽出 | ||
data modify storage asset:effect IDList append from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].Effects[].ID | ||
# 条件を代入 | ||
data modify storage asset:effect ClearType set from storage api: Argument.ClearType | ||
data modify storage asset:effect IsSingle set from storage api: Argument.IsSingle | ||
# ループに入れる | ||
function api:entity/mob/effect/core/remove/from_level/recursion | ||
# リセット | ||
data remove storage asset:effect IDList | ||
data remove storage asset:effect Type | ||
data remove storage asset:effect IsSingle | ||
data remove storage asset:effect CanRemove |
39 changes: 39 additions & 0 deletions
39
...Blessing/data/api/functions/entity/mob/effect/core/remove/from_level/recursion.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#> api:entity/mob/effect/core/remove/from_level/recursion | ||
# | ||
# | ||
# | ||
# @within function | ||
# api:entity/mob/effect/core/remove/from_level/ | ||
# api:entity/mob/effect/core/remove/from_level/recursion | ||
|
||
#> private | ||
# @private | ||
#declare score_holder $ClearLv | ||
#declare score_holder $RequiredLv | ||
|
||
# 末尾を取り出す | ||
data modify storage asset:effect ID set from storage asset:effect IDList[-1] | ||
function asset_manager:effect/common/try_pop_effect_data | ||
|
||
# 存在する場合 | ||
data modify storage asset:effect CanRemove set value true | ||
# レベルチェック | ||
execute unless data storage asset:effect TargetEffectData run data modify storage asset:effect CanRemove set value false | ||
execute if data storage asset:effect TargetEffectData store result score $ClearLv Temporary run data get storage api: Argument.ClearLv 1 | ||
execute if data storage asset:effect TargetEffectData store result score $RequiredLv Temporary run data get storage api: Argument.RequireClearLv 1 | ||
execute unless score $ClearLv Temporary >= $RequiredLv Temporary run data modify storage asset:effect CanRemove set value false | ||
# 削除条件の確認 | ||
execute if data storage asset:effect {TargetEffectData:{IsBadEffect:false},ClearType:"bad"} run data modify storage asset:effect CanRemove set value false | ||
execute if data storage asset:effect {TargetEffectData:{IsBadEffect:true},ClearType:"good"} run data modify storage asset:effect CanRemove set value false | ||
# 条件を満たしている場合残り時間に-1を代入する | ||
execute if data storage asset:effect {CanRemove:true} run data modify storage asset:effect TargetEffectData.Duration set value -1 | ||
# 結果を戻す | ||
execute if data storage asset:effect TargetEffectData run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].Effects append from storage asset:effect TargetEffectData | ||
|
||
# リセット | ||
data remove storage asset:effect ID | ||
data remove storage asset:effect TargetEffectData | ||
|
||
# 残っていたら再帰 | ||
data remove storage asset:effect IDList[-1] | ||
execute unless data storage asset:effect {CanRemove:true,IsSingle:true} if data storage asset:effect IDList[0] run function api:entity/mob/effect/core/remove/from_level/recursion |
12 changes: 12 additions & 0 deletions
12
TheSkyBlessing/data/api/functions/entity/mob/effect/get/all.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#> api:entity/mob/effect/get/all | ||
# | ||
# Effect一覧を取得する | ||
# | ||
# @input as player | ||
# @api | ||
|
||
# storage呼び出し | ||
function oh_my_dat:please | ||
|
||
# エフェクトを取得 | ||
data modify storage api: Return.EffectList set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].Effects |
16 changes: 16 additions & 0 deletions
16
TheSkyBlessing/data/api/functions/entity/mob/effect/get/from_id.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#> api:entity/mob/effect/get/from_id | ||
# | ||
# ID指定で自分の持つエフェクトを拾い上げる | ||
# | ||
# @input | ||
# as player | ||
# storage api: | ||
# Argument.ID : int | ||
# @api | ||
|
||
# validate | ||
execute unless data storage api: Argument.ID run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません","color":"white"},{"text":" ID","color":"red"}] | ||
# 呼び出し | ||
execute if data storage api: Argument.ID run function api:entity/mob/effect/core/get/from_id.m with storage api: Argument | ||
# reset | ||
data remove storage api: Argument.ID |
10 changes: 10 additions & 0 deletions
10
TheSkyBlessing/data/api/functions/entity/mob/effect/get/size/all.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#> api:entity/mob/effect/get/size/all | ||
# | ||
# entityに付与されている全てのエフェクトの数を取得します。 | ||
# | ||
# @api | ||
|
||
# storage呼び出し | ||
function oh_my_dat:please | ||
# エフェクト数を取得 | ||
execute store result storage api: Return.EffectSize.All int 1 if data storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].Effects[] |
10 changes: 10 additions & 0 deletions
10
TheSkyBlessing/data/api/functions/entity/mob/effect/get/size/bad.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#> api:entity/mob/effect/get/size/bad | ||
# | ||
# entityに付与されている悪い効果のエフェクトの数を取得します。 | ||
# | ||
# @api | ||
|
||
# storage呼び出し | ||
function oh_my_dat:please | ||
# エフェクト数を取得 | ||
execute store result storage api: Return.EffectSize.Bad int 1 if data storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].Effects[{IsBadEffect: 1b}] |
10 changes: 10 additions & 0 deletions
10
TheSkyBlessing/data/api/functions/entity/mob/effect/get/size/good.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#> api:entity/mob/effect/get/size/good | ||
# | ||
# entityに付与されている良い効果のエフェクトの数を取得します。 | ||
# | ||
# @api | ||
|
||
# storage呼び出し | ||
function oh_my_dat:please | ||
# エフェクト数を取得 | ||
execute store result storage api: Return.EffectSize.Good int 1 if data storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].Effects[{IsBadEffect: 0b}] |
22 changes: 22 additions & 0 deletions
22
TheSkyBlessing/data/api/functions/entity/mob/effect/give.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#> api:entity/mob/effect/give | ||
# | ||
# entityにエフェクトを与えます。 | ||
# | ||
# @input storage api: | ||
# Argument.ID : int | ||
# Argument.Duration? : int (default: Asset | error) | ||
# Argument.Stack? : int (default: 1) | ||
# Argument.DurationOperation? : "forceReplace" | "replace" | "add" (default: "replace") | ||
# Argument.StackOperation? : "forceReplace" | "replace" | "add" (default: "replace") | ||
# @api | ||
|
||
# validate | ||
execute unless data storage api: Argument.ID run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません"},{"text":" ID","color":"red"}] | ||
# 呼び出し | ||
execute if data storage api: Argument.ID run function api:entity/mob/effect/core/give | ||
# リセット | ||
data remove storage api: Argument.ID | ||
data remove storage api: Argument.Duration | ||
data remove storage api: Argument.Stack | ||
data remove storage api: Argument.DurationOperation | ||
data remove storage api: Argument.StackOperation |
14 changes: 14 additions & 0 deletions
14
TheSkyBlessing/data/api/functions/entity/mob/effect/remove/from_id.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#> api:entity/mob/effect/remove/from_id | ||
# | ||
# entityから特定のエフェクトを削除します | ||
# | ||
# @input storage api: | ||
# Argument.ID : int | ||
# @api | ||
|
||
# validate | ||
execute unless data storage api: Argument.ID run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません","color":"white"},{"text":" ID","color":"red"}] | ||
# 呼び出し | ||
execute if data storage api: Argument.ID if entity @s[tag=HasAssetEffect] run function api:entity/mob/effect/core/remove/from_id | ||
# リセット | ||
data remove storage api: Argument.ID |
20 changes: 20 additions & 0 deletions
20
TheSkyBlessing/data/api/functions/entity/mob/effect/remove/from_level.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#> api:entity/mob/effect/remove/from_level | ||
# | ||
# entityに付与されているエフェクトのうち、ClearLvと条件を満たすものを全て削除します | ||
# | ||
# @input storage api: | ||
# Argument.ClearLv : int | ||
# Argument.ClearType? : "all" | "bad" | "good" (default: "all") | ||
# Argument.IsSingle? : bool (default: false) | ||
# @api | ||
|
||
# validate | ||
execute unless data storage api: Argument.ClearLv run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません","color":"white"},{"text":" ClearLv","color":"red"}] | ||
execute unless data storage api: Argument.ClearType run data modify storage api: Argument.ClearType set value "all" | ||
execute unless data storage api: Argument.IsSingle run data modify storage api: Argument.IsSingle set value false | ||
# 呼び出し | ||
execute if data storage api: Argument.ClearLv if entity @s[tag=HasAssetEffect] run function api:entity/mob/effect/core/remove/from_level/ | ||
# リセット | ||
data remove storage api: Argument.ClearLv | ||
data remove storage api: Argument.ClearType | ||
data remove storage api: Argument.IsSingle |
7 changes: 7 additions & 0 deletions
7
TheSkyBlessing/data/asset/functions/effect/ex.2/_/register.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#> asset:effect/ex.2/_/register | ||
# | ||
# | ||
# | ||
# @within tag/function asset:effect/register | ||
|
||
execute if data storage asset:context {id:65534} run function asset:effect/ex.2/register |
Oops, something went wrong.