Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

スキル削除機能を追加 #549

Merged
merged 8 commits into from
Dec 9, 2024
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#> makeup:skill/trigger/error/mismatched_trigger
tellraw @s [{"translate":"アイテムの種類と発動条件が異なります。","color":"red"},{"text":" "},{"translate":"<<スキル削除>>","bold": true,"color":"white","clickEvent":{"action":"run_command","value":"/trigger ChangeSkill set 10010"}}]
tellraw @s [{"translate":"アイテムの種類と発動条件が異なります。","color":"red"}]
playsound block.dispenser.fail player @s ~ ~ ~ 1 1.2
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
data remove storage item: Item.components."minecraft:custom_name"
data remove storage item: Item.components."minecraft:custom_data".UniqueName
data remove storage item: Item.components."minecraft:custom_data".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
10 changes: 10 additions & 0 deletions data/skill/function/trigger/delete/detection.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#> skill:trigger/delete/detection
# @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{components:{"minecraft:custom_data":{Skill:{Type:"TUSBMemory"}}}} run function makeup:skill/trigger/error/delete_to_tusb_memory
execute unless data storage item: Item{components:{"minecraft:custom_data":{Skill:{Type:"TUSBMemory"}}}} run function skill:trigger/delete/delete
2 changes: 1 addition & 1 deletion data/skill/function/trigger/tellraw/init.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ execute if score @s ChangeSkill matches 8000 run function skill:trigger/tellraw/
execute if score @s ChangeSkill matches 9000 run function skill:trigger/tellraw/job/common
#職業一覧
# data modify block 2 3 2 front_text.messages[0] set value '[{"text":"< "},{"text":"K","font":"icon","color":"aqua","clickEvent":{"action":"run_command","value":"/trigger ChangeSkill set 1000"},"hoverEvent":{"action":"show_text","contents":[{"translate":"剣士"}]}},{"text":" > < "},{"text":"N","font":"icon","color":"aqua","clickEvent":{"action":"run_command","value":"/trigger ChangeSkill set 2000"},"hoverEvent":{"action":"show_text","contents":[{"translate":"忍者"}]}},{"text":" > < "},{"text":"H","font":"icon","color":"aqua","clickEvent":{"action":"run_command","value":"/trigger ChangeSkill set 3000"},"hoverEvent":{"action":"show_text","contents":[{"translate":"狩人"}]}},{"text":" > < "},{"text":"W","font":"icon","color":"aqua","clickEvent":{"action":"run_command","value":"/trigger ChangeSkill set 4000"},"hoverEvent":{"action":"show_text","contents":[{"translate":"白魔導士"}]}},{"text":" > < "},{"text":"B","font":"icon","color":"aqua","clickEvent":{"action":"run_command","value":"/trigger ChangeSkill set 5000"},"hoverEvent":{"action":"show_text","contents":[{"translate":"黒魔導士"}]}},{"text":" > < "},{"text":"S","font":"icon","color":"aqua","clickEvent":{"action":"run_command","value":"/trigger ChangeSkill set 6000"},"hoverEvent":{"action":"show_text","contents":[{"translate":"召喚士"}]}},{"text":" > < "},{"text":"P","font":"icon","color":"aqua","clickEvent":{"action":"run_command","value":"/trigger ChangeSkill set 7000"},"hoverEvent":{"action":"show_text","contents":[{"translate":"絡繰士"}]}},{"text":" > < "},{"text":"T","font":"icon","color":"aqua","clickEvent":{"action":"run_command","value":"/trigger ChangeSkill set 8000"},"hoverEvent":{"action":"show_text","contents":[{"translate":"怪盗"}]}},{"text":" > < "},{"text":"C","font":"icon","color":"aqua","clickEvent":{"action":"run_command","value":"/trigger ChangeSkill set 9000"},"hoverEvent":{"action":"show_text","contents":[{"translate":"共通"}]}},{"text":" > < "},{"text":"✦","color":"light_purple","clickEvent":{"action":"run_command","value":"/trigger ChangeSkill set 10000"},"hoverEvent":{"action":"show_text","contents":[{"translate":"ショートカットを編集","color":"light_purple"}]}},{"text":" >"},{"storage":"skill:","nbt":"NewLine","interpret":true},{"text":"----------------------------------------------------"},{"storage":"skill:","nbt":"NewLine","interpret":true}]'
data modify block 2 3 2 front_text.messages[0] set value '[{"text":"< "},{"text":"K","font":"icon","color":"aqua","clickEvent":{"action":"run_command","value":"/trigger ChangeSkill set 1000"},"hoverEvent":{"action":"show_text","contents":[{"translate":"剣士"}]}},{"text":" > < "},{"text":"N","font":"icon","color":"aqua","clickEvent":{"action":"run_command","value":"/trigger ChangeSkill set 2000"},"hoverEvent":{"action":"show_text","contents":[{"translate":"忍者"}]}},{"text":" > < "},{"text":"H","font":"icon","color":"aqua","clickEvent":{"action":"run_command","value":"/trigger ChangeSkill set 3000"},"hoverEvent":{"action":"show_text","contents":[{"translate":"狩人"}]}},{"text":" > < "},{"text":"W","font":"icon","color":"aqua","clickEvent":{"action":"run_command","value":"/trigger ChangeSkill set 4000"},"hoverEvent":{"action":"show_text","contents":[{"translate":"白魔導士"}]}},{"text":" > < "},{"text":"B","font":"icon","color":"aqua","clickEvent":{"action":"run_command","value":"/trigger ChangeSkill set 5000"},"hoverEvent":{"action":"show_text","contents":[{"translate":"黒魔導士"}]}},{"text":" > < "},{"text":"S","font":"icon","color":"aqua","clickEvent":{"action":"run_command","value":"/trigger ChangeSkill set 6000"},"hoverEvent":{"action":"show_text","contents":[{"translate":"召喚士"}]}},{"text":" > < "},{"text":"P","font":"icon","color":"dark_gray","strikethrough":true,"hoverEvent":{"action":"show_text","contents":[{"translate":"絡繰士"}]}},{"text":" > < "},{"text":"T","font":"icon","color":"dark_gray","strikethrough":true,"hoverEvent":{"action":"show_text","contents":[{"translate":"怪盗"}]}},{"text":" > < "},{"text":"C","font":"icon","color":"aqua","clickEvent":{"action":"run_command","value":"/trigger ChangeSkill set 9000"},"hoverEvent":{"action":"show_text","contents":[{"translate":"共通"}]}},{"text":" > < "},{"text":"✦","color":"light_purple","clickEvent":{"action":"run_command","value":"/trigger ChangeSkill set 10000"},"hoverEvent":{"action":"show_text","contents":[{"translate":"ショートカットを編集","color":"light_purple"}]}},{"text":" >"},{"storage":"skill:","nbt":"NewLine","interpret":true},{"text":"----------------------------------------------------"},{"storage":"skill:","nbt":"NewLine","interpret":true}]'
data modify block 2 3 2 front_text.messages[0] set value '[{"text":"< "},{"text":"K","font":"icon","color":"aqua","clickEvent":{"action":"run_command","value":"/trigger ChangeSkill set 1000"},"hoverEvent":{"action":"show_text","contents":[{"translate":"剣士"}]}},{"text":" > < "},{"text":"N","font":"icon","color":"aqua","clickEvent":{"action":"run_command","value":"/trigger ChangeSkill set 2000"},"hoverEvent":{"action":"show_text","contents":[{"translate":"忍者"}]}},{"text":" > < "},{"text":"H","font":"icon","color":"aqua","clickEvent":{"action":"run_command","value":"/trigger ChangeSkill set 3000"},"hoverEvent":{"action":"show_text","contents":[{"translate":"狩人"}]}},{"text":" > < "},{"text":"W","font":"icon","color":"aqua","clickEvent":{"action":"run_command","value":"/trigger ChangeSkill set 4000"},"hoverEvent":{"action":"show_text","contents":[{"translate":"白魔導士"}]}},{"text":" > < "},{"text":"B","font":"icon","color":"aqua","clickEvent":{"action":"run_command","value":"/trigger ChangeSkill set 5000"},"hoverEvent":{"action":"show_text","contents":[{"translate":"黒魔導士"}]}},{"text":" > < "},{"text":"S","font":"icon","color":"aqua","clickEvent":{"action":"run_command","value":"/trigger ChangeSkill set 6000"},"hoverEvent":{"action":"show_text","contents":[{"translate":"召喚士"}]}},{"text":" > < "},{"text":"P","font":"icon","color":"dark_gray","strikethrough":true,"hoverEvent":{"action":"show_text","contents":[{"translate":"絡繰士"}]}},{"text":" > < "},{"text":"T","font":"icon","color":"dark_gray","strikethrough":true,"hoverEvent":{"action":"show_text","contents":[{"translate":"怪盗"}]}},{"text":" > < "},{"text":"C","font":"icon","color":"aqua","clickEvent":{"action":"run_command","value":"/trigger ChangeSkill set 9000"},"hoverEvent":{"action":"show_text","contents":[{"translate":"共通"}]}},{"text":" > < "},{"text":"✦","color":"light_purple","clickEvent":{"action":"run_command","value":"/trigger ChangeSkill set 10000"},"hoverEvent":{"action":"show_text","contents":[{"translate":"ショートカットを編集","color":"light_purple"}]}},{"text":" >"},{"storage":"skill:","nbt":"NewLine","interpret":true},{"text":"--------------------------------------- "},{"translate":"<<スキル削除>>","bold": true,"color":"white","clickEvent":{"action":"run_command","value":"/trigger ChangeSkill set 10010"}},{"storage":"skill:","nbt":"NewLine","interpret":true}]'
#習得しているスキル一覧
function skill:trigger/tellraw/loop
#表示
Expand Down
Loading