|
4 | 4 | # |
5 | 5 | # @within function api:heal/core/player |
6 | 6 |
|
7 | | -#> Private |
8 | | -# @within api:heal/core/push_heal_events/* |
9 | | -#declare score_holder $ReceiverUUID |
| 7 | +# 現在体力の取得 |
| 8 | + function api:data_get/health |
| 9 | + |
| 10 | +# 超過回復量の計算 |
| 11 | + function api:heal/core/push_heal_events/calc_over_heal |
10 | 12 |
|
11 | 13 | # ヒールされた側にイベントを追加する |
12 | 14 | function oh_my_dat:please |
13 | 15 | data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.ReceiveHeal append value {} |
14 | | - execute store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.ReceiveHeal[-1].Amount double 0.01 run data get storage api: Argument.Fluctuation 100 |
| 16 | + data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.ReceiveHeal[-1].Amount.Base set from storage api: Argument.Fluctuation |
| 17 | + execute store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.ReceiveHeal[-1].Amount.Over float 0.01 run scoreboard players get $OverHeal Temporary |
| 18 | + data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.ReceiveHeal[-1].PreviousHealth set from storage api: Health |
15 | 19 | execute if data storage api: Argument{ApplyTrigger:true} run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.ReceiveHeal[-1].IsHoT set value false |
16 | 20 | execute if data storage api: Argument{ApplyTrigger:false} run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.ReceiveHeal[-1].IsHoT set value true |
17 | 21 | data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.ReceiveHeal[-1].Metadata set from storage api: Argument.Metadata |
18 | 22 |
|
19 | | -# ApplyTriggerがtrueでないなら与回復トリガーは実行しない |
20 | | - execute unless data storage api: Argument{ApplyTrigger:true} run return fail |
| 23 | +# ApplyTriggerがtrueなら、ヒールした側からトリガーをpushする |
| 24 | + execute if data storage api: Argument{ApplyTrigger:true} run function api:heal/core/push_heal_events/from_healer/ |
21 | 25 |
|
22 | | -# ヒールした側から行う処理 |
23 | | - scoreboard players operation $ReceiverUUID Temporary = @s UserID |
24 | | - execute as @a if score @s UserID = $LatestModifiedUser UserID run function api:heal/core/push_heal_events/healer |
25 | | - scoreboard players reset $ReceiverUUID Temporary |
| 26 | +# リセット |
| 27 | + scoreboard players reset $OverHeal Temporary |
0 commit comments