Skip to content

Commit 538f758

Browse files
committed
Add pot size chat message
Stack Attack now announces the points that may be gained in a game upon the start of the game
1 parent 856b156 commit 538f758

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

data/stack_attack_arena/functions/round/draw.mcfunction

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@
66
# move arena points into fake player score for next game
77
scoreboard players operation legacy_match_value sat_match_value += @s sat_match_value
88

9+
# chat announcement
10+
tellraw @a ["",{"text":"["},{"text":"S","color":"yellow"},{"text":"tack ","color":"light_purple"},{"text":"A","color":"blue"},{"text":"ttack","color":"green"},{"text":"] ","color":"none"},{"text":"A game of ","color":"green"},{"text":"S","color":"yellow"},{"text":"tack ","color":"light_purple"},{"text":"A","color":"blue"},{"text":"ttack","color":"green"},{"text":" ended in a draw!","color":"green"}]
11+
912
# set round ended flag
1013
scoreboard players set @s sat_arena_state 3

data/stack_attack_arena/functions/round/timer/go.mcfunction

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,9 @@ title @a[tag=sat_in_game,dx=14,dy=255,dz=14] title ["",{"text":"GO!","color":"bl
99
# sound
1010
execute as @a[tag=sat_in_game,dx=14,dy=255,dz=14] positioned ~6.5 ~2 ~6.5 run playsound minecraft:block.note_block.pling voice @s ~ ~ ~ 1 1.2
1111

12+
# announce pot size to participating players
13+
execute if score @s sat_match_value matches 2.. run tellraw @a[tag=sat_in_game,dx=14,dy=255,dz=14] ["",{"text":"["},{"text":"S","color":"yellow"},{"text":"tack ","color":"light_purple"},{"text":"A","color":"blue"},{"text":"ttack","color":"green"},{"text":"] ","color":"none"},{"text":"Ready, Set, Stack! There are ","color":"green"},{"score":{"name":"@s","objective":"sat_match_value"}},{"text":" points in the pot!","color":"green"}]
14+
execute if score @s sat_match_value matches 1 run tellraw @a[tag=sat_in_game,dx=14,dy=255,dz=14] ["",{"text":"["},{"text":"S","color":"yellow"},{"text":"tack ","color":"light_purple"},{"text":"A","color":"blue"},{"text":"ttack","color":"green"},{"text":"] ","color":"none"},{"text":"Ready, Set, Stack! There is ","color":"green"},{"score":{"name":"@s","objective":"sat_match_value"}},{"text":" point in the pot!","color":"green"}]
15+
1216
# update sat_arena_state
1317
scoreboard players set @s sat_arena_state 2

data/stack_attack_arena/functions/setup/prepare_entities.mcfunction

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,12 @@ spreadplayers ~7.5 ~7.5 1 5 false @a[tag=sat_joining_game]
3131
execute as @a[tag=sat_joining_game] run function stack_attack_arena:setup/prepare_players
3232
# -> match value is now stored in match_value sat_match_value
3333

34+
#====== Players now just have the sat_in_game tag ======
35+
3436
# store match value onto arena marker AEC
3537
scoreboard players operation @s sat_match_value = match_value sat_match_value
3638
scoreboard players reset match_value sat_match_value
3739

38-
# add legacy_match_value to match value (leftover points from a draw game)
39-
scoreboard players operation @s sat_match_value += legacy_match_value sat_match_value
40-
scoreboard players reset legacy_match_value sat_match_value
41-
42-
#====== Players now just have the sat_in_game tag ======
43-
4440
# set sat_round_timer to -4
4541
scoreboard players set @s sat_round_timer -4
4642

data/stack_attack_arena/functions/setup/prepare_players.mcfunction

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,7 @@ replaceitem entity @s[scores={sat_leaderboard=43..}] armor.chest leather_chestpl
4646

4747
# pay participation fee if player has at least 1 point
4848
execute if score @s sat_leaderboard matches 1.. run function stack_attack_arena:setup/pay_participation_fee
49+
50+
# add legacy_match_value to match value (leftover points from a draw game)
51+
scoreboard players operation match_value sat_match_value += legacy_match_value sat_match_value
52+
scoreboard players reset legacy_match_value sat_match_value

0 commit comments

Comments
 (0)