Skip to content

Commit

Permalink
Merge pull request #19 from TriLinder/v2
Browse files Browse the repository at this point in the history
LexiQuest v2.0.0
  • Loading branch information
TriLinder authored Sep 26, 2023
2 parents f79b33f + 7706586 commit 1b41050
Show file tree
Hide file tree
Showing 27,369 changed files with 770 additions and 187,366 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
python-scripts/assets/*
python-scripts/output/*
python-scripts/venv/*
python-scripts/venv/*

datapacks/game/data/wordlist/functions
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<p align="center"><img title="WordCraft logotype" src="promotional-assets/logotype.png" alt="WordCraft logotype" data-align="center" width="499"></p>
<p align="center"><img title="LexiQuest logotype" src="promotional-assets/logotype.png" alt="LexiQuest logotype" data-align="center" width="499"></p>

![1.png](promotional-assets/screenshots/1.png)

Expand All @@ -8,8 +8,8 @@ You can watch the video trailer [here](https://www.youtube.com/watch?v=uMO5CfCpZ

---

This repository is for the data pack used in WordCraft, and doesn't work on its own.
This repository is for the data pack used in LexiQuest, and doesn't work on its own.

You can however [download](https://github.com/TriLinder/WordCraft/releases/latest/download/WordCraft.zip) the full map under the releases tab.
You can however [download](https://github.com/TriLinder/LexiQuest/releases/latest/download/LexiQuest.zip) the full map under the releases tab.

Made for Minecraft version 1.19.3 and higher.
Made for Minecraft version 1.20.2 and higher.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#Title
title @s times 0 10 10
title @s subtitle "\uE000"
title @s title "\uE001\uE002\uE003\uE004\uE005\uE003\uE006\uE007\uE008"
title @s title "\uE001\uE002\uE003\uE004\uE005\uE006\uE002\uE007\uE008"

#Sound
playsound minecraft:wordcraft.dice master @s ~ ~ ~ 1 1
playsound minecraft:custom.dice master @s ~ ~ ~ 1 1 1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
playsound minecraft:entity.experience_orb.pickup master @s ~ ~ ~ 1 1.75 1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
playsound minecraft:block.note_block.guitar master @s ~ ~ ~ 1 1 1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
playsound minecraft:entity.experience_orb.pickup master @s ~ ~ ~ 1 1.75 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
execute as @e[tag=tile_marker] at @s if block ~ ~-2 ~ minecraft:yellow_concrete run tag @s add placed_letter

execute as @e[tag=placed_letter] at @s as @p[tag=current_player] run function game:tile_placing/destroy_tile
execute as @e[tag=placed_letter] at @s unless entity @p[tag=current_player] run function game:tile_placing/destroy_tile
execute as @e[tag=placed_letter] at @s if block ~ ~-2 ~ minecraft:red_concrete run setblock ~ ~-2 ~ minecraft:air

tag @e remove placed_letter

function game:board/update
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
scoreboard players set vote_in_progress end_game_vote 0
tag @a remove has_not_voted

execute if score non_spectator_player_count state matches 2.. run tellraw @a "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
scoreboard players operation vote_end_timer_seconds end_game_vote = vote_end_timer end_game_vote
scoreboard players operation vote_end_timer_seconds end_game_vote /= 20 numerals

tellraw @a "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
tellraw @a ["",{"text":"===== VOTE TO END THE GAME =====\n","bold":true},{"text":"Players left to vote:","color":"white"},{"text":" "},{"selector":"@a[tag=has_not_voted]"},{"text":"\nTime left: "},{"score":{"name":"vote_end_timer_seconds","objective":"end_game_vote"}},{"text":"s"}]

tellraw @a[tag=!player] {"text":"You can not vote.","color":"gray"}
execute as @a[tag=player] unless entity @s[tag=has_not_voted] run tellraw @s {"text":"You have already voted.","color":"gray"}
execute as @a[tag=player] if entity @s[tag=has_not_voted] run tellraw @s ["",{"text":"Click "},{"text":"[HERE]","bold":true,"color":"white","clickEvent":{"action":"run_command","value":"/trigger trigger set 201"}},{"text":" to vote."}]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
scoreboard players set vote_in_progress end_game_vote 1
scoreboard players set vote_end_timer end_game_vote 300

tag @a[tag=player] add has_not_voted
tag @s remove has_not_voted
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
execute if score vote_in_progress end_game_vote matches 1.. run function game:end_game_vote/vote_tick
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
function game:end_game_vote/end_vote
function game:end_game
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#Don't count non-players
tag @a[tag=!player] remove has_not_voted

#Show the message in chat (unless we're in singleplayer)
execute if score non_spectator_player_count state matches 2.. run function game:end_game_vote/message

#Handle players voting
execute as @a[scores={trigger=201}, tag=has_not_voted] run function effects:sound/confirm_sound
tag @a[scores={trigger=201}] remove has_not_voted

#Vote successful
execute unless entity @a[tag=has_not_voted] run function game:end_game_vote/vote_success

#Countdown to vote end
scoreboard players remove vote_end_timer end_game_vote 1
execute if score vote_end_timer end_game_vote matches ..0 run function game:end_game_vote/end_vote
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ execute as @a[scores={used_carrot_stick=1..}, nbt={SelectedItem: {tag: {Action:
execute as @a[scores={used_carrot_stick=1..}, nbt={SelectedItem: {tag: {Action: 2}}}] run function game:board/play

#Detect 'swap letters' click
execute as @a[scores={used_carrot_stick=1..}, nbt={SelectedItem: {tag: {Action: 3}}}] run tag @s add swapping_letters
execute as @a[scores={used_carrot_stick=1..}, nbt={SelectedItem: {tag: {Action: 3}}}] run function game:letter_swapping/start_swapping_letters

#Detect 'end game' click
execute as @a[scores={used_carrot_stick=1..}, nbt={SelectedItem: {tag: {Action: 4}}}] run function game:end_game
execute as @a[scores={used_carrot_stick=1..}, nbt={SelectedItem: {tag: {Action: 4}}}] run function game:end_game_vote/start_vote

#Detect 'recall letters' click
execute as @a[scores={used_carrot_stick=1..}, nbt={SelectedItem: {tag: {Action: 5}}}] run function game:board/recall_letters

#Detect 'cancel swapping letters' click
execute as @a[scores={used_carrot_stick=1..}, nbt={SelectedItem: {tag: {Action: 6}}}] run function game:letter_swapping/cancel_swapping_letters
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Generated using generate_inventory_update.py
execute if entity @s[tag=current_player] run item replace entity @s weapon.offhand with minecraft:carrot_on_a_stick{"CustomModelData": 1, "Action": 0, "display": {"Name": "{\"text\": \"\"}"}}
execute unless entity @s[tag=current_player] run item replace entity @s weapon.offhand with minecraft:air
item replace entity @s inventory.0 with minecraft:air
Expand Down Expand Up @@ -216,17 +217,28 @@ execute if score @s letter_inv6 matches 22 run item replace entity @s hotbar.6 w
execute if score @s letter_inv6 matches 23 run item replace entity @s hotbar.6 with minecraft:gray_wool{"IsLetter": true, "display": {"Name": "{\"text\": \"Letter X\", \"italic\": false}", "Lore": ["{\"text\": \"Value: 8\", \"italic\": false}"]}}
execute if score @s letter_inv6 matches 24 run item replace entity @s hotbar.6 with minecraft:light_gray_wool{"IsLetter": true, "display": {"Name": "{\"text\": \"Letter Y\", \"italic\": false}", "Lore": ["{\"text\": \"Value: 4\", \"italic\": false}"]}}
execute if score @s letter_inv6 matches 25 run item replace entity @s hotbar.6 with minecraft:cyan_wool{"IsLetter": true, "display": {"Name": "{\"text\": \"Letter Z\", \"italic\": false}", "Lore": ["{\"text\": \"Value: 10\", \"italic\": false}"]}}
scoreboard players set has_swap_button hotbar_buttons 0
scoreboard players set has_end_button hotbar_buttons 0
scoreboard players set has_play_button hotbar_buttons 0
scoreboard players set has_pass_button hotbar_buttons 0
execute if entity @s[tag=current_player] unless entity @s[tag=swapping_letters] if score state current_round matches 0 if score letters_left letter_bag matches 1.. run scoreboard players set has_swap_button hotbar_buttons 1
execute if entity @s[tag=current_player] unless entity @s[tag=swapping_letters] if score state current_round matches 0 unless score letters_left letter_bag matches 1.. run scoreboard players set has_end_button hotbar_buttons 1
execute if entity @s[tag=current_player] unless entity @s[tag=swapping_letters] if score state current_round matches 1 run scoreboard players set has_play_button hotbar_buttons 1
execute if entity @s[tag=current_player] if score state current_round matches 0 run scoreboard players set has_pass_button hotbar_buttons 1
execute if score has_swap_button hotbar_buttons matches 1 run item replace entity @s hotbar.7 with minecraft:carrot_on_a_stick{"CustomModelData": 4, "Action": 3, "display": {"Name": "{\"text\": \"Swap letters\", \"italic\": false}", "Lore": ["{\"text\": \"Right-click to swap your letters\", \"italic\": false}"]}}
execute if score has_end_button hotbar_buttons matches 1 run item replace entity @s hotbar.7 with minecraft:carrot_on_a_stick{"CustomModelData": 5, "Action": 4, "display": {"Name": "{\"text\": \"End the Game\", \"italic\": false}", "Lore": ["{\"text\": \"Right-click to end the game\", \"italic\": false}"]}}
execute if score has_swap_button hotbar_buttons matches 0 if score has_end_button hotbar_buttons matches 0 run item replace entity @s hotbar.7 with minecraft:air
execute if score has_play_button hotbar_buttons matches 1 run item replace entity @s hotbar.8 with minecraft:carrot_on_a_stick{"CustomModelData": 2, "Action": 1, "display": {"Name": "{\"text\": \"Play\", \"italic\": false}", "Lore": ["{\"text\": \"Right-click to confirm your play\", \"italic\": false}"]}}
execute if score has_pass_button hotbar_buttons matches 1 run item replace entity @s hotbar.8 with minecraft:carrot_on_a_stick{"CustomModelData": 3, "Action": 2, "display": {"Name": "{\"text\": \"Pass turn\", \"italic\": false}", "Lore": ["{\"text\": \"Right-click to pass your turn\", \"italic\": false}"]}}
execute if score has_pass_button hotbar_buttons matches 0 if score has_play_button hotbar_buttons matches 0 run item replace entity @s hotbar.8 with minecraft:air
scoreboard players set slot0 hotbar_buttons 0
scoreboard players set slot1 hotbar_buttons 0
execute if entity @s[tag=current_player] unless entity @s[tag=swapping_letters] if score state current_round matches 1 run scoreboard players set slot1 hotbar_buttons 1
execute if entity @s[tag=current_player] if score state current_round matches 0 if score non_spectator_player_count state matches 2.. run scoreboard players set slot1 hotbar_buttons 2
execute if entity @s[tag=current_player] if score state current_round matches 0 if entity @s[tag=swapping_letters] run scoreboard players set slot1 hotbar_buttons 2
execute if entity @s[tag=current_player] unless entity @s[tag=swapping_letters] if score state current_round matches 0 if score letters_left letter_bag matches 1.. run scoreboard players set slot0 hotbar_buttons 3
execute if entity @s[tag=current_player] unless entity @s[tag=swapping_letters] if score state current_round matches 0 unless score letters_left letter_bag matches 1.. if score vote_in_progress end_game_vote matches 0 if score non_spectator_player_count state matches 2.. run scoreboard players set slot0 hotbar_buttons 4
execute if entity @s[tag=current_player] unless entity @s[tag=swapping_letters] if score state current_round matches 0 if score vote_in_progress end_game_vote matches 0 if score non_spectator_player_count state matches 1 run scoreboard players set slot1 hotbar_buttons 4
execute unless entity @s[tag=current_player] if score vote_in_progress end_game_vote matches 0 run scoreboard players set slot1 hotbar_buttons 4
execute if entity @s[tag=current_player] unless entity @s[tag=swapping_letters] unless score state current_round matches 0 run scoreboard players set slot0 hotbar_buttons 5
execute if entity @s[tag=current_player] if entity @s[tag=swapping_letters] if score @s swapped_letters matches 0 run scoreboard players set slot0 hotbar_buttons 6
execute if score slot0 hotbar_buttons matches 1 run item replace entity @s hotbar.7 with minecraft:carrot_on_a_stick{"CustomModelData": 2, "Action": 1, "display": {"Name": "{\"text\": \"Play\", \"italic\": false}", "Lore": ["{\"text\": \"Right-click to confirm your play\", \"italic\": false}"]}}
execute if score slot1 hotbar_buttons matches 1 run item replace entity @s hotbar.8 with minecraft:carrot_on_a_stick{"CustomModelData": 2, "Action": 1, "display": {"Name": "{\"text\": \"Play\", \"italic\": false}", "Lore": ["{\"text\": \"Right-click to confirm your play\", \"italic\": false}"]}}
execute if score slot0 hotbar_buttons matches 2 run item replace entity @s hotbar.7 with minecraft:carrot_on_a_stick{"CustomModelData": 3, "Action": 2, "display": {"Name": "{\"text\": \"Pass turn\", \"italic\": false}", "Lore": ["{\"text\": \"Right-click to pass your turn\", \"italic\": false}"]}}
execute if score slot1 hotbar_buttons matches 2 run item replace entity @s hotbar.8 with minecraft:carrot_on_a_stick{"CustomModelData": 3, "Action": 2, "display": {"Name": "{\"text\": \"Pass turn\", \"italic\": false}", "Lore": ["{\"text\": \"Right-click to pass your turn\", \"italic\": false}"]}}
execute if score slot0 hotbar_buttons matches 3 run item replace entity @s hotbar.7 with minecraft:carrot_on_a_stick{"CustomModelData": 4, "Action": 3, "display": {"Name": "{\"text\": \"Swap letters\", \"italic\": false}", "Lore": ["{\"text\": \"Right-click to swap your letters\", \"italic\": false}"]}}
execute if score slot1 hotbar_buttons matches 3 run item replace entity @s hotbar.8 with minecraft:carrot_on_a_stick{"CustomModelData": 4, "Action": 3, "display": {"Name": "{\"text\": \"Swap letters\", \"italic\": false}", "Lore": ["{\"text\": \"Right-click to swap your letters\", \"italic\": false}"]}}
execute if score slot0 hotbar_buttons matches 4 run item replace entity @s hotbar.7 with minecraft:carrot_on_a_stick{"CustomModelData": 5, "Action": 4, "display": {"Name": "{\"text\": \"End the Game\", \"italic\": false}", "Lore": ["{\"text\": \"Right-click to start a vote to end the game\", \"italic\": false}"]}}
execute if score slot1 hotbar_buttons matches 4 run item replace entity @s hotbar.8 with minecraft:carrot_on_a_stick{"CustomModelData": 5, "Action": 4, "display": {"Name": "{\"text\": \"End the Game\", \"italic\": false}", "Lore": ["{\"text\": \"Right-click to start a vote to end the game\", \"italic\": false}"]}}
execute if score slot0 hotbar_buttons matches 5 run item replace entity @s hotbar.7 with minecraft:carrot_on_a_stick{"CustomModelData": 6, "Action": 5, "display": {"Name": "{\"text\": \"Recall letters\", \"italic\": false}", "Lore": ["{\"text\": \"Right-click to recall placed letters\", \"italic\": false}"]}}
execute if score slot1 hotbar_buttons matches 5 run item replace entity @s hotbar.8 with minecraft:carrot_on_a_stick{"CustomModelData": 6, "Action": 5, "display": {"Name": "{\"text\": \"Recall letters\", \"italic\": false}", "Lore": ["{\"text\": \"Right-click to recall placed letters\", \"italic\": false}"]}}
execute if score slot0 hotbar_buttons matches 6 run item replace entity @s hotbar.7 with minecraft:carrot_on_a_stick{"CustomModelData": 7, "Action": 6, "display": {"Name": "{\"text\": \"Cancel swapping\", \"italic\": false}", "Lore": ["{\"text\": \"Right-click to cancel swapping letters\", \"italic\": false}"]}}
execute if score slot1 hotbar_buttons matches 6 run item replace entity @s hotbar.8 with minecraft:carrot_on_a_stick{"CustomModelData": 7, "Action": 6, "display": {"Name": "{\"text\": \"Cancel swapping\", \"italic\": false}", "Lore": ["{\"text\": \"Right-click to cancel swapping letters\", \"italic\": false}"]}}
execute if score slot0 hotbar_buttons matches 0 run item replace entity @s hotbar.7 with minecraft:air
execute if score slot1 hotbar_buttons matches 0 run item replace entity @s hotbar.8 with minecraft:air
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tag @s remove swapping_letters
scoreboard players set @s swapped_letters 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tag @s add swapping_letters
scoreboard players set @s swapped_letters 0
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
title @s actionbar {"text": "Drop letters to swap them", "bold": true}

execute if score @s dropped_item matches 1.. run function game:inventory/clear_selected_slot
execute if score @s dropped_item matches 1.. if score @s swapped_letters = letters_left letter_bag run tellraw @s {"text":"Not enough letters left in the bag!","color":"red"}
execute if score @s dropped_item matches 1.. if score @s swapped_letters = letters_left letter_bag run function effects:sound/error_sound

execute if score @s dropped_item matches 1.. unless score @s swapped_letters = letters_left letter_bag run function game:inventory/clear_selected_slot
execute if score @s dropped_item matches 1.. unless score @s swapped_letters = letters_left letter_bag unless entity @s[nbt={SelectedItemSlot:7}] unless entity @s[nbt={SelectedItemSlot:8}] run scoreboard players add @s swapped_letters 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#Add the letters back to the letter bag if we're not in singleplayer
execute as @a[tag=swapping_letters] if score non_spectator_player_count state matches 2.. run scoreboard players operation letters_left letter_bag += @s swapped_letters

tag @a remove swapping_letters
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
tp @s @p[tag=current_player]
spectate @p[tag=current_player]
title @s actionbar ["",{"text":"Spectating: ","bold":true},{"selector":"@p[tag=current_player]","bold":true}]
4 changes: 3 additions & 1 deletion datapacks/game/data/game/functions/start_game.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ function game:board/reset
function game:turns/assign_turn_order
function game:turns/next_player

scoreboard players set vote_in_progress end_game_vote 0

scoreboard players operation letters_left letter_bag = letters_in_bag configuration

scoreboard players set state state 1
bossbar set minecraft:bar visible true
bossbar set minecraft:letters_left_in_bag visible true

scoreboard objectives setdisplay belowName score
scoreboard objectives setdisplay below_name score
scoreboard objectives setdisplay list score

execute as @a at @s run function game:players/player_join_game
1 change: 1 addition & 0 deletions datapacks/game/data/game/functions/tick.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ title @a actionbar ""
function game:tile_placing/tick
function game:players/tick
function game:hotbar_buttons/tick
function game:end_game_vote/tick

scoreboard players set @a used_carrot_stick 0
scoreboard players set @a dropped_item 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
execute as @e[tag=center_tile] at @s store result score center_tile_filled current_round run execute if block ~ ~-4 ~ minecraft:pink_concrete

execute if score center_tile_filled current_round matches 0 unless block ~ ~ ~ minecraft:blue_wool run tellraw @s {"text":"The first letter must be placed on the center tile!","color":"red"}
execute if score center_tile_filled current_round matches 0 unless block ~ ~ ~ minecraft:blue_wool run function effects:sound/error_sound

execute if score center_tile_filled current_round matches 0 if block ~ ~ ~ minecraft:blue_wool run function game:tile_placing/set_selected_block

execute if score center_tile_filled current_round matches 1 run function game:tile_placing/set_selected_block
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
tag @a remove current_player
tag @a remove swapping_letters
execute if entity @a[tag=swapping_letters] run function game:letter_swapping/turn_over

function game:board/recall_letters

scoreboard players add $current turn_order 1
execute if score $current turn_order >= $incremental turn_order run scoreboard players set $current turn_order 0

execute as @a[tag=player] if score @s turn_order = $current turn_order run tag @s add current_player
execute if score non_spectator_player_count state matches 2.. as @a[tag=current_player] at @s run function game:turns/notify
function game:board/update
2 changes: 2 additions & 0 deletions datapacks/game/data/game/functions/turns/notify.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tellraw @s {"text": "It's your turn!", "color": "green"}
function effects:sound/notification_sound
Loading

0 comments on commit 1b41050

Please sign in to comment.