Skip to content

Commit

Permalink
River Race v1 (#210)
Browse files Browse the repository at this point in the history
* Add initial working bits for microgames and trivia blocks

* In'n'out of microgames like a flash

* Save and restore player inventory when going from minigame to microgame and back

* Add victory points behavior and state, send trivia questions to victory points system, and add team victory points scoring

* Selecting trivia answers

* Let cojo's bits still work

* Add a configurable game queue for microgames and go from microgame to microgame before going back to the main game

* Reward victory points for winning microgames

* Reset victory points if we try to play a game with victory points twice in the same lobby

* Make it more generic so we can store multiple things per-team in the river race game, and make multigamephase a bit more generic for storing game states in general. p hacky thooo

* Remove unused game phase type to fix builds

* Add river race translations file

* Add a trader to each zone

* Add a client state to disable the recipe book

* Crafting bee is in a working state

* Add hints

* Track wins correctly

* Add client state to invert controls and swap movement

See #200

* Connect four

* Track draw

* More work on crafting bee and connect four

* Add trivia chest, make gates work

* Rerun datagen

* Switch microgame queue to an action

* Update build.gradle to not include testing in normal run

* Add a loot item condition to conditionally do loot tables based on minigame

* basic boss bar / progression, ide run names, use spawn from datapack

---------

Co-authored-by: Cory Scheviak <[email protected]>
Co-authored-by: Matyrobbrt <[email protected]>
  • Loading branch information
3 people authored Oct 26, 2024
1 parent c850b76 commit dfddcdc
Show file tree
Hide file tree
Showing 108 changed files with 3,974 additions and 25 deletions.
26 changes: 18 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id 'eclipse'
id 'idea'
id 'java-library'
id 'net.neoforged.moddev' version '1.0.0'
id 'net.neoforged.moddev' version '2.0.36-beta'
}

group = 'com.lovetropics.minigames'
Expand Down Expand Up @@ -45,41 +45,51 @@ neoForge {

addModdingDependenciesTo sourceSets.test

mods {
"${project.mod_id}" {
sourceSet sourceSets.main
}
"${project.mod_id}_test" {
sourceSet sourceSets.main
sourceSet sourceSets.test
}
}

runs {
client {
client()
loadedMods = [mods."${mod_id}"]

programArguments.addAll '--username', 'Dev' + new Random().nextInt(999)
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
}

server {
server()
loadedMods = [mods."${mod_id}"]

programArgument '--nogui'
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
}

gameTestServer {
type = "gameTestServer"
sourceSet = sourceSets.test
loadedMods = [mods."${mod_id}_test"]

systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
}

data {
data()
loadedMods = [mods."${mod_id}_test"]

programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
}

configureEach {
logLevel = org.slf4j.event.Level.WARN
}
}

mods {
"${project.mod_id}" {
sourceSet sourceSets.main
sourceSet sourceSets.test
ideName = project.name + " - " + ideName.get()
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ neo_version=21.0.167
parchment_version=2024.06.23
registrate_version=1.3.0+50
ltlib_version=[1.4.5,1.5)
ltextras_version=1.3.0-release+7
ltextras_version=1.3.0-release+15

org.gradle.jvmargs=-Xmx1G
org.gradle.daemon=true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "ltminigames:block/trivia_chest"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "ltminigames:block/trivia_collectable"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "ltminigames:block/trivia_gate"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "ltminigames:block/trivia_reward"
}
}
}
16 changes: 16 additions & 0 deletions src/generated/resources/assets/ltminigames/lang/en_ud.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
"block.ltminigames.plastic_bottle": "ǝןʇʇoᗺ ɔıʇsɐןԀ",
"block.ltminigames.plastic_rings": "sbuıᴚ ɔıʇsɐןԀ",
"block.ltminigames.straw": "ʍɐɹʇS",
"block.ltminigames.trivia_chest": "ʇsǝɥƆ ɐıʌıɹ⟘",
"block.ltminigames.trivia_collectable": "ǝןqɐʇɔǝןןoƆ ɐıʌıɹ⟘",
"block.ltminigames.trivia_gate": "ǝʇɐ⅁ ɐıʌıɹ⟘",
"block.ltminigames.trivia_reward": "pɹɐʍǝᴚ ɐıʌıɹ⟘",
"effect.ltminigames.coin_multiplier_power_up": "dn-ɹǝʍoԀ ɹǝıןdıʇןnW uıoƆ",
"effect.ltminigames.knockback_resistance_power_up": "d∩-ɹǝʍoԀ ǝɔuɐʇsısǝᴚ ʞɔɐqʞɔouʞ",
"effect.ltminigames.leaky_pockets": "sʇǝʞɔoԀ ʎʞɐǝꞀ",
Expand Down Expand Up @@ -66,6 +70,8 @@
"ltminigames.command.started_game": "¡%s pǝʇɹɐʇs ǝʌɐɥ noʎ",
"ltminigames.command.stopped_game": "¡%s pǝddoʇs ǝʌɐɥ noʎ",
"ltminigames.command.team_chat_intro": "˙ǝuoʎɹǝʌǝ ɥʇıʍ ʇɐɥɔ oʇ ןɐqoןb ʇɐɥɔ/ ɹo ʇnoɥs/ ǝs∩ ˙ʇɐɥɔ ɯɐǝʇ buısn ǝɹɐ noʎ",
"ltminigames.container.triviaChest": "ʇsǝɥƆ ɐıʌıɹ⟘",
"ltminigames.container.triviaChestDouble": "ʇsǝɥƆ ɐıʌıɹ⟘ ǝbɹɐꞀ",
"ltminigames.minigame.arcade_turtle_race": "ǝɔɐᴚ ǝןʇɹn⟘ ǝpɐɔɹⱯ",
"ltminigames.minigame.biodiversity_blitz": "zʇıןᗺ ʎʇısɹǝʌıpoıᗺ",
"ltminigames.minigame.biodiversity_blitz.can_only_place_plants": "¡doɥs ǝɥʇ ɯoɹɟ ʇob noʎ sʇuɐןd ǝɔɐןd ʎןuo uɐɔ noʎ",
Expand Down Expand Up @@ -164,7 +170,14 @@
"ltminigames.minigame.build_competition": "uoıʇıʇǝdɯoƆ pןınᗺ",
"ltminigames.minigame.calamity": "ʎʇıɯɐןɐƆ",
"ltminigames.minigame.chaos_block_party": "ʎʇɹɐԀ ʞɔoןᗺ soɐɥƆ",
"ltminigames.minigame.connect_four": "ɹnoℲ ʇɔǝuuoƆ",
"ltminigames.minigame.connect_four.teams_goes_next": "ʇxǝu sǝob %s ɯɐǝ⟘",
"ltminigames.minigame.connect_four.your_turn": "ʞɔoןq ɐ ǝɔɐןd oʇ uɹnʇ ɹnoʎ sı ʇI",
"ltminigames.minigame.conservation_exploration": "uoıʇɐɹoןdxƎ uoıʇɐʌɹǝsuoƆ",
"ltminigames.minigame.crafting_bee.dont_cheat": "¡ʇɐǝɥɔ ʇ,uoᗡ",
"ltminigames.minigame.crafting_bee.hint": "sʇuǝıpǝɹbuı ɟo ɹǝqɯnu ɯopuɐɹ ɐ ɟo uoıʇısod ǝɥʇ buıʎɐןdsıp 'ʇuıɥ ɐ ʍoɥs oʇ ʞɔıןƆ",
"ltminigames.minigame.crafting_bee.hints_left": "ʇɟǝן sʇuıɥ %s ǝʌɐɥ noʎ",
"ltminigames.minigame.crafting_bee.team_has_completed_recipes": "sǝdıɔǝɹ %s ɟo ʇno %s pǝʇǝןdɯoɔ sɐɥ %s ɯɐǝ⟘",
"ltminigames.minigame.donation.acid_rain": "uıɐᴚ pıɔⱯ",
"ltminigames.minigame.donation.acid_rain.description": "¡ǝʇnuıɯ Ɩ ɹoɟ spɐǝɥ ,sɹǝʎɐןd ǝɥʇ uo uʍop pıɔɐ uıɐᴚ",
"ltminigames.minigame.donation.acid_rain.toast": "¡ǝʇnuıɯ Ɩ ɹoɟ pıɔɐ buıuıɐɹ sı ʇI",
Expand Down Expand Up @@ -382,6 +395,8 @@
"ltminigames.minigame.results": ":sʇןnsǝɹ ǝɥʇ ǝɹɐ ǝɹǝH ¡ɹǝʌo sı ǝɯɐb ǝɥ⟘",
"ltminigames.minigame.reward_item": "%s x%s - ",
"ltminigames.minigame.rewards_granted": "¡sǝɯɐbıuıɯ buıʎɐןd ɹoɟ spɹɐʍǝɹ ʇob noʎ",
"ltminigames.minigame.river_race": "ǝɔɐᴚ ɹǝʌıᴚ",
"ltminigames.minigame.river_race.shop": "doɥS",
"ltminigames.minigame.signature_run": "unᴚ ǝɹnʇɐubıS",
"ltminigames.minigame.spectating_notification": "˙ɯooz oʇ ןןoɹɔs puɐ %s pןoH\n˙sɹǝʎɐןd ʇɔǝןǝs oʇ sʎǝʞ ʍoɹɹɐ ǝɥʇ ǝsn ɹo ןןoɹɔS\n¡%s ɐ ǝɹɐ noʎ",
"ltminigames.minigame.spectating_notification.key": "ןoɹʇuoƆ ʇɟǝꞀ",
Expand Down Expand Up @@ -465,6 +480,7 @@
"ltminigames.minigame.survive_the_tide_intro5": "¡ǝǝs s,ʇǝꞀ\n",
"ltminigames.minigame.survive_the_tide_pvp_enabled.subtitle": "˙˙˙sɹǝʎɐןd ɹǝɥʇo ɟo ǝɹɐʍǝᗺ",
"ltminigames.minigame.survive_the_tide_pvp_enabled.title": "¡ᗡƎꞀᗺⱯNƎ SI ԀΛԀ",
"ltminigames.minigame.team_won": "¡ǝɯɐb ǝɥʇ uoʍ %s ɯɐǝ⟘ ⭐",
"ltminigames.minigame.teams.blue": "ǝnןᗺ",
"ltminigames.minigame.teams.green": "uǝǝɹ⅁",
"ltminigames.minigame.teams.hiders": "sɹǝpıH",
Expand Down
16 changes: 16 additions & 0 deletions src/generated/resources/assets/ltminigames/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
"block.ltminigames.plastic_bottle": "Plastic Bottle",
"block.ltminigames.plastic_rings": "Plastic Rings",
"block.ltminigames.straw": "Straw",
"block.ltminigames.trivia_chest": "Trivia Chest",
"block.ltminigames.trivia_collectable": "Trivia Collectable",
"block.ltminigames.trivia_gate": "Trivia Gate",
"block.ltminigames.trivia_reward": "Trivia Reward",
"effect.ltminigames.coin_multiplier_power_up": "Coin Multiplier Power-up",
"effect.ltminigames.knockback_resistance_power_up": "Knockback Resistance Power-Up",
"effect.ltminigames.leaky_pockets": "Leaky Pockets",
Expand Down Expand Up @@ -66,6 +70,8 @@
"ltminigames.command.started_game": "You have started %s!",
"ltminigames.command.stopped_game": "You have stopped %s!",
"ltminigames.command.team_chat_intro": "You are using team chat. Use /shout or /chat global to chat with everyone.",
"ltminigames.container.triviaChest": "Trivia Chest",
"ltminigames.container.triviaChestDouble": "Large Trivia Chest",
"ltminigames.minigame.arcade_turtle_race": "Arcade Turtle Race",
"ltminigames.minigame.biodiversity_blitz": "Biodiversity Blitz",
"ltminigames.minigame.biodiversity_blitz.can_only_place_plants": "You can only place plants you got from the shop!",
Expand Down Expand Up @@ -164,7 +170,14 @@
"ltminigames.minigame.build_competition": "Build Competition",
"ltminigames.minigame.calamity": "Calamity",
"ltminigames.minigame.chaos_block_party": "Chaos Block Party",
"ltminigames.minigame.connect_four": "Connect Four",
"ltminigames.minigame.connect_four.teams_goes_next": "Team %s goes next",
"ltminigames.minigame.connect_four.your_turn": "It is your turn to place a block",
"ltminigames.minigame.conservation_exploration": "Conservation Exploration",
"ltminigames.minigame.crafting_bee.dont_cheat": "Don't cheat!",
"ltminigames.minigame.crafting_bee.hint": "Click to show a hint, displaying the position of a random number of ingredients",
"ltminigames.minigame.crafting_bee.hints_left": "You have %s hints left",
"ltminigames.minigame.crafting_bee.team_has_completed_recipes": "Team %s has completed %s out of %s recipes",
"ltminigames.minigame.donation.acid_rain": "Acid Rain",
"ltminigames.minigame.donation.acid_rain.description": "Rain acid down on the players' heads for 1 minute!",
"ltminigames.minigame.donation.acid_rain.toast": "It is raining acid for 1 minute!",
Expand Down Expand Up @@ -382,6 +395,8 @@
"ltminigames.minigame.results": "The game is over! Here are the results:",
"ltminigames.minigame.reward_item": " - %sx %s",
"ltminigames.minigame.rewards_granted": "You got rewards for playing minigames!",
"ltminigames.minigame.river_race": "River Race",
"ltminigames.minigame.river_race.shop": "Shop",
"ltminigames.minigame.signature_run": "Signature Run",
"ltminigames.minigame.spectating_notification": "You are a %s!\nScroll or use the arrow keys to select players.\nHold %s and scroll to zoom.",
"ltminigames.minigame.spectating_notification.key": "Left Control",
Expand Down Expand Up @@ -465,6 +480,7 @@
"ltminigames.minigame.survive_the_tide_intro5": "\nLet's see!",
"ltminigames.minigame.survive_the_tide_pvp_enabled.subtitle": "Beware of other players...",
"ltminigames.minigame.survive_the_tide_pvp_enabled.title": "PVP IS ENABLED!",
"ltminigames.minigame.team_won": "⭐ Team %s won the game!",
"ltminigames.minigame.teams.blue": "Blue",
"ltminigames.minigame.teams.green": "Green",
"ltminigames.minigame.teams.hiders": "Hiders",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"textures": {
"particle": "ltminigames:block/trivia_reward"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "ltminigames:block/trivia_collectable"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "ltminigames:block/trivia_gate"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "ltminigames:block/trivia_reward"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/chest",
"textures": {
"particle": "ltminigames:block/trivia_reward"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"parent": "ltminigames:block/trivia_collectable"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"parent": "ltminigames:block/trivia_gate"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"parent": "ltminigames:block/trivia_reward"
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
}
}
],
"is_multi_game": false,
"map": {
"type": "ltminigames:inline",
"dimension": "minecraft:overworld"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"volume": 0.5
}
],
"is_multi_game": false,
"map": {
"type": "ltminigames:inline",
"dimension": "minecraft:overworld"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
}
}
],
"is_multi_game": false,
"map": {
"type": "ltminigames:inline",
"dimension": "minecraft:overworld"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"type": "ltminigames:cancel_player_damage"
}
],
"is_multi_game": false,
"map": {
"type": "ltminigames:inline",
"dimension": "minecraft:overworld"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"type": "ltminigames:disable_hunger"
}
],
"is_multi_game": false,
"map": {
"type": "ltminigames:inline",
"dimension": "minecraft:overworld"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
}
}
],
"is_multi_game": false,
"map": {
"type": "ltminigames:inline",
"dimension": "minecraft:overworld"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
}
}
],
"is_multi_game": false,
"map": {
"type": "ltminigames:inline",
"dimension": "minecraft:overworld"
Expand Down
Loading

0 comments on commit dfddcdc

Please sign in to comment.