Skip to content

Commit

Permalink
Some more minor additions
Browse files Browse the repository at this point in the history
  • Loading branch information
miyucomics committed Jul 23, 2024
1 parent e9b3d78 commit 1502fd7
Show file tree
Hide file tree
Showing 11 changed files with 91 additions and 25 deletions.
11 changes: 6 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@
- added Wristpocket spell - hide items magically
- added Ingest spell - eat wristpocketed item
- added Mage Hand spell - use your wristpocketed item to interact with blocks and entities
- added context checking patterns to get the current context of a hex is being cast in
- added shader spells - alter your vision with magic!
- added spell to age living scrolls
- added context checking patterns to get the current context of a hex is being cast in
- added shader spells - alter your vision with an array of shaders for fun and for utility
- added mishap to Chorus Blink if you don't have chorus fruit in your inventory
- added semi-permeable mage block modifier: only sprinting creatures have collision
- added sprites for conjured staff
- added an ungodly amount of world scrying patterns
- added hex candles - purple amethyst candles whose flames take on the colors of pigments
- added a ton of world scrying patterns
- added hex candles - amethyst candles whose flames take on the pigments of whomever last interacted with them
- added meshes - similar to specks but they take in a list of vectors and connect them with pigmented lines
- changed conjured staff sprite to be less messy
- changed Identify pattern to have ambit limitation
- changed speed and variance of living scroll patterns
Expand All @@ -57,7 +58,7 @@
- overhauled project structure completely
- overhauled genie lamps completely and entirely
- overhauled world scrying patterns
- removed casting sounds from conjured staves and replaced it with staff drawing sounds
- removed casting sounds from conjured staves
- updated documentation
- updated telepathy code to share code with movement reflections

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package miyucomics.hexical.casting.patterns.getters

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.getEntity
import at.petrak.hexcasting.api.spell.iota.Iota
import at.petrak.hexcasting.api.spell.iota.NullIota
import at.petrak.hexcasting.api.spell.mishaps.MishapInvalidIota
import net.minecraft.entity.passive.AnimalEntity

class OpGetBreed : ConstMediaAction {
override val argc = 1
override fun execute(args: List<Iota>, ctx: CastingContext): List<Iota> {
val entity = args.getEntity(0, argc)
if (entity !is AnimalEntity)
return listOf(NullIota())
return entity.isInLove.asActionResult
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,31 @@ 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.getLivingEntityButNotArmorStand
import at.petrak.hexcasting.api.spell.iota.EntityIota
import at.petrak.hexcasting.api.spell.iota.Iota
import at.petrak.hexcasting.api.spell.mishaps.MishapInvalidIota
import miyucomics.hexical.casting.iota.IdentifierIota
import net.minecraft.entity.LivingEntity
import net.minecraft.util.registry.Registry

class OpGetLivingEntityData(private val mode: Int) : ConstMediaAction {
override val argc = 1
override fun execute(args: List<Iota>, ctx: CastingContext): List<Iota> {
val entity = args.getLivingEntityButNotArmorStand(0, argc)
val iota = args[0]
if (iota !is EntityIota)
throw MishapInvalidIota.ofType(iota, 0, "lenient_living")
val entity = iota.entity
if (entity !is LivingEntity)
throw MishapInvalidIota.ofType(iota, 0, "lenient_living")
return when (mode) {
0 -> entity.health.asActionResult
1 -> entity.maxHealth.asActionResult
2 -> (entity.air.toDouble() / 20 + 1).asActionResult
3 -> (entity.maxAir.toDouble() / 20 + 1).asActionResult
4 -> entity.isSleeping.asActionResult
5 -> entity.isSprinting.asActionResult
6 -> {
6 -> entity.isBaby.asActionResult
7 -> {
val list = mutableListOf<Iota>()
for (effect in entity.statusEffects)
list.add(IdentifierIota(Registry.STATUS_EFFECT.getId(effect.effectType)!!))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
package miyucomics.hexical.casting.patterns.lamp

import at.petrak.hexcasting.api.misc.DiscoveryHandlers
import at.petrak.hexcasting.api.spell.ParticleSpray
import at.petrak.hexcasting.api.spell.RenderedSpell
import at.petrak.hexcasting.api.spell.SpellAction
import at.petrak.hexcasting.api.spell.casting.CastingContext
import at.petrak.hexcasting.api.spell.iota.Iota
import miyucomics.hexical.casting.mishaps.NeedsActiveArchLampMishap
import miyucomics.hexical.enums.SpecializedSource
import miyucomics.hexical.items.ArchLampItem
import miyucomics.hexical.items.hasActiveArchLamp
import miyucomics.hexical.registry.HexicalItems
import miyucomics.hexical.utils.CastingUtils

class OpTerminateArchLamp : SpellAction {
override val argc = 0
Expand All @@ -19,9 +23,13 @@ class OpTerminateArchLamp : SpellAction {

private class Spell : RenderedSpell {
override fun cast(ctx: CastingContext) {
for (slot in ctx.caster.inventory.main)
if (slot.item == HexicalItems.ARCH_LAMP_ITEM)
slot.orCreateNbt.putBoolean("active", false)
for (stack in DiscoveryHandlers.collectItemSlots(ctx)) {
if (stack.isOf(HexicalItems.ARCH_LAMP_ITEM)) {
stack.orCreateNbt.putBoolean("active", false)
CastingUtils.castSpecial(ctx.world, ctx.caster, (stack.item as ArchLampItem).getHex(stack, ctx.world)!!, SpecializedSource.ARCH_LAMP, finale = true)
return
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,25 @@ import net.minecraft.item.ItemStack
import net.minecraft.util.math.Vec3d

class OpConjureStaff : SpellAction {
override val argc = 4
override val argc = 5
override fun execute(args: List<Iota>, ctx: CastingContext): Triple<RenderedSpell, Int, List<ParticleSpray>> {
val position = args.getVec3(0, argc)
ctx.assertVecInRange(position)
val battery = args.getInt(1, argc)
val rank = args.getInt(2, argc)
if (rank <= 0)
throw MishapInvalidIota.of(args[2], 2, "integer_natural")
val instructions = args.getList(3, argc).toList()
CastingUtils.assertNoTruename(args[3], ctx.caster)
return Triple(Spell(position, battery * MediaConstants.DUST_UNIT, rank, instructions), MediaConstants.SHARD_UNIT + MediaConstants.DUST_UNIT * (rank + battery), listOf(ParticleSpray.burst(position, 1.0)))
val sprite = args.getIntBetween(3, 0, 10, argc)
val instructions = args.getList(4, argc).toList()
CastingUtils.assertNoTruename(args[4], ctx.caster)
return Triple(Spell(position, battery * MediaConstants.DUST_UNIT, rank, sprite, instructions), MediaConstants.SHARD_UNIT + MediaConstants.DUST_UNIT * (rank + battery), listOf(ParticleSpray.burst(position, 1.0)))
}

private data class Spell(val position: Vec3d, val battery: Int, val rank: Int, val instructions: List<Iota>) : RenderedSpell {
private data class Spell(val position: Vec3d, val battery: Int, val rank: Int, val sprite: Int, val instructions: List<Iota>) : RenderedSpell {
override fun cast(ctx: CastingContext) {
val stack = ItemStack(HexicalItems.CONJURED_STAFF_ITEM, 1)
stack.orCreateNbt.putInt("rank", rank)
stack.orCreateNbt.putInt("sprite", sprite)
val hexHolder = IXplatAbstractions.INSTANCE.findHexHolder(stack)
hexHolder?.writeHex(instructions, battery)
ctx.world.spawnEntity(ItemEntity(ctx.world, position.x, position.y, position.z, stack))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import net.minecraft.world.World
class ConjuredStaffItem : ItemPackagedHex(Settings().maxCount(1)) {
override fun use(world: World, player: PlayerEntity, usedHand: Hand): TypedActionResult<ItemStack> = TypedActionResult.success(player.getStackInHand(usedHand))
override fun canDrawMediaFromInventory(stack: ItemStack) = false
override fun isItemBarVisible(stack: ItemStack) = false
override fun canRecharge(stack: ItemStack) = false
override fun breakAfterDepletion() = true

Expand Down
16 changes: 9 additions & 7 deletions src/main/java/miyucomics/hexical/registry/HexicalPatterns.kt
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,13 @@ object HexicalPatterns {
register("modify_block_semipermeable", "deeeqawde", HexDir.NORTH_WEST, OpModifyMageBlock("semipermeable"))
register("modify_block_volatile", "deewedeeeee", HexDir.NORTH_WEST, OpModifyMageBlock("volatile"))

register("conjure_staff", "wwwwwaqqqqqeaqeaeaeaeaeq", HexDir.NORTH_EAST, OpConjureStaff())
register("write_staff", "waqqqqqeaqeaeaeaeaeq", HexDir.NORTH_EAST, OpWriteStaff())
register("read_staff", "waqqqqqedeqdqdqdqdqe", HexDir.NORTH_EAST, OpReadStaff())
register("conjure_staff", "wwwwwwaqqqqqedeqdqdqdqdqe", HexDir.NORTH_EAST, OpConjureStaff())
register("write_staff", "waqqqqqedeqdqdqdqdqe", HexDir.NORTH_EAST, OpWriteStaff())
register("read_staff", "waqqqqqeaqeaeaeaeaeq", HexDir.NORTH_EAST, OpReadStaff())

register("conjure_compass", "aqwawqwqqwqwqeawwa", HexDir.SOUTH_WEST, OpConjureCompass())
register("conjure_hexburst", "edeqaawaa", HexDir.SOUTH_WEST, OpConjureHexburst())
register("conjure_hextito", "edeaddadd", HexDir.SOUTH_WEST, OpConjureHextito())
register("conjure_compass", "aqwawqwqqwqwq", HexDir.SOUTH_WEST, OpConjureCompass())
register("conjure_hexburst", "aadaadqaq", HexDir.EAST, OpConjureHexburst())
register("conjure_hextito", "qaqdqaqdwawaw", HexDir.EAST, OpConjureHextito())

register("conjure_speck", "ade", HexDir.SOUTH_WEST, OpConjureSpeck())
register("iota_speck", "adeeaqa", HexDir.SOUTH_WEST, OpIotaSpeck())
Expand Down Expand Up @@ -214,6 +214,8 @@ object HexicalPatterns {
register("get_max_air", "wwaadee", HexDir.EAST, OpGetLivingEntityData(3))
register("is_sleeping", "aqaew", HexDir.NORTH_WEST, OpGetLivingEntityData(4))
register("is_sprinting", "eaq", HexDir.WEST, OpGetLivingEntityData(5))
register("is_baby", "awaqdwaaw", HexDir.SOUTH_WEST, OpGetLivingEntityData(6))
register("breedable", "awaaqdqaawa", HexDir.EAST, OpGetBreed())

register("get_enchantments", "waqeaeqawqwawaw", HexDir.WEST, OpGetItemStackData(2))
register("get_enchantment_strength", "waqwwqaweede", HexDir.WEST, OpGetEnchantmentStrength())
Expand All @@ -232,7 +234,7 @@ object HexicalPatterns {
register("blockstate_bunch", "qaqqqqqweeeeedeeqaqdeee", HexDir.EAST, OpGetBlockStateData(6))
register("blockstate_book", "qaqqqqqeawa", HexDir.EAST, OpGetBlockStateData(7))

register("get_effects_entity", "wqqq", HexDir.SOUTH_WEST, OpGetLivingEntityData(6))
register("get_effects_entity", "wqqq", HexDir.SOUTH_WEST, OpGetLivingEntityData(7))
register("get_effects_item", "wqqqadee", HexDir.SOUTH_WEST, OpGetPrescription())
register("get_effect_category", "wqqqaawd", HexDir.SOUTH_WEST, OpGetStatusEffectCategory())
register("get_effect_amplifier", "wqqqaqwa", HexDir.SOUTH_WEST, OpGetStatusEffectInstanceData(0))
Expand Down
8 changes: 7 additions & 1 deletion src/main/resources/assets/hexical/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
"hexcasting.mishap.invalid_value.identifiable": "an identifiable target",
"hexcasting.mishap.invalid_value.integer_natural": "an integer greater than 0",
"hexcasting.mishap.invalid_value.recognizable": "a target with extra information",
"hexcasting.mishap.invalid_value.lenient_living": "a living entity or an armor stand",
"hexcasting.mishap.invalid_value.nonempty_list": "a non-empty list",
"hexcasting.mishap.invalid_value.true_dye_list": "a list of colored dyes",
"hexcasting.mishap.hexical:active_arch_lamp": "Expected an active Arch Lamp in the inventory.",
Expand Down Expand Up @@ -355,6 +356,7 @@
"hexical.page.conjure_staff.summary": "Conjures a staff at the location with the amount of media, rank, and hex respectively.$(br2)$(o)This is my $(l)staff$()$(o). There are many like it, but this one is mine.$()",
"hexical.page.conjure_staff.1": "When I use my primary or secondary use keys while holding a $(item)conjured staff$(), it intercepts my click, preventing me from interacting with the world while holding it. After a number of clicks corresponding to the rank I assigned at conjuration, it casts the _Hex I gave it, starting the stack with false and true, corresponding to the left and right clicks respectively. If I pause for too long between clicks, it simply cancels the current \"cast\".",
"hexical.page.conjure_staff.2": "The spell is not too expensive, requiring only an amethyst shard, an amethyst dust for every rank, and the media for the battery. The result is a speedy and versatile casting device, with infinitely more possibilities and no cooldown compared to other casting devices.$(br2)Not only that, conjured staves feature an iota storage that can only be edited from the staff itself.",
"hexical.page.conjure_staff.3": "The third number given to the spell determines the appearance of the staff. Starting from zero, the current possibilities are a staff, a clover flower, a conch, a handbell, a key, and a magic mirror. I sense that this aspect of the staff is constantly changing so new appearances may emerge in the future.",
"hexcasting.spell.hexical:read_staff": "Staff Reflection",
"hexical.page.read_staff.summary": "Reads the iota from the conjured staff's inner storage.",
"hexcasting.spell.hexical:write_staff": "Staff Gambit",
Expand Down Expand Up @@ -496,14 +498,18 @@
"hexical.page.burning_time.summary": "Pushes how long in seconds the entity will continue burning if not put out.",
"hexcasting.spell.hexical:is_wet": "Enderman's Purification",
"hexical.page.is_wet.summary": "Pushes whether the entity is touching rain, water, or in a bubble column.",
"hexcasting.spell.hexical:is_baby": "Youth Purification",
"hexical.page.is_baby.summary": "Pushes whether a living creature is in its baby form. Also works on armor stands oddly.",
"hexcasting.spell.hexical:breedable": "Reproduction Purification",
"hexical.page.breedable.summary": "Pushes whether an animal creature is in love and ready to mate, or null if that creature is not capable of that type of reproduction.",
"hexcasting.spell.hexical:is_sleeping": "Sloth's Purification",
"hexical.page.is_sleeping.summary": "Pushes whether the entity is sleeping. Applies to players, cats, foxes, and a variety of other creatures.",
"hexcasting.spell.hexical:is_sprinting": "Racer's Purification",
"hexical.page.is_sprinting.summary": "Pushes whether the entity is sprinting. Includes if I am swimming or if I have left the ground since sprinting and extends to cats, foxes, and more.",

"hexical.page.food.title": "Food",
"hexcasting.spell.hexical:edible": "Edibility Purification",
"hexical.page.edible.summary": "Takes in an item entity and pushes whether you can eat it.",
"hexical.page.edible.summary": "Takes in an item identifier and pushes whether you can eat it.",
"hexcasting.spell.hexical:get_hunger": "Calorie Purification",
"hexical.page.get_hunger.summary": "Takes in an item identifier and pushes the amount it will fill you.",
"hexcasting.spell.hexical:get_saturation": "Satiation Purification",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"type": "hexcasting:pattern",
"op_id": "hexical:conjure_staff",
"anchor": "hexical:conjure_staff",
"input": "vec, num, num, [pattern]",
"input": "vec, num, num, num, [pattern]",
"output": "",
"text": "hexical.page.conjure_staff.summary"
}, {
Expand All @@ -21,6 +21,9 @@
}, {
"type": "patchouli:text",
"text": "hexical.page.conjure_staff.2"
}, {
"type": "patchouli:text",
"text": "hexical.page.conjure_staff.3"
}, {
"type": "hexcasting:pattern",
"op_id": "hexical:read_staff",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"anchor": "hexical:greater_blink",
"input": "vector",
"output": "",
"text": "hexical.page.greater_blink.desc"
"text": "hexical.page.greater_blink.summary"
}, {
"type": "patchouli:text",
"text": "hexical.page.greater_blink.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,20 @@
"input": "entity",
"output": "boolean",
"text": "hexical.page.is_wet.summary"
}, {
"type": "hexcasting:pattern",
"op_id": "hexical:is_baby",
"anchor": "hexical:is_baby",
"input": "entity",
"output": "boolean",
"text": "hexical.page.is_baby.summary"
}, {
"type": "hexcasting:pattern",
"op_id": "hexical:breedable",
"anchor": "hexical:breedable",
"input": "entity",
"output": "boolean/null",
"text": "hexical.page.breedable.summary"
}, {
"type": "hexcasting:pattern",
"op_id": "hexical:is_sleeping",
Expand Down

0 comments on commit 1502fd7

Please sign in to comment.