diff --git a/TheSkyBlessing/data/api/functions/damage/core/attack.mcfunction b/TheSkyBlessing/data/api/functions/damage/core/attack.mcfunction index bc3bef748e..e911112c54 100644 --- a/TheSkyBlessing/data/api/functions/damage/core/attack.mcfunction +++ b/TheSkyBlessing/data/api/functions/damage/core/attack.mcfunction @@ -11,7 +11,7 @@ # 与えるダメージの計算 function api:damage/core/calc/ # ダメージの補正 - execute if data storage api: Argument{BypassModifier:false} store result storage api: Damage double 0.0001 run scoreboard players get $Damage Temporary + execute if data storage api: Argument{BypassModifier:false} store result storage api: Damage double 0.01 run scoreboard players get $Damage Temporary execute if data storage api: Argument{BypassModifier:false} run function api:damage/core/modify_damage.m {Side:"Defense"} execute if data storage api: Argument{BypassModifier:false} if entity @s[type=!player,tag=!Enemy.Boss] if score $Metric Temporary matches ..99 run function metric:damage/normal.m {Condition:"Resist"} execute if data storage api: Argument{BypassModifier:false} if entity @s[type=!player,tag=!Enemy.Boss] if score $Metric Temporary matches 100 run function metric:damage/normal.m {Condition:"Normal"} @@ -21,11 +21,8 @@ execute if data storage api: Argument{BypassModifier:false} if entity @s[type=!player,tag= Enemy.Boss] if score $Metric Temporary matches 101.. run function metric:damage/angel.m {Condition:"Weak"} execute if data storage api: Argument{BypassModifier:false} run scoreboard players reset $Metric Temporary execute if data storage api: Argument{BypassModifier:false} store result score $Damage Temporary run data get storage api: ModifiedDamage 100 - execute if data storage api: Argument{BypassModifier: true} run scoreboard players operation $Damage Temporary /= $100 Const execute if data storage api: Argument{BypassModifier: true} if entity @s[type=!player,tag=!Enemy.Boss] run function metric:damage/normal.m {Condition:"Bypass"} execute if data storage api: Argument{BypassModifier: true} if entity @s[type=!player,tag= Enemy.Boss] run function metric:damage/angel.m {Condition:"Bypass"} -# システム的なダメージ上限(9999.9(e2))チェック - execute if score $Damage Temporary matches 999990.. run scoreboard players set $Damage Temporary 999990 # Mobに適用 function api:damage/core/health_subtract/ # リセット diff --git a/TheSkyBlessing/data/api/functions/damage/core/calc/.mcfunction b/TheSkyBlessing/data/api/functions/damage/core/calc/.mcfunction index d62388c04e..55453379a9 100644 --- a/TheSkyBlessing/data/api/functions/damage/core/calc/.mcfunction +++ b/TheSkyBlessing/data/api/functions/damage/core/calc/.mcfunction @@ -9,14 +9,13 @@ #declare score_holder $isDefenseCalcSkip # 計算式: -# damage * (1 - min(20, max(defensePoints / 5, defensePoints - damage / (2 + toughness / 4))) / 25) * (1 - min(5, resistanceLv) / 5) * (1 - (min(20, cappedEPF) / 25)) +# damage * (1 - min(20, max(defensePoints / 5, defensePoints - damage / (2 + toughness / 4))) / 25) * (1 - min(10, resistanceLv) / 10) * (1 - (min(20, cappedEPF) / 25)) -# 計算的なダメージ上限(21474.83)チェック - execute if score $Damage Temporary matches 2147483.. run scoreboard players set $Damage Temporary 2147483 +# 計算的なダメージ上限(214748.36)チェック + execute if score $Damage Temporary matches 21474836.. run scoreboard players set $Damage Temporary 21474836 # 防御による軽減計算部 execute if score $defensePoints Temporary matches 0 if score $toughness Temporary matches 0 run scoreboard players set $isDefenseCalcSkip Temporary 1 execute unless score $isDefenseCalcSkip Temporary matches 1 run function api:damage/core/calc/defense - execute if score $isDefenseCalcSkip Temporary matches 1 run scoreboard players operation $Damage Temporary *= $100 Const # 耐性エフェクトによる軽減計算部 execute if score $Resistance Temporary matches 1.. run function api:damage/core/calc/resistance # エンチャントによる軽減計算部 diff --git a/TheSkyBlessing/data/api/functions/damage/core/calc/defense.mcfunction b/TheSkyBlessing/data/api/functions/damage/core/calc/defense.mcfunction index 01fc0fa0ca..b78da404b0 100644 --- a/TheSkyBlessing/data/api/functions/damage/core/calc/defense.mcfunction +++ b/TheSkyBlessing/data/api/functions/damage/core/calc/defense.mcfunction @@ -8,54 +8,48 @@ # @private #declare score_holder $CalcA #declare score_holder $CalcB + #declare score_holder $CalcB1 #declare score_holder $CalcB2 - #declare score_holder $CalcB3 #declare score_holder $CalcC #declare score_holder $CalcD #declare score_holder $CalcE -# $CalcA(e2) = $defensePoints(e2) * e2 / 5 / e2 +# $CalcA(e2) = $defensePoints(e2) / 5 scoreboard players operation $CalcA Temporary = $defensePoints Temporary - scoreboard players operation $CalcA Temporary *= $20 Const - scoreboard players operation $CalcA Temporary /= $100 Const -# $CalcB3(e2) = $toughness(e2) * e2 / 4 / e2 + 2 * e2 : $damage >= 1000 * e2 -# $CalcB3(e4) = $toughness(e2) * e2 / 4 + 2 * e4 : $damage < 1000 * e2 - scoreboard players operation $CalcB3 Temporary = $toughness Temporary - scoreboard players operation $CalcB3 Temporary *= $25 Const - execute if score $Damage Temporary matches 100000.. run scoreboard players operation $CalcB3 Temporary /= $100 Const - execute if score $Damage Temporary matches 100000.. run scoreboard players operation $CalcB3 Temporary += $200 Const - execute if score $Damage Temporary matches ..099999 run scoreboard players operation $CalcB3 Temporary += $20000 Const -# $CalcB2(e2) = $damage(e2) * e2 / $CalcB3(e2) : $damage >= 1000 * e2 -# $CalcB2(e2) = $damage(e2) * e4 / $CalcB3(e4) : $damage < 1000 * e2 + scoreboard players operation $CalcA Temporary /= $5 Const +# $CalcB1(e2) = 2 * e2 + $toughness(e2) / 4 + scoreboard players operation $CalcB1 Temporary = $toughness Temporary + scoreboard players operation $CalcB1 Temporary /= $4 Const + scoreboard players add $CalcB1 Temporary 200 +# $CalcB2(e2) = $Damage(e2) * e2 / $CalcB1(e2) scoreboard players operation $CalcB2 Temporary = $Damage Temporary - execute if score $Damage Temporary matches 100000.. run scoreboard players operation $CalcB2 Temporary *= $100 Const - execute if score $Damage Temporary matches ..099999 run scoreboard players operation $CalcB2 Temporary *= $10000 Const - scoreboard players operation $CalcB2 Temporary /= $CalcB3 Temporary + scoreboard players operation $CalcB2 Temporary *= $100 Const + scoreboard players operation $CalcB2 Temporary /= $CalcB1 Temporary # $CalcB(e2) = $defensePoints(e2) - $CalcB2(e2) scoreboard players operation $CalcB Temporary = $defensePoints Temporary scoreboard players operation $CalcB Temporary -= $CalcB2 Temporary -# $CalcC(e4) = min(max($CalcA(e2), $CalcB(e2)), 20 * e2) * e2 / 25 +# $CalcC(e3) = min(max($CalcA(e2), $CalcB(e2)), 20 * e2) * e1 / 25 scoreboard players operation $CalcC Temporary = $CalcA Temporary scoreboard players operation $CalcC Temporary > $CalcB Temporary scoreboard players operation $CalcC Temporary < $2000 Const scoreboard players operation $CalcC Temporary *= $4 Const -# $CalcD(e3) = (1 * e4 - $CalcC(e4)) / e1 : $damage >= 1000 * e2 -# $CalcD(e4) = (1 * e4 - $CalcC(e4)) : $damage < 1000 * e2 - scoreboard players operation $CalcD Temporary = $10000 Const + scoreboard players operation $CalcC Temporary /= $10 Const +# $CalcD(e3) = 1 * e3 - $CalcC(e3) + scoreboard players set $CalcD Temporary 1000 scoreboard players operation $CalcD Temporary -= $CalcC Temporary - execute if score $Damage Temporary matches 100000.. run scoreboard players operation $CalcD Temporary /= $10 Const -# $damage(e4) = $damage(e2) * $CalcD(e3) / e1 : $damage >= 1000 * e2 -# $damage(e4) = $damage(e2) * $CalcD(e4) / e2 : $damage < 1000 * e2 +# $Damage(e2) = $Damage(e2) * $CalcD(e3) / e3 scoreboard players operation $CalcE Temporary = $Damage Temporary + execute if score $Damage Temporary matches 1000000.. run scoreboard players operation $CalcE Temporary /= $10 Const scoreboard players operation $CalcE Temporary *= $CalcD Temporary - execute if score $Damage Temporary matches 100000.. run scoreboard players operation $CalcE Temporary /= $10 Const - execute if score $Damage Temporary matches ..099999 run scoreboard players operation $CalcE Temporary /= $100 Const + execute if score $Damage Temporary matches 1000000.. run scoreboard players operation $CalcE Temporary /= $100 Const + execute if score $Damage Temporary matches ..999999 run scoreboard players operation $CalcE Temporary /= $1000 Const scoreboard players operation $Damage Temporary = $CalcE Temporary + # リセット scoreboard players reset $CalcA Temporary scoreboard players reset $CalcB Temporary + scoreboard players reset $CalcB1 Temporary scoreboard players reset $CalcB2 Temporary - scoreboard players reset $CalcB3 Temporary scoreboard players reset $CalcC Temporary scoreboard players reset $CalcD Temporary - scoreboard players reset $CalcE Temporary \ No newline at end of file + scoreboard players reset $CalcE Temporary diff --git a/TheSkyBlessing/data/api/functions/damage/core/calc/resistance.mcfunction b/TheSkyBlessing/data/api/functions/damage/core/calc/resistance.mcfunction index 8db44467a9..a789e1c700 100644 --- a/TheSkyBlessing/data/api/functions/damage/core/calc/resistance.mcfunction +++ b/TheSkyBlessing/data/api/functions/damage/core/calc/resistance.mcfunction @@ -8,7 +8,7 @@ # @private #declare score_holder $Mul -# $Resistance(e1) *= min(5, $Resistance(e0)) * e1 / 5 +# $Resistance(e1) *= min(10, $Resistance(e0)) * e1 / 10 scoreboard players operation $Resistance Temporary < $10 Const # $Mul(e1) = 1 * e1 - $Resistance(e1) scoreboard players operation $Mul Temporary = $10 Const @@ -17,4 +17,4 @@ scoreboard players operation $Damage Temporary *= $Mul Temporary scoreboard players operation $Damage Temporary /= $10 Const # リセット - scoreboard players reset $Mul Temporary \ No newline at end of file + scoreboard players reset $Mul Temporary diff --git a/TheSkyBlessing/data/api/functions/damage/core/health_subtract/force_cap.mcfunction b/TheSkyBlessing/data/api/functions/damage/core/health_subtract/force_cap.mcfunction new file mode 100644 index 0000000000..16c82bea02 --- /dev/null +++ b/TheSkyBlessing/data/api/functions/damage/core/health_subtract/force_cap.mcfunction @@ -0,0 +1,7 @@ +#> api:damage/core/health_subtract/force_cap +# +# システム的なダメージ上限(99999.9(e2))チェック +# +# @within function api:damage/core/health_subtract/*player/ + +execute if score $Damage Temporary matches 9999990.. run scoreboard players set $Damage Temporary 9999990 diff --git a/TheSkyBlessing/data/api/functions/damage/core/health_subtract/non-player/.mcfunction b/TheSkyBlessing/data/api/functions/damage/core/health_subtract/non-player/.mcfunction index 558134b892..b31c280509 100644 --- a/TheSkyBlessing/data/api/functions/damage/core/health_subtract/non-player/.mcfunction +++ b/TheSkyBlessing/data/api/functions/damage/core/health_subtract/non-player/.mcfunction @@ -11,7 +11,10 @@ #> Val # @private -#declare score_holder $Fluctuation + #declare score_holder $Fluctuation + +# ダメージ上限 + function api:damage/core/health_subtract/force_cap # ダメージ表示 scoreboard players set $Fluctuation Lib 0 diff --git a/TheSkyBlessing/data/api/functions/damage/core/health_subtract/player/.mcfunction b/TheSkyBlessing/data/api/functions/damage/core/health_subtract/player/.mcfunction index 5ffb00c149..a1fe1d26c3 100644 --- a/TheSkyBlessing/data/api/functions/damage/core/health_subtract/player/.mcfunction +++ b/TheSkyBlessing/data/api/functions/damage/core/health_subtract/player/.mcfunction @@ -6,6 +6,8 @@ # 難易度補正を掛ける execute if data storage api: Argument{BypassDifficulty:false} run function api:damage/core/health_subtract/player/difficulty_modifier +# ダメージ上限 + function api:damage/core/health_subtract/force_cap # 引数として代入 execute store result storage api: Argument.Fluctuation double -0.01 run scoreboard players get $Damage Temporary # 統計送りにする diff --git a/TheSkyBlessing/data/api/functions/damage/core/health_subtract/player/difficulty_modifier.mcfunction b/TheSkyBlessing/data/api/functions/damage/core/health_subtract/player/difficulty_modifier.mcfunction index c03db2d075..d55d40035a 100644 --- a/TheSkyBlessing/data/api/functions/damage/core/health_subtract/player/difficulty_modifier.mcfunction +++ b/TheSkyBlessing/data/api/functions/damage/core/health_subtract/player/difficulty_modifier.mcfunction @@ -11,7 +11,6 @@ scoreboard players add $Difficulty Temporary 6 scoreboard players operation $Damage Temporary *= $Difficulty Temporary scoreboard players operation $Damage Temporary /= $10 Const - execute if score $Damage Temporary matches 999990000.. run scoreboard players set $Damage Temporary 999990000 # リセット scoreboard players reset $Difficulty Temporary