Skip to content

Commit

Permalink
💥 v1 (#42)
Browse files Browse the repository at this point in the history
[regenerate cache]
  • Loading branch information
haiiro2gou authored Jan 16, 2024
1 parent e252e18 commit 7f099e5
Show file tree
Hide file tree
Showing 271 changed files with 2,151 additions and 1,719 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/datapack-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ jobs:
fetch-depth: 0
sparse-checkout: |
NaturalMergeSort
ScoreToHealth
- name: Deploy Dependencies
run: |
Expand Down Expand Up @@ -107,4 +106,4 @@ jobs:
message: |
Update Declares from haiiro2gou/TSB-Patcher@${{ github.SHA }}
[regenerate cache]
[regenerate cache]
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ MACOSX
*.zip
cspell.json

NaturalMergeSort
ScoreToHealth
NaturalMergeSort
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
# 50島極振り時: HP +50, MP+100, Atk+40%, Def+40%

# 固定加算
scoreboard players add $MaxHealth Global 20000
execute as @a run function player_manager:bonus/update_health_bonus
scoreboard players add $MaxMP Global 4
execute as @a run function player_manager:bonus/update_mp_bonus
scoreboard players add $BonusHealth Global 2
execute as @a run function asset:artifact/0002.blessing/trigger/update/health_bonus
scoreboard players add $BonusMP Global 4
execute as @a run function asset:artifact/0002.blessing/trigger/update/mp_bonus
# 選択トリガー
scoreboard players enable @s 02.Trigger
# チャット
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
execute unless score @s 02.Trigger matches 1..4 run function lib:message/invalid_operation
execute unless score @s 02.Trigger matches 1..4 run function asset:artifact/0002.blessing/trigger/show_trigger_chat
# 体力
execute if score @s 02.Trigger matches 1 run scoreboard players add $MaxHealth Global 10000
execute if score @s 02.Trigger matches 1 as @a run function player_manager:bonus/update_health_bonus
execute if score @s 02.Trigger matches 1 run scoreboard players add $BonusHealth Global 1
execute if score @s 02.Trigger matches 1 as @a run function asset:artifact/0002.blessing/trigger/update/health_bonus
# MP
execute if score @s 02.Trigger matches 2 run scoreboard players add $MaxMP Global 2
execute if score @s 02.Trigger matches 2 as @a run function player_manager:bonus/update_mp_bonus
execute if score @s 02.Trigger matches 2 run scoreboard players add $BonusMP Global 2
execute if score @s 02.Trigger matches 2 as @a run function asset:artifact/0002.blessing/trigger/update/mp_bonus
# 攻撃
execute if score @s 02.Trigger matches 3 run scoreboard players add $AttackBonus Global 1
execute if score @s 02.Trigger matches 3 as @a run function player_manager:bonus/update_attack_bonus
execute if score @s 02.Trigger matches 3 as @a run function asset:artifact/0002.blessing/trigger/update/attack_bonus
# 防御
execute if score @s 02.Trigger matches 4 run scoreboard players add $DefenseBonus Global 1
execute if score @s 02.Trigger matches 4 as @a run function player_manager:bonus/update_defense_bonus
execute if score @s 02.Trigger matches 4 as @a run function asset:artifact/0002.blessing/trigger/update/defense_bonus
# リセット
scoreboard players reset @s 02.Trigger
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,9 @@
#
# @within function asset:artifact/0002.blessing/trigger/*

#> For tellraw
# @private
#declare score_holder $ReadableHealth

# 体力だけx10000なので戻す
scoreboard players operation $ReadableHealth Temporary = $MaxHealth Global
scoreboard players operation $ReadableHealth Temporary /= $10000 Const
# 出力
tellraw @s {"text":"能力ボーナスを一つ選んでください"}
tellraw @s [{"text":"[選ぶ]","clickEvent":{"action":"run_command","value":"/trigger 02.Trigger set 1"},"color":"gold"},{"text":" 体力(現在値: +","color":"white"},{"score":{"name": "$ReadableHealth","objective":"Temporary"},"color":"aqua"},{"text":") +","color":"white"},{"text":"1","color":"aqua"}]
tellraw @s [{"text":"[選ぶ]","clickEvent":{"action":"run_command","value":"/trigger 02.Trigger set 2"},"color":"gold"},{"text":" 魔力(現在値: +","color":"white"},{"score":{"name": "$MaxMP","objective":"Global"},"color":"aqua"},{"text":") +","color":"white"},{"text":"2","color":"aqua"}]
tellraw @s [{"text":"[選ぶ]","clickEvent":{"action":"run_command","value":"/trigger 02.Trigger set 1"},"color":"gold"},{"text":" 体力(現在値: +","color":"white"},{"score":{"name": "$BonusHealth","objective":"Global"},"color":"aqua"},{"text":") +","color":"white"},{"text":"1","color":"aqua"}]
tellraw @s [{"text":"[選ぶ]","clickEvent":{"action":"run_command","value":"/trigger 02.Trigger set 2"},"color":"gold"},{"text":" 魔力(現在値: +","color":"white"},{"score":{"name": "$BonusMP","objective":"Global"},"color":"aqua"},{"text":") +","color":"white"},{"text":"2","color":"aqua"}]
tellraw @s [{"text":"[選ぶ]","clickEvent":{"action":"run_command","value":"/trigger 02.Trigger set 3"},"color":"gold"},{"text":" 攻撃(現在値: +","color":"white"},{"score":{"name": "$AttackBonus","objective":"Global"},"color":"aqua"},{"text":"%) +","color":"white"},{"text":"1","color":"aqua"},{"text":"%","color":"white"}]
tellraw @s [{"text":"[選ぶ]","clickEvent":{"action":"run_command","value":"/trigger 02.Trigger set 4"},"color":"gold"},{"text":" 防御(現在値: +","color":"white"},{"score":{"name": "$DefenseBonus","objective":"Global"},"color":"aqua"},{"text":"%) +","color":"white"},{"text":"1","color":"aqua"},{"text":"%","color":"white"}]
# リセット
scoreboard players reset $ReadableHealth Temporary
tellraw @s [{"text":"[選ぶ]","clickEvent":{"action":"run_command","value":"/trigger 02.Trigger set 4"},"color":"gold"},{"text":" 防御(現在値: +","color":"white"},{"score":{"name": "$DefenseBonus","objective":"Global"},"color":"aqua"},{"text":"%) +","color":"white"},{"text":"1","color":"aqua"},{"text":"%","color":"white"}]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#> player_manager:bonus/update_attack_bonus
#> asset:artifact/0002.blessing/trigger/update/attack_bonus
#
#
#
Expand All @@ -13,7 +13,7 @@
#declare score_holder $isNegative

# 古いのをremove
data modify storage api: Argument.UUID set value [I;2,2,1,1]
data modify storage api: Argument.UUID set value [I;1,1,2,0]
function api:modifier/attack/base/remove
# 差分にする
scoreboard players operation $Diff Temporary = $AttackBonus Global
Expand All @@ -31,6 +31,6 @@
scoreboard players reset $isNegative Temporary

# 適用
data modify storage api: Argument set value {Amount:-1,UUID:[I;2,2,1,1],Operation:"multiply"}
data modify storage api: Argument set value {Amount:-1,UUID:[I;1,1,2,0],Operation:"multiply"}
execute store result storage api: Argument.Amount double 0.01 run scoreboard players get $AttackBonus Global
function api:modifier/attack/base/add
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#> player_manager:bonus/update_defense_bonus
#> asset:artifact/0002.blessing/trigger/update/defense_bonus
#
#
#
Expand All @@ -13,7 +13,7 @@
#declare score_holder $isNegative

# 古いのをremove
data modify storage api: Argument.UUID set value [I;2,2,1,1]
data modify storage api: Argument.UUID set value [I;1,1,2,0]
function api:modifier/defense/base/remove
# 差分にする
scoreboard players operation $Diff Temporary = $DefenseBonus Global
Expand All @@ -31,6 +31,6 @@
scoreboard players reset $isNegative Temporary

# 適用
data modify storage api: Argument set value {Amount:-1,UUID:[I;2,2,1,1],Operation:"multiply"}
data modify storage api: Argument set value {Amount:-1,UUID:[I;1,1,2,0],Operation:"multiply"}
execute store result storage api: Argument.Amount double 0.01 run scoreboard players get $DefenseBonus Global
function api:modifier/defense/base/add
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#> player_manager:bonus/update_health_bonus
#> asset:artifact/0002.blessing/trigger/update/health_bonus
#
#
#
Expand All @@ -9,24 +9,29 @@
#> Diff
# @private
#declare score_holder $Diff
#declare score_holder $RemovedAmount
#declare score_holder $isNegative
#declare score_holder $isNegative

# 古いのをremove
data modify storage api: Argument.UUID set value [I;1,1,2,0]
function api:modifier/max_health/remove

# 差分にする
scoreboard players operation $Diff Temporary = $MaxHealth Global
scoreboard players operation $Diff Temporary -= @s ScoreToMaxHealth
# 符号を記録して正数に補正する
scoreboard players operation $Diff Temporary = $BonusHealth Global
execute store result score $RemovedAmount Temporary run data get storage api: Removed.Amount 1
execute unless score $RemovedAmount Temporary matches -2147483648..2147483647 run scoreboard players set $RemovedAmount Temporary 0
scoreboard players operation $Diff Temporary -= $RemovedAmount Temporary
# 出力
execute store result score $isNegative Temporary if score $Diff Temporary matches ..-1
execute if score $isNegative Temporary matches 1 run scoreboard players operation $Diff Temporary *= $-1 Const
# 整数部のみを取り出す
scoreboard players operation $Diff Temporary = $Diff Temporary
scoreboard players operation $Diff Temporary /= $10000 Const
# 出力
execute if score $isNegative Temporary matches 0 if score $Diff Temporary matches 1.. run tellraw @s [{"text":"最大体力が","color":"white"},{"score":{"name":"$Diff","objective":"Temporary"},"color":"aqua"},{"text":"増加した","color":"white"}]
execute if score $isNegative Temporary matches 1 if score $Diff Temporary matches 1.. run tellraw @s [{"text":"最大体力が","color":"white"},{"score":{"name":"$Diff","objective":"Temporary"},"color":"aqua"},{"text":"減少した","color":"white"}]
# リセット
scoreboard players reset $Diff Temporary
scoreboard players reset $RemovedAmount Temporary
scoreboard players reset $isNegative Temporary

# 適用
scoreboard players operation @s ScoreToMaxHealth = $MaxHealth Global
data modify storage api: Argument set value {Amount:-1,UUID:[I;1,1,2,0],Operation:"add"}
execute store result storage api: Argument.Amount double 1 run scoreboard players get $BonusHealth Global
function api:modifier/max_health/add
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#> player_manager:bonus/update_mp_bonus
#> asset:artifact/0002.blessing/trigger/update/mp_bonus
#
#
#
Expand All @@ -9,20 +9,29 @@
#> Diff
# @private
#declare score_holder $Diff
#declare score_holder $RemovedAmount
#declare score_holder $isNegative

# 古いのをremove
data modify storage api: Argument.UUID set value [I;1,1,2,0]
function api:modifier/max_mp/remove

# 差分にする
scoreboard players operation $Diff Temporary = $MaxMP Global
scoreboard players operation $Diff Temporary -= @s MPMax
scoreboard players operation $Diff Temporary = $BonusMP Global
execute store result score $RemovedAmount Temporary run data get storage api: Removed.Amount 1
execute unless score $RemovedAmount Temporary matches -2147483648..2147483647 run scoreboard players set $RemovedAmount Temporary 0
scoreboard players operation $Diff Temporary -= $RemovedAmount Temporary
# 出力
execute store result score $isNegative Temporary if score $Diff Temporary matches ..-1
execute if score $isNegative Temporary matches 1 run scoreboard players operation $Diff Temporary *= $-1 Const
execute if score $isNegative Temporary matches 0 if score $Diff Temporary matches 1.. run tellraw @s [{"text":"最大魔力が","color":"white"},{"score":{"name":"$Diff","objective":"Temporary"},"color":"aqua"},{"text":"増加した","color":"white"}]
execute if score $isNegative Temporary matches 1 if score $Diff Temporary matches 1.. run tellraw @s [{"text":"最大魔力が","color":"white"},{"score":{"name":"$Diff","objective":"Temporary"},"color":"aqua"},{"text":"減少した","color":"white"}]
# リセット
scoreboard players reset $Diff Temporary
scoreboard players reset $RemovedAmount Temporary
scoreboard players reset $isNegative Temporary


# 適用
scoreboard players operation @s MPMax = $MaxMP Global
data modify storage api: Argument set value {Amount:-1,UUID:[I;1,1,2,0],Operation:"add"}
execute store result storage api: Argument.Amount double 1 run scoreboard players get $BonusMP Global
function api:modifier/max_mp/add
Loading

0 comments on commit 7f099e5

Please sign in to comment.