Skip to content

Commit

Permalink
💥 トリガー処理のマクロ化
Browse files Browse the repository at this point in the history
  • Loading branch information
haiiro2gou committed Nov 17, 2024
1 parent 0aff1f6 commit 7ab0410
Show file tree
Hide file tree
Showing 364 changed files with 3,407 additions and 1,869 deletions.
2 changes: 0 additions & 2 deletions TheSkyBlessing/data/api/functions/damage/.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
# Argument.BypassDifficulty? : boolean
# Argument.ReduceEnchantment? : id(minecraft:enchantment) | { id: id(minecraft:enchantment), modifier?: int }
# Argument.DeathMessage? : TextComponent || TextComponent[]
# Argument.AdditionalMPHeal? : int (default: PersistentArgument.AdditionalMPHeal)
# Argument.DisableLog? : boolean (default: false)
# Argument.Metadata? : any
# @api
Expand All @@ -42,7 +41,6 @@
execute unless data storage api: Argument.BypassEnchantments run data modify storage api: Argument.BypassEnchantments set value false
execute unless data storage api: Argument.BypassResistance run data modify storage api: Argument.BypassResistance set value false
execute unless data storage api: Argument.BypassDifficulty run data modify storage api: Argument.BypassDifficulty set value false
execute unless data storage api: Argument.AdditionalMPHeal run data modify storage api: Argument.AdditionalMPHeal set from storage api: PersistentArgument.AdditionalMPHeal
execute unless data storage api: Argument.DisableLog run data modify storage api: Argument.DisableLog set value false

# Healthを持つ干渉可能なEntityかつ死んでいなければ実行
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,4 @@
function api:damage/core/health_subtract/
# リセット
scoreboard players reset $Health Temporary
scoreboard players reset $Damage Temporary

# MP 回復
execute if data storage api: Argument.AdditionalMPHeal if entity @s[type=!player] as @a if score @s UserID = $LatestModifiedUser UserID run function api:damage/core/mp_heal
scoreboard players reset $Damage Temporary

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ data remove storage api: Argument.BypassEnchantments
data remove storage api: Argument.BypassResistance
data remove storage api: Argument.DisableParticle
data remove storage api: Argument.ReduceEnchantment
data remove storage api: Argument.AdditionalMPHeal
data remove storage api: Argument.DisableLog
data remove storage api: Argument.Metadata

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
execute store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].MobEvents.Death[-1].From int 1 run scoreboard players get @s UserID
# プレイヤーにイベントを追加する
function oh_my_dat:please
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Killed append value {Type: "api",IsVanilla:false}
execute store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Killed[-1].To int 1 run scoreboard players get $DamagerUUID Temporary
execute store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Killed[-1].Amount double 0.01 run scoreboard players get $Damage Temporary
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Killed[-1].AttackType set from storage api: Argument.AttackType
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Killed[-1].ElementType set from storage api: Argument.ElementType
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Killed[-1].Metadata set from storage api: Argument.Metadata
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Kill append value {Type: "api",IsVanilla:false}
execute store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Kill[-1].To int 1 run scoreboard players get $DamagerUUID Temporary
execute store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Kill[-1].Amount double 0.01 run scoreboard players get $Damage Temporary
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Kill[-1].AttackType set from storage api: Argument.AttackType
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Kill[-1].ElementType set from storage api: Argument.ElementType
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Kill[-1].Metadata set from storage api: Argument.Metadata
6 changes: 6 additions & 0 deletions TheSkyBlessing/data/asset/functions/_index.d.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#> asset:_index.d
# @private

#> 処理用一時storage
# @within * asset:**
#declare storage asset:temp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:artifact/alias/65535/attack/
#
# 神器の攻撃時の処理のエイリアス
#
# @within asset_manager:artifact/triggers/attack/attack.m

# 元の登録処理を呼び出す
function asset:artifact/example/attack/
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:artifact/alias/65535/attack/check
#
# 神器の攻撃時の処理のエイリアス
#
# @within asset_manager:artifact/triggers/attack/check.m

# 元の登録処理を呼び出す
function asset:artifact/example/attack/check
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:artifact/alias/65535/dis_equip
#
# 神器の装備解除時の処理のエイリアス
#
# @within asset_manager:artifact/triggers/dis_equip/dis_equip.m

# 元の登録処理を呼び出す
function asset:artifact/example/dis_equip/
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:artifact/alias/65535/equip
#
# 神器の装備時の処理のエイリアス
#
# @within asset_manager:artifact/triggers/equip/equip.m

# 元の登録処理を呼び出す
function asset:artifact/example/equip/
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:artifact/alias/65535/register
#
# 神器のデータ指定処理のエイリアス
#
# @within asset_manager:artifact/triggers/register.m

# 元の登録処理を呼び出す
function asset:artifact/example/register

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 7ab0410

Please sign in to comment.