Skip to content

Commit

Permalink
GH-548 Add スキル削除
Browse files Browse the repository at this point in the history
  • Loading branch information
NePonpon committed Dec 5, 2024
1 parent d860d40 commit 0cae21c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
20 changes: 20 additions & 0 deletions data/skill/function/trigger/delete/delete.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#> skill:trigger/delete/delete
#
# 手に持っているアイテムのスキル情報を削除する
#
# @within function skill:trigger/delete/detection

# Lore削除
function skill:trigger/set/remove_lore
execute unless data storage item: Item.tag.UniqueName run data remove storage item: Item.tag.display.Name
data remove storage item: Item.tag.UniqueName
data remove storage item: Item.tag.Skill

# メインハンドの情報
execute in area:control_area run data modify block 2 2 2 Items set value []
execute in area:control_area run data modify block 2 2 2 Items append from storage item: Item
execute in area:control_area run item replace entity @s weapon.mainhand from block 2 2 2 container.0

# 演出
tellraw @s {"translate":"スキルを削除しました。"}
function makeup:skill/shortcut/sound
9 changes: 9 additions & 0 deletions data/skill/function/trigger/delete/detection.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# @within function skill:trigger/

# メインハンドのアイテム情報取得
data remove storage item: Item
data modify storage item: Item set from entity @s SelectedItem

# TUSBメモリーかどうかで分岐
execute if data storage item: Item{tag:{Skill:{Type:"TUSBMemory"}}} run function makeup:skill/trigger/error/delete_to_tusb_memory
execute unless data storage item: Item{tag:{Skill:{Type:"TUSBMemory"}}} run function skill:trigger/delete/delete

0 comments on commit 0cae21c

Please sign in to comment.