Skip to content

Commit

Permalink
🧑‍💻 バニラ攻撃時の処理を復元
Browse files Browse the repository at this point in the history
  • Loading branch information
haiiro2gou committed Nov 17, 2024
1 parent 5eb2000 commit d2a75db
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@

#> バニラの攻撃を扱う用
# @within function
# asset_manager:artifact/check/
# asset_manager:artifact/triggers/attack_melee/**
# asset_manager:artifact/triggers/
# asset_manager:artifact/triggers/vanilla/
# asset_manager:artifact/triggers/attack_melee/foreach
#declare tag ShouldVanillaAttack

#> check用の失敗フラグ
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@
execute if data storage asset:artifact {EquipmentChanges:[{_:{_:false}}]} run function asset_manager:artifact/triggers/equipments/update_attribute/
# 改宗時の更新処理
execute if entity @s[tag=Believe.Changed] unless data storage asset:artifact {EquipmentChanges:[{_:{_:false}}]} run function asset_manager:artifact/triggers/equipments/update_attribute/
# バニラ攻撃をしているならフラグを建てる
execute if data storage asset:artifact ArtifactEvents.Attack[{Type:"vanilla_melee"}] run tag @s add ShouldVanillaAttack
# 各神器にトリガー受けわたし
function asset_manager:artifact/triggers/trigger/
# 神器でバニラ攻撃を処理していないならダメージを与える
execute if entity @s[tag=ShouldVanillaAttack] run function asset_manager:artifact/triggers/vanilla/
# EntityStorageにデータ突っ込む
function asset_manager:artifact/data/new/stash_to_entity_storage
# リセット
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#
#
# @within function
# asset_manager:artifact/triggers/vanilla/
# asset_manager:artifact/triggers/attack*/foreach
# asset_manager:artifact/triggers/event/attack/add_tag_each_victim

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
#
#
#
# @within function asset_manager:artifact/triggers/attack*/foreach
# @within function
# asset_manager:artifact/triggers/vanilla/
# asset_manager:artifact/triggers/attack*/foreach

function lib:array/session/open
data modify storage lib: Array set from storage asset:context Attack.Amounts
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#> asset_manager:artifact/triggers/vanilla/
#
# バニラ攻撃を処理する
#
# @within function asset_manager:artifact/triggers/

#> Private
# @within asset_manager:artifact/triggers/vanilla/*
#declare score_holder $Damage

# イベントデータ処理
# データを取得
data modify storage asset:context Attack set from storage asset:artifact ArtifactEvents.Attack[{Type:"vanilla_melee"}]
# 攻撃先を取得し、Victim を付与する
data modify storage asset:artifact AttackTargets set from storage asset:context Attack.To
execute if data storage asset:artifact AttackTargets[0] run function asset_manager:artifact/triggers/event/attack/add_tag_each_victim
# 最大ダメージの計算
function asset_manager:artifact/triggers/event/attack/get_max_amount

# 各mobにダメージを与える
execute store result score $Damage Temporary run data get storage asset:context Attack.Amount -100
execute as @e[type=#lib:living,type=!player,tag=Victim,distance=..8] at @s run function asset_manager:artifact/triggers/vanilla/damage

# リセット
scoreboard players reset $Damage Temporary
data remove storage asset:context Attack
data remove storage asset:artifact AttackTargets
tag @s remove ShouldVanillaAttack
tag @e[type=#lib:living,type=!player,tag=Victim] remove Victim
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#> asset_manager:artifact/triggers/vanilla/damage
#
# バニラ攻撃を処理する
#
# @within function asset_manager:artifact/triggers/vanilla/

#> Private
# @private
#declare score_holder $Fluctuation

# 減算
scoreboard players operation @s MobHealth += $Damage Temporary
# ダメージ表示
scoreboard players operation $Fluctuation Lib = $Damage Temporary
execute unless score $Fluctuation Lib matches 0 run function lib:status_log/show_health
# 代入 / kill
execute if score @s MobHealth matches ..0 run tag @s add Death
execute if score @s MobHealth matches ..0 run function asset_manager:artifact/triggers/vanilla/push_kill_and_death_event
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#> asset_manager:artifact/triggers/attack/vanilla/push_kill_and_death_event
#
#
#
# @within function asset_manager:artifact/triggers/attack/vanilla/

# プレイヤーにイベントを追加する
execute as @p[tag=this] run function oh_my_dat:please
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Killed append from storage asset:context Attack
# Mob にもイベントを追加する
function oh_my_dat:please
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].MobEvents.Death append from storage asset:context Attack
data remove storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].MobEvents.Death[-1].To
execute store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].MobEvents.Death[-1].From int 1 run scoreboard players get @p[tag=this] UserID
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# api:damage/core/health_subtract/non-player/
# api:heal/core/non-player
# lib:score_to_health_wrapper/fluctuation
# asset_manager:artifact/triggers/attack/vanilla/
# asset_manager:artifact/triggers/vanilla/damage
# mob_manager:fix_health

#> For Init
Expand Down

0 comments on commit d2a75db

Please sign in to comment.