Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion TheSkyBlessing/data/api/functions/heal/.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
# @input
# as living entity
# storage api: Argument.Heal : float
# storage api: Argument.Heal : double
# storage api: Argument.FixedHeal? : boolean(default: false)
# storage api: Argument.DisableLog? : boolean(default: false)
# storage api: Argument.ApplyTrigger? : boolean(default: true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# 補正
scoreboard players operation $Heal Temporary *= $Modifier Temporary
# 代入
execute store result storage api: Argument.Heal float 0.0001 run scoreboard players get $Heal Temporary
execute store result storage api: Argument.Heal double 0.0001 run scoreboard players get $Heal Temporary
# リセット
scoreboard players reset $Heal Temporary
scoreboard players reset $Modifier Temporary
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
function oh_my_dat:please
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.ReceiveHeal append value {}
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
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
execute store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.ReceiveHeal[-1].Amount.Over double 0.01 run scoreboard players get $OverHeal Temporary
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.ReceiveHeal[-1].PreviousHealth set from storage api: Health
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
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
execute unless score $LastIndex Temporary = $ModifierIndex Global run data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Heal append value {}
execute unless score $LastIndex Temporary = $ModifierIndex Global run execute store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Heal[-1].Index int 1 run scoreboard players get $ModifierIndex Global
# ヒール対象に追加する
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Heal[-1].Amounts.Base append value -1f
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Heal[-1].Amounts.Over append value -1f
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Heal[-1].Amounts.Base append value -1d
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Heal[-1].Amounts.Over append value -1d
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Heal[-1].Amounts.Base[-1] set from storage api: Argument.Fluctuation
execute store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Heal[-1].Amounts.Over[-1] float 0.01 run scoreboard players get $OverHeal Temporary
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Heal[-1].PreviousHealth append value -1f
execute store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Heal[-1].Amounts.Over[-1] double 0.01 run scoreboard players get $OverHeal Temporary
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Heal[-1].PreviousHealth append value -1d

@EllaCoat EllaCoat Jun 16, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MUST]

  • api: Healthdata_get/health.mcfunction:13DataCache.Data.Health から set from

であるため、float 型のはず。
なのでコイツを変えてはならない。
double と float が混在するのはいささか気持ち悪いが……これ、大丈夫かなぁ。

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

そ~いやHealthはfloatか~~~
どうしよう

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

そもそも、double にしようとした理由ってどこの計算過程でバグが発生するからなんだ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ネクターの再生エフェクトを使ってて、回復量が4.2のはずが4.1になって、キモイな~~~~となった

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

どこでそのズレが発生しているのかを調査した方が良さそう、知らんけど

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

今のとこだけど、floatをスコアに変えるときに誤差が発生する

data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Heal[-1].PreviousHealth[-1] set from storage api: Health
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Heal[-1].To append value -1
execute store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Heal[-1].To[-1] int 1 run scoreboard players get $ReceiverUUID Temporary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# 補正
scoreboard players operation $Heal Temporary *= $Modifier Temporary
# 代入
execute store result storage api: Argument.Fluctuation float 0.0001 run scoreboard players get $Heal Temporary
execute store result storage api: Argument.Fluctuation double 0.0001 run scoreboard players get $Heal Temporary
# リセット
scoreboard players reset $Heal Temporary
scoreboard players reset $Modifier Temporary
4 changes: 2 additions & 2 deletions TheSkyBlessing/data/api/functions/heal/modifier.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
#
# @input
# as entity
# storage api: Argument.Heal : float
# storage api: Argument.Heal : double
# storage api: Argument.FIxedHeal : boolean
# @output storage api: Argument.Heal : float
# @output storage api: Argument.Heal : double
# @api

# 補正
Expand Down
Loading