From ecfae4a099cd4fda897301123aa0dcadcdb6bee6 Mon Sep 17 00:00:00 2001 From: Ponpon Date: Fri, 17 Jan 2025 10:12:09 +0900 Subject: [PATCH] =?UTF-8?q?NO-ISSUE=20Add=20=E3=83=A2=E3=83=96=E3=81=B8?= =?UTF-8?q?=E3=81=AE=E6=94=BB=E6=92=83=E6=99=82=E5=87=A6=E7=90=86=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../advancement/trigger/hurt_entity.json | 287 ++++++++++++++++++ .../function/trigger/hurt_entity/.mcfunction | 20 ++ .../hurt_entity/hit_projectile.mcfunction | 20 ++ .../hurt_entity/melee_attack.mcfunction | 39 +++ .../hurt_entity/melee_bow_attack.mcfunction | 5 + .../hurt_entity/sword_attack_sweep.mcfunction | 6 + 6 files changed, 377 insertions(+) create mode 100644 data/player/advancement/trigger/hurt_entity.json create mode 100644 data/player/function/trigger/hurt_entity/.mcfunction create mode 100644 data/player/function/trigger/hurt_entity/hit_projectile.mcfunction create mode 100644 data/player/function/trigger/hurt_entity/melee_attack.mcfunction create mode 100644 data/player/function/trigger/hurt_entity/melee_bow_attack.mcfunction create mode 100644 data/player/function/trigger/hurt_entity/sword_attack_sweep.mcfunction diff --git a/data/player/advancement/trigger/hurt_entity.json b/data/player/advancement/trigger/hurt_entity.json new file mode 100644 index 0000000000..d9dcacd5c3 --- /dev/null +++ b/data/player/advancement/trigger/hurt_entity.json @@ -0,0 +1,287 @@ +{ + "criteria": { + "hit_projectile": { + "trigger": "minecraft:player_hurt_entity", + "conditions": { + "damage": { + "type": { + "tags": [ + { + "id": "minecraft:is_projectile", + "expected": true + } + ] + } + } + } + }, + "melee_attack": { + "trigger": "minecraft:player_hurt_entity", + "conditions": { + "player": [ + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "mainhand": { + "items": "#item:bows" + } + } + } + } + } + ], + "damage": { + "dealt": { + "min": 2 + }, + "type": { + "tags": [ + { + "id": "minecraft:is_explosion", + "expected": false + }, + { + "id": "minecraft:is_fire", + "expected": false + }, + { + "id": "minecraft:is_projectile", + "expected": false + }, + { + "id": "minecraft:bypasses_armor", + "expected": false + }, + { + "id": "minecraft:bypasses_effects", + "expected": false + }, + { + "id": "minecraft:bypasses_enchantments", + "expected": false + }, + { + "id": "minecraft:bypasses_resistance", + "expected": false + }, + { + "id": "player:thorns", + "expected": false + } + ] + } + } + } + }, + "melee_attack2": { + "trigger": "minecraft:player_hurt_entity", + "conditions": { + "player": [ + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:any_of", + "terms": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "mainhand": { + "items": "#item:bows" + } + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "mainhand": { + "items": "#item:swords" + } + } + } + } + ] + } + } + ], + "damage": { + "dealt": { + "max": 1 + }, + "type": { + "tags": [ + { + "id": "minecraft:is_explosion", + "expected": false + }, + { + "id": "minecraft:is_fire", + "expected": false + }, + { + "id": "minecraft:is_projectile", + "expected": false + }, + { + "id": "minecraft:bypasses_armor", + "expected": false + }, + { + "id": "minecraft:bypasses_effects", + "expected": false + }, + { + "id": "minecraft:bypasses_enchantments", + "expected": false + }, + { + "id": "minecraft:bypasses_resistance", + "expected": false + }, + { + "id": "player:thorns", + "expected": false + } + ] + } + } + } + }, + "melee_bow_attack": { + "trigger": "minecraft:player_hurt_entity", + "conditions": { + "player": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "mainhand": { + "items": "#item:bows" + } + } + } + } + ], + "damage": { + "dealt": { + "min": 2 + }, + "type": { + "tags": [ + { + "id": "minecraft:is_explosion", + "expected": false + }, + { + "id": "minecraft:is_fire", + "expected": false + }, + { + "id": "minecraft:is_projectile", + "expected": false + }, + { + "id": "minecraft:bypasses_armor", + "expected": false + }, + { + "id": "minecraft:bypasses_effects", + "expected": false + }, + { + "id": "minecraft:bypasses_enchantments", + "expected": false + }, + { + "id": "minecraft:bypasses_resistance", + "expected": false + }, + { + "id": "player:thorns", + "expected": false + } + ] + } + } + } + }, + "sword_attack_sweep": { + "trigger": "minecraft:player_hurt_entity", + "conditions": { + "player": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "mainhand": { + "items": "#item:swords" + } + } + } + } + ], + "damage": { + "dealt": 1, + "type": { + "tags": [ + { + "id": "minecraft:is_explosion", + "expected": false + }, + { + "id": "minecraft:is_fire", + "expected": false + }, + { + "id": "minecraft:is_projectile", + "expected": false + }, + { + "id": "minecraft:bypasses_armor", + "expected": false + }, + { + "id": "minecraft:bypasses_effects", + "expected": false + }, + { + "id": "minecraft:bypasses_enchantments", + "expected": false + }, + { + "id": "minecraft:bypasses_resistance", + "expected": false + }, + { + "id": "player:thorns", + "expected": false + } + ] + } + } + } + } + }, + "requirements": [ + [ + "hit_projectile", + "melee_attack", + "melee_attack2", + "melee_bow_attack", + "sword_attack_sweep" + ] + ], + "rewards": { + "function": "player:trigger/hurt_entity/" + } +} diff --git a/data/player/function/trigger/hurt_entity/.mcfunction b/data/player/function/trigger/hurt_entity/.mcfunction new file mode 100644 index 0000000000..6bd097e4bd --- /dev/null +++ b/data/player/function/trigger/hurt_entity/.mcfunction @@ -0,0 +1,20 @@ +#> player:trigger/hurt_entity/ +### モブへのダメージトリガー + +#モブの位置をマーク +execute at @e[tag=Enemy,nbt=!{AbsorptionAmount:2048f}] run function calc:geometry/tp_00002 +#分岐 +execute if entity @s[advancements={player:trigger/hurt_entity={hit_projectile=true}}] run function player:trigger/hurt_entity/hit_projectile +execute if entity @s[advancements={player:trigger/hurt_entity={melee_attack=true}}] run function player:trigger/hurt_entity/melee_attack +execute if entity @s[advancements={player:trigger/hurt_entity={melee_attack2=true}}] run function player:trigger/hurt_entity/melee_attack +execute if entity @s[advancements={player:trigger/hurt_entity={melee_bow_attack=true}}] run function player:trigger/hurt_entity/melee_bow_attack +execute if entity @s[advancements={player:trigger/hurt_entity={sword_attack_sweep=true}}] run function player:trigger/hurt_entity/sword_attack_sweep + +##AbsorptionAmountリセット +execute at 0-0-0-0-2 as @e[tag=Enemy,nbt=!{AbsorptionAmount:2048f},distance=0] run function enemy:damage/update_health + +#トリガーリセット +advancement revoke @s only player:trigger/hurt_entity + +#マーカー返却 +execute as 0-0-0-0-2 run function calc:geometry/return_marker diff --git a/data/player/function/trigger/hurt_entity/hit_projectile.mcfunction b/data/player/function/trigger/hurt_entity/hit_projectile.mcfunction new file mode 100644 index 0000000000..5f82e2d826 --- /dev/null +++ b/data/player/function/trigger/hurt_entity/hit_projectile.mcfunction @@ -0,0 +1,20 @@ +#> player:trigger/hurt_entity/hit_projectile +### 投射物による攻撃 + +#投射物からロード +execute at 0-0-0-0-2 as @e[type=#entity:projectiles,limit=1,sort=nearest] run function player:trigger/projectile/load + +#物理・属性ダメージ付与 +data modify storage skill: Damage set value {Hit:1b} +execute at 0-0-0-0-2 as @e[tag=Enemy,nbt=!{AbsorptionAmount:2048f},distance=0] run function skill:damage/apply/ + +### エンチャント +#波動 +execute if data storage item: SelectedItem.components."minecraft:enchantments".levels."tusb:波動" at 0-0-0-0-2 run function skill:enchant/wave_of_element/ +#血吸 +execute if data storage item: SelectedItem.components."minecraft:enchantments".levels."tusb:血吸" run function skill:enchant/life_leech +#魔吸 +execute if data storage item: SelectedItem.components."minecraft:enchantments".levels."tusb:魔吸" run function skill:enchant/mana_leech + +#狩人バースト用フラグ +tag @s add BurstArrow diff --git a/data/player/function/trigger/hurt_entity/melee_attack.mcfunction b/data/player/function/trigger/hurt_entity/melee_attack.mcfunction new file mode 100644 index 0000000000..d09c26fd78 --- /dev/null +++ b/data/player/function/trigger/hurt_entity/melee_attack.mcfunction @@ -0,0 +1,39 @@ +#> player:trigger/hurt_entity/melee_attack +### 近接攻撃 + +#装備を取得 +function player:load_equipments +#物理ダメージ取得 +function skill:damage/add/physical/melee +### 黒魔導士<ライトニングブロー> +execute if score @s LightningBlow matches 1.. run function skill:act/black_mage/lightning_blow/hit + +#スキル用装備リスト +function skill:equipments_to_items +data remove storage item: Item +data modify storage item: Item set from storage item: Items[{components:{"minecraft:custom_data":{Skill:{Trigger:"近接攻撃する"}}}}] + +### 忍者<連舞> +execute if score @s TsuremaiLevel matches 1.. run function skill:act/ninja/tsuremai/trigger/attack + +#属性ダメージ付与 +execute unless data storage item: Item.components."minecraft:custom_data".Skill.Damage{Melee:1b} run data modify storage skill: Damage set value {Hit:1b} +execute unless data storage item: Item.components."minecraft:custom_data".Skill.Damage{Melee:1b} at 0-0-0-0-2 as @e[tag=Enemy,nbt=!{AbsorptionAmount:2048f},distance=0] run function skill:damage/apply/elemental + +### エンチャント +#波動 +execute if data storage item: SelectedItem.components."minecraft:enchantments".levels."tusb:波動" at 0-0-0-0-2 run function skill:enchant/wave_of_element/ +#血吸 +execute if data storage item: SelectedItem.components."minecraft:enchantments".levels."tusb:血吸" run function skill:enchant/life_leech +#魔吸 +execute if data storage item: SelectedItem.components."minecraft:enchantments".levels."tusb:魔吸" run function skill:enchant/mana_leech + +### スキル +execute if data storage item: Item.components."minecraft:custom_data".Skill{Trigger:"近接攻撃する"} run function skill:practice/ + +#近接スキルの場合、物理ダメージはスキル側で計算するため0にする +execute if data storage item: Item.components."minecraft:custom_data".Skill.Damage{Melee:1b} at 0-0-0-0-2 run data modify entity @e[tag=Enemy,nbt=!{AbsorptionAmount:2048f},distance=0,limit=1] AbsorptionAmount set value 2048f + +### 剣の薙ぎ払いの初期設定 +#剣能 +execute if data storage item: SelectedItem.components."minecraft:enchantments".levels."tusb:剣能" run function skill:enchant/sweeping/init diff --git a/data/player/function/trigger/hurt_entity/melee_bow_attack.mcfunction b/data/player/function/trigger/hurt_entity/melee_bow_attack.mcfunction new file mode 100644 index 0000000000..79c3f33852 --- /dev/null +++ b/data/player/function/trigger/hurt_entity/melee_bow_attack.mcfunction @@ -0,0 +1,5 @@ +#> player:trigger/hurt_entity/melee_bow_attack +### 弓による近接攻撃 + +#ダメージを1にする +execute at 0-0-0-0-2 run data modify entity @e[tag=Enemy,nbt=!{AbsorptionAmount:2048f},distance=0,limit=1] AbsorptionAmount set value 2047f diff --git a/data/player/function/trigger/hurt_entity/sword_attack_sweep.mcfunction b/data/player/function/trigger/hurt_entity/sword_attack_sweep.mcfunction new file mode 100644 index 0000000000..c27f90605a --- /dev/null +++ b/data/player/function/trigger/hurt_entity/sword_attack_sweep.mcfunction @@ -0,0 +1,6 @@ +#> player:trigger/hurt_entity/sword_attack_sweep +### 剣の薙ぎ払い攻撃 + +### エンチャント +#剣能 +execute if data storage item: SelectedItem.components."minecraft:enchantments".levels."tusb:剣能" run function skill:enchant/sweeping/apply