Skip to content

Commit

Permalink
Added volatile conjured blocks, finished documentation of lamp
Browse files Browse the repository at this point in the history
  • Loading branch information
miyucomics committed Feb 22, 2024
1 parent 9a8b23a commit 825a2e4
Show file tree
Hide file tree
Showing 13 changed files with 120 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package miyucomics.hexical.blocks

import miyucomics.hexical.generics.GenericConjuredBlock
import miyucomics.hexical.registry.HexicalBlocks
import net.minecraft.block.BlockState
import net.minecraft.block.Blocks
import net.minecraft.entity.player.PlayerEntity
import net.minecraft.sound.SoundCategory
import net.minecraft.sound.SoundEvents
import net.minecraft.util.math.BlockPos
import net.minecraft.util.math.Vec3i
import net.minecraft.world.World

class ConjuredVolatileBlock : GenericConjuredBlock<ConjuredVolatileBlockEntity>(baseMaterial(), ConjuredVolatileBlockEntity::init) {
private val offsets: List<Vec3i> = listOf(
Vec3i(-1, 0, 0), Vec3i(1, 0, 0),
Vec3i(0, -1, 0), Vec3i(0, 1, 0),
Vec3i(0, 0, -1), Vec3i(0, 0, 1),
)

override fun onBreak(world: World, position: BlockPos, state: BlockState, player: PlayerEntity) {
world.setBlockState(position, Blocks.AIR.defaultState)
world.playSound(position.x.toDouble(), position.y.toDouble(), position.z.toDouble(), SoundEvents.BLOCK_AMETHYST_BLOCK_BREAK, SoundCategory.BLOCKS, 1f, 1f, true)
for (offset in offsets) {
val positionToTest = position.add(offset);
val otherState = world.getBlockState(positionToTest)
val block = otherState.block
if (block == HexicalBlocks.CONJURED_VOLATILE_BLOCK)
block.onBreak(world, positionToTest, otherState, player)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package miyucomics.hexical.blocks

import miyucomics.hexical.generics.GenericConjuredBlockEntity
import miyucomics.hexical.registry.HexicalBlocks
import net.minecraft.block.BlockState
import net.minecraft.block.entity.BlockEntityType
import net.minecraft.util.math.BlockPos

class ConjuredVolatileBlockEntity(type: BlockEntityType<ConjuredVolatileBlockEntity>, pos: BlockPos?, state: BlockState?) : GenericConjuredBlockEntity<ConjuredVolatileBlockEntity>(pos, state, type) {
companion object {
fun init (pos: BlockPos?, state: BlockState?): ConjuredVolatileBlockEntity {
return ConjuredVolatileBlockEntity(HexicalBlocks.CONJURED_VOLATILE_BLOCK_ENTITY, pos, state)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ package miyucomics.hexical.registry

import dev.architectury.registry.registries.DeferredRegister
import miyucomics.hexical.Hexical
import miyucomics.hexical.blocks.ConjuredBouncyBlock
import miyucomics.hexical.blocks.ConjuredBouncyBlockEntity
import miyucomics.hexical.blocks.ConjuredSlipperyBlock
import miyucomics.hexical.blocks.ConjuredSlipperyBlockEntity
import miyucomics.hexical.blocks.*
import net.minecraft.block.Block
import net.minecraft.block.entity.BlockEntityType
import net.minecraft.util.registry.Registry
Expand All @@ -16,15 +13,19 @@ object HexicalBlocks {

val CONJURED_BOUNCY_BLOCK: Block = ConjuredBouncyBlock()
val CONJURED_SLIPPERY_BLOCK: Block = ConjuredSlipperyBlock()
val CONJURED_VOLATILE_BLOCK: Block = ConjuredVolatileBlock()
val CONJURED_BOUNCY_BLOCK_ENTITY: BlockEntityType<ConjuredBouncyBlockEntity> = BlockEntityType.Builder.create(ConjuredBouncyBlockEntity::init, CONJURED_BOUNCY_BLOCK).build(null)
val CONJURED_SLIPPERY_BLOCK_ENTITY: BlockEntityType<ConjuredSlipperyBlockEntity> = BlockEntityType.Builder.create(ConjuredSlipperyBlockEntity::init, CONJURED_SLIPPERY_BLOCK).build(null)
val CONJURED_VOLATILE_BLOCK_ENTITY: BlockEntityType<ConjuredVolatileBlockEntity> = BlockEntityType.Builder.create(ConjuredVolatileBlockEntity::init, CONJURED_VOLATILE_BLOCK).build(null)

@JvmStatic
fun init() {
BLOCKS.register("conjured_bouncy_block") { CONJURED_BOUNCY_BLOCK }
BLOCKS.register("conjured_slippery_block") { CONJURED_SLIPPERY_BLOCK }
BLOCKS.register("conjured_volatile_block") { CONJURED_VOLATILE_BLOCK }
BLOCK_ENTITIES.register("conjured_bouncy_block") { CONJURED_BOUNCY_BLOCK_ENTITY }
BLOCK_ENTITIES.register("conjured_slippery_block") { CONJURED_SLIPPERY_BLOCK_ENTITY }
BLOCK_ENTITIES.register("conjured_volatile_block") { CONJURED_VOLATILE_BLOCK_ENTITY }
BLOCK_ENTITIES.register()
BLOCKS.register()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ object HexicalItems {
ITEMS.register("lamp") { LAMP_ITEM }
ITEMS.register("conjured_bouncy_block") { BlockItem(HexicalBlocks.CONJURED_BOUNCY_BLOCK, Item.Settings()) }
ITEMS.register("conjured_slippery_block") { BlockItem(HexicalBlocks.CONJURED_SLIPPERY_BLOCK, Item.Settings()) }
ITEMS.register("conjured_volatile_block") { BlockItem(HexicalBlocks.CONJURED_VOLATILE_BLOCK, Item.Settings()) }
ITEMS.register()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ object HexicalPatterns {
var NEPHTHYS_GAMBIT = register(HexPattern.fromAngles("deaqqdq", HexDir.SOUTH_EAST), "nephthys", OpNephthys);

var CONJURE_BOUNCY_BLOCK: HexPattern = register(HexPattern.fromAngles("dee", HexDir.NORTH_WEST), "conjure_bouncy_block", OpConjureBlock(HexicalBlocks.CONJURED_BOUNCY_BLOCK.defaultState))
var CONJURE_VOLATILE_BLOCK: HexPattern = register(HexPattern.fromAngles("deew", HexDir.NORTH_WEST), "conjure_volatile_block", OpConjureBlock(HexicalBlocks.CONJURED_VOLATILE_BLOCK.defaultState))
var CONJURE_SLIPPERY_BLOCK: HexPattern = register(HexPattern.fromAngles("deea", HexDir.NORTH_WEST), "conjure_slippery_block", OpConjureBlock(HexicalBlocks.CONJURED_SLIPPERY_BLOCK.defaultState))

var CHORUS_BLINK: HexPattern = register(HexPattern.fromAngles("aawqqqq", HexDir.SOUTH_EAST), "chorus_blink", OpChorusBlink())
Expand Down
13 changes: 10 additions & 3 deletions common/src/main/resources/assets/hexical/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
"item.hexical.lamp": "Genieless Lamp",

"block.hexical.conjured_bouncy_block": "Conjured Bouncy Block",
"block.hexical.conjured_falling_block": "Conjured Falling Block",
"block.hexical.conjured_slippery_block": "Conjured Slippery Block",
"block.hexical.conjured_volatile_block": "Conjured Volatile Block",

"hexcasting.spell.hexical:get_lamp_start_position": "Genie Reflection: Spatial",
"hexcasting.spell.hexical:get_lamp_start_rotation": "Genie Reflection: Rotational",
"hexcasting.spell.hexical:get_lamp_use_time": "Genie Reflection: Temporal",
"hexcasting.spell.hexical:chorus_blink": "Chorus Blink",
"hexcasting.spell.hexical:conjure_bouncy_block": "Conjure Bouncy Block",
"hexcasting.spell.hexical:conjure_falling_block": "Conjure Falling Block",
"hexcasting.spell.hexical:conjure_slippery_block": "Conjure Slippery Block",
"hexcasting.spell.hexical:conjure_volatile_block": "Conjure Volatile Block",
"hexcasting.spell.hexical:surveil_sentinel": "Surveil Sentinel",
"hexcasting.spell.hexical:nephthys": "Nephthys Gambit",
"hexcasting.spell.hexical:ping": "Ping",
Expand All @@ -26,11 +26,18 @@
"hexical.page.new_possibilities": "New Possibilities",
"hexical.page.new_possibilities.1": "It casts $(o)$(l)EVERY INSTANT$(). After writing a spell into it, I was treated to a splendid gush of media. I estimate it must be around twenty times every second. The presence inside the lamp performs the casting on my behalf with extraordinarily efficience, not wasting media in the form of sound and particles that accompany other casting methods.",
"hexical.page.new_possibilities.2": "I have deduced some potentially useful patterns for use with the lamp, documented on the next few pages.",
"hexical.page.master_lamps": "Master Lamps",
"hexical.page.master_lamps.1": "Because a separate mind casts my spells, a lamp should be able to cast even without me holding it. I estimate any villager short of a complete master of its field would be unable to cast so often unassisted though. These *master lamps* are activated and deactivated rather than used and while they're active in my inventory, they will cast every moment without my input.",
"hexical.page.master_lamps.2": "The output of a master lamp is so grand that it saturates the air around me with wave after wave of media. It is incredible. Unfortunately, if two lamps are active at once within my inventory, the resonances clash violently and causes a runaway chain that leads to a magical explosion, sapping almost five charged amethyst and violently repelling mobs, but strangely leaving blocks unharmed. To prevent such a cascade, I should only have one master lamp active at once, although I can still simutaneously use a regular lamp.",

"hexical.page.get_lamp_start_position": "Pushes the original position of the caster when the lamp started.",
"hexical.page.get_lamp_start_rotation": "Pushes the original rotation of the caster when the lamp started.",
"hexical.page.get_lamp_use_time": "Pushes how many times the lamp has casted. Divided by 20, it returns how many times in seconds the lamp has been in use.",

"hexical.page.replacement_mind": "Replacement Mind",
"hexical.page.replacement_mind.1": "Hex casting burns the mind from the energy of thought, flooding the mind, inundating every neuron... it's euphoric. For staffs, casting devices, and spell circles, the rate of casting is slow enough for a mind to recuperate, but with the speeds this lamp promises, even an optimized mind can only bear the burden for so long. As if to reflect the mind's deterioration, the lamp itself tarnishes until it becomes unusable. In these cases, the genie must be... replaced.",
"hexical.page.replacement_mind.2": "I have adapted Flay Mind to flay the mind into my magic lamp. The stress of nonstop casting requires highly trained villagers, I estimate of Journeyman-class or greater. The lamp may not be recharged without sacrificing a new mind, discarding the previous mind in the process, so I should aim to gather as much media as I can before casting.",

"hexical.page.hexical_metaevals": "Hexical Meta-evaluations",
"hexical.page.nephthys.1": "Pops a pattern list and a number from the stack and dives down n iota to casts the pattern list. Useful for surgery-like operations.",
"hexical.page.nephthys.2": "It's extremely versatile and I can mend almost any error in my stack using Bookkeeper's Gambit, pushing iota after a dive, and transforming surfaced iota. It was named after a goddess of mourning and rivers, lending to how it buries/dives down into the stack.",
Expand All @@ -42,8 +49,8 @@
"hexical.page.chorus_blink.2": "It consumes a chorus fruit from my inventory and teleports me up to 16 blocks using an offset vector. The cost is constant whether I teleport the full 16 blocks or less, and has no penalty for multiple casts in one hex. With a lot of chorus fruit, it can be a significantly cheaper Greater Teleport.",

"hexical.page.conjure_bouncy_block": "This Conjure Block variant is delightfully fun to bounce on! It returns more force to me than regular slime blocks and I notice even if I sneak, the block bounces me regardless.",
"hexical.page.conjure_falling_block": "This Conjure Block variant is subject to gravity! It even does a hefty amount of damage when landing on a target, scaling with height fallen.",
"hexical.page.conjure_slippery_block": "This Conjure Block variant is even more slippery than blue ice! Not only that, it doesn't melt in hot environments, making it perfect for me.",
"hexical.page.conjure_volatile_block": "This Conjure Block variant is extremely unstable! When just one breaks, every other connected blocks shatters instantly. It's useful for temporary bridges!",

"hexical.page.ping.1": "For the price of a single dust, I can cause a voluntary hallucination of a little circular ripple of my pigment color!",
"hexical.page.ping.2": "I can see it through blocks and its size does not change much even from a far distance, making it perfect for reporting locations from my hexes.",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "minecraft:item/amethyst_shard"
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "hexcasting.spell.hexical:conjure_volatile_block",
"icon": "minecraft:scaffolding",
"category": "hexical:hexical",
"pages": [
{
"type": "hexcasting:pattern",
"op_id": "hexical:conjure_volatile_block",
"anchor": "hexical:conjure_volatile_block",
"input": "vec",
"output": "",
"text": "hexical.page.conjure_volatile_block"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "hexical.page.master_lamps",
"icon": "hexical:lamp",
"category": "hexical:lamp",
"sortnum": 3,
"pages": [
{
"type": "patchouli:text",
"text": "hexical.page.master_lamps.1"
},
{
"type": "patchouli:text",
"text": "hexical.page.master_lamps.2"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
"name": "hexical.page.mysterious_lamp",
"icon": "minecraft:sand",
"category": "hexical:lamp",
"sortnum": 0,
"pages": [
{
"type": "patchouli:text",
"text": "hexical.page.mysterious_lamp.1"
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "hexical.page.new_possibilities",
"icon": "minecraft:sand",
"category": "hexical:lamp",
"sortnum": 1,
"pages": [
{
"type": "patchouli:text",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "hexical.page.replacement_mind",
"icon": "minecraft:textures/particle/soul_7.png",
"category": "hexical:lamp",
"sortnum": 2,
"pages": [
{
"type": "patchouli:text",
"text": "hexical.page.replacement_mind.1"
},
{
"type": "patchouli:text",
"text": "hexical.page.replacement_mind.2"
}
]
}

0 comments on commit 825a2e4

Please sign in to comment.