Skip to content

Commit a271ac4

Browse files
authored
Merge pull request #1701 from ProjectTSB/balance/mp-regen
💥 MP回復量周りの処理を大幅変更
2 parents 9816206 + 8ee3cf2 commit a271ac4

File tree

18 files changed

+44
-128
lines changed

18 files changed

+44
-128
lines changed

TheSkyBlessing/data/api/functions/damage/core/mp_heal.mcfunction

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,22 @@
44
#
55
# @within function api:damage/core/attack
66

7-
data modify storage api: Argument.Fluctuation set from storage api: Argument.AdditionalMPHeal
8-
data modify storage api: Argument.DisableLog set value true
9-
function api:mp/fluctuation
7+
#> private
8+
# @private
9+
#declare score_holder $MPHeal
10+
#declare score_holder $Modifier
11+
12+
# UserStorage呼び出し
13+
function oh_my_dat:please
14+
# 回復量計算
15+
execute store result score $MPHeal Temporary run data get storage api: Argument.AdditionalMPHeal 100
16+
execute store result score $Modifier Temporary run data get storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].Attributes.Value.MPRegen 100
17+
scoreboard players operation $MPHeal Temporary *= $Modifier Temporary
18+
execute store result storage api: Argument.Fluctuation double 0.01 run scoreboard players operation $MPHeal Temporary /= $100 Const
19+
# 表示を無効化する
20+
data modify storage api: Argument.DisableLog set value true
21+
# 回復
22+
function api:mp/fluctuation
23+
# リセット
24+
scoreboard players reset $MPHeal Temporary
25+
scoreboard players reset $Modifier Temporary

TheSkyBlessing/data/api/functions/mp/check.mcfunction

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
#declare score_holder $CheckMP
1616

1717
# 閾値を取得
18-
execute store result score $CheckMP Temporary run data get storage api: Argument.Threshold
18+
execute store result score $CheckMP Temporary run data get storage api: Argument.Threshold 10
1919
# Bypass
2020
execute if entity @s[tag=DevPrivilege] run scoreboard players set $CheckMP Temporary 0
2121
# チェック
2222
execute store success storage api: Return.IsThresholdOrMore byte 1 if score $CheckMP Temporary <= @s MP
2323
# リセット
24-
scoreboard players reset $CheckMP Temporary
24+
scoreboard players reset $CheckMP Temporary

TheSkyBlessing/data/api/functions/mp/fluctuation.mcfunction

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@
1313
#declare score_holder $Fluctuation
1414

1515
# 増減量取得
16-
execute store result score $Fluctuation Lib run data get storage api: Argument.Fluctuation
16+
execute store result score $Fluctuation Temporary run data get storage api: Argument.Fluctuation 10
1717
# 増減
18-
scoreboard players operation @s MP += $Fluctuation Lib
18+
scoreboard players operation @s MP += $Fluctuation Temporary
1919
scoreboard players operation @s MP > $0 Const
2020
scoreboard players operation @s MP < @s MPMax
2121
# 表示
22+
scoreboard players operation $Fluctuation Temporary /= $10 Const
2223
execute unless data storage api: Argument{DisableLog:1b} at @s run function lib:status_log/show_mp
2324
# リセット
24-
scoreboard players reset $Fluctuation Lib
25+
scoreboard players reset $Fluctuation Temporary
2526
data remove storage api: Argument.Fluctuation
2627
data remove storage api: Argument.DisableLog

TheSkyBlessing/data/api/functions/mp/get_current.mcfunction

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
# @api
88

99
# 取得
10-
execute store result storage api: Return.CurrentMP int 1 run scoreboard players get @s MP
10+
execute store result storage api: Return.CurrentMP int 0.1 run scoreboard players get @s MP

TheSkyBlessing/data/api/functions/mp/get_max.mcfunction

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
# @api
88

99
# 取得
10-
execute store result storage api: Return.MaxMP int 1 run scoreboard players get @s MPMax
10+
execute store result storage api: Return.MaxMP int 0.1 run scoreboard players get @s MPMax

TheSkyBlessing/data/api/functions/mp/set.mcfunction

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
#declare score_holder $MP
1313

1414
# 取得
15-
execute store result score $MP Temporary run data get storage api: Argument.MP
15+
execute store result score $MP Temporary run data get storage api: Argument.MP 10
1616
# セット
1717
scoreboard players operation @s MP = $MP Temporary
1818
# リセット
1919
scoreboard players reset $MP Temporary
20-
data remove storage api: Argument.MP
20+
data remove storage api: Argument.MP

TheSkyBlessing/data/api/functions/mp/update_max.mcfunction

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
# Storage呼び出し
1010
function oh_my_dat:please
1111
# 最大MP変更
12-
execute store result score @s MPMax run data get storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].Attributes.Value.MaxMP 1
12+
execute store result score @s MPMax run data get storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].Attributes.Value.MaxMP 10
1313
scoreboard players operation @s MPMax > $0 Const

TheSkyBlessing/data/asset_manager/functions/artifact/check/check_mp.mcfunction

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,3 @@
1818
function api:mp/check
1919
# タグ付与
2020
execute unless data storage api: Return{IsThresholdOrMore:true} run tag @s add CheckFailed
21-
# リセット
22-
scoreboard players reset $Length Temporary

TheSkyBlessing/data/asset_manager/functions/artifact/use/remove_mp.mcfunction

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,9 @@
1212
#declare score_holder $Fluctuation
1313
#declare score_holder $Length
1414

15-
# 取得
16-
execute store result score $Fluctuation Lib run data get storage asset:artifact TargetItems[0].tag.TSB.MPCost
17-
# アイテム数だけ増やす
18-
# execute store result score $Length Temporary if data storage asset:artifact TargetItems[]
19-
# scoreboard players operation $Fluctuation Lib *= $Length Temporary
20-
# 反転して減算
21-
scoreboard players operation $Fluctuation Lib *= $-1 Const
22-
data modify storage lib: Argument.DisableLog set value true
23-
function lib:mp/fluctuation
15+
# 取得して減算
16+
execute store result storage api: Argument.Fluctuation double -0.01 run data get storage asset:artifact TargetItems[0].tag.TSB.MPCost 100
17+
data modify storage api: Argument.DisableLog set value true
18+
function api:mp/fluctuation
2419
# リセット
25-
scoreboard players reset $Length Temporary
20+
scoreboard players reset $Fluctuation Temporary

TheSkyBlessing/data/core/functions/load_once.mcfunction

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,9 +331,8 @@ team modify NoCollision collisionRule never
331331
scoreboard objectives add Health health {"text":"","color":"#FF4c99"}
332332
scoreboard objectives add PerHealth dummy {"text":"","color":"#FF4c99"}
333333
scoreboard objectives add HPRegenCooldown dummy {"text":"HP自然回復のクールダウン"}
334-
scoreboard objectives add MP dummy {"text":"MP"}
335-
scoreboard objectives add MPFloat dummy {"text":"MP - 小数部"}
336-
scoreboard objectives add MPMax dummy {"text":"MP上限値"}
334+
scoreboard objectives add MP dummy {"text":"MP (e1)"}
335+
scoreboard objectives add MPMax dummy {"text":"MP上限値 (e1)"}
337336
scoreboard objectives add MPRegenCooldown dummy {"text":"MP再生のクールダウン"}
338337
scoreboard objectives add OldFallDistance dummy {"text":"1tick前の落下距離 (e1)"}
339338
scoreboard objectives add FloraFoodRegenCooldown dummy {"text":"フローラの満腹度回復のクールダウン"}

TheSkyBlessing/data/lib/functions/mp/fluctuation.mcfunction

Lines changed: 0 additions & 20 deletions
This file was deleted.

TheSkyBlessing/data/lib/functions/mp/get.mcfunction

Lines changed: 0 additions & 12 deletions
This file was deleted.

TheSkyBlessing/data/lib/functions/mp/get_max.mcfunction

Lines changed: 0 additions & 12 deletions
This file was deleted.

TheSkyBlessing/data/lib/functions/mp/set.mcfunction

Lines changed: 0 additions & 17 deletions
This file was deleted.

TheSkyBlessing/data/lib/functions/status_log/show_mp.mcfunction

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,3 @@
2424
execute anchored eyes positioned ^ ^ ^ run tag @e[type=armor_stand,tag=LogAECInit,distance=..1.5,limit=1] remove LogAECInit
2525
# リセット
2626
execute anchored eyes positioned ^ ^ ^ run kill @e[type=armor_stand,tag=SummonPosStand,distance=..1.5,limit=1]
27-
scoreboard players reset $Fluctuation Lib

TheSkyBlessing/data/player_manager/functions/mp/regen/do.mcfunction

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,43 +4,11 @@
44
#
55
# @within function player_manager:mp/regen/check
66

7-
#> Temp
8-
# @private
9-
#declare score_holder $isNegative
10-
#declare score_holder $Fluctuation
11-
#declare score_holder $AmountFloat
12-
13-
# UserStorage呼び出し
14-
function oh_my_dat:please
15-
# 回復量計算
16-
execute store result score $Fluctuation Lib run data get storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].Attributes.Value.MPRegen 10
17-
scoreboard players operation $Fluctuation Lib *= @s MPMax
18-
scoreboard players operation $Fluctuation Lib /= $100 Const
19-
# 負数を強制する
20-
execute store success score $isNegative Temporary if score $Fluctuation Lib matches ..-1
21-
execute if score $isNegative Temporary matches 1 run scoreboard players operation $Fluctuation Lib *= $-1 Const
22-
# MP回復量を整数部と少数部に分離する
23-
# $AmountFloatにコピー
24-
scoreboard players operation $AmountFloat Temporary = $Fluctuation Lib
25-
# 10で除算
26-
scoreboard players operation $Fluctuation Lib /= $10 Const
27-
# 10で剰余算
28-
scoreboard players operation $AmountFloat Temporary %= $10 Const
29-
# 負数なら戻す
30-
execute if score $isNegative Temporary matches 1 run scoreboard players operation $Fluctuation Lib *= $-1 Const
31-
execute if score $isNegative Temporary matches 1 run scoreboard players operation $AmountFloat Lib *= $-1 Const
32-
# 小数点の桁あがりチェック
33-
scoreboard players operation @s MPFloat += $AmountFloat Temporary
34-
execute if score @s MPFloat matches 10.. run scoreboard players add $Fluctuation Lib 1
35-
execute if score @s MPFloat matches 10.. run scoreboard players remove @s MPFloat 10
36-
execute if score @s MPFloat matches ..-1 run scoreboard players remove $Fluctuation Lib 1
37-
execute if score @s MPFloat matches ..-1 run scoreboard players add @s MPFloat 10
7+
# 回復量を取り出す
8+
execute store result storage api: Argument.Fluctuation double 0.001 run scoreboard players get @s MPMax
389
# 表示を無効化する
39-
data modify storage lib: Argument.DisableLog set value true
10+
data modify storage api: Argument.DisableLog set value true
4011
# 回復
41-
function lib:mp/fluctuation
12+
function api:mp/fluctuation
4213
# クールダウンリセット
4314
scoreboard players set @s MPRegenCooldown 0
44-
# リセット
45-
scoreboard players reset $AmountFloat Temporary
46-
scoreboard players reset $isNegative Temporary

TheSkyBlessing/data/player_manager/functions/mp/viewer/adjust_xpbar.mcfunction

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
xp set @s 40 levels
1313
xp set @s 0 points
1414
scoreboard players operation $NowMP Temporary = @s MP
15+
scoreboard players operation $NowMP Temporary /= $10 Const
1516

1617
# pointを設定
1718
scoreboard players operation $NowLvP Temporary *= $2^24 Const
@@ -59,4 +60,4 @@
5960
execute if score $NowMP Temporary matches ..-1 run xp add @s 1 levels
6061

6162
# リセット
62-
scoreboard players reset $NowMP Temporary
63+
scoreboard players reset $NowMP Temporary

TheSkyBlessing/data/player_manager/functions/mp/viewer/check_xpbar.mcfunction

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@
2727
tag @s remove Success
2828
scoreboard players reset $Lv Temporary
2929
scoreboard players reset $LvP Temporary
30-
scoreboard players reset $NowLvP Temporary
30+
scoreboard players reset $NowLvP Temporary

0 commit comments

Comments
 (0)