Skip to content

Commit b191f68

Browse files
committed
Merge branch 'master' into rework/haiiro_artifact-trigger
2 parents 78baea1 + c121c81 commit b191f68

File tree

466 files changed

+3163
-1747
lines changed

Some content is hidden

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

466 files changed

+3163
-1747
lines changed

.github/workflows/datapack-linter.yml

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -51,34 +51,35 @@ jobs:
5151
REPOSITORY: ProjectTSB/TheSkyBlessing
5252
BRANCH: master
5353
VISIBILITY_FILTER: |
54-
function@asset:artifact/artifact_name/trigger_name/
55-
function@asset:artifact/artifact_name/trigger_name/check
56-
function@asset:artifact/artifact_name/enroll_pool
57-
function@asset:artifact/artifact_name/register
58-
function@asset:effect/effect_name/register
59-
function@asset:effect/effect_name/given/
60-
function@asset:effect/effect_name/tick/
61-
function@asset:effect/effect_name/re-given/
62-
function@asset:effect/effect_name/remove/
63-
function@asset:effect/effect_name/end/
64-
function@asset:island/island_id/register/register
65-
function@asset:mob/mob_name/summon/
66-
function@asset:mob/mob_name/register
67-
function@asset:mob/mob_name/attack/
68-
function@asset:mob/mob_name/death/
69-
function@asset:mob/mob_name/hurt/
70-
function@asset:mob/mob_name/init/
71-
function@asset:mob/mob_name/remove/
72-
function@asset:mob/mob_name/tick/
73-
function@asset:mob/mob_name/attack/SOMETHING_FUNCTION
74-
function@asset:mob/mob_name/death/SOMETHING_FUNCTION
75-
function@asset:mob/mob_name/hurt/SOMETHING_FUNCTION
76-
function@asset:spawner/spawner_id/register
77-
function@asset:teleporter/tp_id/register
78-
function@asset:trader/trader_name/register/register
54+
function@asset:artifact/ARTIFACT_NAME/TRIGGER_NAME/
55+
function@asset:artifact/ARTIFACT_NAME/TRIGGER_NAME/check
56+
function@asset:artifact/ARTIFACT_NAME/enroll_pool
57+
function@asset:artifact/ARTIFACT_NAME/register
58+
function@asset:effect/EFFECT_NAME/register
59+
function@asset:effect/EFFECT_NAME/given/
60+
function@asset:effect/EFFECT_NAME/tick/
61+
function@asset:effect/EFFECT_NAME/re-given/
62+
function@asset:effect/EFFECT_NAME/remove/
63+
function@asset:effect/EFFECT_NAME/end/
64+
function@asset:mob/MOB_NAME/register
65+
function@asset:mob/MOB_NAME/summon/
66+
function@asset:mob/MOB_NAME/attack/
67+
function@asset:mob/MOB_NAME/death/
68+
function@asset:mob/MOB_NAME/hurt/
69+
function@asset:mob/MOB_NAME/init/
70+
function@asset:mob/MOB_NAME/remove/
71+
function@asset:mob/MOB_NAME/tick/
72+
function@asset:mob/MOB_NAME/attack/SOMETHING_FUNCTION
73+
function@asset:mob/MOB_NAME/death/SOMETHING_FUNCTION
74+
function@asset:mob/MOB_NAME/hurt/SOMETHING_FUNCTION
7975
function@asset:object/OBJECT_NAME/register
8076
function@asset:object/OBJECT_NAME/init/
8177
function@asset:object/OBJECT_NAME/tick/
78+
function@asset:container/CONTAINER_ID/register
79+
function@asset:island/ISLAND_ID/register
80+
function@asset:spawner/SPAWNER_ID/register
81+
function@asset:teleporter/TELEPORTER_ID/register
82+
function@asset:trader/TRADER_ID/register
8283
OUTPUT_PATH: ./Asset2/Asset/data/minecraft/functions/declares.d.mcfunction
8384
OUTPUT_RESOURCE_PATH: minecraft:declares.d
8485

OhMyDat/data/oh_my_dat/functions/sys/init.mcfunction

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ data modify storage oh_my_dat: IDSet set value [I;]
2525
# asset:**
2626
# asset_manager:**
2727
# mob_manager:**
28+
# metric:**
2829
# player_manager:**
2930
# world_manager:**
3031
#declare storage oh_my_dat:

OhMyDat/data/oh_my_dat/functions/sys/provide.mcfunction

Lines changed: 31 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -35,96 +35,72 @@ data remove storage oh_my_dat: _[6]
3535
data remove storage oh_my_dat: _[5]
3636
data remove storage oh_my_dat: _[4]
3737

38-
# ストレージシフト1
39-
scoreboard players set $ OhMyDat 65536
40-
scoreboard players operation $ OhMyDatID *= $ OhMyDat
41-
# 01....
38+
# シフト1
39+
scoreboard players operation $ OhMyDatID *= $65536 Const
40+
# 上位2bitを元にオフセット要素を末尾追加する
4241
execute if score $ OhMyDatID matches 1073741824.. run data modify storage oh_my_dat: _ append value []
43-
# 10....
4442
execute if score $ OhMyDatID matches ..-1073741825 run data modify storage oh_my_dat: _ append from storage oh_my_dat: two_empty_lists[]
45-
# 11....
4643
execute if score $ OhMyDatID matches -1073741824..-1 run data modify storage oh_my_dat: _ append from storage oh_my_dat: three_empty_lists[]
4744

48-
# ストレージチェック2
45+
# チェック2
4946
execute unless data storage oh_my_dat: _[-4][0] run data modify storage oh_my_dat: _[-4] set from storage oh_my_dat: initial[0]
50-
# ストレージシフト2
51-
scoreboard players operation $ OhMyDatID += $ OhMyDatID
52-
scoreboard players operation $ OhMyDatID += $ OhMyDatID
53-
# 01....
47+
# シフト2
48+
scoreboard players operation $ OhMyDatID *= $4 Const
49+
# 上位2bitを元にオフセット要素を末尾追加する
5450
execute if score $ OhMyDatID matches 1073741824.. run data modify storage oh_my_dat: _[-4] append value []
55-
# 10....
5651
execute if score $ OhMyDatID matches ..-1073741825 run data modify storage oh_my_dat: _[-4] append from storage oh_my_dat: two_empty_lists[]
57-
# 11....
5852
execute if score $ OhMyDatID matches -1073741824..-1 run data modify storage oh_my_dat: _[-4] append from storage oh_my_dat: three_empty_lists[]
5953

60-
# ストレージチェック3
54+
# チェック3
6155
execute unless data storage oh_my_dat: _[-4][-4][0] run data modify storage oh_my_dat: _[-4][-4] set from storage oh_my_dat: initial[0][0]
62-
# ストレージシフト3
63-
scoreboard players operation $ OhMyDatID += $ OhMyDatID
64-
scoreboard players operation $ OhMyDatID += $ OhMyDatID
65-
# 01....
56+
# シフト3
57+
scoreboard players operation $ OhMyDatID *= $4 Const
58+
# 上位2bitを元にオフセット要素を末尾追加する
6659
execute if score $ OhMyDatID matches 1073741824.. run data modify storage oh_my_dat: _[-4][-4] append value []
67-
# 10....
6860
execute if score $ OhMyDatID matches ..-1073741825 run data modify storage oh_my_dat: _[-4][-4] append from storage oh_my_dat: two_empty_lists[]
69-
# 11....
7061
execute if score $ OhMyDatID matches -1073741824..-1 run data modify storage oh_my_dat: _[-4][-4] append from storage oh_my_dat: three_empty_lists[]
7162

72-
# ストレージチェック4
63+
# チェック4
7364
execute unless data storage oh_my_dat: _[-4][-4][-4][0] run data modify storage oh_my_dat: _[-4][-4][-4] set from storage oh_my_dat: initial[0][0][0]
74-
# ストレージシフト4
75-
scoreboard players operation $ OhMyDatID += $ OhMyDatID
76-
scoreboard players operation $ OhMyDatID += $ OhMyDatID
77-
# 01....
65+
# シフト4
66+
scoreboard players operation $ OhMyDatID *= $4 Const
67+
# 上位2bitを元にオフセット要素を末尾追加する
7868
execute if score $ OhMyDatID matches 1073741824.. run data modify storage oh_my_dat: _[-4][-4][-4] append value []
79-
# 10....
8069
execute if score $ OhMyDatID matches ..-1073741825 run data modify storage oh_my_dat: _[-4][-4][-4] append from storage oh_my_dat: two_empty_lists[]
81-
# 11....
8270
execute if score $ OhMyDatID matches -1073741824..-1 run data modify storage oh_my_dat: _[-4][-4][-4] append from storage oh_my_dat: three_empty_lists[]
8371

84-
# ストレージチェック5
72+
# チェック5
8573
execute unless data storage oh_my_dat: _[-4][-4][-4][-4][0] run data modify storage oh_my_dat: _[-4][-4][-4][-4] set from storage oh_my_dat: initial[0][0][0][0]
86-
# ストレージシフト5
87-
scoreboard players operation $ OhMyDatID += $ OhMyDatID
88-
scoreboard players operation $ OhMyDatID += $ OhMyDatID
89-
# 01....
74+
# シフト5
75+
scoreboard players operation $ OhMyDatID *= $4 Const
76+
# 上位2bitを元にオフセット要素を末尾追加する
9077
execute if score $ OhMyDatID matches 1073741824.. run data modify storage oh_my_dat: _[-4][-4][-4][-4] append value []
91-
# 10....
9278
execute if score $ OhMyDatID matches ..-1073741825 run data modify storage oh_my_dat: _[-4][-4][-4][-4] append from storage oh_my_dat: two_empty_lists[]
93-
# 11....
9479
execute if score $ OhMyDatID matches -1073741824..-1 run data modify storage oh_my_dat: _[-4][-4][-4][-4] append from storage oh_my_dat: three_empty_lists[]
9580

96-
# ストレージチェック6
81+
# チェック6
9782
execute unless data storage oh_my_dat: _[-4][-4][-4][-4][-4][0] run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4] set from storage oh_my_dat: initial[0][0][0][0][0]
98-
# ストレージシフト6
99-
scoreboard players operation $ OhMyDatID += $ OhMyDatID
100-
scoreboard players operation $ OhMyDatID += $ OhMyDatID
101-
# 01....
83+
# シフト6
84+
scoreboard players operation $ OhMyDatID *= $4 Const
85+
# 上位2bitを元にオフセット要素を末尾追加する
10286
execute if score $ OhMyDatID matches 1073741824.. run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4] append value []
103-
# 10....
10487
execute if score $ OhMyDatID matches ..-1073741825 run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4] append from storage oh_my_dat: two_empty_lists[]
105-
# 11....
10688
execute if score $ OhMyDatID matches -1073741824..-1 run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4] append from storage oh_my_dat: three_empty_lists[]
10789

108-
# ストレージチェック7
90+
# チェック7
10991
execute unless data storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][0] run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4] set from storage oh_my_dat: initial[0][0][0][0][0][0]
110-
# ストレージシフト7
111-
scoreboard players operation $ OhMyDatID += $ OhMyDatID
112-
scoreboard players operation $ OhMyDatID += $ OhMyDatID
113-
# 01....
92+
# シフト7
93+
scoreboard players operation $ OhMyDatID *= $4 Const
94+
# 上位2bitを元にオフセット要素を末尾追加する
11495
execute if score $ OhMyDatID matches 1073741824.. run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4] append value []
115-
# 10....
11696
execute if score $ OhMyDatID matches ..-1073741825 run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4] append from storage oh_my_dat: two_empty_lists[]
117-
# 11....
11897
execute if score $ OhMyDatID matches -1073741824..-1 run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4] append from storage oh_my_dat: three_empty_lists[]
11998

120-
# ストレージチェック8
99+
# チェック8
121100
execute unless data storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][0] run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4] set from storage oh_my_dat: initial[0][0][0][0][0][0][0]
122-
# ストレージシフト8
123-
scoreboard players operation $ OhMyDatID += $ OhMyDatID
124-
scoreboard players operation $ OhMyDatID += $ OhMyDatID
125-
# 01....
101+
# シフト8
102+
scoreboard players operation $ OhMyDatID *= $4 Const
103+
# 上位2bitを元にオフセット要素を末尾追加する
126104
execute if score $ OhMyDatID matches 1073741824.. run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4] append value {}
127-
# 10....
128105
execute if score $ OhMyDatID matches ..-1073741825 run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4] append from storage oh_my_dat: two_empty_maps[]
129-
# 11....
130106
execute if score $ OhMyDatID matches -1073741824..-1 run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4] append from storage oh_my_dat: three_empty_maps[]

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

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

4646
# Healthを持つ干渉可能なEntityかつ死んでいなければ実行
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/
47+
execute if entity @s[type=#lib:living,tag=!Uninterferable,tag=!Death] at @s run function api:mob/apply_to_forward_target/with_non-idempotent.m {CB:"api:damage/core/attack",Key:"api:damage/",IsForwardedOnly:false}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#> タグ定義
1717
# @within
1818
# function
19-
# api:damage/core/health_subtract/non-player/*
19+
# api:mob/deal_dummy_damage.m
20+
# asset_manager:artifact/triggers/attack/vanilla
2021
# mob_manager:entity_finder/player_hurt_entity/on_attack
2122
#declare tag AttackedByApi

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,19 @@
1313
# ダメージの補正
1414
execute if data storage api: Argument{BypassModifier:false} store result storage api: Damage double 0.0001 run scoreboard players get $Damage Temporary
1515
execute if data storage api: Argument{BypassModifier:false} run function api:damage/core/modify_damage.m {Side:"Defense"}
16+
execute if data storage api: Argument{BypassModifier:false} if entity @s[type=!player,tag=!Enemy.Boss] if score $Metric Temporary matches ..99 run function metric:damage/normal.m {Condition:"Resist"}
17+
execute if data storage api: Argument{BypassModifier:false} if entity @s[type=!player,tag=!Enemy.Boss] if score $Metric Temporary matches 100 run function metric:damage/normal.m {Condition:"Normal"}
18+
execute if data storage api: Argument{BypassModifier:false} if entity @s[type=!player,tag=!Enemy.Boss] if score $Metric Temporary matches 101.. run function metric:damage/normal.m {Condition:"Weak"}
19+
execute if data storage api: Argument{BypassModifier:false} if entity @s[type=!player,tag= Enemy.Boss] if score $Metric Temporary matches ..99 run function metric:damage/angel.m {Condition:"Resist"}
20+
execute if data storage api: Argument{BypassModifier:false} if entity @s[type=!player,tag= Enemy.Boss] if score $Metric Temporary matches 100 run function metric:damage/angel.m {Condition:"Normal"}
21+
execute if data storage api: Argument{BypassModifier:false} if entity @s[type=!player,tag= Enemy.Boss] if score $Metric Temporary matches 101.. run function metric:damage/angel.m {Condition:"Weak"}
22+
execute if data storage api: Argument{BypassModifier:false} run scoreboard players reset $Metric Temporary
1623
execute if data storage api: Argument{BypassModifier:false} store result score $Damage Temporary run data get storage api: ModifiedDamage 100
1724
execute if data storage api: Argument{BypassModifier: true} run scoreboard players operation $Damage Temporary /= $100 Const
18-
# システム的なダメージ上限(9999.9/99999999(e4))チェック
19-
execute if score $Damage Temporary matches 99999000.. run scoreboard players set $Damage Temporary 99999000
25+
execute if data storage api: Argument{BypassModifier: true} if entity @s[type=!player,tag=!Enemy.Boss] run function metric:damage/normal.m {Condition:"Bypass"}
26+
execute if data storage api: Argument{BypassModifier: true} if entity @s[type=!player,tag= Enemy.Boss] run function metric:damage/angel.m {Condition:"Bypass"}
27+
# システム的なダメージ上限(9999.9(e2))チェック
28+
execute if score $Damage Temporary matches 999990.. run scoreboard players set $Damage Temporary 999990
2029
# Mobに適用
2130
function api:damage/core/health_subtract/
2231
# リセット

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

Lines changed: 0 additions & 20 deletions
This file was deleted.

TheSkyBlessing/data/api/functions/damage/core/attack_to_forward_target/check_initial_attack.m.mcfunction

Lines changed: 0 additions & 10 deletions
This file was deleted.

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

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,32 @@
66

77
#> Val
88
# @private
9-
#declare score_holder $Fluctuation
10-
#declare tag UUIDAttacker
9+
#declare score_holder $Fluctuation
1110

1211
# ダメージ表示
13-
scoreboard players set $Fluctuation Lib 0
14-
scoreboard players operation $Fluctuation Lib -= $Damage Temporary
15-
execute at @s run function lib:status_log/show_health
12+
execute unless data storage api: {IsForwarded:true} run scoreboard players set $Fluctuation Lib 0
13+
execute unless data storage api: {IsForwarded:true} run scoreboard players operation $Fluctuation Lib -= $Damage Temporary
14+
execute unless data storage api: {IsForwarded:true} at @s run function lib:status_log/show_health
1615

1716
# MobのHealthよりダメージが高い場合Healthに設定
1817
scoreboard players operation $Damage Temporary < $Health Temporary
1918
# 減算
2019
scoreboard players operation $Health Temporary -= $Damage Temporary
2120

2221
# ノックバックを無効に
23-
attribute @s minecraft:generic.knockback_resistance modifier add 3-0-1-0-100000001 "Temp_Resist" 1 add
22+
execute unless predicate api:mob/has_forward_target run attribute @s minecraft:generic.knockback_resistance modifier add 3-0-1-0-100000001 "Temp_Resist" 1 add
2423
# 敵対させるためのダメージ
25-
execute as @a if score @s UserID = $LatestModifiedUser UserID run tag @s add UUIDAttacker
26-
tag @p[tag=UUIDAttacker] add AttackedByApi
27-
damage @s 0 player_attack by @p[tag=UUIDAttacker]
28-
tag @p[tag=AttackedByApi] remove AttackedByApi
29-
tag @p[tag=UUIDAttacker] remove UUIDAttacker
24+
execute unless predicate api:mob/has_forward_target as @a if score @s UserID = $LatestModifiedUser UserID store result storage api: Argument.AttackerID int 1 run scoreboard players get @s UserID
25+
execute unless predicate api:mob/has_forward_target run function api:mob/deal_dummy_damage
3026
# ノックバック無効を削除
31-
attribute @s minecraft:generic.knockback_resistance modifier remove 3-0-1-0-100000001
27+
execute unless predicate api:mob/has_forward_target run attribute @s minecraft:generic.knockback_resistance modifier remove 3-0-1-0-100000001
3228

3329
# 代入
34-
scoreboard players operation @s MobHealth = $Health Temporary
30+
execute unless predicate api:mob/has_forward_target run scoreboard players operation @s MobHealth = $Health Temporary
3531

3632
# 死んでるならタグ付与 (Kill は AssetMob の場合 Death トリガーをもとに付けるのでここでは付けない)
37-
execute if score $Health Temporary matches ..0 run tag @s add Death
38-
execute if score $Health Temporary matches ..0 if entity @s[tag=!AssetMob] run tag @s add Kill
33+
execute unless predicate api:mob/has_forward_target if score $Health Temporary matches ..0 run tag @s add Death
34+
execute unless predicate api:mob/has_forward_target if score $Health Temporary matches ..0 if entity @s[tag=!AssetMob] run tag @s add Kill
3935
# イベントの追加
4036
function api:damage/core/trigger_events/non-player/attack_and_hurt/
4137
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/health_subtract/player/.mcfunction

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
execute if data storage api: Argument{BypassDifficulty:false} run function api:damage/core/health_subtract/player/difficulty_modifier
99
# 引数として代入
1010
execute store result storage api: Argument.Fluctuation double -0.01 run scoreboard players get $Damage Temporary
11+
# 統計送りにする
12+
execute at @s if entity @e[type=#lib:living,type=!player,tag=Enemy.Boss,distance=..100,limit=1] run function metric:angel/damage/
1113
# onAttackのトリガー
1214
function api:damage/core/trigger_events/player/attack_and_damage/
1315
# 体力の減少を反映させる

0 commit comments

Comments
 (0)