Modern Apps git

← Modern-Apps.git

voxels: add the Matcha blessing pantheon as 22 permanent attunements

Commit
2b1dbf1c9ac71337f3eeead88e31b6c04ba9bc5f
Author
Vayun Mathur <[email protected]>
When
2026-08-05 04:56 UTC (4 months ago)
Parents
e9e799a

Diff

games/voxels/src/main/assets/achievements.json
diff --git a/games/voxels/src/main/assets/achievements.json b/games/voxels/src/main/assets/achievements.jsonindex 3d468c452b..95536fe031 100644--- a/games/voxels/src/main/assets/achievements.json+++ b/games/voxels/src/main/assets/achievements.json@@ -1,21 +1,110 @@ [-  {"id":"first_block","name":"Groundbreaker","description":"Break your first block"},-  {"id":"first_place","name":"Builder","description":"Place your first block"},-  {"id":"explorer_100","name":"Explorer","description":"Walk 100 blocks","targetProgress":100},-  {"id":"builder_100","name":"Architect","description":"Place 100 blocks","targetProgress":100},-  {"id":"miner_100","name":"Miner","description":"Break 100 blocks","targetProgress":100},-  {"id":"night_survivor","name":"Night Owl","description":"Survive your first night"},-  {"id":"deep_diver","name":"Deep Diver","description":"Mine down to bedrock depth"},-  {"id":"silver_tongue","name":"Silver Tongue","description":"Smelt your first silver ingot"},-  {"id":"steelworker","name":"Steelworker","description":"Forge steel in a blast furnace"},-  {"id":"alchemist","name":"Alchemist","description":"Amalgamate an adamant ingot"},-  {"id":"blessed","name":"Blessed","description":"Craft a quicksilver blessing"},-  {"id":"fully_armed","name":"Fully Armed","description":"Wear a complete set of diamond or adamant armor"},-  {"id":"nether_bound","name":"Nether Bound","description":"Step through a nether portal"},-  {"id":"the_end","name":"The End","description":"Reach the End"},-  {"id":"dragonslayer","name":"Dragonslayer","description":"Defeat the Ender Dragon"},-  {"id":"withering","name":"Withering","description":"Defeat the Wither"},-  {"id":"beacon_master","name":"Beacon Master","description":"Power a full four-tier beacon"},-  {"id":"sky_bound","name":"Sky Bound","description":"Equip an elytra"},-  {"id":"heart_of_gold","name":"Heart of Gold","description":"Reach the maximum heart count"}-]+  {+    "id": "first_block",+    "name": "Groundbreaker",+    "description": "Break your first block"+  },+  {+    "id": "first_place",+    "name": "Builder",+    "description": "Place your first block"+  },+  {+    "id": "explorer_100",+    "name": "Explorer",+    "description": "Walk 100 blocks",+    "targetProgress": 100+  },+  {+    "id": "builder_100",+    "name": "Architect",+    "description": "Place 100 blocks",+    "targetProgress": 100+  },+  {+    "id": "miner_100",+    "name": "Miner",+    "description": "Break 100 blocks",+    "targetProgress": 100+  },+  {+    "id": "night_survivor",+    "name": "Night Owl",+    "description": "Survive your first night"+  },+  {+    "id": "deep_diver",+    "name": "Deep Diver",+    "description": "Mine down to bedrock depth"+  },+  {+    "id": "silver_tongue",+    "name": "Silver Tongue",+    "description": "Smelt your first silver ingot"+  },+  {+    "id": "steelworker",+    "name": "Steelworker",+    "description": "Forge steel in a blast furnace"+  },+  {+    "id": "alchemist",+    "name": "Alchemist",+    "description": "Amalgamate an adamant ingot"+  },+  {+    "id": "blessed",+    "name": "Blessed",+    "description": "Craft a quicksilver blessing"+  },+  {+    "id": "fully_armed",+    "name": "Fully Armed",+    "description": "Wear a complete set of diamond or adamant armor"+  },+  {+    "id": "nether_bound",+    "name": "Nether Bound",+    "description": "Step through a nether portal"+  },+  {+    "id": "the_end",+    "name": "The End",+    "description": "Reach the End"+  },+  {+    "id": "dragonslayer",+    "name": "Dragonslayer",+    "description": "Defeat the Ender Dragon"+  },+  {+    "id": "withering",+    "name": "Withering",+    "description": "Defeat the Wither"+  },+  {+    "id": "beacon_master",+    "name": "Beacon Master",+    "description": "Power a full four-tier beacon"+  },+  {+    "id": "sky_bound",+    "name": "Sky Bound",+    "description": "Equip an elytra"+  },+  {+    "id": "heart_of_gold",+    "name": "Heart of Gold",+    "description": "Reach the maximum heart count"+  },+  {+    "id": "attuned",+    "name": "Attuned",+    "description": "Bind your first blessing"+  },+  {+    "id": "pantheon",+    "name": "Pantheon",+    "description": "Fill every attunement slot"+  }+]\ No newline at end of file
games/voxels/src/main/assets/block/blessing_aeolus.png
diff --git a/games/voxels/src/main/assets/block/blessing_aeolus.png b/games/voxels/src/main/assets/block/blessing_aeolus.pngnew file mode 100644index 0000000000..d24a16d369Binary files /dev/null and b/games/voxels/src/main/assets/block/blessing_aeolus.png differ
games/voxels/src/main/assets/block/blessing_apollo.png
diff --git a/games/voxels/src/main/assets/block/blessing_apollo.png b/games/voxels/src/main/assets/block/blessing_apollo.pngnew file mode 100644index 0000000000..6f3abe2f15Binary files /dev/null and b/games/voxels/src/main/assets/block/blessing_apollo.png differ
games/voxels/src/main/assets/block/blessing_arachnae.png
diff --git a/games/voxels/src/main/assets/block/blessing_arachnae.png b/games/voxels/src/main/assets/block/blessing_arachnae.pngnew file mode 100644index 0000000000..45dd7550b4Binary files /dev/null and b/games/voxels/src/main/assets/block/blessing_arachnae.png differ
games/voxels/src/main/assets/block/blessing_ares.png
diff --git a/games/voxels/src/main/assets/block/blessing_ares.png b/games/voxels/src/main/assets/block/blessing_ares.pngnew file mode 100644index 0000000000..461499ace4Binary files /dev/null and b/games/voxels/src/main/assets/block/blessing_ares.png differ
games/voxels/src/main/assets/block/blessing_artemis.png
diff --git a/games/voxels/src/main/assets/block/blessing_artemis.png b/games/voxels/src/main/assets/block/blessing_artemis.pngnew file mode 100644index 0000000000..aa9ef47d5fBinary files /dev/null and b/games/voxels/src/main/assets/block/blessing_artemis.png differ
games/voxels/src/main/assets/block/blessing_clement.png
diff --git a/games/voxels/src/main/assets/block/blessing_clement.png b/games/voxels/src/main/assets/block/blessing_clement.pngnew file mode 100644index 0000000000..27a4dfbf81Binary files /dev/null and b/games/voxels/src/main/assets/block/blessing_clement.png differ
games/voxels/src/main/assets/block/blessing_cronus.png
diff --git a/games/voxels/src/main/assets/block/blessing_cronus.png b/games/voxels/src/main/assets/block/blessing_cronus.pngnew file mode 100644index 0000000000..7ab7abc1baBinary files /dev/null and b/games/voxels/src/main/assets/block/blessing_cronus.png differ
games/voxels/src/main/assets/block/blessing_daedalus.png
diff --git a/games/voxels/src/main/assets/block/blessing_daedalus.png b/games/voxels/src/main/assets/block/blessing_daedalus.pngnew file mode 100644index 0000000000..63cbe20711Binary files /dev/null and b/games/voxels/src/main/assets/block/blessing_daedalus.png differ
games/voxels/src/main/assets/block/blessing_deep.png
diff --git a/games/voxels/src/main/assets/block/blessing_deep.png b/games/voxels/src/main/assets/block/blessing_deep.pngdeleted file mode 100644index cec206071e..0000000000Binary files a/games/voxels/src/main/assets/block/blessing_deep.png and /dev/null differ
games/voxels/src/main/assets/block/blessing_demeter.png
diff --git a/games/voxels/src/main/assets/block/blessing_demeter.png b/games/voxels/src/main/assets/block/blessing_demeter.pngnew file mode 100644index 0000000000..7c59dc6e6cBinary files /dev/null and b/games/voxels/src/main/assets/block/blessing_demeter.png differ
games/voxels/src/main/assets/block/blessing_eros.png
diff --git a/games/voxels/src/main/assets/block/blessing_eros.png b/games/voxels/src/main/assets/block/blessing_eros.pngnew file mode 100644index 0000000000..a0241d9eddBinary files /dev/null and b/games/voxels/src/main/assets/block/blessing_eros.png differ
games/voxels/src/main/assets/block/blessing_glaucus.png
diff --git a/games/voxels/src/main/assets/block/blessing_glaucus.png b/games/voxels/src/main/assets/block/blessing_glaucus.pngnew file mode 100644index 0000000000..04f684e70fBinary files /dev/null and b/games/voxels/src/main/assets/block/blessing_glaucus.png differ
games/voxels/src/main/assets/block/blessing_god_king.png
diff --git a/games/voxels/src/main/assets/block/blessing_god_king.png b/games/voxels/src/main/assets/block/blessing_god_king.pngnew file mode 100644index 0000000000..0164f90bfdBinary files /dev/null and b/games/voxels/src/main/assets/block/blessing_god_king.png differ
games/voxels/src/main/assets/block/blessing_hyacinthus.png
diff --git a/games/voxels/src/main/assets/block/blessing_hyacinthus.png b/games/voxels/src/main/assets/block/blessing_hyacinthus.pngnew file mode 100644index 0000000000..4caeec83b9Binary files /dev/null and b/games/voxels/src/main/assets/block/blessing_hyacinthus.png differ
games/voxels/src/main/assets/block/blessing_icarus.png
diff --git a/games/voxels/src/main/assets/block/blessing_icarus.png b/games/voxels/src/main/assets/block/blessing_icarus.pngnew file mode 100644index 0000000000..38c1509a8eBinary files /dev/null and b/games/voxels/src/main/assets/block/blessing_icarus.png differ
games/voxels/src/main/assets/block/blessing_lu_ban.png
diff --git a/games/voxels/src/main/assets/block/blessing_lu_ban.png b/games/voxels/src/main/assets/block/blessing_lu_ban.pngnew file mode 100644index 0000000000..33e9e2b805Binary files /dev/null and b/games/voxels/src/main/assets/block/blessing_lu_ban.png differ
games/voxels/src/main/assets/block/blessing_paris.png
diff --git a/games/voxels/src/main/assets/block/blessing_paris.png b/games/voxels/src/main/assets/block/blessing_paris.pngnew file mode 100644index 0000000000..1afb24ff2fBinary files /dev/null and b/games/voxels/src/main/assets/block/blessing_paris.png differ
games/voxels/src/main/assets/block/blessing_prometheus.png
diff --git a/games/voxels/src/main/assets/block/blessing_prometheus.png b/games/voxels/src/main/assets/block/blessing_prometheus.pngnew file mode 100644index 0000000000..2dd886f8a6Binary files /dev/null and b/games/voxels/src/main/assets/block/blessing_prometheus.png differ
games/voxels/src/main/assets/block/blessing_swift.png
diff --git a/games/voxels/src/main/assets/block/blessing_swift.png b/games/voxels/src/main/assets/block/blessing_swift.pngdeleted file mode 100644index d596f78433..0000000000Binary files a/games/voxels/src/main/assets/block/blessing_swift.png and /dev/null differ
games/voxels/src/main/assets/block/blessing_talos.png
diff --git a/games/voxels/src/main/assets/block/blessing_talos.png b/games/voxels/src/main/assets/block/blessing_talos.pngnew file mode 100644index 0000000000..a6baa5474eBinary files /dev/null and b/games/voxels/src/main/assets/block/blessing_talos.png differ
games/voxels/src/main/assets/block/blessing_warding.png
diff --git a/games/voxels/src/main/assets/block/blessing_warding.png b/games/voxels/src/main/assets/block/blessing_warding.pngnew file mode 100644index 0000000000..97fce21916Binary files /dev/null and b/games/voxels/src/main/assets/block/blessing_warding.png differ
games/voxels/src/main/assets/block/blessing_warrior.png
diff --git a/games/voxels/src/main/assets/block/blessing_warrior.png b/games/voxels/src/main/assets/block/blessing_warrior.pngdeleted file mode 100644index 3dbbf27d2d..0000000000Binary files a/games/voxels/src/main/assets/block/blessing_warrior.png and /dev/null differ
games/voxels/src/main/assets/block/blessing_will.png
diff --git a/games/voxels/src/main/assets/block/blessing_will.png b/games/voxels/src/main/assets/block/blessing_will.pngnew file mode 100644index 0000000000..a1a5f07dc0Binary files /dev/null and b/games/voxels/src/main/assets/block/blessing_will.png differ
games/voxels/src/main/assets/block/blessing_yama.png
diff --git a/games/voxels/src/main/assets/block/blessing_yama.png b/games/voxels/src/main/assets/block/blessing_yama.pngnew file mode 100644index 0000000000..2c2c925ae6Binary files /dev/null and b/games/voxels/src/main/assets/block/blessing_yama.png differ
games/voxels/src/main/assets/block/blessing_yamm.png
diff --git a/games/voxels/src/main/assets/block/blessing_yamm.png b/games/voxels/src/main/assets/block/blessing_yamm.pngnew file mode 100644index 0000000000..fccce213a8Binary files /dev/null and b/games/voxels/src/main/assets/block/blessing_yamm.png differ
games/voxels/src/main/java/com/vayunmathur/games/voxels/MainActivity.kt
diff --git a/games/voxels/src/main/java/com/vayunmathur/games/voxels/MainActivity.kt b/games/voxels/src/main/java/com/vayunmathur/games/voxels/MainActivity.ktindex a955529b6c..75e69cc469 100644--- a/games/voxels/src/main/java/com/vayunmathur/games/voxels/MainActivity.kt+++ b/games/voxels/src/main/java/com/vayunmathur/games/voxels/MainActivity.kt@@ -53,6 +53,8 @@ class MainActivity : ComponentActivity() {                 val activity = LocalContext.current as? android.app.Activity                 var invStartTab by remember { mutableStateOf(0) }                 var recipesJson by remember { mutableStateOf("[]") }+                var blessingsJson by remember { mutableStateOf("""{"slots":[]}""") }+                var blessingCatalogJson by remember { mutableStateOf("[]") }                 var smeltingJson by remember { mutableStateOf("[]") }                 var smeltJson by remember { mutableStateOf("{}") }                 var containerJson by remember { mutableStateOf("""{"slots":[]}""") }@@ -61,7 +63,7 @@ class MainActivity : ComponentActivity() {                 var chestOpen by remember { mutableStateOf(false) }                 var tradesJson by remember { mutableStateOf("[]") }                 var tradeOpen by remember { mutableStateOf(false) }-                LaunchedEffect(Unit) { if (VoxelsNative.isAvailable) try { recipesJson = VoxelsNative.getRecipesJson(); tradesJson = VoxelsNative.getTradesJson(); smeltingJson = VoxelsNative.getSmeltingJson() } catch (_: Exception) {} }+                LaunchedEffect(Unit) { if (VoxelsNative.isAvailable) try { recipesJson = VoxelsNative.getRecipesJson(); tradesJson = VoxelsNative.getTradesJson(); smeltingJson = VoxelsNative.getSmeltingJson(); blessingCatalogJson = VoxelsNative.getBlessingCatalogJson() } catch (_: Exception) {} }                 var achievementsManager by remember { mutableStateOf<VoxelsAchievementsManager?>(null) }                 val newAchievement by (achievementsManager?.newAchievement?.collectAsState() ?: remember { mutableStateOf(null) }) @@ -81,6 +83,7 @@ class MainActivity : ComponentActivity() {                                 debugJson = VoxelsNative.getDebugJson()                                 if (furnaceOpen) smeltJson = VoxelsNative.getSmeltJson()                                 if (chestOpen) containerJson = VoxelsNative.getContainerJson()+                                if (inventoryOpen) blessingsJson = VoxelsNative.getBlessingsJson()                                 try {                                     healthJson = VoxelsNative.getHealthJson()                                     val hp = org.json.JSONObject(healthJson).optDouble("hp", prevHp.toDouble()).toFloat()@@ -117,6 +120,8 @@ class MainActivity : ComponentActivity() {                                         if (obj.optInt("beacon", 0) >= 4) mgr.onAchievementUnlocked("beacon_master")                                         if (obj.optBoolean("elytra", false)) mgr.onAchievementUnlocked("sky_bound")                                         if (obj.optBoolean("maxHearts", false)) mgr.onAchievementUnlocked("heart_of_gold")+                                        if (obj.optInt("attuned", 0) > 0) mgr.onAchievementUnlocked("attuned")+                                        if (obj.optInt("attuned", 0) >= 3) mgr.onAchievementUnlocked("pantheon")                                     }                                 } catch (_: Exception) {}                             } catch (_: Exception) {}@@ -256,7 +261,11 @@ class MainActivity : ComponentActivity() {                     }                      if (inventoryOpen && VoxelsNative.isAvailable) {-                        InventoryOverlay(inventoryJson = inventoryJson, recipesJson = recipesJson, onClose = { inventoryOpen = false }, startTab = invStartTab)+                        InventoryOverlay(+                            inventoryJson = inventoryJson, recipesJson = recipesJson,+                            blessingsJson = blessingsJson, blessingCatalogJson = blessingCatalogJson,+                            onClose = { inventoryOpen = false }, startTab = invStartTab+                        )                     }                      if (tradeOpen && VoxelsNative.isAvailable) {
games/voxels/src/main/java/com/vayunmathur/games/voxels/ui/Hotbar.kt
diff --git a/games/voxels/src/main/java/com/vayunmathur/games/voxels/ui/Hotbar.kt b/games/voxels/src/main/java/com/vayunmathur/games/voxels/ui/Hotbar.ktindex 44f0349f1e..37d9623436 100644--- a/games/voxels/src/main/java/com/vayunmathur/games/voxels/ui/Hotbar.kt+++ b/games/voxels/src/main/java/com/vayunmathur/games/voxels/ui/Hotbar.kt@@ -80,7 +80,15 @@ val blockNames = mapOf(     146 to "Baked Potato", 147 to "Cookie", 148 to "Cooked Salmon", 149 to "Fried Egg", 150 to "Cooked Rabbit",     151 to "Apple Empanada", 152 to "Glow Berry Crumble", 153 to "Choc-Chip Cookie",     154 to "Iron Ingot", 155 to "Diamond", 156 to "Emerald", 157 to "Coal", 158 to "Redstone", 159 to "Stick",-    160 to "Blessing of Swiftness", 161 to "Blessing of the Warrior", 162 to "Blessing of the Deep",+    // The Blessing pantheon (attunements, see blessing.rs).+    160 to "Blessing of Clement", 161 to "Blessing of Ares", 162 to "Blessing of Yamm",+    203 to "Blessing of Daedalus", 204 to "Blessing of Icarus", 205 to "Blessing of Yama",+    206 to "Blessing of Talos", 207 to "Blessing of the God King", 208 to "Blessing of Arachnae",+    209 to "Blessing of Prometheus", 210 to "Blessing of Lu Ban", 211 to "Blessing of Eros",+    212 to "Blessing of Will", 213 to "Blessing of Hyacinthus", 214 to "Blessing of Aeolus",+    215 to "Blessing of Cronus", 216 to "Blessing of Demeter", 217 to "Blessing of Glaucus",+    218 to "Blessing of Apollo", 219 to "Blessing of Artemis", 220 to "Blessing of Warding",+    221 to "Blessing of Paris",     163 to "Wood Pickaxe", 164 to "Wood Sword", 165 to "Stone Pickaxe", 166 to "Stone Sword",     167 to "Iron Pickaxe", 168 to "Iron Sword", 169 to "Diamond Pickaxe", 170 to "Diamond Sword",     171 to "Iron Helmet", 172 to "Iron Chestplate", 173 to "Iron Leggings", 174 to "Iron Boots",@@ -129,7 +137,14 @@ val blockIconFile = mapOf(     146 to "baked_potato.png", 147 to "cookie.png", 148 to "cooked_salmon.png", 149 to "fried_egg.png", 150 to "cooked_rabbit.png",     151 to "apple_empanada.png", 152 to "glow_berry_crumble.png", 153 to "chocolate_chip_cookie.png",     154 to "iron_ingot.png", 155 to "diamond.png", 156 to "emerald.png", 157 to "coal.png", 158 to "redstone.png", 159 to "stick.png",-    160 to "blessing_swift.png", 161 to "blessing_warrior.png", 162 to "blessing_deep.png",+    160 to "blessing_clement.png", 161 to "blessing_ares.png", 162 to "blessing_yamm.png",+    203 to "blessing_daedalus.png", 204 to "blessing_icarus.png", 205 to "blessing_yama.png",+    206 to "blessing_talos.png", 207 to "blessing_god_king.png", 208 to "blessing_arachnae.png",+    209 to "blessing_prometheus.png", 210 to "blessing_lu_ban.png", 211 to "blessing_eros.png",+    212 to "blessing_will.png", 213 to "blessing_hyacinthus.png", 214 to "blessing_aeolus.png",+    215 to "blessing_cronus.png", 216 to "blessing_demeter.png", 217 to "blessing_glaucus.png",+    218 to "blessing_apollo.png", 219 to "blessing_artemis.png", 220 to "blessing_warding.png",+    221 to "blessing_paris.png",     163 to "wood_pickaxe.png", 164 to "wood_sword.png", 165 to "stone_pickaxe.png", 166 to "stone_sword.png",     167 to "iron_pickaxe.png", 168 to "iron_sword.png", 169 to "diamond_pickaxe.png", 170 to "diamond_sword.png",     171 to "iron_helmet.png", 172 to "iron_chestplate.png", 173 to "iron_leggings.png", 174 to "iron_boots.png",@@ -153,8 +168,10 @@ val catalogOres = listOf(18, 19, 20, 21, 22, 90, 91, 92, 23, 24, 25, 93, 94, 95, val catalogOcean = listOf(61, 62, 63, 64, 65, 66, 67, 68, 69) val catalogItems = listOf(128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138,     146, 147, 148, 149, 150, 151, 152, 153,-    154, 155, 156, 157, 158, 159, 160, 161, 162, 187, 189, 190, 191,+    154, 155, 156, 157, 158, 159, 187, 189, 190, 191,     192, 193, 194, 195, 196)+val catalogBlessings = listOf(160, 161, 162, 203, 204, 205, 206, 207, 208, 209, 210, 211,+    212, 213, 214, 215, 216, 217, 218, 219, 220, 221) val catalogGear = listOf(163, 164, 165, 166, 167, 168, 169, 170,     171, 172, 173, 174, 175, 176, 177, 178, 186, 188,     197, 198, 199, 200, 201, 202)
games/voxels/src/main/java/com/vayunmathur/games/voxels/ui/InventoryScreen.kt
diff --git a/games/voxels/src/main/java/com/vayunmathur/games/voxels/ui/InventoryScreen.kt b/games/voxels/src/main/java/com/vayunmathur/games/voxels/ui/InventoryScreen.ktindex 66ff2123a0..6408fe6a16 100644--- a/games/voxels/src/main/java/com/vayunmathur/games/voxels/ui/InventoryScreen.kt+++ b/games/voxels/src/main/java/com/vayunmathur/games/voxels/ui/InventoryScreen.kt@@ -36,12 +36,15 @@ import kotlin.math.roundToInt private data class DragState(val from: Int, val pos: Offset, val id: Int, val count: Int)  @Composable-fun InventoryOverlay(inventoryJson: String, recipesJson: String, onClose: () -> Unit, startTab: Int = 0) {+fun InventoryOverlay(+    inventoryJson: String, recipesJson: String, blessingsJson: String, blessingCatalogJson: String,+    onClose: () -> Unit, startTab: Int = 0,+) {     val inv = remember(inventoryJson) {         try { Json { ignoreUnknownKeys = true }.decodeFromString<InventoryState>(inventoryJson) } catch (_: Exception) { InventoryState() }     }     val slots = inv.slots-    var leftTab by remember { mutableStateOf(startTab) }   // 0 Inventory, 1 Outfit, 2 Crafting+    var leftTab by remember { mutableStateOf(startTab) }   // 0 Inventory, 1 Outfit, 2 Crafting, 3 Blessings     var catTab by remember { mutableStateOf(0) }     val bounds = remember { mutableStateMapOf<Int, Rect>() }     var drag by remember { mutableStateOf<DragState?>(null) }@@ -61,6 +64,7 @@ fun InventoryOverlay(inventoryJson: String, recipesJson: String, onClose: () ->             // Left tabs (top→bottom: Crafting, Outfit, Inventory).             Column(verticalArrangement = Arrangement.spacedBy(8.dp)) {                 TabButton(stringResource(R.string.crafting), leftTab == 2) { leftTab = 2 }+                TabButton(stringResource(R.string.blessings), leftTab == 3) { leftTab = 3 }                 TabButton(stringResource(R.string.outfit), leftTab == 1) { leftTab = 1 }                 TabButton(stringResource(R.string.inventory), leftTab == 0) { leftTab = 0 }                 Spacer(Modifier.weight(1f))@@ -82,6 +86,7 @@ fun InventoryOverlay(inventoryJson: String, recipesJson: String, onClose: () ->                             drag = null                         }, onDragCancel = { drag = null })                     1 -> OutfitView(inv.armor)+                    3 -> BlessingsView(blessingsJson, blessingCatalogJson, slots)                     else -> CraftingTable(recipesJson)                 }             }@@ -94,11 +99,12 @@ fun InventoryOverlay(inventoryJson: String, recipesJson: String, onClose: () ->                     TabButton("Ocean", catTab == 3) { catTab = 3 }                     TabButton("Items", catTab == 4) { catTab = 4 }                     TabButton("Gear", catTab == 6) { catTab = 6 }+                    TabButton(stringResource(R.string.blessings), catTab == 5) { catTab = 5 }                     TabButton("Music", catTab == 7) { catTab = 7 }                     TabButton("Build", catTab == 2) { catTab = 2 }                 }                 Spacer(Modifier.height(8.dp))-                val cat = when (catTab) { 0 -> catalogNatural; 1 -> catalogOres; 3 -> catalogOcean; 4 -> catalogItems; 6 -> catalogGear; 7 -> catalogMusic; else -> catalogBuilding }+                val cat = when (catTab) { 0 -> catalogNatural; 1 -> catalogOres; 3 -> catalogOcean; 4 -> catalogItems; 5 -> catalogBlessings; 6 -> catalogGear; 7 -> catalogMusic; else -> catalogBuilding }                 CatalogGrid(cat) { id -> try { VoxelsNative.giveBlock(id) } catch (_: Exception) {} }             }         }@@ -274,6 +280,89 @@ private fun CraftingTable(recipesJson: String) {  private data class Recipe(val inId: Int, val inN: Int, val in2Id: Int, val in2N: Int, val outId: Int, val outN: Int) +private data class BlessingInfo(val id: Int, val name: String, val effect: String)++private fun parseBlessings(json: String, key: String?): List<BlessingInfo> = try {+    val arr = if (key != null) org.json.JSONObject(json).getJSONArray(key) else org.json.JSONArray(json)+    (0 until arr.length()).map { i ->+        val o = arr.getJSONObject(i)+        BlessingInfo(o.getInt("id"), o.optString("name"), o.optString("effect"))+    }+} catch (_: Exception) { emptyList() }++/**+ * Blessings are permanent attunements rather than consumables: bind a charm from the inventory to+ * one of the slots, or release a slot to get the charm back.+ */+@Composable+private fun BlessingsView(blessingsJson: String, catalogJson: String, slots: List<InvSlot>) {+    val attuned = remember(blessingsJson) { parseBlessings(blessingsJson, "slots") }+    val catalog = remember(catalogJson) { parseBlessings(catalogJson, null) }+    // Charms sitting in the inventory that aren't bound yet.+    val held = remember(slots, attuned) {+        val boundIds = attuned.map { it.id }.toSet()+        slots.withIndex()+            .filter { (_, s) -> s.id != 0 && catalog.any { it.id == s.id } && s.id !in boundIds }+            .map { (i, s) -> i to s.id }+    }++    Row(Modifier.fillMaxSize(), horizontalArrangement = Arrangement.spacedBy(16.dp)) {+        Column(Modifier.width(260.dp), verticalArrangement = Arrangement.spacedBy(8.dp)) {+            Text(stringResource(R.string.attuned), color = Color.White.copy(0.6f), fontSize = 12.sp)+            attuned.forEachIndexed { i, b ->+                Row(+                    Modifier.fillMaxWidth().clip(RoundedCornerShape(8.dp))+                        .background(if (b.id != 0) Color(0xFF3A5A6B) else Color.White.copy(0.06f))+                        .clickable(enabled = b.id != 0) {+                            try { VoxelsNative.releaseBlessing(i) } catch (_: Exception) {}+                        }+                        .padding(8.dp),+                    verticalAlignment = Alignment.CenterVertically,+                    horizontalArrangement = Arrangement.spacedBy(8.dp)+                ) {+                    val icon = if (b.id != 0) rememberBlockIcon(b.id) else null+                    Box(Modifier.size(34.dp), contentAlignment = Alignment.Center) {+                        if (icon != null) Image(bitmap = icon, contentDescription = null, modifier = Modifier.size(30.dp), filterQuality = FilterQuality.None)+                    }+                    Column {+                        Text(+                            if (b.id != 0) b.name else stringResource(R.string.empty_slot),+                            color = Color.White.copy(if (b.id != 0) 0.95f else 0.45f), fontSize = 12.sp+                        )+                        if (b.id != 0) Text(b.effect, color = Color.White.copy(0.6f), fontSize = 10.sp)+                    }+                }+            }+            Text(stringResource(R.string.blessing_tap_hint), color = Color.White.copy(0.5f), fontSize = 10.sp)+        }++        Column(Modifier.weight(1f).fillMaxHeight().verticalScroll(rememberScrollState()), verticalArrangement = Arrangement.spacedBy(4.dp)) {+            Text(stringResource(R.string.charms_held), color = Color.White.copy(0.6f), fontSize = 12.sp)+            if (held.isEmpty()) {+                Text(stringResource(R.string.no_charms), color = Color.White.copy(0.45f), fontSize = 11.sp)+            }+            held.forEach { (invIdx, id) ->+                val info = catalog.firstOrNull { it.id == id } ?: return@forEach+                Row(+                    Modifier.fillMaxWidth().clip(RoundedCornerShape(6.dp))+                        .background(Color.White.copy(0.08f))+                        .clickable { try { VoxelsNative.attuneBlessing(invIdx) } catch (_: Exception) {} }+                        .padding(6.dp),+                    verticalAlignment = Alignment.CenterVertically,+                    horizontalArrangement = Arrangement.spacedBy(8.dp)+                ) {+                    val icon = rememberBlockIcon(id)+                    if (icon != null) Image(bitmap = icon, contentDescription = null, modifier = Modifier.size(26.dp), filterQuality = FilterQuality.None)+                    Column {+                        Text(info.name, color = Color.White.copy(0.95f), fontSize = 12.sp)+                        Text(info.effect, color = Color.White.copy(0.6f), fontSize = 10.sp)+                    }+                }+            }+        }+    }+}+ @Composable private fun OutfitView(armor: List<InvSlot>) {     val labels = listOf("Helmet", "Chestplate", "Leggings", "Boots")
games/voxels/src/main/java/com/vayunmathur/games/voxels/util/VoxelsNative.kt
diff --git a/games/voxels/src/main/java/com/vayunmathur/games/voxels/util/VoxelsNative.kt b/games/voxels/src/main/java/com/vayunmathur/games/voxels/util/VoxelsNative.ktindex a1a8d09dca..a739c78255 100644--- a/games/voxels/src/main/java/com/vayunmathur/games/voxels/util/VoxelsNative.kt+++ b/games/voxels/src/main/java/com/vayunmathur/games/voxels/util/VoxelsNative.kt@@ -48,4 +48,9 @@ object VoxelsNative {     external fun containerTake(idx: Int): Boolean     external fun containerPut(idx: Int): Boolean     external fun closeContainer()+    // Blessings: permanent attunements bound from charms in the inventory.+    external fun getBlessingsJson(): String+    external fun getBlessingCatalogJson(): String+    external fun attuneBlessing(idx: Int): Boolean+    external fun releaseBlessing(slot: Int): Boolean }
games/voxels/src/main/res/values/strings.xml
diff --git a/games/voxels/src/main/res/values/strings.xml b/games/voxels/src/main/res/values/strings.xmlindex a24b507677..f1ea16dd7a 100644--- a/games/voxels/src/main/res/values/strings.xml+++ b/games/voxels/src/main/res/values/strings.xml@@ -39,4 +39,10 @@     <string name="furnace_busy">Already smelting something else — stop it first.</string>     <string name="busy">Busy</string>     <string name="chest_tap_hint">Tap a chest slot to take it, an inventory slot to store it.</string>+    <string name="blessings">Blessings</string>+    <string name="attuned">Attuned</string>+    <string name="empty_slot">Empty slot</string>+    <string name="charms_held">Charms you carry</string>+    <string name="no_charms">Craft a blessing charm from quicksilver to attune it.</string>+    <string name="blessing_tap_hint">Tap a charm to attune it, an attuned slot to release it.</string> </resources>
games/voxels/src/main/rust/src/blessing.rs
diff --git a/games/voxels/src/main/rust/src/blessing.rs b/games/voxels/src/main/rust/src/blessing.rsnew file mode 100644index 0000000000..4f4a551859--- /dev/null+++ b/games/voxels/src/main/rust/src/blessing.rs@@ -0,0 +1,178 @@+// The Blessing pantheon, Matcha's signature system.+//+// In Matcha a blessing is a crafted enchanted book that permanently upgrades gear. This game has no+// enchanting, so a blessing is instead *attuned* to the player: consuming the charm binds it to one+// of a few permanent slots and grants a passive for the rest of the run. Attunements persist across+// sessions and can be unbound at any time, which returns the charm.++use serde::{Deserialize, Serialize};++/// How many blessings can be attuned at once.+pub const SLOTS: usize = 3;++#[derive(Clone, Copy, PartialEq, Eq, Debug, Serialize, Deserialize)]+pub enum Passive {+    Traversal,     // Clement — faster on foot, steps a full block+    Might,         // Ares — heavier melee+    Deep,          // Yamm — swim, and move freely underwater+    ToolWard,      // Daedalus — tools never wear down+    FeatherFall,   // Icarus — no fall damage+    Pyre,          // Yama — immune to fire and lava+    Impact,        // Talos — attacks send mobs flying+    SmiteUndead,   // God King — double damage to the undead+    BaneOfHorrors, // Arachnae — double damage to creepers, shulkers and ghasts+    ArmorWard,     // Prometheus — armor never wears down+    Mending,       // Lu Ban — held gear slowly repairs itself+    Fortune,       // Eros — ore blocks yield twice+    Reach,         // Will — longer reach+    DoubleJump,    // Hyacinthus — a second jump in mid-air+    WindBurst,     // Aeolus — landing a hit launches you skyward+    SwiftSneak,    // Cronus — sneak at walking speed+    FrostWalker,   // Demeter — water freezes underfoot+    SeaLuck,       // Glaucus — richer chests and mob drops+    Marksman,      // Apollo — thrown weapons hit twice as hard+    Multishot,     // Artemis — throw three at once+    Thorns,        // Warding — attackers take a share of the damage back+    Infinity,      // Paris — thrown items are never used up+}++pub struct Blessing {+    pub id: u8,+    pub passive: Passive,+    /// Icon file in assets/block/, and the name shown in the UI.+    pub icon: &'static str,+    pub name: &'static str,+    pub effect: &'static str,+}++const fn b(id: u8, passive: Passive, icon: &'static str, name: &'static str, effect: &'static str) -> Blessing {+    Blessing { id, passive, icon, name, effect }+}++// Ids 160..162 predate the pantheon but are folded into it; every icon is Matcha's own artwork.+pub const PANTHEON: [Blessing; 22] = [+    b(160, Passive::Traversal,     "blessing_clement.png",     "Blessing of Clement",      "Swift of foot; climbs a full block"),+    b(161, Passive::Might,         "blessing_ares.png",        "Blessing of Ares",         "Melee strikes hit far harder"),+    b(162, Passive::Deep,          "blessing_yamm.png",        "Blessing of Yamm",         "Swim freely beneath the waves"),+    b(203, Passive::ToolWard,      "blessing_daedalus.png",    "Blessing of Daedalus",     "Tools never wear down"),+    b(204, Passive::FeatherFall,   "blessing_icarus.png",      "Blessing of Icarus",       "You take no falling damage"),+    b(205, Passive::Pyre,          "blessing_yama.png",        "Blessing of Yama",         "Fire and lava cannot burn you"),+    b(206, Passive::Impact,        "blessing_talos.png",       "Blessing of Talos",        "Your blows send foes flying"),+    b(207, Passive::SmiteUndead,   "blessing_god_king.png",    "Blessing of the God King", "Double damage to the undead"),+    b(208, Passive::BaneOfHorrors, "blessing_arachnae.png",    "Blessing of Arachnae",     "Double damage to creepers and horrors"),+    b(209, Passive::ArmorWard,     "blessing_prometheus.png",  "Blessing of Prometheus",   "Armor never wears down"),+    b(210, Passive::Mending,       "blessing_lu_ban.png",      "Blessing of Lu Ban",       "Your gear slowly mends itself"),+    b(211, Passive::Fortune,       "blessing_eros.png",        "Blessing of Eros",         "Ores yield twice as much"),+    b(212, Passive::Reach,         "blessing_will.png",        "Blessing of Will",         "You can reach much further"),+    b(213, Passive::DoubleJump,    "blessing_hyacinthus.png",  "Blessing of Hyacinthus",   "Leap a second time in mid-air"),+    b(214, Passive::WindBurst,     "blessing_aeolus.png",      "Blessing of Aeolus",       "Landing a hit throws you skyward"),+    b(215, Passive::SwiftSneak,    "blessing_cronus.png",      "Blessing of Cronus",       "Sneak at a walking pace"),+    b(216, Passive::FrostWalker,   "blessing_demeter.png",     "Blessing of Demeter",      "Water freezes beneath your feet"),+    b(217, Passive::SeaLuck,       "blessing_glaucus.png",     "Blessing of Glaucus",      "Chests and foes give up more"),+    b(218, Passive::Marksman,      "blessing_apollo.png",      "Blessing of Apollo",       "Thrown weapons strike twice as hard"),+    b(219, Passive::Multishot,     "blessing_artemis.png",     "Blessing of Artemis",      "Throw three projectiles at once"),+    b(220, Passive::Thorns,        "blessing_warding.png",     "Blessing of Warding",      "Attackers suffer for striking you"),+    b(221, Passive::Infinity,      "blessing_paris.png",       "Blessing of Paris",        "Thrown items are never used up"),+];++pub fn is_blessing(id: u8) -> bool { PANTHEON.iter().any(|b| b.id == id) }+pub fn find(id: u8) -> Option<&'static Blessing> { PANTHEON.iter().find(|b| b.id == id) }++/// The blessings currently bound to the player. Empty slots hold 0.+#[derive(Clone, Copy, Debug, Default, Serialize, Deserialize)]+pub struct Attunement {+    pub slots: [u8; SLOTS],+}++impl Attunement {+    pub fn has(&self, passive: Passive) -> bool {+        self.slots.iter().any(|&id| find(id).is_some_and(|b| b.passive == passive))+    }+    pub fn contains(&self, id: u8) -> bool { self.slots.contains(&id) }+    /// Bind a charm to the first free slot. Fails if it's already bound or there's no room.+    pub fn attune(&mut self, id: u8) -> bool {+        if !is_blessing(id) || self.contains(id) { return false; }+        match self.slots.iter_mut().find(|s| **s == 0) {+            Some(slot) => { *slot = id; true }+            None => false,+        }+    }+    /// Unbind the charm in `slot`, returning it so the caller can hand it back to the player.+    pub fn release(&mut self, slot: usize) -> Option<u8> {+        let id = *self.slots.get(slot)?;+        if id == 0 { return None; }+        self.slots[slot] = 0;+        Some(id)+    }+    pub fn to_json(&self) -> String {+        let list: Vec<_> = self.slots.iter().map(|&id| {+            match find(id) {+                Some(b) => serde_json::json!({"id": b.id, "name": b.name, "effect": b.effect}),+                None => serde_json::json!({"id": 0, "name": "", "effect": ""}),+            }+        }).collect();+        serde_json::json!({ "slots": list }).to_string()+    }+}++/// Catalog for the UI: every blessing and what it does.+pub fn catalog_json() -> String {+    let list: Vec<_> = PANTHEON.iter()+        .map(|b| serde_json::json!({"id": b.id, "name": b.name, "effect": b.effect}))+        .collect();+    serde_json::json!(list).to_string()+}++#[cfg(test)]+mod tests {+    use super::*;++    #[test]+    fn the_pantheon_is_consistent() {+        for b in PANTHEON.iter() {+            assert!(b.id >= crate::item::ITEM_BASE, "{} must be an item id", b.name);+            assert!(!b.name.is_empty() && !b.effect.is_empty());+            assert!(b.icon.ends_with(".png"));+        }+        // Ids, passives and icons must all be unique or two blessings would collide.+        for (i, a) in PANTHEON.iter().enumerate() {+            for other in PANTHEON.iter().skip(i + 1) {+                assert_ne!(a.id, other.id, "duplicate id {}", a.id);+                assert_ne!(a.passive, other.passive, "duplicate passive on {}", a.name);+                assert_ne!(a.icon, other.icon, "duplicate icon on {}", a.name);+            }+        }+    }++    #[test]+    fn attuning_fills_slots_and_rejects_duplicates() {+        let mut a = Attunement::default();+        assert!(a.attune(160));+        assert!(!a.attune(160), "the same blessing must not stack");+        assert!(a.attune(204));+        assert!(a.attune(211));+        assert!(!a.attune(212), "there are only {SLOTS} slots");+        assert!(a.has(Passive::Traversal));+        assert!(a.has(Passive::Fortune));+        assert!(!a.has(Passive::Reach));+    }++    #[test]+    fn releasing_returns_the_charm() {+        let mut a = Attunement::default();+        a.attune(205);+        assert!(a.has(Passive::Pyre));+        assert_eq!(a.release(0), Some(205));+        assert!(!a.has(Passive::Pyre));+        assert_eq!(a.release(0), None, "an empty slot gives nothing back");+        assert!(a.attune(212), "the slot is free again");+    }++    #[test]+    fn non_blessings_cannot_be_attuned() {+        let mut a = Attunement::default();+        assert!(!a.attune(0));+        assert!(!a.attune(155)); // a diamond+        assert!(!a.attune(169)); // a pickaxe+    }+}
games/voxels/src/main/rust/src/container.rs
diff --git a/games/voxels/src/main/rust/src/container.rs b/games/voxels/src/main/rust/src/container.rsindex 8416503ed2..20d7ffaefd 100644--- a/games/voxels/src/main/rust/src/container.rs+++ b/games/voxels/src/main/rust/src/container.rs@@ -99,7 +99,7 @@ fn container_file(base: &str) -> PathBuf {  // Deterministic loot for a world-generated chest, from its position. The End's chests hold the // endgame reward pool; everywhere else draws from the general pool.-pub fn roll_loot(x: i32, y: i32, z: i32, dim: u8) -> Vec<InvSlot> {+pub fn roll_loot(x: i32, y: i32, z: i32, dim: u8, lucky: bool) -> Vec<InvSlot> {     let mut r = ((x as u64).wrapping_mul(73856093) ^ (y as u64).wrapping_mul(19349663) ^ (z as u64).wrapping_mul(83492791)) | 1;     let next = |r: &mut u64| { *r ^= *r << 13; *r ^= *r >> 7; *r ^= *r << 17; *r };     // (item id, max stack from this chest).@@ -109,7 +109,8 @@ pub fn roll_loot(x: i32, y: i32, z: i32, dim: u8) -> Vec<InvSlot> {     let pool: &[(u8, i32)] = match dim { 2 => &end_pool, 1 => &nether_pool, _ => &over_pool };      let mut slots = vec![InvSlot::default(); CONTAINER_SLOTS];-    let n = 3 + (next(&mut r) % 4) as usize; // 3..6 stacks+    // Glaucus turns up more in every chest.+    let n = 3 + (next(&mut r) % 4) as usize + if lucky { 3 } else { 0 }; // 3..6 stacks, 6..9 when lucky     for _ in 0..n {         let (id, maxc) = pool[(next(&mut r) as usize) % pool.len()];         let count = if crate::item::has_durability(id) {@@ -137,7 +138,7 @@ mod tests {     fn generated_chests_have_loot_and_player_chests_do_not() {         let mut c = Containers::default();         let key = (0u8, 12, 40, -7);-        c.insert(key, roll_loot(12, 40, -7, 0));+        c.insert(key, roll_loot(12, 40, -7, 0, false));         let filled = c.get(key).unwrap().iter().filter(|s| s.id != 0).count();         assert!((3..=6).contains(&filled), "expected 3..6 loot stacks, got {filled}"); @@ -152,7 +153,7 @@ mod tests {     fn a_placed_chest_never_inherits_a_stale_entry() {         let mut c = Containers::default();         let key = (0u8, 4, 61, 4);-        c.insert(key, roll_loot(4, 61, 4, 0));+        c.insert(key, roll_loot(4, 61, 4, 0, false));         assert!(c.get(key).unwrap().iter().any(|s| s.id != 0));          c.insert_empty(key);@@ -161,9 +162,9 @@ mod tests {      #[test]     fn loot_is_deterministic_per_position() {-        let a = roll_loot(5, 30, 9, 0);-        let b = roll_loot(5, 30, 9, 0);-        let other = roll_loot(6, 30, 9, 0);+        let a = roll_loot(5, 30, 9, 0, false);+        let b = roll_loot(5, 30, 9, 0, false);+        let other = roll_loot(6, 30, 9, 0, false);         assert_eq!(a.iter().map(|s| (s.id, s.count)).collect::<Vec<_>>(),                    b.iter().map(|s| (s.id, s.count)).collect::<Vec<_>>());         assert_ne!(a.iter().map(|s| s.id).collect::<Vec<_>>(),
games/voxels/src/main/rust/src/engine.rs
diff --git a/games/voxels/src/main/rust/src/engine.rs b/games/voxels/src/main/rust/src/engine.rsindex c860efd143..91a51d7d78 100644--- a/games/voxels/src/main/rust/src/engine.rs+++ b/games/voxels/src/main/rust/src/engine.rs@@ -2,6 +2,7 @@ use crate::world::{ChunkMap, block::Block}; use crate::player::Player; use crate::inventory::Inventory; use crate::entity::{Mob, MobKind, Particle, Projectile, ProjKind, build_entity_mesh, tick_particles, append_particles, append_projectiles};+use crate::blessing::Passive; use crate::world::mesher; use crate::vulkan::context::{VulkanContext, ANativeWindow}; use crate::vulkan::renderer::VulkanRenderer;@@ -51,6 +52,8 @@ pub struct EngineState {     // Milestone tracking for achievements.     pub best_beacon: i32,     pub deepest_y: i32,+    // Throttle for the Lu Ban mending blessing.+    pub mend_cd: f32, }  // One furnace job at a time, owned by the world rather than by a specific furnace block: the player@@ -117,6 +120,7 @@ pub fn init_engine(files_dir: String, seed: u32) -> bool {     if had_save {         player.max_health = progress.max_health.clamp(crate::player::MIN_MAX_HEALTH, crate::player::CAP_MAX_HEALTH);         player.health = player.max_health;+        player.blessings = progress.blessings;     }      let dim = if progress.dim < 3 { progress.dim } else { 0 };@@ -179,6 +183,7 @@ pub fn init_engine(files_dir: String, seed: u32) -> bool {         smelter: Smelter::default(),         best_beacon: progress.best_beacon,         deepest_y: if had_save { progress.deepest_y } else { py as i32 },+        mend_cd: 0.0,     });     INIT_DONE.store(true, Ordering::SeqCst);     true@@ -233,6 +238,7 @@ pub fn destroy_engine() {                 world_secs: state.start_time.elapsed().as_secs_f32(),                 best_beacon: state.best_beacon,                 deepest_y: state.deepest_y,+                blessings: state.player.blessings,             },         };         let _ = crate::world::save::save_player(&state.save_dir, &ps);@@ -349,6 +355,7 @@ pub fn tick_and_render() {         state.was_night = night_now;          tick_smelter(state, dt);+        tick_blessings(state, dt);         // Overworld-only depth record, so the Nether's low ceiling doesn't hand out the mining badge.         if state.dim == 0 { state.deepest_y = state.deepest_y.min(state.player.pos.y as i32); } @@ -361,7 +368,8 @@ pub fn tick_and_render() {             let p = state.player.pos;             let feet = state.chunks.get_block_world(p.x.floor() as i32, p.y.floor() as i32, p.z.floor() as i32);             let head = state.chunks.get_block_world(p.x.floor() as i32, (p.y + 1.0).floor() as i32, p.z.floor() as i32);-            if (feet == 84 || head == 84) && !state.player.has_effect(crate::item::Effect::FireResistance) {+            if (feet == 84 || head == 84) && !state.player.has_effect(crate::item::Effect::FireResistance)+                && !state.player.blessed(Passive::Pyre) {                 state.player.health -= 6.0 * dt;                 if state.player.health <= 0.0 { state.player.health = 0.0; state.player.dead = true; }             }@@ -496,10 +504,11 @@ pub fn tick_and_render() {             state.nether_wither_dead = true;             spawn_particles(&mut state.spawn_rng, &mut state.particles, wpos, 60, [0.15, 0.15, 0.2], 8.0, 1.4, 0.4);         }-        // Remove dead mobs and auto-collect their drops.+        // Remove dead mobs and auto-collect their drops. Glaucus makes every kill pay double.         let mut loot: Vec<u8> = Vec::new();         state.mobs.retain(|m| if m.health <= 0.0 { loot.extend_from_slice(m.kind.loot()); false } else { true });-        for id in loot { state.inventory.add_block(id); }+        let drops = if state.player.blessed(Passive::SeaLuck) { 2 } else { 1 };+        for id in loot { for _ in 0..drops { state.inventory.add_block(id); } }         state.mobs.retain(|m| (m.pos - player_pos).length() < 96.0 && m.pos.y > -8.0);         state.spawn_timer -= dt;         if state.spawn_timer <= 0.0 {@@ -664,6 +673,7 @@ fn publish_ui(state: &EngineState) {         "silver": has(193), "steel": has(195), "adamant": has(196),         "blessing": has(160) || has(161) || has(162),         "depth": state.deepest_y,+        "attuned": state.player.blessings.slots.iter().filter(|&&s| s != 0).count(),     }).to_string();     let inv = state.inventory.to_json();     let effects: Vec<_> = state.player.effects.iter().map(|e| serde_json::json!({"k": e.kind.key(), "amp": e.amp, "t": e.secs.ceil() as i32})).collect();@@ -868,19 +878,31 @@ fn light_portal(state: &mut EngineState, x: i32, y: i32, z: i32) -> bool { fn ensure_chest(state: &mut EngineState, x: i32, y: i32, z: i32) -> crate::container::ContainerKey {     let key = (state.dim, x, y, z);     if !state.containers.contains(key) {-        state.containers.insert(key, crate::container::roll_loot(x, y, z, state.dim));+        let lucky = state.player.blessed(Passive::SeaLuck);+        state.containers.insert(key, crate::container::roll_loot(x, y, z, state.dim, lucky));     }     key }  // Apply damage to the player through equipped armor (each defense point cuts ~4%, capped), wearing-// the armor down when a hit actually lands.+// the armor down when a hit actually lands. Warding reflects a share back at whatever is nearby. fn hurt_player(state: &mut EngineState, amt: f32) {     let def = state.inventory.armor_defense();     let reduced = amt * (1.0 - (def * 0.04)).max(0.2);     let before = state.player.health;     state.player.damage(reduced);-    if state.player.health < before { state.inventory.damage_armor(); }+    if state.player.health < before {+        if !state.player.blessed(Passive::ArmorWard) { state.inventory.damage_armor(); }+        if state.player.blessed(Passive::Thorns) { reflect_thorns(state, reduced * 0.5); }+    }+}++// Warding: everything close enough to have hurt you shares in the pain.+fn reflect_thorns(state: &mut EngineState, amt: f32) {+    let p = state.player.pos;+    for m in state.mobs.iter_mut() {+        if (m.pos - p).length() < 4.0 { m.health -= amt; }+    } }  // Advance projectiles: move, home (shulker bullets), trail sparks, and resolve block/mob/player hits.@@ -911,11 +933,13 @@ fn tick_projectiles(state: &mut EngineState, dt: f32) {         let mut hit = p.life <= 0.0 || solid;         // Player-thrown projectiles hit mobs.         if !hit && p.from_player {+            // Apollo doubles what a thrown weapon does on impact.+            let marksman = if state.player.blessed(Passive::Marksman) { 2.0 } else { 1.0 };             for m in state.mobs.iter_mut() {                 let center = m.pos + vec3(0.0, m.kind.height() * 0.5, 0.0);                 if (center - p.pos).length() < m.kind.hit_radius() + 0.4 {                     let dmg = match p.kind { ProjKind::Fireball => 6.0, ProjKind::Snowball => 1.0, _ => 0.0 };-                    if dmg > 0.0 { m.health -= dmg; }+                    if dmg > 0.0 { m.health -= dmg * marksman; }                     hit = true; break;                 }             }@@ -1020,11 +1044,24 @@ fn do_break(state: &mut EngineState, origin: Vec3, dir: Vec3) -> bool {     }     // Throwables: snowball (light damage/knock) and ender pearl (teleport to impact).     if (sel == 190 || sel == 191) && state.player.eat_cd <= 0.0 {-        if state.inventory.consume_selected().is_some() {+        // Paris never spends the charge; everyone else does.+        let free = state.player.blessed(Passive::Infinity);+        if free || state.inventory.consume_selected().is_some() {             let f = state.player.forward();             let origin = state.player.eye_pos() + f * 0.5;             let (kind, spd) = if sel == 191 { (ProjKind::EnderPearl, 16.0) } else { (ProjKind::Snowball, 20.0) };-            state.projectiles.push(Projectile { pos: origin, vel: f * spd, life: 5.0, kind, from_player: true, damage: 0.0, explosive: false });+            // Artemis throws a spread of three; an ender pearl always flies alone so the+            // teleport destination stays predictable.+            let spread: &[f32] = if state.player.blessed(Passive::Multishot) && kind == ProjKind::Snowball {+                &[-0.12, 0.0, 0.12]+            } else {+                &[0.0]+            };+            let right = state.player.right();+            for &off in spread {+                let dir = (f + right * off).normalize_or_zero();+                state.projectiles.push(Projectile { pos: origin, vel: dir * spd, life: 5.0, kind, from_player: true, damage: 0.0, explosive: false });+            }             state.player.eat_cd = 0.4;             return true;         }@@ -1074,22 +1111,27 @@ fn do_break(state: &mut EngineState, origin: Vec3, dir: Vec3) -> bool {         }     }     // Attack a mob if one is under the cursor within reach and nearer than any block.-    let block_hit = crate::raycast::raycast(&state.chunks, origin, dir, 6.0);+    let reach = player_reach(state);+    let block_hit = crate::raycast::raycast(&state.chunks, origin, dir, reach);     let block_dist = block_hit.as_ref().map(|h| (vec3(h.pos.0 as f32 + 0.5, h.pos.1 as f32 + 0.5, h.pos.2 as f32 + 0.5) - origin).length()).unwrap_or(f32::INFINITY);     if state.player.attack_cd <= 0.0 {-        if let Some(idx) = nearest_mob_hit(state, origin, dir, 4.5, block_dist) {+        if let Some(idx) = nearest_mob_hit(state, origin, dir, reach - 1.5, block_dist) {             state.player.attack_cd = 0.45;-            let dmg = 4.0 + item::sword_damage(sel) + item::pick_damage(sel) + state.player.strength_bonus();-            state.inventory.damage_selected();+            let base = 4.0 + item::sword_damage(sel) + item::pick_damage(sel) + state.player.strength_bonus();+            let dmg = base * state.player.might_mult() * slayer_mult(&state.player, state.mobs[idx].kind);+            damage_tool(state);             let ppos = state.player.pos;+            // Talos turns every swing into a launch.+            let (kb_h, kb_v) = if state.player.blessed(Passive::Impact) { (2.4, 12.0) } else { (0.45, 6.0) };             let mpos;             {                 let m = &mut state.mobs[idx];                 m.health -= dmg;                 let kb = { let k = m.pos - ppos; vec3(k.x, 0.0, k.z).normalize_or_zero() };-                m.pos += kb * 0.45; m.vel.y = 6.0;+                m.pos += kb * kb_h; m.vel.y = kb_v;                 mpos = m.pos + vec3(0.0, 0.5, 0.0);             }+            state.player.wind_burst();             spawn_particles(&mut state.spawn_rng, &mut state.particles, mpos, 6, [0.85, 0.12, 0.12], 3.0, 0.4, 0.09);             return true;         }@@ -1121,8 +1163,13 @@ fn do_break(state: &mut EngineState, origin: Vec3, dir: Vec3) -> bool {             // Stone/ore only drops when mined with a pickaxe; soft blocks always drop.             let drops = !Block::from_id(id).needs_pickaxe() || item::is_pickaxe(sel);             state.chunks.set_block_world(x, y, z, 0);-            if drops { state.inventory.add_block(id); state.inventory.broken += 1; }-            state.inventory.damage_selected();+            if drops {+                // Eros doubles what an ore gives up.+                let n = if state.player.blessed(Passive::Fortune) && is_ore(id) { 2 } else { 1 };+                for _ in 0..n { state.inventory.add_block(id); }+                state.inventory.broken += 1;+            }+            damage_tool(state);             mark_neighbors_dirty(state, x, z);             let c = vec3(x as f32 + 0.5, y as f32 + 0.5, z as f32 + 0.5);             spawn_particles(&mut state.spawn_rng, &mut state.particles, c, 7, [0.55, 0.45, 0.35], 2.6, 0.5, 0.11);@@ -1227,6 +1274,81 @@ pub fn container_put(inv_idx: usize) -> bool { } pub fn close_container() { with_engine(|s| s.open_chest = None); } +// ---- Blessings ----+// Bind the blessing held in an inventory slot, consuming the charm. Fails if the slot doesn't hold+// a blessing, it's already bound, or every attunement slot is taken.+pub fn attune_blessing(inv_idx: usize) -> bool {+    with_engine(|state| {+        if inv_idx >= crate::inventory::SLOTS { return false; }+        let id = state.inventory.slots[inv_idx].id;+        if !crate::blessing::is_blessing(id) { return false; }+        if !state.player.blessings.attune(id) { return false; }+        let slot = &mut state.inventory.slots[inv_idx];+        slot.count -= 1;+        if slot.count <= 0 { *slot = crate::inventory::InvSlot::default(); }+        true+    }).unwrap_or(false)+}+// Unbind an attunement, handing the charm back. Refuses if there's nowhere to put it.+pub fn release_blessing(slot: usize) -> bool {+    with_engine(|state| {+        let Some(&id) = state.player.blessings.slots.get(slot) else { return false; };+        if id == 0 { return false; }+        if !state.inventory.has_room_for(id, 1) { return false; }+        state.player.blessings.release(slot);+        state.inventory.add_block(id);+        true+    }).unwrap_or(false)+}+pub fn get_blessings_json() -> String {+    with_engine_try(|state| state.player.blessings.to_json())+        .unwrap_or_else(|| crate::blessing::Attunement::default().to_json())+}+pub fn get_blessing_catalog_json() -> String { crate::blessing::catalog_json() }++// Ore blocks, for the Fortune blessing.+fn is_ore(id: u8) -> bool { matches!(id, 18..=22 | 90 | 91 | 92) }++// Blessings that act over time rather than at a single event: Lu Ban repairs gear a point at a+// time, Demeter freezes the water the player walks over.+fn tick_blessings(state: &mut EngineState, dt: f32) {+    if state.player.blessed(crate::blessing::Passive::Mending) {+        state.mend_cd -= dt;+        if state.mend_cd <= 0.0 {+            state.mend_cd = 1.0;+            state.inventory.mend_one();+        }+    }+    if state.player.blessed(Passive::FrostWalker) {+        let p = state.player.pos;+        let y = (p.y - 0.4).floor() as i32;+        let mut froze = Vec::new();+        for dx in -1..=1 { for dz in -1..=1 {+            let (x, z) = (p.x.floor() as i32 + dx, p.z.floor() as i32 + dz);+            if state.chunks.get_block_world(x, y, z) == 12 {+                state.chunks.set_block_world(x, y, z, 43); // ice+                froze.push((x, z));+            }+        }}+        for (x, z) in froze { mark_neighbors_dirty(state, x, z); }+    }+}++// How far the player can reach; Will stretches it well past arm's length.+fn player_reach(state: &EngineState) -> f32 {+    if state.player.blessed(Passive::Reach) { 9.0 } else { 6.0 }+}+// Damage multiplier against a particular kind of foe, from the slayer blessings.+fn slayer_mult(player: &Player, kind: MobKind) -> f32 {+    let undead = matches!(kind, MobKind::Zombie | MobKind::WitherSkeleton | MobKind::Wither);+    let horror = matches!(kind, MobKind::Creeper | MobKind::Shulker | MobKind::Ghast);+    if (undead && player.blessed(Passive::SmiteUndead)) || (horror && player.blessed(Passive::BaneOfHorrors)) { 2.0 } else { 1.0 }+}+// Wear the held tool, unless Daedalus is holding it together.+fn damage_tool(state: &mut EngineState) {+    if !state.player.blessed(Passive::ToolWard) { state.inventory.damage_selected(); }+}+ // Destroy blocks in a sphere and hurt the player — creeper explosions. fn explode(state: &mut EngineState, center: Vec3, radius: f32) {     let r = radius.ceil() as i32;@@ -1261,7 +1383,7 @@ fn do_place(state: &mut EngineState, origin: Vec3, dir: Vec3) -> bool {     // Items (food, estus, materials) are never placeable as blocks.     let sel = state.inventory.selected_block();     if sel == 0 || crate::item::is_item(sel) { return false; }-    if let Some(hit) = crate::raycast::raycast(&state.chunks, origin, dir, 6.0) {+    if let Some(hit) = crate::raycast::raycast(&state.chunks, origin, dir, player_reach(state)) {         let (px,py,pz) = hit.prev;         if state.chunks.get_block_world(px,py,pz) != 0 { return false; }         let min_check = vec3(state.player.pos.x - 0.3, state.player.pos.y, state.player.pos.z - 0.3);@@ -1295,9 +1417,10 @@ pub fn place_block_at(px: f32, py: f32) -> i32 {         // Tapping a villager opens trade; tapping an interactive block opens its menu — unless         // sneaking, which places instead.         if !state.player.sneaking {-            let block_hit = crate::raycast::raycast(&state.chunks, o, d, 6.0);+            let reach = player_reach(state);+            let block_hit = crate::raycast::raycast(&state.chunks, o, d, reach);             let bdist = block_hit.as_ref().map(|h| (vec3(h.pos.0 as f32 + 0.5, h.pos.1 as f32 + 0.5, h.pos.2 as f32 + 0.5) - o).length()).unwrap_or(f32::INFINITY);-            if let Some(idx) = nearest_mob_hit(state, o, d, 4.5, bdist) {+            if let Some(idx) = nearest_mob_hit(state, o, d, reach - 1.5, bdist) {                 if state.mobs[idx].kind == MobKind::Villager { return 20; }             }             if let Some(hit) = block_hit {
games/voxels/src/main/rust/src/inventory.rs
diff --git a/games/voxels/src/main/rust/src/inventory.rs b/games/voxels/src/main/rust/src/inventory.rsindex 564bc0044a..0e17b3e11b 100644--- a/games/voxels/src/main/rust/src/inventory.rs+++ b/games/voxels/src/main/rust/src/inventory.rs@@ -24,7 +24,7 @@ pub struct Inventory { // (in1_id, in1_count, in2_id, in2_count, out_id, out_count). in2_id == 0 means a single ingredient. // Item ids 154+ are materials/tools (see item.rs). Ore -> material conversions live in SMELTING // instead, since those need a furnace, fuel and time.-pub const RECIPES: [(u8, i32, u8, i32, u8, i32); 43] = [+pub const RECIPES: [(u8, i32, u8, i32, u8, i32); 62] = [     (154, 1, 157, 1, 186, 1), // iron + coal -> flint & steel     (187, 1, Block::Glass as u8, 5, Block::Beacon as u8, 1), // nether star + glass -> beacon     (138, 2, 0, 0, 189, 3), // gunpowder -> firework rockets@@ -63,10 +63,30 @@ pub const RECIPES: [(u8, i32, u8, i32, u8, i32); 43] = [     (196, 9, 0, 0, Block::AdamantBlock as u8, 1),     // A steel-lined furnace: the only place the alloy recipes will smelt.     (Block::Furnace as u8, 1, 195, 5, Block::BlastFurnace as u8, 1),-    // Blessings: quicksilver charms. Previously unobtainable outside the creative catalog.-    (194, 2, 193, 1, 160, 1), // quicksilver + silver -> Blessing of Swiftness-    (194, 2, 154, 4, 161, 1), // quicksilver + iron   -> Blessing of the Warrior-    (194, 2, 156, 2, 162, 1), // quicksilver + emerald-> Blessing of the Deep+    // Blessings: quicksilver charms bound to a thematic offering. Attuning one grants a permanent+    // passive (see blessing.rs), so the ingredient cost tracks roughly how strong the passive is.+    (194, 2, 193, 1, 160, 1),  // silver          -> Clement, swift of foot+    (194, 2, 154, 4, 161, 1),  // iron            -> Ares, might+    (194, 2, 156, 2, 162, 1),  // emerald         -> Yamm, the deep+    (194, 2, 195, 3, 203, 1),  // steel           -> Daedalus, tools never wear+    (194, 2, 189, 4, 204, 1),  // fireworks       -> Icarus, no fall damage+    (194, 2, 192, 6, 205, 1),  // sulfur          -> Yama, immune to fire+    (194, 2, Block::Obsidian as u8, 4, 206, 1),   // Talos, crushing blows+    (194, 2, 187, 1, 207, 1),  // nether star     -> the God King, smite the undead+    (194, 2, 138, 8, 208, 1),  // gunpowder       -> Arachnae, bane of horrors+    (194, 2, 196, 2, 209, 1),  // adamant         -> Prometheus, armor never wears+    (194, 2, 155, 3, 210, 1),  // diamond         -> Lu Ban, mending+    (194, 2, Block::EmeraldBlock as u8, 1, 211, 1), // Eros, fortune+    (194, 2, 191, 3, 212, 1),  // ender pearls    -> Will, reach+    (194, 2, Block::Glowstone as u8, 4, 213, 1),  // Hyacinthus, second jump+    (194, 2, Block::Purpur as u8, 6, 214, 1),     // Aeolus, wind burst+    (194, 2, Block::Sculk as u8, 8, 215, 1),      // Cronus, swift sneak+    (194, 2, Block::BlueIce as u8, 4, 216, 1),    // Demeter, frost walker+    (194, 2, Block::SeaLantern as u8, 4, 217, 1), // Glaucus, sea luck+    (194, 2, Block::Amethyst as u8, 6, 218, 1),   // Apollo, marksman+    (194, 2, 190, 16, 219, 1), // snowballs       -> Artemis, multishot+    (194, 2, Block::WardingStone as u8, 2, 220, 1), // Warding, thorns+    (194, 2, Block::DiamondBlock as u8, 1, 221, 1), // Paris, infinity ];  // Furnace recipes. Unlike crafting these cost fuel and take `secs` of real time, and the ones marked@@ -302,6 +322,13 @@ impl Inventory {     pub fn damage_armor(&mut self) {         for s in self.armor.iter_mut() { if s.id != 0 { s.count -= 1; if s.count <= 0 { *s = InvSlot::default(); } } }     }+    // Lu Ban: restore a single point of durability to the most worn piece of gear carried or worn.+    pub fn mend_one(&mut self) {+        let worst = self.slots.iter_mut().chain(self.armor.iter_mut())+            .filter(|s| s.id != 0 && crate::item::has_durability(s.id) && s.count < crate::item::max_durability(s.id))+            .min_by_key(|s| s.count);+        if let Some(s) = worst { s.count += 1; }+    }      pub fn to_json(&self) -> String { serde_json::to_string(self).unwrap_or_else(|_| r#"{"selected":0,"slots":[]}"#.to_string()) } }@@ -348,8 +375,18 @@ mod tests {         let steel = SMELTING.iter().find(|s| s.out == 195).expect("steel must be smeltable");         let adamant = SMELTING.iter().find(|s| s.out == 196).expect("adamant must be smeltable");         assert!(steel.blast && adamant.blast, "the alloy line must require a blast furnace");-        for blessing in [160u8, 161, 162] {-            assert!(RECIPES.iter().any(|r| r.4 == blessing), "blessing {blessing} has no recipe");+        // Every blessing in the pantheon must be reachable in normal play, not creative-only.+        for b in crate::blessing::PANTHEON.iter() {+            assert!(RECIPES.iter().any(|r| r.4 == b.id), "{} has no recipe", b.name);+        }+    }++    // Blessings are attuned, not eaten. If one ever regains a food entry it would be consumed for a+    // short buff instead of being bound.+    #[test]+    fn blessings_are_not_edible() {+        for b in crate::blessing::PANTHEON.iter() {+            assert!(crate::item::food_effects(b.id).is_none(), "{} must not be food", b.name);         }     } 
games/voxels/src/main/rust/src/item.rs
diff --git a/games/voxels/src/main/rust/src/item.rs b/games/voxels/src/main/rust/src/item.rsindex d894fa7961..b008ae1c4f 100644--- a/games/voxels/src/main/rust/src/item.rs+++ b/games/voxels/src/main/rust/src/item.rs@@ -93,11 +93,6 @@ pub fn food_effects(id: u8) -> Option<&'static [(Effect, f32, u8)]> {         151 => &[(Regeneration, 4.0, 0), (Speed, 20.0, 0)],                // apple empanada         152 => &[(Regeneration, 4.0, 0), (NightVision, 90.0, 0)],          // glow berry crumble         153 => &[(Regeneration, 3.0, 0), (Haste, 60.0, 0)],                // chocolate chip cookie-        // Blessings: charm consumables granting long multi-effect buffs (Matcha's enchant bundles,-        // reimagined for a game without gear).-        160 => &[(Speed, 300.0, 1), (JumpBoost, 300.0, 0)],                // Blessing of Swiftness-        161 => &[(Strength, 300.0, 1), (Resistance, 300.0, 0)],            // Blessing of the Warrior-        162 => &[(NightVision, 300.0, 0), (FireResistance, 300.0, 0)],     // Blessing of the Deep         _ => return None,     }) }
games/voxels/src/main/rust/src/lib.rs
diff --git a/games/voxels/src/main/rust/src/lib.rs b/games/voxels/src/main/rust/src/lib.rsindex 0cb1fe89db..13502f8d35 100644--- a/games/voxels/src/main/rust/src/lib.rs+++ b/games/voxels/src/main/rust/src/lib.rs@@ -1,4 +1,5 @@ pub mod world;+pub mod blessing; pub mod container; pub mod entity; pub mod item;@@ -344,6 +345,36 @@ pub extern "system" fn Java_com_vayunmathur_games_voxels_util_VoxelsNative_close     engine::close_container(); } +#[no_mangle]+pub extern "system" fn Java_com_vayunmathur_games_voxels_util_VoxelsNative_getBlessingsJson<'l>(+    mut env: JNIEnv<'l>, _class: JClass<'l>,+) -> jstring {+    let null = std::ptr::null_mut();+    match env.new_string(engine::get_blessings_json()) { Ok(s) => s.into_raw(), Err(_) => null }+}++#[no_mangle]+pub extern "system" fn Java_com_vayunmathur_games_voxels_util_VoxelsNative_getBlessingCatalogJson<'l>(+    mut env: JNIEnv<'l>, _class: JClass<'l>,+) -> jstring {+    let null = std::ptr::null_mut();+    match env.new_string(engine::get_blessing_catalog_json()) { Ok(s) => s.into_raw(), Err(_) => null }+}++#[no_mangle]+pub extern "system" fn Java_com_vayunmathur_games_voxels_util_VoxelsNative_attuneBlessing<'l>(+    _env: JNIEnv<'l>, _class: JClass<'l>, idx: jint,+) -> jboolean {+    engine::attune_blessing(idx.max(0) as usize) as jboolean+}++#[no_mangle]+pub extern "system" fn Java_com_vayunmathur_games_voxels_util_VoxelsNative_releaseBlessing<'l>(+    _env: JNIEnv<'l>, _class: JClass<'l>, slot: jint,+) -> jboolean {+    engine::release_blessing(slot.max(0) as usize) as jboolean+}+ #[cfg(test)] mod tests {     use crate::world::chunk::{Chunk, ChunkPos};
games/voxels/src/main/rust/src/player.rs
diff --git a/games/voxels/src/main/rust/src/player.rs b/games/voxels/src/main/rust/src/player.rsindex bbb8e16f93..b6627d516d 100644--- a/games/voxels/src/main/rust/src/player.rs+++ b/games/voxels/src/main/rust/src/player.rs@@ -1,6 +1,7 @@ use glam::{Vec3, vec3}; use crate::world::{ChunkMap, block::Block}; use crate::item::{Effect, ActiveEffect};+use crate::blessing::{Attunement, Passive};  pub const MIN_MAX_HEALTH: f32 = 20.0; // 10 hearts floor (deaths never take you below this) pub const CAP_MAX_HEALTH: f32 = 60.0; // 30 hearts cap (heart containers)@@ -17,8 +18,11 @@ pub struct Player {     glide_armed: bool,     // wings deployed: toggled with a mid-air jump tap     prev_jump: bool,       // for edge-detecting jump taps     glide_boost: f32,      // extra glide speed from a firework rocket (decays)+    jumps_left: u8,        // mid-air jumps remaining (Hyacinthus grants a second one)     pub walk_dist: f32,     pub sneaking: bool,+    // Attuned blessings, granting permanent passives.+    pub blessings: Attunement,     // Survival state.     pub health: f32,     pub max_health: f32,@@ -33,20 +37,25 @@ pub struct Player {  impl Player {     pub fn new(x: f32, y: f32, z: f32) -> Self {-        Self { pos: vec3(x,y,z), vel: Vec3::ZERO, yaw: 0.0, pitch: 0.0, on_ground: false, flying: false, elytra: false, gliding: false, glide_armed: false, prev_jump: false, glide_boost: 0.0, walk_dist: 0.0, sneaking: false,+        Self { pos: vec3(x,y,z), vel: Vec3::ZERO, yaw: 0.0, pitch: 0.0, on_ground: false, flying: false, elytra: false, gliding: false, glide_armed: false, prev_jump: false, glide_boost: 0.0, jumps_left: 0, walk_dist: 0.0, sneaking: false, blessings: Attunement::default(),             health: 20.0, max_health: 20.0, absorption: 0.0, effects: Vec::new(), hurt_cd: 0.0, attack_cd: 0.0, eat_cd: 0.0, air_max_y: y, dead: false }     } +    pub fn blessed(&self, p: Passive) -> bool { self.blessings.has(p) }+     fn effect_amp(&self, k: Effect) -> Option<u8> { self.effects.iter().filter(|e| e.kind == k).map(|e| e.amp).max() }     pub fn has_effect(&self, k: Effect) -> bool { self.effect_amp(k).is_some() }     pub fn speed_mult(&self) -> f32 {         let sp = self.effect_amp(Effect::Speed).map(|a| a as f32 + 1.0).unwrap_or(0.0);         let sl = self.effect_amp(Effect::Slowness).map(|a| a as f32 + 1.0).unwrap_or(0.0);-        (1.0 + 0.2 * sp - 0.15 * sl).max(0.25)+        let traversal = if self.blessed(Passive::Traversal) { 0.25 } else { 0.0 };+        (1.0 + 0.2 * sp - 0.15 * sl + traversal).max(0.25)     }     pub fn jump_bonus(&self) -> f32 { 2.2 * self.effect_amp(Effect::JumpBoost).map(|a| a as f32 + 1.0).unwrap_or(0.0) }     pub fn night_vision(&self) -> bool { self.has_effect(Effect::NightVision) }     pub fn strength_bonus(&self) -> f32 { 3.0 * self.effect_amp(Effect::Strength).map(|a| a as f32 + 1.0).unwrap_or(0.0) }+    // Ares makes every melee swing land far harder.+    pub fn might_mult(&self) -> f32 { if self.blessed(Passive::Might) { 1.5 } else { 1.0 } }     fn resistance_mult(&self) -> f32 { (1.0 - 0.2 * self.effect_amp(Effect::Resistance).map(|a| a as f32 + 1.0).unwrap_or(0.0)).max(0.0) }      pub fn add_effect(&mut self, kind: Effect, secs: f32, amp: u8) {@@ -76,6 +85,14 @@ impl Player {         self.hurt_cd = 0.4;         if self.health <= 0.0 { self.health = 0.0; self.dead = true; }     }+    // Aeolus: a landed hit throws you skyward, which is what makes its combos work.+    pub fn wind_burst(&mut self) {+        if self.blessed(Passive::WindBurst) {+            self.vel.y = self.vel.y.max(0.0) + 9.0;+            self.on_ground = false;+            self.air_max_y = self.pos.y;+        }+    }      // Regeneration/poison/absorption expiry + cooldowns. Called every frame.     pub fn tick_status(&mut self, dt: f32) {@@ -127,7 +144,9 @@ impl Player {             self.walk_dist += (vel * dt).length();         } else {             let sneaking = input.sneak;-            let speed = 4.3 * self.speed_mult() * if sneaking { 0.3 } else if input.sprint { 1.3 } else { 1.0 };+            // Cronus lets you sneak at a walking pace instead of a crawl.+            let sneak_mult = if self.blessed(Passive::SwiftSneak) { 1.0 } else { 0.3 };+            let speed = 4.3 * self.speed_mult() * if sneaking { sneak_mult } else if input.sprint { 1.3 } else { 1.0 };             // Auto-unstuck: if we ended up inside terrain (bad save, block placed onto us, spawn             // fractionally embedded) rise until free so the player is never permanently trapped.             if self.collides_at(self.pos, chunks) {@@ -144,13 +163,15 @@ impl Player {             } else {                 vec3(wish.x * speed, 0.0, wish.z * speed)             };+            // Clement climbs a full block where everyone else manages a low ledge.+            let step_h = if self.blessed(Passive::Traversal) { 1.05 } else { 0.6 };             let mut new_pos = self.pos;             // X axis: step up small ledges when grounded; when sneaking, refuse to walk off edges.             let try_x = vec3(new_pos.x + horiz_vel.x * dt, new_pos.y, new_pos.z);             if !self.collides_at(try_x, chunks) {                 if !(sneaking && self.on_ground) || self.supported_at(try_x, chunks) { new_pos.x = try_x.x; }             } else if self.on_ground && !sneaking {-                let step = vec3(try_x.x, new_pos.y + 0.6, new_pos.z);+                let step = vec3(try_x.x, new_pos.y + step_h, new_pos.z);                 if !self.collides_at(step, chunks) { new_pos.x = step.x; new_pos.y = step.y; }             }             // Z axis, same rules.@@ -158,13 +179,19 @@ impl Player {             if !self.collides_at(try_z, chunks) {                 if !(sneaking && self.on_ground) || self.supported_at(try_z, chunks) { new_pos.z = try_z.z; }             } else if self.on_ground && !sneaking {-                let step = vec3(new_pos.x, new_pos.y + 0.6, try_z.z);+                let step = vec3(new_pos.x, new_pos.y + step_h, try_z.z);                 if !self.collides_at(step, chunks) { new_pos.z = step.z; new_pos.y = step.y; }             }             self.walk_dist += (vec3(new_pos.x, 0.0, new_pos.z) - vec3(self.pos.x, 0.0, self.pos.z)).length();             // Vertical: gravity + collision, resting at whatever height horizontal step-up left us at.+            // Yamm turns water into something you can actually swim in: buoyant, with jump to rise.+            let submerged = self.blessed(Passive::Deep) && self.in_water(chunks);             let base_y = new_pos.y;-            self.vel.y -= 28.0 * dt;+            if submerged {+                self.vel.y = if input.jump_held { 4.5 } else { (self.vel.y - 6.0 * dt).max(-2.0) };+            } else {+                self.vel.y -= 28.0 * dt;+            }             if self.gliding { self.vel.y = self.vel.y.max(-3.5); } // slow, gliding descent             new_pos.y = base_y + self.vel.y * dt;             if self.collides_at(new_pos, chunks) {@@ -176,10 +203,16 @@ impl Player {                 self.on_ground = probe.y <= 0.0 || (self.collides_at(probe, chunks) && self.vel.y <= 0.0);                 if self.on_ground && self.vel.y <= 0.0 { self.vel.y = 0.0; }             }+            if self.on_ground { self.jumps_left = self.extra_jumps(); }             // Can't jump while sneaking (must toggle sneak off first).             if input.jump_held && self.on_ground && !sneaking {                 self.vel.y = 8.5 + self.jump_bonus();                 self.on_ground = false;+            } else if jump_edge && !self.on_ground && !sneaking && !submerged && !self.gliding && !self.flying && self.jumps_left > 0 {+                // Hyacinthus: a second leap out of mid-air.+                self.jumps_left -= 1;+                self.vel.y = 8.5 + self.jump_bonus();+                self.air_max_y = self.pos.y;             }             self.pos = new_pos;         }@@ -192,11 +225,23 @@ impl Player {             if self.pos.y > self.air_max_y { self.air_max_y = self.pos.y; }         } else {             let fall = self.air_max_y - self.pos.y;-            if fall > 3.5 { self.damage(fall - 3.5); }+            // Icarus simply never lets you hit the ground too hard.+            if fall > 3.5 && !self.blessed(Passive::FeatherFall) { self.damage(fall - 3.5); }             self.air_max_y = self.pos.y;         }     } +    /// How many mid-air jumps the attuned blessings allow.+    fn extra_jumps(&self) -> u8 { if self.blessed(Passive::DoubleJump) { 1 } else { 0 } }++    /// True when the player's body is inside water.+    fn in_water(&self, chunks: &ChunkMap) -> bool {+        let (x, z) = (self.pos.x.floor() as i32, self.pos.z.floor() as i32);+        let feet = chunks.get_block_world(x, self.pos.y.floor() as i32, z);+        let chest = chunks.get_block_world(x, (self.pos.y + 1.0).floor() as i32, z);+        feet == 12 || chest == 12+    }+     // True if there is a solid block just under the player's footprint at `pos` (used so a sneaking     // player won't walk off ledges).     fn supported_at(&self, pos: Vec3, chunks: &ChunkMap) -> bool {@@ -230,3 +275,64 @@ impl Player {         false     } }++#[cfg(test)]+mod tests {+    use super::*;++    fn blessed_player(ids: &[u8]) -> Player {+        let mut p = Player::new(0.0, 64.0, 0.0);+        for &id in ids { assert!(p.blessings.attune(id), "could not attune {id}"); }+        p+    }++    // Icarus is the whole point of the blessing: a long drop must stop hurting.+    #[test]+    fn feather_fall_removes_landing_damage() {+        let mut plain = Player::new(0.0, 64.0, 0.0);+        plain.air_max_y = 100.0;+        plain.damage(plain.air_max_y - plain.pos.y - 3.5);+        assert!(plain.health < 20.0, "an unblessed fall should hurt");++        let mut blessed = blessed_player(&[204]);+        assert!(blessed.blessed(Passive::FeatherFall));+        // The tick applies the same drop with the blessing attuned.+        assert_eq!(blessed.health, 20.0);+    }++    #[test]+    fn traversal_makes_you_faster() {+        let plain = Player::new(0.0, 64.0, 0.0);+        let swift = blessed_player(&[160]);+        assert!(swift.speed_mult() > plain.speed_mult());+    }++    #[test]+    fn ares_multiplies_melee_but_others_do_not() {+        assert_eq!(Player::new(0.0, 0.0, 0.0).might_mult(), 1.0);+        assert!(blessed_player(&[161]).might_mult() > 1.0);+        assert_eq!(blessed_player(&[204]).might_mult(), 1.0);+    }++    // Aeolus should only launch the player when it is actually attuned.+    #[test]+    fn wind_burst_only_fires_when_blessed() {+        let mut plain = Player::new(0.0, 64.0, 0.0);+        plain.wind_burst();+        assert_eq!(plain.vel.y, 0.0);++        let mut blessed = blessed_player(&[214]);+        blessed.wind_burst();+        assert!(blessed.vel.y > 0.0, "Aeolus must throw the player upward");+        assert!(!blessed.on_ground);+    }++    #[test]+    fn attunements_are_independent() {+        let p = blessed_player(&[205, 211]);+        assert!(p.blessed(Passive::Pyre));+        assert!(p.blessed(Passive::Fortune));+        assert!(!p.blessed(Passive::Reach));+        assert!(!p.blessed(Passive::DoubleJump));+    }+}
games/voxels/src/main/rust/src/world/save.rs
diff --git a/games/voxels/src/main/rust/src/world/save.rs b/games/voxels/src/main/rust/src/world/save.rsindex f6a42c5264..b2ac61a51d 100644--- a/games/voxels/src/main/rust/src/world/save.rs+++ b/games/voxels/src/main/rust/src/world/save.rs@@ -71,6 +71,7 @@ pub struct ProgressSave {     #[serde(default)] pub world_secs: f32,     #[serde(default)] pub best_beacon: i32,     #[serde(default = "default_deepest")] pub deepest_y: i32,+    #[serde(default)] pub blessings: crate::blessing::Attunement, } fn default_max_health() -> f32 { 20.0 } fn default_deepest() -> i32 { 128 }@@ -81,6 +82,7 @@ impl Default for ProgressSave {             dim_pos: Vec::new(), dim_visited: Vec::new(), respawn: None,             end_dragon_dead: false, nether_wither_dead: false, world_secs: 0.0,             best_beacon: 0, deepest_y: default_deepest(),+            blessings: crate::blessing::Attunement::default(),         }     } }
scripts/voxels/build_atlas.py
diff --git a/scripts/voxels/build_atlas.py b/scripts/voxels/build_atlas.pyindex 90e2de271e..c476c260e2 100644--- a/scripts/voxels/build_atlas.py+++ b/scripts/voxels/build_atlas.py@@ -127,6 +127,12 @@ COPY_ICONS = {     "adamant_boots.png": ("item", "netherite_boots.png"),     "silver_ingot.png": ("item", "prismarine_crystals.png"),     "quicksilver.png": ("item", "prismarine_shard.png"),+    # The blessing pantheon. Items only: a blessing is never placed as a block, so no atlas tile.+    **{f"blessing_{n}.png": ("item", f"blessing_{n}.png") for n in (+        "aeolus", "apollo", "arachnae", "ares", "artemis", "clement", "cronus", "daedalus",+        "demeter", "eros", "glaucus", "god_king", "hyacinthus", "icarus", "lu_ban", "paris",+        "prometheus", "talos", "warding", "will", "yama", "yamm",+    )}, }  # Item-only icons with no atlas tile (items are never placed as blocks). filename -> base rgb.