Skip to content

Commit

Permalink
Resolves #83: Test announcer added for key moments
Browse files Browse the repository at this point in the history
  • Loading branch information
Moesh committed Apr 4, 2021
1 parent 9878d25 commit b873bca
Show file tree
Hide file tree
Showing 22 changed files with 85 additions and 5 deletions.
4 changes: 3 additions & 1 deletion resourcepacks/calamity/assets/calamity/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,7 @@
"calamity.shuffle.newTeamAdditions":"Shuffled to %s: %s",
"calamity.shuffle.newTeam":"%s: %s",
"calamity.shuffle.playerShuffled.rest":"%s shuffled players who were not on a team",
"calamity.shuffle.playerShuffled.all":"%s shuffled all players"
"calamity.shuffle.playerShuffled.all":"%s shuffled all players",
"calamity.player.sessionID.mismatch":"SessionID mismatch. You will be processed as a new player.",
"calamity.subtitle.announcer":"Announcer speaks"
}
66 changes: 63 additions & 3 deletions resourcepacks/calamity/assets/calamity/sounds.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,70 @@
],
"subtitle": "calamity.subtitle.eye.squish"
},
"calamity.eye.release": {
"calamity.announcer.countdown.1": {
"sounds": [
"calamity:resource_point/release"
"calamity:announcer_test/1"
],
"subtitle": "calamity.subtitle.eye.release"
"subtitle": "calamity.subtitle.announcer"
},
"calamity.announcer.countdown.2": {
"sounds": [
"calamity:announcer_test/2"
],
"subtitle": "calamity.subtitle.announcer"
},
"calamity.announcer.countdown.3": {
"sounds": [
"calamity:announcer_test/3"
],
"subtitle": "calamity.subtitle.announcer"
},
"calamity.announcer.countdown.4": {
"sounds": [
"calamity:announcer_test/4"
],
"subtitle": "calamity.subtitle.announcer"
},
"calamity.announcer.countdown.5": {
"sounds": [
"calamity:announcer_test/5"
],
"subtitle": "calamity.subtitle.announcer"
},
"calamity.announcer.match.countdown.start": {
"sounds": [
"calamity:announcer_test/match-begins-in-15-seconds"
],
"subtitle": "calamity.subtitle.announcer"
},
"calamity.announcer.match.cancelled": {
"sounds": [
"calamity:announcer_test/match-cancelled"
],
"subtitle": "calamity.subtitle.announcer"
},
"calamity.announcer.match.started": {
"sounds": [
"calamity:announcer_test/seek-glory-or-fall-to-calamity"
],
"subtitle": "calamity.subtitle.announcer"
},
"calamity.announcer.enchanted.item": {
"sounds": [
"calamity:announcer_test/the-enemy-has-an-enchanted-item"
],
"subtitle": "calamity.subtitle.announcer"
},
"calamity.announcer.lead.enemy": {
"sounds": [
"calamity:announcer_test/the-enemy-is-in-the-lead"
],
"subtitle": "calamity.subtitle.announcer"
},
"calamity.announcer.lead.friendly": {
"sounds": [
"calamity:announcer_test/you-have-taken-the-lead"
],
"subtitle": "calamity.subtitle.announcer"
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ scoreboard players set @a[tag=Playing] giveSpawnItems 1
tellraw @a {"translate":"system.message","color":"green","with":[{"translate":"calamity.seekGlory"}]}
tellraw @a {"translate":"calamity.select.respawnItem","color":"gray","with":[{"translate":"calamity.select.respawnItem","italic": true}]}
playsound minecraft:event.raid.horn master @a 217 100 195 999999
playsound calamity:calamity.announcer.match.started master @a 136 150 89 500
# Purpose: Update game state
scoreboard players set StartingMatch gameVariable 0
scoreboard players set GameState gameVariable 1
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,23 @@ execute if score #Every20Ticks gameVariable matches 0 run playsound minecraft:bl
# Check our progress. Announce to the player when enough time has passed.
# 15, 10, and 5 seconds
execute if score TimeInTicks gameVariable matches 300 run tellraw @a {"translate":"system.message","color":"green","with":[{"translate":"calamity.startMatch.countdown","with":[{"score":{"name":"#InSeconds","objective":"gameVariable"},"color":"white"}]}]}
execute if score TimeInTicks gameVariable matches 300 run playsound calamity:calamity.announcer.match.countdown.start master @a 136 150 89 500
execute if score TimeInTicks gameVariable matches 200 run tellraw @a {"translate":"system.message","color":"green","with":[{"translate":"calamity.startMatch.countdown","with":[{"score":{"name":"#InSeconds","objective":"gameVariable"},"color":"white"}]}]}
execute if score TimeInTicks gameVariable matches 100 run tellraw @a {"translate":"system.message","color":"green","with":[{"translate":"calamity.startMatch.countdown","with":[{"score":{"name":"#InSeconds","objective":"gameVariable"},"color":"white"}]}]}
execute if score TimeInTicks gameVariable matches 100 run playsound calamity:calamity.announcer.countdown.5 master @a 136 150 89 500
# 4 seconds to 1 seconds...
execute if score TimeInTicks gameVariable matches 80 run tellraw @a {"translate":"system.message","color":"green","with":[{"translate":"calamity.startMatch.countdown.lastFiveSeconds","with":[{"score":{"name":"#InSeconds","objective":"gameVariable"},"color":"white"}]}]}
execute if score TimeInTicks gameVariable matches 80 run playsound calamity:calamity.announcer.countdown.4 master @a 136 150 89 500
execute if score TimeInTicks gameVariable matches 60 run tellraw @a {"translate":"system.message","color":"green","with":[{"translate":"calamity.startMatch.countdown.lastFiveSeconds","with":[{"score":{"name":"#InSeconds","objective":"gameVariable"},"color":"white"}]}]}
execute if score TimeInTicks gameVariable matches 60 run playsound calamity:calamity.announcer.countdown.3 master @a 136 150 89 500
execute if score TimeInTicks gameVariable matches 40 run tellraw @a {"translate":"system.message","color":"green","with":[{"translate":"calamity.startMatch.countdown.lastFiveSeconds","with":[{"score":{"name":"#InSeconds","objective":"gameVariable"},"color":"white"}]}]}
execute if score TimeInTicks gameVariable matches 40 run playsound calamity:calamity.announcer.countdown.2 master @a 136 150 89 500
execute if score TimeInTicks gameVariable matches 20 run tellraw @a {"translate":"system.message","color":"green","with":[{"translate":"calamity.startMatch.countdown.lastFiveSeconds","with":[{"score":{"name":"#InSeconds","objective":"gameVariable"},"color":"white"}]}]}
execute if score TimeInTicks gameVariable matches 20 run playsound calamity:calamity.announcer.countdown.1 master @a 136 150 89 500

# It's time to start the game!
function calamity:game_state/check_if_start_conditions_met
execute if score #PlayersPlaying gameVariable matches 0 run playsound calamity:calamity.announcer.match.cancelled master @a 136 150 89 500
execute if score #PlayersPlaying gameVariable matches 0 run tellraw @a {"translate":"system.message","color":"green","with":[{"translate":"calamity.match.cancelled.noPlayers","color":"red"}]}
execute if score #PlayersPlaying gameVariable matches 0 run function calamity:game_state/trigger_cancel_start

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# Purpose: Cancel the timer to start a match
#---------------------------------------------------------------------------------------------------
scoreboard players set StartingMatch gameVariable 0
execute if entity @a[scores={cancelStart=1..}] run playsound calamity:calamity.announcer.match.cancelled master @a 136 150 89 500
execute as @a[scores={cancelStart=1..},team=blue] run tellraw @a {"translate":"system.message","color":"green","with":[{"translate":"calamity.match.cancelled.byPlayer","color":"blue","with":[{"selector":"@s"},{"translate":""}]}]}
execute as @a[scores={cancelStart=1..},team=red] run tellraw @a {"translate":"system.message","color":"green","with":[{"translate":"calamity.match.cancelled.byPlayer","color":"red","with":[{"selector":"@s"},{"translate":""}]}]}
execute unless entity @a[scores={cancelStart=1..}] run tellraw @a {"translate":"system.message","color":"green","with":[{"translate":"calamity.match.cancelled","color":"red","with":[{"translate":""}]}]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,18 @@ scoreboard players operation #tempVar gameVariable -= RedPoints gameVariable
# Blue is in the lead!
execute if score #tempVar gameVariable matches 1.. run bossbar set calamity:iron_ore color blue
execute if score #tempVar gameVariable matches 1.. run execute store result bossbar calamity:iron_ore value run scoreboard players get BluePoints gameVariable
execute if score #tempVar gameVariable matches 1.. unless score #TeamInLead gameVariable matches 1 run playsound calamity:calamity.announcer.lead.friendly master @a[team=blue] 136 150 89 500
execute if score #tempVar gameVariable matches 1.. unless score #TeamInLead gameVariable matches 1 run playsound calamity:calamity.announcer.lead.enemy master @a[team=red] 136 150 89 500
execute if score #tempVar gameVariable matches 1.. run scoreboard players set #TeamInLead gameVariable 1
# The game is tied!
execute if score #tempVar gameVariable matches 0 run execute store result bossbar calamity:iron_ore value run scoreboard players get OreLeft gameVariable
execute if score #tempVar gameVariable matches 0 run bossbar set calamity:iron_ore color purple
# Read is in the lead!
# Red is in the lead!
execute if score #tempVar gameVariable matches ..-1 run execute store result bossbar calamity:iron_ore value run scoreboard players get RedPoints gameVariable
execute if score #tempVar gameVariable matches ..-1 run bossbar set calamity:iron_ore color red
execute if score #tempVar gameVariable matches ..-1 unless score #TeamInLead gameVariable matches 2 run playsound calamity:calamity.announcer.lead.friendly master @a[team=red] 136 150 89 500
execute if score #tempVar gameVariable matches ..-1 unless score #TeamInLead gameVariable matches 2 run playsound calamity:calamity.announcer.lead.enemy master @a[team=blue] 136 150 89 500
execute if score #tempVar gameVariable matches ..-1 run scoreboard players set #TeamInLead gameVariable 2
# Always reset the #tempVar
scoreboard players reset #tempVar gameVariable

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ tag @a[tag=CheckForValidItem,nbt={SelectedItem: {id: "minecraft:netherite_boots"
tellraw @a[tag=Enchant,tag=!CheckForValidItem] {"translate":"calamity.resourcePoint.enchantedItem.valid","color": "gray","italic": true,"with":[{"translate":"calamity.enchanted.item","color":"white"}]}
tellraw @a[tag=Enchant,tag=CheckForValidItem] {"translate":"calamity.resourcePoint.enchantedItem.invalid","color": "gray","italic": true,"with":[{"translate":"item.minecraft.enchanted_book","color":"white"}]}
execute if entity @a[tag=Enchant,team=blue] run tellraw @a {"translate":"calamity.resourcePoint.enchantedItem.announced","color":"blue","with":[{"translate":"calamity.enchanted.item","color":"white"},{"translate":"team.blue"},{"translate":"b","color":"blue","font": "calamity:icons"}]}

execute if entity @a[tag=Enchant,team=red] run tellraw @a {"translate":"calamity.resourcePoint.enchantedItem.announced","color":"red","with":[{"translate":"calamity.enchanted.item","color":"white"},{"translate":"team.red"},{"translate":"r","color": "red","font": "calamity:icons"}]}

# No valid item found, give default book
Expand All @@ -198,6 +199,8 @@ tag @a[tag=CheckForValidItem] remove CheckForValidItem
execute as @a[tag=GiveEffects] run playsound minecraft:entity.generic.drink player @s
execute as @s[tag=GiveResources] run playsound minecraft:entity.player.levelup master @a ~ ~ ~ 0.5 0.5
execute as @s[tag=Enchant] run playsound minecraft:entity.player.levelup master @a ~ ~ ~ 0.5 0.5
execute as @a[tag=Enchant,team=blue] run playsound calamity:calamity.announcer.enchanted.item master @a[team=red] ~ ~ ~ 500
execute as @a[tag=Enchant,team=red] run playsound calamity:calamity.announcer.enchanted.item master @a[team=blue] ~ ~ ~ 500

# Give title message and resource/effect
tag @a[tag=GiveResources] add GiveMessage
Expand Down
Binary file modified saves/calamity/level.dat
Binary file not shown.
Binary file modified saves/calamity/region/r.0.0.mca
Binary file not shown.

0 comments on commit b873bca

Please sign in to comment.