Skip to content

Commit 5fc673f

Browse files
authored
Merge branch 'master' into fix/haiiro_dmgapi-comment
2 parents 021d262 + a2354b5 commit 5fc673f

File tree

9 files changed

+25
-29
lines changed

9 files changed

+25
-29
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,19 @@
1010
function api:damage/core/get_status/
1111
# 与えるダメージの計算
1212
function api:damage/core/calc/
13+
# ダメージの補正
14+
execute if data storage api: Argument{BypassModifier:false} store result storage api: Damage double 0.0001 run scoreboard players get $Damage Temporary
15+
execute if data storage api: Argument{BypassModifier:false} run function api:damage/core/modify_damage.m {Side:"Defense"}
16+
execute if data storage api: Argument{BypassModifier:false} store result score $Damage Temporary run data get storage api: ModifiedDamage 100
17+
execute if data storage api: Argument{BypassModifier: true} run scoreboard players operation $Damage Temporary /= $100 Const
18+
# システム的なダメージ上限(9999.9/99999999(e4))チェック
19+
execute if score $Damage Temporary matches 99999000.. run scoreboard players set $Damage Temporary 99999000
1320
# Mobに適用
1421
function api:damage/core/health_subtract/
1522
# リセット
1623
scoreboard players reset $Health Temporary
1724
scoreboard players reset $Damage Temporary
25+
data remove storage api: ModifiedDamage
1826

1927
# MP 回復
2028
execute if data storage api: Argument.AdditionalMPHeal if entity @s[type=!player] as @a if score @s UserID = $LatestModifiedUser UserID run function api:damage/core/mp_heal

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@
2121
execute if score $Resistance Temporary matches 1.. run function api:damage/core/calc/resistance
2222
# エンチャントによる軽減計算部
2323
execute if score $EPF Temporary matches 1.. run function api:damage/core/calc/enchantment
24-
# システム的なダメージ上限(9999.9/99999999(e4))チェック
25-
execute if score $Damage Temporary matches 99999000.. run scoreboard players set $Damage Temporary 99999000
2624
# Reset
2725
scoreboard players reset $isDefenseCalcSkip Temporary
2826
scoreboard players reset $defensePoints Temporary
2927
scoreboard players reset $toughness Temporary
3028
scoreboard players reset $EPF Temporary
31-
scoreboard players reset $Resistance Temporary
29+
scoreboard players reset $Resistance Temporary

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66

77
# 体力
88
execute if entity @s[type=!player] store result score $Health Temporary run scoreboard players get @s MobHealth
9-
# ダメージ
10-
execute if data storage api: Argument{BypassModifier:false} run function api:damage/core/get_status/modify_and_get_damage
11-
execute if data storage api: Argument{BypassModifier: true} store result score $Damage Temporary run data get storage api: Argument.Damage 100
9+
# ダメージを取得
10+
execute store result score $Damage Temporary run data get storage api: Argument.Damage 100
1211
# 防御力
1312
execute if data storage api: Argument{BypassArmorDefense:false} store result score $defensePoints Temporary run attribute @s generic.armor get 100
1413
execute if data storage api: Argument{BypassArmorDefense: true} run scoreboard players set $defensePoints Temporary 0

TheSkyBlessing/data/api/functions/damage/core/get_status/modify_and_get_damage.mcfunction

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

TheSkyBlessing/data/api/functions/damage/core/health_subtract/non-player/.mcfunction

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
#declare score_holder $Fluctuation
1010
#declare tag UUIDAttacker
1111

12-
# ダメージ量を補正
13-
scoreboard players operation $Damage Temporary /= $100 Const
1412
# ダメージ表示
1513
scoreboard players set $Fluctuation Lib 0
1614
scoreboard players operation $Fluctuation Lib -= $Damage Temporary

TheSkyBlessing/data/api/functions/damage/core/health_subtract/player/.mcfunction

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# 難易度補正を掛ける
88
execute if data storage api: Argument{BypassDifficulty:false} run function api:damage/core/health_subtract/player/difficulty_modifier
99
# 引数として代入
10-
execute store result storage api: Argument.Fluctuation double -0.0001 run scoreboard players get $Damage Temporary
10+
execute store result storage api: Argument.Fluctuation double -0.01 run scoreboard players get $Damage Temporary
1111
# onAttackのトリガー
1212
function api:damage/core/trigger_events/player/attack_and_damage/
1313
# 体力の減少を反映させる

TheSkyBlessing/data/api/functions/damage/core/modify/player.mcfunction

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111
# ModifierIndex をインクリメントする
1212
scoreboard players add $ModifierIndex Global 1
1313
# ダメージに補正値を掛ける
14-
execute if data storage api: Argument{BypassModifier:false} run function oh_my_dat:please
15-
execute if data storage api: Argument{BypassModifier:false} run data modify storage api: Modifiers set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].Attributes.Value.Attack
16-
execute if data storage api: Argument{BypassModifier:false} run function api:damage/core/modify_damage
14+
execute if data storage api: Argument{BypassModifier:false} run data modify storage api: Damage set from storage api: Argument.Damage
15+
execute if data storage api: Argument{BypassModifier:false} run function api:damage/core/modify_damage.m {Side:"Attack"}
1716
execute if data storage api: Argument{BypassModifier:false} run data modify storage api: Argument.Damage set from storage api: ModifiedDamage
1817
# リセット
1918
data remove storage api: ModifiedDamage

TheSkyBlessing/data/api/functions/damage/core/modify_damage.mcfunction renamed to TheSkyBlessing/data/api/functions/damage/core/modify_damage.m.mcfunction

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
#> api:damage/core/modify_damage
1+
#> api:damage/core/modify_damage.m
22
#
33
# ダメージをapi: Modifiersを元に補正します
44
#
5+
# @input args
6+
# Side : "Attack" | "Defense"
57
# @within function
68
# api:damage/core/modify/player
7-
# api:damage/core/get_status/modify_and_get_damage
9+
# api:damage/core/attack
810

911
#> Temp
1012
# @private
@@ -16,7 +18,11 @@
1618

1719
# 必要なデータの取得と加算
1820
# 元ダメージ
19-
execute store result score $Damage Temporary run data get storage api: Argument.Damage 100
21+
execute store result score $Damage Temporary run data get storage api: Damage 100
22+
# 補正
23+
function oh_my_dat:please
24+
$data modify storage api: Modifiers set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].Attributes.Value.$(Side)
25+
# 補正値の計算
2026
# Base値による補正
2127
execute store result score $Modifier Temporary run data get storage api: Modifiers.Base 100
2228
execute unless data storage api: Modifiers.Base run scoreboard players set $Modifier Temporary 100
@@ -53,6 +59,7 @@
5359
# 代入
5460
execute store result storage api: ModifiedDamage double 0.0001 run scoreboard players get $Damage Temporary
5561
# リセット
62+
data remove storage api: Damage
5663
data remove storage api: Modifiers
5764
scoreboard players reset $Damage Temporary
5865
scoreboard players reset $Modifier Temporary

TheSkyBlessing/data/core/functions/define_const.mcfunction

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,5 +485,5 @@ scoreboard players set $2147483647 Const 2147483647
485485
scoreboard players set $-2147483648 Const -2147483648
486486
scoreboard players set $2147483647 Const 2147483647
487487

488-
scoreboard players set $155 Const 165
488+
scoreboard players set $155 Const 155
489489
scoreboard players set $165 Const 165

0 commit comments

Comments
 (0)