diff --git a/CHANGELOG.md b/CHANGELOG.md index 5619f4936..20177fec3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - added prestidigitation support for shearing beehives and bee nests for honeycomb - added ability to dye specklikes with the Dye spell - added wandering lamps: resembles a compass and points you towards the vector left at the top of the stack +- added two more akashic utility patterns for clearing and getting the pattern of an akashic bookshelf - changed Offerings page to no longer require using up a lamp - fixed bug that made magic missile deal velocity damage, making it the cheapest railgun in existence - removed cost from Reweave Mesh @@ -162,4 +163,4 @@ - fixed telepathy crashing on servers ## 1.0.0 -- Initial release, wooo! +- Initial release, wooo! \ No newline at end of file diff --git a/src/main/java/miyucomics/hexical/casting/patterns/akashic/OpClearAkashicShelf.kt b/src/main/java/miyucomics/hexical/casting/patterns/akashic/OpClearAkashicShelf.kt new file mode 100644 index 000000000..0076815ce --- /dev/null +++ b/src/main/java/miyucomics/hexical/casting/patterns/akashic/OpClearAkashicShelf.kt @@ -0,0 +1,29 @@ +package miyucomics.hexical.casting.patterns.akashic + +import at.petrak.hexcasting.api.spell.* +import at.petrak.hexcasting.api.spell.casting.CastingContext +import at.petrak.hexcasting.api.spell.iota.Iota +import at.petrak.hexcasting.api.spell.mishaps.MishapBadBlock +import at.petrak.hexcasting.common.blocks.akashic.BlockEntityAkashicBookshelf +import at.petrak.hexcasting.common.lib.HexBlocks +import net.minecraft.util.math.BlockPos + +class OpClearAkashicShelf : SpellAction { + override val argc = 1 + override fun execute(args: List, ctx: CastingContext): Triple> { + val position = args.getBlockPos(0, argc) + ctx.assertVecInRange(position) + val block = ctx.world.getBlockState(position) + if (!block.isOf(HexBlocks.AKASHIC_BOOKSHELF)) + throw MishapBadBlock.of(position, "akashic_bookshelf") + return Triple(Spell(position), 0, listOf()) + } + + private data class Spell(val position: BlockPos) : RenderedSpell { + override fun cast(ctx: CastingContext) { + val shelf = ctx.world.getBlockEntity(position)!! as BlockEntityAkashicBookshelf + shelf.clearIota() + shelf.markDirty() + } + } +} \ No newline at end of file diff --git a/src/main/java/miyucomics/hexical/casting/patterns/akashic/OpKeyAkashicShelf.kt b/src/main/java/miyucomics/hexical/casting/patterns/akashic/OpKeyAkashicShelf.kt new file mode 100644 index 000000000..cb4343c33 --- /dev/null +++ b/src/main/java/miyucomics/hexical/casting/patterns/akashic/OpKeyAkashicShelf.kt @@ -0,0 +1,25 @@ +package miyucomics.hexical.casting.patterns.akashic + +import at.petrak.hexcasting.api.spell.ConstMediaAction +import at.petrak.hexcasting.api.spell.asActionResult +import at.petrak.hexcasting.api.spell.casting.CastingContext +import at.petrak.hexcasting.api.spell.getBlockPos +import at.petrak.hexcasting.api.spell.iota.Iota +import at.petrak.hexcasting.api.spell.iota.NullIota +import at.petrak.hexcasting.api.spell.mishaps.MishapBadBlock +import at.petrak.hexcasting.common.blocks.akashic.BlockEntityAkashicBookshelf +import at.petrak.hexcasting.common.lib.HexBlocks +import at.petrak.hexcasting.common.lib.hex.HexIotaTypes + +class OpKeyAkashicShelf : ConstMediaAction { + override val argc = 1 + override fun execute(args: List, ctx: CastingContext): List { + val position = args.getBlockPos(0, argc) + ctx.assertVecInRange(position) + val block = ctx.world.getBlockState(position) + if (!block.isOf(HexBlocks.AKASHIC_BOOKSHELF)) + throw MishapBadBlock.of(position, "akashic_bookshelf") + val pattern = (ctx.world.getBlockEntity(position) as BlockEntityAkashicBookshelf).pattern ?: return listOf(NullIota()) + return pattern.asActionResult + } +} \ No newline at end of file diff --git a/src/main/java/miyucomics/hexical/entities/MagicMissileEntity.kt b/src/main/java/miyucomics/hexical/entities/MagicMissileEntity.kt index 1586e7b22..e60f6f678 100644 --- a/src/main/java/miyucomics/hexical/entities/MagicMissileEntity.kt +++ b/src/main/java/miyucomics/hexical/entities/MagicMissileEntity.kt @@ -16,6 +16,8 @@ import net.minecraft.sound.SoundEvent import net.minecraft.sound.SoundEvents import net.minecraft.util.hit.BlockHitResult import net.minecraft.util.hit.EntityHitResult +import net.minecraft.util.hit.HitResult +import net.minecraft.world.RaycastContext import net.minecraft.world.World class MagicMissileEntity(entityType: EntityType, world: World) : PersistentProjectileEntity(entityType, world) { diff --git a/src/main/java/miyucomics/hexical/registry/HexicalPatterns.kt b/src/main/java/miyucomics/hexical/registry/HexicalPatterns.kt index 79e81039a..3c63fb448 100644 --- a/src/main/java/miyucomics/hexical/registry/HexicalPatterns.kt +++ b/src/main/java/miyucomics/hexical/registry/HexicalPatterns.kt @@ -7,6 +7,8 @@ import at.petrak.hexcasting.api.spell.math.HexPattern import at.petrak.hexcasting.common.casting.operators.selectors.OpGetEntitiesBy import miyucomics.hexical.HexicalMain import miyucomics.hexical.casting.patterns.* +import miyucomics.hexical.casting.patterns.akashic.OpClearAkashicShelf +import miyucomics.hexical.casting.patterns.akashic.OpKeyAkashicShelf import miyucomics.hexical.casting.patterns.akashic.OpReadAkashicShelf import miyucomics.hexical.casting.patterns.akashic.OpWriteAkashicShelf import miyucomics.hexical.casting.patterns.circle.OpDisplace @@ -91,8 +93,10 @@ object HexicalPatterns { register("glow_scroll", "waeqqqqedeqdqdqdqeqdwwd", HexDir.EAST, OpGlowScroll()) register("vanish_scroll", "waeqqqqedeqeeweeqewee", HexDir.EAST, OpVanishScroll()) + register("key_shelf", "qaqqadaq", HexDir.EAST, OpKeyAkashicShelf()) register("read_shelf", "qaqqqada", HexDir.EAST, OpReadAkashicShelf()) register("write_shelf", "edeeedad", HexDir.SOUTH_WEST, OpWriteAkashicShelf()) + register("clear_shelf", "edeedade", HexDir.SOUTH_WEST, OpClearAkashicShelf()) register("displace", "qaqqqqeedaqqqa", HexDir.NORTH_EAST, OpDisplace()) diff --git a/src/main/resources/assets/hexical/lang/en_us.json b/src/main/resources/assets/hexical/lang/en_us.json index 7dda147f6..2d0ec4717 100644 --- a/src/main/resources/assets/hexical/lang/en_us.json +++ b/src/main/resources/assets/hexical/lang/en_us.json @@ -136,6 +136,7 @@ "hexcasting.spell.book.hexical:modify_block_replaceable": "Replaceable", "hexcasting.spell.book.hexical:modify_block_semipermeable": "Semi-Permeable", "hexcasting.spell.book.hexical:modify_block_volatile": "Volatile", + "hexcasting.spell.book.hexical:read_shelf": "Librarian's Purif. II", "hexical.page.hexical_changes.title": "Hexical Changes", "hexical.page.hexical_changes.0": "I feel strangely more in tune with the ambient _media around me. It feels $(o)friendlier$() somehow... I can even feel it rippling around me, responding to my actions, as if suggesting new spells to me. The _media itself also feels more malleable, more $(o)workable$(), allowing me to manipulate it into precise specialized effects.", @@ -328,11 +329,15 @@ "hexical.page.themis.1": "After each iteration, it demands a number at the top of the stack which will correspond to that iota. At the end of the gambit, a list is pushed with the iota sorted by that number in increasing order. The order of identically numbered iota are kept. If it encounters $(l:patterns/meta#hexcasting:halt)$(action)Charon's Gambit$(), it will create a sorted list with only the iota it has come across.$(br2)$(o)Shuffling is the only thing which Nature cannot undo.$()", "hexical.page.akashic_utils.title": "Akashic Utilities", - "hexical.page.akashic_utils.0": "I have discovered some conveniences for akashic libraries! I can right-click or $(l:hexical:patterns/spells/prestidigitation)magically interact$() with a filled akashic bookshelf to copy its iota into my stack. I can also right-click with a scroll to copy the pattern of the bookshelf onto the scroll. Finally, I have discovered two patterns that can read and write directly to a bookshelf within ambit for free.", - "hexcasting.spell.hexical:read_shelf": "Librarian's Purification", + "hexical.page.akashic_utils.0": "I have discovered some conveniences for akashic libraries! I can right-click or $(l:hexical:patterns/spells/prestidigitation)magically interact$() with a filled akashic bookshelf to copy its iota into my stack. I can also right-click with a scroll to copy the pattern of the bookshelf onto the scroll. Finally, I have discovered patterns that can read and write directly to a bookshelf within ambit for free.", + "hexcasting.spell.hexical:key_shelf": "Librarian's Purification", + "hexical.page.key_shelf.summary": "Reads the pattern key of an akashic bookshelf within ambit. Free to cast.", + "hexcasting.spell.hexical:read_shelf": "Librarian's Purification II", "hexical.page.read_shelf.summary": "Reads the iota from an akashic bookshelf within ambit. Free to cast.", "hexcasting.spell.hexical:write_shelf": "Librarian's Gambit", "hexical.page.write_shelf.summary": "Writes an iota under a pattern to an akashic bookshelf within ambit. Free to cast.", + "hexcasting.spell.hexical:clear_shelf": "Librarian's Gambit II", + "hexical.page.clear_shelf.summary": "Clears an akashic bookshelf within ambit. Free to cast.", "hexical.page.mage_block.title": "Mage Blocks", "hexical.page.mage_block": "The blocks from $(l:patterns/spells/blockworks#hexcasting:conjure_block)$(action)Conjure Block$() last forever, are consequently a pain to clean up, and are not too versatile. Luckily, Nature offers an elegant and flexible alternative. These mage blocks come with a suite of $(o)modifiers$(). I could even stack multiple modifiers on one block or reapply a modifier to toggle it off.", diff --git a/src/main/resources/data/hexical/patchouli_books/hexicalbook/en_us/entries/patterns/akashic_utils.json b/src/main/resources/data/hexical/patchouli_books/hexicalbook/en_us/entries/patterns/akashic_utils.json index 05135503e..25258951a 100644 --- a/src/main/resources/data/hexical/patchouli_books/hexicalbook/en_us/entries/patterns/akashic_utils.json +++ b/src/main/resources/data/hexical/patchouli_books/hexicalbook/en_us/entries/patterns/akashic_utils.json @@ -9,6 +9,13 @@ { "type": "patchouli:text", "text": "hexical.page.akashic_utils.0" + }, { + "type": "hexcasting:pattern", + "op_id": "hexical:key_shelf", + "anchor": "hexical:key_shelf", + "input": "vector", + "output": "pattern/null", + "text": "hexical.page.key_shelf.summary" }, { "type": "hexcasting:pattern", "op_id": "hexical:read_shelf", @@ -23,6 +30,13 @@ "input": "vector, pattern, any", "output": "", "text": "hexical.page.write_shelf.summary" + }, { + "type": "hexcasting:pattern", + "op_id": "hexical:clear_shelf", + "anchor": "hexical:clear_shelf", + "input": "vector", + "output": "", + "text": "hexical.page.clear_shelf.summary" } ] -} +} \ No newline at end of file