# Settings
gamerule doMobSpawning false
gamerule commandBlockOutput false
gamerule doFireTick false
gamerule doDaylightCycle false
gamerule doWeatherCycle false
gamerule mobGriefing false
gamerule randomTickSpeed 0
gamerule doTileDrops false
gamerule doImmediateRespawn true
gamerule spawnRadius 0
gamerule keepInventory true
defaultgamemode adventure
setworldspawn 5 52 0

# Scores
scoreboard objectives add state dummy
scoreboard objectives add clock dummy
scoreboard objectives add dungeon dummy
scoreboard objectives add Death deathCount
scoreboard objectives add display_hp health
scoreboard objectives setdisplay belowName display_hp
scoreboard objectives setdisplay list display_hp
scoreboard objectives setdisplay list display_hp
scoreboard objectives add game dummy
scoreboard objectives add room_state dummy
scoreboard objectives add room_wave dummy
scoreboard objectives add room_clock dummy
scoreboard objectives add shard_timeout dummy
scoreboard objectives add lsaber_easteregg dummy

# Settings/Flags
execute unless score floor dungeon matches ..0 unless score floor dungeon matches 0.. run scoreboard players set floor dungeon 1
execute unless score new_run state matches ..0 unless score new_run state matches 0.. run scoreboard players set new_run state 1
scoreboard players operation tutorial state = tutorial state
scoreboard players operation difficulty state = difficulty state
scoreboard players operation generation state = generation state
scoreboard players operation game state = game state
scoreboard players operation @a Death = @a Death
scoreboard players set pattern lsaber_easteregg 1

# Generation Bossbar
bossbar add generation "Generation"
bossbar set generation color green
bossbar set generation style notched_10
bossbar set generation visible false
bossbar set generation max 5

# Teams
team add players
team modify players friendlyFire false

# Mimic animation
scoreboard players set mimic_head clock 1
scoreboard players set mimic_right clock 400
scoreboard players set mimic_left clock 300
scoreboard players set #mimic_right clock 1
scoreboard players set #mimic_left clock -1

# Testing
schedule function dungeon:menu/tester 1s


# In game music
execute if score game state matches 3 run schedule function game:music/loop 1s
