@MOD psi
@BOOK(encyclopaedia_psionica) DATA@@{"show_progress":false,"book_texture": "psi:textures/gui/book.png","subtitle": "psi.book.subtitle","open_sound": "psi:book_open","flip_sound": "psi:book_flip","creative_tab": "psi","use_resource_pack":true}@@ MAP{$(piece)->$(3)} i18n:book. icon:encyclopaedia_psionica Encyclopaedia Psionica; $(thing)Psi$(0) is a mod about creating $(thing)Spells$(0) whose limits are only defined by your own ingenuity. This book contains all the knowledge you need to become an expert spellslinger.$(p)(This book is a work in progress. You can find the old tutorial entries under the Legacy Entries Section.)


##basics icon:textures/spell/trick_debug.png Basics; If you're new to $(thing)Psi$(0), I advise that you take a read through each and every entry here. All of them contain vital information.

#introduction+ Introduction
Welcome to $(thing)Psi$(0), the greatest spell-program-based magitech mod this side of the universe!$(p)$(thing)Psi$(0) is a mod (inspired by the Mahouka series) about creating and casting $(thing)Spells$(0) to do your bidding.$(p)To begin your journey to become a spellslinging mage, you'll first need some $(item)Psidust$(0)-- however, one does not simply craft the stuff.
Instead, start by crafting a $(item)CAD Assembler$(0) and an $(item)Iron CAD Assembly$(0).$(p)Place the $(item)CAD Assembler$(0), open it, and insert the $(item)Iron CAD Assembly$(0) to construct a very bare-bones $(thing)Casting Assistant Device$(0) ($(thing)CAD$(0), for short).$(p)From there, drop some $(item)Redstone Dust$(0) on the ground, point your new $(thing)CAD$(0) at the dust, and cast ($(k:use)) to create some $(item)Psidust$(0).

#cad_assembler icon:cad_assembler CAD Assembler
The $(item)CAD Assembler$(0) is the heart of $(thing)Psi$(0), serving two essential functions.$(p)First, it assembles a $(thing)CAD$(0) from its component parts. Second, it loads $(o)non-empty$() $(item)Spell Bullets$(0) into $(thing)CADs$(0) (as well as other things that hold $(thing)Bullets$(0), such as $(thing)Psimetal Tools$(0)).
@RECIPE (assembler): Build-a-CAD Workshop
// TODO make this img 200x200
@IMAGE B(assembler_build): The simplest CAD that can cast
A $(thing)CAD$(0) is built from up to five components; the simplest $(thing)CAD$(0) only uses one component, an $(item)Assembly$(0), though this is only useful for crafting $(item)Psidust$(0).$(p)A $(thing)CAD$(0) capable of casting $(thing)Spells$(0) requires a $(item)Core$(0) and a $(item)Socket$(0) as well.$(p)Adding a $(item)Battery$(0) slightly increases a user's maximum $(thing)Psi energy$(0), and adding a $(item)Colorizer$(0) changes the color of cast $(thing)Spells$(0), which is purely cosmetic.
Once a $(thing)CAD$(0) is created, it can be placed in the leftmost panel of the $(item)CAD Assembler$(0).$(p)When placed there, the slots below open; $(item)Spell Bullets$(0) can be placed in these slots to be loaded into the $(thing)CAD$(0).$(p)Once the $(thing)Bullets$(0) are loaded, the $(thing)CAD$(0) is removed and held, and the $(thing)Psi master keybind$(0) ($(k:psimisc.keybind)) is held, the $(thing)Bullets$(0)' $(thing)Spells$(0) will be displayed on a radial menu, ready to be selected and cast.
// TODO make this img 200x200
@IMAGE B(assembler_load): A CAD with one bullet loaded

#spell_programmer icon:programmer Spell Programmer
If the $(item)CAD Assembler$(0) is the heart of $(thing)Psi$(0), then the $(item)Spell Programmer$(0) is the brains of the mod. It's where $(thing)Spells$(0) are written and compiled, and eventually copied into $(item)Spell Bullets$(0) to be cast.$(p)When placed and opened ($(k:use)), it displays a large 9x9 grid; see $(l:basics/tutorial_1)the tutorial entries$(/l) for more in-depth knowledge on using this grid.
@RECIPE (programmer): Hour Of Code

#vector_primer icon:textures/spell/operator_vector_construct.png A Primer On Vectors
@URL(https://www.youtube.com/watch?v=fNk_zzaMoSs) 3Blue1Brown: $(thing)Psi$(0) uses the concept of a Vector extensively. Therefore, if you haven't the foggiest idea what a vector is, I strongly recommend you watch the video below.$(p)The explanation in the next few pages is $(l)simplified$() for beginners. Don't take it as definitive.
In the world of $(thing)Psi$(0) (and indeed in a $(thing)Minecraft$(0) world), all vectors are three-dimensional. In essence, they're just lists of three coordinates: $(o)x$(), $(o)y$(), $(o)z$().$(p)The $(o)x$()-coordinate represents east when positive and west when negative, the $(o)y$()-direction up and down, and the $(o)z$()-direction south and north.$(p)If this doesn't make sense yet, open the debug screen (F3) and run around, paying attention to the row labeled "XYZ:".$(br)You'll understand.
That list of three numbers on the debug screen is, in fact, the first type of vector you'll meet: a $(l)position vector$().$(p)A position vector simply represents the location of a block, or an entity, or perhaps some empty space in the world. A single fixed location, represented by a list [$(o)x$(), $(o)y$(), $(o)z$()].$(p)However, not all vectors represent positions-- and it's important to note that $(l)any three numbers in a list constitute a vector$().
An interesting fact about vectors is that they're extremely easy to add.$(p)For example, say we have a grass block at some location, which we choose to represent as [$(o)x$(), $(o)y$(), $(o)z$()].$(p)If we wish to add another vector (e.g. [0, 1, 0]) to this one, all we would have to do is add corresponding numbers:$(br)our vector sum would be [$(o)x$()+0, $(o)y$()+1, $(o)z$()+0], or just [$(o)x$(), $(o)y$()+1, $(o)z$()].
Since the $(o)y$()-component of our new vector has increased by one, and positive-$(o)y$() means up, this new vector simply represents the block above our grass block.$(p)The vector [0, 1, 0] represents the $(o)difference$() in position between our original and new vector, and it's our second type of vector: an $(l)offset vector$().
Offset vectors are what most spellslingers spend the majority of their time manipulating, so a mastery over them is key.$(p)Usually, a mage starts with a single position vector, then adds, subtracts, or otherwise combines offset vectors with this position vector in order to target their desired point in the world.
It's important to note that the idea "offset" and "position" vectors is conceptual; the terms are unique to the terminology of this tablet.$(p)Again: all $(thing)Psi$(0) vectors are just lists of three numbers, and there's nothing stopping you from pretending the distinction doesn't exist.$(p)Indeed, in some contexts outside the scope of this book, the distinction doesn't even make $(o)sense$().
// However, $(o)within$() the context of $(thing)Psi$(0), putting offset and position vectors where they don't belong can lead to unpredictable results indeed.$(p)Two rules of thumb:$(li)Most $(thing)Operators$(0) that accept vectors should take no more than one position vector;$(li)Most $(thing)Tricks$(0) that affect blocks should take $(o)only$() a position vector.$(p)These are general rules, though; some $(thing)Spell Pieces$(0) do act differently.
Offset vectors have $(l)magnitudes$().$(p)You can think of an offset vector's magnitude as its "length," or the distance between a position in the world, and that same position when the offset vector is added to it.$(p)For example, our earlier offset vector [0, 1, 0] simply moved the position one block-length up, so it had a length, and therefore a magnitude, of 1.
Since a distance is always positive, so are vectors' magnitudes.$(p)Consider the vector [0, -3, 0] as an example: it represents down, three blocks-- yet the total distance moved is three blocks, and the "down" bit doesn't matter.$(p)Therefore, the magnitude of this vector is $(l)positive$() 3.
// Magnitudes are a bit harder to calculate for vectors that $(o)aren't$() mostly zeroes.$(p)However, since the $(o)x$(), $(o)y$(), and $(o)z$() directions are all at right angles, we can use the well-known Pythagorean Theorem to calculate any vector's magnitude.$(p)In particular, the magnitude for a vector [$(o)p$(), $(o)q$(), $(o)r$()] is the number √($(o)p$()²+$(o)q$()²+$(o)r$()²).
// For example, the magnitude of the vector [3, -4, 0] is √(3²+(-4)²+0²), which comes out to exactly 5.$(p)(Most of the time, a vector magnitude doesn't come out to a whole number, though.)$(p)Note that, while you $(o)can$() find the magnitude of a position vector, the number you get is largely meaningless-- who $(o)cares$() about your distance from [0, 0, 0] (which is some arbitrary point near bedrock and world spawn)?
Almost all vectors also have $(l)directions$().$(p)An offset vector's direction is, well, the direction something would move if it followed the vector in a straight line.$(p)For example, the direction of [0, 1, 0] is simply straight up.$(p)The vector [1, 0, -1], on the other hand, represents one block east and one block north, so its direction is just straight ahead, due northeast.
// TODO below: replace with an image
(Most directions aren't so nice, usually looking like "36.86 degrees north of west, 22.62 degrees below the horizon.")$(p)Note that the only vector without a direction is [0, 0, 0] (the $(l)zero vector$()), since you have to be going somewhere $(o)else$() to have a direction.$(p)Note that the direction of a position vector is almost as meaningless as its magnitude-- most $(thing)Spells$(0) don't need to know "where should I go to get away from bedrock at world spawn."
As a matter of fact, you can reconstruct any vector, given only its magnitude and direction, into a list of three numbers (which are known as the $(l)components$() of the vector).$(p)For example, the direction "up" and the magnitude 1 correspond to the vector [0, 1, 0].$(p)This isn't as surprising as it may seem: after all, if someone tells you which direction to go, and how far, you should know they want you to be.
There are several simple ways to manipulate position and offset vectors.$(p)First, we can add a position and an offset vector to get another position vector, as we did earlier with the grass block example.$(p)On the other hand, we can of course $(o)subtract$() two position vectors to get the offset vector representing the offset from one to the other:$(br)[$(o)x$(), $(o)y$()+1, $(o)z$()] − [$(o)x$(), $(o)y$(), $(o)z$()] = [0, 1, 0].
// TODO illustrate this maybe?
Perhaps more interestingly, we can add two offset vectors, to get a single offset representing their combination.$(p)Adding this offset to a position vector would be equivalent to first adding one of its components to that position vector, then adding the other.
And last, but most certainly not least, of the simple operations: we can $(l)scale$() a vector, by multiplying it by a number.$(p)Note that we're multiplying it by a number, and $(o)not$() another vector.$(p)If we wish to scale an vector [$(o)p$(), $(o)q$(), $(o)r$()] by a factor $(o)n$(), we simply multiply each of the vector's components by $(o)n$():$(br)$(o)n$()·[$(o)p$(), $(o)q$(), $(o)r$()] = [$(o)n$()·$(o)p$(), $(o)n$()·$(o)q$(), $(o)n$()·$(o)r$()].
This final operation relates nicely indeed to the concepts of magnitude and direction.$(p)When you scale a vector by a number $(o)n$(), you:$(li)multiply its magnitude by the absolute value of $(o)n$(), and$(li)don't change its direction if $(o)n$() is positive, but reverse its direction if $(o)n$() is negative.$(p)If $(o)n$()=0, then of course the resulting vector is the zero vector.
On the other hand, if we set $(o)n$()=-1, then we get a vector with the same magnitude (the absolute value of -1 is 1), but pointing the opposite way (since -1 is negative)!$(p)This vector is known as the $(l)negative$() of the original, and when the two are added we get the zero vector.$(p)This makes sense, since if we go in a direction, then go in the opposite direction for the same distance, our net movement is zero.
If, instead of multiplying, we $(o)divide$() a (nonzero) vector by its magnitude, we get a vector with magnitude 1 (since anything divided by itself is 1), but the same direction (since magnitudes are always positive).$(p)This is an important and well-known operation, known as $(l)normalizing$() a vector; the vector that results (and, in fact, any vector with magnitude 1) is called a $(l)unit vector$().
Unit vectors have a fixed magnitude, so they only represent direction.$(p)Many $(thing)Spell Pieces$(0) related to direction return unit vectors, like $(piece)Operator: Vector Axis Raycast$(0) and $(piece)Operator: Entity Look$(0).$(p)Indeed, there are $(thing)Operators$(0) to do $(o)most$() of the vector operations laid out in this article, usually with self-explanatory names.
#!ops The operations and their corresponding $(thing)Operators$(0) are as follows:$(li)Negating is $(piece)Operator: Vector Negate$(0);$(li)Normalizing is $(piece)Operator: Vector Normalize$(0);$(li)Scaling is $(piece)Operator: Vector Multiply$(0) and $(piece)Operator: Vector Divide$(0);$(li)Taking the magnitude is $(piece)Operator: Vector Magnitude$(0);$(li)Adding is $(piece)Operator: Vector Sum$(0);$(li)Subtracting is $(piece)Operator: Vector Subtract$(0).
Finally: vectors are still lists of three numbers. Don't lose sight of that.$(p)In a $(item)Spell Programmer$(0), they can be constructed from up to three numbers with $(piece)Operator: Vector Construct$(0).$(p)Conversely, a vector can also be broken back down into numbers with $(piece)Operator: Extract X$(0), $(piece)Operator: Extract Y$(0), and $(piece)Operator: Extract Z$(0).
Congratulations on making it through this tutorial!$(p)Again, this is just an introduction to vectors-- I've not said anything about dot or cross products, or vector projections, for example.$(p)But this should be more than enough to put together some quite interesting $(thing)Spells$(0) already.$(p)That's all-- now go forth and spellsling!

#tutorial_1+ icon:textures/spell/trick_debug.png Tutorial (1): Writing A Spell
@TITLE(Writing A Spell): Congratulations on getting acquainted with your brand-new $(thing)CAD$(0)!$(p)This tablet will serve as a reference manual for this mod, but certain entries (like this one) are tutorials, introducing you to the concepts and terms of a proper spellslinger.$(p)Don't worry, this is the longest tutorial, as it covers all the basics.
$(o)Note that many keywords in $(item)colored$(0) $(thing)italicized$(0) $(piece)text$(0) are links, and can be clicked on to learn more about their respective items or concepts.$()$(p)To get started with $(thing)Spell$(0) programming, you'll need (duh) a $(item)Spell Programmer$(0).$(p)Additionally, to actually execute your $(thing)Spells$(0), you'll need a better $(thing)CAD$(0) than the one you have right now-- you can construct one in your $(item)CAD Assembler$(0).
To that end, you probably want to make a $(item)Basic CAD Core$(0) and $(item)Basic CAD Socket$(0).$(p)You don't have to make another $(item)Assembly$(0); you can put your current $(thing)CAD$(0) in a crafting grid to revert it back to one (since it's pretty much just an $(item)Assembly$(0) anyway).$(p)Additionally, $(thing)Spells$(0) can't be cast directly out of a $(thing)CAD$(0); instead they're stored in $(item)Spell Bullets$(0), so to get rolling you'll need a small handful of those as well.
Once all your materials are gathered, the standard workflow for $(thing)Spell$(0) creation goes as follows:$(li)Construct a $(thing)Spell$(0) in the $(item)Programmer$(0);$(li)Copy the $(thing)Spell$(0) into a $(item)Spell Bullet$(0);$(li)Load the $(item)Spell Bullet$(0) into your $(thing)CAD$(0) using the $(item)CAD Assembler$(0);$(li)Hold your $(thing)CAD$(0), point, and cast.$(p)In this tutorial and the next, we'll walk you through this process.
When you open up your $(item)Spell Programmer$(0), you'll see a large grid-- this is where $(thing)Spells$(0) are made, and where the magic happens.$(p)$(thing)Psi$(0)'s programming system isn't $(o)exactly$() a traditional, complex one; instead, $(thing)Spells$(0) are composed of simple actions, called $(thing)Tricks$(0), executed in sequence.$(p)The whole mod centers around simply getting $(thing)Tricks$(0) to do what you want them to.
$(thing)Psi$(0)'s $(thing)Spells$(0) are all created on the $(item)Programmer$(0)'s grid from $(thing)Spell Pieces$(0); you can add as many pieces of as many types to a grid as you want, though not all arrangements of $(thing)Spell Pieces$(0) will produce valid $(thing)Spells$(0).$(p)To add a piece to the grid, right-click where you want the piece to go, and select from the menu of pieces that pops up.
When selecting from the menu of $(thing)Spell Pieces$(0), you can hover over one to see its name, and click on it to place it in the grid.$(p)Don't worry about the myriad of pieces that appear for you; you can simply type to search for specific pieces, and press Enter to place the first search result.$(p)You can hold Shift and hover over the "?" button on the bottom-right to see the full list of shortcuts.
Start by placing the piece called $(piece)Trick: Debug$(0) anywhere on the grid.$(p)As mentioned before, $(thing)Tricks$(0) like this one are the $(thing)Spell Pieces$(0) responsible for interacting with the world.$(p)This is the simplest $(thing)Trick$(0); all it does is say something in your chat. Yet $(thing)Tricks$(0) can use your $(thing)Psi energy$(0) to do a huge variety of things.
Select a grid piece $(l)adjacent$() to your $(piece)Trick: Debug$(0), and place the piece called $(piece)Selector: Caster$(0) there.$(p)$(thing)Selectors$(0) are the $(thing)Spell Pieces$(0) that provide information about the surrounding world to $(thing)Spells$(0).$(p)This particular piece represents you, the eventual caster of this $(thing)Spell$(0). You'll probably use this one rather often, as it's a natural starting-point for your $(thing)Spells$(0).
Nearly all $(thing)Spell Pieces$(0) need $(l)parameters$(), which tell the pieces what to perform their actions on.$(p)For example, we know that $(piece)Trick: Debug$(0) sends something to chat; its first parameter tells it $(o)what$() to say.$(p)$(o)Parameters also have $(l)data types$()$(o), or $(l)types$()$(o) for short, but we'll worry about those in a later tutorial.$()
Left-click your $(piece)Trick: Debug$(0) piece; you should see a panel appear on the left-hand side with two rows. Each row should have a label and several small arrows.$(p)These two rows represent the two parameters that $(piece)Trick: Debug$(0) takes.$(p)Ignore the row labeled "Number" for now; just know that the dot in the center means it's optional. For a $(thing)Spell$(0) to function, all $(o)non$()-optional parameters must be filled.
Look at the arrows labeled "Target," and select the one corresponding to where you placed $(piece)Selector: Caster$(0) (for example, if you placed it to the right of $(piece)Trick: Debug$(0), select the rightmost arrow that points left), so it appears that the $(thing)Selector$(0) piece is pointing towards the $(thing)Trick$(0) piece.
This will make the $(thing)Trick$(0) use the $(thing)Selector$(0) as its "Target" parameter.$(p)We say that $(piece)Trick: Debug$(0) $(l)accepts$() or $(l)takes$() $(piece)Selector: Caster$(0) as its "Target" parameter.$(p)Parameters are also known as $(l)arguments$(), or simply $(l)inputs$().$(p)$(o)Technical note: In programming-vocabulary there's a subtle difference in the terms, but it's beyond the scope of this tablet.$()
@IMAGE B(tutorial_1_spell): Your final $(thing)Spell$(0) should look something like this
At this point, the X in the upper-left hand corner of the $(item)Programmer$(0) should have turned into a check-mark.$(p)A check-mark means that the $(thing)Spell$(0) $(l)compiled successfully$() (which is a compact way of saying "the $(item)Programmer$(0) made sure that all the $(thing)Spell Pieces$(0) you've placed fit together correctly"). 
If at any time the X is present (which means that the compilation $(l)failed$() or $(l)errored$()), you can hover over it to see the problem with your $(thing)Spell$(0) and correct that problem.$(p)Once your $(thing)Spell$(0) compiles successfully, it can be copied into a $(item)Spell Bullet$(0) and cast. And that's exactly what we'll do in $(l:basics/tutorial_2)the next tutorial$(/l)!

#tutorial_2+ icon:cad_assembly_iron Tutorial (2): Casting A Spell
@TITLE(Casting A Spell): So, you've written your first $(thing)Spell$(0)! Actually casting it, though, will take a few extra steps.$(p)First, close out your $(item)Spell Programmer$(0), hold a $(item)Spell Bullet$(0) (which you should have prepared in the last tutorial), and use ($(k:use)) the bullet on the Programmer. You should hear a chime, and the bullet should rename itself to "Debug."
The bullet now contains a copy of the $(thing)Spell$(0) you've written, and is ready to be loaded into your $(thing)CAD$(0).$(p)To load a $(item)Spell Bullet$(0) into your $(thing)CAD$(0), open your $(item)CAD Assembler$(0) and insert your $(thing)CAD$(0) into the leftmost slot. Some of the slots below it should open; place the bullet with the $(thing)Spell$(0) you've written in one of these slots. Take your $(thing)CAD$(0) back out.
$(s$(0) can hold multiple $(item)Spell Bullets$(0), and therefore multiple $(thing)Spells$(0); the active $(thing)Spell$(0) to be cast can be switched on-the-fly.$(p)To select a $(thing)Spell$(0) to cast, hold your $(thing)CAD$(0) in either hand and hold down the $(thing)Psi master keybind$(0) ($(k:psimisc.keybind)).$(p)A radial menu should appear; hover over the $(thing)Spell$(0) labeled "Debug" (the one you just wrote) and release the key to select it.
When you cast the $(thing)Spell$(0) ($(k:use)), you should see displayed in chat a long block of text that includes your username and coordinates. If so: congratulations! You've managed to write and cast your first $(thing)Spell$(0)!$(p)If you need to craft more $(item)Psidust$(0), re-open the radial menu and select a slot without a $(thing)Spell$(0) stored, then cast at $(item)Redstone Dust$(0) as you normally would.
$(l)A sidenote: you should carry only one $(thing)CAD$(0) at a time.$()$(p)If more than one is carried, their channeled $(thing)Psi$(0) energies interfere, shorting out any $(thing)Spells$(0) cast. This phenomenon, known as "cast jamming," is best avoided by simply keeping to one-$(thing)CAD$(0)-per-mage.$(p)Once you've successfully cast your Debug $(thing)Spell$(0), you can move on to $(l:basics/tutorial_3)the next tutorial$(/l).

#tutorial_3+ icon:textures/spell/operator_root.png Tutorial (3): Types & Numbers
@TITLE(Types & Numbers): Open up your $(item)Spell Programmer$(0) and take a look at your "Debug" $(thing)Spell$(0) again.$(p)Remember the "Number" parameter on $(piece)Trick: Debug$(0) that we saw in $(l:basics/tutorial_1)the first tutorial$(/l)? We mentioned previously that that parameter has an extra dot in the center, meaning it can be disabled. But this time, we $(o)won't$() disable it.
The "Number" parameter of $(piece)Trick: Debug$(0), when used, is printed as a label of sorts, so that multiple copies of $(piece)Trick: Debug$(0) in a complex $(thing)Spell$(0) can be differentiated.$(p)The $(l)type$() of this parameter is "Number," which means that the parameter will only accept arguments that output (or $(l)return$()) Numbers.$(p)The first parameter, "Target," accepts the special type "Any," which means it can accept anything.
If you hold Shift and hover over a Spell Piece, it'll tell you the types of all its parameters, as well as its output's type. For example, we can see that the $(piece)Selector: Caster$(0) piece returns an Entity, which isn't a Number. So we'll need some other piece to represent one.
// TODO: re-screenshot this
@IMAGE (tutorial_3_tooltip): Tooltip for $(piece)Selector: Caster$(0); it returns an Entity
Choose an empty grid piece adjacent to $(piece)Trick: Debug$(0), and place the piece called $(piece)Constant: Number$(0).$(p)If you Shift-hover over this piece, you'll see that it $(o)does$() return a Number (actually, it returns a Number Constant, which is a Number but more specific).$(p)Therefore, if you left-click your $(piece)Trick: Debug$(0) again and point its Number parameter at the $(piece)Constant: Number$(0), your $(thing)Spell$(0) should compile.
To run your new-and-improved Debug $(thing)Spell$(0), you might believe that you need to unload the bullet, re-copy the $(thing)Spell$(0), reload the bullet, and re-select the $(thing)Spell$(0).$(p)Luckily, your $(thing)CAD$(0) comes with a shortcut: simply select your Debug $(thing)Spell$(0) on your $(thing)CAD$(0) and crouch and swipe ($(k:use)) your $(thing)CAD$(0) over your $(item)Programmer$(0), and the $(thing)Spell$(0) stored in the corresponding bullet will update itself to the $(item)Programmer$(0)'s version.
If you cast your Debug $(thing)Spell$(0) now, you'll notice that you get the same long block of text as before, but with a bracketed zero in front: in fact, the same zero that was displayed in the $(piece)Constant: Number$(0) piece when you placed it.$(p)So the logical next question is: How do we display a number $(o)other$() than zero?
Well, the $(piece)Constant: Number$(0) piece is special: to set its stored constant, all you have to do is select the piece and simply type a new number.$(p)All other $(thing)Spell Pieces$(0) are configured only from the left-hand parameter panel.$(p)$(o)Technical wayside: all Number Constants count as Numbers, but plain Numbers don't count as Number Constants. Only $(thing)Constant$(0) $(thing)Spell Pieces$(0) return Number Constants.$()
Try editing the number stored in the $(piece)Constant: Number$(0), updating the $(thing)Spell$(0) stored in your $(thing)CAD$(0), and re-casting. You should see that the prefixed number has, in fact, changed! Neat!
Now, here's the thing: we've hooked $(piece)Trick: Debug$(0) up to two different inputs at once.$(p)Truth be told, $(o)most$() $(thing)Spell Pieces$(0) take two (or even three) inputs. And when it comes right down to it, your $(thing)Spell$(0)'s inputs might end up adjacent to one another.$(p)That's where $(piece)Connectors$(0) come in.
Connectors are simple pieces, yet powerful: They take one input, of any type, and return that same input. Thus, if a certain $(thing)Spell Piece$(0) requires as input another piece that's two grid-spaces away, you can connect them with a $(piece)Connector$(0).
@IMAGE (tutorial_3_connector): Bridge to Terabithia
Of course, the true power of a $(piece)Connector$(0) is that they can connect to each $(o)other$(): so you can of course daisy-chain them together to connect $(thing)Spell Pieces$(0) from as far-away as you please.$(p)Play around with some $(piece)Connectors$(0), and as soon as you feel comfortable with them you can move on to $(l:basics/tutorial_4)the next tutorial$(/l)!
@IMAGE (tutorial_3_chain): The long way around

#tutorial_4+ icon:textures/spell/trick_add_motion.png Tutorial (4): Move It
@TITLE(Move It): Okay, okay. I know what you're thinking: "This is boring. When do we start doing cool stuff?" Well... now!$(p)Let's introduce a $(thing)Trick$(0) that actually interacts with the world-- introducing: $(piece)Trick: Add Motion$(0).$(p)This $(thing)Trick$(0) takes an entity, and adds motion to it (i.e. gives it a push) in a certain direction.
Examples of entities include: you, the caster; a chicken; a zombie; a minecart; a falling sand block; an arrow; the Wither.$(p)This $(thing)Trick$(0) takes as parameters an Entity (which represents the entity to move), a Vector (the direction to push it in), and a Number Constant (how hard the $(thing)Trick$(0) should push the entity).$(p)$(o)Note: If you don't understand what the word "vector" means, $(l:basics/vector_primer)this entry$(/l) should serve as a good introduction.$()
Let's write a $(thing)Spell$(0) that, when cast, simply boosts its caster forwards, using $(piece)Trick: Add Motion$(0).$(p)As mentioned before, $(piece)Selector: Caster$(0) returns an Entity (namely: you, the caster), so we can use that as the first parameter to $(piece)Trick: Add Motion$(0).$(p)We'd like the $(thing)Trick$(0) to boost you $(o)forward$()-- that is, $(o)in the direction you're looking$(). To do that, let's introduce our next piece: $(piece)Operator: Entity Look$(0).
No $(thing)Operator$(0) pieces change the world around them in any way, nor do they pull information from it (with a few exceptions). Instead, they merely $(o)transform$() information into more useful forms.$(p)In particular, $(piece)Operator: Entity Look$(0) accepts an Entity, and returns a unit Vector: the direction the Entity is looking.$(p)Thus, one of these, hooked up to a $(piece)Selector: Caster$(0), will return a Vector that points wherever you're looking at.
Finally, for the last parameter of $(piece)Trick: Add Motion$(0), a simple $(piece)Constant: Number$(0) will do.$(p)Let's put this $(thing)Spell$(0) all together: first, open up your $(item)Spell Programmer$(0) and clear any $(thing)Spell$(0) currently on it. Then, place a $(piece)Trick: Add Motion$(0) near the middle of the grid.
Place a $(piece)Selector: Caster$(0) directly above the $(thing)Trick$(0), an $(piece)Operator: Entity Look$(0) to its right, and a $(piece)Constant: Number$(0) to its left.$(p)Fill in the number 3 for the $(thing)Constant$(0) (you can tinker with this later).$(p)Place a $(piece)Connector$(0) between the $(thing)Operator$(0) and the $(thing)Selector$(0), and then set up all the parameters for the $(thing)Operator$(0) and $(thing)Trick$(0) so the $(thing)Spell$(0) compiles-- it should look something like the image on the next page.
@IMAGE (tutorial_4_spell): When push comes to shove
Copy the $(thing)Spell$(0) into your $(thing)CAD$(0), look straight ahead, and cast. If you get thrown forward, then congratulations! You've just finished writing your first real $(thing)Spell$(0)!$(p)$(o)Note: Casting your new $(thing)Spell$(0) too many times in a row might be bad for your health. More on this in $(l:basics/tutorial_5)the next tutorial$(/l).$()

#tutorial_5+ icon:cad_assembler Tutorial (5): Limits
@TITLE(Limits): Open your $(item)Spell Programmer$(0) again, and review the $(thing)Spell$(0) you wrote in $(l:basics/tutorial_4)the last tutorial$(/l).$(p)When it compiled correctly, you should have seen five icons appear to the right of the grid, each with two numbers. These numerical stats define the practical limits on exactly what $(thing)Spells$(0) you're able to cast.
@IMAGE B(tutorial_5_stats): The stats for your Add Motion $(thing)Spell$(0) (assuming your constant was 3)
#!complexity(Complexity) The first stat is $(thing)Complexity$(0), the total number of $(thing)Operators$(0), $(thing)Selectors$(0), and non-debug $(thing)Tricks$(0) in the $(thing)Spell$(0).$(p)Its maximum value is determined by the $(item)CAD Core$(0) you have installed; if a $(thing)Spell$(0)'s $(thing)Complexity$(0) exceeds your $(thing)CAD$(0)'s capacity, it won't be castable.
#!potency(Potency) The second is $(thing)Potency$(0), capped by your $(item)Assembly$(0) component; the approximate total power draw of all $(thing)Tricks$(0) used in the $(thing)Spell$(0).$(p)Some $(thing)Tricks$(0) have a fixed $(thing)Potency$(0) cost per-use. However, most $(thing)Tricks$(0) that have a Number Constant-type parameter use it to determine their $(thing)Potency$(0); the higher the constant, the greater the $(thing)Potency$(0).
#!cost(Cost) The third stat, $(thing)Cost$(0), is unique in that your $(thing)CAD$(0) sets no limits on it. Instead, each time a $(thing)Spell$(0) is cast, it consumes its $(thing)Cost$(0) from your own body's $(thing)Psi energy$(0).$(p)The first number shown is the $(o)ideal$() $(thing)Cost$(0) of the $(thing)Spell$(0)-- all $(item)CAD Assemblies$(0) have flaws that increase it.
The true $(thing)Cost$(0) of casting with your $(thing)CAD$(0) is the parenthesized number on the $(item)Programmer$(0) display, and the higher an $(item)Assembly$(0)'s $(thing)Efficiency$(0), the closer to ideal the actual $(thing)Cost$(0) of casting from your $(thing)CAD$(0) becomes.
// TODO: move first para to prev paragraph, replace Caster Energy info with diagram?
Your $(thing)Psi energy$(0) regenerates at around 500 units per second, limiting the speed at which you can cast $(thing)Spells$(0).$(p)Your current level of $(thing)Psi energy$(0) can be accessed from within a $(thing)Spell$(0) with $(piece)Selector: Caster Energy$(0).
Note that if you cast a $(thing)Spell$(0) without enough $(thing)Psi energy$(0) available (known as $(l)overdrawing$()), your $(thing)CAD$(0) will draw the excess cost from your own health, and promptly disable itself until your $(thing)Psi energy$(0) fully regenerates, for your own protection.$(p)A $(item)Battery$(0) added to a $(thing)CAD$(0) can guard against this.$(p)Be careful-- overdrawing has consequences that are painful, and maybe even lethal!
#!projection(Projection) The fourth stat displayed on the $(item)Programmer$(0) is $(thing)Projection$(0): the total number of non-debug $(thing)Tricks$(0) in the $(thing)Spell$(0).$(p)Your $(thing)CAD$(0)'s $(item)Core$(0) determines your maximum $(thing)Projection$(0) per-$(thing)Spell$(0); too many $(thing)Tricks$(0) and the $(thing)Spell$(0) is uncastable.
#!bandwidth(Bandwidth) And the fifth and final stat is $(thing)Bandwidth$(0), capped by your $(item)CAD Socket$(0): the width or height of the $(thing)Spell$(0), measured in grid spaces-- whichever is larger.$(p)This is, with a bit of ingenuity, one of the more interesting stats to work with; if your $(thing)Spell$(0) is too big, the technique of moving some pieces around and eliminating others to pack it into a smaller space is known as $(l)compression$().
There's one final limitation on $(thing)Spells$(0): no $(thing)Trick$(0) can affect anything more than 32 blocks away from its $(thing)Focal Point$(0) (for a plain $(item)Spell Bullet$(0), that's just you, the caster), excepting the caster of the $(thing)Spell$(0) themself.$(p)A $(thing)Spell$(0) that attempts to do so will display an error in chat, then $(l)fizzle$().$(p)When a $(thing)Spell$(0) fizzles, it harmlessly disperses its stored $(thing)Psi energy$(0), and any remaining $(thing)Tricks$(0) it would otherwise execute don't happen.
To clarify the earlier exception mentioned:$(br)Certain types of $(item)Spell Bullets$(0) have $(thing)Focal Points$(0) that $(o)aren't$() their casters-- yet in these cases, their stored $(thing)Spells$(0) can still affect their casters through $(piece)Selector: Caster$(0), no matter how far away their $(thing)Focal Points$(0) are.$(p)There's $(l:basics/tutorial_6)one final tutorial$(/l) lined up, putting most of what we've learned together, and then we'll cut you loose into the wider world of $(thing)Psi$(0). Good luck!

#tutorial_6+ icon:textures/spell/trick_explode.png Tutorial (6): EXPLOSION
@TITLE(EXPLOSION!!): Do you like explosions?$(p)Of course you do. Everyone loves explosions!$(p)So let's make a $(thing)Spell$(0) that blows up whatever you're looking at when you cast it.$(p)What could possibly go wrong?
To write this $(thing)Spell$(0), let's start with the $(thing)Trick$(0) we'll use to cause an explosion, and work backwards.$(p)Conveniently, it's named $(piece)Trick: Explode$(0)-- so open up your $(item)Spell Programmer$(0), clear out the grid, and place a $(piece)Trick: Explode$(0) near the middle.$(p)Shift-hovering over it reveals that it accepts a Vector and a Number Constant as parameters.
The Number Constant parameter represents the explosion's power-- easy enough to fill with a $(piece)Constant: Number$(0) piece.$(p)The Vector, on the other hand, accepts the position vector of the location you want the explosion to go off at. This is what'll take a bit more effort to calculate.
$(l:basics/tutorial_5)Last tutorial$(/l), we used $(piece)Operator: Entity Look$(0).$(p)However, that $(thing)Operator$(0) returns a unit vector, and $(piece)Trick: Explode$(0) needs a position, so feeding that piece directly into the $(thing)Trick$(0) would probably not produce the results we want.$(p)So let's introduce another $(thing)Operator$(0): namely, $(piece)Operator: Entity Position$(0).
$(piece)Operator: Entity Position$(0) accepts an Entity (like the caster of the $(thing)Spell$(0)), and returns that entity's position (to be more precise: for a player like you, it returns your position at eye-level).$(p)However, we don't want to pass this directly into $(piece)Trick: Explode$(0), either-- because it would literally explode in your face when cast.
What we $(o)could$() do here is simply scale up the vector we got from $(piece)Operator: Entity Look$(0) by a factor of, say, 10, and then add this to $(piece)Operator: Entity Position$(0)'s output.$(p)When fed into $(piece)Trick: Explode$(0), this would create a $(thing)Spell$(0) that, when cast, would create an explosion $(o)exactly ten blocks away from you, in the direction you're looking$().
// TODO: expand this into a new tutorial?
But the limitations of this $(thing)Spell$(0) seem obvious: if you want to blow something up that's closer or further than ten blocks away, you'll have to do some awkward moving-around and guesstimating of distances.$(p)Not very practical, all things considered.$(p)Instead, let's use a smarter operator: $(piece)Operator: Vector Raycast$(0).
// TODO: Vaz wants another goddamn diagram these bitches don't grow on trees you know
This $(thing)Operator$(0)'s function is intuitively simple; it accepts a position vector and a "ray" vector (which is just a vector to represent direction).$(p)Its return value pretty much represents "if I stood there and looked in that direction, what position would I be looking at?", which makes it perfect for our purposes.$(p)For more details, including what the "Max" argument does, read the page about $(piece)Operator: Vector Raycast$(0).
So! To build this $(thing)Spell$(0), let's work backwards.$(p)If you haven't done so already, place a $(piece)Constant: Number$(0) near the $(piece)Trick: Explode$(0) (if you're still using the $(thing)CAD$(0) you built in $(l:basics/tutorial_1)the first tutorial$(/l), 1.4 would be a good number to set it to).$(p)Then, place a $(piece)Operator: Vector Raycast$(0) next to the $(thing)Trick$(0) as well, and hook the $(thing)Trick$(0) up to the other two $(thing)Spell Pieces$(0).
Next, place an $(piece)Operator: Entity Position$(0) and an $(piece)Operator: Entity Look$(0), then connect your $(piece)Operator: Vector Raycast$(0) to the two.$(p)Make sure to hook "Position" up to Entity Position and "Ray" up to Entity Look, and not the other way around, or else you'll get some odd results/errors when you cast the $(thing)Spell$(0).$(p)Finally, place a $(piece)Selector: Caster$(0), and hook this up to the two Entity $(thing)Operators$(0).
@IMAGE (tutorial_6_spell): Something along these lines
Once your $(thing)Spell$(0) compiles successfully, load it into your $(thing)CAD$(0), take careful aim at something (preferably something you don't care much about), and cast.$(p)If that thing you're looking at explodes, take a moment to savor your newfound power.$(p)Just, er, try not to cast it at your own two feet.
One final note: Try casting your new "Explode" $(thing)Spell$(0) at something that's more than 32 blocks away (or at nothing, like the sky).$(p)You should see no explosion, and an error should pop up in chat, telling you "$(c)Spell Target is outside maximum 32 block radius.$(0)" (this limit was discussed last tutorial).$(p)These sorts of errors popping up in chat can get rather annoying.
To fix this, simply place an $(piece)Error Suppressor$(0) piece anywhere on the grid, and the resulting $(thing)Spell$(0) will instead fail silently, when cast.$(p)You might want to remove the piece when debugging, though. Errors $(o)can$() be useful sometimes.
This concludes this set of tutorials!$(p)Have a read through the rest of this book for an idea of exactly what you can do with this mod. Experienced mages can do terrifying things, after all.$(p)It's up to you to experiment with your $(thing)CAD$(0) and $(item)Spell Programmer$(0), and to create your own unique $(thing)Spells$(0).$(p)Good luck, and welcome to the wide world of $(thing)Psi$(0)!
// TODO: tutorial 7? give people ideas on what to do

#eval_order icon:textures/spell/trick_evaluate.png Evaluation Order
// TODO: Give her an icon?
Nearly all $(thing)Tricks$(0) execute simultaneously with the $(thing)Spell$(0) containing them. Nonetheless, to use $(piece)flow control tricks$(0), you'll need a basic knowledge of evaluation order; that is, the order that $(thing)Spell Pieces$(0) get evaluated in.
There are three basic rules to evaluation order; they're explained in more detail in the following pages, but a brief summary follows:$(li)When a $(thing)Spell$(0) is executed, its $(thing)Tricks$(0) are each evaluated (and then executed) left-to-right, then top-to-bottom;$(li)Any $(thing)Spell Piece$(0) being evaluated will evaluate all of its inputs first;$(li)A $(thing)Spell Piece$(0) is evaluated at most once per $(thing)Spell$(0) execution, when its value is first required.
The first rule should be rather self-explanatory: a $(thing)Trick$(0) placed higher on the grid is executed earlier than a $(thing)Trick$(0) placed lower, and when two or more $(thing)Tricks$(0) are in the same row, the leftmost one executes first.$(p)Thus, the $(thing)Spell$(0) shown on the next page should display "1.0", "2.0", "3.0", and "4.0" in chat, in that exact order.
@IMAGE(eval_order_1): Make it count
The second rule is just as simple; a $(thing)Spell Piece$(0) is only evaluated when its value is required.$(p)However, notably, the converse is $(o)also$() true-- namely: if a $(thing)Spell Piece$(0) $(o)isn't$() required for a $(thing)Trick$(0), directly or indirectly, it's never evaluated when the $(thing)Spell$(0) executes.$(p)Any $(thing)Spell Piece$(0) that isn't connected to a $(thing)Trick$(0) causes $(l)undefined behavior$()-- no guarantees on $(thing)Spell$(0) behavior in those cases.
@IMAGE(eval_order_2): Not suggested
The third and final rule is a bit more subtle, and is best illustrated in the $(thing)Spell$(0) on the next page:$(p)A $(thing)Spell Piece$(0) only evaluates once, and returns $(o)the exact same value$() for subsequent evaluations. Therefore, the four copies of $(piece)Trick: Debug$(0) displayed will all output the $(o)same$() number, since the $(piece)Operator: Random$(0) only gets evaluated once.$(p)$(piece)Trick: Evaluate$(0) can be used to evaluate a $(thing)Spell Piece$(0) "early."
@IMAGE(eval_order_3): First-come first-serve


##components icon:cad_assembly_psimetal Materials & Components; This section of the book details all the new raw materials $(thing)Psi$(0) adds to the game, as well as all the components you need to construct a proper $(thing)CAD$(0).

#psidust+ icon:psidust Psidust
$(item)Psidust$(0) is a material transmuted from $(item)Redstone Dust$(0) by an unfocused burst of $(thing)Psi energy$(0), and is, as such, a good conductor of said energies.$(p)Therefore, it's a critical component in low-tier $(s$(0), since it's used in simple $(l:components/core#basic)$(item)CAD Cores$(0)$(/l), $(l:components/socket#basic)$(item)Sockets$(0)$(/l), and $(l:components/battery#basic)$(item)Batteries$(0)$(/l), as well as all $(item)CAD Colorizers$(0).$(p)It's also used in $(item)Spell Bullets$(0).
@ITEM (psidust+): To create $(item)Psidust$(0), first throw some $(item)Redstone Dust$(0) on the ground. Then stand nearby and cast ($(k:use)) with a $(thing)CAD$(0) $(l)that has no $(thing)Spell$(0) selected$() to convert the redstone into $(item)Psidust$(0).$(p)$(item)Psidust$(0) can also be created with any of the $(piece)infusion tricks$(0).

#psimetal+ icon:psimetal Psimetal
$(item)Psimetal$(0) is a material transmuted from $(item)Gold Ingots$(0) that conducts, stores, and transfers $(thing)Psi energy$(0) $(o)much$() better than $(item)Psidust$(0) does.$(p)In addition to being a component in more powerful $(item)CAD Cores$(0), $(item)Sockets$(0), and $(l:components/battery#extended)$(item)Batteries$(0)$(/l), it can be fashioned into a superior $(l:components/assembly#psimetal)$(item)CAD Assembly$(0)$(/l). It's also used to craft $(thing)Psimetal Tools$(0) and $(thing)Armor$(0), as well as $(item)Ebony & Ivory Ingots$(0).
@ITEM (psimetal+): To create $(item)Psimetal$(0), first drop $(item)Gold Ingots$(0) on the ground.$(p)Then, stand nearby, and cast a $(thing)Spell$(0) with $(piece)Trick: Infusion$(0) (or any other $(piece)infusion trick$(0)) as one of its $(thing)Tricks$(0) to convert the gold into $(item)Psimetal$(0).

// TODO set up sortnum for this so it's after Psimetal
#psigem+ icon:psigem Psigem
$(item)Psigems$(0) are crystals transmuted from $(item)Diamonds$(0) whose refractive properties make them extraordinarily good at conducting, transferring, and storing $(thing)Psi energy$(0).$(p)These are used to fashion top-of-the-line $(item)CAD Cores$(0), $(item)Sockets$(0), and $(l:components/battery#ultradense)$(item)Batteries$(0)$(/l), and as essential components in $(thing)Psimetal Tools$(0) and $(thing)Armor$(0).
@ITEM (psigem+): To create a $(item)Psigem$(0), first throw a $(item)Diamond$(0) on the ground.$(p)Then, stand nearby, and cast a $(thing)Spell$(0) with $(piece)Trick: Greater Infusion$(0) (or $(piece)Trick: Ebony & Ivory$(0)) as one of its tricks to convert the $(item)Diamond$(0) into a $(item)Psigem$(0).

#ebony_ivory icon:ivory_substance Ebony & Ivory
The $(thing)End$(0) is much closer to a dimension of the mind than the $(thing)Overworld$(0). Therefore, its essences are much more conductive to $(thing)Psi energy$(0), which derives from the mind as well.$(p)$(piece)Trick: Ebony & Ivory$(0) can be used to capture these essences in $(item)Coal$(0) and $(item)Nether Quartz$(0), transmuting them into $(item)Ebony Substance$(0) and $(item)Ivory Substance$(0), respectively.
Unfortunately, as it turns out, neither $(item)Ebony$(0) nor $(item)Ivory Substance$(0) plays nicely with $(thing)Overworld$(0)-y materials.$(p)This means that fashioning them into $(item)CAD Cores$(0), $(item)Sockets$(0), and $(item)Batteries$(0) proves rather difficult.$(p)We $(o)can$(), however, coat $(item)Psimetal Ingots$(0) with the stuff, yielding $(item)Ebony$(0) and $(item)Ivory Psimetal Ingots$(0), respectively, which are just about stable enough to be shaped into $(item)CAD Assemblies$(0).
@ITEM (ebony_substance+): To create $(item)Ebony Substance$(0), first travel to the $(thing)End$(0), and drop $(item)Coal$(0) on the ground there.$(p)Then, stand nearby, and cast a $(thing)Spell$(0) with $(piece)Trick: Ebony & Ivory$(0) as one of its $(thing)Tricks$(0) to convert the $(item)Coal$(0) into $(item)Ebony Substance$(0).
@ITEM (ivory_substance+): To create $(item)Ivory Substance$(0), first travel to the $(thing)End$(0), and drop $(item)Nether Quartz$(0) on the ground there.$(p)Then, stand nearby, and cast a $(thing)Spell$(0) with $(piece)Trick: Ebony & Ivory$(0) as one of its $(thing)Tricks$(0) to convert the $(item)Nether Quartz$(0) into $(item)Ivory Substance$(0).
@RECIPE (ebony_psimetal): Dark'ness Dementia Raven Way
@RECIPE (ivory_psimetal): No elephants were harmed in its creation

#assembly icon:cad_assembly_iron Assemblies
The $(item)CAD Assembly$(0) is simple in structure, yet the single most important component of a $(thing)CAD$(0).$(p)An $(item)Assembly$(0) is responsible for channeling its user's $(thing)Psi energy$(0)-- it's simply a conveniently-shaped conduit for the task.$(p)All $(thing)Psi$(0) $(thing)CADs$(0) are crafted from four ingots of their component material in a crafting grid, shaped in a sideways L.$(p)
The $(item)Assembly$(0) is the only $(thing)CAD$(0) component that's strictly necessary in an $(item)CAD Assembler$(0)-- indeed, any $(thing)CAD$(0) consisting of just an $(item)Assembly$(0) can be reverted to one in a crafting grid.$(p)Every $(item)Assembly$(0) has a $(thing)Potency$(0): roughly, the maximum rate it can channel $(thing)Psi energy$(0) at.$(p)It also has an $(thing)Efficiency$(0), which is the percent of its user's $(thing)Psi energy$(0) that it can actually $(o)use$() in a $(thing)Spell$(0)-- a higher $(thing)Efficiency$(0) is better.
#!iron @ITEM (cad_assembly_iron): The humble $(item)Iron CAD Assembly$(0) has the lowest $(thing)Potency$(0) and $(thing)Efficiency$(0) of any $(item)Assembly$(0) in this book.$(p)But it's relatively cheap, and crafts $(item)Psidust$(0) as well any other $(thing)CAD$(0), so it's the go-to $(item)Assembly$(0) for beginners.
@RECIPE (cad_assembly_iron): Sleek and simple
#!gold @ITEM (cad_assembly_gold): The $(item)Gold CAD Assembly$(0) boasts a higher $(thing)Potency$(0) as well as a higher $(thing)Efficiency$(0) than its iron counterpart-- in fact, it's the best $(item)Assembly$(0) in the book that's made from mundane materials.
@RECIPE (cad_assembly_gold): A bit heavy to carry around, though
#!psimetal @ITEM (cad_assembly_psimetal): The $(item)Psimetal CAD Assembly$(0) has a higher $(thing)Efficiency$(0) than an $(l:components/assembly#iron)$(item)Iron Assembly$(0)$(/l) as well as a higher $(thing)Potency$(0) than a $(l:components/assembly#gold)$(item)Gold Assembly$(0)$(/l), making it versatile indeed.$(p)Both $(piece)Trick: Greater Infusion$(0) and $(piece)Trick: Ebony & Ivory$(0) require a $(thing)CAD$(0) with an $(item)Assembly$(0) of this caliber or higher to cast.
@RECIPE (cad_assembly_psimetal): Best of both worlds
#!ebony @ITEM (cad_assembly_ebony_psimetal): The $(item)Ebony Psimetal CAD Assembly$(0) is a top-tier type of $(item)Assembly.$(0)$(p)It's slightly less efficient, but can handle more $(thing)Potency$(0), than its $(item)Ivory$(0) counterpart.
// TODO: shorten the title here
@RECIPE (cad_assembly_ebony): The big guns (so to speak)
#!ivory @ITEM (cad_assembly_ivory_psimetal): The $(item)Ivory Psimetal CAD Assembly$(0) is a top-tier type of $(item)Assembly.$(0)$(p)It's slightly less potent, but has a greater $(thing)Efficiency$(0), than its $(item)Ebony$(0) counterpart.
@RECIPE (cad_assembly_ivory): Go with the flow
#core icon:cad_core_basic Cores
A $(thing)CAD$(0)'s $(item)Core$(0) is essentially its CPU-- it's responsible for reading a $(thing)Spell$(0) from the $(item)Socket$(0), running calculations, and using $(thing)Psi energy$(0) to create the effects of $(thing)Tricks$(0) in the world.$(p)$(item)CAD Cores$(0) are crafted with four of a $(thing)Psi$(0)-conductive material placed around a central piece of dust (as a processor).
Every $(item)CAD Core$(0) has a $(thing)Complexity$(0) value, which is the maximum number of computations ($(thing)Selectors$(0), $(thing)Operators$(0), non-debug $(thing)Tricks$(0)) the $(item)Core$(0) can perform per-$(thing)Spell$(0).$(p)A $(item)Core$(0) also has a $(thing)Projection$(0), which is simply the total number of non-debug $(thing)Tricks$(0) it can perform at once.
#!basic @ITEM (cad_core_basic): Crafted from an $(item)Iron$(0) shell around a piece of $(item)Psidust$(0), the $(item)Basic CAD Core$(0) is often the first $(item)CAD Core$(0) a mage crafts.$(p)It's not fantastic (in particular, it can only cast one $(thing)Trick$(0) at a time), but it's quite sufficient for a beginner's needs.
@RECIPE (cad_core_basic): Spell it out
#!overclocked @ITEM (cad_core_overclocked): Substituting $(item)Psimetal$(0) for $(item)Iron$(0) around a $(item)CAD Core$(0) allows us to use a different dust component in the $(item)Core$(0)'s center.$(p)If $(item)Redstone Dust$(0) is used for the dust, we get a $(item)Overclocked CAD Core$(0), which boasts twice the $(thing)Complexity$(0) of its $(l:components/core#basic)$(item)Basic$(0)$(/l) predecessor, and thrice the $(thing)Projection$(0).
@RECIPE (cad_core_overclocked): A hat trick
#!conductive @ITEM (cad_core_conductive): If, instead, we place a piece of $(item)Glowstone Dust$(0) within a $(item)Psimetal$(0) shell, we create a $(item)Conductive CAD Core$(0).$(p)This $(item)Core$(0) handles less $(thing)Complexity$(0) than its $(item)Redstone Dust$(0)-based counterpart, but can handle four $(thing)Tricks$(0) at once, over the $(l:components/core#overclocked)$(item)Overclocked$(0)$(/l)'s three.
@RECIPE (cad_core_conductive): Some real tricky business
#!hyperclocked @ITEM (cad_core_hyperclocked): Embedding two $(item)Psigems$(0) into the recipe for a $(item)CAD Core$(0) creates $(o)serious$() performance benefits.$(p)The $(item)Hyperclocked CAD Core$(0), with $(item)Redstone Dust$(0) at its center, has double the $(thing)Complexity$(0) of a $(l:components/core#conductive)$(item)Conductive$(0)$(/l) core $(o)and$() double the $(thing)Projection$(0) of an $(l:components/core#overclocked)$(item)Overclocked$(0)$(/l) one.
@RECIPE (cad_core_hyperclocked): Won't tell the time, though
#!radiative @ITEM (cad_core_radiative): If we use $(item)Psigems$(0) in a $(item)CAD Core$(0) with $(item)Glowstone Dust$(0) at its center, we get a $(item)Radiative CAD Core$(0).$(p)This $(item)Core$(0) has a lesser $(thing)Projection$(0) than the $(l:components/core#hyperclocked)$(item)Hyperclocked$(0)$(/l) one, but has the capability to execute a staggering $(o)seven$() $(thing)Tricks$(0) per-cast.
@RECIPE (cad_core_radiative): No technetium involved

#socket icon:cad_socket_basic Sockets
A $(thing)CAD$(0)'s $(item)Socket$(0) is basically its bullet clip.$(p)It's what $(item)Spell Bullets$(0) are loaded into, and it's responsible for transferring the compiled $(thing)Spells$(0) contained within the $(thing)Bullets$(0) to the $(item)Core$(0) for processing.$(p)$(item)Sockets$(0) are crafted with a piece of dust, which interfaces with the $(thing)Bullets$(0), on a metallic substrate.
A $(item)Socket$(0) has a $(thing)Bandwidth$(0), which is the maximum size (in grid spaces) of a $(thing)Spell$(0) that it can transfer to a $(item)Core$(0), all at once-- for example, a $(item)Socket$(0) with bandwidth 5 could transfer a $(thing)Spell$(0) up to 5x5 in dimension.$(p)It also has, well, a number of $(item)Sockets$(0), which are compartments that can hold one $(item)Spell Bullet$(0) each.
#!basic @ITEM (cad_socket_basic): The $(item)Basic CAD Socket$(0) is the simplest of $(item)Sockets$(0), crafted from $(item)Psidust$(0) on a substrate of $(item)Iron$(0).$(p)It holds up to four $(item)Spell Bullets$(0) at a time, and can transfer $(thing)Spells$(0) up to 5x5 in size.
@RECIPE (cad_socket_basic): Plug & chug
#!signaling @ITEM (cad_socket_signaling): Replacing the $(item)Iron$(0) substrate in a $(item)Socket$(0) with a metal that's more conductive to $(thing)Psi energy$(0) (i.e. $(item)Psimetal$(0)) allows us to choose a different dust to interface with the $(item)Spell Bullets$(0).$(p)Using $(item)Redstone Dust$(0) gets us a $(item)Signaling CAD Socket$(0), which holds up to six $(thing)Bullets$(0), each with a $(thing)Spell$(0) up to 7x7 in size.
@RECIPE (cad_socket_signaling): Do ya feel lucky, punk?
#!large @ITEM (cad_socket_large): Placing $(item)Glowstone Dust$(0) on a $(item)Psimetal$(0) substrate creates a $(item)Large CAD Socket$(0).$(p)This $(item)Socket$(0) can't handle $(thing)Spells$(0) as large as its $(l:components/socket#signaling)$(item)Signaling$(0)$(/l) counterpart can, only managing those up to 6x6 in size, but can hold up to eight $(thing)Bullets$(0) at a time.
@RECIPE (cad_socket_large): Practically endless
#!transmissive @ITEM (cad_socket_transmissive): Augmenting a $(item)Socket$(0) in its recipe with a $(item)Psigem$(0) makes it transfer a lot more data, a lot faster.$(p)A $(l:components/socket#signaling)$(item)Signaling CAD Socket$(0)$(/l) with such an augmentation becomes a $(item)Transmissive CAD Socket$(0), which can hold up to ten $(thing)Bullets$(0), and can in fact handle $(o)any$() $(thing)Spell$(0) that fits in a $(item)Spell Programmer$(0).
@RECIPE (cad_socket_transmissive): Avaritia's Bane
#!huge @ITEM (cad_socket_huge): A $(l:components/socket#large)$(item)Large CAD Socket$(0)$(/l), augmented with a $(item)Psigem$(0), becomes the imaginatively-named $(item)Huge CAD Socket$(0).$(p)One of these doesn't have the $(thing)Bandwidth$(0) of its $(l:components/socket#transmissive)$(item)Transmissive$(0)$(/l) counterpart (only $(thing)Spells$(0) that are 8x8 or smaller), but can store up to a full dozen $(item)Spell Bullets$(0).
@RECIPE (cad_socket_huge): Hope Ophiuchus doesn't mind

#battery icon:cad_battery_basic Batteries
A $(item)CAD Battery$(0) is an optional attachment to a $(thing)CAD$(0), allowing it to indefinitely store a small amount of its user's $(thing)Psi energy$(0)-- its $(thing)Overflow$(0) represents how much.$(p)A $(item)Battery$(0) discharges after its user's main supply of $(thing)Psi energy$(0) runs out, but before the $(thing)CAD$(0) taps into its user's health.
In effect, a $(item)Battery$(0) is meant to be a small safety net of stored $(thing)Psi energy$(0).$(p)It's there so that you can overdraw a $(o)bit$(), without taking damage or having to wait for your $(thing)Psi energy$(0) to refill.$(p)All $(item)Batteries$(0) are crafted with a $(thing)Psi energy$(0)-conductive material enclosed between an $(item)Iron$(0) and a $(item)Gold Ingot$(0).$(p)A $(item)Battery$(0)'s current charge can be accessed from a $(thing)Spell$(0) with $(piece)Selector: Caster Battery$(0).
#!basic @RECIPE (cad_battery_basic): Not lithium-ion
#!extended @RECIPE (cad_battery_extended): It's pretty metal
#!ultradense @RECIPE (cad_battery_ultradense): Call 1-(800)-BATTERY

#colorizer icon:cad_colorizer_psi Colorizers
A $(item)CAD Colorizer$(0) is an optional attachment to a $(thing)CAD$(0) that modifies the color of its user's $(thing)Psi energy$(0) as it manifests in the physical world.$(p)All $(item)Colorizers$(0) are crafted with a base of an $(item)Iron Ingot$(0), a piece of $(item)Psidust$(0) on top, two pieces of $(item)Glass$(0) (one on either side), and of course a color item to apply in the center. 
A $(item)Colorizer$(0) can be crafted with any of the sixteen vanilla $(item)Dyes$(0) for their respective colors.$(p)If $(item)Prismarine Crystals$(0) are used in place of a dye, the resulting $(item)Colorizer$(0) will shift through the colors of the rainbow.$(p)If, on the other hand, $(o)no$() color item is used, the resulting $(item)Colorizer$(0) will $(o)draw$() color $(o)out$() of the user's $(thing)Psi energy$(0), and the resulting particles will be nigh-invisible.
Using a piece of $(item)Psidust$(0) as the color item in the $(item)Colorizer$(0) seems to have no known effect for most people, though $(l:https://www.patreon.com/Vazkii)certain individuals have reported differently$(/l).$(p)A $(item)Colorizer$(0) in a $(thing)CAD$(0) affects:$(li)particles emitted by the $(thing)CAD$(0);$(li)projectiles and $(thing)Spell Circles$(0) cast;$(li)blocks and lights conjured by the $(piece)conjuration tricks$(0).
@RECIPES (cad_colorizer_:psi;rainbow;empty;white;orange;magenta;light_blue;yellow;lime;pink;gray;light_gray;cyan;purple;blue;brown;green;red;black): Taste the Rainbow


##items icon:spell_bullet Items; This section is filled to the brim with all sorts of items, tools, and utilities you can use to enhance your $(thing)Spell$(0)-casting experience.

#spell_bullet+ Spell Bullet Types
A $(item)Spell Bullet$(0) is a simple device-- when inserted into a $(thing)CAD$(0)'s $(item)Socket$(0), it simply provides its contained $(thing)Spell$(0)'s data (and metadata) to the $(thing)CAD$(0).$(p)But $(thing)Bullets$(0) come in several types, each with their own merits.$(p)Each entry linked on the next page has more detailed information on that type of $(thing)Bullet$(0).
// TODO: debug this
@LIST (items/:spell_bullet,projectile_bullet,loopcast_bullet,circle_bullet,grenade_bullet,charge_bullet,mine_bullet) Types of Bullets: If you want a specific type of $(item)Spell Bullet$(0), here you go.
Every type of $(item)Spell Bullet$(0) is crafted with an $(item)Iron Ingot$(0) and a piece of $(item)Psidust$(0), horizontally placed in a crafting grid.$(p)If nothing else is added to the recipe, this yields the most basic type of $(item)Spell Bullet$(0), (somewhat confusingly) just called the $(item)Spell Bullet$(0).$(p)Other types of $(item)Spell Bullet$(0) require one more ingredient, placed horizontally adjacent to the $(item)Iron Ingot$(0).
The ingredients for other types of $(item)Spell Bullets$(0) are as follows:$(li)a $(item)Projectile Spell Bullet$(0) needs some kind of $(item)Arrow$(0),$(li)a $(item)Loopcast Spell Bullet$(0) needs a piece of $(item)String$(0),$(li)a $(item)Circle Spell Bullet$(0) needs, well, something circular (a $(item)Snowball$(0) or a $(item)Slimeball$(0)),$(li)a $(item)Grenade Spell Bullet$(0) needs a piece of $(item)Gunpowder$(0),$(li)a $(item)Charge Spell Bullet$(0) needs a piece of $(item)Redstone Dust$(0), and$(li)a $(item)Mine Spell Bullet$(0) needs some kind of $(item)Button$(0).
Before a $(item)Spell Bullet$(0) can be loaded into a $(thing)CAD$(0), it needs to have a $(thing)Spell$(0) stored on it.$(p)To store a $(thing)Spell$(0) on a $(item)Spell Programmer$(0) in a $(thing)Bullet$(0), just swipe the $(item)Spell Bullet$(0) over the $(item)Programmer$(0) ($(k:use)).$(p)A $(thing)Spell$(0) stored in a $(item)Spell Bullet$(0) can be copied into an empty $(item)Spell Drive$(0) in a crafting grid for storage purposes.
A $(item)Spell Programmer$(0) displays a $(thing)Cost$(0) for any $(thing)Spell$(0) it compiles successfully-- yet for different types of $(thing)Bullets$(0), this $(thing)Cost$(0) can be different.$(p)The $(item)Programmer$(0)'s value is calibrated to the most basic type of $(item)Spell Bullet$(0), (somewhat confusingly) just called the $(item)Spell Bullet$(0).
All other types of $(item)Spell Bullet$(0) display a $(thing)Cost Multiplier$(0) in percentage, which can simply be multiplied by the cost displayed on the $(item)Programmer$(0) to determine the $(thing)Spell$(0)'s true $(thing)Cost$(0) for that $(thing)Bullet$(0) type.$(p)For example, if a $(thing)Spell$(0) displays a final cost of 300 in a $(item)Programmer$(0), when copied into a $(item)Projectile Spell Bullet$(0) (with a $(thing)Cost Multiplier$(0) of 102%%) it would have a true $(thing)Cost$(0) of$(br)300 × 102%% = 306 $(thing)Psi energy$(0) per cast.
Many $(item)Spell Bullet$(0) types introduce a delay between when the $(thing)Spell$(0) is cast, and when it actually gets executed.$(p)Thus, it's important to note that the $(thing)Cost$(0) of a $(thing)Spell$(0) being cast is paid upfront in full, and is non-refundable-- even if the $(thing)Tricks$(0) in the $(thing)Spell$(0) don't actually get cast.
#!focal_point Every $(thing)Spell$(0), when cast, has a $(thing)Focal Point$(0).$(p)A $(thing)Focal Point$(0) is where the caster's $(thing)Psi energy$(0) is projected into the world (as one or more $(thing)Tricks$(0)).$(p)Of course, a $(thing)Focal Point$(0) can't execute any $(thing)Tricks$(0) or evaluate any $(thing)Selectors$(0) from further than 32 blocks away (excepting those that affect its caster).$(p)A $(thing)Spell$(0) can access its $(thing)Focal Point$(0) using $(piece)Selector: Focal Point$(0).
The location of a $(thing)Focal Point$(0) depends on the type of $(item)Spell Bullet$(0) it's cast from.$(p)The basic $(item)Spell Bullet$(0)'s $(thing)Focal Point$(0) is simply the caster of the $(thing)Spell$(0), but other types of $(item)Spell Bullet$(0) can create different $(thing)Focal Points$(0).$(p)For example, a $(item)Projectile Spell Bullet$(0)'s $(thing)Focal Point$(0) is the projectile itself.$(p)For more info on each $(thing)Bullet$(0) type's $(thing)Focal Points$(0) and quirks, consult individual entries.

#basic_bullet icon:spell_bullet Spell Bullet
The simplest type of $(item)Spell Bullet$(0) (and the namesake of the line of items), the humble $(item)Spell Bullet$(0) stores a $(thing)Spell$(0) that's ready for execution.$(p)When loaded into a $(thing)CAD$(0) by way of a $(item)CAD Assembler$(0), it allows the $(thing)CAD$(0) to cast the $(thing)Spell$(0) stored within.
Selecting the $(item)Spell Bullet$(0) from the $(thing)CAD$(0) and pressing $(k:use) will immediately execute the $(thing)Spell$(0) stored within. The $(thing)Focal Point$(0) for this type of $(thing)Bullet$(0) is just the caster.$(p)Other, more advanced $(item)Spell Bullets$(0) can do interesting things, though! Check out $(l:items/spell_bullet)the list$(/l) for more info.
@RECIPE (spell_bullet_basic): No gunpowder necessary

#projectile_bullet icon:spell_bullet_projectile Projectile Spell Bullet
A $(thing)Spell$(0) cast from a $(item)Projectile Spell Bullet$(0) doesn't execute immediately.$(p)Instead, a fast-moving $(thing)Spell Projectile$(0) containing it is fired out the end of the $(thing)CAD$(0) from which it's cast.$(p)This projectile acts as the $(thing)Focal Point$(0) for its $(thing)Spell$(0), executing it when the projectile collides with something.
@RECIPE (spell_bullet_projectile): Not quite high noon
A $(thing)Spell Projectile$(0) isn't physical; instead, it's a thin wrapper of $(thing)Psi energy$(0) around its contained $(thing)Spell$(0) (hence the extra cost in the $(thing)Bullet$(0)).$(p)As such, it can last for up to thirty seconds before dissipating.$(p)A $(thing)Spell Projectile$(0) moves quite swiftly, and can travel more than 200 blocks' distance without assistance in its lifespan.
The projectile's stored $(thing)Spell$(0) will activate if it collides with any blocks or entities.$(p)In the case of the latter, $(piece)Selector: Attack Target$(0) can be used to identify the entity that was hit.$(p)On the other hand, if the projectile hits $(o)nothing$() in that time, the $(thing)Spell$(0) will fizzle, wasting the $(thing)Psi energy$(0) invested into it-- so aim carefully!

#loopcast_bullet icon:spell_bullet_loop Loopcast Spell Bullet
A $(thing)Spell$(0) cast from a $(item)Loopcast Spell Bullet$(0) is executed as if from a plain $(item)Spell Bullet$(0).$(p)Repeatedly.$(p)A $(thing)Spell$(0) cast from one of these $(thing)Bullets$(0) is executed over and over nonstop, four times a second, until the $(thing)CAD$(0) it was cast from stops being held in the same hand, or a different $(thing)Spell$(0) is selected.
@RECIPE (spell_bullet_loopcast): The definition of insanity
The $(thing)Focal Point$(0) for a $(thing)Spell$(0) cast from a $(item)Loopcast Spell Bullet$(0) is just the caster, and the full $(thing)Psi energy$(0) cost is incurred on each execution.$(p)The major advantage of using one of these $(thing)Bullets$(0) over just casting repeatedly really fast lies in the $(o)regeneration$() of your $(thing)Psi energy$(0).
When you cast a $(thing)Spell$(0) (or when you take damage), your $(thing)Psi energy$(0) is momentarily left in a state of disequilibrium; it can't regenerate until you can focus inward and restabilize it.$(br)While not difficult, this restabilization takes a bit of time to achieve.$(p)But when you cast from a $(item)Loopcast Spell Bullet$(0), this delay only occurs $(o)initially$()-- afterwards, the $(thing)Bullet$(0) makes no disruptions in your $(thing)Psi energy$(0), allowing it to regenerate as normal.
A $(thing)Spell$(0) cast from one of these $(thing)Bullets$(0) can do different things on each invocation.$(p)Specifically, $(piece)Selector: Loopcast Index$(0) returns the number of times the $(thing)Spell$(0) has been executed since you first cast it.$(p)Thus, it returns 1 the first time the $(thing)Spell$(0) executes, 2 the second time, and so on.
When used with $(piece)Operator: Integer Divide$(0) and $(piece)Operator: Modulus$(0), these $(thing)Bullets$(0) can perform operations $(o)en masse$() over wide areas with ease.

#circle_bullet icon:spell_bullet_circle Circle Spell Bullet
A $(thing)Spell$(0) cast from a $(item)Circle Spell Bullet$(0) is executed consecutively exactly twenty times.$(p)When the $(thing)Spell$(0) is first cast, a $(thing)Spell Circle$(0) is conjured at the point the caster is looking at, which acts as the $(thing)Focal Point$(0) for the $(thing)Spell$(0). This circle executes the $(thing)Spell$(0) four times a second until it runs out of $(thing)Psi energy$(0), five seconds later.
@RECIPE (spell_bullet_circle): The Costco of spellslinging
A $(thing)Spell Circle$(0), when first cast, is conjured up to 32 blocks away from the caster's position or at the nearest block they look at (whichever is closer).$(p)Similarly to a $(item)Loopcast Spell Bullet$(0), a $(thing)Spell$(0) cast from a $(thing)Spell Circle$(0) can know which iteration it's on using $(piece)Selector: Loopcast Index$(0) (which will return a number from 1 to 20, inclusive).
A $(thing)Spell Circle$(0) drains all the $(thing)Psi energy$(0) it needs when it's first cast, hence its $(thing)Cost Multiplier$(0) of a whopping 1500%%.$(p)However, its voracious $(thing)Cost$(0) is not without benefit; its compact, self-contained design makes it $(o)extremely$() efficient, allowing it to execute a $(thing)Spell$(0) 20 times for the cost of 15.$(p)For those of you keeping track, that's a full 25%% discount per-execution.
$(item)Circle Spell Bullets$(0) are popular among spellslingers new and experienced both for their versatility and their conservation of $(thing)Psi energy$(0).$(p)As such, there are several relatively common $(thing)Tricks$(0) used with $(item)Circle Spell Bullets$(0) in particular that aren't seen elsewhere.
The $(thing)Circlesync$(0) idiom, relatively simple to build, allows all twenty executions of the $(thing)Spell$(0) to happen at once, allowing them to accumulate into a much grander effect than a single execution would alone.$(p)The $(thing)20-Bit Tower$(0) idiom has a slightly more difficult setup involving a $(item)Vector Ruler$(0); but allows a $(thing)Spell$(0) to only do something on a subset of its twenty executions.
#!circlesync(Circlesync) The $(thing)Circlesync$(0) idiom (pictured at right) uses $(piece)Trick: Sleep$(0) at its core.$(p)When placed in the $(thing)Spell$(0), it delays each execution corresponding exactly to the time left until the final $(thing)Trick$(0) activates.$(p)Any $(thing)Tricks$(0) placed after the $(piece)Trick: Sleep$(0), then, execute simultaneously.
@IMAGE (circle_bullet_circlesync): When the stars align... 
#!20b_tower(20-Bit Tower) The $(thing)20-Bit Tower$(0) idiom is a rather advanced technique, rather technical in design.$(p)To use it, select a block with a $(item)Vector Ruler$(0), then place some blocks (it doesn't matter what kind) in the twenty-block-high vertical space directly above the location you selected, then copy the code on the following page to the top of your $(thing)Spell$(0).
Each block position in that vertical space represents one execution of the $(thing)Spell$(0); the bottommost location of the tower represents the first execution, the next location the second, and so on.$(p)An empty space in a tower represents "$(o)DO$() execute on that iteration," and a block in that position tells the $(thing)Spell$(0) "$(o)DON'T$()."$(p)Finally, copy the code on the next page to the top of your $(thing)Spell$(0).
// TODO: actually explain the mechanics
@IMAGE (circle_bullet_20b_tower): Conditionally

#grenade_bullet icon:spell_bullet_grenade Grenade Spell Bullet
A $(thing)Spell$(0) cast from a $(item)Grenade Spell Bullet$(0), instead of executing immediately, is fired out the end of the $(thing)CAD$(0) it was cast as a $(thing)Spell Grenade$(0).$(p)Unlike a $(thing)Spell Projectile$(0), though, a grenade $(o)is$() affected by gravity.$(p)It executes its contained $(thing)Spell$(0) after exactly three seconds, no sooner and no later.
@RECIPE (spell_bullet_grenade): Pull the trigger, not the pin
A $(thing)Spell Grenade$(0) is an intangible thin wrapper of $(thing)Psi energy$(0), created from the excess drawn by the $(item)Grenade Spell Bullet$(0).$(p)The conjured grenade also acts as the $(thing)Focal Point$(0) for the $(thing)Spell$(0) when it executes.$(p)While its uses appear rather limited at first, a $(thing)Spell Grenade$(0) can reach places a $(thing)Spell Projectile$(0) can't (e.g. over a wall, or inside a hole).
A $(thing)Spell Grenade$(0) will record the last entity it comes into contact with.$(p)When its contained $(thing)Spell$(0) executes, this entity can be accessed from $(piece)Selector: Attack Target$(0), if applicable.

#charge_bullet icon:spell_bullet_charge Charge Spell Bullet
A $(thing)Spell$(0) cast from a $(item)Charge Spell Bullet$(0), rather than executing immediately, is fired out the end of the $(thing)CAD$(0) it's cast from in a $(thing)Spell Charge$(0), which obeys gravity just like a $(thing)Spell Grenade$(0).$(p)However, unlike a $(thing)Spell Grenade$(0), a $(thing)Spell Charge$(0) can last up to five minutes, and only executes its $(thing)Spell$(0) when specially told to do so by a $(item)Spell Detonator$(0).
@RECIPE (spell_bullet_charge): They build up
A $(thing)Spell Charge$(0) is a stable shell of $(thing)Psi energy$(0) around its contained $(thing)Spell$(0), acting as the $(thing)Spell$(0)'s $(thing)Focal Point$(0) when executed.$(p)If the $(thing)Spell Charge$(0) is never activated within its lifetime, it simply dissipates, fizzling the $(thing)Spell$(0) within and wasting the invested $(thing)Psi energy$(0).
However, many $(thing)Spell Charges$(0) in close proximity can all be activated at once by a single $(item)Spell Detonator$(0) (or $(piece)Trick: Detonate$(0)), making them quite useful for mass effect.$(p)A $(thing)Spell Charge$(0) will record the last entity it bumps into (or, as may occur, the last entity to step on it).$(p)When its contained $(thing)Spell$(0) executes, this entity can be accessed from $(piece)Selector: Attack Target$(0), if applicable.

#mine_bullet icon:spell_bullet_mine Mine Spell Bullet
A $(thing)Spell$(0) cast from a $(item)Mine Spell Bullet$(0) is fired out of the $(thing)CAD$(0) it was cast in a $(thing)Spell Mine$(0).$(p)A $(thing)Spell Mine$(0) obeys gravity and has a five-minute lifespan. It only executes its stored $(thing)Spell$(0) once stepped on by someone (or something).
@RECIPE (spell_bullet_mine): Country roads...
A $(thing)Spell Mine$(0)'s conditions for execution are rather finicky; a mine begins by staying on the ground and waiting to be stepped on.$(p)When one or more entities step on it, the mine doesn't trigger right away; instead it merely primes itself.$(p)When it's primed and there are no longer any entities atop it, then and only then will it execute its contained $(thing)Spell$(0).
The entity that triggered the $(thing)Spell$(0) (i.e. the last entity to step off the $(thing)Spell Mine$(0)) is accessible from $(piece)Selector: Attack Target$(0).$(p)However, if a $(thing)Spell Mine$(0)'s activation conditions are never met within its lifetime, the mine will simply dissipate, fizzling its stored energy.$(p)So if you end up landing on a $(thing)Spell Mine$(0), waiting it out might just be preferable to knowing what the caster has in store for you.

// TODO merge into charge bullet
#detonator icon:detonator Spell Detonator
A $(item)Spell Detonator$(0) is crafted from two $(item)Iron Ingots$(0), $(item)Psidust$(0), and a $(item)Button$(0).$(p)It serves exactly one function: when it's actuated ($(k:use)), it activates every single $(thing)Spell Charge$(0) (and $(item)Exosuit Detonation Sensor$(0)) cast by you in a 32-block radius, instructing them to simultaneously execute their contained $(thing)Spells$(0).
@RECIPE (detonator): The first bomb

#exosuit+ icon:exosuit_controller Psimetal Exosuit
A $(thing)Psimetal Exosuit$(0) is a suit of armor allowing you to seamlessly integrate $(thing)Spell$(0)-casting into your everyday adventuring!$(p)Each piece of the $(thing)Exosuit$(0) is crafted from two $(item)Psigems$(0) and some $(item)Psimetal$(0), and is capable of casting a $(thing)Spell$(0) when its respective trigger is activated.
The suits' $(thing)Spells$(0) are cast with your $(thing)CAD$(0) as a focus, so the usual $(thing)CAD$(0) limits apply.$(p)Each piece of the $(thing)Psimetal Exosuit$(0) can be loaded with up to three $(item)Spell Bullets$(0) in a $(item)CAD Assembler$(0), though sadly, some $(item)Spell Bullet$(0) variants don't play well with the suit.$(p)A suit piece remembers the number of times it's successfully cast a $(thing)Spell$(0); this count can be accessed from $(piece)Selector: Success Counter$(0).
#!controller @ITEM(exosuit_controller): To select which $(thing)Spell$(0) to use for a suit piece, craft an $(item)Exosuit Controller$(0) from $(item)Redstone Dust$(0), $(item)Glass$(0), and $(item)Psimetal$(0). To use the $(item)Controller$(0), hold it and press the $(thing)Psi master keybind$(0) ($(k:psimisc.keybind)).$(p)Use the right and left-mouse buttons to cycle through suit pieces.
@RECIPE (exosuit_controller): It's no JARVIS, but it works
Once you've selected the suit piece you want to configure, choose one of the $(item)Spell Bullets$(0) that's displayed the same way you would with your $(thing)CAD$(0).$(p)Selecting the empty fourth slot disables that suit piece completely-- no $(thing)Spells$(0) will be cast even if its activation criteria are met.
A $(thing)Psimetal Exosuit$(0) is slightly better than $(thing)Iron Armor$(0) in strength and durability.$(p)All pieces of a suit will draw from their wearer's excess $(thing)Psi energy$(0) to repair damage to themselves, a feat made possible by the $(item)Psigems$(0) used in their construction.
// TODO: remove Psimetal prefix
#!helmet @ITEM(psimetal_exosuit_helmet): The $(item)Psimetal Exosuit Helmet$(0) is the most configurable of the bunch, casting its designated $(thing)Spell$(0) whenever its contained $(thing)Exosuit Sensor$(0) triggers.$(p)A $(thing)Sensor$(0) attaches to and detaches from a $(item)Helmet$(0) in a crafting grid; a $(item)Helmet$(0) can only have one $(thing)Exosuit Sensor$(0) attached at a time.
@RECIPE (psimetal_exosuit_helmet): You hear a sound, turn around
#!chestplate @ITEM(psimetal_exosuit_chestplate): The $(item)Psimetal Exosuit Chestplate$(0) casts its selected $(thing)Spell$(0) whenever its user takes any form of damage.$(p)$(piece)Selector: Attacker$(0) and $(piece)Selector: Damage Taken$(0) can be used to identify the source and amount of damage, respectively.
@RECIPE (psimetal_exosuit_chestplate): Explosive Thorns
#!leggings @ITEM(psimetal_exosuit_leggings): $(item)Psimetal Exosuit Leggings$(0) $(o)never stop$() casting their selected $(thing)Spell$(0).$(p)In fact, they do so once per $(thing)CAD$(0) tick, which is a unit of time equal to 0.05 seconds.$(p)They're quite popular as "better $(item)Loopcast Spell Bullets$(0)."
@RECIPE (psimetal_exosuit_leggings): while(true) {}
#!boots @ITEM(psimetal_exosuit_boots): $(item)Psimetal Exosuit Boots$(0) simply cast their designated $(thing)Spell$(0) when their wearer jumps off the ground.$(p)No more, no less.
@RECIPE (psimetal_exosuit_boots): Jump Boost-- er, Boots

// TODO merge into charge bullet
#exosuit_sensor icon:exosuit_sensor_light Exosuit Sensors
$(thing)Exosuit Sensors$(0) are small devices designed to be embedded into larger pieces of armor (e.g. the $(item)Psimetal Exosuit Helmet$(0)), and to signal their containing armor when triggered.$(p)Each $(thing)Sensor$(0) has a different condition for what triggers it.
All $(thing)Sensors$(0) are crafted from two $(item)Iron Ingots$(0) and two of $(item)Psimetal$(0) around a reagent; the reagent used determines the resulting $(thing)Sensor$(0)'s effect:$(li)the $(item)Light Sensor$(0) uses $(item)Glowstone Dust$(0);$(li)the $(item)Heat Sensor$(0) uses a $(item)Fire Charge$(0);$(li)the $(item)Stress Sensor$(0) uses a slice of $(item)Glistering Melon$(0);$(li)the $(item)Water Sensor$(0) uses $(item)Prismarine Crystals$(0);$(li)the $(item)Detonation Sensor$(0) uses $(item)Gunpowder$(0).
#!light @ITEM(exosuit_sensor_light): The $(item)Exosuit Light Sensor$(0) triggers once whenever its wearer moves into a dark area (i.e. an area that's dark enough to spawn monsters) from a non-dark area.$(p)It can be manually triggered in a dark area with a $(piece)Trick: Conjure Light$(0) on a timer.
// TODO: remove Exosuit prefix
@RECIPE (exosuit_sensor_light): Who turned out the lights?
#!heat @ITEM(exosuit_sensor_heat): The $(item)Exosuit Heat Sensor$(0) triggers whenever its wearer catches fire.$(p)$(piece)Trick: Fire Resistance$(0) or $(piece)Trick: Torrent$(0) are good responses to this $(thing)Sensor$(0) triggering, unless you $(o)really$() know what you're doing.
@RECIPE (exosuit_sensor_heat): We carry on
#!stress @ITEM(exosuit_sensor_stress): The $(item)Exosuit Stress Sensor$(0) triggers when its wearer is low on health (specifically, if the wearer is at three hearts or less).$(p)$(piece)Trick: Regeneration$(0) might be a good response to this issue.
@RECIPE (exosuit_sensor_stress): Don't panic
#!water @ITEM(exosuit_sensor_water): The $(item)Exosuit Water Sensor$(0) triggers when its wearer touches water.$(p)With a bit of ingenuity, it can be triggered manually via $(piece)Trick: Torrent$(0).
@RECIPE (exosuit_sensor_water): Make a splash
#!trigger @ITEM(exosuit_sensor_trigger): The $(item)Exosuit Detonation Sensor$(0) triggers whenever a $(item)Spell Detonator$(0) is actuated within a 32-block radius, or when a $(piece)Trick: Detonate$(0) is cast in the same area.
@RECIPE (exosuit_sensor_trigger): At the push of a button

#tools+ icon:psimetal_pickaxe Psimetal Tools
The $(thing)Psimetal Tools$(0) are a set of tools, comparable to $(item)Diamond$(0)-tier in quality, each of which can cast a $(thing)Spell$(0) each time it performs its intended action.$(p)All $(thing)Psimetal Tools$(0) are crafted with $(item)Iron Ingots$(0) in place of $(item)Sticks$(0), one $(item)Psigem$(0), and some $(item)Psimetal$(0).
@RECIPES (psimetal_:sword;shovel;pickaxe;axe): It's a bonus action
A $(thing)Psimetal Tool$(0) can be loaded with up to three $(item)Spell Bullets$(0) in a $(item)CAD Assembler$(0) (though some $(item)Spell Bullets$(0) don't play well with the tools).$(p)To select the $(item)Spell Bullet$(0) to use for a tool, hold the $(thing)Psi master keybind$(0) ($(k:psimisc.keybind)) and select from the menu as usual.$(p)Picking an empty slot from the menu disables the tool from casting entirely.
All $(thing)Psimetal Tools$(0) except the $(item)Psimetal Sword$(0) cast their selected $(thing)Spell$(0) once each time they break a block.$(p)The $(item)Sword$(0) instead casts each time it hits a living being (though it should be noted for strategic purposes that once damaged, a living thing is invulnerable for half a second).$(p)$(thing)Psimetal Tools$(0) will draw from their wielder's excess $(thing)Psi energy$(0) to repair themselves.
$(thing)Psimetal Tools$(0) also get some convenient integration with $(thing)Spell Pieces$(0).$(p)When the $(item)Psimetal Sword$(0) casts a $(thing)Spell$(0), $(piece)Selector: Attack Target$(0) returns the mob you whacked to do so.$(p)When one of the other $(thing)Tools$(0) breaks a block, $(piece)Selector: Block Broken$(0) returns the position of the broken block, and $(piece)Selector: Block Broken Side$(0) returns the axial vector corresponding to the direction the block was broken from.

#vector_ruler+ icon:vector_ruler Vector Ruler
A $(item)Vector Ruler$(0) can store an arbitrary vector, which can then be accessed from within a $(thing)Spell$(0) at your convenience.$(p)It's made from $(item)Iron Ingots$(0) and a tip of $(item)Psidust$(0).
@RECIPE (vector_ruler): Vectors rule
Tapping a $(item)Ruler$(0) on a block ($(k:use)) while crouching stores that block's position in the $(item)Ruler$(0) as a vector.$(p)Once a block's position is stored, tapping the $(item)Ruler$(0) without crouching on another block will store the offset between the two blocks.$(p)A $(item)Ruler$(0)'s stored vector can be accessed with $(piece)Selector: Vector Ruler$(0).
If you happen to be carrying several $(item)Rulers$(0) at a time, $(piece)Selector: Vector Ruler$(0) will return the stored value of the leftmost $(item)Ruler$(0) in your hotbar, or the highest $(item)Ruler$(0) in your inventory if your hotbar has none.

#spell_drive+ icon:spell_drive Spell Drive
A $(item)Spell Drive$(0), crafted from two ingots of $(item)Psimetal$(0) and a piece of $(item)Redstone Dust$(0), can store a single $(thing)Spell$(0) for later use.$(p)To store a $(thing)Spell$(0) in a $(item)Spell Programmer$(0) onto a $(item)Drive$(0), crouch and swipe ($(k:use)) an empty $(item)Drive$(0) over it.$(p)To copy a $(thing)Spell$(0) back, crouch-swipe a $(item)Drive$(0) with a $(thing)Spell$(0) stored over the $(item)Programmer$(0).
@RECIPE (spell_drive): Build yourself a library
To clear a stored $(thing)Spell$(0), crouch-swipe the $(item)Drive$(0) over any other block.$(p)A $(item)Drive$(0) with a stored $(thing)Spell$(0) can be placed in a crafting grid with an empty $(item)Drive$(0) or $(item)Spell Bullet$(0) to copy its $(thing)Spell$(0) onto the latter.


##legacy icon:cad_assembly_gold Legacy Entries; These entries are a holdover from the days of $(thing)Psi$(0) for 1.12 and below. As this book fills up with rewritten documentation, this section will shrink in size until all documentation is ported, when it'll vanish for good.

#vectors101 icon:textures/spell/operator_vector_construct.png Vectors 101
The manipulation of vectors is an essential component to $(thing)Spell$(0) programming. Most vector operations are outlined $(l:basics/vector_primer#ops)here$(/l); the only missing piece is $(piece)Operator: Vector Cross Product$(0).
The $(l)cross product$() of two vectors is a vector that is perpendicular to both. You can make use of this to get a vector that points to your side, by taking the cross product of the player's look vector and [0, 1, 0] (which you can create with $(piece)Operator: Vector Construct$(0)). 

#entities101 icon:textures/spell/operator_closest_to_point.png Entities 101
The manipulation of entities is an essential component to $(thing)Spell$(0) programming. The most obvious entity to manipulate is you, the caster, via $(piece)Selector: Caster$(0). Other pieces, however, allow you to target other entities in the world.$(p)You can make use of those pieces to create $(thing)Spells$(0) that affect other entities. Try using them with $(piece)Trick: Add Motion$(0) to fling around others.

#blockworks icon:textures/spell/trick_break_in_sequence.png Blockworks
Working with blocks is an essential skill for a mage. You can, of course, refer to a block's position via a vector, so knowledge of vectors is important to understand how to work with blocks.$(p)Two of the most basic block pieces in this group are $(piece)Trick: Place Block$(0) and $(piece)Trick: Break Block$(0).
These both take a position vector, and respectively place and break a block at that position. $(piece)Trick: Place Block$(0) uses the block to the right of your $(thing)CAD$(0) in your hotbar for placing. Knowing the block position to break is easy; $(piece)Operator: Vector Raycast$(0) suffices.
However, placing a block is trickier: $(piece)Operator: Vector Raycast$(0) gives us the block the player is looking at. We can't place a block there-- there already $(o)is$() one! To remedy that, we can combine our $(piece)Operator: Vector Raycast$(0) with the $(piece)Operator: Vector Axis Raycast$(0) piece, which gives us a vector representing the side of the block we're looking at. 
For example, if we're looking at the top of the block, it'll give us the axial vector [0, 1, 0]. We can use $(piece)Operator: Vector Sum$(0) to add it to our plain Raycast to tell us where our block will go!$(p)$(piece)Operator: Entity Axial Look$(0) is similar to $(piece)Operator: Entity Look$(0), but returns a value snapped to one of the six axial vectors (e.g. if you're looking east, it returns [1, 0, 0]). Think of the "Facing" value in your F3 menu.
The other two $(thing)Tricks$(0) available here are $(piece)Trick: Place Block Sequence$(0) and $(piece)Trick: Break Block Sequence$(0). These $(thing)Tricks$(0) break or place a line of blocks. Similarly to the standard break and place $(thing)Tricks$(0), they require a position to start off, but they also require another Vector, "Target", that defines the direction to operate in. So if "Target" is [0, 1, 0], it'll place or break blocks starting from the value of "Position" upwards.
The last component to these $(thing)Tricks$(0) is "Max", this is a number constant for the maximum amount of blocks the $(thing)Trick$(0) is allowed to break or place. Since the vector requirements aren't constant, this works as means of calculating the Potency and Cost of the $(thing)Trick$(0). The higher you set it, the more the $(thing)Spell$(0) will cost.$(p)The last piece in this group is $(piece)Operator: Vector Project$(0).
Vector Projection is a somewhat complex topic, so we'll only explain a potential uses for it below.$(p)Say you want to make a $(thing)Spell$(0) that places blocks from your position in the world to the position you're looking at, but in a straight line aligned to the side of the block you're looking at (using $(piece)Operator: Vector Axis Raycast$(0)).
You start off by finding the vector that you want to place blocks along, so you can plug it into $(piece)Trick: Place Block Sequence$(0). If you're diagonal to the block, though, you may get something like [3, 2, 4]. That's not a straight line! We can use $(piece)Operator: Vector Project$(0) to project that into the axis of the side you're looking at, say, [0, 0, 1].
So our "Vector A" is [3, 2, 4] and our "Vector B" is [0, 0, 1]. Applying the projection leaves us with [0, 0, 4]. If our "Vector B", was, for example, [1, 0, 0], we'd get [3, 0, 0]. In general, when an axial vector is used for "Vector B", $(piece)Operator: Vector Project$(0) strips any components of A that are 0 in B, leaving you with a straight line.$(p)To put it all together, try making a $(thing)Spell$(0) that brings down an 8 block high column, so you can "treecapitate"!

#movement_advances icon:textures/spell/trick_blink.png Movement Advances
The basics of movement $(thing)Tricks$(0) were covered when we talked about $(piece)Trick: Add Motion$(0). This group has pieces that improve on that idea.$(p)$(piece)Trick: Blink$(0) simply teleports the target entity forwards in the direction they're looking in. A negative value will teleport the entity backwards.
$(piece)Trick: Mass Blink$(0) does the same as $(piece)Trick: Blink$(0), but accepts an Entity List instead; each entity in the list is individually affected by the $(thing)Trick$(0).$(p)$(piece)Trick: Mass Add Motion$(0) is similar; it's the Entity List version of $(piece)Trick: Add Motion$(0).$(p)Finally, $(piece)Trick: Mass Exodus$(0) pulls every entity in an Entity List towards a given position, at the given speed. A negative speed will push them away instead. 

#block_movement icon:textures/spell/trick_move_block.png Block Movement
The ability to move blocks isn't as important as the ability to break and place them, but happens to be quite useful nonetheless.$(p)$(piece)Trick: Move Block$(0) takes a position for a block in the world and moves it in the target vector's direction, as if it were pushed by a piston. The target vector must be axial; if it isn't, the $(thing)Trick$(0) will fail.
On the other hand, $(piece)Trick: Collapse Block$(0) causes a block to fall as if it were sand or gravel.$(p)Both these $(thing)Tricks$(0) will fail to execute on complex blocks (those known as Tile Entities) and blocks that can't be harvested with Silk Touch. 

#elemental_arts icon:textures/spell/trick_smite.png Elemental Arts
What's a magic system without the ability to cast elemental $(thing)Spells$(0)?$(p)This group contains $(thing)Tricks$(0) for the four elements; for example, $(piece)Trick: Smite$(0) summons a lightning bolt at the position it's told to.
The group also contains $(piece)Operator: Random$(0), a piece that will generate a random number between 0 (inclusive) and the number passed in (exclusive). This can be used alongside Loopcast or Spell Circle $(thing)Spells$(0) in many ways. For example, one can create a $(thing)Spell$(0) that would use $(piece)Trick: Overgrow$(0) to mass bone meal a plantation. 

#positive_effects icon:textures/spell/trick_speed.png Positive Effects
The ability to apply magical effects to things and people is a must-have feature of any magical lexicon worth its weight. We're not writing $(thing)Spells$(0) from a spellbook, but you can apply effects to entities anyway.$(p)All of the pieces in this group will apply their respective potion effect to the target entity, for the given time (in seconds).
If the piece also has a Power parameter, it represents the level of the effect to apply.$(p)For example, $(piece)Trick: Speed$(0) with Time 20 and Power 2 would apply a Speed II effect for 20 seconds to the target entity. 

#negative_effects icon:textures/spell/trick_wither.png Negative Effects
As one might expect, with $(l:legacy/positive_effects)Positive Effects$(/l) come Negative Effects.$(p)There isn't much to say here, really. All tricks in this group do exactly what they say on the tin.$(p)Have fun. 

#trigonometry icon:textures/spell/constant_pi.png Trigonometry
This group includes $(thing)Operators$(0) relevant to trigonometric functions. $(piece)Constant: Pi$(0) is exactly what it says on the tin, a constant that gives you the value of π=3.1415….$(p)This group includes elementary trigonometric operations as well: the sine and cosine functions, as well as their inverses (arcsine and arccosine).
Additionally, $(piece)Operator: Vector Dot Product$(0) returns the dot product of two vectors: the product of the two vectors' magnitudes times the cosine of the angle between them. Using $(piece)Operator: Arc Cosine$(0) on the result will allow you to get the angle between two vectors. 

#smeltery icon:textures/spell/trick_smelt_item.png Smeltery
The pieces in this group are function quite simply; they all smelt things into other things as if they had been put in a furnace.$(p)$(piece)Trick: Smelt Item$(0) will cook a single dropped item in the world into its smelted counterpart.
$(piece)Trick: Smelt Block$(0) will smelt a block in the world into its smelted version, provided that that smelted form's also a block.$(p)So Cobblestone can be smelted into Stone, and then into Smooth Stone, but a log won't smelt into Charcoal. 

#flow_control icon:textures/spell/trick_delay.png Flow Control
Flow Control is a somewhat complex subject. All the pieces here included allow a $(thing)Spell$(0) to function in wildly different ways. However, understanding how to properly use these pieces requires knowledge of the very internals of the spellcasting system-- have a read through $(l:basics/eval_order)this article$(/l) for more information.
With that info under your belt, let's start off with $(piece)Trick: Sleep$(0). This piece causes the $(thing)Spell$(0) from which it's cast to delay its execution for the number of ticks it receives. (A tick is a span of 0.05 seconds.) So if you wish to delay further processing of a $(thing)Spell$(0) by half a second, you would use 10 as the "Time" parameter. $(piece)Trick: Sleep$(0) does not add any $(thing)Projection$(0) to your $(thing)Spell$(0), but does cost $(thing)Potency$(0).
$(piece)Trick: Evaluate$(0) is a $(thing)Trick$(0) that does absolutely nothing.$(p)Yes, you heard that right. This $(thing)Trick$(0) does nothing. It doesn't add to any stats on your $(thing)Spell$(0), either.$(p)Its only practical use is to evaluate a value before a $(piece)Trick: Sleep$(0) executes, allowing you to, for example, get the place an entity was before the $(piece)Trick: Sleep$(0) triggered, for use later in the $(thing)Spell$(0).
$(piece)Trick: Die$(0), on the other hand, is a Flow Control piece in the proper sense of the term.$(p)It takes a Number parameter, and if that number's absolute value lies strictly below 1 (also exclusive), it fizzles the $(thing)Spell$(0) right then and there. Any other values passed to the $(thing)Trick$(0) will allow the $(thing)Spell$(0) to continue on as usual.$(p)This piece doesn't cost $(thing)Projection$(0).
A very simple way to put $(piece)Trick: Die$(0) to use is to couple it to $(piece)Selector: Sneak Status$(0), which conveniently returns 0 if the caster is sneaking and 1 if they're not.$(p)Why, it's almost as if they were made to be used together!
$(piece)Constant: Wrapper$(0) allows you to use pieces that return Numbers for $(thing)Tricks$(0) that would otherwise require Number Constants.$(p)As you should know by now, Number Constants fed to $(thing)Tricks$(0) are used to calculate a $(thing)Spell$(0)'s stats (including $(thing)Cost$(0)) before the $(thing)Spell$(0)it's ever cast.$(p)Since these Constants are required at compile-time, simple Numbers that get evaluated at execution-time are clearly unusable here.
$(piece)Constant: Wrapper$(0) gets around this by accepting two Numbers, a Constant and a non-Constant.$(p)The Constant passed to the piece will be the one used for $(thing)Spell$(0) compilation calculations; but the non-Constant number will be the one used when the $(thing)Spell$(0) is actually executed.$(p)The non-Constant Number's value will be capped at the value of the Constant during $(thing)Spell$(0) execution, to prevent tomfoolery.
The execution-time Number has its sign changed to the sign of the Number Constant, so that the signs of both numbers match. If the Constant Number is 0, $(piece)Constant: Wrapper$(0) always returns 0, regardless of input.


#block_conjuration icon:textures/spell/trick_conjure_block.png Block Conjuration
This group includes pieces that do exactly as advertised: they conjure blocks.$(p)$(piece)Trick: Conjure Block$(0) creates a Conjured Block, a semi-transparent solid block, at the given position. Conjured Blocks, if conjured with a "Time" parameter, can quietly break themselves after the specified time has elapsed.
If the "Time" parameter is used, it's specified in ticks (units of 0.05 seconds). Thus, if you want to make a block that disappears after half a second, set the "Time" parameter to 10 ticks.$(p)$(piece)Trick: Conjure Light$(0) conjures a light source instead, one that can't be collided against.
$(piece)Trick: Conjure Block Sequence$(0) functions much like $(piece)Trick: Place Block Sequence$(0), but creates Conjured Blocks instead. Both these pieces also include a "Time" parameter.$(p)Conjured Blocks are fragile, and will break instantly to any tool a player cares to swing at them.

#eidos_manipulation icon:textures/spell/trick_eidos_reversal.png Eidos Manpulation
Eidos $(thing)Tricks$(0) allow their caster to manipulate the space-time continuum in their favor.$(p)$(piece)Trick: Eidos Reversal$(0) causes its caster to retrace their steps in reverse, at double speed, for the amount of time (in seconds) specified.
Only one Eidos Reversal may be active at a time, and after a Reversal is cast, any subsequent Reversals can only reverse to the place where the last one ended. Sneaking will stop an ongoing Reversal.$(p)The other $(thing)Trick$(0) piece of the group, $(piece)Trick: Eidos Anchor$(0) creates an "anchor" for the caster.
After the specified amount of time (in seconds), the caster will be warped back to their anchor's location. Multiple executions of $(piece)Trick: Eidos Anchor$(0) can happen in quick succession, but only the last created anchor will activate.
Finally, $(piece)Selector: Eidos Changelog$(0) takes a single number parameter (let's call it n), and gives you the position in the n'th index of the Eidos Changelog starting from the end. In other words, it gives you a position vector to where you were n ticks ago.$(p)$(piece)Trick: Eidos Reversal$(0) takes you backwards in the changelog, wiping out any locations that occur "afterward." $(piece)Trick: Eidos Anchor$(0) does not modify the changelog. 

#detection_dynamics icon:textures/spell/trick_switch_target_slot.png Detection & Focus
This group includes two types of pieces, as the title says: detection, and focus. To understand this, the concept of Slot Focus must be introduced.
An already known example of Slot Focus is the family of Place Block style $(thing)Tricks$(0). These make use of the block directly to the right of your $(thing)CAD$(0). Slot Focus is the slot which $(thing)Tricks$(0) like these will use. It can be relative (to the position of your $(thing)CAD$(0)) or absolute, can only be in the hotbar and goes from 1 to 9.
By default, whenever a $(thing)Spell$(0) is cast, its value is "Relative 1", so it's 1 slot to the right of your $(thing)CAD$(0). If it was "Relative -1" it would be 1 slot to the left of your $(thing)CAD$(0). "Absolute 3" would be the third slot in your hotbar. It also loops around, so if you have your $(thing)CAD$(0) on your last slot and the value is "Relative 1", it'll be your first slot.
To set the focused slot, you can use $(piece)Trick: Switch Focus Slot$(0). This takes one of 2 parameters. Both are optional and mutually exclusive, and if you don't define any, it'll set the focus to the default of "Relative 1". If you choose to set the "Position" parameter, it'll set an Absolute value, whereas the "Shift" parameter will set a Relative value.
This allows you to, for example, build things with different blocks based on the circumstance. This $(thing)Trick$(0) only works for the current $(thing)Spell$(0) cast, and the focus will reset the next time a $(thing)Spell$(0) is cast (even if it's the same $(thing)Spell$(0)).$(p)The other two pieces in the group are set in the "detection" area.
First, $(piece)Selector: Item Presence$(0) takes an optional slot number (if not set it'll default to your Focused Slot), and returns the amount of items in that slot, 0 if it's empty, of course.
Lastly, $(piece)Selector: Block Presence$(0) takes a vector, to be used as coordinates in the world, and finds the block there, the value returned is 0 if there's no block or a replaceable block (like tall grass), 1 if it's a non-solid block and 2 if it's a solid block. 

#memory_management icon:textures/spell/trick_save_vector.png Memory Management
This group introduces the ability for a $(thing)Spell$(0) to store information persistently inside a $(thing)CAD$(0). A $(thing)CAD$(0) can save vectors to be retrieved in future $(thing)Spell$(0) executions. A $(thing)CAD$(0) can store one vector for every three $(item)Socket$(0) slots it has.
The number of vectors a $(thing)CAD$(0) can store is known as the number of $(thing)Memory Slots$(0) it has.$(p)This piece group includes two $(thing)Spell Pieces$(0), which can save and load vectors to and from a $(thing)CAD$(0)'s $(thing)Memory Slots$(0).$(p)$(piece)Trick: Save Vector$(0) saves a vector to a designated $(thing)Memory Slot$(0), whereas $(piece)Selector: Saved Vector$(0) retrieves the vector saved in the designated $(thing)Memory Slot$(0).
A $(thing)CAD$(0)'s $(thing)Memory Slots$(0) are numbered starting from 1, so a $(thing)CAD$(0) with 3 memory slots can save to slots 1, 2, and 3.$(p)Both $(thing)Tricks$(0) in this group add $(thing)Potency$(0) to $(thing)Spells$(0) they're used in equal to the number of the slot used.$(p)For example, saving to or loading from slot 2 costs two $(thing)Potency$(0).
$(piece)Trick: Save Vector$(0) has an imperfection: it "locks" the $(thing)Memory Slot$(0) it saves to.$(p)This prevents either of the two pieces from interacting with that same $(thing)Memory Slot$(0) later in the $(thing)Spell$(0).$(p)So if you need to load the value saved in a slot before you save something new to it, remember the rules of Flow Control to ensure the load happens before the save.

#secondary_operators icon:textures/spell/operator_square.png Secondary Operators
As its name implies, this group is composed of mathematical $(thing)Operators$(0) that aren't quite as important as the "primary" ones, like addition or subtraction. This group's just a mixed bag of all sorts of math or logic relates pieces that can be used to help with $(thing)Spell$(0) creation. We'll separate the pieces in two sets to make them easier to explain.
The first set is related to raising numbers to power, including pieces like $(piece)Operator: Square$(0), $(piece)Operator: Power$(0), $(piece)Operator: Square Root$(0) and even $(piece)Operator: Logarithm$(0). Most of these operate exactly how you'd expect them to.$(p)Note that $(piece)Operator: Logarithm$(0) takes an optional Base argument; if no base is passed in, it'll default to base 10.$(p)$(piece)Constant: e$(0) can also be used to get a natural logarithm.
The second set of $(thing)Operators$(0) are related to logic. They're pieces that do rounding (to an integer).$(p)$(piece)Operator: Ceiling$(0), $(piece)Operator: Floor$(0) and $(piece)Operator: Round$(0) round up, down, and to the closest integer, respectively.$(p)This group also includes $(piece)Operator: Min$(0) and $(piece)Operator: Max$(0). These get the smallest and largest, respectively, of their parameters.
__END__

##selectors icon:textures/spell/selector_caster.png Selectors & Misc.
#connectors icon:textures/spell/connector.png Connectors
$(piece)Connectors$(0) are perhaps some of the most important $(thing)Spell Pieces$(0), despite also being the simplest.$(p)They're essential for creating larger $(thing)Spells$(0), though, with their ability to, when connected, transfer information between opposite sides of the grid.
@PIECE (connector): A $(piece)Connector$(0) $(l)accepts$() one argument of any type and $(l)returns$() that same argument.$(p)Any piece that accesses its other three sides will get the same value the $(piece)Connector$(0) accepts.
A $(piece)Cross Connector$(0) 
__END__
connector_lines
connector
cross_connector

#Constants
constant_e
constant_number
constant_pi
constant_tau

#Constant Wrapper
constant_wrapper

#Error Suppressors
error_suppressor
error_catcher

#Simple Selectors
caster
focal_point

#Combat Selectors
attacker
attack_target
sucession_counter
damage_taken

#Tool Selectors
block_broken
block_side_broken

#Eidos Changelog
eidos_changelog

#Item Presence
item_presence

#Nearby Selectors
nearby_animals
nearby_charges
nearby_enemies
nearby_falling_blocks
nearby_glowing
nearby_items
nearby_living
nearby_players
nearby_projectiles
nearby_smeltables
nearby_vehicles

#Block Selectors
ruler_vector
saved_vector
block_presence

#Selectors And You
sneak_status
caster_battery
caster_energy

#Time Selectors
time
loopcast_index


##tricks icon:textures/spell/trick_explode.png Tricks


##operators icon:textures/spell/operator_sum.png Operators
