Skip to content

Commit dcbd3a9

Browse files
authored
Merge branch '1-21-1-dev' into feature/skill-trigger-delete
2 parents 5fabe19 + e65f406 commit dcbd3a9

17 files changed

+247
-48
lines changed

.github/ISSUE_TEMPLATE/feature_request.yml

-5
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ body:
6363
3.
6464
value : |
6565
<!-- 知らない人から見てもわかりやすく、簡潔に。短すぎず長すぎず -->
66-
## タスクの内容
6766
1.
6867
2.
6968
3.
@@ -80,7 +79,6 @@ body:
8079
8180
value : |
8281
<!-- draw.ioなどのタスクの参考となる情報を記載してください。(オプション) -->
83-
## 参考情報
8482
8583
validations:
8684
required: false
@@ -92,11 +90,8 @@ body:
9290
description: |
9391
なぜこの重要度にしたのかを詳細記載してください。【⚠️ 重要度 高い 以上向け それ以外の場合はこの項目は**削除**されます】
9492
placeholder : |
95-
## 何故この重要度なのか
9693
1.
9794
2.
9895
3.
99-
value: |
100-
## 何故この重要度なのか
10196
validations:
10297
required: false

.github/workflows/sync-feature-priority.yml

+58-43
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ on:
44
issues:
55
types: [opened, edited]
66

7-
env:
8-
PRIORITY: ""
9-
107
jobs:
118
set_env_priority:
129
runs-on: ubuntu-latest
@@ -56,64 +53,82 @@ jobs:
5653
labels: [label]
5754
});
5855
}
59-
- name: Check issue priority and clean body
60-
if: ${{ needs.set_env_priority.outputs.PRIORITY.includes('高い') }}
61-
uses: actions/github-script@v6
56+
57+
check-field:
58+
runs-on: ubuntu-latest
59+
needs: set_env_priority
60+
env:
61+
PRIORITY: ${{ needs.set_env_priority.outputs.PRIORITY }}
62+
steps:
63+
- name: Extract Issue Form Data
64+
id: form
65+
uses: actions-ecosystem/action-get-issue-form-parameters@v1
6266
with:
63-
script: |
64-
const issue = context.payload.issue;
65-
const issueNumber = issue.number;
66-
const issueBody = issue.body;
67-
// 特定のセクションを削除
68-
const newBody = issueBody.replace(/###\s*なぜ優先度が高いのか[\s\S]*?(?=###|$)/g, '').trim();
69-
70-
await github.rest.issues.update({
71-
owner: context.repo.owner,
72-
repo: context.repo.repo,
73-
issue_number: issueNumber,
74-
body: newBody
75-
});
67+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7668

77-
- name: Check if Field is Empty or Default Text
78-
id: check_field
69+
- name: Get Field Content
70+
id: get_field
7971
run: |
80-
# フィールドのデータを取得
81-
FIELD_CONTENT=$(echo '${{ fromJSON(steps.form.outputs.data)["task-reasons-for-high-priority"] }}')
72+
echo "FIELD_CONTENT<<EOF" >> $GITHUB_ENV
73+
echo "${{ steps.form.outputs['task-reasons-for-high-priority'] }}" >> $GITHUB_ENV
74+
echo "EOF" >> $GITHUB_ENV
8275
76+
- name: Check if Field is Empty, Default Text, or No Response
77+
id: check_field
78+
run: |
79+
# フィールドの内容を取得
80+
FIELD_CONTENT="${FIELD_CONTENT}"
8381
# フィールドが存在しない場合は未記入とみなす
8482
if [ -z "$FIELD_CONTENT" ]; then
8583
echo "field_empty=true" >> $GITHUB_OUTPUT
8684
else
87-
# フィールドの内容からスペース、タブ、改行を削除
88-
TRIMMED_CONTENT=$(echo "$FIELD_CONTENT" | tr -d ' \t\n\r')
89-
90-
# 比較対象のデフォルトテキストからスペース、タブ、改行を削除
91-
DEFAULT_TEXT="##何故この重要度なのか"
92-
93-
if [ -z "$TRIMMED_CONTENT" ] || [ "$TRIMMED_CONTENT" = "$DEFAULT_TEXT" ]; then
85+
# フィールドの内容から全ての空白文字を削除
86+
TRIMMED_CONTENT=$(echo "$FIELD_CONTENT" | tr -d '[:space:]')
87+
# 比較対象のデフォルトテキストと"No response"から全ての空白文字を削除
88+
DEFAULT_TEXT=$(echo "### なぜ優先度が高いのか" | tr -d '[:space:]')
89+
NO_RESPONSE=$(echo "_Noresponse_" | tr -d '[:space:]')
90+
if [ -z "$TRIMMED_CONTENT" ] || [ "$TRIMMED_CONTENT" = "$DEFAULT_TEXT" ] || [ "$TRIMMED_CONTENT" = "$NO_RESPONSE" ]; then
9491
echo "field_empty=true" >> $GITHUB_OUTPUT
9592
else
9693
echo "field_empty=false" >> $GITHUB_OUTPUT
9794
fi
9895
fi
9996
10097
- name: Close Issue if Field is Empty
101-
if: ${{ needs.set_env_priority.outputs.PRIORITY.includes('高い') && ( steps.check_field.outputs.field_empty == 'true' || steps.form.outputs.data == null || fromJSON(steps.form.outputs.data)['task-reasons-for-high-priority'] == '') }}
98+
if: steps.check_field.outputs.field_empty == 'true'
10299
uses: actions/github-script@v6
100+
env:
101+
PRIORITY: ${{ env.PRIORITY }}
103102
with:
104103
script: |
105-
// コメントを追加してIssueをクローズする
106-
await github.rest.issues.createComment({
107-
owner: context.repo.owner,
108-
repo: context.repo.repo,
109-
issue_number: context.issue.number,
110-
body: '優先度が「高い」と選択されていますが、必要な情報が記入されていないため、このIssueはクローズされました。必要な情報を記入して再度作成してください。'
111-
});
112-
113-
await github.rest.issues.update({
104+
const priority = process.env.PRIORITY;
105+
const issue = context.payload.issue;
106+
const issueNumber = issue.number;
107+
if (priority && priority.includes('高い')) {
108+
// コメントを追加してIssueをクローズする
109+
await github.rest.issues.createComment({
110+
owner: context.repo.owner,
111+
repo: context.repo.repo,
112+
issue_number: issueNumber,
113+
body: '優先度が「高い」と選択されていますが、必要な情報が記入されていないため、このIssueはクローズされました。必要な情報を記入して再度作成してください。'
114+
});
115+
116+
await github.rest.issues.update({
117+
owner: context.repo.owner,
118+
repo: context.repo.repo,
119+
issue_number: issueNumber,
120+
state: 'closed',
121+
state_reason: 'not_planned'
122+
});
123+
} else {
124+
const issueBody = issue.body;
125+
// "なぜ優先度が高いのか"のセクションを削除
126+
const newBody = issueBody.replace(/###\s*なぜ優先度が高いのか[\s\S]*?(?=###|$)/g, '').trim();
127+
128+
await github.rest.issues.update({
114129
owner: context.repo.owner,
115130
repo: context.repo.repo,
116131
issue_number: issueNumber,
117-
state: 'closed',
118-
state_reason: 'not_planned'
119-
});
132+
body: newBody
133+
});
134+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#> makeup:skill/trigger/error/delete_to_tusb_memory
2+
tellraw @s {"translate":"TUSBメモリーのスキルは削除できません。","color":"red"}
3+
playsound block.dispenser.fail player @s ~ ~ ~ 1 1.2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#> makeup:skill/trigger/error/mismatched_trigger
2+
tellraw @s [{"translate":"アイテムの種類と発動条件が異なります。","color":"red"},{"text":" "},{"translate":"<<スキル削除>>","bold": true,"color":"white","clickEvent":{"action":"run_command","value":"/trigger ChangeSkill set 10010"}}]
3+
playsound block.dispenser.fail player @s ~ ~ ~ 1 1.2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#> makeup:skill/trigger/error/no_mainhand
2+
tellraw @s {"translate":"メインハンドにアイテムを持っていません。","color":"red"}
3+
playsound block.dispenser.fail player @s ~ ~ ~ 1 1.2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#> makeup:skill/trigger/error/set_to_tusb_memory
2+
tellraw @s {"translate":"TUSBメモリーに職業スキルはセットできません。","color":"red"}
3+
playsound block.dispenser.fail player @s ~ ~ ~ 1 1.2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#> makeup:skill/trigger/set
2+
playsound minecraft:block.respawn_anchor.charge player @a ~ ~ ~ 1 2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#> player:load_equipments
2+
### 装備をストレージに保存
3+
#SelectedItem
4+
data remove storage item: SelectedItem
5+
data modify storage item: SelectedItem set from entity @s SelectedItem
6+
data modify storage item: SelectedItem.Slot set from entity @s SelectedItemSlot
7+
#Equipments 両手+防具
8+
data modify storage item: Equipments set value []
9+
data modify storage item: Equipments append from entity @s SelectedItem
10+
data modify storage item: Equipments append from entity @s Inventory[{Slot:-106b}]
11+
data modify storage item: Equipments append from entity @s Inventory[{Slot:100b}]
12+
data modify storage item: Equipments append from entity @s Inventory[{Slot:101b}]
13+
data modify storage item: Equipments append from entity @s Inventory[{Slot:102b}]
14+
data modify storage item: Equipments append from entity @s Inventory[{Slot:103b}]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#> skill:trigger/set/check_trigger
2+
#スキルをロード
3+
scoreboard players operation _ _ = @s ChangeSkill
4+
function skill:load/job
5+
#剣・斧で攻撃は条件を満たしていれば近接攻撃に切り替え
6+
execute if data storage skill: Skill{Trigger:"剣・斧で攻撃"} if predicate skill:trigger/weapon/mainhand run data modify storage skill: Skill.Trigger set value "近接攻撃する"
7+
execute if data storage skill: Skill{Trigger:"人参棒を使用"} run data modify storage skill: Skill.Trigger set value "手に持って右クリック"
8+
#付与可能かチェック
9+
scoreboard players set _ _ 0
10+
execute if data storage skill: Skill{Trigger:"弓を構えて矢を撃つ"} if data storage item: Item{id:"minecraft:bow"} run scoreboard players set _ _ 1
11+
execute if data storage skill: Skill{Trigger:"クロスボウを構えて矢を撃つ"} if data storage item: Item{id:"minecraft:crossbow"} run scoreboard players set _ _ 1
12+
execute if data storage skill: Skill{Trigger:"手に持って右クリック"} if data storage item: Item{id:"minecraft:carrot_on_a_stick"} run scoreboard players set _ _ 1
13+
execute if data storage skill: Skill{Trigger:"盾で攻撃を防ぐ"} if data storage item: Item{id:"minecraft:shield"} run scoreboard players set _ _ 1
14+
execute if data storage skill: Skill{Trigger:"剣を持った状態でスニーク解除"} if predicate skill:trigger/sword run scoreboard players set _ _ 1
15+
execute if data storage skill: Skill{Trigger:"近接攻撃する"} run scoreboard players set _ _ 1
16+
#実行
17+
execute if score _ _ matches 1 run function skill:trigger/set/set
18+
execute if score _ _ matches 0 run function makeup:skill/trigger/error/mismatched_trigger
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#> skill:trigger/set/check_type
2+
#メインハンドをストレージに保存
3+
data remove storage item: Item
4+
data modify storage item: Item set from entity @s SelectedItem
5+
#TUSBメモリー以外のアイテムかチェック
6+
execute unless data storage item: Item run function makeup:skill/trigger/error/no_mainhand
7+
execute if data storage item: Item.components."minecraft:custom_data".Skill{Type:"TUSBMemory"} run function makeup:skill/trigger/error/set_to_tusb_memory
8+
execute if data storage item: Item unless data storage item: Item.components."minecraft:custom_data".Skill{Type:"TUSBMemory"} in area:control_area run function skill:trigger/set/check_trigger
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#> skill:trigger/set/damage_json
2+
data modify storage skill: DamageJson.NewLine set value '[{"storage":"skill:","nbt":"NewLine","interpret":true}]'
3+
execute if data storage skill: Skill.Damage.Physical run data modify storage skill: DamageJson.Physical set value '[{"text":""},{"text":"p","font":"icon","color":"white"},{"storage":"skill:","nbt":"Skill.Damage.Physical","color":"white"}]'
4+
execute if data storage skill: Skill.Damage.Fire run data modify storage skill: DamageJson.Fire set value '[{"text":""},{"text":"f","font":"icon","color":"red"},{"storage":"skill:","nbt":"Skill.Damage.Fire","color":"red"}]'
5+
execute if data storage skill: Skill.Damage.Ice run data modify storage skill: DamageJson.Ice set value '[{"text":""},{"text":"c","font":"icon","color":"aqua"},{"storage":"skill:","nbt":"Skill.Damage.Ice","color":"aqua"}]'
6+
execute if data storage skill: Skill.Damage.Lightning run data modify storage skill: DamageJson.Lightning set value '[{"text":""},{"text":"n","font":"icon","color":"gold"},{"storage":"skill:","nbt":"Skill.Damage.Lightning","color":"gold"}]'
7+
execute if data storage skill: Skill.Damage.Light run data modify storage skill: DamageJson.Light set value '[{"text":""},{"text":"l","font":"icon","color":"yellow"},{"storage":"skill:","nbt":"Skill.Damage.Light","color":"yellow"}]'
8+
execute if data storage skill: Skill.Damage.Dark run data modify storage skill: DamageJson.Dark set value '[{"text":""},{"text":"d","font":"icon","color":"light_purple"},{"storage":"skill:","nbt":"Skill.Damage.Dark","color":"light_purple"}]'
9+
data modify storage skill: DamageJson.Damage set value '[{"text":"✦ ","color":"light_purple"},{"translate":"ダメージ: ","color":"white"},{"storage":"skill:","nbt":"DamageJson.Physical","interpret":true},{"storage":"skill:","nbt":"DamageJson.Fire","interpret":true},{"storage":"skill:","nbt":"DamageJson.Ice","interpret":true},{"storage":"skill:","nbt":"DamageJson.Lightning","interpret":true},{"storage":"skill:","nbt":"DamageJson.Light","interpret":true},{"storage":"skill:","nbt":"DamageJson.Dark","interpret":true}]'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#> skill:trigger/set/remove_lore
2+
#LoreCount回だけ末尾のLore削除
3+
data remove storage item: Item.components."minecraft:lore"[-1]
4+
execute store result storage item: Item.components."minecraft:custom_data".Skill.LoreCount int 0.99999 run data get storage item: Item.components."minecraft:custom_data".Skill.LoreCount
5+
execute unless data storage item: Item.components."minecraft:custom_data".Skill{LoreCount:0} run function skill:trigger/set/remove_lore
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#> skill:trigger/set/set
2+
#以前のスキルLoreを削除
3+
execute if data storage item: Item.components."minecraft:custom_data".Skill{Type:"Job"} run function skill:trigger/set/remove_lore
4+
#スキル名
5+
#custom_nameへ上書きする
6+
#item_nameがある場合は、 item_name | スキル名 になる。
7+
data modify block 2 3 2 front_text.messages[0] set value '[{"text":"","color":"white","italic":false},{"storage":"item:","nbt":"Item.components.\\"minecraft:item_name\\"","interpret":true}," | ",{"storage":"skill:","nbt":"Skill.Icon","font":"icon","color":"green"},{"text":" "},{"storage":"skill:","nbt":"Skill.Skill"}]'
8+
data modify block 2 3 2 front_text.messages[1] set value '[{"text":"","color":"white","italic":false},{"storage":"skill:","nbt":"Skill.Icon","font":"icon","color":"green"},{"text":" "},{"storage":"skill:","nbt":"Skill.Skill"}]'
9+
execute if data storage item: Item.components."minecraft:item_name" run data modify storage item: Item.components."minecraft:custom_name" set from block 2 3 2 front_text.messages[0]
10+
execute unless data storage item: Item.components."minecraft:item_name" run data modify storage item: Item.components."minecraft:custom_name" set from block 2 3 2 front_text.messages[1]
11+
#Loreセット
12+
#item_nameがあればスキル名をLoreに入れる
13+
# なければ追加しないため、LoreCount - 1
14+
execute if data storage item: Item.components."minecraft:item_name" run data modify storage item: Item.components."minecraft:lore" append from block 2 3 2 front_text.messages[1]
15+
execute unless data storage item: Item.components."minecraft:item_name" run execute store result storage skill: Skill.LoreCount int 0.99999 run data get storage skill: Skill.LoreCount
16+
#説明
17+
data modify storage item: Item.components."minecraft:lore" append from storage skill: Skill.Lore[]
18+
#発動条件
19+
data modify block 2 3 2 front_text.messages[0] set value '[{"text":"","color":"white","italic":false},{"text":"K","font":"icon","color":"gold"},{"translate":" 発動条件: "},{"storage":"skill:","nbt":"Skill.Trigger"}]'
20+
data modify storage item: Item.components."minecraft:lore" append from block 2 3 2 front_text.messages[0]
21+
#消費MP
22+
data modify block 2 3 2 front_text.messages[0] set value '[{"text":"","color":"white","italic":false},{"text":"M","font":"icon","color":"aqua"},{"translate":" 消費MP: "},{"storage":"skill:","nbt":"Skill.MP"}]'
23+
data modify storage item: Item.components."minecraft:lore" append from block 2 3 2 front_text.messages[0]
24+
#ダメージ
25+
data remove storage skill: DamageJson
26+
execute if data storage skill: Skill.Damage run function skill:trigger/set/damage_json
27+
execute if data storage skill: Skill.Damage run data modify block 2 3 2 front_text.messages[0] set value '{"storage":"skill:","nbt":"DamageJson.Damage","italic":false,"interpret":true}'
28+
execute if data storage skill: Skill.Damage run data modify storage item: Item.components."minecraft:lore" append from block 2 3 2 front_text.messages[0]
29+
#インターバルチェック
30+
data modify storage skill: Skill.ShowInterval set value 1b
31+
#不要なNBT削除
32+
data remove storage skill: Skill.Lore
33+
data remove storage skill: Skill.ClickEvent
34+
#スキル付与
35+
data modify storage item: Item.components."minecraft:custom_data".Skill set from storage skill: Skill
36+
data modify storage item: Item.components."minecraft:custom_data".Skill.Type set value "Job"
37+
#プレイヤーのアイテム更新
38+
data modify block 2 2 2 Items set value []
39+
data modify block 2 2 2 Items append from storage item: Item
40+
item replace entity @s weapon.mainhand from block 2 2 2 container.0
41+
#演出
42+
function makeup:skill/trigger/set
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"condition": "minecraft:entity_properties",
3+
"entity": "this",
4+
"predicate": {
5+
"equipment": {
6+
"mainhand": {
7+
"items": [
8+
"minecraft:wooden_sword",
9+
"minecraft:stone_sword",
10+
"minecraft:golden_sword",
11+
"minecraft:iron_sword",
12+
"minecraft:diamond_sword",
13+
"minecraft:netherite_sword"
14+
]
15+
}
16+
}
17+
}
18+
}
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"condition": "any_of",
3+
"terms": [
4+
{
5+
"condition": "reference",
6+
"name": "skill:trigger/weapon/mainhand"
7+
},
8+
{
9+
"condition": "reference",
10+
"name": "skill:trigger/weapon/offhand"
11+
}
12+
]
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"condition": "minecraft:entity_properties",
3+
"entity": "this",
4+
"predicate": {
5+
"equipment": {
6+
"mainhand": {
7+
"items": [
8+
"minecraft:wooden_sword",
9+
"minecraft:stone_sword",
10+
"minecraft:golden_sword",
11+
"minecraft:iron_sword",
12+
"minecraft:diamond_sword",
13+
"minecraft:netherite_sword",
14+
"minecraft:wooden_axe",
15+
"minecraft:stone_axe",
16+
"minecraft:golden_axe",
17+
"minecraft:iron_axe",
18+
"minecraft:diamond_axe",
19+
"minecraft:netherite_axe"
20+
]
21+
}
22+
}
23+
}
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"condition": "minecraft:entity_properties",
3+
"entity": "this",
4+
"predicate": {
5+
"equipment": {
6+
"offhand": {
7+
"items": [
8+
"minecraft:wooden_sword",
9+
"minecraft:stone_sword",
10+
"minecraft:golden_sword",
11+
"minecraft:iron_sword",
12+
"minecraft:diamond_sword",
13+
"minecraft:netherite_sword",
14+
"minecraft:wooden_axe",
15+
"minecraft:stone_axe",
16+
"minecraft:golden_axe",
17+
"minecraft:iron_axe",
18+
"minecraft:diamond_axe",
19+
"minecraft:netherite_axe"
20+
]
21+
}
22+
}
23+
}
24+
}

0 commit comments

Comments
 (0)