File tree Expand file tree Collapse file tree 9 files changed +25
-29
lines changed
api/functions/damage/core Expand file tree Collapse file tree 9 files changed +25
-29
lines changed Original file line number Diff line number Diff line change 10
10
function api:damage/core/get_status/
11
11
# 与えるダメージの計算
12
12
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
13
20
# Mobに適用
14
21
function api:damage/core/health_subtract/
15
22
# リセット
16
23
scoreboard players reset $Health Temporary
17
24
scoreboard players reset $Damage Temporary
25
+ data remove storage api : ModifiedDamage
18
26
19
27
# MP 回復
20
28
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
Original file line number Diff line number Diff line change 21
21
execute if score $Resistance Temporary matches 1 .. run function api:damage/core/calc/resistance
22
22
# エンチャントによる軽減計算部
23
23
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
26
24
# Reset
27
25
scoreboard players reset $isDefenseCalcSkip Temporary
28
26
scoreboard players reset $defensePoints Temporary
29
27
scoreboard players reset $toughness Temporary
30
28
scoreboard players reset $EPF Temporary
31
- scoreboard players reset $Resistance Temporary
29
+ scoreboard players reset $Resistance Temporary
Original file line number Diff line number Diff line change 6
6
7
7
# 体力
8
8
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
12
11
# 防御力
13
12
execute if data storage api : Argument {BypassArmorDefense : false } store result score $defensePoints Temporary run attribute @s generic . armor get 100
14
13
execute if data storage api : Argument {BypassArmorDefense : true } run scoreboard players set $defensePoints Temporary 0
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 9
9
# declare score_holder $Fluctuation
10
10
# declare tag UUIDAttacker
11
11
12
- # ダメージ量を補正
13
- scoreboard players operation $Damage Temporary /= $100 Const
14
12
# ダメージ表示
15
13
scoreboard players set $Fluctuation Lib 0
16
14
scoreboard players operation $Fluctuation Lib -= $Damage Temporary
Original file line number Diff line number Diff line change 7
7
# 難易度補正を掛ける
8
8
execute if data storage api : Argument {BypassDifficulty : false } run function api:damage/core/health_subtract/player/difficulty_modifier
9
9
# 引数として代入
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
11
11
# onAttackのトリガー
12
12
function api:damage/core/trigger_events/player/attack_and_damage/
13
13
# 体力の減少を反映させる
Original file line number Diff line number Diff line change 11
11
# ModifierIndex をインクリメントする
12
12
scoreboard players add $ModifierIndex Global 1
13
13
# ダメージに補正値を掛ける
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 " }
17
16
execute if data storage api : Argument {BypassModifier : false } run data modify storage api : Argument . Damage set from storage api : ModifiedDamage
18
17
# リセット
19
18
data remove storage api : ModifiedDamage
Original file line number Diff line number Diff line change 1
- #> api:damage/core/modify_damage
1
+ #> api:damage/core/modify_damage.m
2
2
#
3
3
# ダメージをapi: Modifiersを元に補正します
4
4
#
5
+ # @input args
6
+ # Side : "Attack" | "Defense"
5
7
# @within function
6
8
# api:damage/core/modify/player
7
- # api:damage/core/get_status/modify_and_get_damage
9
+ # api:damage/core/attack
8
10
9
11
#> Temp
10
12
# @private
16
18
17
19
# 必要なデータの取得と加算
18
20
# 元ダメージ
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
+ # 補正値の計算
20
26
# Base値による補正
21
27
execute store result score $Modifier Temporary run data get storage api : Modifiers . Base 100
22
28
execute unless data storage api : Modifiers . Base run scoreboard players set $Modifier Temporary 100
53
59
# 代入
54
60
execute store result storage api : ModifiedDamage double 0.0001 run scoreboard players get $Damage Temporary
55
61
# リセット
62
+ data remove storage api : Damage
56
63
data remove storage api : Modifiers
57
64
scoreboard players reset $Damage Temporary
58
65
scoreboard players reset $Modifier Temporary
Original file line number Diff line number Diff line change @@ -485,5 +485,5 @@ scoreboard players set $2147483647 Const 2147483647
485
485
scoreboard players set $-2147483648 Const -2147483648
486
486
scoreboard players set $2147483647 Const 2147483647
487
487
488
- scoreboard players set $155 Const 165
488
+ scoreboard players set $155 Const 155
489
489
scoreboard players set $165 Const 165
You can’t perform that action at this time.
0 commit comments