fix up documentation

This commit is contained in:
gamma-delta 2022-04-08 19:16:28 -05:00
parent a3c1abf65e
commit 8b3d3e62fa
6 changed files with 62 additions and 54 deletions

View file

@ -71,7 +71,6 @@ public class RegisterPatterns {
// == Modify Stack ==
// PatternRegistry.mapPattern(HexPattern.FromAnglesSig("a", HexDir.EAST), prefix("undo"), OpUndo.INSTANCE);
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("d", HexDir.EAST), prefix("const/null"), Widget.NULL);
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("aadaa", HexDir.EAST), prefix("duplicate"),
OpDuplicate.INSTANCE);
@ -110,9 +109,9 @@ public class RegisterPatterns {
new OpCompare((a, b) -> a > b));
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("q", HexDir.SOUTH_WEST), prefix("less"),
new OpCompare((a, b) -> a < b));
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("ea", HexDir.SOUTH_EAST), prefix("greater_eq"),
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("ee", HexDir.SOUTH_EAST), prefix("greater_eq"),
new OpCompare((a, b) -> a >= b));
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("qd", HexDir.SOUTH_WEST), prefix("less_eq"),
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("qq", HexDir.SOUTH_WEST), prefix("less_eq"),
new OpCompare((a, b) -> a <= b));
PatternRegistry.mapPattern(HexPattern.FromAnglesSig("ad", HexDir.EAST), prefix("equals"),
new OpCompare((a, b) -> Math.abs(a - b) < 0.0001));
@ -391,9 +390,8 @@ public class RegisterPatterns {
return null;
}
});
// and swizzles
PatternRegistry.addSpecialHandler(prefix("swizzle"), pat -> {
PatternRegistry.addSpecialHandler(prefix("mask"), pat -> {
var directions = pat.directions();
HexDir flatDir;
@ -427,7 +425,7 @@ public class RegisterPatterns {
return null;
}
return new OpSwizzle(mask);
return new OpMask(mask);
});
}
}

View file

@ -5,7 +5,7 @@ import at.petrak.hexcasting.api.spell.SpellDatum
import at.petrak.hexcasting.common.casting.CastingContext
import it.unimi.dsi.fastutil.booleans.BooleanList
class OpSwizzle(val mask: BooleanList) : ConstManaOperator {
class OpMask(val mask: BooleanList) : ConstManaOperator {
override val argc: Int
get() = mask.size

View file

@ -1,13 +0,0 @@
package at.petrak.hexcasting.common.casting.operators
import at.petrak.hexcasting.api.spell.ConstManaOperator
import at.petrak.hexcasting.api.spell.SpellDatum
import at.petrak.hexcasting.common.casting.CastingContext
object OpUndo : ConstManaOperator {
override val argc = 1
// Do literally nothing!
override fun execute(args: List<SpellDatum<*>>, ctx: CastingContext): List<SpellDatum<*>> =
emptyList()
}

View file

@ -172,6 +172,7 @@
"hexcasting.spell.hexcasting:undo": "Novice's Gambit",
"hexcasting.spell.hexcasting:const/null": "Nullary Reflection",
"hexcasting.spell.hexcasting:duplicate": "Gemini Decomposition",
"hexcasting.spell.hexcasting:duplicate_n": "Gemini Gambit",
"hexcasting.spell.hexcasting:swap": "Jester's Gambit",
"hexcasting.spell.hexcasting:fisherman": "Fisherman's Gambit",
"hexcasting.spell.hexcasting:add": "Additive Distillation",
@ -252,7 +253,7 @@
"hexcasting.spell.hexcasting:const/vec/nz": "Vector Reflection -Z",
"hexcasting.spell.hexcasting:const/vec/0": "Vector Reflection Zero",
"hexcasting.spell.hexcasting:number": "Numerical Reflection",
"hexcasting.spell.hexcasting:swizzle": "Swindler's Gambit",
"hexcasting.spell.hexcasting:mask": "Bookkeeper's Gambit",
"hexcasting.spell.unknown": "Special Handler",
"hexcasting.mishap.invalid_pattern": "That pattern isn't associated with any action",
@ -552,18 +553,20 @@
"hexcasting.page.math.15": "Split a vector into its X, Y, and Z components (top to bottom).",
"hexcasting.entry.consts": "Constants",
"hexcasting.page.consts.1": "The left-hand counter-clockwise pattern adds (1, 0, 0) to the stack; the right-hand clockwise pattern adds (-1, 0, 0).",
"hexcasting.page.consts.2": "The left-hand counter-clockwise pattern adds (0, 1, 0) to the stack; the right-hand clockwise pattern adds (0, -1, 0).",
"hexcasting.page.consts.3": "The left-hand counter-clockwise pattern adds (0, 0, 1); the right-hand clockwise pattern adds (0, 0, -1).",
"hexcasting.page.consts.4": "Adds (0, 0, 0) to the stack.",
"hexcasting.page.consts.1": "The left-hand counter-clockwise pattern adds [1, 0, 0] to the stack; the right-hand clockwise pattern adds [-1, 0, 0].",
"hexcasting.page.consts.2": "The left-hand counter-clockwise pattern adds [0, 1, 0] to the stack; the right-hand clockwise pattern adds [0, -1, 0].",
"hexcasting.page.consts.3": "The left-hand counter-clockwise pattern adds [0, 0, 1]; the right-hand clockwise pattern adds [0, 0, -1].",
"hexcasting.page.consts.4": "Adds [0, 0, 0] to the stack.",
"hexcasting.page.consts.5": "Adds the Null influence to the top of the stack.",
"hexcasting.entry.stackmanip": "Stack Manipulation",
"hexcasting.page.stackmanip1": "Removes the top of the stack and does nothing with it. This is handy when I make a mistake.",
"hexcasting.page.stackmanip2": "Duplicates the top iota of the stack.",
"hexcasting.page.stackmanip3": "Swaps the top two iotas of the stack.",
"hexcasting.page.stackmanip4": "Grabs the nth element in the stack and brings it to the top.",
"hexcasting.page.stackmanip5": "The Fisherman's Gambit takes a number and reaches that far $(italic)down/$ the stack-- pulling it from its original position up to the top of the stack. For example, using the Gambit with the number 2 will pull the second item on the stack to the top, effectively acting as a more-cumbersome Jester's Gambit. Using the Gambit with a negative number, a fraction, or a length larger than the stack will dredge all sorts of unknowable patterns from the aether, and is liable to cause a mishap.",
"hexcasting.page.stackmanip.1": "Swaps the top two iotas of the stack.",
"hexcasting.page.stackmanip.2": "Grabs the element in the stack indexed by the number and brings it to the top.",
"hexcasting.page.stackmanip.3": "Duplicates the top iota of the stack.",
"hexcasting.page.stackmanip.4": "Copies the top iota of the stack the given number of times. (A count of 2 results in two of the iota on the stack, not three.)",
"hexcasting.page.stackmanip.5.header": "Bookkeeper's Gambits",
"hexcasting.page.stackmanip.5": "An infinite family of actions that keep or remove elements at the top of the stack based on the sequence of dips and lines.",
"hexcasting.page.stackmanip.6": "Assuming that I draw a Bookkeeper's Gambit pattern left-to-right, the number of iotas the action will require is determined by the horizontal distance covered by the pattern. From deepest in the stack to shallowest, a flat line will keep the iota, whereas a triangle dipping down will remove it.$(br2)If my stack contains $(italic)0, 1, 2/$ from deepest to shallowest, drawing the first pattern opposite will give me $(italic)1/$, the second will give me $(italic)0/$, and the third will give me $(italic)0, 2/$ (the 0 at the bottom is left untouched).",
"hexcasting.entry.logic": "Logical Operators",
"hexcasting.page.logic.1": "If the first argument is greater than the second, return 1. Otherwise, return 0.",

View file

@ -12,7 +12,6 @@
"anchor": "Numbers",
"input": "",
"output": "number",
"args": "-> number",
"text": "hexcasting.page.numbers.1",
"patterns": [
{

View file

@ -6,32 +6,13 @@
"advancement": "hexcasting:root",
"read_by_default": true,
"pages": [
{
"type": "hexcasting:pattern",
"op_id": "hexcasting:undo",
"anchor": "hexcasting:undo",
"input": "any",
"output": "",
"text": "hexcasting.page.stackmanip1"
},
{
"type": "hexcasting:pattern",
"op_id": "hexcasting:duplicate",
"anchor": "hexcasting:duplicate",
"input": "any",
"output": "any, any",
"text": "hexcasting.page.stackmanip2"
},
{
"type": "hexcasting:pattern",
"op_id": "hexcasting:swap",
"anchor": "hexcasting:swap",
"input": "any, any",
"output": "any, any",
"text": "hexcasting.page.stackmanip3"
},
{
"type": "patchouli:empty"
"text": "hexcasting.page.stackmanip.1"
},
{
"type": "hexcasting:pattern",
@ -39,11 +20,51 @@
"anchor": "hexcasting:fisherman",
"input": "num",
"output": "any",
"text": "hexcasting.page.stackmanip4"
"text": "hexcasting.page.stackmanip.2"
},
{
"type": "hexcasting:pattern",
"op_id": "hexcasting:duplicate",
"anchor": "hexcasting:duplicate",
"input": "any",
"output": "any, any",
"text": "hexcasting.page.stackmanip.3"
},
{
"type": "hexcasting:pattern",
"op_id": "hexcasting:duplicate_n",
"anchor": "hexcasting:duplicate_n",
"input": "number, any",
"output": "many",
"text": "hexcasting.page.stackmanip.4"
},
{
"type": "hexcasting:manual_pattern",
"header": "hexcasting.page.stackmanip.5.header",
"anchor": "Numbers",
"input": "many",
"output": "many",
"text": "hexcasting.page.stackmanip.5",
"patterns": [
{
"startdir": "SOUTH_EAST",
"signature": "aeea"
}, {
"startdir": "EAST",
"signature": "eada",
"q": 1,
"r": 2
}, {
"startdir": "SOUTH_EAST",
"signature": "ae",
"q": 2,
"r": 4
}
]
},
{
"type": "patchouli:text",
"text": "hexcasting.page.stackmanip5"
"text": "hexcasting.page.stackmanip.6"
}
]
}