From 902907d9e42986b56c0b78ea68269311b77c76b8 Mon Sep 17 00:00:00 2001 From: slicedlime Date: Tue, 9 Feb 2021 23:03:14 +0100 Subject: [PATCH] Tweaks after first playtest --- data/mob_dash/functions/end_game.mcfunction | 2 ++ data/mob_dash/functions/load.mcfunction | 3 +++ data/mob_dash/functions/reset.mcfunction | 1 - data/mob_dash/functions/start_game.mcfunction | 9 +++++++++ data/mob_dash/functions/tick_menu.mcfunction | 1 + 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/data/mob_dash/functions/end_game.mcfunction b/data/mob_dash/functions/end_game.mcfunction index 0ec016c..cacd6b3 100644 --- a/data/mob_dash/functions/end_game.mcfunction +++ b/data/mob_dash/functions/end_game.mcfunction @@ -20,3 +20,5 @@ execute if score $WinningTeams md_state matches 2.. run tellraw @a [{"text":"It' execute if score $WinningTeams md_state matches 1 run tellraw @a ["",{"text":"Team ","color": "gold"},{"selector":"@e[type=area_effect_cloud,tag=md_winner]"},{"text":" wins!","color":"gold"}] tellraw @a "Returning to menu in 60 seconds..." + +scoreboard objectives setdisplay sidebar md_score_display diff --git a/data/mob_dash/functions/load.mcfunction b/data/mob_dash/functions/load.mcfunction index 0a50e2c..82b9ce8 100644 --- a/data/mob_dash/functions/load.mcfunction +++ b/data/mob_dash/functions/load.mcfunction @@ -30,6 +30,9 @@ scoreboard players add $Timeout md_state 0 scoreboard players add $Scoring md_state 0 scoreboard players add $Difficulty md_state 0 +execute store result score $Temp md_state run difficulty +execute if score $Temp md_state matches 1.. run scoreboard players operation $GameDifficulty md_state = $Temp md_state + function mob_dash:update_scoring_text function mob_dash:update_difficulty_text diff --git a/data/mob_dash/functions/reset.mcfunction b/data/mob_dash/functions/reset.mcfunction index f469570..fb54244 100644 --- a/data/mob_dash/functions/reset.mcfunction +++ b/data/mob_dash/functions/reset.mcfunction @@ -2,7 +2,6 @@ scoreboard players set $State md_state 0 scoreboard players reset * md_score -scoreboard players reset * md_score_display scoreboard players reset * md_player_scores tp @a ~ ~ ~ diff --git a/data/mob_dash/functions/start_game.mcfunction b/data/mob_dash/functions/start_game.mcfunction index 01e405e..a879696 100644 --- a/data/mob_dash/functions/start_game.mcfunction +++ b/data/mob_dash/functions/start_game.mcfunction @@ -21,3 +21,12 @@ scoreboard players set @e[type=area_effect_cloud,tag=md_team] md_score 0 scoreboard players set $Tick md_state 0 scoreboard players operation $EndTick md_state = $Timeout md_state scoreboard players operation $EndTick md_state *= 1200 md_const + +# Set appropriate difficulty +execute if score $GameDifficulty md_state matches 1 run difficulty easy +execute if score $GameDifficulty md_state matches 2 run difficulty normal +execute if score $GameDifficulty md_state matches 3 run difficulty hard + +# Reset scores +scoreboard players reset * md_score_display +scoreboard objectives setdisplay sidebar diff --git a/data/mob_dash/functions/tick_menu.mcfunction b/data/mob_dash/functions/tick_menu.mcfunction index 4375e63..1ffe426 100644 --- a/data/mob_dash/functions/tick_menu.mcfunction +++ b/data/mob_dash/functions/tick_menu.mcfunction @@ -4,6 +4,7 @@ gamerule doDaylightCycle false gamerule doWeatherCycle false gamerule doMobSpawning false +difficulty peaceful time set noon