Skip to content

Commit

Permalink
More librarian patterns!
Browse files Browse the repository at this point in the history
  • Loading branch information
miyucomics committed Aug 26, 2024
1 parent a278a85 commit ea7a6ba
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -162,4 +163,4 @@
- fixed telepathy crashing on servers

## 1.0.0
- Initial release, wooo!
- Initial release, wooo!
Original file line number Diff line number Diff line change
@@ -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<Iota>, ctx: CastingContext): Triple<RenderedSpell, Int, List<ParticleSpray>> {
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()
}
}
}
Original file line number Diff line number Diff line change
@@ -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<Iota>, ctx: CastingContext): List<Iota> {
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
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<out MagicMissileEntity?>, world: World) : PersistentProjectileEntity(entityType, world) {
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/miyucomics/hexical/registry/HexicalPatterns.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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())

Expand Down
9 changes: 7 additions & 2 deletions src/main/resources/assets/hexical/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down Expand Up @@ -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.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
}
]
}
}

0 comments on commit ea7a6ba

Please sign in to comment.