-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Item Detection: Document and follow new conventions
This documents all functions and declarations in item detection (Work towards #5). This also renames some tremporary declarations to follow new conventions better (work towards #4).
- Loading branch information
1 parent
a2967f6
commit 8b74b5d
Showing
184 changed files
with
2,350 additions
and
420 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 26 additions & 9 deletions
35
data/bingo/functions/item_detection/helper/announce.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 10 additions & 1 deletion
11
data/bingo/functions/item_detection/helper/check_and_announce.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,15 @@ | ||
#> bingo:item_detection/helper/check_and_announce | ||
# | ||
# This function checks whether @s' team already has obtained the currently | ||
# selcted item. If they didn't it announces the item receivement and also | ||
# checks if a goal was reached. | ||
# | ||
# @within bingo:item_detection/items/* | ||
# @context entity Player who just obtained the item | ||
|
||
function bingo:util/find_player_team | ||
|
||
function bingo:item_detection/helper/set_border | ||
execute if score $success bingo.tmp matches 1 run function bingo:item_detection/helper/announce | ||
execute if score $item_detect/set_border.success bingo.tmp matches 1 run function bingo:item_detection/helper/announce | ||
|
||
data modify storage bingo:card slots[{selected: true}].selected set value false |
28 changes: 24 additions & 4 deletions
28
data/bingo/functions/item_detection/helper/find_slot.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,25 @@ | ||
data modify storage bingo:tmp slots append from storage bingo:tmp previousSlots[0] | ||
data remove storage bingo:tmp previousSlots[0] | ||
#> bingo:item_detection/helper/find_slot | ||
# | ||
# This function is used to iterate through the current slots until the correct | ||
# one is found | ||
# | ||
# @within | ||
# function bingo:item_detection/helper/find_slot | ||
# function bingo:item_detection/helper/set_border | ||
# @input score $item_detect/find_slot.slot_id bingo.tmp The slot id of the slot that is searched | ||
|
||
scoreboard players remove $i bingo.tmp 1 | ||
execute if score $i bingo.tmp matches 0.. run function bingo:item_detection/helper/find_slot | ||
#> | ||
# The slot id of the slot that is searched | ||
# | ||
# This is an input for function bingo:item_detection/helper/find_slot | ||
# | ||
# @within | ||
# function bingo:item_detection/helper/find_slot | ||
# function bingo:item_detection/helper/set_border | ||
#declare score_holder $item_detect/find_slot.slot_id | ||
|
||
data modify storage temp:bingo.item_detection/set_border slots append from storage temp:bingo.item_detection/set_border previousSlots[0] | ||
data remove storage temp:bingo.item_detection/set_border previousSlots[0] | ||
|
||
scoreboard players remove $item_detect/find_slot.slot_id bingo.tmp 1 | ||
execute if score $item_detect/find_slot.slot_id bingo.tmp matches 0.. run function bingo:item_detection/helper/find_slot |
7 changes: 7 additions & 0 deletions
7
data/bingo/functions/item_detection/helper/goals/announce_20_no_bingo.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
#> bingo:item_detection/helper/goals/announce_20_no_bingo | ||
# | ||
# Announces a 20 no bingo and plays the goal completed effect for the entire | ||
# team | ||
# | ||
# @within function bingo:item_detection/helper/goals/bingo/detect_bingo_and_20_no_bingo | ||
|
||
tellraw @a {"translate": "bingo.got_20_no_bingo", "with": [{"storage": "neun_einser.timer:display", "nbt": "\"hh:mm:ss.s\"", "interpret": true}, {"selector": "@a[tag=bingo.in_current_team]"}]} | ||
execute as @a[tag=bingo.in_current_team] at @s run function bingo:item_detection/helper/goals/completed_goal_effects |
6 changes: 6 additions & 0 deletions
6
data/bingo/functions/item_detection/helper/goals/announce_blackout.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
#> bingo:item_detection/helper/goals/announce_blackout | ||
# | ||
# Announces a blackout and plays the goal completed effect for the entire team | ||
# | ||
# @within function bingo:item_detection/helper/announce | ||
|
||
tellraw @a {"translate": "bingo.got_blackout", "with": [{"storage": "neun_einser.timer:display", "nbt": "\"hh:mm:ss.s\"", "interpret": true}, {"selector": "@a[tag=bingo.in_current_team]"}]} | ||
execute as @a[tag=bingo.in_current_team] at @s run function bingo:item_detection/helper/goals/completed_goal_effects |
8 changes: 7 additions & 1 deletion
8
data/bingo/functions/item_detection/helper/goals/bingo/announce/col.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 9 additions & 3 deletions
12
data/bingo/functions/item_detection/helper/goals/bingo/announce/col_diag.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
data/bingo/functions/item_detection/helper/goals/bingo/announce/col_row.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 9 additions & 3 deletions
12
data/bingo/functions/item_detection/helper/goals/bingo/announce/col_row_diag.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 9 additions & 3 deletions
12
data/bingo/functions/item_detection/helper/goals/bingo/announce/diag.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
data/bingo/functions/item_detection/helper/goals/bingo/announce/row.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 9 additions & 3 deletions
12
data/bingo/functions/item_detection/helper/goals/bingo/announce/row_diag.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 17 additions & 3 deletions
20
data/bingo/functions/item_detection/helper/goals/bingo/col/1.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,17 @@ | ||
data modify storage bingo:tmp icon set value '"\\uFFFF"' | ||
execute store success score $success bingo.tmp run data modify storage bingo:tmp icon set from storage bingo:tmp slots[0] | ||
execute if score $success bingo.tmp matches 1 run function bingo:item_detection/helper/goals/bingo/col/1/2 | ||
#> bingo:item_detection/helper/goals/bingo/col/1 | ||
# | ||
# @within function bingo:item_detection/helper/goals/bingo/detect_bingo_and_20_no_bingo | ||
|
||
#> | ||
# @within | ||
# function bingo:item_detection/helper/goals/bingo/col/1 | ||
# function bingo:item_detection/helper/goals/bingo/col/1/* | ||
#declare storage temp:bingo.item_detect/bingo/col/1 | ||
|
||
#> | ||
# @private | ||
#declare score_holder $item_detect/bingo/col/1/1.success | ||
|
||
data modify storage temp:bingo.item_detect/bingo/col/1 icon set value '"\\uFFFF"' | ||
execute store success score $item_detect/bingo/col/1/1.success bingo.tmp run data modify storage temp:bingo.item_detect/bingo/col/1 icon set from storage temp:bingo.item_detect/bingo/col/1 slots[0] | ||
execute if score $item_detect/bingo/col/1/1.success bingo.tmp matches 1 run function bingo:item_detection/helper/goals/bingo/col/1/2 |
12 changes: 10 additions & 2 deletions
12
data/bingo/functions/item_detection/helper/goals/bingo/col/1/2.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,10 @@ | ||
execute store success score $success bingo.tmp run data modify storage bingo:tmp icon set from storage bingo:tmp slots[5] | ||
execute if score $success bingo.tmp matches 0 run function bingo:item_detection/helper/goals/bingo/col/1/3 | ||
#> bingo:item_detection/helper/goals/bingo/col/1/2 | ||
# | ||
# @within function bingo:item_detection/helper/goals/bingo/col/1 | ||
|
||
#> | ||
# @private | ||
#declare score_holder $item_detect/bingo/col/1/2.success | ||
|
||
execute store success score $item_detect/bingo/col/1/2.success bingo.tmp run data modify storage temp:bingo.item_detect/bingo/col/1 icon set from storage temp:bingo.item_detect/bingo/col/1 slots[5] | ||
execute if score $item_detect/bingo/col/1/2.success bingo.tmp matches 1 run function bingo:item_detection/helper/goals/bingo/col/1/3 |
Oops, something went wrong.