Skip to content

Commit

Permalink
🚚 各所のタグ名を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenCMD committed Oct 20, 2024
1 parent 3e1739d commit f0285b8
Show file tree
Hide file tree
Showing 26 changed files with 54 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# プレイヤー特定
execute as @a if score @s UserID = $LatestModifiedUser UserID run tag @s add TargetAttacker
# 神器側で攻撃先を軽量に取得できるようにタグを付与しておく
tag @s add AttackedEntity
tag @s add DamagedEntity
# プレイヤーにイベントを追加する
execute as @a[tag=TargetAttacker] run function oh_my_dat:please
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Attack append value {Type: "api",IsVanilla:false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# @within function api:damage/core/trigger_events/player/

# 神器側で攻撃先を軽量に取得できるようにタグを付与しておく
tag @s add AttackingEntity
tag @s add AttackedEntity
# プレイヤーにイベントを追加する
execute store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Damage[-1].From int 1 run scoreboard players get @s MobUUID
# Mob にもイベントを追加する
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,17 @@
# @within function
# asset_manager:artifact/triggers/
# asset_manager:artifact/triggers/attack/foreach
# api:damage/core/trigger_events/non-player/attack_and_hurt
# api:damage/core/trigger_events/non-player/
# mob_manager:entity_finder/player_hurt_entity/fetch_entity
#declare tag AttackedEntity
#declare tag DamagedEntity

#> 攻撃してきたEntity
# @within function
# asset_manager:artifact/triggers/
# asset_manager:artifact/triggers/damage/foreach
# api:damage/core/trigger_events/player/push_from_attacker
# mob_manager:entity_finder/entity_hurt_player/fetch_entity
#declare tag AttackingEntity
#declare tag AttackedEntity

#> バニラの攻撃を扱う用
# @within function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
data remove storage asset:artifact ArtifactEvents
function asset_manager:artifact/data/current/reset
tag @e[tag=Attacker] remove Attacker
tag @e[type=#lib:living,type=!player,tag=DamagedEntity] remove DamagedEntity
tag @e[type=#lib:living,type=!player,tag=AttackedEntity] remove AttackedEntity
tag @e[type=#lib:living,type=!player,tag=AttackingEntity] remove AttackingEntity
tag @s remove TriggerFlag.ClickCarrot
tag @s remove TriggerFlag.Damage
tag @s remove TriggerFlag.Killed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
data remove storage asset:artifact ArtifactEvents.Attack[-1]
# 攻撃先を取得し、Victim を付与する (null の可能性もある)
execute if data storage asset:context Attack.To store result score $AttackTarget Temporary run data get storage asset:context Attack.To
execute if data storage asset:context Attack.To as @e[type=#lib:living,type=!player,tag=AttackedEntity,distance=..150] if score @s MobUUID = $AttackTarget Temporary run tag @s add Victim
execute if data storage asset:context Attack.To as @e[type=#lib:living,type=!player,tag=DamagedEntity,distance=..150] if score @s MobUUID = $AttackTarget Temporary run tag @s add Victim
scoreboard players reset $AttackTarget Temporary
# 神器側に受け渡し
function #asset:artifact/attack
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
data remove storage asset:artifact ArtifactEvents.Damage[-1]
# 攻撃元を取得し、Attacker を付与する (null の可能性もある)
execute if data storage asset:context Damage.From store result score $AttackedFrom Temporary run data get storage asset:context Damage.From
execute if data storage asset:context Damage.From as @e[type=#lib:living,type=!player,tag=AttackingEntity,distance=..150] if score @s MobUUID = $AttackedFrom Temporary run tag @s add Attacker
execute if data storage asset:context Damage.From as @e[type=#lib:living,type=!player,tag=AttackedEntity,distance=..150] if score @s MobUUID = $AttackedFrom Temporary run tag @s add Attacker
scoreboard players reset $AttackedFrom Temporary
# 神器側に受け渡し
function #asset:artifact/attack
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

#> 攻撃されたPlayer
# @within function mob_manager:entity_finder/entity_hurt_player/**
#declare tag AttackingPlayer
#declare tag DamagedPlayer
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
#declare score_holder $Damage

# 軽量にセレクターを利用する用のtag
tag @s add AttackingEntity
tag @s add AttackedEntity
# ダメージ種別取得
execute if entity @p[tag=AttackingPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={type-melee=true}}] run data modify storage mob_manager:entity_finder DamageType set value "vanilla_melee"
execute if entity @p[tag=AttackingPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={type-projectile=true}}] run data modify storage mob_manager:entity_finder DamageType set value "vanilla_projectile"
execute if entity @p[tag=AttackingPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={type-explosion=true}}] run data modify storage mob_manager:entity_finder DamageType set value "vanilla_explosion"
execute if entity @p[tag=DamagedPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={type-melee=true}}] run data modify storage mob_manager:entity_finder DamageType set value "vanilla_melee"
execute if entity @p[tag=DamagedPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={type-projectile=true}}] run data modify storage mob_manager:entity_finder DamageType set value "vanilla_projectile"
execute if entity @p[tag=DamagedPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={type-explosion=true}}] run data modify storage mob_manager:entity_finder DamageType set value "vanilla_explosion"
# 防御されたかの取得
execute if entity @p[tag=AttackingPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={blocked=true}}] run data modify storage mob_manager:entity_finder Blocked set value true
execute if entity @p[tag=AttackingPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={blocked=false}}] run data modify storage mob_manager:entity_finder Blocked set value false
execute if entity @p[tag=DamagedPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={blocked=true}}] run data modify storage mob_manager:entity_finder Blocked set value true
execute if entity @p[tag=DamagedPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={blocked=false}}] run data modify storage mob_manager:entity_finder Blocked set value false

# ダメージ取得
scoreboard players operation $Damage Temporary = @p[tag=AttackingPlayer] TakenDamage
scoreboard players operation $Damage Temporary = @p[tag=DamagedPlayer] TakenDamage
scoreboard players operation $Damage Temporary *= $10 Const
# ArtifactEvents にデータ追加
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Damage append value {IsVanilla:true}
Expand All @@ -34,11 +34,11 @@
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].MobEvents.Attack append value {IsVanilla:true}
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].MobEvents.Attack[-1].Type set from storage mob_manager:entity_finder DamageType
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].MobEvents.Attack[-1].Blocked set from storage mob_manager:entity_finder Blocked
execute store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].MobEvents.Attack[-1].To int 1 run scoreboard players get @p[tag=AttackingPlayer] UserID
execute store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].MobEvents.Attack[-1].To int 1 run scoreboard players get @p[tag=DamagedPlayer] UserID
execute store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].MobEvents.Attack[-1].Damage double 0.01 run scoreboard players get $Damage Temporary

# リセット
data remove storage mob_manager:entity_finder Blocked
data remove storage mob_manager:entity_finder DamageType
scoreboard players reset @p[tag=AttackingPlayer] TakenDamage
scoreboard players reset @p[tag=DamagedPlayer] TakenDamage
scoreboard players reset $Damage Temporary
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# プレイヤーの OMD 取得
function oh_my_dat:please
# tag付け
tag @s add AttackingPlayer
tag @s add DamagedPlayer
# フィルタ
execute as @e[type=#lib:living,type=!player,distance=..150] run function mob_manager:entity_finder/entity_hurt_player/filters/15
# リセット
tag @s remove AttackingPlayer
tag @s remove DamagedPlayer
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
#
# @within function mob_manager:entity_finder/entity_hurt_player/filters/1

execute if entity @p[tag=AttackingPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={0-0=true}}] if entity @s[tag=FindFlag0.0] run function mob_manager:entity_finder/entity_hurt_player/fetch_entity
execute if entity @p[tag=AttackingPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={0-1=true}}] if entity @s[tag=FindFlag0.1] run function mob_manager:entity_finder/entity_hurt_player/fetch_entity
execute if entity @p[tag=DamagedPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={0-0=true}}] if entity @s[tag=FindFlag0.0] run function mob_manager:entity_finder/entity_hurt_player/fetch_entity
execute if entity @p[tag=DamagedPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={0-1=true}}] if entity @s[tag=FindFlag0.1] run function mob_manager:entity_finder/entity_hurt_player/fetch_entity
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
#
# @within function mob_manager:entity_finder/entity_hurt_player/filters/2

execute if entity @p[tag=AttackingPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={1-0=true}}] if entity @s[tag=FindFlag1.0] run function mob_manager:entity_finder/entity_hurt_player/filters/0
execute if entity @p[tag=AttackingPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={1-1=true}}] if entity @s[tag=FindFlag1.1] run function mob_manager:entity_finder/entity_hurt_player/filters/0
execute if entity @p[tag=DamagedPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={1-0=true}}] if entity @s[tag=FindFlag1.0] run function mob_manager:entity_finder/entity_hurt_player/filters/0
execute if entity @p[tag=DamagedPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={1-1=true}}] if entity @s[tag=FindFlag1.1] run function mob_manager:entity_finder/entity_hurt_player/filters/0
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
#
# @within function mob_manager:entity_finder/entity_hurt_player/filters/11

execute if entity @p[tag=AttackingPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={10-0=true}}] if entity @s[tag=FindFlag10.0] run function mob_manager:entity_finder/entity_hurt_player/filters/9
execute if entity @p[tag=AttackingPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={10-1=true}}] if entity @s[tag=FindFlag10.1] run function mob_manager:entity_finder/entity_hurt_player/filters/9
execute if entity @p[tag=DamagedPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={10-0=true}}] if entity @s[tag=FindFlag10.0] run function mob_manager:entity_finder/entity_hurt_player/filters/9
execute if entity @p[tag=DamagedPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={10-1=true}}] if entity @s[tag=FindFlag10.1] run function mob_manager:entity_finder/entity_hurt_player/filters/9
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
#
# @within function mob_manager:entity_finder/entity_hurt_player/filters/12

execute if entity @p[tag=AttackingPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={11-0=true}}] if entity @s[tag=FindFlag11.0] run function mob_manager:entity_finder/entity_hurt_player/filters/10
execute if entity @p[tag=AttackingPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={11-1=true}}] if entity @s[tag=FindFlag11.1] run function mob_manager:entity_finder/entity_hurt_player/filters/10
execute if entity @p[tag=DamagedPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={11-0=true}}] if entity @s[tag=FindFlag11.0] run function mob_manager:entity_finder/entity_hurt_player/filters/10
execute if entity @p[tag=DamagedPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={11-1=true}}] if entity @s[tag=FindFlag11.1] run function mob_manager:entity_finder/entity_hurt_player/filters/10
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
#
# @within function mob_manager:entity_finder/entity_hurt_player/filters/13

execute if entity @p[tag=AttackingPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={12-0=true}}] if entity @s[tag=FindFlag12.0] run function mob_manager:entity_finder/entity_hurt_player/filters/11
execute if entity @p[tag=AttackingPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={12-1=true}}] if entity @s[tag=FindFlag12.1] run function mob_manager:entity_finder/entity_hurt_player/filters/11
execute if entity @p[tag=DamagedPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={12-0=true}}] if entity @s[tag=FindFlag12.0] run function mob_manager:entity_finder/entity_hurt_player/filters/11
execute if entity @p[tag=DamagedPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={12-1=true}}] if entity @s[tag=FindFlag12.1] run function mob_manager:entity_finder/entity_hurt_player/filters/11
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
#
# @within function mob_manager:entity_finder/entity_hurt_player/filters/14

execute if entity @p[tag=AttackingPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={13-0=true}}] if entity @s[tag=FindFlag13.0] run function mob_manager:entity_finder/entity_hurt_player/filters/12
execute if entity @p[tag=AttackingPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={13-1=true}}] if entity @s[tag=FindFlag13.1] run function mob_manager:entity_finder/entity_hurt_player/filters/12
execute if entity @p[tag=DamagedPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={13-0=true}}] if entity @s[tag=FindFlag13.0] run function mob_manager:entity_finder/entity_hurt_player/filters/12
execute if entity @p[tag=DamagedPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={13-1=true}}] if entity @s[tag=FindFlag13.1] run function mob_manager:entity_finder/entity_hurt_player/filters/12
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
#
# @within function mob_manager:entity_finder/entity_hurt_player/filters/15

execute if entity @p[tag=AttackingPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={14-0=true}}] if entity @s[tag=FindFlag14.0] run function mob_manager:entity_finder/entity_hurt_player/filters/13
execute if entity @p[tag=AttackingPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={14-1=true}}] if entity @s[tag=FindFlag14.1] run function mob_manager:entity_finder/entity_hurt_player/filters/13
execute if entity @p[tag=DamagedPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={14-0=true}}] if entity @s[tag=FindFlag14.0] run function mob_manager:entity_finder/entity_hurt_player/filters/13
execute if entity @p[tag=DamagedPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={14-1=true}}] if entity @s[tag=FindFlag14.1] run function mob_manager:entity_finder/entity_hurt_player/filters/13
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
#
# @within function mob_manager:entity_finder/entity_hurt_player/filters/

execute if entity @p[tag=AttackingPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={15-0=true}}] if entity @s[tag=FindFlag15.0] run function mob_manager:entity_finder/entity_hurt_player/filters/14
execute if entity @p[tag=AttackingPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={15-1=true}}] if entity @s[tag=FindFlag15.1] run function mob_manager:entity_finder/entity_hurt_player/filters/14
execute if entity @p[tag=DamagedPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={15-0=true}}] if entity @s[tag=FindFlag15.0] run function mob_manager:entity_finder/entity_hurt_player/filters/14
execute if entity @p[tag=DamagedPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={15-1=true}}] if entity @s[tag=FindFlag15.1] run function mob_manager:entity_finder/entity_hurt_player/filters/14
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
#
# @within function mob_manager:entity_finder/entity_hurt_player/filters/3

execute if entity @p[tag=AttackingPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={2-0=true}}] if entity @s[tag=FindFlag2.0] run function mob_manager:entity_finder/entity_hurt_player/filters/1
execute if entity @p[tag=AttackingPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={2-1=true}}] if entity @s[tag=FindFlag2.1] run function mob_manager:entity_finder/entity_hurt_player/filters/1
execute if entity @p[tag=DamagedPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={2-0=true}}] if entity @s[tag=FindFlag2.0] run function mob_manager:entity_finder/entity_hurt_player/filters/1
execute if entity @p[tag=DamagedPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={2-1=true}}] if entity @s[tag=FindFlag2.1] run function mob_manager:entity_finder/entity_hurt_player/filters/1
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
#
# @within function mob_manager:entity_finder/entity_hurt_player/filters/4

execute if entity @p[tag=AttackingPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={3-0=true}}] if entity @s[tag=FindFlag3.0] run function mob_manager:entity_finder/entity_hurt_player/filters/2
execute if entity @p[tag=AttackingPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={3-1=true}}] if entity @s[tag=FindFlag3.1] run function mob_manager:entity_finder/entity_hurt_player/filters/2
execute if entity @p[tag=DamagedPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={3-0=true}}] if entity @s[tag=FindFlag3.0] run function mob_manager:entity_finder/entity_hurt_player/filters/2
execute if entity @p[tag=DamagedPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={3-1=true}}] if entity @s[tag=FindFlag3.1] run function mob_manager:entity_finder/entity_hurt_player/filters/2
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
#
# @within function mob_manager:entity_finder/entity_hurt_player/filters/5

execute if entity @p[tag=AttackingPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={4-0=true}}] if entity @s[tag=FindFlag4.0] run function mob_manager:entity_finder/entity_hurt_player/filters/3
execute if entity @p[tag=AttackingPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={4-1=true}}] if entity @s[tag=FindFlag4.1] run function mob_manager:entity_finder/entity_hurt_player/filters/3
execute if entity @p[tag=DamagedPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={4-0=true}}] if entity @s[tag=FindFlag4.0] run function mob_manager:entity_finder/entity_hurt_player/filters/3
execute if entity @p[tag=DamagedPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={4-1=true}}] if entity @s[tag=FindFlag4.1] run function mob_manager:entity_finder/entity_hurt_player/filters/3
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
#
# @within function mob_manager:entity_finder/entity_hurt_player/filters/6

execute if entity @p[tag=AttackingPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={5-0=true}}] if entity @s[tag=FindFlag5.0] run function mob_manager:entity_finder/entity_hurt_player/filters/4
execute if entity @p[tag=AttackingPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={5-1=true}}] if entity @s[tag=FindFlag5.1] run function mob_manager:entity_finder/entity_hurt_player/filters/4
execute if entity @p[tag=DamagedPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={5-0=true}}] if entity @s[tag=FindFlag5.0] run function mob_manager:entity_finder/entity_hurt_player/filters/4
execute if entity @p[tag=DamagedPlayer,advancements={mob_manager:entity_finder/entity_hurt_player={5-1=true}}] if entity @s[tag=FindFlag5.1] run function mob_manager:entity_finder/entity_hurt_player/filters/4
Loading

0 comments on commit f0285b8

Please sign in to comment.