Skip to content

Commit

Permalink
Merge branch 'main' into ignite-spell-tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
miyucomics authored Sep 21, 2024
2 parents 67d0137 + 16b2cfd commit 71c5b1d
Show file tree
Hide file tree
Showing 15 changed files with 131 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,13 @@ public interface ClientConfigAccess {

double gridSnapThreshold();

boolean clickingTogglesDrawing();

boolean DEFAULT_CTRL_TOGGLES_OFF_STROKE_ORDER = false;
boolean DEFAULT_INVERT_SPELLBOOK_SCROLL = false;
boolean DEFAULT_INVERT_ABACUS_SCROLL = false;
double DEFAULT_GRID_SNAP_THRESHOLD = 0.5;
boolean DEFAULT_CLICKING_TOGGLES_DRAWING = false;
}

public interface ServerConfigAccess {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,16 @@ class GuiSpellcasting constructor(
if (super.mouseClicked(mxOut, myOut, pButton)) {
return true
}
if (HexConfig.client().clickingTogglesDrawing()) {
return if (this.drawState is PatternDrawState.BetweenPatterns)
drawStart(mxOut, myOut)
else
drawEnd()
}
return drawStart(mxOut, myOut)
}

private fun drawStart(mxOut: Double, myOut: Double): Boolean {
val mx = Mth.clamp(mxOut, 0.0, this.width.toDouble())
val my = Mth.clamp(myOut, 0.0, this.height.toDouble())
if (this.drawState is PatternDrawState.BetweenPatterns) {
Expand All @@ -156,11 +165,23 @@ class GuiSpellcasting constructor(
return false
}

override fun mouseMoved(mxOut: Double, myOut: Double) {
super.mouseMoved(mxOut, myOut)

if (HexConfig.client().clickingTogglesDrawing() && this.drawState !is PatternDrawState.BetweenPatterns)
drawMove(mxOut, myOut)
}

override fun mouseDragged(mxOut: Double, myOut: Double, pButton: Int, pDragX: Double, pDragY: Double): Boolean {
if (super.mouseDragged(mxOut, myOut, pButton, pDragX, pDragY)) {
return true
}
if (HexConfig.client().clickingTogglesDrawing())
return false
return drawMove(mxOut, myOut)
}

private fun drawMove(mxOut: Double, myOut: Double): Boolean {
val mx = Mth.clamp(mxOut, 0.0, this.width.toDouble())
val my = Mth.clamp(myOut, 0.0, this.height.toDouble())

Expand Down Expand Up @@ -237,7 +258,12 @@ class GuiSpellcasting constructor(
if (super.mouseReleased(mx, my, pButton)) {
return true
}
if (HexConfig.client().clickingTogglesDrawing())
return false
return drawEnd()
}

private fun drawEnd(): Boolean {
when (this.drawState) {
PatternDrawState.BetweenPatterns -> {}
is PatternDrawState.JustStarted -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,10 @@
"": "Grid Snap Threshold",
"@Tooltip": "When using a staff, the distance from one dot you have to go to snap to the next dot, where 0.5 means 50% of the way (0.5-1)",
},
clickingTogglesDrawing: {
"": "Clicking Toggles Drawing",
"@Tooltip": "Whether you click to start and stop drawing instead of clicking and dragging to draw",
},
},

server: {
Expand Down Expand Up @@ -604,7 +608,7 @@
},

append: "Integration Distillation",
unappend: "Derivation Distillation",
unappend: "Derivation Decomposition",
index: "Selection Distillation",
singleton: "Single's Purification",
empty_list: "Vacant Reflection",
Expand Down Expand Up @@ -731,7 +735,9 @@
bonemeal: "Overgrow",
edify: "Edify Sapling",
colorize: "Internalize Pigment",


cycle_variant: "Caster's Glamour",

"sentinel/": {
create: "Summon Sentinel",
"create/great": "Summon Greater Sentinel",
Expand Down Expand Up @@ -1058,7 +1064,7 @@
great_spells: {
"": "Great Spells",
desc: "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). \
They seem to have been recorded only $(l:items/scroll)sparsely/$ (for good reason, the texts claim). \
It's probably just the ramblings of extinct traditionalists, though -- a pattern's a pattern.$(br2)\
What could possibly go wrong?",
},
Expand Down Expand Up @@ -1495,7 +1501,7 @@
empty_impetus: "First, the cradle. Although it does not work as an $(l:greatwork/impetus)$(item)Impetus/$, the flow of _media in a circle will only exit out the side pointed to by the arrows. This allows me to change the plane in which the wave flows, for example.",
impetus_rightclick: "Then, to transpose the mind. Villagers of different professions will lend different actuation conditions to the resulting $(l:greatwork/impetus)$(item)Impetus/$. A $(l:greatwork/impetus)$(item)Toolsmith Impetus/$ activates on a simple $(k:use).",
impetus_storedplayer: {
"1": "A $(l:greatwork/impetus)$(item)Cleric Impetus/$ must be bound to a player by using an item with a reference to that player, like a $(l:items/focus)$(item)Focus/$, on the block. Then, it activates when receiving a redstone signal.",
"1": "A $(l:greatwork/impetus)$(item)Cleric Impetus/$ activates when receiving a redstone signal. It may be bound to a player by using an item with a reference to that player, like a $(l:items/focus)$(item)Focus/$, on the block.",
"2": "Peculiarly to this $(l:greatwork/impetus)$(item)Impetus/$, the bound player, as well as a small region around them, are always accessible to the spell circle. It's as if they were standing within the bounds of the circle, no matter how far away they might stand.$(br2)The bound player is shown when looking at a $(l:greatwork/impetus)$(item)Cleric Impetus/$ through a $(l:items/lens)$(item)Scrying Lens/$.",
},
impetus_look: "A $(l:greatwork/impetus)$(item)Fletcher Impetus/$ activates when looked at for a short time.",
Expand All @@ -1520,7 +1526,7 @@
"1": "THEY ARE BITS OF MEDIA. How did I not see it sooner? They are -- as I am a heap of flesh with a scrap, blessed with a scrap of thought, an Allay is a self-sustaining quarrel of media pinned to a scrap of flesh. It explains everything -- their propensity for media, their response to music, I SEE NOW, HOW did the ones before NOT?",
"2": "And given this it is only RIGHT I conquer their peculiar minds -- their peculiar selves -- that is all they are, a mind, a self, a coda. Something about their phase speaks to me. I can... I can compress _media with them, overlay two wends of thought in one space, physical and cognitive, all and once.$(br2)Somehow, the process produces _media of its own. How? Perhaps -- perhaps MY work, the process of doing it --",
"3": "It matters not. I matter not. They matter not, all that matters is what it does. And this is it.$(br2)It must hurt so very much.",
"4": "The product is fragile. Breaking it shatters it into pieces, with $(thing)Fortune/$ increasing the yield... if I wish the block itself I need a silken touch.$(br2)The produced shards are worth thrice an $(l:items/amethyst)$(item)Charged Amethyst Crystal/$ apiece. The block itself is worth four of the shards.",
"4": "The product is fragile. Breaking it shatters it into pieces, with $(thing)Fortune/$ increasing the yield... if I wish the block itself I need a silken touch.$(br2)The produced shards are worth thrice a $(l:items/amethyst)$(item)Charged Amethyst Crystal/$ apiece. The block itself is worth four of the shards.",
"5": "They are mercurial, they seem to twist and wink under my fingers, and by giving them a mentor in another form of _media they may be coerced into its shape, in an equivalent exchange of _media.",
},

Expand Down Expand Up @@ -1597,8 +1603,8 @@

floor: "\"Floors\" a number, cutting off the fractional component and leaving an integer value. If passed a vector, instead floors each of its components.",
ceil: "\"Ceilings\" a number, raising it to the next integer value if it has a fractional component. If passed a vector, instead ceils each of its components.",
construct_vec: "Combine three numbers at the top of the stack into a vector's X, Y, and Z components (top to bottom).",
deconstruct_vec: "Split a vector into its X, Y, and Z components (top to bottom).",
construct_vec: "Combine three numbers at the top of the stack into a vector's X, Y, and Z components (bottom to top).",
deconstruct_vec: "Split a vector into its X, Y, and Z components (bottom to top).",
modulo: "Takes the modulus of two numbers. This is the amount $(italics)remaining/$ after division - for example, 5 %% 2 is 1, and 5 %% 3 is 2. When applied on vectors, performs the above operation elementwise.",
coerce_axial: "For a vector, coerce it to its nearest axial direction, a unit vector. For a number, return the sign of the number; 1 if positive, -1 if negative. In both cases, zero is unaffected.",
random: "Creates a random number between 0 and 1.",
Expand Down Expand Up @@ -1679,7 +1685,7 @@
},

logic: {
bool_coerce: "Convert an argument to a boolean. The number $(thing)0/$, $(l:casting/influences)$(thing)Null/$, and the empty list become False; everything else becomes True.",
bool_coerce: "Convert an argument to a boolean. The number $(thing)0/$, $(l:casting/influences)$(thing)Null/$, False, and the empty list become False; everything else becomes True.",
bool_to_number: "Convert a boolean to a number; True becomes $(thing)1/$, and False becomes $(thing)0/$.",
not: "If the argument is True, return False; if it is False, return True.",
or: "Returns True if at least one of the arguments are True; otherwise returns False.",
Expand Down Expand Up @@ -1750,11 +1756,11 @@
"2": "If I draw another $(l:patterns/patterns_as_iotas#hexcasting:close_paren)$(action)Introspection/$, it'll still be saved to the list, but I'll then have to draw $(italic)two/$ $(l:patterns/patterns_as_iotas#hexcasting:close_paren)$(action)Retrospections/$ to get back to normal casting.",
"3": "Also, I can escape the special behavior of $(l:patterns/patterns_as_iotas#hexcasting:open_paren)$(action)Intro-/$ and $(l:patterns/patterns_as_iotas#hexcasting:close_paren)$(action)Retrospection/$ by drawing a $(l:patterns/patterns_as_iotas#hexcasting:escape)$(action)Consideration/$ before them, which will simply add them to the list without affecting which the number of $(l:patterns/patterns_as_iotas#hexcasting:close_paren)$(action)Retrospections/$ I need to return to casting.$(br2)If I draw two $(l:patterns/patterns_as_iotas#hexcasting:escape)$(action)Considerations/$ in a row while $(l:patterns/patterns_as_iotas#hexcasting:open_paren)$(action)introspecting/$, it will add a single $(l:patterns/patterns_as_iotas#hexcasting:escape)$(action)Consideration/$ to the list.",
},
undo: "Finally, if I make a mistake while drawning patterns inside $(l:patterns/patterns_as_iotas#hexcasting:open_paren)$(action)Intro-/$ and $(l:patterns/patterns_as_iotas#hexcasting:close_paren)$(action)Retrospection/$ I can draw $(l:patterns/patterns_as_iotas#hexcasting:undo)$(action)Evanition/$ to remove the last pattern that I drew from the pattern list that is being constructed.",
undo: "Finally, if I make a mistake while drawing patterns inside $(l:patterns/patterns_as_iotas#hexcasting:open_paren)$(action)Intro-/$ and $(l:patterns/patterns_as_iotas#hexcasting:close_paren)$(action)Retrospection/$ I can draw $(l:patterns/patterns_as_iotas#hexcasting:undo)$(action)Evanition/$ to remove the last pattern that I drew from the pattern list that is being constructed.",
},

readwrite: {
"1": "This section deals with the storage of $(thing)Iotas/$ in a more permanent medium. Nearly any iota can be stored to a suitable item, such as a $(l:items/focus)$(item)Focus/$ or $(l:items/spellbook)$(item)Spellbook/$), and read back later. Certain items, such as an $(l:items/abacus)$(item)Abacus/$, can only be read from.$(br2)Iotas are usually read and written from the other hand, but it is also possible to read and write with an item when it is sitting on the ground as an item entity, or when in an item frame.",
"1": "This section deals with the storage of $(thing)Iotas/$ in a more permanent medium. Nearly any iota can be stored to a suitable item, such as a $(l:items/focus)$(item)Focus/$ or $(l:items/spellbook)$(item)Spellbook/$, and read back later. Certain items, such as an $(l:items/abacus)$(item)Abacus/$, can only be read from.$(br2)Iotas are usually read and written from the other hand, but it is also possible to read and write with an item when it is sitting on the ground as an item entity, or when in an item frame.",
"2": "There may be other entities I can interact with in this way. For example, a $(l:items/scroll)$(item)Scroll/$ hung on the wall can have its pattern read off of it.$(br2)However, it seems I am unable to save a reference to another player, only me. I suppose an entity reference is similar to the idea of a True Name; perhaps Nature is helping to keep our Names out of the hands of enemies. If I want a friend to have my Name I can make a $(l:items/focus)$(item)Focus/$ for them.",
read: "Copy the iota stored in the item in my other hand and add it to the stack.",
write: "Remove the top iota from the stack, and save it into the item in my other hand.",
Expand Down Expand Up @@ -1871,6 +1877,8 @@

colorize: "I must be holding a $(l:items/pigments)$(item)Pigment/$ in my other hand to cast this spell. When I do, it will consume the dye and permanently change my mind's coloration (at least, until I cast the spell again). Costs about one $(l:items/amethyst)$(item)Amethyst Dust/$.",

cycle_variant: "Certain items I create seem oddly receptive to the influence of _media. By holding a $(l:items/hexcasting)$(item)Cypher/$, $(l:items/hexcasting)$(item)Trinket/$, $(l:items/hexcasting)$(item)Artifact/$, $(l:items/focus)$(item)Focus/$, or $(l:items/spellbook)$(item)Spellbook/$ in my other hand, I can use this spell to change the appearance of the item. Costs about one $(l:items/amethyst)$(item)Amethyst Dust/$.",

flights: {
"1": "Although it seems that true, limitless flight is out of my grasp, I have nonetheless found some methods of holding one in the sky, each with their respective drawbacks.$(br2)All forms produce a shimmer of excess _media; as the spell gets closer to ending, the sparks are shot through with more red and black.",
"2": "Other forms of flight do exist, of course. For example, a combination of $(l:patterns/spells/basic#hexcasting:add_motion)$(action)Impulse/$ and $(l:patterns/spells/nadirs#hexcasting:potion/levitation)$(action)Blue Sun's Nadir/$ has been used since antiquity for a flight of sorts.$(br2)I've also heard tell of a thin membrane worn on the back that allows the ability to glide. From my research, I believe the Great spell $(l:patterns/great_spells/altiora)$(action)Altiora/$ may be used to mimic it.",
Expand Down Expand Up @@ -1900,7 +1908,7 @@

"teleport/great": {
"1": "Far more powerful than $(l:patterns/spells/basic#hexcasting:blink)$(action)Blink/$, this spell lets me teleport nearly anywhere in the entire world! There does seem to be a limit, but it is $(italic)much/$ greater than the normal radius of influence I am used to.",
"2": "The entity will be teleported by the given vector, which is an offset from its given position. No matter the distance, it always seems to cost about ten $(l:items/amethyst)$(item)Charged Amethyst/$.$(br2)The transference is not perfect, and it seems when teleporting something as complex as a player, their inventory doesn't $(italic)quite/$ stay attached, and tends to splatter everywhere at the destination. In addition, the target will be forcibly removed from anything inanimate they are riding or sitting on ... but I've read scraps that suggest animals can come along for the ride, so to speak.",
"2": "The entity will be teleported by the given vector. Curiously, this vector seems to be an offset, not an absolute position in the world; for example, if I use $(l:patterns/consts#hexcasting:const/vec/x)$(action)Vector Reflection +X/$, the entity will end up precisely one block east of its original position. No matter the distance, it always seems to cost about ten $(l:items/amethyst)$(item)Charged Amethyst/$.$(br2)The transference is not perfect, and it seems when teleporting something as complex as a player, their inventory doesn't $(italic)quite/$ stay attached, and tends to splatter everywhere at the destination. In addition, the target will be forcibly removed from anything inanimate they are riding or sitting on ... but I've read scraps that suggest animals can come along for the ride, so to speak.",
},

zeniths: {
Expand Down Expand Up @@ -2024,7 +2032,7 @@
"3": "Finally, if I find myself interested in the lore and stories of this world, I do not think any notes compiled while examining these interoperations should be considered as anything more than light trifles.",

gravity: {
"1": "I have discovered actions to get and set an entity's gravity. I find them interesting, if slightly nauseating.$(br2)Interestingly, although $(l:patterns/great_spells/flight)$(action)Flight/$ is a great spell, and manipulates gravity similarly, these are not. It baffles me why... Perhaps the mod developer wanted players to have fun, for once.",
"1": "I have discovered actions to get and set an entity's gravity. I find them interesting, if slightly nauseating.$(br2)Interestingly, although the $(l:patterns/spells/flight)$(action)Flight/$ spells are limited in range or duration, and manipulate gravity similarly, these are not. It baffles me why... Perhaps the mod developer wanted players to have fun, for once.",
get: "Get the main direction gravity pulls the given entity in, as a unit vector. For most entities, this will be down, <0, -1, 0>.",
set: "Set the main direction gravity pulls the given entity in. The given vector will be coerced into the nearest axis, as per $(l:patterns/math#hexcasting:coerce_axial)$(action)Axial Purification/$. Costs about one $(l:items/amethyst)$(item)Charged Amethyst/$.",
},
Expand Down
Loading

0 comments on commit 71c5b1d

Please sign in to comment.