> For the complete documentation index, see [llms.txt](https://xeavin.gitbook.io/the-insurgents-forge/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xeavin.gitbook.io/the-insurgents-forge/home.md).

# Home

<figure><img src="/files/JcQez1vvfuCqHuMKdN98" alt=""><figcaption></figcaption></figure>

### Description

Every action (e.g. Cure) uses a formula which ultimately determines what happens to both the caster and target. This includes:

* Modifying stats such as hp, mp, mist, strength, etc.
* Adding or removing a status effect or augment.
* Adding an item to the player's inventory.
* When an action will miss, be countered, etc.
* and many many more.

A formula is the combination of one or more functions which are processed in a predetermined order.&#x20;

Each function does one specific task and is usually unique. For example, one function could check if the target is immune to fire while the other calculates the amount of health the target should lose.

However, these functions are all hardcoded in the executable and cannot be modified or even reordered.

### Features

This mod allows modifying existing formulas and adding entirely new ones to the game via Lua.

Every single formula and its functions can be modified to the tiniest detail.

There are 6 modules that provide the ground framework for this mod. This includes:

* **Formulas:** Specify which functions are executed and in what order.
* **Functions:** Contain a series of statements that perform a specific task.
* **Classes:** Simulate object oriented programming to help with creating easily readable and maintainable code in formula functions.
* **Helpers:** Similar to functions, but are only defined once and can then be reused in various formula functions to avoid having to rewrite the same block code more than once.
* **Assemblies:** Strings with a block of assembly code that can call in-game functions and more.
* **Middlewares:** Control which functions are always executed before and after every formula.

These modules allow the creation of entirely new formulas very easily. Afterwards, you can assign it to an action or equipment via [The Insurgent's Toolkit](https://www.nexusmods.com/finalfantasy12/mods/160) -> Battlepack Editor.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://xeavin.gitbook.io/the-insurgents-forge/home.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
