diff --git a/CHANGELOG.md b/CHANGELOG.md index 799351cab..baee372c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 @@ -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 diff --git a/src/main/java/miyucomics/hexical/casting/patterns/getters/OpGetBreed.kt b/src/main/java/miyucomics/hexical/casting/patterns/getters/OpGetBreed.kt new file mode 100644 index 000000000..f2cae6ba9 --- /dev/null +++ b/src/main/java/miyucomics/hexical/casting/patterns/getters/OpGetBreed.kt @@ -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, ctx: CastingContext): List { + val entity = args.getEntity(0, argc) + if (entity !is AnimalEntity) + return listOf(NullIota()) + return entity.isInLove.asActionResult + } +} \ No newline at end of file diff --git a/src/main/java/miyucomics/hexical/casting/patterns/getters/OpGetLivingEntityData.kt b/src/main/java/miyucomics/hexical/casting/patterns/getters/OpGetLivingEntityData.kt index 921bd8c69..c82871102 100644 --- a/src/main/java/miyucomics/hexical/casting/patterns/getters/OpGetLivingEntityData.kt +++ b/src/main/java/miyucomics/hexical/casting/patterns/getters/OpGetLivingEntityData.kt @@ -4,14 +4,22 @@ 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, ctx: CastingContext): List { - 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 @@ -19,7 +27,8 @@ class OpGetLivingEntityData(private val mode: Int) : ConstMediaAction { 3 -> (entity.maxAir.toDouble() / 20 + 1).asActionResult 4 -> entity.isSleeping.asActionResult 5 -> entity.isSprinting.asActionResult - 6 -> { + 6 -> entity.isBaby.asActionResult + 7 -> { val list = mutableListOf() for (effect in entity.statusEffects) list.add(IdentifierIota(Registry.STATUS_EFFECT.getId(effect.effectType)!!)) diff --git a/src/main/java/miyucomics/hexical/casting/patterns/lamp/OpTerminateArchLamp.kt b/src/main/java/miyucomics/hexical/casting/patterns/lamp/OpTerminateArchLamp.kt index e44928e3f..f5a96cb58 100644 --- a/src/main/java/miyucomics/hexical/casting/patterns/lamp/OpTerminateArchLamp.kt +++ b/src/main/java/miyucomics/hexical/casting/patterns/lamp/OpTerminateArchLamp.kt @@ -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 @@ -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 + } + } } } } \ No newline at end of file diff --git a/src/main/java/miyucomics/hexical/casting/patterns/staff/OpConjureStaff.kt b/src/main/java/miyucomics/hexical/casting/patterns/staff/OpConjureStaff.kt index 96c6d66fd..3d5cac17a 100644 --- a/src/main/java/miyucomics/hexical/casting/patterns/staff/OpConjureStaff.kt +++ b/src/main/java/miyucomics/hexical/casting/patterns/staff/OpConjureStaff.kt @@ -13,7 +13,7 @@ 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, ctx: CastingContext): Triple> { val position = args.getVec3(0, argc) ctx.assertVecInRange(position) @@ -21,15 +21,17 @@ class OpConjureStaff : SpellAction { 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) : RenderedSpell { + private data class Spell(val position: Vec3d, val battery: Int, val rank: Int, val sprite: Int, val instructions: List) : 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)) diff --git a/src/main/java/miyucomics/hexical/items/ConjuredStaffItem.kt b/src/main/java/miyucomics/hexical/items/ConjuredStaffItem.kt index c1005dd36..91c87c025 100644 --- a/src/main/java/miyucomics/hexical/items/ConjuredStaffItem.kt +++ b/src/main/java/miyucomics/hexical/items/ConjuredStaffItem.kt @@ -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 = 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 diff --git a/src/main/java/miyucomics/hexical/registry/HexicalPatterns.kt b/src/main/java/miyucomics/hexical/registry/HexicalPatterns.kt index f8e2ef3b8..14a55c001 100644 --- a/src/main/java/miyucomics/hexical/registry/HexicalPatterns.kt +++ b/src/main/java/miyucomics/hexical/registry/HexicalPatterns.kt @@ -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()) @@ -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()) @@ -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)) diff --git a/src/main/resources/assets/hexical/lang/en_us.json b/src/main/resources/assets/hexical/lang/en_us.json index 6522a70e7..6839853e6 100644 --- a/src/main/resources/assets/hexical/lang/en_us.json +++ b/src/main/resources/assets/hexical/lang/en_us.json @@ -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.", @@ -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", @@ -496,6 +498,10 @@ "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", @@ -503,7 +509,7 @@ "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", diff --git a/src/main/resources/data/hexical/patchouli_books/hexicalbook/en_us/entries/patterns/conjured_staff.json b/src/main/resources/data/hexical/patchouli_books/hexicalbook/en_us/entries/patterns/conjured_staff.json index 374920e6b..bb8a698dc 100644 --- a/src/main/resources/data/hexical/patchouli_books/hexicalbook/en_us/entries/patterns/conjured_staff.json +++ b/src/main/resources/data/hexical/patchouli_books/hexicalbook/en_us/entries/patterns/conjured_staff.json @@ -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" }, { @@ -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", diff --git a/src/main/resources/data/hexical/patchouli_books/hexicalbook/en_us/entries/patterns/greater_blink.json b/src/main/resources/data/hexical/patchouli_books/hexicalbook/en_us/entries/patterns/greater_blink.json index 3f4a7db2c..5ab157793 100644 --- a/src/main/resources/data/hexical/patchouli_books/hexicalbook/en_us/entries/patterns/greater_blink.json +++ b/src/main/resources/data/hexical/patchouli_books/hexicalbook/en_us/entries/patterns/greater_blink.json @@ -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" diff --git a/src/main/resources/data/hexical/patchouli_books/hexicalbook/en_us/entries/patterns/scrying/entities.json b/src/main/resources/data/hexical/patchouli_books/hexicalbook/en_us/entries/patterns/scrying/entities.json index 117e5609e..17391afb0 100644 --- a/src/main/resources/data/hexical/patchouli_books/hexicalbook/en_us/entries/patterns/scrying/entities.json +++ b/src/main/resources/data/hexical/patchouli_books/hexicalbook/en_us/entries/patterns/scrying/entities.json @@ -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",