Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into dev
  • Loading branch information
VForiel committed Oct 11, 2023
2 parents 7def72e + eb6be6d commit 42278ee
Show file tree
Hide file tree
Showing 25 changed files with 43 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ scoreboard objectives add listener.use.yellow_spawn_egg minecraft.used:blaze_spa

# Triggers --------------------------------------------------------------------

scoreboard objectives add trigger.start_game trigger {"text":"Trigger Start Game","color": "black"}
scoreboard objectives add trigger.reset trigger {"text":"Trigger Reset","color": "black"}
scoreboard objectives add trigger.tutorial trigger {"text":"Trigger Tutorial","color": "black"}
scoreboard objectives add trigger.lobby trigger {"text":"Trigger Lobby","color": "black"}
scoreboard objectives add start_game trigger {"text":"Trigger Start Game","color": "black"}
scoreboard objectives add reset trigger {"text":"Trigger Reset","color": "black"}
scoreboard objectives add tutorial trigger {"text":"Trigger Tutorial","color": "black"}
scoreboard objectives add lobby trigger {"text":"Trigger Lobby","color": "black"}

# Player items ----------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ execute if score tick200 data matches 200.. run scoreboard players set tick200 d
# Game management -------------------------------------------------------------

# Game management (when a game is started)
execute as @a[scores={trigger.start_game=1..}] run function scaffolding_rush:game/start/pre_start_checks
execute as @a[scores={start_game=1..}] run function scaffolding_rush:game/start/pre_start_checks

execute if entity @a[scores={trigger.reset=1..}] run function scaffolding_rush:reset
execute if entity @a[scores={reset=1..}] run function scaffolding_rush:reset

# ORDER IS IMPORTANT!
execute if score #lobby.active data matches 1 run function scaffolding_rush:lobby/__main__
Expand All @@ -32,9 +32,9 @@ function scaffolding_rush:player/__main__
# Admin mode
execute unless entity @a[tag=admin] if score #admin.exist options matches 1 run function scaffolding_rush:options/admin

scoreboard players reset @a trigger.reset
execute if score #admin.exist options matches 1 as @a[tag=admin] run scoreboard players enable @s trigger.reset
execute if score #admin.exist options matches 0 run scoreboard players enable @a trigger.reset
scoreboard players reset @a reset
execute if score #admin.exist options matches 1 as @a[tag=admin] run scoreboard players enable @s reset
execute if score #admin.exist options matches 0 run scoreboard players enable @a reset

# Others generic behvaiors ----------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function scaffolding_rush:game/map/reset/__start__
#advancement use_item
advancement revoke @a from scaffolding_rush:use_item

scoreboard players reset @a trigger.start_game
scoreboard players reset @a start_game

execute as @a run function scaffolding_rush:options/disable_all
execute if score #admin.exist options matches 1 as @a[tag=admin] run function scaffolding_rush:options/activate_all
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Force leave & disable tutorial
execute as @a[tag=inTutorial] run function scaffolding_rush:tutorial/leave
function scaffolding_rush:tutorial/unload
scoreboard players reset @s trigger.tutorial
scoreboard players reset @s tutorial

# Clear
clear @s
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@


scoreboard players reset @a trigger.start_game
execute if score #admin.exist options matches 1 as @a[tag=admin] run scoreboard players enable @s trigger.start_game
execute if score #admin.exist options matches 0 as @a run scoreboard players enable @s trigger.start_game
scoreboard players reset @a start_game
execute if score #admin.exist options matches 1 as @a[tag=admin] run scoreboard players enable @s start_game
execute if score #admin.exist options matches 0 as @a run scoreboard players enable @s start_game
execute as @a[team=] run function scaffolding_rush:team/join/random

# Count active teams
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ execute as @e[type=marker,tag=lobbyLight] at @s if block ~ ~ ~ #scaffolding_rush
execute as @a[tag=!player.is_dead] at @s if block ~ ~ ~ #scaffolding_rush:lobby_suffocation run function scaffolding_rush:lobby/suffocation

# Start game
execute unless score #admin.exist options matches 1 as @a[scores={bellring=1..}] run scoreboard players set @s trigger.start_game 1
execute if score #admin.exist options matches 1 as @a[scores={bellring=1..},tag=admin] run scoreboard players set @s trigger.start_game 1
execute unless score #admin.exist options matches 1 as @a[scores={bellring=1..}] run scoreboard players set @s start_game 1
execute if score #admin.exist options matches 1 as @a[scores={bellring=1..},tag=admin] run scoreboard players set @s start_game 1
execute if score #admin.exist options matches 1 as @a[scores={bellring=1..},tag=!admin] run tellraw @s[scores={option.language=0}] ["",{"text":"[BS] ","color":"gold"},{"text":"Sorry, only ","color":"red"},{"selector":"@a[tag=admin]","color":"red"},{"text":" can start the game","color":"red"}]

execute if score #admin.exist options matches 1 as @a[scores={bellring=1..},tag=!admin] run tellraw @s[scores={option.language=1}] ["",{"text":"[BS] ","color":"gold"},{"text":"Désolez, seuleument ","color":"red"},{"selector":"@a[tag=admin]","color":"red"},{"text":" peut démarrer la partie","color":"red"}]
Expand All @@ -33,8 +33,8 @@ scoreboard players reset @a bellring
# interaction
function scaffolding_rush:lobby/interaction/__main__

execute as @a[scores={trigger.tutorial=1}] run function scaffolding_rush:tutorial/join
execute as @a[scores={tutorial=1}] run function scaffolding_rush:tutorial/join

tag @a[tag=!player.item.can_have_book] add player.item.can_have_book
scoreboard players enable @a[tag=!inTutorial] trigger.tutorial
scoreboard players enable @a[tag=!inTutorial] tutorial
function scaffolding_rush:lobby/protection/__main__
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ scoreboard objectives add option.volcano trigger
execute unless score Volcano options matches 0.. run scoreboard players set Volcano options 0

# Tutorial
scoreboard objectives add trigger.lobby trigger
scoreboard objectives add lobby trigger
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ scoreboard players enable @s option.volcano_pop_period
scoreboard players enable @s option.volcano_target_rate
scoreboard players enable @s option.scaff_stops_arrow

scoreboard players enable @s trigger.reset
scoreboard players enable @s trigger.start_game
scoreboard players enable @s reset
scoreboard players enable @s start_game

#generated scores
scoreboard players enable @s option.time_limit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ execute if score #lobby.active data matches 1 if score #admin.exist options matc
execute if score #lobby.active data matches 1 if score #admin.exist options matches 0 as @a run function scaffolding_rush:options/activate_all
execute if score #lobby.active data matches 1 run scoreboard players enable @a option.admin
execute if score #lobby.active data matches 1 run scoreboard players enable @a option.language
execute if score #lobby.active data matches 0 if score #admin.exist options matches 1 as @a[tag=admin] run scoreboard players enable @s trigger.reset
execute if score #lobby.active data matches 0 if score #admin.exist options matches 0 run scoreboard players enable @a trigger.reset
execute if score #lobby.active data matches 0 if score #admin.exist options matches 1 as @a[tag=admin] run scoreboard players enable @s reset
execute if score #lobby.active data matches 0 if score #admin.exist options matches 0 run scoreboard players enable @a reset

execute if score #lobby.active data matches 1 run function scaffolding_rush:options/refresh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ scoreboard players reset @s option.volcano_pop_period
scoreboard players reset @s option.volcano_target_rate
scoreboard players reset @s option.scaff_stops_arrow

scoreboard players reset @s trigger.start_game
scoreboard players reset @s start_game

#generated scores
scoreboard players reset @s option.time_limit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ execute if score #admin.exist options matches 1 as @a[tag=admin] run function sc
execute if score #admin.exist options matches 0 as @a run function scaffolding_rush:options/activate_all

scoreboard players enable @s option.admin
scoreboard players enable @s trigger.tutorial
scoreboard players enable @s tutorial

bossbar set reset_lobby_en players @s[scores={option.language=0}]
bossbar set reset_lobby_fr players @a[scores={option.language=1}]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ scoreboard players set TutorialPlacementRecursionStep data 0
execute positioned -1021.5 1 1000.5 run function scaffolding_rush:tutorial/room/step_right

# Trigger
scoreboard players set @s trigger.tutorial 0
scoreboard players set @s trigger.lobby 0
scoreboard players set @s tutorial 0
scoreboard players set @s lobby 0
tag @s add player.item.can_have_items

loot replace entity @s hotbar.0 loot scaffolding_rush:scaffolding
# item replace entity @s hotbar.1 with minecraft:cyan_concrete_powder{HideFlags:24,CanPlaceOn:["#scaffolding_rush:scaffolding"],CanDestroy:["#scaffolding_rush:scaffolding","#scaffolding_rush:sand","#scaffolding_rush:concrete"]} 42

tellraw @a[scores={option.language=0}] ["",{"text":"[BS] ","color":"gold"},{"selector":"@s","color":"aqua"},{"text":" joined the tutorial ","color":"gray"},{"text":"[Join]","color":"green","clickEvent":{"action":"run_command","value":"/trigger trigger.tutorial"},"hoverEvent":{"action":"show_text","contents":"/trigger trigger.tutorial"}}]
tellraw @a[scores={option.language=1}] ["",{"text":"[BS] ","color":"gold"},{"selector":"@s","color":"aqua"},{"text":" a rejoint le tutoriel ","color":"gray"},{"text":"[Rejoindre]","color":"green","clickEvent":{"action":"run_command","value":"/trigger trigger.tutorial"},"hoverEvent":{"action":"show_text","contents":"/trigger trigger.tutorial"}}]
tellraw @a[scores={option.language=0}] ["",{"text":"[BS] ","color":"gold"},{"selector":"@s","color":"aqua"},{"text":" joined the tutorial ","color":"gray"},{"text":"[Join]","color":"green","clickEvent":{"action":"run_command","value":"/trigger tutorial"},"hoverEvent":{"action":"show_text","contents":"/trigger tutorial"}}]
tellraw @a[scores={option.language=1}] ["",{"text":"[BS] ","color":"gold"},{"selector":"@s","color":"aqua"},{"text":" a rejoint le tutoriel ","color":"gray"},{"text":"[Rejoindre]","color":"green","clickEvent":{"action":"run_command","value":"/trigger tutorial"},"hoverEvent":{"action":"show_text","contents":"/trigger tutorial"}}]

scoreboard players enable @s[tag=!inTutorial] trigger.tutorial
scoreboard players enable @s[tag=inTutorial] trigger.lobby
scoreboard players enable @s[tag=!inTutorial] tutorial
scoreboard players enable @s[tag=inTutorial] lobby
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ tag @s remove TutorialMessage5

tag @s remove inTutorial

scoreboard players set @s trigger.tutorial 0
scoreboard players set @s trigger.lobby 0
scoreboard players enable @s trigger.tutorial
scoreboard players set @s tutorial 0
scoreboard players set @s lobby 0
scoreboard players enable @s tutorial

clear @s
tag @s remove player.item.can_have_items
tag @s remove player.item.have_egg

execute unless entity @a[tag=inTutorial] run function scaffolding_rush:options/map/wb_size_refresh

tellraw @a[scores={option.language=0}] ["",{"text":"[BS] ","color":"gold"},{"selector":"@s","color":"aqua"},{"text":" exited the tutorial ","color":"gray"},{"text":"[Join]","color":"green","clickEvent":{"action":"run_command","value":"/trigger trigger.tutorial"},"hoverEvent":{"action":"show_text","contents":"/trigger trigger.tutorial"}}]
tellraw @a[scores={option.language=1}] ["",{"text":"[BS] ","color":"gold"},{"selector":"@s","color":"aqua"},{"text":" est sorti du tutoriel ","color":"gray"},{"text":"[Rejoindre]","color":"green","clickEvent":{"action":"run_command","value":"/trigger trigger.tutorial"},"hoverEvent":{"action":"show_text","contents":"/trigger trigger.tutorial"}}]
tellraw @a[scores={option.language=0}] ["",{"text":"[BS] ","color":"gold"},{"selector":"@s","color":"aqua"},{"text":" exited the tutorial ","color":"gray"},{"text":"[Join]","color":"green","clickEvent":{"action":"run_command","value":"/trigger tutorial"},"hoverEvent":{"action":"show_text","contents":"/trigger tutorial"}}]
tellraw @a[scores={option.language=1}] ["",{"text":"[BS] ","color":"gold"},{"selector":"@s","color":"aqua"},{"text":" est sorti du tutoriel ","color":"gray"},{"text":"[Rejoindre]","color":"green","clickEvent":{"action":"run_command","value":"/trigger tutorial"},"hoverEvent":{"action":"show_text","contents":"/trigger tutorial"}}]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

tellraw @s[scores={option.language=0}] ["",{"text":"======================","color":"gray"},{"text":"\n\n"},{"text":"Don't know how to use a scaffolding?\n","color":"white"},{"text":"[join the tutorial]","color":"#38ec26","clickEvent":{"action":"run_command","value":"/trigger trigger.tutorial"}},{"text":"\n\n======================","color":"gray"}]
tellraw @s[scores={option.language=1}] ["",{"text":"======================","color":"gray"},{"text":"\n\n"},{"text":"Tu ne sais pas comment utiliser les échaffaudages ?\n","color":"white"},{"text":"[rejoindre le tutoriel]","color":"#38ec26","clickEvent":{"action":"run_command","value":"/trigger trigger.tutorial"}},{"text":"\n\n======================","color":"gray"}]
tellraw @s[scores={option.language=0}] ["",{"text":"======================","color":"gray"},{"text":"\n\n"},{"text":"Don't know how to use a scaffolding?\n","color":"white"},{"text":"[join the tutorial]","color":"#38ec26","clickEvent":{"action":"run_command","value":"/trigger tutorial"}},{"text":"\n\n======================","color":"gray"}]
tellraw @s[scores={option.language=1}] ["",{"text":"======================","color":"gray"},{"text":"\n\n"},{"text":"Tu ne sais pas comment utiliser les échaffaudages ?\n","color":"white"},{"text":"[rejoindre le tutoriel]","color":"#38ec26","clickEvent":{"action":"run_command","value":"/trigger tutorial"}},{"text":"\n\n======================","color":"gray"}]
playsound block.note_block.bell ambient @s ~ ~ ~ 1000 1.41
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ execute if score @s pos.x matches 16.. run function scaffolding_rush:tutorial/le

# Proposes to skip the tutorial if the player was in the tutorial for over 10 min
scoreboard players add @s sc.timer.tutorial 1
execute if score @s sc.timer.tutorial matches 12000 run tellraw @s[scores={option.language=0}] ["",{"text":"[BS] ","color":"gold"},{"text":"It looks like you are stuck in the tutorial, it was not meant to last this long\nUse ","color":"gray"},{"text":"/trigger trigger.lobby","color":"aqua","clickEvent":{"action":"run_command","value":"/trigger trigger.lobby"},"hoverEvent":{"action":"show_text","contents":"Suggest command"}},{"text":" to ","color":"gray"},{"text":"skip it","color":"gold"}]
execute if score @s sc.timer.tutorial matches 12000 run tellraw @s[scores={option.language=1}] ["",{"text":"[BS] ","color":"gold"},{"text":"Il semblerait que vous êtes bloqué dans le tutoriel, il n'était pas cencé durer si longtemps\nUtilisez ","color":"gray"},{"text":"/trigger trigger.lobby","color":"aqua","clickEvent":{"action":"run_command","value":"/trigger trigger.lobby"},"hoverEvent":{"action":"show_text","contents":"Suggérer la commande"}},{"text":" pour ","color":"gray"},{"text":"en sortir","color":"gold"}]
execute if score @s sc.timer.tutorial matches 12000 run tellraw @s[scores={option.language=0}] ["",{"text":"[BS] ","color":"gold"},{"text":"It looks like you are stuck in the tutorial, it was not meant to last this long\nUse ","color":"gray"},{"text":"/trigger lobby","color":"aqua","clickEvent":{"action":"run_command","value":"/trigger lobby"},"hoverEvent":{"action":"show_text","contents":"Suggest command"}},{"text":" to ","color":"gray"},{"text":"skip it","color":"gold"}]
execute if score @s sc.timer.tutorial matches 12000 run tellraw @s[scores={option.language=1}] ["",{"text":"[BS] ","color":"gold"},{"text":"Il semblerait que vous êtes bloqué dans le tutoriel, il n'était pas cencé durer si longtemps\nUtilisez ","color":"gray"},{"text":"/trigger lobby","color":"aqua","clickEvent":{"action":"run_command","value":"/trigger lobby"},"hoverEvent":{"action":"show_text","contents":"Suggérer la commande"}},{"text":" pour ","color":"gray"},{"text":"en sortir","color":"gold"}]

Loading

0 comments on commit 42278ee

Please sign in to comment.