Skip to content
Open
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

function api:modifier/max_health/get
execute store result score $_ ScoreToHealth run data get storage api: Return.MaxHealth 100
execute store result score $_ ScoreToHealth run attribute @s generic.max_health get 100
function api:data_get/health
execute store result score $__ ScoreToHealth run data get storage api: Health 100
scoreboard players operation $__ ScoreToHealth -= $_ ScoreToHealth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,10 @@
# lib:has_health_modify_score
# api:modifier/max_health/**
scoreboard objectives add ScoreToHealth dummy {"text":"プレイヤーをこの体力にする(*0.01HP)"}
scoreboard objectives add ScoreToMaxHealth dummy {"text":"プレイヤーをこの最大体力にする(*0.0001HP)"}

#> PrivateUse
# @internal
#declare tag ScoreToHealth.AntiGlitch.UnsafeTick
#declare tag ScoreToHealth.AntiGlitch.Protected
#declare tag ScoreToHealth.Modified
#declare tag ScoreToHealth.Return
scoreboard objectives add STMHBackup dummy {"text":"ScoreToMaxHealthのBackup"}

#> RespawnCheck
# @within function core:handler/respawn
#declare objective STMHBackup

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
# limitations under the License.

execute if entity @s[tag=ScoreToHealth.Modified] run function score_to_health:restore
execute unless score @s STMHBackup matches -2147483648.. run scoreboard players set @s ScoreToMaxHealth 200000
execute unless score @s STMHBackup matches -2147483648.. run scoreboard players set @s STMHBackup 200000
execute if entity @s[tag=!ScoreToHealth.Return,tag=!ScoreToHealth.AntiGlitch.UnsafeTick] unless score @s ScoreToMaxHealth = @s STMHBackup run function score_to_health:modify_max_health
execute unless entity @s[tag=ScoreToHealth.Return] if score @s ScoreToHealth matches -2147483648.. run function score_to_health:check
tag @s[tag=ScoreToHealth.Return] remove ScoreToHealth.Return
advancement revoke @s only score_to_health:player_tick
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
execute store result score $Health Temporary run data get storage api: Health 10000

# 最大体力を取得
function api:modifier/max_health/get
execute store result score $MaxHealth Temporary run data get storage api: Return.MaxHealth 10
execute store result score $MaxHealth Temporary run attribute @s generic.max_health get 10

# 計算結果を api: Return.HealthPer
execute store result storage api: Return.HealthPer double 0.001 run scoreboard players operation $Health Temporary /= $MaxHealth Temporary
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> api:modifier/core/max_health/add.m
#
#
#
# @within function api:modifier/max_health/update_bonus

# 付与
$attribute @s generic.max_health modifier add 00000001-0000-0001-0000-000200000000 "BonusHealth" $(Amount) add

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@
#declare score_holder $RemovedAmount
#declare score_holder $isNegative

# 削除前に更新前の補正量を取得しておく
execute store result score $RemovedAmount Temporary run attribute @s generic.max_health modifier value get 00000001-0000-0001-0000-000200000000

# 古いのをremove
data modify storage api: Argument.UUID set value [I;1,1,2,0]
function api:modifier/max_health/remove
attribute @s generic.max_health modifier remove 00000001-0000-0001-0000-000200000000
Comment thread
Lapis-LJA marked this conversation as resolved.

# 差分にする
scoreboard players operation $Diff Temporary = $BonusHealth Global
execute store result score $RemovedAmount Temporary run data get storage api: Removed.Amount 1
execute unless score $RemovedAmount Temporary matches -2147483648..2147483647 run scoreboard players set $RemovedAmount Temporary 0
scoreboard players operation $Diff Temporary -= $RemovedAmount Temporary
# 出力
Expand All @@ -30,6 +31,6 @@
scoreboard players reset $isNegative Temporary

# 適用
data modify storage api: Argument set value {Amount:-1,UUID:[I;1,1,2,0],Operation:"add"}
execute store result storage api: Argument.Amount double 1 run scoreboard players get $BonusHealth Global
function api:modifier/max_health/add
execute store result storage api: Temp.Amount int 1 run scoreboard players get $BonusHealth Global
function api:modifier/core/max_health/add.m with storage api: Temp
data remove storage api: Temp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@
execute if data storage asset:artifact Modifier{Type:"receive_heal"} run data modify storage asset:artifact Line[1] set value '"被回復量"'
execute if data storage asset:artifact Modifier{Type:"mp_regen"} run scoreboard players set $CustomModifier Temporary 1
execute if data storage asset:artifact Modifier{Type:"mp_regen"} run data modify storage asset:artifact Line[1] set value '"MP回復量"'
execute if data storage asset:artifact Modifier{Type:"max_health"} run scoreboard players set $CustomModifier Temporary 1
execute if data storage asset:artifact Modifier{Type:"max_health"} run data modify storage asset:artifact Line[1] set value '"最大体力"'
execute if data storage asset:artifact Modifier{Type:"max_mp"} run scoreboard players set $CustomModifier Temporary 1
execute if data storage asset:artifact Modifier{Type:"max_mp"} run data modify storage asset:artifact Line[1] set value '"最大MP"'
Comment thread
Lapis-LJA marked this conversation as resolved.
execute if score $CustomModifier Temporary matches 0 run function asset_manager:artifact/create/set_lore/modifier/generic.m with storage asset:artifact Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# 無信仰にする
execute unless predicate player_manager:is_believe/flora unless predicate player_manager:is_believe/nyaptov unless predicate player_manager:is_believe/rumor unless predicate player_manager:is_believe/urban unless predicate player_manager:is_believe/wi-ki run function player_manager:god/none/set_tag
# ステータス初期化
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].Attributes.Default set value {Heal:1d,ReceiveHeal:1d,Attack:{Base:1d,Physical:1d,Magic:1d,None:1d,Fire:1d,Water:1d,Thunder:1d},Defense:{Base:1d,Physical:1d,Magic:1d,None:1d,Fire:1d,Water:1d,Thunder:1d},MaxMP:100d,MPRegen:1d,MaxHealth:20d,FallResistance:1d}
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].Attributes.Default set value {Heal:1d,ReceiveHeal:1d,Attack:{Base:1d,Physical:1d,Magic:1d,None:1d,Fire:1d,Water:1d,Thunder:1d},Defense:{Base:1d,Physical:1d,Magic:1d,None:1d,Fire:1d,Water:1d,Thunder:1d},MaxMP:100d,MPRegen:1d,FallResistance:1d}
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].Attributes.Value set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].Attributes.Default
# 神器クールダウンの初期化
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCoolDown set value [{Value:-15,Max:0},{Value:-15,Max:0},{Value:-15,Max:0},{Value:-15,Max:0},{Value:-15,Max:0},{Value:-15,Max:0},{Value:-15,Max:0},{Value:-15,Max:0},{Value:-15,Max:0},{Value:-15,Max:0},{Value:-15,Max:0},{Value:-15,Max:0},{Value:-15,Max:0},{Value:-15,Max:0}]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@
tag @s remove Death
# リスポーン中タグの設定
tag @s add InRespawnEvent
# 最大体力 attribute を復元させる
scoreboard players set @s STMHBackup 200000
# 体力を最大体力の 50% まで回復させる
function api:modifier/max_health/get
execute store result score $Set Lib run data get storage api: Return.MaxHealth 100
execute store result score $Set Lib run attribute @s generic.max_health get 100
function lib:score_to_health_wrapper/set
# リスポーン時の満腹度調整
function player_manager:adjust_hunger/respawn
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
#> debug:modify_health/add.m
# @input args
# Amount: int
# Amount: float
# @private
# @user

function debug:modify_health/remove

data modify storage api: Argument.UUID set value [I; -1,0,0,0]
$data modify storage api: Argument.Amount set value $(Amount)
data modify storage api: Argument.Operation set value "add"

function api:modifier/max_health/add
$attribute @s generic.max_health modifier add ffffffff-0000-0000-0000-000000000000 "DebugModifyHealth" $(Amount) add
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
# @within function debug:modify_health/add.m
# @user

data modify storage api: Argument.UUID set value [I; -1,0,0,0]
function api:modifier/max_health/remove
attribute @s generic.max_health modifier remove ffffffff-0000-0000-0000-000000000000
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
execute unless score @s ScoreToHealth matches -2147483648..2147483647 run function api:data_get/health
execute unless score @s ScoreToHealth matches -2147483648..2147483647 store result score @s ScoreToHealth run data get storage api: Health 100
# 最大体力を定義
function api:modifier/max_health/get
execute store result score $MaxHealth Temporary run data get storage api: Return.MaxHealth 100
execute store result score $MaxHealth Temporary run attribute @s generic.max_health get 100
# 体力>=1 & 差分<=-1: ダメージ演出
execute if score @s ScoreToHPFluc matches ..-1 if score @s ScoreToHealth matches 1.. if data storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].DamageVfx{_:true} run summon area_effect_cloud ~ ~ ~ {Duration:6,Age:4,effects:[{id:"unluck",amplifier:127b,duration:1,show_particles:0b},{id:"resistance",amplifier:127b,duration:1,show_particles:0b},{id:"instant_damage",amplifier:0b,duration:1,show_particles:0b}]}
# ダメージの場合は金ハートを消費する
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@
#
# @within function mob_manager:processing_tag/common_tag/anti_void_action/

# 最大体力を取得
function api:modifier/max_health/get

# 引数設定 - ダメージ
execute if entity @s[distance=..5] store result storage api: Argument.Damage float 0.020 run data get storage api: Return.MaxHealth 10
execute if entity @s[distance=..4] store result storage api: Argument.Damage float 0.035 run data get storage api: Return.MaxHealth 10
execute if entity @s[distance=..3] store result storage api: Argument.Damage float 0.050 run data get storage api: Return.MaxHealth 10
execute if entity @s[distance=..2] store result storage api: Argument.Damage float 0.065 run data get storage api: Return.MaxHealth 10
execute if entity @s[distance=..1] store result storage api: Argument.Damage float 0.080 run data get storage api: Return.MaxHealth 10
execute if entity @s[distance=..5] store result storage api: Argument.Damage float 0.020 run attribute @s generic.max_health get 10
execute if entity @s[distance=..4] store result storage api: Argument.Damage float 0.035 run attribute @s generic.max_health get 10
execute if entity @s[distance=..3] store result storage api: Argument.Damage float 0.050 run attribute @s generic.max_health get 10
execute if entity @s[distance=..2] store result storage api: Argument.Damage float 0.065 run attribute @s generic.max_health get 10
execute if entity @s[distance=..1] store result storage api: Argument.Damage float 0.080 run attribute @s generic.max_health get 10
# 引数設定 - その他
data modify storage api: Argument.AttackType set value "Physical"
data modify storage api: Argument.ElementType set value "None"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
#declare score_holder $YVec

# 最大体力取得
function api:modifier/max_health/get
execute store result score $MaxHealth Temporary run data get storage api: Return.MaxHealth 100
execute store result score $MaxHealth Temporary run attribute @s generic.max_health get 100

# 1tick前のFallDistance取得
execute store result score $FallDistance Temporary run scoreboard players get @s OldFallDistance
Expand Down
Loading
Loading