diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index e3062d02..1028758f 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -1,3 +1,4 @@ +60c0f39882d22c2634cf738b0fe4e956eaa2adbe assets/hexcasting/models/item/abacus.json eb78f6a2b68dd772a5016fc5a3db10488a65abfa assets/hexcasting/models/item/amethyst_dust.json df940dd798240fac6fde700c57f8ae6aa43d1c9e assets/hexcasting/models/item/artifact.json 1a66f279c030ebd5ed6a596f63205094b2529819 assets/hexcasting/models/item/artifact_filled.json @@ -81,6 +82,7 @@ b6593ea802a692c29b5032292df31beb84878ad8 data/hexcasting/advancements/aaa_wastef 4f4c94021adfb296e3ef3dce1acc46f724f38f92 data/hexcasting/advancements/aab_big_cast.json a165e3959b7d0c37bea586d0e94609b483255569 data/hexcasting/advancements/enlightenment.json eb6393ffc79966e4b5983a68157742b78cd12414 data/hexcasting/advancements/opened_eyes.json +47000a9b5a409038e369dbef156a72ec93cb51db data/hexcasting/advancements/recipes/hexcasting/abacus.json af81f4442801d794920d6330d82cb1289a78f236 data/hexcasting/advancements/recipes/hexcasting/artifact.json 7e4de1f72dd75e3efea6e879e1be15fa4216bd4b data/hexcasting/advancements/recipes/hexcasting/cypher.json 29260d23193f414236b0278a5abd7fe1f7ba8b46 data/hexcasting/advancements/recipes/hexcasting/dye_colorizer_black.json @@ -129,6 +131,7 @@ afecba3144e00505977a4ab4de7940f949ab7818 data/hexcasting/loot_modifiers/scroll_d 0e8c8a56161586a4021487b27059ca151465af67 data/hexcasting/loot_modifiers/scroll_jungle.json 50e7ad657a0ab43f3bd632120e09f109791aaf34 data/hexcasting/loot_modifiers/scroll_shipwreck.json 7ffa361bd8a108b504fe450749b42997dc898e5e data/hexcasting/loot_modifiers/scroll_stronghold_library.json +6b4459635b3d53cc2b6836fa97d29244a65b412d data/hexcasting/recipes/abacus.json 6e6e4d01097c10316892e274f33cb0faaf9dc0df data/hexcasting/recipes/artifact.json 27164ae64cf43091f25946cc15dfcace2c903b2b data/hexcasting/recipes/cypher.json 33fed8fb8e34df026e1eea0df8161c7f842a8648 data/hexcasting/recipes/dye_colorizer_black.json diff --git a/src/generated/resources/assets/hexcasting/models/item/abacus.json b/src/generated/resources/assets/hexcasting/models/item/abacus.json new file mode 100644 index 00000000..f6947c43 --- /dev/null +++ b/src/generated/resources/assets/hexcasting/models/item/abacus.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "hexcasting:item/abacus" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/hexcasting/advancements/recipes/hexcasting/abacus.json b/src/generated/resources/data/hexcasting/advancements/recipes/hexcasting/abacus.json new file mode 100644 index 00000000..2ee99b3d --- /dev/null +++ b/src/generated/resources/data/hexcasting/advancements/recipes/hexcasting/abacus.json @@ -0,0 +1,34 @@ +{ + "parent": "minecraft:recipes/root", + "rewards": { + "recipes": [ + "hexcasting:abacus" + ] + }, + "criteria": { + "has_item": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "items": [ + "hexcasting:wand" + ] + } + ] + } + }, + "has_the_recipe": { + "trigger": "minecraft:recipe_unlocked", + "conditions": { + "recipe": "hexcasting:abacus" + } + } + }, + "requirements": [ + [ + "has_item", + "has_the_recipe" + ] + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/hexcasting/recipes/abacus.json b/src/generated/resources/data/hexcasting/recipes/abacus.json new file mode 100644 index 00000000..f4a9095d --- /dev/null +++ b/src/generated/resources/data/hexcasting/recipes/abacus.json @@ -0,0 +1,22 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "WAW", + "SAS", + "WAW" + ], + "key": { + "S": { + "item": "minecraft:stick" + }, + "A": { + "item": "minecraft:amethyst_shard" + }, + "W": { + "tag": "minecraft:planks" + } + }, + "result": { + "item": "hexcasting:abacus" + } +} \ No newline at end of file diff --git a/src/main/java/at/petrak/hexcasting/client/ShiftScrollListener.java b/src/main/java/at/petrak/hexcasting/client/ShiftScrollListener.java index 78ce4acf..5825dd56 100644 --- a/src/main/java/at/petrak/hexcasting/client/ShiftScrollListener.java +++ b/src/main/java/at/petrak/hexcasting/client/ShiftScrollListener.java @@ -1,9 +1,10 @@ package at.petrak.hexcasting.client; -import at.petrak.hexcasting.common.items.ItemSpellbook; +import at.petrak.hexcasting.common.items.HexItems; import at.petrak.hexcasting.common.network.HexMessages; import at.petrak.hexcasting.common.network.MsgShiftScrollSyn; import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.screens.Screen; import net.minecraft.client.player.LocalPlayer; import net.minecraft.world.InteractionHand; import net.minecraft.world.item.Item; @@ -26,12 +27,13 @@ public class ShiftScrollListener { if (hand != null) { evt.setCanceled(true); - HexMessages.getNetwork().sendToServer(new MsgShiftScrollSyn(hand, evt.getScrollDelta())); + HexMessages.getNetwork().sendToServer(new MsgShiftScrollSyn(hand, evt.getScrollDelta(), + Screen.hasControlDown())); } } } private static boolean IsScrollableItem(Item item) { - return item instanceof ItemSpellbook; + return item == HexItems.SPELLBOOK.get() || item == HexItems.ABACUS.get(); } } diff --git a/src/main/java/at/petrak/hexcasting/client/gui/GuiSpellcasting.kt b/src/main/java/at/petrak/hexcasting/client/gui/GuiSpellcasting.kt index 96dd81d4..247af9c5 100644 --- a/src/main/java/at/petrak/hexcasting/client/gui/GuiSpellcasting.kt +++ b/src/main/java/at/petrak/hexcasting/client/gui/GuiSpellcasting.kt @@ -203,7 +203,7 @@ class GuiSpellcasting(private val handOpenedWith: InteractionHand) : Screen(Text val otherHand = HexUtils.OtherHand(this.handOpenedWith) if (Minecraft.getInstance().player!!.getItemInHand(otherHand).item is ItemSpellbook) - HexMessages.getNetwork().sendToServer(MsgShiftScrollSyn(otherHand, pDelta)) + HexMessages.getNetwork().sendToServer(MsgShiftScrollSyn(otherHand, pDelta, Screen.hasControlDown())) return true } diff --git a/src/main/java/at/petrak/hexcasting/common/items/HexItems.java b/src/main/java/at/petrak/hexcasting/common/items/HexItems.java index 0a5f76cc..041e306a 100644 --- a/src/main/java/at/petrak/hexcasting/common/items/HexItems.java +++ b/src/main/java/at/petrak/hexcasting/common/items/HexItems.java @@ -94,6 +94,8 @@ public class HexItems { public static final RegistryObject UUID_COLORIZER = ITEMS.register(HexItemNames.UUID_COLORIZER, () -> new Item(unstackable())); + public static final RegistryObject ABACUS = ITEMS.register(HexItemNames.ABACUS, + () -> new ItemAbacus(unstackable())); // BUFF SANDVICH public static final RegistryObject SUBMARINE_SANDWICH = ITEMS.register(HexItemNames.SUBMARINE_SANDWICH, diff --git a/src/main/java/at/petrak/hexcasting/common/items/ItemAbacus.java b/src/main/java/at/petrak/hexcasting/common/items/ItemAbacus.java new file mode 100644 index 00000000..f4953bec --- /dev/null +++ b/src/main/java/at/petrak/hexcasting/common/items/ItemAbacus.java @@ -0,0 +1,65 @@ +package at.petrak.hexcasting.common.items; + +import at.petrak.hexcasting.api.SpellDatum; +import at.petrak.hexcasting.common.lib.HexSounds; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.Tag; +import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.InteractionResultHolder; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.Level; +import org.jetbrains.annotations.Nullable; + +public class ItemAbacus extends ItemDataHolder { + public static final String TAG_VALUE = "value"; + + public ItemAbacus(Properties pProperties) { + super(pProperties); + } + + @Override + public @Nullable CompoundTag readDatumTag(ItemStack stack) { + double num; + var tag = stack.getTag(); + if (tag == null) { + num = 0d; + } else { + num = tag.getDouble(TAG_VALUE); + } + var datum = SpellDatum.make(num); + return datum.serializeToNBT(); + } + + @Override + public void writeDatum(CompoundTag tag, SpellDatum datum) { + // nope + } + + @Override + public InteractionResultHolder use(Level world, Player player, InteractionHand hand) { + var stack = player.getItemInHand(hand); + if (player.isShiftKeyDown()) { + + var tag = stack.getOrCreateTag(); + double oldNum = 0d; + if (tag.contains(TAG_VALUE, Tag.TAG_DOUBLE)) { + oldNum = tag.getDouble(TAG_VALUE); + } + tag.putDouble(TAG_VALUE, 0d); + + player.playSound(HexSounds.ABACUS_SHAKE.get(), 1f, 1f); + + var key = "hexcasting.tooltip.abacus.reset"; + if (oldNum == 69) { + key += ".nice"; + } + player.displayClientMessage(new TranslatableComponent(key), true); + + return InteractionResultHolder.sidedSuccess(stack, world.isClientSide); + } else { + return InteractionResultHolder.pass(stack); + } + } +} diff --git a/src/main/java/at/petrak/hexcasting/common/lib/HexItemNames.java b/src/main/java/at/petrak/hexcasting/common/lib/HexItemNames.java index 8dec9682..a26a503a 100644 --- a/src/main/java/at/petrak/hexcasting/common/lib/HexItemNames.java +++ b/src/main/java/at/petrak/hexcasting/common/lib/HexItemNames.java @@ -16,4 +16,5 @@ public class HexItemNames { public static final String DYE_COLORIZER_STUB = "dye_colorizer_"; public static final String PRIDE_COLORIZER_STUB = "pride_colorizer_"; public static final String UUID_COLORIZER = "uuid_colorizer"; + public static final String ABACUS = "abacus"; } diff --git a/src/main/java/at/petrak/hexcasting/common/lib/HexSounds.java b/src/main/java/at/petrak/hexcasting/common/lib/HexSounds.java index 030b96a6..2678aa1d 100644 --- a/src/main/java/at/petrak/hexcasting/common/lib/HexSounds.java +++ b/src/main/java/at/petrak/hexcasting/common/lib/HexSounds.java @@ -19,6 +19,8 @@ public class HexSounds { public static final RegistryObject FAIL_PATTERN = sound("casting.fail_pattern"); public static final RegistryObject CASTING_AMBIANCE = sound("casting.ambiance"); public static final RegistryObject ACTUALLY_CAST = sound("casting.cast"); + public static final RegistryObject ABACUS = sound("abacus"); + public static final RegistryObject ABACUS_SHAKE = sound("abacus.shake"); private static RegistryObject sound(String name) { return SOUNDS.register(name, () -> new SoundEvent(prefix(name))); diff --git a/src/main/java/at/petrak/hexcasting/common/network/MsgShiftScrollSyn.java b/src/main/java/at/petrak/hexcasting/common/network/MsgShiftScrollSyn.java index 3194403e..1219c43d 100644 --- a/src/main/java/at/petrak/hexcasting/common/network/MsgShiftScrollSyn.java +++ b/src/main/java/at/petrak/hexcasting/common/network/MsgShiftScrollSyn.java @@ -1,10 +1,15 @@ package at.petrak.hexcasting.common.network; +import at.petrak.hexcasting.api.SpellDatum; +import at.petrak.hexcasting.common.items.HexItems; +import at.petrak.hexcasting.common.items.ItemAbacus; import at.petrak.hexcasting.common.items.ItemSpellbook; +import at.petrak.hexcasting.common.lib.HexSounds; import io.netty.buffer.ByteBuf; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.chat.TranslatableComponent; import net.minecraft.server.level.ServerPlayer; +import net.minecraft.sounds.SoundSource; import net.minecraft.world.InteractionHand; import net.minecraft.world.item.ItemStack; import net.minecraftforge.network.NetworkEvent; @@ -15,18 +20,20 @@ import java.util.function.Supplier; * Sent client->server when the client shift+scrolls with a shift-scrollable item * or scrolls in the spellcasting UI. */ -public record MsgShiftScrollSyn(InteractionHand hand, double scrollDelta) { +public record MsgShiftScrollSyn(InteractionHand hand, double scrollDelta, boolean isCtrl) { public static MsgShiftScrollSyn deserialize(ByteBuf buffer) { var buf = new FriendlyByteBuf(buffer); var hand = InteractionHand.values()[buf.readInt()]; var scrollDelta = buf.readDouble(); - return new MsgShiftScrollSyn(hand, scrollDelta); + var isCtrl = buf.readBoolean(); + return new MsgShiftScrollSyn(hand, scrollDelta, isCtrl); } public void serialize(ByteBuf buffer) { var buf = new FriendlyByteBuf(buffer); buf.writeInt(this.hand.ordinal()); buf.writeDouble(this.scrollDelta); + buf.writeBoolean(this.isCtrl); } public void handle(Supplier ctx) { @@ -35,8 +42,10 @@ public record MsgShiftScrollSyn(InteractionHand hand, double scrollDelta) { if (sender != null) { var stack = sender.getItemInHand(hand); - if (stack.getItem() instanceof ItemSpellbook) { + if (stack.getItem() == HexItems.SPELLBOOK.get()) { spellbook(sender, stack); + } else if (stack.getItem() == HexItems.ABACUS.get()) { + abacus(sender, stack); } } }); @@ -49,6 +58,36 @@ public record MsgShiftScrollSyn(InteractionHand hand, double scrollDelta) { var newIdx = tag.getInt(ItemSpellbook.TAG_SELECTED_PAGE); var len = ItemSpellbook.HighestPage(tag.getCompound(ItemSpellbook.TAG_PAGES)); - sender.displayClientMessage(new TranslatableComponent("hexcasting.spellbook.tooltip.page", newIdx, len), true); + sender.displayClientMessage(new TranslatableComponent("hexcasting.tooltip.spellbook.page", newIdx, len), true); + } + + private void abacus(ServerPlayer sender, ItemStack stack) { + var increase = this.scrollDelta < 0; + var tag = stack.getTag(); + double num = 0d; + if (tag != null) { + num = tag.getDouble(ItemAbacus.TAG_VALUE); + } + + double delta; + float pitch; + if (this.hand == InteractionHand.MAIN_HAND) { + delta = this.isCtrl ? 10 : 1; + pitch = this.isCtrl ? 0.7f : 0.9f; + } else { + delta = this.isCtrl ? 0.01 : 0.1; + pitch = this.isCtrl ? 1.3f : 1.0f; + } + + num += delta * (increase ? 1 : -1); + stack.getOrCreateTag().putDouble(ItemAbacus.TAG_VALUE, num); + + pitch *= (increase ? 1.05f : 0.95f); + pitch += (Math.random() - 0.5) * 0.1; + sender.level.playSound(null, sender.getX(), sender.getY(), sender.getZ(), + HexSounds.ABACUS.get(), SoundSource.PLAYERS, 0.5f, pitch); + + var popup = SpellDatum.DisplayFromTag(HexItems.ABACUS.get().readDatumTag(stack)); + sender.displayClientMessage(new TranslatableComponent("hexcasting.tooltip.abacus", popup), true); } } diff --git a/src/main/java/at/petrak/hexcasting/datagen/ItemModels.java b/src/main/java/at/petrak/hexcasting/datagen/ItemModels.java index d04a2a24..f76b659d 100644 --- a/src/main/java/at/petrak/hexcasting/datagen/ItemModels.java +++ b/src/main/java/at/petrak/hexcasting/datagen/ItemModels.java @@ -27,6 +27,7 @@ public class ItemModels extends ItemModelProvider { simpleItem(HexItems.CHARGED_AMETHYST.get()); simpleItem(HexItems.SUBMARINE_SANDWICH.get()); simpleItem(HexItems.SCRYING_LENS.get()); + simpleItem(HexItems.ABACUS.get()); simpleItem(modLoc("scroll_pristine")); simpleItem(modLoc("scroll_ancient")); diff --git a/src/main/java/at/petrak/hexcasting/datagen/Recipes.java b/src/main/java/at/petrak/hexcasting/datagen/Recipes.java index 2cf0d7dc..052e2604 100644 --- a/src/main/java/at/petrak/hexcasting/datagen/Recipes.java +++ b/src/main/java/at/petrak/hexcasting/datagen/Recipes.java @@ -97,6 +97,15 @@ public class Recipes extends RecipeProvider { .pattern(" G ") .unlockedBy("has_item", has(HexItems.WAND.get())).save(recipes); + ShapedRecipeBuilder.shaped(HexItems.ABACUS.get()) + .define('S', Items.STICK) + .define('A', Items.AMETHYST_SHARD) + .define('W', ItemTags.PLANKS) + .pattern("WAW") + .pattern("SAS") + .pattern("WAW") + .unlockedBy("has_item", has(HexItems.WAND.get())).save(recipes); + // Why am I like this ShapedRecipeBuilder.shaped(HexItems.SUBMARINE_SANDWICH.get()) .define('S', Items.STICK) diff --git a/src/main/resources/assets/hexcasting/lang/en_us.json b/src/main/resources/assets/hexcasting/lang/en_us.json index b705591c..7fcf35e6 100644 --- a/src/main/resources/assets/hexcasting/lang/en_us.json +++ b/src/main/resources/assets/hexcasting/lang/en_us.json @@ -14,6 +14,7 @@ "item.hexcasting.scroll": "Scroll", "item.hexcasting.scroll.of": "Ancient Scroll of %s", "item.hexcasting.scroll.empty": "Empty Scroll", + "item.hexcasting.abacus": "Abacus", "item.hexcasting.sub_sandwich": "Submarine Sandwich", "item.hexcasting.dye_colorizer_white": "White Pigment", "item.hexcasting.dye_colorizer_orange": "Orange Pigment", @@ -49,16 +50,10 @@ "block.hexcasting.conjured": "Conjured Block", "itemGroup.hexcasting": "Hexcasting", - "hexcasting.subtitles.start_pattern": "Starting pattern", - "hexcasting.subtitles.add_line": "Adding line", - "hexcasting.subtitles.add_pattern": "Adding pattern", - "hexcasting.subtitles.fail_pattern": "Pattern fails", - "hexcasting.subtitles.ambiance": "Hex grid hums", - "hexcasting.subtitles.cast": "Hex casts", - - "hexcasting.landing": "I seem to have discovered a new method of magical arts, in which one draws patterns strange and wild onto a hexagonal grid. It fascinates me. I've decided to start a journal of my thoughts and findings.", - - "hexcasting.spellbook.tooltip.page": "§7Selected Page §a§l%d§7/§a§l%d§r", + "hexcasting.tooltip.spellbook.page": "§7Selected Page §a§l%d§7/§a§l%d§r", + "hexcasting.tooltip.abacus": "§a§l%d§r", + "hexcasting.tooltip.abacus.reset": "Reset to 0", + "hexcasting.tooltip.abacus.reset.nice": "nice", "hexcasting.spelldata.onitem": "§7Contains: §r%s", "hexcasting.spelldata.entity.whoknows": "An Entity (this should only show up if this was stored before the 0.5.0 update, use Scribe's Reflection, Scribe's Gambit to fix)", @@ -202,6 +197,17 @@ "hexcasting.spell.hexcasting:const/vec/ny": "Vector Reflection -Y", "hexcasting.spell.hexcasting:const/vec/nz": "Vector Reflection -Z", + "hexcasting.subtitles.start_pattern": "Starting pattern", + "hexcasting.subtitles.add_line": "Adding line", + "hexcasting.subtitles.add_pattern": "Adding pattern", + "hexcasting.subtitles.fail_pattern": "Pattern fails", + "hexcasting.subtitles.ambiance": "Hex grid hums", + "hexcasting.subtitles.cast": "Hex casts", + "hexcasting.subtitles.abacus": "Abacus clicks", + "hexcasting.subtitles.abacus.shake": "Abacus shakes", + + "hexcasting.landing": "I seem to have discovered a new method of magical arts, in which one draws patterns strange and wild onto a hexagonal grid. It fascinates me. I've decided to start a journal of my thoughts and findings.", + "hexcasting.entry.great_spells": "Great Spells", "hexcasting.page.great_spells1": "The spells catalogued here are purported to be of legendary difficulty and power. They seem to have been recorded only sparsely (for good reason, the texts claim). It's probably just the hogwash of extinct traditionalists, though-- a pattern's a pattern. What could possibly go wrong?", @@ -311,11 +317,19 @@ "hexcasting.page.amethyst4": "$(italic)The old man sighed and raised a hand toward the fire. He unlocked a part of his brain that held the memories of the mountains around them. He pulled the energies from those lands, as he learned to do in Terisia City with Drafna, Hurkyl, the archimandrite, and the other mages of the Ivory Towers. He concentrated, and the flames writhed as they rose from the logs, twisting upon themselves until they finally formed a soft smile./$", "hexcasting.entry.focus": "Focus", - "hexcasting.page.focus1": "A $(item)Focus/$ can store a single iota.$(br2)When I craft it, it holds the Null influence by default. Using the $(action)$(l:patterns/meta#OpWrite)Scribe's Gambit/$ while holding a $(item)Focus/$ in my other hand will remove the top of the stack and save it into the $(item)Focus/$. Using the $(action)$(l:patterns/meta#OpRead)Scribe's Reflection/$ will copy whatever iota's in the $(item)Focus/$ and add it to the stack.", + "hexcasting.page.focus1": "A $(item)Focus/$ can store a single iota.$(br2)When I craft it, it holds the Null influence by default. Using $(l:patterns/meta#hexcasting:write)$(action)Scribe's Gambit/$ while holding a $(item)Focus/$ in my other hand will remove the top of the stack and save it into the $(item)Focus/$. Using $(l:patterns/meta#hexcasting:read)$(action)Scribe's Reflection/$ will copy whatever iota's in the $(item)Focus/$ and add it to the stack.", "hexcasting.page.focus2": "$(italic)Poison apples, poison worms./$", "hexcasting.page.focus3": "It occurs to me that I could conceivably store a whole list of patterns in a $(item)Focus/$, then recall them and evaluate them with $(l:patterns/meta#OpEval)$(action)Hermes' Gambit/$. This way I can cast complex spells, or parts of spells, without having to draw them over and over.$(br2)I could use this like a slightly less convenient $(l:items/hexcasting#artifact)$(item)Artifact/$, but I think I could get much better dividends by putting common \"phrases\" in a $(item)Focus/$, like the patterns for figuring out where I'm looking.", - "hexcasting.page.focus4": "Also, if I store an entity in a $(item)Focus/$ and try to recall it after the referenced entity has died or otherwise disappeared, the $(action)Scribe's Reflection/$ will add Null to the stack instead.", - "hexcasting.page.focus5": "Finally, it seems if I wish to protect a focus from accidentally being overwritten, I can seal it with wax by crafting it with a $(item)Honeycomb/$. Attempting to use $(action)Scribe's Gambit/$ on a sealed focus will fail.", + "hexcasting.page.focus4": "Also, if I store an entity in a $(item)Focus/$ and try to recall it after the referenced entity has died or otherwise disappeared, the $(action)Scribe's Reflection/$ will add Null to the stack instead.$(br2)Finally, it seems if I wish to protect a focus from accidentally being overwritten, I can seal it with wax by crafting it with a $(item)Honeycomb/$. Attempting to use $(action)Scribe's Gambit/$ on a sealed focus will fail.", + + "hexcasting.entry.abacus": "Abacus", + "hexcasting.page.abacus1": "Although there are $(l:patterns/numbers)$(action)patterns for drawing numbers/$, I find them ... cumbersome, to say the least.$(br2)Fortunately, the old masters of my craft invented an ingenious device called an $(item)Abacus/$ to provide numbers to my casting. I simply set the number to what I want, then read the value using $(l:patterns/meta#hexcasting:read)$(action)Scribe's Reflection/$, just like I would read a $(item)Focus/$.", + "hexcasting.page.abacus2": "To operate one, I simply hold it, sneak, and scroll. If in my main hand, the number will increment or decrement by 1, or 10 if I am also holding Control/Command. If in my off hand, the number will increment or decrement by 0.1, or 0.001 if I am also holding Control/Command.$(br2)I can shake the abacus to reset it to zero by sneak-right-clicking.", + "hexcasting.page.abacus3": "$(italic)Mathematics? That's for eggheads!/$", + + "hexcasting.entry.spellbook": "Spellbook", + "hexcasting.page.spellbook1": "A $(item)Spellbook/$ is the culmination of my art-- it acts like an entire library of $(l:items/focus)$(item)Foci/$.$(br2)Each page can hold a single iota, and I can select the active page (the page that iotas are saved to and copied from) by sneak-scrolling while holding it, or simply holding it in my off-hand and scrolling while casting a _Hex.", + "hexcasting.page.spellbook2": "$(italic)Wizards love words. Most of them read a great deal, and indeed one strong sign of a potential wizard is the inability to get to sleep without reading something first.", "hexcasting.entry.hexcasting": "Hexcasting Items", "hexcasting.page.hexcasting1": "Although the flexibility that casting _Hexes \"on the go\" with my $(l:items/staff)$(item)Staff/$ is quite helpful, it's a huge pain to have to wave it around repeatedly just to accomplish a common task. If I could save a common spell for later reuse, it would simplify things a lot-- and allow me to share my _Hexes with friends, too.", @@ -342,9 +356,6 @@ "hexcasting.page.pigments3": "Pigments all the colors of the rainbow.", "hexcasting.page.pigments4": "And finally, a pigment with a color wholly unique to me.$(br2)$(italic)And all the colors I am inside have not been invented yet./$", - "hexcasting.entry.spellbook": "Spellbook", - "hexcasting.page.spellbook1": "A $(item)Spellbook/$ is the culmination of my art-- it acts like an entire library of $(l:items/focus)$(item)Foci/$.$(br2)Each page can hold a single iota, and I can select the active page (the page that iotas are saved to and copied from) by sneak-scrolling while holding it, or simply holding it in my off-hand and scrolling while casting a _Hex.", - "hexcasting.page.spellbook2": "$(italic)Wizards love words. Most of them read a great deal, and indeed one strong sign of a potential wizard is the inability to get to sleep without reading something first.", "hexcasting.entry.staff": "Staff", "hexcasting.page.staff1": "A $(item)Staff/$ is my entry point into casting all _Hexes, large and small. By holding it and pressing $(thing)$(k:use)/$, I begin casting a _Hex; then I can click and drag to draw patterns.$(br2)It's little more than a chunk of _media on the end of a stick; that's all that's needed, after all.", @@ -468,7 +479,7 @@ "hexcasting.page.lists7": "Remove the list at the top of the stack, then push the number of elements in the list to the stack.", "hexcasting.page.lists8": "Reverse the list at the top of the stack.", - "hexcasting.entry.math": "Math", + "hexcasting.entry.math": "Mathematics", "hexcasting.page.math1": "Many mathematical operations function on both numbers and vectors. Such arguments are written as \"num/vec\".", "hexcasting.page.math2": "Perform addition.", "hexcasting.page.math3": "As such:$(li)With two numbers at the top of the stack, combines them into their sum.$(li)With a number and a vector, removes the number from the stack and adds it to each element of the vector.$(li)With two vectors, combines them by summing corresponding components into a new vector (i.e. [1, 2, 3] + [0, 4, -1] = [1, 6, 2]).", @@ -518,6 +529,7 @@ "hexcasting.page.numbers5": "This pattern pushes -32: negate 1 + 5 + 10 * 2.", "hexcasting.page.numbers6header": "Example 4", "hexcasting.page.numbers6": "This pattern pushes 4.5: 5 / 2 + 1 + 1.", + "hexcasting.page.numbers7": "It might be easier to just use an $(l:items/abacus)$(item)Abacus/$.", "hexcasting.entry.readers_guide": "How to Read this Section", "hexcasting.page.readers_guide1": "I've divided all the valid patterns I've found into sections based on what they do, more or less. I've written down the stroke order of the patterns as well, if I managed to find it in my studies, with the start of the pattern marked with a red dot.$(br2)If an action is cast by multiple patterns, as is the case with some simple actions, I'll write them all side-by-side.", diff --git a/src/main/resources/assets/hexcasting/sounds.json b/src/main/resources/assets/hexcasting/sounds.json index a5e45412..250ddc02 100644 --- a/src/main/resources/assets/hexcasting/sounds.json +++ b/src/main/resources/assets/hexcasting/sounds.json @@ -48,5 +48,19 @@ "sounds": [ "hexcasting:cast_hex" ] + }, + "abacus": { + "subtitle": "hexcasting.subtitles.abacus", + "sounds": [ + "hexcasting:abacus1", + "hexcasting:abacus2", + "hexcasting:abacus3" + ] + }, + "abacus.shake": { + "subtitle": "hexcasting.subtitles.abacus.shake", + "sounds": [ + "hexcasting:abacus_shake" + ] } } \ No newline at end of file diff --git a/src/main/resources/assets/hexcasting/sounds/abacus1.ogg b/src/main/resources/assets/hexcasting/sounds/abacus1.ogg new file mode 100644 index 00000000..a9a9c04f Binary files /dev/null and b/src/main/resources/assets/hexcasting/sounds/abacus1.ogg differ diff --git a/src/main/resources/assets/hexcasting/sounds/abacus2.ogg b/src/main/resources/assets/hexcasting/sounds/abacus2.ogg new file mode 100644 index 00000000..42b0dd76 Binary files /dev/null and b/src/main/resources/assets/hexcasting/sounds/abacus2.ogg differ diff --git a/src/main/resources/assets/hexcasting/sounds/abacus3.ogg b/src/main/resources/assets/hexcasting/sounds/abacus3.ogg new file mode 100644 index 00000000..b83de311 Binary files /dev/null and b/src/main/resources/assets/hexcasting/sounds/abacus3.ogg differ diff --git a/src/main/resources/assets/hexcasting/sounds/abacus_shake.ogg b/src/main/resources/assets/hexcasting/sounds/abacus_shake.ogg new file mode 100644 index 00000000..6e40a78f Binary files /dev/null and b/src/main/resources/assets/hexcasting/sounds/abacus_shake.ogg differ diff --git a/src/main/resources/assets/hexcasting/textures/item/abacus.png b/src/main/resources/assets/hexcasting/textures/item/abacus.png new file mode 100644 index 00000000..7bf65c0e Binary files /dev/null and b/src/main/resources/assets/hexcasting/textures/item/abacus.png differ diff --git a/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/items/abacus.json b/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/items/abacus.json new file mode 100644 index 00000000..0018c353 --- /dev/null +++ b/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/items/abacus.json @@ -0,0 +1,22 @@ +{ + "name": "hexcasting.entry.abacus", + "category": "hexcasting:items", + "icon": "hexcasting:abacus", + "sortnum": 3, + "advancement": "hexcasting:root", + "pages": [ + { + "type": "patchouli:text", + "text": "hexcasting.page.abacus1" + }, + { + "type": "patchouli:text", + "text": "hexcasting.page.abacus2" + }, + { + "type": "patchouli:crafting", + "recipe": "hexcasting:abacus", + "text": "hexcasting.page.abacus3" + } + ] +} diff --git a/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/items/focus.json b/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/items/focus.json index b8de8af9..93da1960 100644 --- a/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/items/focus.json +++ b/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/items/focus.json @@ -21,10 +21,6 @@ { "type": "patchouli:text", "text": "hexcasting.page.focus4" - }, - { - "type": "patchouli:text", - "text": "hexcasting.page.focus5" } ] } diff --git a/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/items/hexcasting.json b/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/items/hexcasting.json index e503fbb8..f6fa7353 100644 --- a/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/items/hexcasting.json +++ b/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/items/hexcasting.json @@ -1,41 +1,41 @@ { - "name": "hexcasting.entry.hexcasting", - "category": "hexcasting:items", - "icon": "hexcasting:artifact{patterns:[]}", - "sortnum": 4, - "advancement": "hexcasting:root", - "pages": [ - { - "type": "patchouli:text", - "text": "hexcasting.page.hexcasting1" - }, - { - "type": "patchouli:text", - "text": "hexcasting.page.hexcasting2" - }, - { - "type": "patchouli:text", - "text": "hexcasting.page.hexcasting3" - }, - { - "type": "patchouli:text", - "text": "hexcasting.page.hexcasting4" - }, - { - "type": "patchouli:text", - "text": "hexcasting.page.hexcasting5" - }, - { - "type": "patchouli:crafting", - "anchor": "cypher_trinket", - "recipe": "hexcasting:cypher", - "recipe2": "hexcasting:trinket" - }, - { - "type": "patchouli:crafting", - "anchor": "artifact", - "recipe": "hexcasting:artifact", - "text": "hexcasting.page.hexcasting6" - } - ] + "name": "hexcasting.entry.hexcasting", + "category": "hexcasting:items", + "icon": "hexcasting:artifact{patterns:[]}", + "sortnum": 5, + "advancement": "hexcasting:root", + "pages": [ + { + "type": "patchouli:text", + "text": "hexcasting.page.hexcasting1" + }, + { + "type": "patchouli:text", + "text": "hexcasting.page.hexcasting2" + }, + { + "type": "patchouli:text", + "text": "hexcasting.page.hexcasting3" + }, + { + "type": "patchouli:text", + "text": "hexcasting.page.hexcasting4" + }, + { + "type": "patchouli:text", + "text": "hexcasting.page.hexcasting5" + }, + { + "type": "patchouli:crafting", + "anchor": "cypher_trinket", + "recipe": "hexcasting:cypher", + "recipe2": "hexcasting:trinket" + }, + { + "type": "patchouli:crafting", + "anchor": "artifact", + "recipe": "hexcasting:artifact", + "text": "hexcasting.page.hexcasting6" + } + ] } diff --git a/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/items/phials.json b/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/items/phials.json index 3d2e722e..d50938dc 100644 --- a/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/items/phials.json +++ b/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/items/phials.json @@ -2,7 +2,7 @@ "name": "hexcasting.entry.phials", "category": "hexcasting:items", "icon": "hexcasting:battery{mana:10000,max_mana:10000}", - "sortnum": 5, + "sortnum": 6, "advancement": "hexcasting:root", "read_by_default": true, "pages": [ diff --git a/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/items/pigments.json b/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/items/pigments.json index 74ebd529..a1bb8c22 100644 --- a/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/items/pigments.json +++ b/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/items/pigments.json @@ -2,7 +2,7 @@ "name": "hexcasting.entry.pigments", "category": "hexcasting:items", "icon": "hexcasting:uuid_colorizer", - "sortnum": 6, + "sortnum": 7, "advancement": "hexcasting:root", "read_by_default": true, "pages": [ diff --git a/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/items/spellbook.json b/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/items/spellbook.json index b586f435..ae823873 100644 --- a/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/items/spellbook.json +++ b/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/items/spellbook.json @@ -1,18 +1,18 @@ { - "name": "hexcasting.entry.spellbook", - "category": "hexcasting:items", - "icon": "hexcasting:spellbook", - "sortnum": 3, - "advancement": "hexcasting:root", - "pages": [ - { - "type": "patchouli:text", - "text": "hexcasting.page.spellbook1" - }, - { - "type": "patchouli:crafting", - "recipe": "hexcasting:spellbook", - "text": "hexcasting.page.spellbook2" - } - ] + "name": "hexcasting.entry.spellbook", + "category": "hexcasting:items", + "icon": "hexcasting:spellbook", + "sortnum": 4, + "advancement": "hexcasting:root", + "pages": [ + { + "type": "patchouli:text", + "text": "hexcasting.page.spellbook1" + }, + { + "type": "patchouli:crafting", + "recipe": "hexcasting:spellbook", + "text": "hexcasting.page.spellbook2" + } + ] } diff --git a/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/patterns/numbers.json b/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/patterns/numbers.json index 3dee246e..9fac0aef 100644 --- a/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/patterns/numbers.json +++ b/src/main/resources/data/hexcasting/patchouli_books/thehexbook/en_us/entries/patterns/numbers.json @@ -10,10 +10,10 @@ "type": "hexcasting:manual_pattern", "header": "hexcasting.page.numbers1header", "anchor": "Numbers", - "input": "hexcasting.page.numbers1", + "input": "", "output": "number", "args": "-> number", - "text": "", + "text": "hexcasting.page.numbers1", "patterns": [ { "startdir": "SOUTH_EAST", @@ -64,6 +64,10 @@ "startdir": "SOUTH_EAST", "signature": "aqaaqdww" } + }, + { + "type": "patchouli:text", + "text": "hexcasting.page.numbers7" } ] }