Skip to content

Commit cbb272d

Browse files
committed
Merge branch 'master' into rework/haiiro_artifact-trigger
2 parents b7ba236 + 6c94b10 commit cbb272d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+269
-699
lines changed

TheSkyBlessing/data/api/functions/damage/.mcfunction

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,5 @@
4444
execute unless data storage api: Argument.DisableLog run data modify storage api: Argument.DisableLog set value false
4545

4646
# Healthを持つ干渉可能なEntityかつ死んでいなければ実行
47-
execute if entity @s[type=#lib:living,tag=!Uninterferable,tag=!Death] at @s run function api:damage/core/attack
47+
execute unless score @s ForwardTargetMobUUID matches -2147483648..2147483647 if entity @s[type=#lib:living,tag=!Uninterferable,tag=!Death] at @s run function api:damage/core/attack
48+
execute if score @s ForwardTargetMobUUID matches -2147483648..2147483647 if entity @s[type=#lib:living,tag=!Uninterferable,tag=!Death] at @s run function api:damage/core/attack_to_forward_target/

TheSkyBlessing/data/api/functions/damage/core/attack.mcfunction

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
#
33
# ダメージ与えるよ
44
#
5-
# @within function api:damage/
5+
# @within function
6+
# api:damage/
7+
# api:damage/core/attack_to_forward_target/
68

79
# 計算に必要な値を取得
810
function api:damage/core/get_status/
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#> api:damage/core/attack_to_forward_target/
2+
#
3+
#
4+
#
5+
# @within function api:damage/
6+
7+
#> Private
8+
# @private
9+
#declare score_holder $DamageForwardTarget
10+
11+
# 初回の攻撃か判別する
12+
execute store result storage api: Args.ID int 1 run scoreboard players get @s ForwardTargetMobUUID
13+
execute store result storage api: IsInitialAttack byte 1 run function api:damage/core/attack_to_forward_target/check_initial_attack.m with storage api: Args
14+
data remove storage api: Args
15+
# ダメージを与える
16+
execute if data storage api: {IsInitialAttack:true} run scoreboard players operation $DamageForwardTarget Temporary = @s ForwardTargetMobUUID
17+
execute if data storage api: {IsInitialAttack:true} as @e[type=#lib:living,tag=!Uninterferable,tag=!Death,distance=..30] if score @s MobUUID = $DamageForwardTarget Temporary run function api:damage/core/attack
18+
# リセット
19+
data remove storage api: IsInitialAttack
20+
scoreboard players reset $DamageForwardTarget Temporary
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#> api:damage/core/attack_to_forward_target/check_initial_attack.m
2+
#
3+
#
4+
#
5+
# @input args
6+
# ID: int
7+
# @output result isPushed
8+
# @within function api:damage/core/attack_to_forward_target/
9+
10+
$return run data modify storage api: AttackForwardTargetSet.$(ID) set value true

TheSkyBlessing/data/api/functions/damage/core/health_subtract/non-player/.mcfunction

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@
3535
# 代入
3636
scoreboard players operation @s MobHealth = $Health Temporary
3737

38-
# 死んでるならタグ付与
38+
# 死んでるならタグ付与 (Kill は AssetMob の場合 Death トリガーをもとに付けるのでここでは付けない)
3939
execute if score $Health Temporary matches ..0 run tag @s add Death
40+
execute if score $Health Temporary matches ..0 if entity @s[tag=!AssetMob] run tag @s add Kill
4041
# イベントの追加
4142
function api:damage/core/trigger_events/non-player/attack_and_hurt/
4243
execute if score $Health Temporary matches ..0 run function api:damage/core/trigger_events/non-player/kill_and_death/

TheSkyBlessing/data/api/functions/damage/core/reset.mcfunction

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,7 @@ data remove storage api: Argument.ReduceEnchantment
2020
data remove storage api: Argument.DisableLog
2121
data remove storage api: Argument.Metadata
2222

23+
data remove storage api: AttackForwardTargetSet
24+
2325
scoreboard players reset $LatestModifiedUser UserID
2426
scoreboard players reset $LatestModifiedEntity MobUUID
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#> api:entity/mob/effect/core/apply_to_forward_target/apply.m
2+
#
3+
#
4+
#
5+
# @input args
6+
# CB: id(minecraft:function)
7+
# @within function
8+
# api:entity/mob/effect/**
9+
# api:entity/mob/effect/core/apply_to_forward_target/only_initial_apply.m
10+
11+
#> Private
12+
# @private
13+
#declare score_holder $ForwardTarget
14+
15+
# ForwardTarget を実行者として CB を呼び出す
16+
scoreboard players operation $ForwardTarget Temporary = @s ForwardTargetMobUUID
17+
$execute as @e[type=#lib:living,tag=!Uninterferable,tag=!Death,distance=..30] if score @s MobUUID = $ForwardTarget Temporary run function $(CB)
18+
# リセット
19+
scoreboard players reset $ForwardTarget Temporary
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#> api:entity/mob/effect/core/apply_to_forward_target/check_initial_apply.m
2+
#
3+
#
4+
#
5+
# @input args
6+
# ID: int
7+
# @output result isPushed
8+
# @within function api:entity/mob/effect/core/apply_to_forward_target/only_initial_apply.m
9+
10+
$return run data modify storage api: ApplyForwardTargetSet.$(ID) set value true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#> api:entity/mob/effect/core/apply_to_forward_target/only_initial_apply.m
2+
#
3+
#
4+
#
5+
# @input args
6+
# CB: id(minecraft:function)
7+
# @within function api:entity/mob/effect/**
8+
9+
# 初回の攻撃か判別する
10+
execute store result storage api: Args.ID int 1 run scoreboard players get @s ForwardTargetMobUUID
11+
execute store result storage api: IsInitialApply byte 1 run function api:entity/mob/effect/core/apply_to_forward_target/check_initial_apply.m with storage api: Args
12+
data remove storage api: Args
13+
# 呼び出し
14+
$execute if data storage api: {IsInitialApply:true} run function api:entity/mob/effect/core/apply_to_forward_target/apply.m {CB:"$(CB)"}
15+
# リセット
16+
data remove storage api: IsInitialApply

TheSkyBlessing/data/api/functions/entity/mob/effect/core/get/from_id.m.mcfunction

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
# @within function api:entity/mob/effect/get/from_id
66

77
data remove storage api: Return.Effect
8-
function oh_my_dat:please
9-
$data modify storage api: Return.Effect set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].Effects[{ID:$(ID)}]
8+
execute unless score @s ForwardTargetMobUUID matches -2147483648..2147483647 run function oh_my_dat:please
9+
execute if score @s ForwardTargetMobUUID matches -2147483648..2147483647 run function api:entity/mob/effect/core/apply_to_forward_target/apply.m {CB:"oh_my_dat:please"}
10+
$data modify storage api: Return.Effect set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].Effects[{ID:$(ID)}]

TheSkyBlessing/data/api/functions/entity/mob/effect/core/remove/from_id.mcfunction

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
#
55
# @within function api:entity/mob/effect/remove/from_id
66

7+
# エフェクトを持ってなかったら return
8+
execute if entity @s[tag=!HasAssetEffect] run return 0
9+
710
# 該当IDのデータを引っこ抜く
811
data modify storage asset:effect ID set from storage api: Argument.ID
912
function asset_manager:effect/common/try_pop_effect_data

TheSkyBlessing/data/api/functions/entity/mob/effect/core/remove/from_level/.mcfunction

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
#
55
# @within function api:entity/mob/effect/remove/from_level
66

7+
# エフェクトを持ってなかったら return
8+
execute if entity @s[tag=!HasAssetEffect] run return 0
9+
710
# storage呼び出し
811
function oh_my_dat:please
912
# effect id抽出

TheSkyBlessing/data/api/functions/entity/mob/effect/get/all.mcfunction

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
# @api
77

88
# storage呼び出し
9-
function oh_my_dat:please
9+
execute unless score @s ForwardTargetMobUUID matches -2147483648..2147483647 run function oh_my_dat:please
10+
execute if score @s ForwardTargetMobUUID matches -2147483648..2147483647 run function api:entity/mob/effect/core/apply_to_forward_target/apply.m {CB:"oh_my_dat:please"}
1011

1112
# エフェクトを取得
12-
data modify storage api: Return.EffectList set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].Effects
13+
data modify storage api: Return.EffectList set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].Effects

TheSkyBlessing/data/api/functions/entity/mob/effect/get/size/all.mcfunction

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# @api
66

77
# storage呼び出し
8-
function oh_my_dat:please
8+
execute unless score @s ForwardTargetMobUUID matches -2147483648..2147483647 run function oh_my_dat:please
9+
execute if score @s ForwardTargetMobUUID matches -2147483648..2147483647 run function api:entity/mob/effect/core/apply_to_forward_target/apply.m {CB:"oh_my_dat:please"}
910
# エフェクト数を取得
1011
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[]

TheSkyBlessing/data/api/functions/entity/mob/effect/get/size/bad.mcfunction

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# @api
66

77
# storage呼び出し
8-
function oh_my_dat:please
8+
execute unless score @s ForwardTargetMobUUID matches -2147483648..2147483647 run function oh_my_dat:please
9+
execute if score @s ForwardTargetMobUUID matches -2147483648..2147483647 run function api:entity/mob/effect/core/apply_to_forward_target/apply.m {CB:"oh_my_dat:please"}
910
# エフェクト数を取得
1011
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}]

TheSkyBlessing/data/api/functions/entity/mob/effect/get/size/good.mcfunction

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# @api
66

77
# storage呼び出し
8-
function oh_my_dat:please
8+
execute unless score @s ForwardTargetMobUUID matches -2147483648..2147483647 run function oh_my_dat:please
9+
execute if score @s ForwardTargetMobUUID matches -2147483648..2147483647 run function api:entity/mob/effect/core/apply_to_forward_target/apply.m {CB:"oh_my_dat:please"}
910
# エフェクト数を取得
1011
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}]

TheSkyBlessing/data/api/functions/entity/mob/effect/give.mcfunction

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,5 @@
1414
# validate
1515
execute unless data storage api: Argument.ID run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません"},{"text":" ID","color":"red"}]
1616
# 呼び出し
17-
execute if data storage api: Argument.ID run function api:entity/mob/effect/core/give
18-
# リセット
19-
data remove storage api: Argument.ID
20-
data remove storage api: Argument.Duration
21-
data remove storage api: Argument.Stack
22-
data remove storage api: Argument.DurationOperation
23-
data remove storage api: Argument.StackOperation
24-
data remove storage api: Argument.FieldOverride
17+
execute if data storage api: Argument.ID unless score @s ForwardTargetMobUUID matches -2147483648..2147483647 run function api:entity/mob/effect/core/give
18+
execute if data storage api: Argument.ID if score @s ForwardTargetMobUUID matches -2147483648..2147483647 run function api:entity/mob/effect/core/apply_to_forward_target/only_initial_apply.m {CB:"api:entity/mob/effect/core/give"}

TheSkyBlessing/data/api/functions/entity/mob/effect/remove/from_id.mcfunction

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@
99
# validate
1010
execute unless data storage api: Argument.ID run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません","color":"white"},{"text":" ID","color":"red"}]
1111
# 呼び出し
12-
execute if data storage api: Argument.ID if entity @s[tag=HasAssetEffect] run function api:entity/mob/effect/core/remove/from_id
13-
# リセット
14-
data remove storage api: Argument.ID
12+
execute if data storage api: Argument.ID unless score @s ForwardTargetMobUUID matches -2147483648..2147483647 run function api:entity/mob/effect/core/remove/from_id
13+
execute if data storage api: Argument.ID if score @s ForwardTargetMobUUID matches -2147483648..2147483647 run function api:entity/mob/effect/core/apply_to_forward_target/only_initial_apply.m {CB:"api:entity/mob/effect/core/remove/from_id"}

TheSkyBlessing/data/api/functions/entity/mob/effect/remove/from_level.mcfunction

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,5 @@
1616
# execute unless data storage api: Argument.ClearCount run
1717
execute if data storage api: Argument{IsSingle:true} run data modify storage api: Argument.ClearCount set value 1
1818
# 呼び出し
19-
execute if data storage api: Argument.ClearLv if entity @s[tag=HasAssetEffect] run function api:entity/mob/effect/core/remove/from_level/
20-
# リセット
21-
data remove storage api: Argument.ClearLv
22-
data remove storage api: Argument.ClearType
23-
data remove storage api: Argument.IsSingle
24-
data remove storage api: Argument.ClearCount
19+
execute if data storage api: Argument.ClearLv unless score @s ForwardTargetMobUUID matches -2147483648..2147483647 run function api:entity/mob/effect/core/remove/from_level/
20+
execute if data storage api: Argument.ClearLv if score @s ForwardTargetMobUUID matches -2147483648..2147483647 run function api:entity/mob/effect/core/apply_to_forward_target/only_initial_apply.m {CB:"api:entity/mob/effect/core/remove/from_level/"}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#> api:entity/mob/effect/reset
2+
#
3+
#
4+
#
5+
# @api
6+
7+
# リセット
8+
data remove storage api: Argument.ID
9+
data remove storage api: Argument.Duration
10+
data remove storage api: Argument.Stack
11+
data remove storage api: Argument.DurationOperation
12+
data remove storage api: Argument.StackOperation
13+
data remove storage api: Argument.FieldOverride
14+
data remove storage api: Argument.ClearLv
15+
data remove storage api: Argument.ClearType
16+
data remove storage api: Argument.IsSingle
17+
data remove storage api: Argument.ClearCount
18+
19+
data remove storage api: ApplyForwardTargetSet

TheSkyBlessing/data/api/functions/mob/kill.mcfunction

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,11 @@
44
#
55
# @api
66

7-
# 殺す
7+
# 殺す (Kill は AssetMob の場合 Death トリガーをもとに付けるのでここでは付けない)
88
tag @s add Death
9+
execute if entity @s[tag=!AssetMob] run tag @s add Kill
910
# HP を 0 に
1011
scoreboard players set @s MobHealth 0
1112
# イベントを追加する
1213
function oh_my_dat:please
13-
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].MobEvents.Death append value {Type: "api",IsVanilla:false}
14-
execute store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].MobEvents.Death[-1].Amount double 0.01 run scoreboard players get $Damage Temporary
15-
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].MobEvents.Death[-1].AttackType set from storage api: Argument.AttackType
16-
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].MobEvents.Death[-1].ElementType set from storage api: Argument.ElementType
17-
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].MobEvents.Death[-1].Metadata set from storage api: Argument.Metadata
14+
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].MobEvents.Death append value {Type:"api",IsVanilla:false}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#> asset:container/example/generate
2+
# @within function asset:container/example/register
3+
4+
# ブロック (id(minecraft:block))
5+
data modify storage asset:container Block set value "chest[facing=east,waterlogged=true]"
6+
7+
# 以下はどちらかしか設定できない
8+
# ルートテーブル (id(minecraft:loot_table)) (オプション)
9+
# data modify storage asset:container LootTable set value "common:island_rewards/lv-1"
10+
# アイテム ([id(minecraft:loot_table)] オプション)
11+
data modify storage asset:container Items set value [{Slot:0b,Item:{PresetItem:"currency/",Count:1b}},{Slot:1b,Item:{PresetItem:"currency/high",Count:1b}},{Slot:2b,Item:{PresetItem:"sacred_shard/lv-1",Count:1b}},{Slot:3b,Item:{PresetItem:"sacred_shard/lv-2",Count:1b}},{Slot:4b,Item:{PresetItem:"sacred_shard/lv-3",Count:1b}},{Slot:5b,Item:{PresetItem:"sacred_shard/lv-4",Count:1b}},{Slot:6b,Item:1},{Slot:7b,Item:{id:"stick",Count:1b,tag:{Enchantments:[{id:"minecraft:sharpness",lvl:10s}]}}}]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#> asset:container/example/register
2+
# @within tag/function asset:container/register
3+
4+
# R 木に従ってデータを追加する (1 ~ 4 くらいの配列に追加することになる?)
5+
# data modify storage asset:container Registry[0][0][0][0] append value 65535

TheSkyBlessing/data/asset/functions/mob/example.1/summon/.mcfunction

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
# @within asset:mob/alias/65534/summon
66

77
# 元となるEntityを召喚する
8-
summon zombie ~ ~ ~ {Tags:["MobInit","AntiVoid"],DeathLootTable:"asset:mob/death/example.1"}
8+
summon zombie ~ ~ ~ {Tags:["MobInit","AntiVoid"]}

TheSkyBlessing/data/asset/functions/mob/example.2/summon/.mcfunction

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
# @within asset:mob/alias/65533/summon
66

77
# 元となるEntityを召喚する
8-
summon zombie ~ ~ ~ {Tags:["MobInit"],DeathLootTable:"asset:mob/death/example.2"}
8+
summon zombie ~ ~ ~ {Tags:["MobInit"]}

0 commit comments

Comments
 (0)