Skip to content

Commit

Permalink
Merge branch 'master' into rework/haiiro_artifact-trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
haiiro2gou committed Dec 17, 2024
2 parents 94ff391 + a271ac4 commit 6c923b3
Show file tree
Hide file tree
Showing 72 changed files with 403 additions and 238 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
function api:damage/core/get_status/
# 与えるダメージの計算
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} run function api:damage/core/modify_damage.m {Side:"Defense"}
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
# システム的なダメージ上限(9999.9/99999999(e4))チェック
execute if score $Damage Temporary matches 99999000.. run scoreboard players set $Damage Temporary 99999000
# Mobに適用
function api:damage/core/health_subtract/
# リセット
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@
execute if score $Resistance Temporary matches 1.. run function api:damage/core/calc/resistance
# エンチャントによる軽減計算部
execute if score $EPF Temporary matches 1.. run function api:damage/core/calc/enchantment
# システム的なダメージ上限(9999.9/99999999(e4))チェック
execute if score $Damage Temporary matches 99999000.. run scoreboard players set $Damage Temporary 99999000
# Reset
scoreboard players reset $isDefenseCalcSkip Temporary
scoreboard players reset $defensePoints Temporary
scoreboard players reset $toughness Temporary
scoreboard players reset $EPF Temporary
scoreboard players reset $Resistance Temporary
scoreboard players reset $Resistance Temporary
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@

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

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
#declare score_holder $Fluctuation
#declare tag UUIDAttacker

# ダメージ量を補正
scoreboard players operation $Damage Temporary /= $100 Const
# ダメージ表示
scoreboard players set $Fluctuation Lib 0
scoreboard players operation $Fluctuation Lib -= $Damage Temporary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
# 難易度補正を掛ける
execute if data storage api: Argument{BypassDifficulty:false} run function api:damage/core/health_subtract/player/difficulty_modifier
# 引数として代入
execute store result storage api: Argument.Fluctuation double -0.0001 run scoreboard players get $Damage Temporary
execute store result storage api: Argument.Attacker int 1 run scoreboard players get $LatestModifiedEntity MobUUID
# data modify storage api: Argument.AttackType set from storage api: Argument.AttackType
# data modify storage api: Argument.ElementType set from storage api: Argument.ElementType
# data modify storage api: Argument.DisableLog set from storage api: Argument.DisableLog
execute store result storage api: Argument.Fluctuation double -0.01 run scoreboard players get $Damage Temporary
# onAttackのトリガー
function api:damage/core/trigger_events/player/attack_and_damage/
# 体力の減少を反映させる
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@

# 攻撃者情報の記録
scoreboard players operation $LatestModifiedEntity MobUUID = @s MobUUID
execute store result storage api: Argument.Attacker int 1 run scoreboard players get @s MobUUID
data modify storage api: Argument.AttackerType set value "non-player"
# ModifierIndex をインクリメントする
scoreboard players add $ModifierIndex Global 1
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@

# 攻撃者情報の記録
execute store result score $LatestModifiedEntity MobUUID run data get storage api: Argument.MobUUID
execute store result storage api: Argument.Attacker int 1 run data get storage api: Argument.MobUUID
data modify storage api: Argument.AttackerType set value "non-player"
# ModifierIndex をインクリメントする
scoreboard players add $ModifierIndex Global 1
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@

# プレイヤー情報の記録
scoreboard players operation $LatestModifiedUser UserID = @s UserID
execute store result storage api: Argument.Attacker int 1 run scoreboard players get @s UserID
data modify storage api: Argument.AttackerType set value "player"
# ModifierIndex をインクリメントする
scoreboard players add $ModifierIndex Global 1
# ダメージに補正値を掛ける
execute if data storage api: Argument{BypassModifier:false} run function oh_my_dat:please
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
execute if data storage api: Argument{BypassModifier:false} run function api:damage/core/modify_damage
execute if data storage api: Argument{BypassModifier:false} run data modify storage api: Damage set from storage api: Argument.Damage
execute if data storage api: Argument{BypassModifier:false} run function api:damage/core/modify_damage.m {Side:"Attack"}
execute if data storage api: Argument{BypassModifier:false} run data modify storage api: Argument.Damage set from storage api: ModifiedDamage
# リセット
data remove storage api: ModifiedDamage
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#> api:damage/core/modify_damage
#> api:damage/core/modify_damage.m
#
# ダメージをapi: Modifiersを元に補正します
#
# @input args
# Side : "Attack" | "Defense"
# @within function
# api:damage/core/modify/player
# api:damage/core/get_status/modify_and_get_damage
# api:damage/core/attack

#> Temp
# @private
Expand All @@ -16,7 +18,11 @@

# 必要なデータの取得と加算
# 元ダメージ
execute store result score $Damage Temporary run data get storage api: Argument.Damage 100
execute store result score $Damage Temporary run data get storage api: Damage 100
# 補正
function oh_my_dat:please
$data modify storage api: Modifiers set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].Attributes.Value.$(Side)
# 補正値の計算
# Base値による補正
execute store result score $Modifier Temporary run data get storage api: Modifiers.Base 100
execute unless data storage api: Modifiers.Base run scoreboard players set $Modifier Temporary 100
Expand Down Expand Up @@ -53,6 +59,7 @@
# 代入
execute store result storage api: ModifiedDamage double 0.0001 run scoreboard players get $Damage Temporary
# リセット
data remove storage api: Damage
data remove storage api: Modifiers
scoreboard players reset $Damage Temporary
scoreboard players reset $Modifier Temporary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
data remove storage api: Argument.Damage
data remove storage api: Argument.AttackType
data remove storage api: Argument.ElementType
data remove storage api: Argument.Attacker
data remove storage api: Argument.AttackerType
data remove storage api: Argument.DeathMessage
data remove storage api: Argument.FixedDamage
data remove storage api: Argument.BypassModifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
# 補正フラグを立てる
data modify storage api: DamageLibModified set value true
# 補正
execute if entity @s[type=player] run function api:damage/core/modify/player
execute if entity @s[type= player] run function api:damage/core/modify/player
execute if entity @s[type=!player] run function api:damage/core/modify/non-player
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
execute unless data storage asset:effect DurationOperation run data modify storage asset:effect DurationOperation set from storage api: Argument.DurationOperation
execute unless data storage asset:effect StackOperation run data modify storage asset:effect StackOperation set from storage api: Argument.StackOperation
# デフォルト値
execute unless data storage asset:effect Visible run data modify storage asset:effect Visible set value true
execute unless data storage asset:effect Stack run data modify storage asset:effect Stack set value 1
execute unless data storage asset:effect StackVisible run data modify storage asset:effect StackVisible set value true
execute unless data storage asset:effect DurationOperation run data modify storage asset:effect DurationOperation set value "replace"
execute unless data storage asset:effect StackOperation run data modify storage asset:effect StackOperation set value "replace"
execute unless data storage asset:effect MaxDuration run data modify storage asset:effect MaxDuration set value 2147483647
Expand All @@ -42,7 +44,9 @@
data remove storage asset:effect Name
data remove storage asset:effect Description
data remove storage asset:effect Duration
data remove storage asset:effect Visible
data remove storage asset:effect Stack
data remove storage asset:effect StackVisible
data remove storage asset:effect DurationOperation
data remove storage asset:effect StackOperation
data remove storage asset:effect MaxDuration
Expand Down
4 changes: 2 additions & 2 deletions TheSkyBlessing/data/api/functions/mp/check.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
#declare score_holder $CheckMP

# 閾値を取得
execute store result score $CheckMP Temporary run data get storage api: Argument.Threshold
execute store result score $CheckMP Temporary run data get storage api: Argument.Threshold 10
# Bypass
execute if entity @s[tag=DevPrivilege] run scoreboard players set $CheckMP Temporary 0
# チェック
execute store success storage api: Return.IsThresholdOrMore byte 1 if score $CheckMP Temporary <= @s MP
# リセット
scoreboard players reset $CheckMP Temporary
scoreboard players reset $CheckMP Temporary
7 changes: 4 additions & 3 deletions TheSkyBlessing/data/api/functions/mp/fluctuation.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@
#declare score_holder $Fluctuation

# 増減量取得
execute store result score $Fluctuation Lib run data get storage api: Argument.Fluctuation
execute store result score $Fluctuation Temporary run data get storage api: Argument.Fluctuation 10
# 増減
scoreboard players operation @s MP += $Fluctuation Lib
scoreboard players operation @s MP += $Fluctuation Temporary
scoreboard players operation @s MP > $0 Const
scoreboard players operation @s MP < @s MPMax
# 表示
scoreboard players operation $Fluctuation Temporary /= $10 Const
execute unless data storage api: Argument{DisableLog:1b} at @s run function lib:status_log/show_mp
# リセット
scoreboard players reset $Fluctuation Lib
scoreboard players reset $Fluctuation Temporary
data remove storage api: Argument.Fluctuation
data remove storage api: Argument.DisableLog
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
# @api

# 取得
execute store result storage api: Return.CurrentMP int 1 run scoreboard players get @s MP
execute store result storage api: Return.CurrentMP int 0.1 run scoreboard players get @s MP
2 changes: 1 addition & 1 deletion TheSkyBlessing/data/api/functions/mp/get_max.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
# @api

# 取得
execute store result storage api: Return.MaxMP int 1 run scoreboard players get @s MPMax
execute store result storage api: Return.MaxMP int 0.1 run scoreboard players get @s MPMax
4 changes: 2 additions & 2 deletions TheSkyBlessing/data/api/functions/mp/set.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
#declare score_holder $MP

# 取得
execute store result score $MP Temporary run data get storage api: Argument.MP
execute store result score $MP Temporary run data get storage api: Argument.MP 10
# セット
scoreboard players operation @s MP = $MP Temporary
# リセット
scoreboard players reset $MP Temporary
data remove storage api: Argument.MP
data remove storage api: Argument.MP
2 changes: 1 addition & 1 deletion TheSkyBlessing/data/api/functions/mp/update_max.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
# Storage呼び出し
function oh_my_dat:please
# 最大MP変更
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
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
scoreboard players operation @s MPMax > $0 Const
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
# asset:artifact/*/register
# asset:artifact/enum/**
# asset_manager:artifact/**
# player_manager:actionbar/
#declare storage asset:artifact

#> 特殊クールダウン
Expand Down Expand Up @@ -57,6 +56,7 @@
#declare tag Victim
#declare tag Healer
#declare tag Receiver
#declare tag ShotArrow

#> セレクターテンプレート
# @within * asset:artifact/**
Expand All @@ -75,6 +75,10 @@
#declare score_holder $Max
#declare score_holder $LatestUsedTick

#> 矢検知
# @within function asset_manager:artifact/triggers/trigger/
#declare score_holder $GameTime

#> スロットの数値化
# @within function
# asset_manager:artifact/data/new/fetch_data/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,10 @@
#
# @within function asset_manager:artifact/check/

#> Private
# @private
#declare score_holder $Length

# MP必要量を取得
execute if data storage asset:artifact TargetItem.MPRequire run data modify storage api: Argument.Threshold set from storage asset:artifact TargetItems[-1].tag.TSB.MPRequire
execute unless data storage asset:artifact TargetItem.MPRequire run data modify storage api: Argument.Threshold set from storage asset:artifact TargetItems[-1].tag.TSB.MPCost
# アイテム数だけ増やす
# execute store result score $Length Temporary if data storage asset:artifact TargetItems[]
# scoreboard players operation $CheckMP Lib *= $Length Temporary
# チェック
function api:mp/check
# タグ付与
execute unless data storage api: Return{IsThresholdOrMore:true} run tag @s add CheckFailed
# リセット
scoreboard players reset $Length Temporary
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
#
# @within function asset_manager:artifact/cooldown/main_bar/

$data modify storage asset:artifact MainBarMessage set value ['{"text":"\\uC051","font":"space"}','{"text":"\\u$(Value)","font":"cooldown/main_bar","color":"$(Color)"}','{"text":"\\uC051","font":"space"}']
$data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].Message.MainBar set value ['{"text":"\\uC051","font":"space"}','{"text":"\\u$(Value)","font":"cooldown/main_bar","color":"$(Color)"}','{"text":"\\uC051","font":"space"}']
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
#
# @within function asset_manager:artifact/cooldown/mini_bar/

$data modify storage asset:artifact MiniBarsMessage set value ['{"text":"\\uC151","font":"space"}','{"text":"\\u$(Head)","font":"cooldown/mini_bar/head"}','{"text":"\\uC024","font":"space"}','{"text":"\\u$(Chest)","font":"cooldown/mini_bar/chest"}','{"text":"\\uC024","font":"space"}','{"text":"\\u$(Legs)","font":"cooldown/mini_bar/legs"}','{"text":"\\uC024","font":"space"}','{"text":"\\u$(Feet)","font":"cooldown/mini_bar/feet"}','{"text":"\\u0003","font":"space"}','{"text":"\\u$(Offhand)","font":"cooldown/mini_bar/offhand"}','{"text":"\\u0011","font":"space"}','{"text":"\\u$(Hotbar0)","font":"cooldown/mini_bar/common"}','{"text":"\\u0002","font":"space"}','{"text":"\\u$(Hotbar1)","font":"cooldown/mini_bar/common"}','{"text":"\\u0002","font":"space"}','{"text":"\\u$(Hotbar2)","font":"cooldown/mini_bar/common"}','{"text":"\\u0002","font":"space"}','{"text":"\\u$(Hotbar3)","font":"cooldown/mini_bar/common"}','{"text":"\\u0002","font":"space"}','{"text":"\\u$(Hotbar4)","font":"cooldown/mini_bar/common"}','{"text":"\\u0002","font":"space"}','{"text":"\\u$(Hotbar5)","font":"cooldown/mini_bar/common"}','{"text":"\\u0002","font":"space"}','{"text":"\\u$(Hotbar6)","font":"cooldown/mini_bar/common"}','{"text":"\\u0002","font":"space"}','{"text":"\\u$(Hotbar7)","font":"cooldown/mini_bar/common"}','{"text":"\\u0002","font":"space"}','{"text":"\\u$(Hotbar8)","font":"cooldown/mini_bar/common"}','{"text":"\\uC089","font":"space"}']
$data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].Message.MiniBars set value ['{"text":"\\uC151","font":"space"}','{"text":"\\u$(Head)","font":"cooldown/mini_bar/head"}','{"text":"\\uC024","font":"space"}','{"text":"\\u$(Chest)","font":"cooldown/mini_bar/chest"}','{"text":"\\uC024","font":"space"}','{"text":"\\u$(Legs)","font":"cooldown/mini_bar/legs"}','{"text":"\\uC024","font":"space"}','{"text":"\\u$(Feet)","font":"cooldown/mini_bar/feet"}','{"text":"\\u0003","font":"space"}','{"text":"\\u$(Offhand)","font":"cooldown/mini_bar/offhand"}','{"text":"\\u0011","font":"space"}','{"text":"\\u$(Hotbar0)","font":"cooldown/mini_bar/common"}','{"text":"\\u0002","font":"space"}','{"text":"\\u$(Hotbar1)","font":"cooldown/mini_bar/common"}','{"text":"\\u0002","font":"space"}','{"text":"\\u$(Hotbar2)","font":"cooldown/mini_bar/common"}','{"text":"\\u0002","font":"space"}','{"text":"\\u$(Hotbar3)","font":"cooldown/mini_bar/common"}','{"text":"\\u0002","font":"space"}','{"text":"\\u$(Hotbar4)","font":"cooldown/mini_bar/common"}','{"text":"\\u0002","font":"space"}','{"text":"\\u$(Hotbar5)","font":"cooldown/mini_bar/common"}','{"text":"\\u0002","font":"space"}','{"text":"\\u$(Hotbar6)","font":"cooldown/mini_bar/common"}','{"text":"\\u0002","font":"space"}','{"text":"\\u$(Hotbar7)","font":"cooldown/mini_bar/common"}','{"text":"\\u0002","font":"space"}','{"text":"\\u$(Hotbar8)","font":"cooldown/mini_bar/common"}','{"text":"\\uC089","font":"space"}']
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ function oh_my_dat:please
execute if entity @s[advancements={core:handler/damage={blocked=false}}] run data modify storage asset:artifact Blocked set value false

# ダメージ取得
scoreboard players operation $Damage Temporary = @s TakenDamage
scoreboard players operation $Damage Temporary += @s TakenDamage
scoreboard players operation $Damage Temporary += @s AbsorbedDamage
scoreboard players operation $Damage Temporary *= $10 Const
# ArtifactEvents にデータ追加
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Damage append value {IsVanilla:true}
Expand All @@ -40,4 +41,5 @@ function oh_my_dat:please
data remove storage asset:artifact Blocked
data remove storage asset:artifact DamageType
scoreboard players reset @s TakenDamage
scoreboard players reset @s AbsorbedDamage
scoreboard players reset $Damage Temporary
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# asset_manager:artifact/triggers/
# asset_manager:artifact/triggers/trigger/
# asset_manager:artifact/triggers/use_item/
# asset_manager:artifact/triggers/shot/

# タグをはがす
tag @s remove ConsumingItem
Expand Down
Loading

0 comments on commit 6c923b3

Please sign in to comment.