Skip to content

Commit

Permalink
🚚 DollarPrefixをHashPrefixに変換
Browse files Browse the repository at this point in the history
  • Loading branch information
haiiro2gou committed Jan 25, 2024
1 parent 87a7d8f commit f8f1897
Show file tree
Hide file tree
Showing 458 changed files with 3,160 additions and 3,160 deletions.
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@
"datapack.lint.nameOfScoreHolders": [
"error",
{
"label": "DollerPrefix",
"prefix": "$"
"label": "HashPrefix",
"prefix": "#"
}
],
"datapack.lint.nameOfTeams": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@

#> Length
# @private
#declare score_holder $CandidatesLength
#declare score_holder $Argument.Index
#declare score_holder #CandidatesLength
#declare score_holder #Argument.Index

# セッション開ける
function lib:array/session/open
# 名前候補リスト
data modify storage lib: Array set value ['深淵','奈落','天空','始原','神威','太陽','生命','満月','星雲','極光','蒼天','夜闇']
# 候補リストの長さを取得
execute store result score $CandidatesLength Temporary if data storage lib: Array[]
execute store result score #CandidatesLength Temporary if data storage lib: Array[]
# ターゲットの名前をランダムに決める
execute store result score $Argument.Index Lib run function lib:random/
scoreboard players operation $Argument.Index Lib %= $CandidatesLength Temporary
execute store result score #Argument.Index Lib run function lib:random/
scoreboard players operation #Argument.Index Lib %= #CandidatesLength Temporary
# 移動
function lib:array/move
# 取得
data modify storage asset:temp 02.Name set from storage lib: Array[-1]
# リセット
function lib:array/session/close
scoreboard players reset $CandidatesLength
scoreboard players reset #CandidatesLength
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
# 50島極振り時: HP +50, MP+100, Atk+40%, Def+40%

# 固定加算
scoreboard players add $BonusHealth Global 2
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
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 $BonusHealth Global 1
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 $BonusMP Global 2
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 run scoreboard players add #AttackBonus Global 1
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 run scoreboard players add #DefenseBonus Global 1
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 @@ -6,7 +6,7 @@

# 出力
tellraw @s {"text":"能力ボーナスを一つ選んでください"}
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"}]
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"}]
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,29 @@

#> Diff
# @private
#declare score_holder $Diff
#declare score_holder $RemovedAmount
#declare score_holder $isNegative
#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/attack/base/remove
# 差分にする
scoreboard players operation $Diff Temporary = $AttackBonus Global
execute store result score $RemovedAmount Temporary run data get storage api: Removed.Amount 100
execute unless score $RemovedAmount Temporary matches -2147483648..2147483647 run scoreboard players set $RemovedAmount Temporary 0
scoreboard players operation $Diff Temporary -= $RemovedAmount Temporary
scoreboard players operation #Diff Temporary = #AttackBonus Global
execute store result score #RemovedAmount Temporary run data get storage api: Removed.Amount 100
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"}]
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 reset #Diff Temporary
scoreboard players reset #RemovedAmount Temporary
scoreboard players reset #isNegative Temporary

# 適用
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
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
Expand Up @@ -8,29 +8,29 @@

#> Diff
# @private
#declare score_holder $Diff
#declare score_holder $RemovedAmount
#declare score_holder $isNegative
#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/defense/base/remove
# 差分にする
scoreboard players operation $Diff Temporary = $DefenseBonus Global
execute store result score $RemovedAmount Temporary run data get storage api: Removed.Amount 100
execute unless score $RemovedAmount Temporary matches -2147483648..2147483647 run scoreboard players set $RemovedAmount Temporary 0
scoreboard players operation $Diff Temporary -= $RemovedAmount Temporary
scoreboard players operation #Diff Temporary = #DefenseBonus Global
execute store result score #RemovedAmount Temporary run data get storage api: Removed.Amount 100
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"}]
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 reset #Diff Temporary
scoreboard players reset #RemovedAmount Temporary
scoreboard players reset #isNegative Temporary

# 適用
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
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
Expand Up @@ -8,30 +8,30 @@

#> Diff
# @private
#declare score_holder $Diff
#declare score_holder $RemovedAmount
#declare score_holder $isNegative
#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_health/remove

# 差分にする
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
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
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"}]
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 reset #Diff Temporary
scoreboard players reset #RemovedAmount Temporary
scoreboard players reset #isNegative Temporary

# 適用
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
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
Expand Up @@ -8,30 +8,30 @@

#> Diff
# @private
#declare score_holder $Diff
#declare score_holder $RemovedAmount
#declare score_holder $isNegative
#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 = $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
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"}]
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 reset #Diff Temporary
scoreboard players reset #RemovedAmount Temporary
scoreboard players reset #isNegative Temporary

# 適用
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
execute store result storage api: Argument.Amount double 1 run scoreboard players get #BonusMP Global
function api:modifier/max_mp/add
2 changes: 1 addition & 1 deletion OhMyDat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ data remove storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].DataName
## 既知のストレージにIDでアクセスしたい場合 / If you want to use known storage by storage ID

```
scoreboard players set $ OhMyDatID <ID>
scoreboard players set # OhMyDatID <ID>
function oh_its_dat:please
```

Expand Down
Loading

0 comments on commit f8f1897

Please sign in to comment.